import{S as jx,i as Bx,s as zx,e as n,k as c,w as k,t as i,M as Jx,c as a,d as t,m as p,a as s,x as v,h as d,b as h,N as $x,G as e,g as _,y as T,q as w,o as M,B as F,v as qx,L as S}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ie}from"../../chunks/Tip-hf-doc-builder.js";import{D as q}from"../../chunks/Docstring-hf-doc-builder.js";import{C as G}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ae}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as R}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as oM}from"../../chunks/PipelineTag-hf-doc-builder.js";function Ex($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJhcnRDb25maWclMkMlMjBCYXJ0TW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQkFSVCUyMGZhY2Vib29rJTJGYmFydC1sYXJnZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBCYXJ0Q29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGZhY2Vib29rJTJGYmFydC1sYXJnZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQmFydE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function Cx($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJhcnRUb2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBCYXJ0VG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtYmFzZSUyMiklMEF0b2tlbml6ZXIoJTIySGVsbG8lMjB3b3JsZCUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEElMEF0b2tlbml6ZXIoJTIyJTIwSGVsbG8lMjB3b3JsZCUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BartTokenizer

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot; Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">0</span>, <span class="hljs-number">20920</span>, <span class="hljs-number">232</span>, <span class="hljs-number">2</span>]`}}),{c(){l=n("p"),y=i("be encoded differently whether it is at the beginning of the sentence (without space) or not:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function Zx($){let l,y,f,m,b,r,u,j;return{c(){l=n("p"),y=i("When used with "),f=n("code"),m=i("is_split_into_words=True"),b=i(", this tokenizer needs to be instantiated with "),r=n("code"),u=i("add_prefix_space=True"),j=i(".")},l(se){l=a(se,"P",{});var P=s(l);y=d(P,"When used with "),f=a(P,"CODE",{});var Z=s(f);m=d(Z,"is_split_into_words=True"),Z.forEach(t),b=d(P,", this tokenizer needs to be instantiated with "),r=a(P,"CODE",{});var re=s(r);u=d(re,"add_prefix_space=True"),re.forEach(t),j=d(P,"."),P.forEach(t)},m(se,P){_(se,l,P),e(l,y),e(l,f),e(f,m),e(l,b),e(l,r),e(r,u),e(l,j)},d(se){se&&t(l)}}}function Gx($){let l,y,f,m,b;return{c(){l=n("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(u,"CODE",{});var j=s(f);m=d(j,"Module"),j.forEach(t),b=d(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(r,u){_(r,l,u),e(l,y),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function Wx($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCYXJ0TW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGYmFydC1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmFydE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function Ax($){let l,y,f,m,b;return{c(){l=n("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(u,"CODE",{});var j=s(f);m=d(j,"Module"),j.forEach(t),b=d(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(r,u){_(r,l,u),e(l,y),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function Nx($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCYXJ0Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBCYXJ0Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtbGFyZ2UtY25uJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGYmFydC1sYXJnZS1jbm4lMjIpJTBBJTBBQVJUSUNMRV9UT19TVU1NQVJJWkUlMjAlM0QlMjAoJTBBJTIwJTIwJTIwJTIwJTIyUEclMjZFJTIwc3RhdGVkJTIwaXQlMjBzY2hlZHVsZWQlMjB0aGUlMjBibGFja291dHMlMjBpbiUyMHJlc3BvbnNlJTIwdG8lMjBmb3JlY2FzdHMlMjBmb3IlMjBoaWdoJTIwd2luZHMlMjAlMjIlMEElMjAlMjAlMjAlMjAlMjJhbWlkJTIwZHJ5JTIwY29uZGl0aW9ucy4lMjBUaGUlMjBhaW0lMjBpcyUyMHRvJTIwcmVkdWNlJTIwdGhlJTIwcmlzayUyMG9mJTIwd2lsZGZpcmVzLiUyME5lYXJseSUyMDgwMCUyMHRob3VzYW5kJTIwY3VzdG9tZXJzJTIwd2VyZSUyMCUyMiUwQSUyMCUyMCUyMCUyMCUyMnNjaGVkdWxlZCUyMHRvJTIwYmUlMjBhZmZlY3RlZCUyMGJ5JTIwdGhlJTIwc2h1dG9mZnMlMjB3aGljaCUyMHdlcmUlMjBleHBlY3RlZCUyMHRvJTIwbGFzdCUyMHRocm91Z2glMjBhdCUyMGxlYXN0JTIwbWlkZGF5JTIwdG9tb3Jyb3cuJTIyJTBBKSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglNUJBUlRJQ0xFX1RPX1NVTU1BUklaRSU1RCUyQyUyMG1heF9sZW5ndGglM0QxMDI0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEElMjMlMjBHZW5lcmF0ZSUyMFN1bW1hcnklMEFzdW1tYXJ5X2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCUyQyUyMG51bV9iZWFtcyUzRDIlMkMlMjBtaW5fbGVuZ3RoJTNEMCUyQyUyMG1heF9sZW5ndGglM0QyMCklMEF0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKHN1bW1hcnlfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUlMkMlMjBjbGVhbl91cF90b2tlbml6YXRpb25fc3BhY2VzJTNERmFsc2UpJTVCMCU1RA==",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"),y=i("Summarization example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Summarization example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function Rx($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCYXJ0Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBCYXJ0Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtYmFzZSUyMiklMEElMEFUWFQlMjAlM0QlMjAlMjJNeSUyMGZyaWVuZHMlMjBhcmUlMjAlM0NtYXNrJTNFJTIwYnV0JTIwdGhleSUyMGVhdCUyMHRvbyUyMG1hbnklMjBjYXJicy4lMjIlMEFpbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCVFhUJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEFsb2dpdHMlMjAlM0QlMjBtb2RlbChpbnB1dF9pZHMpLmxvZ2l0cyUwQSUwQW1hc2tlZF9pbmRleCUyMCUzRCUyMChpbnB1dF9pZHMlNUIwJTVEJTIwJTNEJTNEJTIwdG9rZW5pemVyLm1hc2tfdG9rZW5faWQpLm5vbnplcm8oKS5pdGVtKCklMEFwcm9icyUyMCUzRCUyMGxvZ2l0cyU1QjAlMkMlMjBtYXNrZWRfaW5kZXglNUQuc29mdG1heChkaW0lM0QwKSUwQXZhbHVlcyUyQyUyMHByZWRpY3Rpb25zJTIwJTNEJTIwcHJvYnMudG9wayg1KSUwQSUwQXRva2VuaXplci5kZWNvZGUocHJlZGljdGlvbnMpLnNwbGl0KCk=",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"),y=i("Mask filling example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Mask filling example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function Sx($){let l,y,f,m,b;return{c(){l=n("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(u,"CODE",{});var j=s(f);m=d(j,"Module"),j.forEach(t),b=d(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(r,u){_(r,l,u),e(l,y),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function Xx($){let l,y,f,m,b;return m=new G({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEJhcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydmFsaGFsbGElMkZiYXJ0LWxhcmdlLXNzdDIlMjIpJTBBbW9kZWwlMjAlM0QlMjBCYXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydmFsaGFsbGElMkZiYXJ0LWxhcmdlLXNzdDIlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwbG9naXRzLmFyZ21heCgpLml0ZW0oKSUwQW1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9jbGFzc19pZCU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMEJhcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ2YWxoYWxsYSUyRmJhcnQtbGFyZ2Utc3N0MiUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcyUwQXJvdW5kKGxvc3MuaXRlbSgpJTJDJTIwMik=",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"),y=i("Example of single-label classification:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example of single-label classification:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function Vx($){let l,y,f,m,b;return m=new G({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEJhcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydmFsaGFsbGElMkZiYXJ0LWxhcmdlLXNzdDIlMjIpJTBBbW9kZWwlMjAlM0QlMjBCYXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydmFsaGFsbGElMkZiYXJ0LWxhcmdlLXNzdDIlMjIlMkMlMjBwcm9ibGVtX3R5cGUlM0QlMjJtdWx0aV9sYWJlbF9jbGFzc2lmaWNhdGlvbiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJhbmdlKDAlMkMlMjBsb2dpdHMuc2hhcGUlNUItMSU1RCklNUJ0b3JjaC5zaWdtb2lkKGxvZ2l0cykuc3F1ZWV6ZShkaW0lM0QwKSUyMCUzRSUyMDAuNSU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMEJhcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJ2YWxoYWxsYSUyRmJhcnQtbGFyZ2Utc3N0MiUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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"),y=i("Example of multi-label classification:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example of multi-label classification:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function Px($){let l,y,f,m,b;return{c(){l=n("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(u,"CODE",{});var j=s(f);m=d(j,"Module"),j.forEach(t),b=d(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(r,u){_(r,l,u),e(l,y),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function Qx($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCYXJ0Rm9yUXVlc3Rpb25BbnN3ZXJpbmclMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnZhbGhhbGxhJTJGYmFydC1sYXJnZS1maW5ldHVuZWQtc3F1YWR2MSUyMiklMEFtb2RlbCUyMCUzRCUyMEJhcnRGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIydmFsaGFsbGElMkZiYXJ0LWxhcmdlLWZpbmV0dW5lZC1zcXVhZHYxJTIyKSUwQSUwQXF1ZXN0aW9uJTJDJTIwdGV4dCUyMCUzRCUyMCUyMldobyUyMHdhcyUyMEppbSUyMEhlbnNvbiUzRiUyMiUyQyUyMCUyMkppbSUyMEhlbnNvbiUyMHdhcyUyMGElMjBuaWNlJTIwcHVwcGV0JTIyJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHF1ZXN0aW9uJTJDJTIwdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0QlMjBvdXRwdXRzLnN0YXJ0X2xvZ2l0cy5hcmdtYXgoKSUwQWFuc3dlcl9lbmRfaW5kZXglMjAlM0QlMjBvdXRwdXRzLmVuZF9sb2dpdHMuYXJnbWF4KCklMEElMEFwcmVkaWN0X2Fuc3dlcl90b2tlbnMlMjAlM0QlMjBpbnB1dHMuaW5wdXRfaWRzJTVCMCUyQyUyMGFuc3dlcl9zdGFydF9pbmRleCUyMCUzQSUyMGFuc3dlcl9lbmRfaW5kZXglMjAlMkIlMjAxJTVEJTBBdG9rZW5pemVyLmRlY29kZShwcmVkaWN0X2Fuc3dlcl90b2tlbnMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklMEElMEElMjMlMjB0YXJnZXQlMjBpcyUyMCUyMm5pY2UlMjBwdXBwZXQlMjIlMEF0YXJnZXRfc3RhcnRfaW5kZXglMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCMTQlNUQpJTBBdGFyZ2V0X2VuZF9pbmRleCUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxNSU1RCklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBzdGFydF9wb3NpdGlvbnMlM0R0YXJnZXRfc3RhcnRfaW5kZXglMkMlMjBlbmRfcG9zaXRpb25zJTNEdGFyZ2V0X2VuZF9pbmRleCklMEFsb3NzJTIwJTNEJTIwb3V0cHV0cy5sb3NzJTBBcm91bmQobG9zcy5pdGVtKCklMkMlMjAyKQ==",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function Yx($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCYXJ0Rm9yQ2F1c2FsTE0lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMEJhcnRGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWJhc2UlMjIlMkMlMjBhZGRfY3Jvc3NfYXR0ZW50aW9uJTNERmFsc2UpJTBBYXNzZXJ0JTIwbW9kZWwuY29uZmlnLmlzX2RlY29kZXIlMkMlMjBmJTIyJTdCbW9kZWwuX19jbGFzc19fJTdEJTIwaGFzJTIwdG8lMjBiZSUyMGNvbmZpZ3VyZWQlMjBhcyUyMGElMjBkZWNvZGVyLiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlMEFleHBlY3RlZF9zaGFwZSUyMCUzRCUyMCU1QjElMkMlMjBpbnB1dHMuaW5wdXRfaWRzLnNoYXBlJTVCLTElNUQlMkMlMjBtb2RlbC5jb25maWcudm9jYWJfc2l6ZSU1RCUwQWxpc3QobG9naXRzLnNoYXBlKSUyMCUzRCUzRCUyMGV4cGVjdGVkX3NoYXBl",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function Lx($){let l,y,f,m,b,r,u,j,se,P,Z,re,ie,B,Ve,Y,Fe,it,D,de,qe,le,Pe,we,ce,Qe,Ze,W,be,Ee,K,E,C,Ye,ee,ye,Le,Q,Oe,He,U,xe,pe,Ge,te,L,De,Ke,X,et,he,Ce,$e,I,je,A,We,ke;return{c(){l=n("p"),y=i("TensorFlow models and layers in "),f=n("code"),m=i("transformers"),b=i(" accept two formats as input:"),r=c(),u=n("ul"),j=n("li"),se=i("having all inputs as keyword arguments (like PyTorch models), or"),P=c(),Z=n("li"),re=i("having all inputs as a list, tuple or dict in the first positional argument."),ie=c(),B=n("p"),Ve=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 `),Y=n("code"),Fe=i("model.fit()"),it=i(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=n("code"),de=i("model.fit()"),qe=i(` supports! If, however, you want to use the second
format outside of Keras methods like `),le=n("code"),Pe=i("fit()"),we=i(" and "),ce=n("code"),Qe=i("predict()"),Ze=i(`, such as when creating your own layers or models with
the Keras `),W=n("code"),be=i("Functional"),Ee=i(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),K=c(),E=n("ul"),C=n("li"),Ye=i("a single Tensor with "),ee=n("code"),ye=i("input_ids"),Le=i(" only and nothing else: "),Q=n("code"),Oe=i("model(input_ids)"),He=c(),U=n("li"),xe=i(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=n("code"),Ge=i("model([input_ids, attention_mask])"),te=i(" or "),L=n("code"),De=i("model([input_ids, attention_mask, token_type_ids])"),Ke=c(),X=n("li"),et=i(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),he=n("code"),Ce=i('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),$e=c(),I=n("p"),je=i(`Note that when creating models and layers with
`),A=n("a"),We=i("subclassing"),ke=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(x){l=a(x,"P",{});var z=s(l);y=d(z,"TensorFlow models and layers in "),f=a(z,"CODE",{});var wt=s(f);m=d(wt,"transformers"),wt.forEach(t),b=d(z," accept two formats as input:"),z.forEach(t),r=p(x),u=a(x,"UL",{});var Be=s(u);j=a(Be,"LI",{});var Ae=s(j);se=d(Ae,"having all inputs as keyword arguments (like PyTorch models), or"),Ae.forEach(t),P=p(Be),Z=a(Be,"LI",{});var dt=s(Z);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(x),B=a(x,"P",{});var J=s(B);Ve=d(J,`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 `),Y=a(J,"CODE",{});var Mt=s(Y);Fe=d(Mt,"model.fit()"),Mt.forEach(t),it=d(J,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=a(J,"CODE",{});var oe=s(D);de=d(oe,"model.fit()"),oe.forEach(t),qe=d(J,` supports! If, however, you want to use the second
format outside of Keras methods like `),le=a(J,"CODE",{});var lt=s(le);Pe=d(lt,"fit()"),lt.forEach(t),we=d(J," and "),ce=a(J,"CODE",{});var Ft=s(ce);Qe=d(Ft,"predict()"),Ft.forEach(t),Ze=d(J,`, such as when creating your own layers or models with
the Keras `),W=a(J,"CODE",{});var xt=s(W);be=d(xt,"Functional"),xt.forEach(t),Ee=d(J,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),J.forEach(t),K=p(x),E=a(x,"UL",{});var V=s(E);C=a(V,"LI",{});var ue=s(C);Ye=d(ue,"a single Tensor with "),ee=a(ue,"CODE",{});var $t=s(ee);ye=d($t,"input_ids"),$t.forEach(t),Le=d(ue," only and nothing else: "),Q=a(ue,"CODE",{});var ct=s(Q);Oe=d(ct,"model(input_ids)"),ct.forEach(t),ue.forEach(t),He=p(V),U=a(V,"LI",{});var me=s(U);xe=d(me,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=a(me,"CODE",{});var jt=s(pe);Ge=d(jt,"model([input_ids, attention_mask])"),jt.forEach(t),te=d(me," or "),L=a(me,"CODE",{});var pt=s(L);De=d(pt,"model([input_ids, attention_mask, token_type_ids])"),pt.forEach(t),me.forEach(t),Ke=p(V),X=a(V,"LI",{});var tt=s(X);et=d(tt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),he=a(tt,"CODE",{});var Bt=s(he);Ce=d(Bt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Bt.forEach(t),tt.forEach(t),V.forEach(t),$e=p(x),I=a(x,"P",{});var ve=s(I);je=d(ve,`Note that when creating models and layers with
`),A=a(ve,"A",{href:!0,rel:!0});var zt=s(A);We=d(zt,"subclassing"),zt.forEach(t),ke=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(){h(A,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(A,"rel","nofollow")},m(x,z){_(x,l,z),e(l,y),e(l,f),e(f,m),e(l,b),_(x,r,z),_(x,u,z),e(u,j),e(j,se),e(u,P),e(u,Z),e(Z,re),_(x,ie,z),_(x,B,z),e(B,Ve),e(B,Y),e(Y,Fe),e(B,it),e(B,D),e(D,de),e(B,qe),e(B,le),e(le,Pe),e(B,we),e(B,ce),e(ce,Qe),e(B,Ze),e(B,W),e(W,be),e(B,Ee),_(x,K,z),_(x,E,z),e(E,C),e(C,Ye),e(C,ee),e(ee,ye),e(C,Le),e(C,Q),e(Q,Oe),e(E,He),e(E,U),e(U,xe),e(U,pe),e(pe,Ge),e(U,te),e(U,L),e(L,De),e(E,Ke),e(E,X),e(X,et),e(X,he),e(he,Ce),_(x,$e,z),_(x,I,z),e(I,je),e(I,A),e(A,We),e(I,ke)},d(x){x&&t(l),x&&t(r),x&&t(u),x&&t(ie),x&&t(B),x&&t(K),x&&t(E),x&&t($e),x&&t(I)}}}function Ox($){let l,y,f,m,b;return{c(){l=n("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(u,"CODE",{});var j=s(f);m=d(j,"Module"),j.forEach(t),b=d(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(r,u){_(r,l,u),e(l,y),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function Hx($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkJhcnRNb2RlbCUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWxhcmdlJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZCYXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGYmFydC1sYXJnZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function Dx($){let l,y,f,m,b,r,u,j,se,P,Z,re,ie,B,Ve,Y,Fe,it,D,de,qe,le,Pe,we,ce,Qe,Ze,W,be,Ee,K,E,C,Ye,ee,ye,Le,Q,Oe,He,U,xe,pe,Ge,te,L,De,Ke,X,et,he,Ce,$e,I,je,A,We,ke;return{c(){l=n("p"),y=i("TensorFlow models and layers in "),f=n("code"),m=i("transformers"),b=i(" accept two formats as input:"),r=c(),u=n("ul"),j=n("li"),se=i("having all inputs as keyword arguments (like PyTorch models), or"),P=c(),Z=n("li"),re=i("having all inputs as a list, tuple or dict in the first positional argument."),ie=c(),B=n("p"),Ve=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 `),Y=n("code"),Fe=i("model.fit()"),it=i(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=n("code"),de=i("model.fit()"),qe=i(` supports! If, however, you want to use the second
format outside of Keras methods like `),le=n("code"),Pe=i("fit()"),we=i(" and "),ce=n("code"),Qe=i("predict()"),Ze=i(`, such as when creating your own layers or models with
the Keras `),W=n("code"),be=i("Functional"),Ee=i(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),K=c(),E=n("ul"),C=n("li"),Ye=i("a single Tensor with "),ee=n("code"),ye=i("input_ids"),Le=i(" only and nothing else: "),Q=n("code"),Oe=i("model(input_ids)"),He=c(),U=n("li"),xe=i(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=n("code"),Ge=i("model([input_ids, attention_mask])"),te=i(" or "),L=n("code"),De=i("model([input_ids, attention_mask, token_type_ids])"),Ke=c(),X=n("li"),et=i(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),he=n("code"),Ce=i('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),$e=c(),I=n("p"),je=i(`Note that when creating models and layers with
`),A=n("a"),We=i("subclassing"),ke=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(x){l=a(x,"P",{});var z=s(l);y=d(z,"TensorFlow models and layers in "),f=a(z,"CODE",{});var wt=s(f);m=d(wt,"transformers"),wt.forEach(t),b=d(z," accept two formats as input:"),z.forEach(t),r=p(x),u=a(x,"UL",{});var Be=s(u);j=a(Be,"LI",{});var Ae=s(j);se=d(Ae,"having all inputs as keyword arguments (like PyTorch models), or"),Ae.forEach(t),P=p(Be),Z=a(Be,"LI",{});var dt=s(Z);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(x),B=a(x,"P",{});var J=s(B);Ve=d(J,`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 `),Y=a(J,"CODE",{});var Mt=s(Y);Fe=d(Mt,"model.fit()"),Mt.forEach(t),it=d(J,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=a(J,"CODE",{});var oe=s(D);de=d(oe,"model.fit()"),oe.forEach(t),qe=d(J,` supports! If, however, you want to use the second
format outside of Keras methods like `),le=a(J,"CODE",{});var lt=s(le);Pe=d(lt,"fit()"),lt.forEach(t),we=d(J," and "),ce=a(J,"CODE",{});var Ft=s(ce);Qe=d(Ft,"predict()"),Ft.forEach(t),Ze=d(J,`, such as when creating your own layers or models with
the Keras `),W=a(J,"CODE",{});var xt=s(W);be=d(xt,"Functional"),xt.forEach(t),Ee=d(J,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),J.forEach(t),K=p(x),E=a(x,"UL",{});var V=s(E);C=a(V,"LI",{});var ue=s(C);Ye=d(ue,"a single Tensor with "),ee=a(ue,"CODE",{});var $t=s(ee);ye=d($t,"input_ids"),$t.forEach(t),Le=d(ue," only and nothing else: "),Q=a(ue,"CODE",{});var ct=s(Q);Oe=d(ct,"model(input_ids)"),ct.forEach(t),ue.forEach(t),He=p(V),U=a(V,"LI",{});var me=s(U);xe=d(me,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=a(me,"CODE",{});var jt=s(pe);Ge=d(jt,"model([input_ids, attention_mask])"),jt.forEach(t),te=d(me," or "),L=a(me,"CODE",{});var pt=s(L);De=d(pt,"model([input_ids, attention_mask, token_type_ids])"),pt.forEach(t),me.forEach(t),Ke=p(V),X=a(V,"LI",{});var tt=s(X);et=d(tt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),he=a(tt,"CODE",{});var Bt=s(he);Ce=d(Bt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Bt.forEach(t),tt.forEach(t),V.forEach(t),$e=p(x),I=a(x,"P",{});var ve=s(I);je=d(ve,`Note that when creating models and layers with
`),A=a(ve,"A",{href:!0,rel:!0});var zt=s(A);We=d(zt,"subclassing"),zt.forEach(t),ke=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(){h(A,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(A,"rel","nofollow")},m(x,z){_(x,l,z),e(l,y),e(l,f),e(f,m),e(l,b),_(x,r,z),_(x,u,z),e(u,j),e(j,se),e(u,P),e(u,Z),e(Z,re),_(x,ie,z),_(x,B,z),e(B,Ve),e(B,Y),e(Y,Fe),e(B,it),e(B,D),e(D,de),e(B,qe),e(B,le),e(le,Pe),e(B,we),e(B,ce),e(ce,Qe),e(B,Ze),e(B,W),e(W,be),e(B,Ee),_(x,K,z),_(x,E,z),e(E,C),e(C,Ye),e(C,ee),e(ee,ye),e(C,Le),e(C,Q),e(Q,Oe),e(E,He),e(E,U),e(U,xe),e(U,pe),e(pe,Ge),e(U,te),e(U,L),e(L,De),e(E,Ke),e(E,X),e(X,et),e(X,he),e(he,Ce),_(x,$e,z),_(x,I,z),e(I,je),e(I,A),e(A,We),e(I,ke)},d(x){x&&t(l),x&&t(r),x&&t(u),x&&t(ie),x&&t(B),x&&t(K),x&&t(E),x&&t($e),x&&t(I)}}}function Kx($){let l,y,f,m,b;return{c(){l=n("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(u,"CODE",{});var j=s(f);m=d(j,"Module"),j.forEach(t),b=d(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(r,u){_(r,l,u),e(l,y),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function e$($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkJhcnRGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEFtb2RlbCUyMCUzRCUyMFRGQmFydEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWxhcmdlJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGYmFydC1sYXJnZSUyMiklMEElMEFBUlRJQ0xFX1RPX1NVTU1BUklaRSUyMCUzRCUyMCUyMk15JTIwZnJpZW5kcyUyMGFyZSUyMGNvb2wlMjBidXQlMjB0aGV5JTIwZWF0JTIwdG9vJTIwbWFueSUyMGNhcmJzLiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglNUJBUlRJQ0xFX1RPX1NVTU1BUklaRSU1RCUyQyUyMG1heF9sZW5ndGglM0QxMDI0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEElMEElMjMlMjBHZW5lcmF0ZSUyMFN1bW1hcnklMEFzdW1tYXJ5X2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCUyQyUyMG51bV9iZWFtcyUzRDQlMkMlMjBtYXhfbGVuZ3RoJTNENSklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKHN1bW1hcnlfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUlMkMlMjBjbGVhbl91cF90b2tlbml6YXRpb25fc3BhY2VzJTNERmFsc2UpKQ==",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"),y=i("Summarization example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Summarization example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function t$($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkJhcnRGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtbGFyZ2UlMjIpJTBBVFhUJTIwJTNEJTIwJTIyTXklMjBmcmllbmRzJTIwYXJlJTIwJTNDbWFzayUzRSUyMGJ1dCUyMHRoZXklMjBlYXQlMjB0b28lMjBtYW55JTIwY2FyYnMuJTIyJTBBJTBBbW9kZWwlMjAlM0QlMjBURkJhcnRGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGYmFydC1sYXJnZSUyMiklMEFpbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCVFhUJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEFsb2dpdHMlMjAlM0QlMjBtb2RlbChpbnB1dF9pZHMpLmxvZ2l0cyUwQXByb2JzJTIwJTNEJTIwdGYubm4uc29mdG1heChsb2dpdHMlNUIwJTVEKSUwQSUyMyUyMHByb2JzJTVCNSU1RCUyMGlzJTIwYXNzb2NpYXRlZCUyMHdpdGglMjB0aGUlMjBtYXNrJTIwdG9rZW4=",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"),y=i("Mask filling example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Mask filling example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function o$($){let l,y,f,m,b,r,u,j,se,P,Z,re,ie,B,Ve,Y,Fe,it,D,de,qe,le,Pe,we,ce,Qe,Ze,W,be,Ee,K,E,C,Ye,ee,ye,Le,Q,Oe,He,U,xe,pe,Ge,te,L,De,Ke,X,et,he,Ce,$e,I,je,A,We,ke;return{c(){l=n("p"),y=i("TensorFlow models and layers in "),f=n("code"),m=i("transformers"),b=i(" accept two formats as input:"),r=c(),u=n("ul"),j=n("li"),se=i("having all inputs as keyword arguments (like PyTorch models), or"),P=c(),Z=n("li"),re=i("having all inputs as a list, tuple or dict in the first positional argument."),ie=c(),B=n("p"),Ve=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 `),Y=n("code"),Fe=i("model.fit()"),it=i(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=n("code"),de=i("model.fit()"),qe=i(` supports! If, however, you want to use the second
format outside of Keras methods like `),le=n("code"),Pe=i("fit()"),we=i(" and "),ce=n("code"),Qe=i("predict()"),Ze=i(`, such as when creating your own layers or models with
the Keras `),W=n("code"),be=i("Functional"),Ee=i(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),K=c(),E=n("ul"),C=n("li"),Ye=i("a single Tensor with "),ee=n("code"),ye=i("input_ids"),Le=i(" only and nothing else: "),Q=n("code"),Oe=i("model(input_ids)"),He=c(),U=n("li"),xe=i(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=n("code"),Ge=i("model([input_ids, attention_mask])"),te=i(" or "),L=n("code"),De=i("model([input_ids, attention_mask, token_type_ids])"),Ke=c(),X=n("li"),et=i(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),he=n("code"),Ce=i('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),$e=c(),I=n("p"),je=i(`Note that when creating models and layers with
`),A=n("a"),We=i("subclassing"),ke=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(x){l=a(x,"P",{});var z=s(l);y=d(z,"TensorFlow models and layers in "),f=a(z,"CODE",{});var wt=s(f);m=d(wt,"transformers"),wt.forEach(t),b=d(z," accept two formats as input:"),z.forEach(t),r=p(x),u=a(x,"UL",{});var Be=s(u);j=a(Be,"LI",{});var Ae=s(j);se=d(Ae,"having all inputs as keyword arguments (like PyTorch models), or"),Ae.forEach(t),P=p(Be),Z=a(Be,"LI",{});var dt=s(Z);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(x),B=a(x,"P",{});var J=s(B);Ve=d(J,`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 `),Y=a(J,"CODE",{});var Mt=s(Y);Fe=d(Mt,"model.fit()"),Mt.forEach(t),it=d(J,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=a(J,"CODE",{});var oe=s(D);de=d(oe,"model.fit()"),oe.forEach(t),qe=d(J,` supports! If, however, you want to use the second
format outside of Keras methods like `),le=a(J,"CODE",{});var lt=s(le);Pe=d(lt,"fit()"),lt.forEach(t),we=d(J," and "),ce=a(J,"CODE",{});var Ft=s(ce);Qe=d(Ft,"predict()"),Ft.forEach(t),Ze=d(J,`, such as when creating your own layers or models with
the Keras `),W=a(J,"CODE",{});var xt=s(W);be=d(xt,"Functional"),xt.forEach(t),Ee=d(J,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),J.forEach(t),K=p(x),E=a(x,"UL",{});var V=s(E);C=a(V,"LI",{});var ue=s(C);Ye=d(ue,"a single Tensor with "),ee=a(ue,"CODE",{});var $t=s(ee);ye=d($t,"input_ids"),$t.forEach(t),Le=d(ue," only and nothing else: "),Q=a(ue,"CODE",{});var ct=s(Q);Oe=d(ct,"model(input_ids)"),ct.forEach(t),ue.forEach(t),He=p(V),U=a(V,"LI",{});var me=s(U);xe=d(me,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=a(me,"CODE",{});var jt=s(pe);Ge=d(jt,"model([input_ids, attention_mask])"),jt.forEach(t),te=d(me," or "),L=a(me,"CODE",{});var pt=s(L);De=d(pt,"model([input_ids, attention_mask, token_type_ids])"),pt.forEach(t),me.forEach(t),Ke=p(V),X=a(V,"LI",{});var tt=s(X);et=d(tt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),he=a(tt,"CODE",{});var Bt=s(he);Ce=d(Bt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Bt.forEach(t),tt.forEach(t),V.forEach(t),$e=p(x),I=a(x,"P",{});var ve=s(I);je=d(ve,`Note that when creating models and layers with
`),A=a(ve,"A",{href:!0,rel:!0});var zt=s(A);We=d(zt,"subclassing"),zt.forEach(t),ke=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(){h(A,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(A,"rel","nofollow")},m(x,z){_(x,l,z),e(l,y),e(l,f),e(f,m),e(l,b),_(x,r,z),_(x,u,z),e(u,j),e(j,se),e(u,P),e(u,Z),e(Z,re),_(x,ie,z),_(x,B,z),e(B,Ve),e(B,Y),e(Y,Fe),e(B,it),e(B,D),e(D,de),e(B,qe),e(B,le),e(le,Pe),e(B,we),e(B,ce),e(ce,Qe),e(B,Ze),e(B,W),e(W,be),e(B,Ee),_(x,K,z),_(x,E,z),e(E,C),e(C,Ye),e(C,ee),e(ee,ye),e(C,Le),e(C,Q),e(Q,Oe),e(E,He),e(E,U),e(U,xe),e(U,pe),e(pe,Ge),e(U,te),e(U,L),e(L,De),e(E,Ke),e(E,X),e(X,et),e(X,he),e(he,Ce),_(x,$e,z),_(x,I,z),e(I,je),e(I,A),e(A,We),e(I,ke)},d(x){x&&t(l),x&&t(r),x&&t(u),x&&t(ie),x&&t(B),x&&t(K),x&&t(E),x&&t($e),x&&t(I)}}}function n$($){let l,y,f,m,b;return{c(){l=n("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(u,"CODE",{});var j=s(f);m=d(j,"Module"),j.forEach(t),b=d(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(r,u){_(r,l,u),e(l,y),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function a$($){let l,y,f,m,b;return{c(){l=n("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(u,"CODE",{});var j=s(f);m=d(j,"Module"),j.forEach(t),b=d(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(r,u){_(r,l,u),e(l,y),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function s$($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4QmFydE1vZGVsJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBGbGF4QmFydE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIyamF4JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function r$($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4QmFydEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsJTIwJTNEJTIwRmxheEJhcnRGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGYmFydC1sYXJnZS1jbm4lMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWxhcmdlLWNubiUyMiklMEElMEF0ZXh0JTIwJTNEJTIwJTIyTXklMjBmcmllbmRzJTIwYXJlJTIwY29vbCUyMGJ1dCUyMHRoZXklMjBlYXQlMjB0b28lMjBtYW55JTIwY2FyYnMuJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjBtYXhfbGVuZ3RoJTNEMTAyNCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIyamF4JTIyKSUwQWVuY29kZXJfb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmVuY29kZSgqKmlucHV0cyk=",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function i$($){let l,y,f,m,b;return m=new G({props:{code:"aW1wb3J0JTIwamF4Lm51bXB5JTIwYXMlMjBqbnAlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEZsYXhCYXJ0Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBGbGF4QmFydEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWxhcmdlLWNubiUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtbGFyZ2UtY25uJTIyKSUwQSUwQXRleHQlMjAlM0QlMjAlMjJNeSUyMGZyaWVuZHMlMjBhcmUlMjBjb29sJTIwYnV0JTIwdGhleSUyMGVhdCUyMHRvbyUyMG1hbnklMjBjYXJicy4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIodGV4dCUyQyUyMG1heF9sZW5ndGglM0QxMDI0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJqYXglMjIpJTBBZW5jb2Rlcl9vdXRwdXRzJTIwJTNEJTIwbW9kZWwuZW5jb2RlKCoqaW5wdXRzKSUwQSUwQWRlY29kZXJfc3RhcnRfdG9rZW5faWQlMjAlM0QlMjBtb2RlbC5jb25maWcuZGVjb2Rlcl9zdGFydF90b2tlbl9pZCUwQWRlY29kZXJfaW5wdXRfaWRzJTIwJTNEJTIwam5wLm9uZXMoKGlucHV0cy5pbnB1dF9pZHMuc2hhcGUlNUIwJTVEJTJDJTIwMSklMkMlMjBkdHlwZSUzRCUyMmk0JTIyKSUyMColMjBkZWNvZGVyX3N0YXJ0X3Rva2VuX2lkJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmRlY29kZShkZWNvZGVyX2lucHV0X2lkcyUyQyUyMGVuY29kZXJfb3V0cHV0cyklMEFsYXN0X2RlY29kZXJfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function d$($){let l,y,f,m,b;return{c(){l=n("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(u,"CODE",{});var j=s(f);m=d(j,"Module"),j.forEach(t),b=d(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(r,u){_(r,l,u),e(l,y),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function l$($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4QmFydEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsJTIwJTNEJTIwRmxheEJhcnRGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGYmFydC1sYXJnZS1jbm4lMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWxhcmdlLWNubiUyMiklMEElMEFBUlRJQ0xFX1RPX1NVTU1BUklaRSUyMCUzRCUyMCUyMk15JTIwZnJpZW5kcyUyMGFyZSUyMGNvb2wlMjBidXQlMjB0aGV5JTIwZWF0JTIwdG9vJTIwbWFueSUyMGNhcmJzLiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglNUJBUlRJQ0xFX1RPX1NVTU1BUklaRSU1RCUyQyUyMG1heF9sZW5ndGglM0QxMDI0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEElMEElMjMlMjBHZW5lcmF0ZSUyMFN1bW1hcnklMEFzdW1tYXJ5X2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCkuc2VxdWVuY2VzJTBBcHJpbnQodG9rZW5pemVyLmJhdGNoX2RlY29kZShzdW1tYXJ5X2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlJTJDJTIwY2xlYW5fdXBfdG9rZW5pemF0aW9uX3NwYWNlcyUzREZhbHNlKSk=",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"),y=i("Summarization example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Summarization example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function c$($){let l,y,f,m,b;return m=new G({props:{code:"aW1wb3J0JTIwamF4JTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4QmFydEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsJTIwJTNEJTIwRmxheEJhcnRGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGYmFydC1sYXJnZSUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtbGFyZ2UlMjIpJTBBJTBBVFhUJTIwJTNEJTIwJTIyTXklMjBmcmllbmRzJTIwYXJlJTIwJTNDbWFzayUzRSUyMGJ1dCUyMHRoZXklMjBlYXQlMjB0b28lMjBtYW55JTIwY2FyYnMuJTIyJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QlRYVCU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIyamF4JTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RCUwQSUwQWxvZ2l0cyUyMCUzRCUyMG1vZGVsKGlucHV0X2lkcykubG9naXRzJTBBbWFza2VkX2luZGV4JTIwJTNEJTIwKGlucHV0X2lkcyU1QjAlNUQlMjAlM0QlM0QlMjB0b2tlbml6ZXIubWFza190b2tlbl9pZCkubm9uemVybygpJTVCMCU1RC5pdGVtKCklMEFwcm9icyUyMCUzRCUyMGpheC5ubi5zb2Z0bWF4KGxvZ2l0cyU1QjAlMkMlMjBtYXNrZWRfaW5kZXglNUQlMkMlMjBheGlzJTNEMCklMEF2YWx1ZXMlMkMlMjBwcmVkaWN0aW9ucyUyMCUzRCUyMGpheC5sYXgudG9wX2socHJvYnMlMkMlMjBrJTNEMSklMEElMEF0b2tlbml6ZXIuZGVjb2RlKHByZWRpY3Rpb25zKS5zcGxpdCgp",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"),y=i("Mask filling example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Mask filling example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function p$($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4QmFydEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsJTIwJTNEJTIwRmxheEJhcnRGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGYmFydC1sYXJnZS1jbm4lMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWxhcmdlLWNubiUyMiklMEElMEF0ZXh0JTIwJTNEJTIwJTIyTXklMjBmcmllbmRzJTIwYXJlJTIwY29vbCUyMGJ1dCUyMHRoZXklMjBlYXQlMjB0b28lMjBtYW55JTIwY2FyYnMuJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjBtYXhfbGVuZ3RoJTNEMTAyNCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIyamF4JTIyKSUwQWVuY29kZXJfb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmVuY29kZSgqKmlucHV0cyk=",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function h$($){let l,y,f,m,b;return m=new G({props:{code:"aW1wb3J0JTIwamF4Lm51bXB5JTIwYXMlMjBqbnAlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEZsYXhCYXJ0Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBGbGF4QmFydEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWxhcmdlLWNubiUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtbGFyZ2UtY25uJTIyKSUwQSUwQXRleHQlMjAlM0QlMjAlMjJNeSUyMGZyaWVuZHMlMjBhcmUlMjBjb29sJTIwYnV0JTIwdGhleSUyMGVhdCUyMHRvbyUyMG1hbnklMjBjYXJicy4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIodGV4dCUyQyUyMG1heF9sZW5ndGglM0QxMDI0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJqYXglMjIpJTBBZW5jb2Rlcl9vdXRwdXRzJTIwJTNEJTIwbW9kZWwuZW5jb2RlKCoqaW5wdXRzKSUwQSUwQWRlY29kZXJfc3RhcnRfdG9rZW5faWQlMjAlM0QlMjBtb2RlbC5jb25maWcuZGVjb2Rlcl9zdGFydF90b2tlbl9pZCUwQWRlY29kZXJfaW5wdXRfaWRzJTIwJTNEJTIwam5wLm9uZXMoKGlucHV0cy5pbnB1dF9pZHMuc2hhcGUlNUIwJTVEJTJDJTIwMSklMkMlMjBkdHlwZSUzRCUyMmk0JTIyKSUyMColMjBkZWNvZGVyX3N0YXJ0X3Rva2VuX2lkJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmRlY29kZShkZWNvZGVyX2lucHV0X2lkcyUyQyUyMGVuY29kZXJfb3V0cHV0cyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function u$($){let l,y,f,m,b;return{c(){l=n("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(u,"CODE",{});var j=s(f);m=d(j,"Module"),j.forEach(t),b=d(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(r,u){_(r,l,u),e(l,y),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function m$($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4QmFydEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMEZsYXhCYXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWJhc2UlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMmpheCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHM=",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function f$($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4QmFydEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsJTIwJTNEJTIwRmxheEJhcnRGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGYmFydC1sYXJnZS1jbm4lMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWxhcmdlLWNubiUyMiklMEElMEF0ZXh0JTIwJTNEJTIwJTIyTXklMjBmcmllbmRzJTIwYXJlJTIwY29vbCUyMGJ1dCUyMHRoZXklMjBlYXQlMjB0b28lMjBtYW55JTIwY2FyYnMuJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjBtYXhfbGVuZ3RoJTNEMTAyNCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIyamF4JTIyKSUwQWVuY29kZXJfb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmVuY29kZSgqKmlucHV0cyk=",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function g$($){let l,y,f,m,b;return m=new G({props:{code:"aW1wb3J0JTIwamF4Lm51bXB5JTIwYXMlMjBqbnAlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEZsYXhCYXJ0Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBGbGF4QmFydEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWxhcmdlLWNubiUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtbGFyZ2UtY25uJTIyKSUwQSUwQXRleHQlMjAlM0QlMjAlMjJNeSUyMGZyaWVuZHMlMjBhcmUlMjBjb29sJTIwYnV0JTIwdGhleSUyMGVhdCUyMHRvbyUyMG1hbnklMjBjYXJicy4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIodGV4dCUyQyUyMG1heF9sZW5ndGglM0QxMDI0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJqYXglMjIpJTBBZW5jb2Rlcl9vdXRwdXRzJTIwJTNEJTIwbW9kZWwuZW5jb2RlKCoqaW5wdXRzKSUwQSUwQWRlY29kZXJfc3RhcnRfdG9rZW5faWQlMjAlM0QlMjBtb2RlbC5jb25maWcuZGVjb2Rlcl9zdGFydF90b2tlbl9pZCUwQWRlY29kZXJfaW5wdXRfaWRzJTIwJTNEJTIwam5wLm9uZXMoKGlucHV0cy5pbnB1dF9pZHMuc2hhcGUlNUIwJTVEJTJDJTIwMSklMkMlMjBkdHlwZSUzRCUyMmk0JTIyKSUyMColMjBkZWNvZGVyX3N0YXJ0X3Rva2VuX2lkJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmRlY29kZShkZWNvZGVyX2lucHV0X2lkcyUyQyUyMGVuY29kZXJfb3V0cHV0cyklMEFsYXN0X2RlY29kZXJfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function _$($){let l,y,f,m,b;return{c(){l=n("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(u,"CODE",{});var j=s(f);m=d(j,"Module"),j.forEach(t),b=d(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(r,u){_(r,l,u),e(l,y),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function b$($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4QmFydEZvclF1ZXN0aW9uQW5zd2VyaW5nJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBGbGF4QmFydEZvclF1ZXN0aW9uQW5zd2VyaW5nLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtYmFzZSUyMiklMEElMEFxdWVzdGlvbiUyQyUyMHRleHQlMjAlM0QlMjAlMjJXaG8lMjB3YXMlMjBKaW0lMjBIZW5zb24lM0YlMjIlMkMlMjAlMjJKaW0lMjBIZW5zb24lMjB3YXMlMjBhJTIwbmljZSUyMHB1cHBldCUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihxdWVzdGlvbiUyQyUyMHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMmpheCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBc3RhcnRfc2NvcmVzJTIwJTNEJTIwb3V0cHV0cy5zdGFydF9sb2dpdHMlMEFlbmRfc2NvcmVzJTIwJTNEJTIwb3V0cHV0cy5lbmRfbG9naXRz",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function y$($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4QmFydEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsJTIwJTNEJTIwRmxheEJhcnRGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGYmFydC1sYXJnZS1jbm4lMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWxhcmdlLWNubiUyMiklMEElMEF0ZXh0JTIwJTNEJTIwJTIyTXklMjBmcmllbmRzJTIwYXJlJTIwY29vbCUyMGJ1dCUyMHRoZXklMjBlYXQlMjB0b28lMjBtYW55JTIwY2FyYnMuJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjBtYXhfbGVuZ3RoJTNEMTAyNCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIyamF4JTIyKSUwQWVuY29kZXJfb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmVuY29kZSgqKmlucHV0cyk=",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function k$($){let l,y,f,m,b;return m=new G({props:{code:"aW1wb3J0JTIwamF4Lm51bXB5JTIwYXMlMjBqbnAlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEZsYXhCYXJ0Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBGbGF4QmFydEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWxhcmdlLWNubiUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtbGFyZ2UtY25uJTIyKSUwQSUwQXRleHQlMjAlM0QlMjAlMjJNeSUyMGZyaWVuZHMlMjBhcmUlMjBjb29sJTIwYnV0JTIwdGhleSUyMGVhdCUyMHRvbyUyMG1hbnklMjBjYXJicy4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIodGV4dCUyQyUyMG1heF9sZW5ndGglM0QxMDI0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJqYXglMjIpJTBBZW5jb2Rlcl9vdXRwdXRzJTIwJTNEJTIwbW9kZWwuZW5jb2RlKCoqaW5wdXRzKSUwQSUwQWRlY29kZXJfc3RhcnRfdG9rZW5faWQlMjAlM0QlMjBtb2RlbC5jb25maWcuZGVjb2Rlcl9zdGFydF90b2tlbl9pZCUwQWRlY29kZXJfaW5wdXRfaWRzJTIwJTNEJTIwam5wLm9uZXMoKGlucHV0cy5pbnB1dF9pZHMuc2hhcGUlNUIwJTVEJTJDJTIwMSklMkMlMjBkdHlwZSUzRCUyMmk0JTIyKSUyMColMjBkZWNvZGVyX3N0YXJ0X3Rva2VuX2lkJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmRlY29kZShkZWNvZGVyX2lucHV0X2lkcyUyQyUyMGVuY29kZXJfb3V0cHV0cyklMEFsYXN0X2RlY29kZXJfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function v$($){let l,y,f,m,b;return{c(){l=n("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(u,"CODE",{});var j=s(f);m=d(j,"Module"),j.forEach(t),b=d(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(r,u){_(r,l,u),e(l,y),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function T$($){let l,y,f,m,b;return m=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4QmFydEZvckNhdXNhbExNJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZiYXJ0LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBGbGF4QmFydEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQSUyMyUyMHJldHJpZXZlJTIwbG9ndHMlMjBmb3IlMjBuZXh0JTIwdG9rZW4lMEFuZXh0X3Rva2VuX2xvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTVCJTNBJTJDJTIwLTElNUQ=",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"),y=i("Example:"),f=c(),k(m.$$.fragment)},l(r){l=a(r,"P",{});var u=s(l);y=d(u,"Example:"),u.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,u){_(r,l,u),e(l,y),_(r,f,u),T(m,r,u),b=!0},p:S,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){M(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),F(m,r)}}}function w$($){let l,y,f,m,b,r,u,j,se,P,Z,re,ie,B,Ve,Y,Fe,it,D,de,qe,le,Pe,we,ce,Qe,Ze,W,be,Ee,K,E,C,Ye,ee,ye,Le,Q,Oe,He,U,xe,pe,Ge,te,L,De,Ke,X,et,he,Ce,$e,I,je,A,We,ke,x,z,wt,Be,Ae,dt,J,Mt,oe,lt,Ft,xt,V,ue,$t,ct,me,jt,pt,tt,Bt,ve,zt,Mh,Yt,Im,Ha,Zm,Gm,Da,Wm,Am,Fh,yo,dn,Ul,Ka,Nm,Il,Rm,xh,Lt,es,Sm,ts,Xm,Vm,Pm,At,Qm,fd,Ym,Lm,Zl,Om,Hm,os,Dm,Km,ef,ln,ns,tf,of,as,nf,af,$h,ko,cn,Gl,ss,sf,Wl,rf,jh,ht,Nt,df,Al,lf,cf,gd,pf,hf,_d,uf,mf,ff,vo,gf,bd,_f,bf,Nl,yf,kf,vf,To,Tf,Rl,wf,Mf,Sl,Ff,xf,$f,yd,kd,jf,Bf,zf,wo,Jf,Xl,qf,Ef,Vl,Cf,Uf,Bh,Mo,pn,Pl,rs,If,Ql,Zf,zh,Ot,Gf,Yl,Wf,Af,Ll,Nf,Rf,Jh,is,qh,Fo,hn,Ol,ds,Sf,Hl,Xf,Eh,vd,Vf,Ch,ls,Uh,Te,cs,Pf,ps,Qf,Yf,Lf,hs,Of,us,Hf,Df,Kf,ms,eg,fs,tg,og,ng,Ht,Td,ag,sg,gs,rg,ig,_s,dg,lg,cg,Dt,wd,pg,hg,bs,ug,mg,ys,fg,gg,_g,un,Md,bg,yg,ks,kg,vg,Tg,Fd,vs,wg,Mg,Fg,Dl,xd,xg,Ih,Ts,Zh,ut,Kt,$d,$g,jg,ws,Bg,zg,Ms,Jg,qg,Eg,eo,jd,Cg,Ug,Fs,Ig,Zg,xs,Gg,Wg,Ag,to,Bd,Ng,Rg,$s,Sg,Xg,js,Vg,Pg,Qg,zd,Bs,Yg,Lg,Og,Kl,Jd,Hg,Gh,zs,Wh,Jt,Js,Dg,qs,Kg,e_,t_,oo,qd,o_,n_,Es,a_,s_,Cs,r_,i_,d_,no,Ed,l_,c_,Us,p_,h_,Is,u_,m_,f_,ec,Cd,g_,Ah,Ud,__,Nh,ao,tc,Id,b_,y_,oc,Zd,k_,v_,nc,Gd,T_,Rh,xo,mn,ac,Zs,w_,sc,M_,Sh,yt,Gs,F_,$o,x_,Wd,$_,j_,Ws,B_,z_,J_,jo,q_,Ad,E_,C_,Nd,U_,I_,Z_,fn,Xh,Bo,gn,rc,As,G_,ic,W_,Vh,N,Ns,A_,dc,N_,R_,lc,S_,X_,_n,V_,Rs,P_,cc,Q_,Y_,L_,bn,O_,Ss,H_,Rd,D_,K_,eb,so,Xs,tb,pc,ob,nb,Vs,Sd,ab,hc,sb,rb,Xd,ib,uc,db,lb,yn,Ps,cb,mc,pb,hb,kn,Qs,ub,fc,mb,fb,vn,Ys,gb,Ls,_b,gc,bb,yb,Ph,zo,Tn,_c,Os,kb,bc,vb,Qh,fe,Hs,Tb,Ds,wb,yc,Mb,Fb,xb,kc,$b,jb,wn,Bb,Ks,zb,vc,Jb,qb,Eb,Mn,Cb,er,Ub,Vd,Ib,Zb,Gb,Fn,tr,Wb,Tc,Ab,Yh,Jo,xn,wc,or,Nb,Mc,Rb,Lh,kt,nr,Sb,ar,Xb,Pd,Vb,Pb,Qb,sr,Yb,rr,Lb,Ob,Hb,qt,ir,Db,qo,Kb,Qd,ey,ty,Fc,oy,ny,ay,$n,sy,jn,Oh,Eo,Bn,xc,dr,ry,$c,iy,Hh,vt,lr,dy,cr,ly,Yd,cy,py,hy,pr,uy,hr,my,fy,gy,mt,ur,_y,Co,by,Ld,yy,ky,jc,vy,Ty,wy,zn,My,Jn,Fy,qn,Dh,Uo,En,Bc,mr,xy,zc,$y,Kh,ot,fr,jy,Jc,By,zy,gr,Jy,Od,qy,Ey,Cy,_r,Uy,br,Iy,Zy,Gy,ft,yr,Wy,Io,Ay,Hd,Ny,Ry,qc,Sy,Xy,Vy,Cn,Py,Un,Qy,In,eu,Zo,Zn,Ec,kr,Yy,Cc,Ly,tu,nt,vr,Oy,Go,Hy,Uc,Dy,Ky,Ic,ek,tk,ok,Tr,nk,Dd,ak,sk,rk,wr,ik,Mr,dk,lk,ck,Et,Fr,pk,Wo,hk,Kd,uk,mk,Zc,fk,gk,_k,Gn,bk,Wn,ou,Ao,An,Gc,xr,yk,Wc,kk,nu,at,$r,vk,Ac,Tk,wk,jr,Mk,el,Fk,xk,$k,Br,jk,zr,Bk,zk,Jk,Nn,Jr,qk,Rn,au,No,Sn,Nc,qr,Ek,Rc,Ck,su,st,Er,Uk,Cr,Ik,tl,Zk,Gk,Wk,Ur,Ak,Ir,Nk,Rk,Sk,Xn,Xk,Ct,Zr,Vk,Ro,Pk,ol,Qk,Yk,Sc,Lk,Ok,Hk,Vn,Dk,Pn,ru,So,Qn,Xc,Gr,Kk,Vc,ev,iu,rt,Wr,tv,Ar,ov,nl,nv,av,sv,Nr,rv,Rr,iv,dv,lv,Yn,cv,gt,Sr,pv,Xo,hv,al,uv,mv,Pc,fv,gv,_v,Ln,bv,On,yv,Hn,du,Vo,Dn,Qc,Xr,kv,Yc,vv,lu,Ue,Vr,Tv,Lc,wv,Mv,Pr,Fv,sl,xv,$v,jv,Qr,Bv,Yr,zv,Jv,qv,Kn,Ev,ro,Lr,Cv,Po,Uv,rl,Iv,Zv,Oc,Gv,Wv,Av,ea,cu,Qo,ta,Hc,Or,Nv,Dc,Rv,pu,ge,Hr,Sv,Dr,Xv,il,Vv,Pv,Qv,Kr,Yv,ei,Lv,Ov,Hv,Kc,Dv,Kv,Rt,ep,ti,eT,tT,tp,oi,oT,nT,op,ni,aT,sT,np,ai,rT,iT,Ut,si,dT,Yo,lT,ap,cT,pT,sp,hT,uT,mT,oa,fT,na,gT,aa,ri,_T,sa,bT,ra,ii,yT,ia,hu,Lo,da,rp,di,kT,ip,vT,uu,_e,li,TT,ci,wT,dl,MT,FT,xT,pi,$T,hi,jT,BT,zT,dp,JT,qT,St,lp,ui,ET,CT,cp,mi,UT,IT,pp,fi,ZT,GT,hp,gi,WT,AT,_t,_i,NT,Oo,RT,up,ST,XT,mp,VT,PT,QT,la,YT,ca,LT,pa,OT,ha,bi,HT,ua,DT,ma,yi,KT,fa,mu,Ho,ga,fp,ki,ew,gp,tw,fu,O,vi,ow,_p,nw,aw,Ti,sw,ll,rw,iw,dw,wi,lw,Mi,cw,pw,hw,bp,uw,mw,Xt,yp,Fi,fw,gw,kp,xi,_w,bw,vp,$i,yw,kw,Tp,ji,vw,Tw,It,Bi,ww,Do,Mw,wp,Fw,xw,Mp,$w,jw,Bw,_a,zw,ba,Jw,ya,zi,qw,ka,Ew,va,Ji,Cw,Ta,gu,Ko,wa,Fp,qi,Uw,xp,Iw,_u,H,Ei,Zw,en,Gw,$p,Ww,Aw,jp,Nw,Rw,Sw,Ci,Xw,cl,Vw,Pw,Qw,Ui,Yw,Ii,Lw,Ow,Hw,Bp,Dw,Kw,Vt,zp,Zi,e2,t2,Jp,Gi,o2,n2,qp,Wi,a2,s2,Ep,Ai,r2,i2,Zt,Ni,d2,tn,l2,Cp,c2,p2,Up,h2,u2,m2,Ma,f2,Fa,g2,xa,Ri,_2,$a,b2,ja,Si,y2,Ba,bu,on,za,Ip,Xi,k2,Zp,v2,yu,Me,Vi,T2,Gp,w2,M2,Pi,F2,pl,x2,$2,j2,Qi,B2,Yi,z2,J2,q2,Wp,E2,C2,Pt,Ap,Li,U2,I2,Np,Oi,Z2,G2,Rp,Hi,W2,A2,Sp,Di,N2,R2,Gt,Ki,S2,nn,X2,Xp,V2,P2,Vp,Q2,Y2,L2,Ja,O2,qa,ku;return r=new ae({}),K=new ae({}),Ka=new ae({}),ss=new ae({}),rs=new ae({}),is=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJhcnRGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMkMlMjBCYXJ0VG9rZW5pemVyJTBBJTBBbW9kZWwlMjAlM0QlMjBCYXJ0Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtbGFyZ2UlMjIlMkMlMjBmb3JjZWRfYm9zX3Rva2VuX2lkJTNEMCklMEF0b2slMjAlM0QlMjBCYXJ0VG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJhcnQtbGFyZ2UlMjIpJTBBZXhhbXBsZV9lbmdsaXNoX3BocmFzZSUyMCUzRCUyMCUyMlVOJTIwQ2hpZWYlMjBTYXlzJTIwVGhlcmUlMjBJcyUyME5vJTIwJTNDbWFzayUzRSUyMGluJTIwU3lyaWElMjIlMEFiYXRjaCUyMCUzRCUyMHRvayhleGFtcGxlX2VuZ2xpc2hfcGhyYXNlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFnZW5lcmF0ZWRfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoYmF0Y2glNUIlMjJpbnB1dF9pZHMlMjIlNUQpJTBBYXNzZXJ0JTIwdG9rLmJhdGNoX2RlY29kZShnZW5lcmF0ZWRfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTIwJTNEJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIyVU4lMjBDaGllZiUyMFNheXMlMjBUaGVyZSUyMElzJTIwTm8lMjBQbGFuJTIwdG8lMjBTdG9wJTIwQ2hlbWljYWwlMjBXZWFwb25zJTIwaW4lMjBTeXJpYSUyMiUwQSU1RA==",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 oM({props:{pipeline:"summarization"}}),Ts=new oM({props:{pipeline:"fill-mask"}}),zs=new oM({props:{pipeline:"translation"}}),Zs=new ae({}),Gs=new q({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.32.0/en/model_doc/bart#transformers.BartModel">BartModel</a> or <a href="/docs/transformers/v4.32.0/en/model_doc/bart#transformers.TFBartModel">TFBartModel</a>.`,name:"vocab_size"},{anchor:"transformers.BartConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.BartConfig.encoder_layers",description:`<strong>encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of encoder layers.`,name:"encoder_layers"},{anchor:"transformers.BartConfig.decoder_layers",description:`<strong>decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of decoder layers.`,name:"decoder_layers"},{anchor:"transformers.BartConfig.encoder_attention_heads",description:`<strong>encoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"encoder_attention_heads"},{anchor:"transformers.BartConfig.decoder_attention_heads",description:`<strong>decoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"decoder_attention_heads"},{anchor:"transformers.BartConfig.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.BartConfig.encoder_ffn_dim",description:`<strong>encoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.BartConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"activation_function"},{anchor:"transformers.BartConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.BartConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.BartConfig.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for activations inside the fully connected layer.`,name:"activation_dropout"},{anchor:"transformers.BartConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for classifier.`,name:"classifier_dropout"},{anchor:"transformers.BartConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.BartConfig.init_std",description:`<strong>init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"init_std"},{anchor:"transformers.BartConfig.encoder_layerdrop",description:`<strong>encoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the encoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"encoder_layerdrop"},{anchor:"transformers.BartConfig.decoder_layerdrop",description:`<strong>decoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the decoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"decoder_layerdrop"},{anchor:"transformers.BartConfig.scale_embedding",description:`<strong>scale_embedding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Scale embeddings by diving by sqrt(d_model).`,name:"scale_embedding"},{anchor:"transformers.BartConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"},{anchor:"transformers.BartConfig.num_labels",description:`<strong>num_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of labels to use in <a href="/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartForSequenceClassification">BartForSequenceClassification</a>.`,name:"num_labels"},{anchor:"transformers.BartConfig.forced_eos_token_id",description:`<strong>forced_eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached. Usually set to
<code>eos_token_id</code>.`,name:"forced_eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/configuration_bart.py#L35"}}),fn=new R({props:{anchor:"transformers.BartConfig.example",$$slots:{default:[Ex]},$$scope:{ctx:$}}}),As=new ae({}),Ns=new q({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.32.0/src/transformers/models/bart/tokenization_bart.py#L101"}}),_n=new R({props:{anchor:"transformers.BartTokenizer.example",$$slots:{default:[Cx]},$$scope:{ctx:$}}}),bn=new Ie({props:{$$slots:{default:[Ux]},$$scope:{ctx:$}}}),Xs=new q({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.32.0/src/transformers/models/bart/tokenization_bart.py#L340",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Ps=new q({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.32.0/src/transformers/models/bart/tokenization_bart.py#L305"}}),Qs=new q({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.32.0/src/transformers/models/bart/tokenization_bart.py#L392",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Ys=new q({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.32.0/src/transformers/models/bart/tokenization_bart.py#L365",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Os=new ae({}),Hs=new q({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.32.0/src/transformers/models/bart/tokenization_bart_fast.py#L70"}}),wn=new R({props:{anchor:"transformers.BartTokenizerFast.example",$$slots:{default:[Ix]},$$scope:{ctx:$}}}),Mn=new Ie({props:{$$slots:{default:[Zx]},$$scope:{ctx:$}}}),tr=new q({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.32.0/src/transformers/models/bart/tokenization_bart_fast.py#L285",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),or=new ae({}),nr=new q({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.32.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_bart.py#L1180"}}),ir=new q({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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_bart.py#L1209",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$n=new Ie({props:{$$slots:{default:[Gx]},$$scope:{ctx:$}}}),jn=new R({props:{anchor:"transformers.BartModel.forward.example",$$slots:{default:[Wx]},$$scope:{ctx:$}}}),dr=new ae({}),lr=new q({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.32.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_bart.py#L1307"}}),ur=new q({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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BartForConditionalGeneration.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_bart.py#L1347",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),zn=new Ie({props:{$$slots:{default:[Ax]},$$scope:{ctx:$}}}),Jn=new R({props:{anchor:"transformers.BartForConditionalGeneration.forward.example",$$slots:{default:[Nx]},$$scope:{ctx:$}}}),qn=new R({props:{anchor:"transformers.BartForConditionalGeneration.forward.example-2",$$slots:{default:[Rx]},$$scope:{ctx:$}}}),mr=new ae({}),fr=new q({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.32.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_bart.py#L1482"}}),yr=new q({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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BartForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_bart.py#L1498",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput"
>transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>label</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput"
>transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Cn=new Ie({props:{$$slots:{default:[Sx]},$$scope:{ctx:$}}}),Un=new R({props:{anchor:"transformers.BartForSequenceClassification.forward.example",$$slots:{default:[Xx]},$$scope:{ctx:$}}}),In=new R({props:{anchor:"transformers.BartForSequenceClassification.forward.example-2",$$slots:{default:[Vx]},$$scope:{ctx:$}}}),kr=new ae({}),vr=new q({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.32.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_bart.py#L1612"}}),Fr=new q({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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BartForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.BartForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_bart.py#L1627",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Gn=new Ie({props:{$$slots:{default:[Px]},$$scope:{ctx:$}}}),Wn=new R({props:{anchor:"transformers.BartForQuestionAnswering.forward.example",$$slots:{default:[Qx]},$$scope:{ctx:$}}}),xr=new ae({}),$r=new q({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.32.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_bart.py#L1750"}}),Jr=new q({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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_bart.py#L1783",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Rn=new R({props:{anchor:"transformers.BartForCausalLM.forward.example",$$slots:{default:[Yx]},$$scope:{ctx:$}}}),qr=new ae({}),Er=new q({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.32.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_tf_bart.py#L1151"}}),Xn=new Ie({props:{$$slots:{default:[Lx]},$$scope:{ctx:$}}}),Zr=new q({props:{name:"call",anchor:"transformers.TFBartModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_input_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"cross_attn_head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_outputs",val:": Optional[Union[Tuple, TFBaseModelOutput]] = None"},{name:"past_key_values",val:": Optional[Tuple[Tuple[Union[np.ndarray, tf.Tensor]]]] = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"use_cache",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBartModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_tf_bart.py#L1165",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Vn=new Ie({props:{$$slots:{default:[Ox]},$$scope:{ctx:$}}}),Pn=new R({props:{anchor:"transformers.TFBartModel.call.example",$$slots:{default:[Hx]},$$scope:{ctx:$}}}),Gr=new ae({}),Wr=new q({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.32.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_tf_bart.py#L1256"}}),Yn=new Ie({props:{$$slots:{default:[Dx]},$$scope:{ctx:$}}}),Sr=new q({props:{name:"call",anchor:"transformers.TFBartForConditionalGeneration.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_input_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"cross_attn_head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_outputs",val:": Optional[TFBaseModelOutput] = None"},{name:"past_key_values",val:": Optional[Tuple[Tuple[Union[np.ndarray, tf.Tensor]]]] = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"use_cache",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"training",val:": 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBartForConditionalGeneration.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBartForConditionalGeneration.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_tf_bart.py#L1292",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Ln=new Ie({props:{$$slots:{default:[Kx]},$$scope:{ctx:$}}}),On=new R({props:{anchor:"transformers.TFBartForConditionalGeneration.call.example",$$slots:{default:[e$]},$$scope:{ctx:$}}}),Hn=new R({props:{anchor:"transformers.TFBartForConditionalGeneration.call.example-2",$$slots:{default:[t$]},$$scope:{ctx:$}}}),Xr=new ae({}),Vr=new q({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.32.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_tf_bart.py#L1445"}}),Kn=new Ie({props:{$$slots:{default:[o$]},$$scope:{ctx:$}}}),Lr=new q({props:{name:"call",anchor:"transformers.TFBartForSequenceClassification.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_input_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"cross_attn_head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_outputs",val:": Optional[TFBaseModelOutput] = None"},{name:"past_key_values",val:": Optional[Tuple[Tuple[Union[np.ndarray, tf.Tensor]]]] = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"use_cache",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"training",val:": 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBartForSequenceClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBartForSequenceClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_tf_bart.py#L1453",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqSequenceClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>label</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code></p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ea=new Ie({props:{$$slots:{default:[n$]},$$scope:{ctx:$}}}),Or=new ae({}),Hr=new q({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.32.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBartModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L1241"}}),si=new q({props:{name:"__call__",anchor:"transformers.FlaxBartModel.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"position_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax.Array] = 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L1176",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),oa=new Ie({props:{$$slots:{default:[a$]},$$scope:{ctx:$}}}),na=new R({props:{anchor:"transformers.FlaxBartModel.__call__.example",$$slots:{default:[s$]},$$scope:{ctx:$}}}),ri=new q({props:{name:"encode",anchor:"transformers.FlaxBartModel.encode",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"position_ids",val:": typing.Optional[jax.Array] = 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L999",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),sa=new R({props:{anchor:"transformers.FlaxBartModel.encode.example",$$slots:{default:[r$]},$$scope:{ctx:$}}}),ii=new q({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.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax.Array] = 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L1062",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ia=new R({props:{anchor:"transformers.FlaxBartModel.decode.example",$$slots:{default:[i$]},$$scope:{ctx:$}}}),di=new ae({}),li=new q({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.32.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBartForConditionalGeneration.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L1325"}}),_i=new q({props:{name:"__call__",anchor:"transformers.FlaxBartForConditionalGeneration.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"position_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax.Array] = 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L1176",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),la=new Ie({props:{$$slots:{default:[d$]},$$scope:{ctx:$}}}),ca=new R({props:{anchor:"transformers.FlaxBartForConditionalGeneration.__call__.example",$$slots:{default:[l$]},$$scope:{ctx:$}}}),pa=new R({props:{anchor:"transformers.FlaxBartForConditionalGeneration.__call__.example-2",$$slots:{default:[c$]},$$scope:{ctx:$}}}),bi=new q({props:{name:"encode",anchor:"transformers.FlaxBartForConditionalGeneration.encode",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"position_ids",val:": typing.Optional[jax.Array] = 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L999",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ua=new R({props:{anchor:"transformers.FlaxBartForConditionalGeneration.encode.example",$$slots:{default:[p$]},$$scope:{ctx:$}}}),yi=new q({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.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax.Array] = 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L1329",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key, value
states of the self-attention and the cross-attention layers if model is used in encoder-decoder setting.
Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),fa=new R({props:{anchor:"transformers.FlaxBartForConditionalGeneration.decode.example",$$slots:{default:[h$]},$$scope:{ctx:$}}}),ki=new ae({}),vi=new q({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.32.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBartForSequenceClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L1638"}}),Bi=new q({props:{name:"__call__",anchor:"transformers.FlaxBartForSequenceClassification.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"position_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax.Array] = 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L1176",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqSequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_a=new Ie({props:{$$slots:{default:[u$]},$$scope:{ctx:$}}}),ba=new R({props:{anchor:"transformers.FlaxBartForSequenceClassification.__call__.example",$$slots:{default:[m$]},$$scope:{ctx:$}}}),zi=new q({props:{name:"encode",anchor:"transformers.FlaxBartForSequenceClassification.encode",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"position_ids",val:": typing.Optional[jax.Array] = 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L999",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ka=new R({props:{anchor:"transformers.FlaxBartForSequenceClassification.encode.example",$$slots:{default:[f$]},$$scope:{ctx:$}}}),Ji=new q({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.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax.Array] = 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L1062",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ta=new R({props:{anchor:"transformers.FlaxBartForSequenceClassification.decode.example",$$slots:{default:[g$]},$$scope:{ctx:$}}}),qi=new ae({}),Ei=new q({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.32.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBartForQuestionAnswering.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L1724"}}),Ni=new q({props:{name:"__call__",anchor:"transformers.FlaxBartForQuestionAnswering.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"position_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax.Array] = 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L1176",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqQuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>start_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ma=new Ie({props:{$$slots:{default:[_$]},$$scope:{ctx:$}}}),Fa=new R({props:{anchor:"transformers.FlaxBartForQuestionAnswering.__call__.example",$$slots:{default:[b$]},$$scope:{ctx:$}}}),Ri=new q({props:{name:"encode",anchor:"transformers.FlaxBartForQuestionAnswering.encode",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"position_ids",val:": typing.Optional[jax.Array] = 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L999",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$a=new R({props:{anchor:"transformers.FlaxBartForQuestionAnswering.encode.example",$$slots:{default:[y$]},$$scope:{ctx:$}}}),Si=new q({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.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax.Array] = 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L1062",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ba=new R({props:{anchor:"transformers.FlaxBartForQuestionAnswering.decode.example",$$slots:{default:[k$]},$$scope:{ctx:$}}}),Xi=new ae({}),Vi=new q({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.32.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBartForCausalLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L1960"}}),Ki=new q({props:{name:"__call__",anchor:"transformers.FlaxBartForCausalLM.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"position_ids",val:": typing.Optional[jax.Array] = None"},{name:"encoder_hidden_states",val:": typing.Optional[jax.Array] = None"},{name:"encoder_attention_mask",val:": typing.Optional[jax.Array] = 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.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bart/modeling_flax_bart.py#L1798",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key, value
states of the self-attention and the cross-attention layers if model is used in encoder-decoder setting.
Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ja=new Ie({props:{$$slots:{default:[v$]},$$scope:{ctx:$}}}),qa=new R({props:{anchor:"transformers.FlaxBartForCausalLM.__call__.example",$$slots:{default:[T$]},$$scope:{ctx:$}}}),{c(){l=n("meta"),y=c(),f=n("h1"),m=n("a"),b=n("span"),k(r.$$.fragment),u=c(),j=n("span"),se=i("BART"),P=c(),Z=n("div"),re=n("a"),ie=n("img"),Ve=c(),Y=n("a"),Fe=n("img"),D=c(),de=n("p"),qe=n("strong"),le=i("DISCLAIMER:"),Pe=i(" If you see something strange, file a "),we=n("a"),ce=i("Github Issue"),Qe=i(` and assign
@patrickvonplaten`),Ze=c(),W=n("h2"),be=n("a"),Ee=n("span"),k(K.$$.fragment),E=c(),C=n("span"),Ye=i("Overview"),ee=c(),ye=n("p"),Le=i("The Bart model was proposed in "),Q=n("a"),Oe=i(`BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation,
Translation, and Comprehension`),He=i(` by Mike Lewis, Yinhan Liu, Naman Goyal, Marjan
Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov and Luke Zettlemoyer on 29 Oct, 2019.`),U=c(),xe=n("p"),pe=i("According to the abstract,"),Ge=c(),te=n("ul"),L=n("li"),De=i(`Bart uses a standard seq2seq/machine translation architecture with a bidirectional encoder (like BERT) and a
left-to-right decoder (like GPT).`),Ke=c(),X=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.`),he=c(),Ce=n("li"),$e=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.`),I=c(),je=n("p"),A=i("Tips:"),We=c(),ke=n("ul"),x=n("li"),z=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(),Ae=n("li"),dt=n("p"),J=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:"),Mt=c(),oe=n("ul"),lt=n("li"),Ft=i("mask random tokens (like in BERT)"),xt=c(),V=n("li"),ue=i("delete random tokens"),$t=c(),ct=n("li"),me=i("mask a span of k tokens with a single mask token (a span of 0 tokens is an insertion of a mask token)"),jt=c(),pt=n("li"),tt=i("permute sentences"),Bt=c(),ve=n("li"),zt=i("rotate the document to make it start at a specific token"),Mh=c(),Yt=n("p"),Im=i("This model was contributed by "),Ha=n("a"),Zm=i("sshleifer"),Gm=i(". The Authors\u2019 code can be found "),Da=n("a"),Wm=i("here"),Am=i("."),Fh=c(),yo=n("h3"),dn=n("a"),Ul=n("span"),k(Ka.$$.fragment),Nm=c(),Il=n("span"),Rm=i("Examples"),xh=c(),Lt=n("ul"),es=n("li"),Sm=i(`Examples and scripts for fine-tuning BART and other models for sequence to sequence tasks can be found in
`),ts=n("a"),Xm=i("examples/pytorch/summarization/"),Vm=i("."),Pm=c(),At=n("li"),Qm=i("An example of how to train "),fd=n("a"),Ym=i("BartForConditionalGeneration"),Lm=i(" with a Hugging Face "),Zl=n("code"),Om=i("datasets"),Hm=i(`
object can be found in this `),os=n("a"),Dm=i("forum discussion"),Km=i("."),ef=c(),ln=n("li"),ns=n("a"),tf=i("Distilled checkpoints"),of=i(" are described in this "),as=n("a"),nf=i("paper"),af=i("."),$h=c(),ko=n("h2"),cn=n("a"),Gl=n("span"),k(ss.$$.fragment),sf=c(),Wl=n("span"),rf=i("Implementation Notes"),jh=c(),ht=n("ul"),Nt=n("li"),df=i("Bart doesn\u2019t use "),Al=n("code"),lf=i("token_type_ids"),cf=i(" for sequence classification. Use "),gd=n("a"),pf=i("BartTokenizer"),hf=i(` or
`),_d=n("a"),uf=i("encode()"),mf=i(" to get the proper splitting."),ff=c(),vo=n("li"),gf=i("The forward pass of "),bd=n("a"),_f=i("BartModel"),bf=i(" will create the "),Nl=n("code"),yf=i("decoder_input_ids"),kf=i(` if they are not passed.
This is different than some other modeling APIs. A typical use case of this feature is mask filling.`),vf=c(),To=n("li"),Tf=i(`Model predictions are intended to be identical to the original implementation when
`),Rl=n("code"),wf=i("forced_bos_token_id=0"),Mf=i(`. This only works, however, if the string you pass to
`),Sl=n("code"),Ff=i("fairseq.encode"),xf=i(" starts with a space."),$f=c(),yd=n("li"),kd=n("a"),jf=i("generate()"),Bf=i(` should be used for conditional generation tasks like
summarization, see the example in that docstrings.`),zf=c(),wo=n("li"),Jf=i("Models that load the "),Xl=n("em"),qf=i("facebook/bart-large-cnn"),Ef=i(" weights will not have a "),Vl=n("code"),Cf=i("mask_token_id"),Uf=i(`, or be able to perform
mask-filling tasks.`),Bh=c(),Mo=n("h2"),pn=n("a"),Pl=n("span"),k(rs.$$.fragment),If=c(),Ql=n("span"),Zf=i("Mask Filling"),zh=c(),Ot=n("p"),Gf=i("The "),Yl=n("code"),Wf=i("facebook/bart-base"),Af=i(" and "),Ll=n("code"),Nf=i("facebook/bart-large"),Rf=i(" checkpoints can be used to fill multi-token masks."),Jh=c(),k(is.$$.fragment),qh=c(),Fo=n("h2"),hn=n("a"),Ol=n("span"),k(ds.$$.fragment),Sf=c(),Hl=n("span"),Xf=i("Resources"),Eh=c(),vd=n("p"),Vf=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."),Ch=c(),k(ls.$$.fragment),Uh=c(),Te=n("ul"),cs=n("li"),Pf=i("A blog post on "),ps=n("a"),Qf=i("Distributed Training: Train BART/T5 for Summarization using \u{1F917} Transformers and Amazon SageMaker"),Yf=i("."),Lf=c(),hs=n("li"),Of=i("A notebook on how to "),us=n("a"),Hf=i("finetune BART for summarization with fastai using blurr"),Df=i(". \u{1F30E}"),Kf=c(),ms=n("li"),eg=i("A notebook on how to "),fs=n("a"),tg=i("finetune BART for summarization in two languages with Trainer class"),og=i(". \u{1F30E}"),ng=c(),Ht=n("li"),Td=n("a"),ag=i("BartForConditionalGeneration"),sg=i(" is supported by this "),gs=n("a"),rg=i("example script"),ig=i(" and "),_s=n("a"),dg=i("notebook"),lg=i("."),cg=c(),Dt=n("li"),wd=n("a"),pg=i("TFBartForConditionalGeneration"),hg=i(" is supported by this "),bs=n("a"),ug=i("example script"),mg=i(" and "),ys=n("a"),fg=i("notebook"),gg=i("."),_g=c(),un=n("li"),Md=n("a"),bg=i("FlaxBartForConditionalGeneration"),yg=i(" is supported by this "),ks=n("a"),kg=i("example script"),vg=i("."),Tg=c(),Fd=n("li"),vs=n("a"),wg=i("Summarization"),Mg=i(" chapter of the \u{1F917} Hugging Face course."),Fg=c(),Dl=n("li"),xd=n("a"),xg=i("Summarization task guide"),Ih=c(),k(Ts.$$.fragment),Zh=c(),ut=n("ul"),Kt=n("li"),$d=n("a"),$g=i("BartForConditionalGeneration"),jg=i(" is supported by this "),ws=n("a"),Bg=i("example script"),zg=i(" and "),Ms=n("a"),Jg=i("notebook"),qg=i("."),Eg=c(),eo=n("li"),jd=n("a"),Cg=i("TFBartForConditionalGeneration"),Ug=i(" is supported by this "),Fs=n("a"),Ig=i("example script"),Zg=i(" and "),xs=n("a"),Gg=i("notebook"),Wg=i("."),Ag=c(),to=n("li"),Bd=n("a"),Ng=i("FlaxBartForConditionalGeneration"),Rg=i(" is supported by this "),$s=n("a"),Sg=i("example script"),Xg=i(" and "),js=n("a"),Vg=i("notebook"),Pg=i("."),Qg=c(),zd=n("li"),Bs=n("a"),Yg=i("Masked language modeling"),Lg=i(" chapter of the \u{1F917} Hugging Face Course."),Og=c(),Kl=n("li"),Jd=n("a"),Hg=i("Masked language modeling task guide"),Gh=c(),k(zs.$$.fragment),Wh=c(),Jt=n("ul"),Js=n("li"),Dg=i("A notebook on how to "),qs=n("a"),Kg=i("finetune mBART using Seq2SeqTrainer for Hindi to English translation"),e_=i(". \u{1F30E}"),t_=c(),oo=n("li"),qd=n("a"),o_=i("BartForConditionalGeneration"),n_=i(" is supported by this "),Es=n("a"),a_=i("example script"),s_=i(" and "),Cs=n("a"),r_=i("notebook"),i_=i("."),d_=c(),no=n("li"),Ed=n("a"),l_=i("TFBartForConditionalGeneration"),c_=i(" is supported by this "),Us=n("a"),p_=i("example script"),h_=i(" and "),Is=n("a"),u_=i("notebook"),m_=i("."),f_=c(),ec=n("li"),Cd=n("a"),g_=i("Translation task guide"),Ah=c(),Ud=n("p"),__=i("See also:"),Nh=c(),ao=n("ul"),tc=n("li"),Id=n("a"),b_=i("Text classification task guide"),y_=c(),oc=n("li"),Zd=n("a"),k_=i("Question answering task guide"),v_=c(),nc=n("li"),Gd=n("a"),T_=i("Causal language modeling task guide"),Rh=c(),xo=n("h2"),mn=n("a"),ac=n("span"),k(Zs.$$.fragment),w_=c(),sc=n("span"),M_=i("BartConfig"),Sh=c(),yt=n("div"),k(Gs.$$.fragment),F_=c(),$o=n("p"),x_=i("This is the configuration class to store the configuration of a "),Wd=n("a"),$_=i("BartModel"),j_=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
`),Ws=n("a"),B_=i("facebook/bart-large"),z_=i(" architecture."),J_=c(),jo=n("p"),q_=i("Configuration objects inherit from "),Ad=n("a"),E_=i("PretrainedConfig"),C_=i(` and can be used to control the model outputs. Read the
documentation from `),Nd=n("a"),U_=i("PretrainedConfig"),I_=i(" for more information."),Z_=c(),k(fn.$$.fragment),Xh=c(),Bo=n("h2"),gn=n("a"),rc=n("span"),k(As.$$.fragment),G_=c(),ic=n("span"),W_=i("BartTokenizer"),Vh=c(),N=n("div"),k(Ns.$$.fragment),A_=c(),dc=n("p"),N_=i("Constructs a BART tokenizer, which is smilar to the ROBERTa tokenizer, using byte-level Byte-Pair-Encoding."),R_=c(),lc=n("p"),S_=i("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),X_=c(),k(_n.$$.fragment),V_=c(),Rs=n("p"),P_=i("You can get around that behavior by passing "),cc=n("code"),Q_=i("add_prefix_space=True"),Y_=i(` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),L_=c(),k(bn.$$.fragment),O_=c(),Ss=n("p"),H_=i("This tokenizer inherits from "),Rd=n("a"),D_=i("PreTrainedTokenizer"),K_=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"),k(Xs.$$.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(),Vs=n("ul"),Sd=n("li"),ab=i("single sequence: "),hc=n("code"),sb=i("<s> X </s>"),rb=c(),Xd=n("li"),ib=i("pair of sequences: "),uc=n("code"),db=i("<s> A </s></s> B </s>"),lb=c(),yn=n("div"),k(Ps.$$.fragment),cb=c(),mc=n("p"),pb=i("Converts a sequence of tokens (string) in a single string."),hb=c(),kn=n("div"),k(Qs.$$.fragment),ub=c(),fc=n("p"),mb=i(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. BART does not
make use of token type ids, therefore a list of zeros is returned.`),fb=c(),vn=n("div"),k(Ys.$$.fragment),gb=c(),Ls=n("p"),_b=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 `),gc=n("code"),bb=i("prepare_for_model"),yb=i(" method."),Ph=c(),zo=n("h2"),Tn=n("a"),_c=n("span"),k(Os.$$.fragment),kb=c(),bc=n("span"),vb=i("BartTokenizerFast"),Qh=c(),fe=n("div"),k(Hs.$$.fragment),Tb=c(),Ds=n("p"),wb=i("Construct a \u201Cfast\u201D BART tokenizer (backed by HuggingFace\u2019s "),yc=n("em"),Mb=i("tokenizers"),Fb=i(` library), derived from the GPT-2 tokenizer,
using byte-level Byte-Pair-Encoding.`),xb=c(),kc=n("p"),$b=i("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),jb=c(),k(wn.$$.fragment),Bb=c(),Ks=n("p"),zb=i("You can get around that behavior by passing "),vc=n("code"),Jb=i("add_prefix_space=True"),qb=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.`),Eb=c(),k(Mn.$$.fragment),Cb=c(),er=n("p"),Ub=i("This tokenizer inherits from "),Vd=n("a"),Ib=i("PreTrainedTokenizerFast"),Zb=i(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Gb=c(),Fn=n("div"),k(tr.$$.fragment),Wb=c(),Tc=n("p"),Ab=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.`),Yh=c(),Jo=n("h2"),xn=n("a"),wc=n("span"),k(or.$$.fragment),Nb=c(),Mc=n("span"),Rb=i("BartModel"),Lh=c(),kt=n("div"),k(nr.$$.fragment),Sb=c(),ar=n("p"),Xb=i(`The bare BART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Pd=n("a"),Vb=i("PreTrainedModel"),Pb=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"),Yb=i("This model is also a PyTorch "),rr=n("a"),Lb=i("torch.nn.Module"),Ob=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Hb=c(),qt=n("div"),k(ir.$$.fragment),Db=c(),qo=n("p"),Kb=i("The "),Qd=n("a"),ey=i("BartModel"),ty=i(" forward method, overrides the "),Fc=n("code"),oy=i("__call__"),ny=i(" special method."),ay=c(),k($n.$$.fragment),sy=c(),k(jn.$$.fragment),Oh=c(),Eo=n("h2"),Bn=n("a"),xc=n("span"),k(dr.$$.fragment),ry=c(),$c=n("span"),iy=i("BartForConditionalGeneration"),Hh=c(),vt=n("div"),k(lr.$$.fragment),dy=c(),cr=n("p"),ly=i(`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),Yd=n("a"),cy=i("PreTrainedModel"),py=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.)`),hy=c(),pr=n("p"),uy=i("This model is also a PyTorch "),hr=n("a"),my=i("torch.nn.Module"),fy=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),gy=c(),mt=n("div"),k(ur.$$.fragment),_y=c(),Co=n("p"),by=i("The "),Ld=n("a"),yy=i("BartForConditionalGeneration"),ky=i(" forward method, overrides the "),jc=n("code"),vy=i("__call__"),Ty=i(" special method."),wy=c(),k(zn.$$.fragment),My=c(),k(Jn.$$.fragment),Fy=c(),k(qn.$$.fragment),Dh=c(),Uo=n("h2"),En=n("a"),Bc=n("span"),k(mr.$$.fragment),xy=c(),zc=n("span"),$y=i("BartForSequenceClassification"),Kh=c(),ot=n("div"),k(fr.$$.fragment),jy=c(),Jc=n("p"),By=i(`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),zy=c(),gr=n("p"),Jy=i("This model inherits from "),Od=n("a"),qy=i("PreTrainedModel"),Ey=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.)`),Cy=c(),_r=n("p"),Uy=i("This model is also a PyTorch "),br=n("a"),Iy=i("torch.nn.Module"),Zy=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Gy=c(),ft=n("div"),k(yr.$$.fragment),Wy=c(),Io=n("p"),Ay=i("The "),Hd=n("a"),Ny=i("BartForSequenceClassification"),Ry=i(" forward method, overrides the "),qc=n("code"),Sy=i("__call__"),Xy=i(" special method."),Vy=c(),k(Cn.$$.fragment),Py=c(),k(Un.$$.fragment),Qy=c(),k(In.$$.fragment),eu=c(),Zo=n("h2"),Zn=n("a"),Ec=n("span"),k(kr.$$.fragment),Yy=c(),Cc=n("span"),Ly=i("BartForQuestionAnswering"),tu=c(),nt=n("div"),k(vr.$$.fragment),Oy=c(),Go=n("p"),Hy=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 `),Uc=n("code"),Dy=i("span start logits"),Ky=i(" and "),Ic=n("code"),ek=i("span end logits"),tk=i(")."),ok=c(),Tr=n("p"),nk=i("This model inherits from "),Dd=n("a"),ak=i("PreTrainedModel"),sk=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.)`),rk=c(),wr=n("p"),ik=i("This model is also a PyTorch "),Mr=n("a"),dk=i("torch.nn.Module"),lk=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ck=c(),Et=n("div"),k(Fr.$$.fragment),pk=c(),Wo=n("p"),hk=i("The "),Kd=n("a"),uk=i("BartForQuestionAnswering"),mk=i(" forward method, overrides the "),Zc=n("code"),fk=i("__call__"),gk=i(" special method."),_k=c(),k(Gn.$$.fragment),bk=c(),k(Wn.$$.fragment),ou=c(),Ao=n("h2"),An=n("a"),Gc=n("span"),k(xr.$$.fragment),yk=c(),Wc=n("span"),kk=i("BartForCausalLM"),nu=c(),at=n("div"),k($r.$$.fragment),vk=c(),Ac=n("p"),Tk=i("BART decoder with with a language modeling head on top (linear layer with weights tied to the input embeddings)."),wk=c(),jr=n("p"),Mk=i("This model inherits from "),el=n("a"),Fk=i("PreTrainedModel"),xk=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.)`),$k=c(),Br=n("p"),jk=i("This model is also a PyTorch "),zr=n("a"),Bk=i("torch.nn.Module"),zk=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Jk=c(),Nn=n("div"),k(Jr.$$.fragment),qk=c(),k(Rn.$$.fragment),au=c(),No=n("h2"),Sn=n("a"),Nc=n("span"),k(qr.$$.fragment),Ek=c(),Rc=n("span"),Ck=i("TFBartModel"),su=c(),st=n("div"),k(Er.$$.fragment),Uk=c(),Cr=n("p"),Ik=i(`The bare BART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),tl=n("a"),Zk=i("TFPreTrainedModel"),Gk=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Wk=c(),Ur=n("p"),Ak=i("This model is also a "),Ir=n("a"),Nk=i("tf.keras.Model"),Rk=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.`),Sk=c(),k(Xn.$$.fragment),Xk=c(),Ct=n("div"),k(Zr.$$.fragment),Vk=c(),Ro=n("p"),Pk=i("The "),ol=n("a"),Qk=i("TFBartModel"),Yk=i(" forward method, overrides the "),Sc=n("code"),Lk=i("__call__"),Ok=i(" special method."),Hk=c(),k(Vn.$$.fragment),Dk=c(),k(Pn.$$.fragment),ru=c(),So=n("h2"),Qn=n("a"),Xc=n("span"),k(Gr.$$.fragment),Kk=c(),Vc=n("span"),ev=i("TFBartForConditionalGeneration"),iu=c(),rt=n("div"),k(Wr.$$.fragment),tv=c(),Ar=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(),Nr=n("p"),rv=i("This model is also a "),Rr=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(),k(Yn.$$.fragment),cv=c(),gt=n("div"),k(Sr.$$.fragment),pv=c(),Xo=n("p"),hv=i("The "),al=n("a"),uv=i("TFBartForConditionalGeneration"),mv=i(" forward method, overrides the "),Pc=n("code"),fv=i("__call__"),gv=i(" special method."),_v=c(),k(Ln.$$.fragment),bv=c(),k(On.$$.fragment),yv=c(),k(Hn.$$.fragment),du=c(),Vo=n("h2"),Dn=n("a"),Qc=n("span"),k(Xr.$$.fragment),kv=c(),Yc=n("span"),vv=i("TFBartForSequenceClassification"),lu=c(),Ue=n("div"),k(Vr.$$.fragment),Tv=c(),Lc=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.`),Mv=c(),Pr=n("p"),Fv=i("This model inherits from "),sl=n("a"),xv=i("TFPreTrainedModel"),$v=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),jv=c(),Qr=n("p"),Bv=i("This model is also a "),Yr=n("a"),zv=i("tf.keras.Model"),Jv=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.`),qv=c(),k(Kn.$$.fragment),Ev=c(),ro=n("div"),k(Lr.$$.fragment),Cv=c(),Po=n("p"),Uv=i("The "),rl=n("a"),Iv=i("TFBartForSequenceClassification"),Zv=i(" forward method, overrides the "),Oc=n("code"),Gv=i("__call__"),Wv=i(" special method."),Av=c(),k(ea.$$.fragment),cu=c(),Qo=n("h2"),ta=n("a"),Hc=n("span"),k(Or.$$.fragment),Nv=c(),Dc=n("span"),Rv=i("FlaxBartModel"),pu=c(),ge=n("div"),k(Hr.$$.fragment),Sv=c(),Dr=n("p"),Xv=i(`The bare Bart Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),il=n("a"),Vv=i("FlaxPreTrainedModel"),Pv=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(),Kr=n("p"),Yv=i(`This model is also a Flax Linen
`),ei=n("a"),Lv=i("flax.nn.Module"),Ov=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Hv=c(),Kc=n("p"),Dv=i("Finally, this model supports inherent JAX features such as:"),Kv=c(),Rt=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(),Ut=n("div"),k(si.$$.fragment),dT=c(),Yo=n("p"),lT=i("The "),ap=n("code"),cT=i("FlaxBartPreTrainedModel"),pT=i(" forward method, overrides the "),sp=n("code"),hT=i("__call__"),uT=i(" special method."),mT=c(),k(oa.$$.fragment),fT=c(),k(na.$$.fragment),gT=c(),aa=n("div"),k(ri.$$.fragment),_T=c(),k(sa.$$.fragment),bT=c(),ra=n("div"),k(ii.$$.fragment),yT=c(),k(ia.$$.fragment),hu=c(),Lo=n("h2"),da=n("a"),rp=n("span"),k(di.$$.fragment),kT=c(),ip=n("span"),vT=i("FlaxBartForConditionalGeneration"),uu=c(),_e=n("div"),k(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"),MT=i("FlaxPreTrainedModel"),FT=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.)`),xT=c(),pi=n("p"),$T=i(`This model is also a Flax Linen
`),hi=n("a"),jT=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.`),zT=c(),dp=n("p"),JT=i("Finally, this model supports inherent JAX features such as:"),qT=c(),St=n("ul"),lp=n("li"),ui=n("a"),ET=i("Just-In-Time (JIT) compilation"),CT=c(),cp=n("li"),mi=n("a"),UT=i("Automatic Differentiation"),IT=c(),pp=n("li"),fi=n("a"),ZT=i("Vectorization"),GT=c(),hp=n("li"),gi=n("a"),WT=i("Parallelization"),AT=c(),_t=n("div"),k(_i.$$.fragment),NT=c(),Oo=n("p"),RT=i("The "),up=n("code"),ST=i("FlaxBartPreTrainedModel"),XT=i(" forward method, overrides the "),mp=n("code"),VT=i("__call__"),PT=i(" special method."),QT=c(),k(la.$$.fragment),YT=c(),k(ca.$$.fragment),LT=c(),k(pa.$$.fragment),OT=c(),ha=n("div"),k(bi.$$.fragment),HT=c(),k(ua.$$.fragment),DT=c(),ma=n("div"),k(yi.$$.fragment),KT=c(),k(fa.$$.fragment),mu=c(),Ho=n("h2"),ga=n("a"),fp=n("span"),k(ki.$$.fragment),ew=c(),gp=n("span"),tw=i("FlaxBartForSequenceClassification"),fu=c(),O=n("div"),k(vi.$$.fragment),ow=c(),_p=n("p"),nw=i(`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),aw=c(),Ti=n("p"),sw=i("This model inherits from "),ll=n("a"),rw=i("FlaxPreTrainedModel"),iw=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),dw=c(),wi=n("p"),lw=i(`This model is also a Flax Linen
`),Mi=n("a"),cw=i("flax.nn.Module"),pw=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),hw=c(),bp=n("p"),uw=i("Finally, this model supports inherent JAX features such as:"),mw=c(),Xt=n("ul"),yp=n("li"),Fi=n("a"),fw=i("Just-In-Time (JIT) compilation"),gw=c(),kp=n("li"),xi=n("a"),_w=i("Automatic Differentiation"),bw=c(),vp=n("li"),$i=n("a"),yw=i("Vectorization"),kw=c(),Tp=n("li"),ji=n("a"),vw=i("Parallelization"),Tw=c(),It=n("div"),k(Bi.$$.fragment),ww=c(),Do=n("p"),Mw=i("The "),wp=n("code"),Fw=i("FlaxBartPreTrainedModel"),xw=i(" forward method, overrides the "),Mp=n("code"),$w=i("__call__"),jw=i(" special method."),Bw=c(),k(_a.$$.fragment),zw=c(),k(ba.$$.fragment),Jw=c(),ya=n("div"),k(zi.$$.fragment),qw=c(),k(ka.$$.fragment),Ew=c(),va=n("div"),k(Ji.$$.fragment),Cw=c(),k(Ta.$$.fragment),gu=c(),Ko=n("h2"),wa=n("a"),Fp=n("span"),k(qi.$$.fragment),Uw=c(),xp=n("span"),Iw=i("FlaxBartForQuestionAnswering"),_u=c(),H=n("div"),k(Ei.$$.fragment),Zw=c(),en=n("p"),Gw=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 `),$p=n("code"),Ww=i("span start logits"),Aw=i(" and "),jp=n("code"),Nw=i("span end logits"),Rw=i(")."),Sw=c(),Ci=n("p"),Xw=i("This model inherits from "),cl=n("a"),Vw=i("FlaxPreTrainedModel"),Pw=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(),Ui=n("p"),Yw=i(`This model is also a Flax Linen
`),Ii=n("a"),Lw=i("flax.nn.Module"),Ow=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Hw=c(),Bp=n("p"),Dw=i("Finally, this model supports inherent JAX features such as:"),Kw=c(),Vt=n("ul"),zp=n("li"),Zi=n("a"),e2=i("Just-In-Time (JIT) compilation"),t2=c(),Jp=n("li"),Gi=n("a"),o2=i("Automatic Differentiation"),n2=c(),qp=n("li"),Wi=n("a"),a2=i("Vectorization"),s2=c(),Ep=n("li"),Ai=n("a"),r2=i("Parallelization"),i2=c(),Zt=n("div"),k(Ni.$$.fragment),d2=c(),tn=n("p"),l2=i("The "),Cp=n("code"),c2=i("FlaxBartPreTrainedModel"),p2=i(" forward method, overrides the "),Up=n("code"),h2=i("__call__"),u2=i(" special method."),m2=c(),k(Ma.$$.fragment),f2=c(),k(Fa.$$.fragment),g2=c(),xa=n("div"),k(Ri.$$.fragment),_2=c(),k($a.$$.fragment),b2=c(),ja=n("div"),k(Si.$$.fragment),y2=c(),k(Ba.$$.fragment),bu=c(),on=n("h2"),za=n("a"),Ip=n("span"),k(Xi.$$.fragment),k2=c(),Zp=n("span"),v2=i("FlaxBartForCausalLM"),yu=c(),Me=n("div"),k(Vi.$$.fragment),T2=c(),Gp=n("p"),w2=i(`Bart Decoder Model with a language modeling head on top (linear layer with weights tied to the input embeddings)
e.g for autoregressive tasks.`),M2=c(),Pi=n("p"),F2=i("This model inherits from "),pl=n("a"),x2=i("FlaxPreTrainedModel"),$2=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.)`),j2=c(),Qi=n("p"),B2=i(`This model is also a Flax Linen
`),Yi=n("a"),z2=i("flax.nn.Module"),J2=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),q2=c(),Wp=n("p"),E2=i("Finally, this model supports inherent JAX features such as:"),C2=c(),Pt=n("ul"),Ap=n("li"),Li=n("a"),U2=i("Just-In-Time (JIT) compilation"),I2=c(),Np=n("li"),Oi=n("a"),Z2=i("Automatic Differentiation"),G2=c(),Rp=n("li"),Hi=n("a"),W2=i("Vectorization"),A2=c(),Sp=n("li"),Di=n("a"),N2=i("Parallelization"),R2=c(),Gt=n("div"),k(Ki.$$.fragment),S2=c(),nn=n("p"),X2=i("The "),Xp=n("code"),V2=i("FlaxBartDecoderPreTrainedModel"),P2=i(" forward method, overrides the "),Vp=n("code"),Q2=i("__call__"),Y2=i(" special method."),L2=c(),k(Ja.$$.fragment),O2=c(),k(qa.$$.fragment),this.h()},l(o){const g=Jx('[data-svelte="svelte-1phssyn"]',document.head);l=a(g,"META",{name:!0,content:!0}),g.forEach(t),y=p(o),f=a(o,"H1",{class:!0});var ed=s(f);m=a(ed,"A",{id:!0,class:!0,href:!0});var Pp=s(m);b=a(Pp,"SPAN",{});var Qp=s(b);v(r.$$.fragment,Qp),Qp.forEach(t),Pp.forEach(t),u=p(ed),j=a(ed,"SPAN",{});var Yp=s(j);se=d(Yp,"BART"),Yp.forEach(t),ed.forEach(t),P=p(o),Z=a(o,"DIV",{class:!0});var td=s(Z);re=a(td,"A",{href:!0});var Lp=s(re);ie=a(Lp,"IMG",{alt:!0,src:!0}),Lp.forEach(t),Ve=p(td),Y=a(td,"A",{href:!0});var Op=s(Y);Fe=a(Op,"IMG",{alt:!0,src:!0}),Op.forEach(t),td.forEach(t),D=p(o),de=a(o,"P",{});var Ea=s(de);qe=a(Ea,"STRONG",{});var Hp=s(qe);le=d(Hp,"DISCLAIMER:"),Hp.forEach(t),Pe=d(Ea," If you see something strange, file a "),we=a(Ea,"A",{href:!0,rel:!0});var Dp=s(we);ce=d(Dp,"Github Issue"),Dp.forEach(t),Qe=d(Ea,` and assign
@patrickvonplaten`),Ea.forEach(t),Ze=p(o),W=a(o,"H2",{class:!0});var od=s(W);be=a(od,"A",{id:!0,class:!0,href:!0});var Kp=s(be);Ee=a(Kp,"SPAN",{});var eh=s(Ee);v(K.$$.fragment,eh),eh.forEach(t),Kp.forEach(t),E=p(od),C=a(od,"SPAN",{});var th=s(C);Ye=d(th,"Overview"),th.forEach(t),od.forEach(t),ee=p(o),ye=a(o,"P",{});var nd=s(ye);Le=d(nd,"The Bart model was proposed in "),Q=a(nd,"A",{href:!0,rel:!0});var oh=s(Q);Oe=d(oh,`BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation,
Translation, and Comprehension`),oh.forEach(t),He=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),U=p(o),xe=a(o,"P",{});var nh=s(xe);pe=d(nh,"According to the abstract,"),nh.forEach(t),Ge=p(o),te=a(o,"UL",{});var an=s(te);L=a(an,"LI",{});var ah=s(L);De=d(ah,`Bart uses a standard seq2seq/machine translation architecture with a bidirectional encoder (like BERT) and a
left-to-right decoder (like GPT).`),ah.forEach(t),Ke=p(an),X=a(an,"LI",{});var sh=s(X);et=d(sh,`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.`),sh.forEach(t),he=p(an),Ce=a(an,"LI",{});var rh=s(Ce);$e=d(rh,`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.`),rh.forEach(t),an.forEach(t),I=p(o),je=a(o,"P",{});var ih=s(je);A=d(ih,"Tips:"),ih.forEach(t),We=p(o),ke=a(o,"UL",{});var ad=s(ke);x=a(ad,"LI",{});var dh=s(x);z=a(dh,"P",{});var lh=s(z);wt=d(lh,`BART is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),lh.forEach(t),dh.forEach(t),Be=p(ad),Ae=a(ad,"LI",{});var sd=s(Ae);dt=a(sd,"P",{});var ch=s(dt);J=d(ch,"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:"),ch.forEach(t),Mt=p(sd),oe=a(sd,"UL",{});var Tt=s(oe);lt=a(Tt,"LI",{});var ph=s(lt);Ft=d(ph,"mask random tokens (like in BERT)"),ph.forEach(t),xt=p(Tt),V=a(Tt,"LI",{});var hh=s(V);ue=d(hh,"delete random tokens"),hh.forEach(t),$t=p(Tt),ct=a(Tt,"LI",{});var uh=s(ct);me=d(uh,"mask a span of k tokens with a single mask token (a span of 0 tokens is an insertion of a mask token)"),uh.forEach(t),jt=p(Tt),pt=a(Tt,"LI",{});var mh=s(pt);tt=d(mh,"permute sentences"),mh.forEach(t),Bt=p(Tt),ve=a(Tt,"LI",{});var fh=s(ve);zt=d(fh,"rotate the document to make it start at a specific token"),fh.forEach(t),Tt.forEach(t),sd.forEach(t),ad.forEach(t),Mh=p(o),Yt=a(o,"P",{});var sn=s(Yt);Im=d(sn,"This model was contributed by "),Ha=a(sn,"A",{href:!0,rel:!0});var gh=s(Ha);Zm=d(gh,"sshleifer"),gh.forEach(t),Gm=d(sn,". The Authors\u2019 code can be found "),Da=a(sn,"A",{href:!0,rel:!0});var _h=s(Da);Wm=d(_h,"here"),_h.forEach(t),Am=d(sn,"."),sn.forEach(t),Fh=p(o),yo=a(o,"H3",{class:!0});var rd=s(yo);dn=a(rd,"A",{id:!0,class:!0,href:!0});var bh=s(dn);Ul=a(bh,"SPAN",{});var yh=s(Ul);v(Ka.$$.fragment,yh),yh.forEach(t),bh.forEach(t),Nm=p(rd),Il=a(rd,"SPAN",{});var kh=s(Il);Rm=d(kh,"Examples"),kh.forEach(t),rd.forEach(t),xh=p(o),Lt=a(o,"UL",{});var rn=s(Lt);es=a(rn,"LI",{});var id=s(es);Sm=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 vh=s(ts);Xm=d(vh,"examples/pytorch/summarization/"),vh.forEach(t),Vm=d(id,"."),id.forEach(t),Pm=p(rn),At=a(rn,"LI",{});var Qt=s(At);Qm=d(Qt,"An example of how to train "),fd=a(Qt,"A",{href:!0});var nM=s(fd);Ym=d(nM,"BartForConditionalGeneration"),nM.forEach(t),Lm=d(Qt," with a Hugging Face "),Zl=a(Qt,"CODE",{});var aM=s(Zl);Om=d(aM,"datasets"),aM.forEach(t),Hm=d(Qt,`
object can be found in this `),os=a(Qt,"A",{href:!0,rel:!0});var sM=s(os);Dm=d(sM,"forum discussion"),sM.forEach(t),Km=d(Qt,"."),Qt.forEach(t),ef=p(rn),ln=a(rn,"LI",{});var Th=s(ln);ns=a(Th,"A",{href:!0,rel:!0});var rM=s(ns);tf=d(rM,"Distilled checkpoints"),rM.forEach(t),of=d(Th," are described in this "),as=a(Th,"A",{href:!0,rel:!0});var iM=s(as);nf=d(iM,"paper"),iM.forEach(t),af=d(Th,"."),Th.forEach(t),rn.forEach(t),$h=p(o),ko=a(o,"H2",{class:!0});var vu=s(ko);cn=a(vu,"A",{id:!0,class:!0,href:!0});var dM=s(cn);Gl=a(dM,"SPAN",{});var lM=s(Gl);v(ss.$$.fragment,lM),lM.forEach(t),dM.forEach(t),sf=p(vu),Wl=a(vu,"SPAN",{});var cM=s(Wl);rf=d(cM,"Implementation Notes"),cM.forEach(t),vu.forEach(t),jh=p(o),ht=a(o,"UL",{});var io=s(ht);Nt=a(io,"LI",{});var Ca=s(Nt);df=d(Ca,"Bart doesn\u2019t use "),Al=a(Ca,"CODE",{});var pM=s(Al);lf=d(pM,"token_type_ids"),pM.forEach(t),cf=d(Ca," for sequence classification. Use "),gd=a(Ca,"A",{href:!0});var hM=s(gd);pf=d(hM,"BartTokenizer"),hM.forEach(t),hf=d(Ca,` or
`),_d=a(Ca,"A",{href:!0});var uM=s(_d);uf=d(uM,"encode()"),uM.forEach(t),mf=d(Ca," to get the proper splitting."),Ca.forEach(t),ff=p(io),vo=a(io,"LI",{});var hl=s(vo);gf=d(hl,"The forward pass of "),bd=a(hl,"A",{href:!0});var mM=s(bd);_f=d(mM,"BartModel"),mM.forEach(t),bf=d(hl," will create the "),Nl=a(hl,"CODE",{});var fM=s(Nl);yf=d(fM,"decoder_input_ids"),fM.forEach(t),kf=d(hl,` if they are not passed.
This is different than some other modeling APIs. A typical use case of this feature is mask filling.`),hl.forEach(t),vf=p(io),To=a(io,"LI",{});var ul=s(To);Tf=d(ul,`Model predictions are intended to be identical to the original implementation when
`),Rl=a(ul,"CODE",{});var gM=s(Rl);wf=d(gM,"forced_bos_token_id=0"),gM.forEach(t),Mf=d(ul,`. This only works, however, if the string you pass to
`),Sl=a(ul,"CODE",{});var _M=s(Sl);Ff=d(_M,"fairseq.encode"),_M.forEach(t),xf=d(ul," starts with a space."),ul.forEach(t),$f=p(io),yd=a(io,"LI",{});var H2=s(yd);kd=a(H2,"A",{href:!0});var bM=s(kd);jf=d(bM,"generate()"),bM.forEach(t),Bf=d(H2,` should be used for conditional generation tasks like
summarization, see the example in that docstrings.`),H2.forEach(t),zf=p(io),wo=a(io,"LI",{});var ml=s(wo);Jf=d(ml,"Models that load the "),Xl=a(ml,"EM",{});var yM=s(Xl);qf=d(yM,"facebook/bart-large-cnn"),yM.forEach(t),Ef=d(ml," weights will not have a "),Vl=a(ml,"CODE",{});var kM=s(Vl);Cf=d(kM,"mask_token_id"),kM.forEach(t),Uf=d(ml,`, or be able to perform
mask-filling tasks.`),ml.forEach(t),io.forEach(t),Bh=p(o),Mo=a(o,"H2",{class:!0});var Tu=s(Mo);pn=a(Tu,"A",{id:!0,class:!0,href:!0});var vM=s(pn);Pl=a(vM,"SPAN",{});var TM=s(Pl);v(rs.$$.fragment,TM),TM.forEach(t),vM.forEach(t),If=p(Tu),Ql=a(Tu,"SPAN",{});var wM=s(Ql);Zf=d(wM,"Mask Filling"),wM.forEach(t),Tu.forEach(t),zh=p(o),Ot=a(o,"P",{});var fl=s(Ot);Gf=d(fl,"The "),Yl=a(fl,"CODE",{});var MM=s(Yl);Wf=d(MM,"facebook/bart-base"),MM.forEach(t),Af=d(fl," and "),Ll=a(fl,"CODE",{});var FM=s(Ll);Nf=d(FM,"facebook/bart-large"),FM.forEach(t),Rf=d(fl," checkpoints can be used to fill multi-token masks."),fl.forEach(t),Jh=p(o),v(is.$$.fragment,o),qh=p(o),Fo=a(o,"H2",{class:!0});var wu=s(Fo);hn=a(wu,"A",{id:!0,class:!0,href:!0});var xM=s(hn);Ol=a(xM,"SPAN",{});var $M=s(Ol);v(ds.$$.fragment,$M),$M.forEach(t),xM.forEach(t),Sf=p(wu),Hl=a(wu,"SPAN",{});var jM=s(Hl);Xf=d(jM,"Resources"),jM.forEach(t),wu.forEach(t),Eh=p(o),vd=a(o,"P",{});var BM=s(vd);Vf=d(BM,"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."),BM.forEach(t),Ch=p(o),v(ls.$$.fragment,o),Uh=p(o),Te=a(o,"UL",{});var Ne=s(Te);cs=a(Ne,"LI",{});var Mu=s(cs);Pf=d(Mu,"A blog post on "),ps=a(Mu,"A",{href:!0,rel:!0});var zM=s(ps);Qf=d(zM,"Distributed Training: Train BART/T5 for Summarization using \u{1F917} Transformers and Amazon SageMaker"),zM.forEach(t),Yf=d(Mu,"."),Mu.forEach(t),Lf=p(Ne),hs=a(Ne,"LI",{});var Fu=s(hs);Of=d(Fu,"A notebook on how to "),us=a(Fu,"A",{href:!0,rel:!0});var JM=s(us);Hf=d(JM,"finetune BART for summarization with fastai using blurr"),JM.forEach(t),Df=d(Fu,". \u{1F30E}"),Fu.forEach(t),Kf=p(Ne),ms=a(Ne,"LI",{});var xu=s(ms);eg=d(xu,"A notebook on how to "),fs=a(xu,"A",{href:!0,rel:!0});var qM=s(fs);tg=d(qM,"finetune BART for summarization in two languages with Trainer class"),qM.forEach(t),og=d(xu,". \u{1F30E}"),xu.forEach(t),ng=p(Ne),Ht=a(Ne,"LI",{});var dd=s(Ht);Td=a(dd,"A",{href:!0});var EM=s(Td);ag=d(EM,"BartForConditionalGeneration"),EM.forEach(t),sg=d(dd," is supported by this "),gs=a(dd,"A",{href:!0,rel:!0});var CM=s(gs);rg=d(CM,"example script"),CM.forEach(t),ig=d(dd," and "),_s=a(dd,"A",{href:!0,rel:!0});var UM=s(_s);dg=d(UM,"notebook"),UM.forEach(t),lg=d(dd,"."),dd.forEach(t),cg=p(Ne),Dt=a(Ne,"LI",{});var ld=s(Dt);wd=a(ld,"A",{href:!0});var IM=s(wd);pg=d(IM,"TFBartForConditionalGeneration"),IM.forEach(t),hg=d(ld," is supported by this "),bs=a(ld,"A",{href:!0,rel:!0});var ZM=s(bs);ug=d(ZM,"example script"),ZM.forEach(t),mg=d(ld," and "),ys=a(ld,"A",{href:!0,rel:!0});var GM=s(ys);fg=d(GM,"notebook"),GM.forEach(t),gg=d(ld,"."),ld.forEach(t),_g=p(Ne),un=a(Ne,"LI",{});var wh=s(un);Md=a(wh,"A",{href:!0});var WM=s(Md);bg=d(WM,"FlaxBartForConditionalGeneration"),WM.forEach(t),yg=d(wh," is supported by this "),ks=a(wh,"A",{href:!0,rel:!0});var AM=s(ks);kg=d(AM,"example script"),AM.forEach(t),vg=d(wh,"."),wh.forEach(t),Tg=p(Ne),Fd=a(Ne,"LI",{});var D2=s(Fd);vs=a(D2,"A",{href:!0,rel:!0});var NM=s(vs);wg=d(NM,"Summarization"),NM.forEach(t),Mg=d(D2," chapter of the \u{1F917} Hugging Face course."),D2.forEach(t),Fg=p(Ne),Dl=a(Ne,"LI",{});var RM=s(Dl);xd=a(RM,"A",{href:!0});var SM=s(xd);xg=d(SM,"Summarization task guide"),SM.forEach(t),RM.forEach(t),Ne.forEach(t),Ih=p(o),v(Ts.$$.fragment,o),Zh=p(o),ut=a(o,"UL",{});var lo=s(ut);Kt=a(lo,"LI",{});var cd=s(Kt);$d=a(cd,"A",{href:!0});var XM=s($d);$g=d(XM,"BartForConditionalGeneration"),XM.forEach(t),jg=d(cd," is supported by this "),ws=a(cd,"A",{href:!0,rel:!0});var VM=s(ws);Bg=d(VM,"example script"),VM.forEach(t),zg=d(cd," and "),Ms=a(cd,"A",{href:!0,rel:!0});var PM=s(Ms);Jg=d(PM,"notebook"),PM.forEach(t),qg=d(cd,"."),cd.forEach(t),Eg=p(lo),eo=a(lo,"LI",{});var pd=s(eo);jd=a(pd,"A",{href:!0});var QM=s(jd);Cg=d(QM,"TFBartForConditionalGeneration"),QM.forEach(t),Ug=d(pd," is supported by this "),Fs=a(pd,"A",{href:!0,rel:!0});var YM=s(Fs);Ig=d(YM,"example script"),YM.forEach(t),Zg=d(pd," and "),xs=a(pd,"A",{href:!0,rel:!0});var LM=s(xs);Gg=d(LM,"notebook"),LM.forEach(t),Wg=d(pd,"."),pd.forEach(t),Ag=p(lo),to=a(lo,"LI",{});var hd=s(to);Bd=a(hd,"A",{href:!0});var OM=s(Bd);Ng=d(OM,"FlaxBartForConditionalGeneration"),OM.forEach(t),Rg=d(hd," is supported by this "),$s=a(hd,"A",{href:!0,rel:!0});var HM=s($s);Sg=d(HM,"example script"),HM.forEach(t),Xg=d(hd," and "),js=a(hd,"A",{href:!0,rel:!0});var DM=s(js);Vg=d(DM,"notebook"),DM.forEach(t),Pg=d(hd,"."),hd.forEach(t),Qg=p(lo),zd=a(lo,"LI",{});var K2=s(zd);Bs=a(K2,"A",{href:!0,rel:!0});var KM=s(Bs);Yg=d(KM,"Masked language modeling"),KM.forEach(t),Lg=d(K2," chapter of the \u{1F917} Hugging Face Course."),K2.forEach(t),Og=p(lo),Kl=a(lo,"LI",{});var e0=s(Kl);Jd=a(e0,"A",{href:!0});var t0=s(Jd);Hg=d(t0,"Masked language modeling task guide"),t0.forEach(t),e0.forEach(t),lo.forEach(t),Gh=p(o),v(zs.$$.fragment,o),Wh=p(o),Jt=a(o,"UL",{});var Ua=s(Jt);Js=a(Ua,"LI",{});var $u=s(Js);Dg=d($u,"A notebook on how to "),qs=a($u,"A",{href:!0,rel:!0});var o0=s(qs);Kg=d(o0,"finetune mBART using Seq2SeqTrainer for Hindi to English translation"),o0.forEach(t),e_=d($u,". \u{1F30E}"),$u.forEach(t),t_=p(Ua),oo=a(Ua,"LI",{});var ud=s(oo);qd=a(ud,"A",{href:!0});var n0=s(qd);o_=d(n0,"BartForConditionalGeneration"),n0.forEach(t),n_=d(ud," is supported by this "),Es=a(ud,"A",{href:!0,rel:!0});var a0=s(Es);a_=d(a0,"example script"),a0.forEach(t),s_=d(ud," and "),Cs=a(ud,"A",{href:!0,rel:!0});var s0=s(Cs);r_=d(s0,"notebook"),s0.forEach(t),i_=d(ud,"."),ud.forEach(t),d_=p(Ua),no=a(Ua,"LI",{});var md=s(no);Ed=a(md,"A",{href:!0});var r0=s(Ed);l_=d(r0,"TFBartForConditionalGeneration"),r0.forEach(t),c_=d(md," is supported by this "),Us=a(md,"A",{href:!0,rel:!0});var i0=s(Us);p_=d(i0,"example script"),i0.forEach(t),h_=d(md," and "),Is=a(md,"A",{href:!0,rel:!0});var d0=s(Is);u_=d(d0,"notebook"),d0.forEach(t),m_=d(md,"."),md.forEach(t),f_=p(Ua),ec=a(Ua,"LI",{});var l0=s(ec);Cd=a(l0,"A",{href:!0});var c0=s(Cd);g_=d(c0,"Translation task guide"),c0.forEach(t),l0.forEach(t),Ua.forEach(t),Ah=p(o),Ud=a(o,"P",{});var p0=s(Ud);__=d(p0,"See also:"),p0.forEach(t),Nh=p(o),ao=a(o,"UL",{});var gl=s(ao);tc=a(gl,"LI",{});var h0=s(tc);Id=a(h0,"A",{href:!0});var u0=s(Id);b_=d(u0,"Text classification task guide"),u0.forEach(t),h0.forEach(t),y_=p(gl),oc=a(gl,"LI",{});var m0=s(oc);Zd=a(m0,"A",{href:!0});var f0=s(Zd);k_=d(f0,"Question answering task guide"),f0.forEach(t),m0.forEach(t),v_=p(gl),nc=a(gl,"LI",{});var g0=s(nc);Gd=a(g0,"A",{href:!0});var _0=s(Gd);T_=d(_0,"Causal language modeling task guide"),_0.forEach(t),g0.forEach(t),gl.forEach(t),Rh=p(o),xo=a(o,"H2",{class:!0});var ju=s(xo);mn=a(ju,"A",{id:!0,class:!0,href:!0});var b0=s(mn);ac=a(b0,"SPAN",{});var y0=s(ac);v(Zs.$$.fragment,y0),y0.forEach(t),b0.forEach(t),w_=p(ju),sc=a(ju,"SPAN",{});var k0=s(sc);M_=d(k0,"BartConfig"),k0.forEach(t),ju.forEach(t),Sh=p(o),yt=a(o,"DIV",{class:!0});var Ia=s(yt);v(Gs.$$.fragment,Ia),F_=p(Ia),$o=a(Ia,"P",{});var _l=s($o);x_=d(_l,"This is the configuration class to store the configuration of a "),Wd=a(_l,"A",{href:!0});var v0=s(Wd);$_=d(v0,"BartModel"),v0.forEach(t),j_=d(_l,`. 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
`),Ws=a(_l,"A",{href:!0,rel:!0});var T0=s(Ws);B_=d(T0,"facebook/bart-large"),T0.forEach(t),z_=d(_l," architecture."),_l.forEach(t),J_=p(Ia),jo=a(Ia,"P",{});var bl=s(jo);q_=d(bl,"Configuration objects inherit from "),Ad=a(bl,"A",{href:!0});var w0=s(Ad);E_=d(w0,"PretrainedConfig"),w0.forEach(t),C_=d(bl,` and can be used to control the model outputs. Read the
documentation from `),Nd=a(bl,"A",{href:!0});var M0=s(Nd);U_=d(M0,"PretrainedConfig"),M0.forEach(t),I_=d(bl," for more information."),bl.forEach(t),Z_=p(Ia),v(fn.$$.fragment,Ia),Ia.forEach(t),Xh=p(o),Bo=a(o,"H2",{class:!0});var Bu=s(Bo);gn=a(Bu,"A",{id:!0,class:!0,href:!0});var F0=s(gn);rc=a(F0,"SPAN",{});var x0=s(rc);v(As.$$.fragment,x0),x0.forEach(t),F0.forEach(t),G_=p(Bu),ic=a(Bu,"SPAN",{});var $0=s(ic);W_=d($0,"BartTokenizer"),$0.forEach(t),Bu.forEach(t),Vh=p(o),N=a(o,"DIV",{class:!0});var ne=s(N);v(Ns.$$.fragment,ne),A_=p(ne),dc=a(ne,"P",{});var j0=s(dc);N_=d(j0,"Constructs a BART tokenizer, which is smilar to the ROBERTa tokenizer, using byte-level Byte-Pair-Encoding."),j0.forEach(t),R_=p(ne),lc=a(ne,"P",{});var B0=s(lc);S_=d(B0,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),B0.forEach(t),X_=p(ne),v(_n.$$.fragment,ne),V_=p(ne),Rs=a(ne,"P",{});var zu=s(Rs);P_=d(zu,"You can get around that behavior by passing "),cc=a(zu,"CODE",{});var z0=s(cc);Q_=d(z0,"add_prefix_space=True"),z0.forEach(t),Y_=d(zu,` 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.`),zu.forEach(t),L_=p(ne),v(bn.$$.fragment,ne),O_=p(ne),Ss=a(ne,"P",{});var Ju=s(Ss);H_=d(Ju,"This tokenizer inherits from "),Rd=a(Ju,"A",{href:!0});var J0=s(Rd);D_=d(J0,"PreTrainedTokenizer"),J0.forEach(t),K_=d(Ju,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Ju.forEach(t),eb=p(ne),so=a(ne,"DIV",{class:!0});var yl=s(so);v(Xs.$$.fragment,yl),tb=p(yl),pc=a(yl,"P",{});var q0=s(pc);ob=d(q0,`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:`),q0.forEach(t),nb=p(yl),Vs=a(yl,"UL",{});var qu=s(Vs);Sd=a(qu,"LI",{});var eM=s(Sd);ab=d(eM,"single sequence: "),hc=a(eM,"CODE",{});var E0=s(hc);sb=d(E0,"<s> X </s>"),E0.forEach(t),eM.forEach(t),rb=p(qu),Xd=a(qu,"LI",{});var tM=s(Xd);ib=d(tM,"pair of sequences: "),uc=a(tM,"CODE",{});var C0=s(uc);db=d(C0,"<s> A </s></s> B </s>"),C0.forEach(t),tM.forEach(t),qu.forEach(t),yl.forEach(t),lb=p(ne),yn=a(ne,"DIV",{class:!0});var Eu=s(yn);v(Ps.$$.fragment,Eu),cb=p(Eu),mc=a(Eu,"P",{});var U0=s(mc);pb=d(U0,"Converts a sequence of tokens (string) in a single string."),U0.forEach(t),Eu.forEach(t),hb=p(ne),kn=a(ne,"DIV",{class:!0});var Cu=s(kn);v(Qs.$$.fragment,Cu),ub=p(Cu),fc=a(Cu,"P",{});var I0=s(fc);mb=d(I0,`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.`),I0.forEach(t),Cu.forEach(t),fb=p(ne),vn=a(ne,"DIV",{class:!0});var Uu=s(vn);v(Ys.$$.fragment,Uu),gb=p(Uu),Ls=a(Uu,"P",{});var Iu=s(Ls);_b=d(Iu,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),gc=a(Iu,"CODE",{});var Z0=s(gc);bb=d(Z0,"prepare_for_model"),Z0.forEach(t),yb=d(Iu," method."),Iu.forEach(t),Uu.forEach(t),ne.forEach(t),Ph=p(o),zo=a(o,"H2",{class:!0});var Zu=s(zo);Tn=a(Zu,"A",{id:!0,class:!0,href:!0});var G0=s(Tn);_c=a(G0,"SPAN",{});var W0=s(_c);v(Os.$$.fragment,W0),W0.forEach(t),G0.forEach(t),kb=p(Zu),bc=a(Zu,"SPAN",{});var A0=s(bc);vb=d(A0,"BartTokenizerFast"),A0.forEach(t),Zu.forEach(t),Qh=p(o),fe=a(o,"DIV",{class:!0});var Re=s(fe);v(Hs.$$.fragment,Re),Tb=p(Re),Ds=a(Re,"P",{});var Gu=s(Ds);wb=d(Gu,"Construct a \u201Cfast\u201D BART tokenizer (backed by HuggingFace\u2019s "),yc=a(Gu,"EM",{});var N0=s(yc);Mb=d(N0,"tokenizers"),N0.forEach(t),Fb=d(Gu,` library), derived from the GPT-2 tokenizer,
using byte-level Byte-Pair-Encoding.`),Gu.forEach(t),xb=p(Re),kc=a(Re,"P",{});var R0=s(kc);$b=d(R0,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),R0.forEach(t),jb=p(Re),v(wn.$$.fragment,Re),Bb=p(Re),Ks=a(Re,"P",{});var Wu=s(Ks);zb=d(Wu,"You can get around that behavior by passing "),vc=a(Wu,"CODE",{});var S0=s(vc);Jb=d(S0,"add_prefix_space=True"),S0.forEach(t),qb=d(Wu,` 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.`),Wu.forEach(t),Eb=p(Re),v(Mn.$$.fragment,Re),Cb=p(Re),er=a(Re,"P",{});var Au=s(er);Ub=d(Au,"This tokenizer inherits from "),Vd=a(Au,"A",{href:!0});var X0=s(Vd);Ib=d(X0,"PreTrainedTokenizerFast"),X0.forEach(t),Zb=d(Au,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Au.forEach(t),Gb=p(Re),Fn=a(Re,"DIV",{class:!0});var Nu=s(Fn);v(tr.$$.fragment,Nu),Wb=p(Nu),Tc=a(Nu,"P",{});var V0=s(Tc);Ab=d(V0,`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.`),V0.forEach(t),Nu.forEach(t),Re.forEach(t),Yh=p(o),Jo=a(o,"H2",{class:!0});var Ru=s(Jo);xn=a(Ru,"A",{id:!0,class:!0,href:!0});var P0=s(xn);wc=a(P0,"SPAN",{});var Q0=s(wc);v(or.$$.fragment,Q0),Q0.forEach(t),P0.forEach(t),Nb=p(Ru),Mc=a(Ru,"SPAN",{});var Y0=s(Mc);Rb=d(Y0,"BartModel"),Y0.forEach(t),Ru.forEach(t),Lh=p(o),kt=a(o,"DIV",{class:!0});var Za=s(kt);v(nr.$$.fragment,Za),Sb=p(Za),ar=a(Za,"P",{});var Su=s(ar);Xb=d(Su,`The bare BART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Pd=a(Su,"A",{href:!0});var L0=s(Pd);Vb=d(L0,"PreTrainedModel"),L0.forEach(t),Pb=d(Su,`. 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.)`),Su.forEach(t),Qb=p(Za),sr=a(Za,"P",{});var Xu=s(sr);Yb=d(Xu,"This model is also a PyTorch "),rr=a(Xu,"A",{href:!0,rel:!0});var O0=s(rr);Lb=d(O0,"torch.nn.Module"),O0.forEach(t),Ob=d(Xu,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Xu.forEach(t),Hb=p(Za),qt=a(Za,"DIV",{class:!0});var Ga=s(qt);v(ir.$$.fragment,Ga),Db=p(Ga),qo=a(Ga,"P",{});var kl=s(qo);Kb=d(kl,"The "),Qd=a(kl,"A",{href:!0});var H0=s(Qd);ey=d(H0,"BartModel"),H0.forEach(t),ty=d(kl," forward method, overrides the "),Fc=a(kl,"CODE",{});var D0=s(Fc);oy=d(D0,"__call__"),D0.forEach(t),ny=d(kl," special method."),kl.forEach(t),ay=p(Ga),v($n.$$.fragment,Ga),sy=p(Ga),v(jn.$$.fragment,Ga),Ga.forEach(t),Za.forEach(t),Oh=p(o),Eo=a(o,"H2",{class:!0});var Vu=s(Eo);Bn=a(Vu,"A",{id:!0,class:!0,href:!0});var K0=s(Bn);xc=a(K0,"SPAN",{});var e1=s(xc);v(dr.$$.fragment,e1),e1.forEach(t),K0.forEach(t),ry=p(Vu),$c=a(Vu,"SPAN",{});var t1=s($c);iy=d(t1,"BartForConditionalGeneration"),t1.forEach(t),Vu.forEach(t),Hh=p(o),vt=a(o,"DIV",{class:!0});var Wa=s(vt);v(lr.$$.fragment,Wa),dy=p(Wa),cr=a(Wa,"P",{});var Pu=s(cr);ly=d(Pu,`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),Yd=a(Pu,"A",{href:!0});var o1=s(Yd);cy=d(o1,"PreTrainedModel"),o1.forEach(t),py=d(Pu,`. 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.)`),Pu.forEach(t),hy=p(Wa),pr=a(Wa,"P",{});var Qu=s(pr);uy=d(Qu,"This model is also a PyTorch "),hr=a(Qu,"A",{href:!0,rel:!0});var n1=s(hr);my=d(n1,"torch.nn.Module"),n1.forEach(t),fy=d(Qu,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Qu.forEach(t),gy=p(Wa),mt=a(Wa,"DIV",{class:!0});var co=s(mt);v(ur.$$.fragment,co),_y=p(co),Co=a(co,"P",{});var vl=s(Co);by=d(vl,"The "),Ld=a(vl,"A",{href:!0});var a1=s(Ld);yy=d(a1,"BartForConditionalGeneration"),a1.forEach(t),ky=d(vl," forward method, overrides the "),jc=a(vl,"CODE",{});var s1=s(jc);vy=d(s1,"__call__"),s1.forEach(t),Ty=d(vl," special method."),vl.forEach(t),wy=p(co),v(zn.$$.fragment,co),My=p(co),v(Jn.$$.fragment,co),Fy=p(co),v(qn.$$.fragment,co),co.forEach(t),Wa.forEach(t),Dh=p(o),Uo=a(o,"H2",{class:!0});var Yu=s(Uo);En=a(Yu,"A",{id:!0,class:!0,href:!0});var r1=s(En);Bc=a(r1,"SPAN",{});var i1=s(Bc);v(mr.$$.fragment,i1),i1.forEach(t),r1.forEach(t),xy=p(Yu),zc=a(Yu,"SPAN",{});var d1=s(zc);$y=d(d1,"BartForSequenceClassification"),d1.forEach(t),Yu.forEach(t),Kh=p(o),ot=a(o,"DIV",{class:!0});var po=s(ot);v(fr.$$.fragment,po),jy=p(po),Jc=a(po,"P",{});var l1=s(Jc);By=d(l1,`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),l1.forEach(t),zy=p(po),gr=a(po,"P",{});var Lu=s(gr);Jy=d(Lu,"This model inherits from "),Od=a(Lu,"A",{href:!0});var c1=s(Od);qy=d(c1,"PreTrainedModel"),c1.forEach(t),Ey=d(Lu,`. 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.)`),Lu.forEach(t),Cy=p(po),_r=a(po,"P",{});var Ou=s(_r);Uy=d(Ou,"This model is also a PyTorch "),br=a(Ou,"A",{href:!0,rel:!0});var p1=s(br);Iy=d(p1,"torch.nn.Module"),p1.forEach(t),Zy=d(Ou,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ou.forEach(t),Gy=p(po),ft=a(po,"DIV",{class:!0});var ho=s(ft);v(yr.$$.fragment,ho),Wy=p(ho),Io=a(ho,"P",{});var Tl=s(Io);Ay=d(Tl,"The "),Hd=a(Tl,"A",{href:!0});var h1=s(Hd);Ny=d(h1,"BartForSequenceClassification"),h1.forEach(t),Ry=d(Tl," forward method, overrides the "),qc=a(Tl,"CODE",{});var u1=s(qc);Sy=d(u1,"__call__"),u1.forEach(t),Xy=d(Tl," special method."),Tl.forEach(t),Vy=p(ho),v(Cn.$$.fragment,ho),Py=p(ho),v(Un.$$.fragment,ho),Qy=p(ho),v(In.$$.fragment,ho),ho.forEach(t),po.forEach(t),eu=p(o),Zo=a(o,"H2",{class:!0});var Hu=s(Zo);Zn=a(Hu,"A",{id:!0,class:!0,href:!0});var m1=s(Zn);Ec=a(m1,"SPAN",{});var f1=s(Ec);v(kr.$$.fragment,f1),f1.forEach(t),m1.forEach(t),Yy=p(Hu),Cc=a(Hu,"SPAN",{});var g1=s(Cc);Ly=d(g1,"BartForQuestionAnswering"),g1.forEach(t),Hu.forEach(t),tu=p(o),nt=a(o,"DIV",{class:!0});var uo=s(nt);v(vr.$$.fragment,uo),Oy=p(uo),Go=a(uo,"P",{});var wl=s(Go);Hy=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 `),Uc=a(wl,"CODE",{});var _1=s(Uc);Dy=d(_1,"span start logits"),_1.forEach(t),Ky=d(wl," and "),Ic=a(wl,"CODE",{});var b1=s(Ic);ek=d(b1,"span end logits"),b1.forEach(t),tk=d(wl,")."),wl.forEach(t),ok=p(uo),Tr=a(uo,"P",{});var Du=s(Tr);nk=d(Du,"This model inherits from "),Dd=a(Du,"A",{href:!0});var y1=s(Dd);ak=d(y1,"PreTrainedModel"),y1.forEach(t),sk=d(Du,`. 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.)`),Du.forEach(t),rk=p(uo),wr=a(uo,"P",{});var Ku=s(wr);ik=d(Ku,"This model is also a PyTorch "),Mr=a(Ku,"A",{href:!0,rel:!0});var k1=s(Mr);dk=d(k1,"torch.nn.Module"),k1.forEach(t),lk=d(Ku,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ku.forEach(t),ck=p(uo),Et=a(uo,"DIV",{class:!0});var Aa=s(Et);v(Fr.$$.fragment,Aa),pk=p(Aa),Wo=a(Aa,"P",{});var Ml=s(Wo);hk=d(Ml,"The "),Kd=a(Ml,"A",{href:!0});var v1=s(Kd);uk=d(v1,"BartForQuestionAnswering"),v1.forEach(t),mk=d(Ml," forward method, overrides the "),Zc=a(Ml,"CODE",{});var T1=s(Zc);fk=d(T1,"__call__"),T1.forEach(t),gk=d(Ml," special method."),Ml.forEach(t),_k=p(Aa),v(Gn.$$.fragment,Aa),bk=p(Aa),v(Wn.$$.fragment,Aa),Aa.forEach(t),uo.forEach(t),ou=p(o),Ao=a(o,"H2",{class:!0});var em=s(Ao);An=a(em,"A",{id:!0,class:!0,href:!0});var w1=s(An);Gc=a(w1,"SPAN",{});var M1=s(Gc);v(xr.$$.fragment,M1),M1.forEach(t),w1.forEach(t),yk=p(em),Wc=a(em,"SPAN",{});var F1=s(Wc);kk=d(F1,"BartForCausalLM"),F1.forEach(t),em.forEach(t),nu=p(o),at=a(o,"DIV",{class:!0});var mo=s(at);v($r.$$.fragment,mo),vk=p(mo),Ac=a(mo,"P",{});var x1=s(Ac);Tk=d(x1,"BART decoder with with a language modeling head on top (linear layer with weights tied to the input embeddings)."),x1.forEach(t),wk=p(mo),jr=a(mo,"P",{});var tm=s(jr);Mk=d(tm,"This model inherits from "),el=a(tm,"A",{href:!0});var $1=s(el);Fk=d($1,"PreTrainedModel"),$1.forEach(t),xk=d(tm,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),tm.forEach(t),$k=p(mo),Br=a(mo,"P",{});var om=s(Br);jk=d(om,"This model is also a PyTorch "),zr=a(om,"A",{href:!0,rel:!0});var j1=s(zr);Bk=d(j1,"torch.nn.Module"),j1.forEach(t),zk=d(om,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),om.forEach(t),Jk=p(mo),Nn=a(mo,"DIV",{class:!0});var nm=s(Nn);v(Jr.$$.fragment,nm),qk=p(nm),v(Rn.$$.fragment,nm),nm.forEach(t),mo.forEach(t),au=p(o),No=a(o,"H2",{class:!0});var am=s(No);Sn=a(am,"A",{id:!0,class:!0,href:!0});var B1=s(Sn);Nc=a(B1,"SPAN",{});var z1=s(Nc);v(qr.$$.fragment,z1),z1.forEach(t),B1.forEach(t),Ek=p(am),Rc=a(am,"SPAN",{});var J1=s(Rc);Ck=d(J1,"TFBartModel"),J1.forEach(t),am.forEach(t),su=p(o),st=a(o,"DIV",{class:!0});var fo=s(st);v(Er.$$.fragment,fo),Uk=p(fo),Cr=a(fo,"P",{});var sm=s(Cr);Ik=d(sm,`The bare BART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),tl=a(sm,"A",{href:!0});var q1=s(tl);Zk=d(q1,"TFPreTrainedModel"),q1.forEach(t),Gk=d(sm,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),sm.forEach(t),Wk=p(fo),Ur=a(fo,"P",{});var rm=s(Ur);Ak=d(rm,"This model is also a "),Ir=a(rm,"A",{href:!0,rel:!0});var E1=s(Ir);Nk=d(E1,"tf.keras.Model"),E1.forEach(t),Rk=d(rm,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),rm.forEach(t),Sk=p(fo),v(Xn.$$.fragment,fo),Xk=p(fo),Ct=a(fo,"DIV",{class:!0});var Na=s(Ct);v(Zr.$$.fragment,Na),Vk=p(Na),Ro=a(Na,"P",{});var Fl=s(Ro);Pk=d(Fl,"The "),ol=a(Fl,"A",{href:!0});var C1=s(ol);Qk=d(C1,"TFBartModel"),C1.forEach(t),Yk=d(Fl," forward method, overrides the "),Sc=a(Fl,"CODE",{});var U1=s(Sc);Lk=d(U1,"__call__"),U1.forEach(t),Ok=d(Fl," special method."),Fl.forEach(t),Hk=p(Na),v(Vn.$$.fragment,Na),Dk=p(Na),v(Pn.$$.fragment,Na),Na.forEach(t),fo.forEach(t),ru=p(o),So=a(o,"H2",{class:!0});var im=s(So);Qn=a(im,"A",{id:!0,class:!0,href:!0});var I1=s(Qn);Xc=a(I1,"SPAN",{});var Z1=s(Xc);v(Gr.$$.fragment,Z1),Z1.forEach(t),I1.forEach(t),Kk=p(im),Vc=a(im,"SPAN",{});var G1=s(Vc);ev=d(G1,"TFBartForConditionalGeneration"),G1.forEach(t),im.forEach(t),iu=p(o),rt=a(o,"DIV",{class:!0});var go=s(rt);v(Wr.$$.fragment,go),tv=p(go),Ar=a(go,"P",{});var dm=s(Ar);ov=d(dm,`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),nl=a(dm,"A",{href:!0});var W1=s(nl);nv=d(W1,"TFPreTrainedModel"),W1.forEach(t),av=d(dm,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),dm.forEach(t),sv=p(go),Nr=a(go,"P",{});var lm=s(Nr);rv=d(lm,"This model is also a "),Rr=a(lm,"A",{href:!0,rel:!0});var A1=s(Rr);iv=d(A1,"tf.keras.Model"),A1.forEach(t),dv=d(lm,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),lm.forEach(t),lv=p(go),v(Yn.$$.fragment,go),cv=p(go),gt=a(go,"DIV",{class:!0});var _o=s(gt);v(Sr.$$.fragment,_o),pv=p(_o),Xo=a(_o,"P",{});var xl=s(Xo);hv=d(xl,"The "),al=a(xl,"A",{href:!0});var N1=s(al);uv=d(N1,"TFBartForConditionalGeneration"),N1.forEach(t),mv=d(xl," forward method, overrides the "),Pc=a(xl,"CODE",{});var R1=s(Pc);fv=d(R1,"__call__"),R1.forEach(t),gv=d(xl," special method."),xl.forEach(t),_v=p(_o),v(Ln.$$.fragment,_o),bv=p(_o),v(On.$$.fragment,_o),yv=p(_o),v(Hn.$$.fragment,_o),_o.forEach(t),go.forEach(t),du=p(o),Vo=a(o,"H2",{class:!0});var cm=s(Vo);Dn=a(cm,"A",{id:!0,class:!0,href:!0});var S1=s(Dn);Qc=a(S1,"SPAN",{});var X1=s(Qc);v(Xr.$$.fragment,X1),X1.forEach(t),S1.forEach(t),kv=p(cm),Yc=a(cm,"SPAN",{});var V1=s(Yc);vv=d(V1,"TFBartForSequenceClassification"),V1.forEach(t),cm.forEach(t),lu=p(o),Ue=a(o,"DIV",{class:!0});var Wt=s(Ue);v(Vr.$$.fragment,Wt),Tv=p(Wt),Lc=a(Wt,"P",{});var P1=s(Lc);wv=d(P1,`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),P1.forEach(t),Mv=p(Wt),Pr=a(Wt,"P",{});var pm=s(Pr);Fv=d(pm,"This model inherits from "),sl=a(pm,"A",{href:!0});var Q1=s(sl);xv=d(Q1,"TFPreTrainedModel"),Q1.forEach(t),$v=d(pm,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),pm.forEach(t),jv=p(Wt),Qr=a(Wt,"P",{});var hm=s(Qr);Bv=d(hm,"This model is also a "),Yr=a(hm,"A",{href:!0,rel:!0});var Y1=s(Yr);zv=d(Y1,"tf.keras.Model"),Y1.forEach(t),Jv=d(hm,` 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.`),hm.forEach(t),qv=p(Wt),v(Kn.$$.fragment,Wt),Ev=p(Wt),ro=a(Wt,"DIV",{class:!0});var $l=s(ro);v(Lr.$$.fragment,$l),Cv=p($l),Po=a($l,"P",{});var jl=s(Po);Uv=d(jl,"The "),rl=a(jl,"A",{href:!0});var L1=s(rl);Iv=d(L1,"TFBartForSequenceClassification"),L1.forEach(t),Zv=d(jl," forward method, overrides the "),Oc=a(jl,"CODE",{});var O1=s(Oc);Gv=d(O1,"__call__"),O1.forEach(t),Wv=d(jl," special method."),jl.forEach(t),Av=p($l),v(ea.$$.fragment,$l),$l.forEach(t),Wt.forEach(t),cu=p(o),Qo=a(o,"H2",{class:!0});var um=s(Qo);ta=a(um,"A",{id:!0,class:!0,href:!0});var H1=s(ta);Hc=a(H1,"SPAN",{});var D1=s(Hc);v(Or.$$.fragment,D1),D1.forEach(t),H1.forEach(t),Nv=p(um),Dc=a(um,"SPAN",{});var K1=s(Dc);Rv=d(K1,"FlaxBartModel"),K1.forEach(t),um.forEach(t),pu=p(o),ge=a(o,"DIV",{class:!0});var Se=s(ge);v(Hr.$$.fragment,Se),Sv=p(Se),Dr=a(Se,"P",{});var mm=s(Dr);Xv=d(mm,`The bare Bart Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),il=a(mm,"A",{href:!0});var eF=s(il);Vv=d(eF,"FlaxPreTrainedModel"),eF.forEach(t),Pv=d(mm,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),mm.forEach(t),Qv=p(Se),Kr=a(Se,"P",{});var fm=s(Kr);Yv=d(fm,`This model is also a Flax Linen
`),ei=a(fm,"A",{href:!0,rel:!0});var tF=s(ei);Lv=d(tF,"flax.nn.Module"),tF.forEach(t),Ov=d(fm,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),fm.forEach(t),Hv=p(Se),Kc=a(Se,"P",{});var oF=s(Kc);Dv=d(oF,"Finally, this model supports inherent JAX features such as:"),oF.forEach(t),Kv=p(Se),Rt=a(Se,"UL",{});var Ra=s(Rt);ep=a(Ra,"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(Ra),tp=a(Ra,"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(Ra),op=a(Ra,"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(Ra),np=a(Ra,"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),Ra.forEach(t),iT=p(Se),Ut=a(Se,"DIV",{class:!0});var Sa=s(Ut);v(si.$$.fragment,Sa),dT=p(Sa),Yo=a(Sa,"P",{});var Bl=s(Yo);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 hF=s(sp);hT=d(hF,"__call__"),hF.forEach(t),uT=d(Bl," special method."),Bl.forEach(t),mT=p(Sa),v(oa.$$.fragment,Sa),fT=p(Sa),v(na.$$.fragment,Sa),Sa.forEach(t),gT=p(Se),aa=a(Se,"DIV",{class:!0});var gm=s(aa);v(ri.$$.fragment,gm),_T=p(gm),v(sa.$$.fragment,gm),gm.forEach(t),bT=p(Se),ra=a(Se,"DIV",{class:!0});var _m=s(ra);v(ii.$$.fragment,_m),yT=p(_m),v(ia.$$.fragment,_m),_m.forEach(t),Se.forEach(t),hu=p(o),Lo=a(o,"H2",{class:!0});var bm=s(Lo);da=a(bm,"A",{id:!0,class:!0,href:!0});var uF=s(da);rp=a(uF,"SPAN",{});var mF=s(rp);v(di.$$.fragment,mF),mF.forEach(t),uF.forEach(t),kT=p(bm),ip=a(bm,"SPAN",{});var fF=s(ip);vT=d(fF,"FlaxBartForConditionalGeneration"),fF.forEach(t),bm.forEach(t),uu=p(o),_e=a(o,"DIV",{class:!0});var Xe=s(_e);v(li.$$.fragment,Xe),TT=p(Xe),ci=a(Xe,"P",{});var ym=s(ci);wT=d(ym,`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),dl=a(ym,"A",{href:!0});var gF=s(dl);MT=d(gF,"FlaxPreTrainedModel"),gF.forEach(t),FT=d(ym,`. 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.)`),ym.forEach(t),xT=p(Xe),pi=a(Xe,"P",{});var km=s(pi);$T=d(km,`This model is also a Flax Linen
`),hi=a(km,"A",{href:!0,rel:!0});var _F=s(hi);jT=d(_F,"flax.nn.Module"),_F.forEach(t),BT=d(km,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),km.forEach(t),zT=p(Xe),dp=a(Xe,"P",{});var bF=s(dp);JT=d(bF,"Finally, this model supports inherent JAX features such as:"),bF.forEach(t),qT=p(Xe),St=a(Xe,"UL",{});var Xa=s(St);lp=a(Xa,"LI",{});var yF=s(lp);ui=a(yF,"A",{href:!0,rel:!0});var kF=s(ui);ET=d(kF,"Just-In-Time (JIT) compilation"),kF.forEach(t),yF.forEach(t),CT=p(Xa),cp=a(Xa,"LI",{});var vF=s(cp);mi=a(vF,"A",{href:!0,rel:!0});var TF=s(mi);UT=d(TF,"Automatic Differentiation"),TF.forEach(t),vF.forEach(t),IT=p(Xa),pp=a(Xa,"LI",{});var wF=s(pp);fi=a(wF,"A",{href:!0,rel:!0});var MF=s(fi);ZT=d(MF,"Vectorization"),MF.forEach(t),wF.forEach(t),GT=p(Xa),hp=a(Xa,"LI",{});var FF=s(hp);gi=a(FF,"A",{href:!0,rel:!0});var xF=s(gi);WT=d(xF,"Parallelization"),xF.forEach(t),FF.forEach(t),Xa.forEach(t),AT=p(Xe),_t=a(Xe,"DIV",{class:!0});var bo=s(_t);v(_i.$$.fragment,bo),NT=p(bo),Oo=a(bo,"P",{});var zl=s(Oo);RT=d(zl,"The "),up=a(zl,"CODE",{});var $F=s(up);ST=d($F,"FlaxBartPreTrainedModel"),$F.forEach(t),XT=d(zl," forward method, overrides the "),mp=a(zl,"CODE",{});var jF=s(mp);VT=d(jF,"__call__"),jF.forEach(t),PT=d(zl," special method."),zl.forEach(t),QT=p(bo),v(la.$$.fragment,bo),YT=p(bo),v(ca.$$.fragment,bo),LT=p(bo),v(pa.$$.fragment,bo),bo.forEach(t),OT=p(Xe),ha=a(Xe,"DIV",{class:!0});var vm=s(ha);v(bi.$$.fragment,vm),HT=p(vm),v(ua.$$.fragment,vm),vm.forEach(t),DT=p(Xe),ma=a(Xe,"DIV",{class:!0});var Tm=s(ma);v(yi.$$.fragment,Tm),KT=p(Tm),v(fa.$$.fragment,Tm),Tm.forEach(t),Xe.forEach(t),mu=p(o),Ho=a(o,"H2",{class:!0});var wm=s(Ho);ga=a(wm,"A",{id:!0,class:!0,href:!0});var BF=s(ga);fp=a(BF,"SPAN",{});var zF=s(fp);v(ki.$$.fragment,zF),zF.forEach(t),BF.forEach(t),ew=p(wm),gp=a(wm,"SPAN",{});var JF=s(gp);tw=d(JF,"FlaxBartForSequenceClassification"),JF.forEach(t),wm.forEach(t),fu=p(o),O=a(o,"DIV",{class:!0});var ze=s(O);v(vi.$$.fragment,ze),ow=p(ze),_p=a(ze,"P",{});var qF=s(_p);nw=d(qF,`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),qF.forEach(t),aw=p(ze),Ti=a(ze,"P",{});var Mm=s(Ti);sw=d(Mm,"This model inherits from "),ll=a(Mm,"A",{href:!0});var EF=s(ll);rw=d(EF,"FlaxPreTrainedModel"),EF.forEach(t),iw=d(Mm,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Mm.forEach(t),dw=p(ze),wi=a(ze,"P",{});var Fm=s(wi);lw=d(Fm,`This model is also a Flax Linen
`),Mi=a(Fm,"A",{href:!0,rel:!0});var CF=s(Mi);cw=d(CF,"flax.nn.Module"),CF.forEach(t),pw=d(Fm,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Fm.forEach(t),hw=p(ze),bp=a(ze,"P",{});var UF=s(bp);uw=d(UF,"Finally, this model supports inherent JAX features such as:"),UF.forEach(t),mw=p(ze),Xt=a(ze,"UL",{});var Va=s(Xt);yp=a(Va,"LI",{});var IF=s(yp);Fi=a(IF,"A",{href:!0,rel:!0});var ZF=s(Fi);fw=d(ZF,"Just-In-Time (JIT) compilation"),ZF.forEach(t),IF.forEach(t),gw=p(Va),kp=a(Va,"LI",{});var GF=s(kp);xi=a(GF,"A",{href:!0,rel:!0});var WF=s(xi);_w=d(WF,"Automatic Differentiation"),WF.forEach(t),GF.forEach(t),bw=p(Va),vp=a(Va,"LI",{});var AF=s(vp);$i=a(AF,"A",{href:!0,rel:!0});var NF=s($i);yw=d(NF,"Vectorization"),NF.forEach(t),AF.forEach(t),kw=p(Va),Tp=a(Va,"LI",{});var RF=s(Tp);ji=a(RF,"A",{href:!0,rel:!0});var SF=s(ji);vw=d(SF,"Parallelization"),SF.forEach(t),RF.forEach(t),Va.forEach(t),Tw=p(ze),It=a(ze,"DIV",{class:!0});var Pa=s(It);v(Bi.$$.fragment,Pa),ww=p(Pa),Do=a(Pa,"P",{});var Jl=s(Do);Mw=d(Jl,"The "),wp=a(Jl,"CODE",{});var XF=s(wp);Fw=d(XF,"FlaxBartPreTrainedModel"),XF.forEach(t),xw=d(Jl," forward method, overrides the "),Mp=a(Jl,"CODE",{});var VF=s(Mp);$w=d(VF,"__call__"),VF.forEach(t),jw=d(Jl," special method."),Jl.forEach(t),Bw=p(Pa),v(_a.$$.fragment,Pa),zw=p(Pa),v(ba.$$.fragment,Pa),Pa.forEach(t),Jw=p(ze),ya=a(ze,"DIV",{class:!0});var xm=s(ya);v(zi.$$.fragment,xm),qw=p(xm),v(ka.$$.fragment,xm),xm.forEach(t),Ew=p(ze),va=a(ze,"DIV",{class:!0});var $m=s(va);v(Ji.$$.fragment,$m),Cw=p($m),v(Ta.$$.fragment,$m),$m.forEach(t),ze.forEach(t),gu=p(o),Ko=a(o,"H2",{class:!0});var jm=s(Ko);wa=a(jm,"A",{id:!0,class:!0,href:!0});var PF=s(wa);Fp=a(PF,"SPAN",{});var QF=s(Fp);v(qi.$$.fragment,QF),QF.forEach(t),PF.forEach(t),Uw=p(jm),xp=a(jm,"SPAN",{});var YF=s(xp);Iw=d(YF,"FlaxBartForQuestionAnswering"),YF.forEach(t),jm.forEach(t),_u=p(o),H=a(o,"DIV",{class:!0});var Je=s(H);v(Ei.$$.fragment,Je),Zw=p(Je),en=a(Je,"P",{});var ql=s(en);Gw=d(ql,`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 `),$p=a(ql,"CODE",{});var LF=s($p);Ww=d(LF,"span start logits"),LF.forEach(t),Aw=d(ql," and "),jp=a(ql,"CODE",{});var OF=s(jp);Nw=d(OF,"span end logits"),OF.forEach(t),Rw=d(ql,")."),ql.forEach(t),Sw=p(Je),Ci=a(Je,"P",{});var Bm=s(Ci);Xw=d(Bm,"This model inherits from "),cl=a(Bm,"A",{href:!0});var HF=s(cl);Vw=d(HF,"FlaxPreTrainedModel"),HF.forEach(t),Pw=d(Bm,`. 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.)`),Bm.forEach(t),Qw=p(Je),Ui=a(Je,"P",{});var zm=s(Ui);Yw=d(zm,`This model is also a Flax Linen
`),Ii=a(zm,"A",{href:!0,rel:!0});var DF=s(Ii);Lw=d(DF,"flax.nn.Module"),DF.forEach(t),Ow=d(zm,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),zm.forEach(t),Hw=p(Je),Bp=a(Je,"P",{});var KF=s(Bp);Dw=d(KF,"Finally, this model supports inherent JAX features such as:"),KF.forEach(t),Kw=p(Je),Vt=a(Je,"UL",{});var Qa=s(Vt);zp=a(Qa,"LI",{});var ex=s(zp);Zi=a(ex,"A",{href:!0,rel:!0});var tx=s(Zi);e2=d(tx,"Just-In-Time (JIT) compilation"),tx.forEach(t),ex.forEach(t),t2=p(Qa),Jp=a(Qa,"LI",{});var ox=s(Jp);Gi=a(ox,"A",{href:!0,rel:!0});var nx=s(Gi);o2=d(nx,"Automatic Differentiation"),nx.forEach(t),ox.forEach(t),n2=p(Qa),qp=a(Qa,"LI",{});var ax=s(qp);Wi=a(ax,"A",{href:!0,rel:!0});var sx=s(Wi);a2=d(sx,"Vectorization"),sx.forEach(t),ax.forEach(t),s2=p(Qa),Ep=a(Qa,"LI",{});var rx=s(Ep);Ai=a(rx,"A",{href:!0,rel:!0});var ix=s(Ai);r2=d(ix,"Parallelization"),ix.forEach(t),rx.forEach(t),Qa.forEach(t),i2=p(Je),Zt=a(Je,"DIV",{class:!0});var Ya=s(Zt);v(Ni.$$.fragment,Ya),d2=p(Ya),tn=a(Ya,"P",{});var El=s(tn);l2=d(El,"The "),Cp=a(El,"CODE",{});var dx=s(Cp);c2=d(dx,"FlaxBartPreTrainedModel"),dx.forEach(t),p2=d(El," forward method, overrides the "),Up=a(El,"CODE",{});var lx=s(Up);h2=d(lx,"__call__"),lx.forEach(t),u2=d(El," special method."),El.forEach(t),m2=p(Ya),v(Ma.$$.fragment,Ya),f2=p(Ya),v(Fa.$$.fragment,Ya),Ya.forEach(t),g2=p(Je),xa=a(Je,"DIV",{class:!0});var Jm=s(xa);v(Ri.$$.fragment,Jm),_2=p(Jm),v($a.$$.fragment,Jm),Jm.forEach(t),b2=p(Je),ja=a(Je,"DIV",{class:!0});var qm=s(ja);v(Si.$$.fragment,qm),y2=p(qm),v(Ba.$$.fragment,qm),qm.forEach(t),Je.forEach(t),bu=p(o),on=a(o,"H2",{class:!0});var Em=s(on);za=a(Em,"A",{id:!0,class:!0,href:!0});var cx=s(za);Ip=a(cx,"SPAN",{});var px=s(Ip);v(Xi.$$.fragment,px),px.forEach(t),cx.forEach(t),k2=p(Em),Zp=a(Em,"SPAN",{});var hx=s(Zp);v2=d(hx,"FlaxBartForCausalLM"),hx.forEach(t),Em.forEach(t),yu=p(o),Me=a(o,"DIV",{class:!0});var bt=s(Me);v(Vi.$$.fragment,bt),T2=p(bt),Gp=a(bt,"P",{});var ux=s(Gp);w2=d(ux,`Bart Decoder Model with a language modeling head on top (linear layer with weights tied to the input embeddings)
e.g for autoregressive tasks.`),ux.forEach(t),M2=p(bt),Pi=a(bt,"P",{});var Cm=s(Pi);F2=d(Cm,"This model inherits from "),pl=a(Cm,"A",{href:!0});var mx=s(pl);x2=d(mx,"FlaxPreTrainedModel"),mx.forEach(t),$2=d(Cm,`. 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.)`),Cm.forEach(t),j2=p(bt),Qi=a(bt,"P",{});var Um=s(Qi);B2=d(Um,`This model is also a Flax Linen
`),Yi=a(Um,"A",{href:!0,rel:!0});var fx=s(Yi);z2=d(fx,"flax.nn.Module"),fx.forEach(t),J2=d(Um,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Um.forEach(t),q2=p(bt),Wp=a(bt,"P",{});var gx=s(Wp);E2=d(gx,"Finally, this model supports inherent JAX features such as:"),gx.forEach(t),C2=p(bt),Pt=a(bt,"UL",{});var La=s(Pt);Ap=a(La,"LI",{});var _x=s(Ap);Li=a(_x,"A",{href:!0,rel:!0});var bx=s(Li);U2=d(bx,"Just-In-Time (JIT) compilation"),bx.forEach(t),_x.forEach(t),I2=p(La),Np=a(La,"LI",{});var yx=s(Np);Oi=a(yx,"A",{href:!0,rel:!0});var kx=s(Oi);Z2=d(kx,"Automatic Differentiation"),kx.forEach(t),yx.forEach(t),G2=p(La),Rp=a(La,"LI",{});var vx=s(Rp);Hi=a(vx,"A",{href:!0,rel:!0});var Tx=s(Hi);W2=d(Tx,"Vectorization"),Tx.forEach(t),vx.forEach(t),A2=p(La),Sp=a(La,"LI",{});var wx=s(Sp);Di=a(wx,"A",{href:!0,rel:!0});var Mx=s(Di);N2=d(Mx,"Parallelization"),Mx.forEach(t),wx.forEach(t),La.forEach(t),R2=p(bt),Gt=a(bt,"DIV",{class:!0});var Oa=s(Gt);v(Ki.$$.fragment,Oa),S2=p(Oa),nn=a(Oa,"P",{});var Cl=s(nn);X2=d(Cl,"The "),Xp=a(Cl,"CODE",{});var Fx=s(Xp);V2=d(Fx,"FlaxBartDecoderPreTrainedModel"),Fx.forEach(t),P2=d(Cl," forward method, overrides the "),Vp=a(Cl,"CODE",{});var xx=s(Vp);Q2=d(xx,"__call__"),xx.forEach(t),Y2=d(Cl," special method."),Cl.forEach(t),L2=p(Oa),v(Ja.$$.fragment,Oa),O2=p(Oa),v(qa.$$.fragment,Oa),Oa.forEach(t),bt.forEach(t),this.h()},h(){h(l,"name","hf:doc:metadata"),h(l,"content",JSON.stringify(M$)),h(m,"id","bart"),h(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(m,"href","#bart"),h(f,"class","relative group"),h(ie,"alt","Models"),$x(ie.src,B="https://img.shields.io/badge/All_model_pages-bart-blueviolet")||h(ie,"src",B),h(re,"href","https://huggingface.co/models?filter=bart"),h(Fe,"alt","Spaces"),$x(Fe.src,it="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||h(Fe,"src",it),h(Y,"href","https://huggingface.co/spaces/docs-demos/bart-large-mnli"),h(Z,"class","flex flex-wrap space-x-1"),h(we,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),h(we,"rel","nofollow"),h(be,"id","overview"),h(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"),h(be,"href","#overview"),h(W,"class","relative group"),h(Q,"href","https://arxiv.org/abs/1910.13461"),h(Q,"rel","nofollow"),h(Ha,"href","https://huggingface.co/sshleifer"),h(Ha,"rel","nofollow"),h(Da,"href","https://github.com/pytorch/fairseq/tree/master/examples/bart"),h(Da,"rel","nofollow"),h(dn,"id","examples"),h(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"),h(dn,"href","#examples"),h(yo,"class","relative group"),h(ts,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/summarization/README.md"),h(ts,"rel","nofollow"),h(fd,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartForConditionalGeneration"),h(os,"href","https://discuss.huggingface.co/t/train-bart-for-conditional-generation-e-g-summarization/1904"),h(os,"rel","nofollow"),h(ns,"href","https://huggingface.co/models?search=distilbart"),h(ns,"rel","nofollow"),h(as,"href","https://arxiv.org/abs/2010.13002"),h(as,"rel","nofollow"),h(cn,"id","implementation-notes"),h(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"),h(cn,"href","#implementation-notes"),h(ko,"class","relative group"),h(gd,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartTokenizer"),h(_d,"href","/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode"),h(bd,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartModel"),h(kd,"href","/docs/transformers/v4.32.0/en/main_classes/text_generation#transformers.GenerationMixin.generate"),h(pn,"id","mask-filling"),h(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"),h(pn,"href","#mask-filling"),h(Mo,"class","relative group"),h(hn,"id","resources"),h(hn,"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"),h(hn,"href","#resources"),h(Fo,"class","relative group"),h(ps,"href","https://huggingface.co/blog/sagemaker-distributed-training-seq2seq"),h(ps,"rel","nofollow"),h(us,"href","https://colab.research.google.com/github/ohmeow/ohmeow_website/blob/master/posts/2021-05-25-mbart-sequence-classification-with-blurr.ipynb"),h(us,"rel","nofollow"),h(fs,"href","https://colab.research.google.com/github/elsanns/xai-nlp-notebooks/blob/master/fine_tune_bart_summarization_two_langs.ipynb"),h(fs,"rel","nofollow"),h(Td,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartForConditionalGeneration"),h(gs,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/summarization"),h(gs,"rel","nofollow"),h(_s,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/summarization.ipynb"),h(_s,"rel","nofollow"),h(wd,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.TFBartForConditionalGeneration"),h(bs,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/summarization"),h(bs,"rel","nofollow"),h(ys,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/summarization-tf.ipynb"),h(ys,"rel","nofollow"),h(Md,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.FlaxBartForConditionalGeneration"),h(ks,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/summarization"),h(ks,"rel","nofollow"),h(vs,"href","https://huggingface.co/course/chapter7/5?fw=pt#summarization"),h(vs,"rel","nofollow"),h(xd,"href","../tasks/summarization"),h($d,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartForConditionalGeneration"),h(ws,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/language-modeling#robertabertdistilbert-and-masked-language-modeling"),h(ws,"rel","nofollow"),h(Ms,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb"),h(Ms,"rel","nofollow"),h(jd,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.TFBartForConditionalGeneration"),h(Fs,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/language-modeling#run_mlmpy"),h(Fs,"rel","nofollow"),h(xs,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb"),h(xs,"rel","nofollow"),h(Bd,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.FlaxBartForConditionalGeneration"),h($s,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/language-modeling#masked-language-modeling"),h($s,"rel","nofollow"),h(js,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/masked_language_modeling_flax.ipynb"),h(js,"rel","nofollow"),h(Bs,"href","https://huggingface.co/course/chapter7/3?fw=pt"),h(Bs,"rel","nofollow"),h(Jd,"href","../tasks/masked_language_modeling"),h(qs,"href","https://colab.research.google.com/github/vasudevgupta7/huggingface-tutorials/blob/main/translation_training.ipynb"),h(qs,"rel","nofollow"),h(qd,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartForConditionalGeneration"),h(Es,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/translation"),h(Es,"rel","nofollow"),h(Cs,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/translation.ipynb"),h(Cs,"rel","nofollow"),h(Ed,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.TFBartForConditionalGeneration"),h(Us,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/translation"),h(Us,"rel","nofollow"),h(Is,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/translation-tf.ipynb"),h(Is,"rel","nofollow"),h(Cd,"href","../tasks/translation"),h(Id,"href","../tasks/sequence_classification"),h(Zd,"href","../tasks/question_answering"),h(Gd,"href","../tasks/language_modeling"),h(mn,"id","transformers.BartConfig"),h(mn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(mn,"href","#transformers.BartConfig"),h(xo,"class","relative group"),h(Wd,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartModel"),h(Ws,"href","https://huggingface.co/facebook/bart-large"),h(Ws,"rel","nofollow"),h(Ad,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(Nd,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(gn,"id","transformers.BartTokenizer"),h(gn,"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"),h(gn,"href","#transformers.BartTokenizer"),h(Bo,"class","relative group"),h(Rd,"href","/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),h(so,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(yn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(kn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(vn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Tn,"id","transformers.BartTokenizerFast"),h(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"),h(Tn,"href","#transformers.BartTokenizerFast"),h(zo,"class","relative group"),h(Vd,"href","/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),h(Fn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(xn,"id","transformers.BartModel"),h(xn,"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"),h(xn,"href","#transformers.BartModel"),h(Jo,"class","relative group"),h(Pd,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),h(rr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(rr,"rel","nofollow"),h(Qd,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartModel"),h(qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Bn,"id","transformers.BartForConditionalGeneration"),h(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"),h(Bn,"href","#transformers.BartForConditionalGeneration"),h(Eo,"class","relative group"),h(Yd,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),h(hr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(hr,"rel","nofollow"),h(Ld,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartForConditionalGeneration"),h(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(En,"id","transformers.BartForSequenceClassification"),h(En,"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"),h(En,"href","#transformers.BartForSequenceClassification"),h(Uo,"class","relative group"),h(Od,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),h(br,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(br,"rel","nofollow"),h(Hd,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartForSequenceClassification"),h(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Zn,"id","transformers.BartForQuestionAnswering"),h(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"),h(Zn,"href","#transformers.BartForQuestionAnswering"),h(Zo,"class","relative group"),h(Dd,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),h(Mr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Mr,"rel","nofollow"),h(Kd,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartForQuestionAnswering"),h(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(An,"id","transformers.BartForCausalLM"),h(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"),h(An,"href","#transformers.BartForCausalLM"),h(Ao,"class","relative group"),h(el,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),h(zr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(zr,"rel","nofollow"),h(Nn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Sn,"id","transformers.TFBartModel"),h(Sn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Sn,"href","#transformers.TFBartModel"),h(No,"class","relative group"),h(tl,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(Ir,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Ir,"rel","nofollow"),h(ol,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.TFBartModel"),h(Ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Qn,"id","transformers.TFBartForConditionalGeneration"),h(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"),h(Qn,"href","#transformers.TFBartForConditionalGeneration"),h(So,"class","relative group"),h(nl,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(Rr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Rr,"rel","nofollow"),h(al,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.TFBartForConditionalGeneration"),h(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Dn,"id","transformers.TFBartForSequenceClassification"),h(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"),h(Dn,"href","#transformers.TFBartForSequenceClassification"),h(Vo,"class","relative group"),h(sl,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(Yr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Yr,"rel","nofollow"),h(rl,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.TFBartForSequenceClassification"),h(ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ta,"id","transformers.FlaxBartModel"),h(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"),h(ta,"href","#transformers.FlaxBartModel"),h(Qo,"class","relative group"),h(il,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(ei,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),h(ei,"rel","nofollow"),h(ti,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(ti,"rel","nofollow"),h(oi,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(oi,"rel","nofollow"),h(ni,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(ni,"rel","nofollow"),h(ai,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(ai,"rel","nofollow"),h(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(aa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ra,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(da,"id","transformers.FlaxBartForConditionalGeneration"),h(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"),h(da,"href","#transformers.FlaxBartForConditionalGeneration"),h(Lo,"class","relative group"),h(dl,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(hi,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),h(hi,"rel","nofollow"),h(ui,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(ui,"rel","nofollow"),h(mi,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(mi,"rel","nofollow"),h(fi,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(fi,"rel","nofollow"),h(gi,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(gi,"rel","nofollow"),h(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ha,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ma,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ga,"id","transformers.FlaxBartForSequenceClassification"),h(ga,"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"),h(ga,"href","#transformers.FlaxBartForSequenceClassification"),h(Ho,"class","relative group"),h(ll,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Mi,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),h(Mi,"rel","nofollow"),h(Fi,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Fi,"rel","nofollow"),h(xi,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(xi,"rel","nofollow"),h($i,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h($i,"rel","nofollow"),h(ji,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(ji,"rel","nofollow"),h(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ya,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(va,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(wa,"id","transformers.FlaxBartForQuestionAnswering"),h(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"),h(wa,"href","#transformers.FlaxBartForQuestionAnswering"),h(Ko,"class","relative group"),h(cl,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Ii,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),h(Ii,"rel","nofollow"),h(Zi,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Zi,"rel","nofollow"),h(Gi,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Gi,"rel","nofollow"),h(Wi,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Wi,"rel","nofollow"),h(Ai,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Ai,"rel","nofollow"),h(Zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(xa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ja,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(za,"id","transformers.FlaxBartForCausalLM"),h(za,"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"),h(za,"href","#transformers.FlaxBartForCausalLM"),h(on,"class","relative group"),h(pl,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Yi,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),h(Yi,"rel","nofollow"),h(Li,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Li,"rel","nofollow"),h(Oi,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Oi,"rel","nofollow"),h(Hi,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Hi,"rel","nofollow"),h(Di,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Di,"rel","nofollow"),h(Gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,g){e(document.head,l),_(o,y,g),_(o,f,g),e(f,m),e(m,b),T(r,b,null),e(f,u),e(f,j),e(j,se),_(o,P,g),_(o,Z,g),e(Z,re),e(re,ie),e(Z,Ve),e(Z,Y),e(Y,Fe),_(o,D,g),_(o,de,g),e(de,qe),e(qe,le),e(de,Pe),e(de,we),e(we,ce),e(de,Qe),_(o,Ze,g),_(o,W,g),e(W,be),e(be,Ee),T(K,Ee,null),e(W,E),e(W,C),e(C,Ye),_(o,ee,g),_(o,ye,g),e(ye,Le),e(ye,Q),e(Q,Oe),e(ye,He),_(o,U,g),_(o,xe,g),e(xe,pe),_(o,Ge,g),_(o,te,g),e(te,L),e(L,De),e(te,Ke),e(te,X),e(X,et),e(te,he),e(te,Ce),e(Ce,$e),_(o,I,g),_(o,je,g),e(je,A),_(o,We,g),_(o,ke,g),e(ke,x),e(x,z),e(z,wt),e(ke,Be),e(ke,Ae),e(Ae,dt),e(dt,J),e(Ae,Mt),e(Ae,oe),e(oe,lt),e(lt,Ft),e(oe,xt),e(oe,V),e(V,ue),e(oe,$t),e(oe,ct),e(ct,me),e(oe,jt),e(oe,pt),e(pt,tt),e(oe,Bt),e(oe,ve),e(ve,zt),_(o,Mh,g),_(o,Yt,g),e(Yt,Im),e(Yt,Ha),e(Ha,Zm),e(Yt,Gm),e(Yt,Da),e(Da,Wm),e(Yt,Am),_(o,Fh,g),_(o,yo,g),e(yo,dn),e(dn,Ul),T(Ka,Ul,null),e(yo,Nm),e(yo,Il),e(Il,Rm),_(o,xh,g),_(o,Lt,g),e(Lt,es),e(es,Sm),e(es,ts),e(ts,Xm),e(es,Vm),e(Lt,Pm),e(Lt,At),e(At,Qm),e(At,fd),e(fd,Ym),e(At,Lm),e(At,Zl),e(Zl,Om),e(At,Hm),e(At,os),e(os,Dm),e(At,Km),e(Lt,ef),e(Lt,ln),e(ln,ns),e(ns,tf),e(ln,of),e(ln,as),e(as,nf),e(ln,af),_(o,$h,g),_(o,ko,g),e(ko,cn),e(cn,Gl),T(ss,Gl,null),e(ko,sf),e(ko,Wl),e(Wl,rf),_(o,jh,g),_(o,ht,g),e(ht,Nt),e(Nt,df),e(Nt,Al),e(Al,lf),e(Nt,cf),e(Nt,gd),e(gd,pf),e(Nt,hf),e(Nt,_d),e(_d,uf),e(Nt,mf),e(ht,ff),e(ht,vo),e(vo,gf),e(vo,bd),e(bd,_f),e(vo,bf),e(vo,Nl),e(Nl,yf),e(vo,kf),e(ht,vf),e(ht,To),e(To,Tf),e(To,Rl),e(Rl,wf),e(To,Mf),e(To,Sl),e(Sl,Ff),e(To,xf),e(ht,$f),e(ht,yd),e(yd,kd),e(kd,jf),e(yd,Bf),e(ht,zf),e(ht,wo),e(wo,Jf),e(wo,Xl),e(Xl,qf),e(wo,Ef),e(wo,Vl),e(Vl,Cf),e(wo,Uf),_(o,Bh,g),_(o,Mo,g),e(Mo,pn),e(pn,Pl),T(rs,Pl,null),e(Mo,If),e(Mo,Ql),e(Ql,Zf),_(o,zh,g),_(o,Ot,g),e(Ot,Gf),e(Ot,Yl),e(Yl,Wf),e(Ot,Af),e(Ot,Ll),e(Ll,Nf),e(Ot,Rf),_(o,Jh,g),T(is,o,g),_(o,qh,g),_(o,Fo,g),e(Fo,hn),e(hn,Ol),T(ds,Ol,null),e(Fo,Sf),e(Fo,Hl),e(Hl,Xf),_(o,Eh,g),_(o,vd,g),e(vd,Vf),_(o,Ch,g),T(ls,o,g),_(o,Uh,g),_(o,Te,g),e(Te,cs),e(cs,Pf),e(cs,ps),e(ps,Qf),e(cs,Yf),e(Te,Lf),e(Te,hs),e(hs,Of),e(hs,us),e(us,Hf),e(hs,Df),e(Te,Kf),e(Te,ms),e(ms,eg),e(ms,fs),e(fs,tg),e(ms,og),e(Te,ng),e(Te,Ht),e(Ht,Td),e(Td,ag),e(Ht,sg),e(Ht,gs),e(gs,rg),e(Ht,ig),e(Ht,_s),e(_s,dg),e(Ht,lg),e(Te,cg),e(Te,Dt),e(Dt,wd),e(wd,pg),e(Dt,hg),e(Dt,bs),e(bs,ug),e(Dt,mg),e(Dt,ys),e(ys,fg),e(Dt,gg),e(Te,_g),e(Te,un),e(un,Md),e(Md,bg),e(un,yg),e(un,ks),e(ks,kg),e(un,vg),e(Te,Tg),e(Te,Fd),e(Fd,vs),e(vs,wg),e(Fd,Mg),e(Te,Fg),e(Te,Dl),e(Dl,xd),e(xd,xg),_(o,Ih,g),T(Ts,o,g),_(o,Zh,g),_(o,ut,g),e(ut,Kt),e(Kt,$d),e($d,$g),e(Kt,jg),e(Kt,ws),e(ws,Bg),e(Kt,zg),e(Kt,Ms),e(Ms,Jg),e(Kt,qg),e(ut,Eg),e(ut,eo),e(eo,jd),e(jd,Cg),e(eo,Ug),e(eo,Fs),e(Fs,Ig),e(eo,Zg),e(eo,xs),e(xs,Gg),e(eo,Wg),e(ut,Ag),e(ut,to),e(to,Bd),e(Bd,Ng),e(to,Rg),e(to,$s),e($s,Sg),e(to,Xg),e(to,js),e(js,Vg),e(to,Pg),e(ut,Qg),e(ut,zd),e(zd,Bs),e(Bs,Yg),e(zd,Lg),e(ut,Og),e(ut,Kl),e(Kl,Jd),e(Jd,Hg),_(o,Gh,g),T(zs,o,g),_(o,Wh,g),_(o,Jt,g),e(Jt,Js),e(Js,Dg),e(Js,qs),e(qs,Kg),e(Js,e_),e(Jt,t_),e(Jt,oo),e(oo,qd),e(qd,o_),e(oo,n_),e(oo,Es),e(Es,a_),e(oo,s_),e(oo,Cs),e(Cs,r_),e(oo,i_),e(Jt,d_),e(Jt,no),e(no,Ed),e(Ed,l_),e(no,c_),e(no,Us),e(Us,p_),e(no,h_),e(no,Is),e(Is,u_),e(no,m_),e(Jt,f_),e(Jt,ec),e(ec,Cd),e(Cd,g_),_(o,Ah,g),_(o,Ud,g),e(Ud,__),_(o,Nh,g),_(o,ao,g),e(ao,tc),e(tc,Id),e(Id,b_),e(ao,y_),e(ao,oc),e(oc,Zd),e(Zd,k_),e(ao,v_),e(ao,nc),e(nc,Gd),e(Gd,T_),_(o,Rh,g),_(o,xo,g),e(xo,mn),e(mn,ac),T(Zs,ac,null),e(xo,w_),e(xo,sc),e(sc,M_),_(o,Sh,g),_(o,yt,g),T(Gs,yt,null),e(yt,F_),e(yt,$o),e($o,x_),e($o,Wd),e(Wd,$_),e($o,j_),e($o,Ws),e(Ws,B_),e($o,z_),e(yt,J_),e(yt,jo),e(jo,q_),e(jo,Ad),e(Ad,E_),e(jo,C_),e(jo,Nd),e(Nd,U_),e(jo,I_),e(yt,Z_),T(fn,yt,null),_(o,Xh,g),_(o,Bo,g),e(Bo,gn),e(gn,rc),T(As,rc,null),e(Bo,G_),e(Bo,ic),e(ic,W_),_(o,Vh,g),_(o,N,g),T(Ns,N,null),e(N,A_),e(N,dc),e(dc,N_),e(N,R_),e(N,lc),e(lc,S_),e(N,X_),T(_n,N,null),e(N,V_),e(N,Rs),e(Rs,P_),e(Rs,cc),e(cc,Q_),e(Rs,Y_),e(N,L_),T(bn,N,null),e(N,O_),e(N,Ss),e(Ss,H_),e(Ss,Rd),e(Rd,D_),e(Ss,K_),e(N,eb),e(N,so),T(Xs,so,null),e(so,tb),e(so,pc),e(pc,ob),e(so,nb),e(so,Vs),e(Vs,Sd),e(Sd,ab),e(Sd,hc),e(hc,sb),e(Vs,rb),e(Vs,Xd),e(Xd,ib),e(Xd,uc),e(uc,db),e(N,lb),e(N,yn),T(Ps,yn,null),e(yn,cb),e(yn,mc),e(mc,pb),e(N,hb),e(N,kn),T(Qs,kn,null),e(kn,ub),e(kn,fc),e(fc,mb),e(N,fb),e(N,vn),T(Ys,vn,null),e(vn,gb),e(vn,Ls),e(Ls,_b),e(Ls,gc),e(gc,bb),e(Ls,yb),_(o,Ph,g),_(o,zo,g),e(zo,Tn),e(Tn,_c),T(Os,_c,null),e(zo,kb),e(zo,bc),e(bc,vb),_(o,Qh,g),_(o,fe,g),T(Hs,fe,null),e(fe,Tb),e(fe,Ds),e(Ds,wb),e(Ds,yc),e(yc,Mb),e(Ds,Fb),e(fe,xb),e(fe,kc),e(kc,$b),e(fe,jb),T(wn,fe,null),e(fe,Bb),e(fe,Ks),e(Ks,zb),e(Ks,vc),e(vc,Jb),e(Ks,qb),e(fe,Eb),T(Mn,fe,null),e(fe,Cb),e(fe,er),e(er,Ub),e(er,Vd),e(Vd,Ib),e(er,Zb),e(fe,Gb),e(fe,Fn),T(tr,Fn,null),e(Fn,Wb),e(Fn,Tc),e(Tc,Ab),_(o,Yh,g),_(o,Jo,g),e(Jo,xn),e(xn,wc),T(or,wc,null),e(Jo,Nb),e(Jo,Mc),e(Mc,Rb),_(o,Lh,g),_(o,kt,g),T(nr,kt,null),e(kt,Sb),e(kt,ar),e(ar,Xb),e(ar,Pd),e(Pd,Vb),e(ar,Pb),e(kt,Qb),e(kt,sr),e(sr,Yb),e(sr,rr),e(rr,Lb),e(sr,Ob),e(kt,Hb),e(kt,qt),T(ir,qt,null),e(qt,Db),e(qt,qo),e(qo,Kb),e(qo,Qd),e(Qd,ey),e(qo,ty),e(qo,Fc),e(Fc,oy),e(qo,ny),e(qt,ay),T($n,qt,null),e(qt,sy),T(jn,qt,null),_(o,Oh,g),_(o,Eo,g),e(Eo,Bn),e(Bn,xc),T(dr,xc,null),e(Eo,ry),e(Eo,$c),e($c,iy),_(o,Hh,g),_(o,vt,g),T(lr,vt,null),e(vt,dy),e(vt,cr),e(cr,ly),e(cr,Yd),e(Yd,cy),e(cr,py),e(vt,hy),e(vt,pr),e(pr,uy),e(pr,hr),e(hr,my),e(pr,fy),e(vt,gy),e(vt,mt),T(ur,mt,null),e(mt,_y),e(mt,Co),e(Co,by),e(Co,Ld),e(Ld,yy),e(Co,ky),e(Co,jc),e(jc,vy),e(Co,Ty),e(mt,wy),T(zn,mt,null),e(mt,My),T(Jn,mt,null),e(mt,Fy),T(qn,mt,null),_(o,Dh,g),_(o,Uo,g),e(Uo,En),e(En,Bc),T(mr,Bc,null),e(Uo,xy),e(Uo,zc),e(zc,$y),_(o,Kh,g),_(o,ot,g),T(fr,ot,null),e(ot,jy),e(ot,Jc),e(Jc,By),e(ot,zy),e(ot,gr),e(gr,Jy),e(gr,Od),e(Od,qy),e(gr,Ey),e(ot,Cy),e(ot,_r),e(_r,Uy),e(_r,br),e(br,Iy),e(_r,Zy),e(ot,Gy),e(ot,ft),T(yr,ft,null),e(ft,Wy),e(ft,Io),e(Io,Ay),e(Io,Hd),e(Hd,Ny),e(Io,Ry),e(Io,qc),e(qc,Sy),e(Io,Xy),e(ft,Vy),T(Cn,ft,null),e(ft,Py),T(Un,ft,null),e(ft,Qy),T(In,ft,null),_(o,eu,g),_(o,Zo,g),e(Zo,Zn),e(Zn,Ec),T(kr,Ec,null),e(Zo,Yy),e(Zo,Cc),e(Cc,Ly),_(o,tu,g),_(o,nt,g),T(vr,nt,null),e(nt,Oy),e(nt,Go),e(Go,Hy),e(Go,Uc),e(Uc,Dy),e(Go,Ky),e(Go,Ic),e(Ic,ek),e(Go,tk),e(nt,ok),e(nt,Tr),e(Tr,nk),e(Tr,Dd),e(Dd,ak),e(Tr,sk),e(nt,rk),e(nt,wr),e(wr,ik),e(wr,Mr),e(Mr,dk),e(wr,lk),e(nt,ck),e(nt,Et),T(Fr,Et,null),e(Et,pk),e(Et,Wo),e(Wo,hk),e(Wo,Kd),e(Kd,uk),e(Wo,mk),e(Wo,Zc),e(Zc,fk),e(Wo,gk),e(Et,_k),T(Gn,Et,null),e(Et,bk),T(Wn,Et,null),_(o,ou,g),_(o,Ao,g),e(Ao,An),e(An,Gc),T(xr,Gc,null),e(Ao,yk),e(Ao,Wc),e(Wc,kk),_(o,nu,g),_(o,at,g),T($r,at,null),e(at,vk),e(at,Ac),e(Ac,Tk),e(at,wk),e(at,jr),e(jr,Mk),e(jr,el),e(el,Fk),e(jr,xk),e(at,$k),e(at,Br),e(Br,jk),e(Br,zr),e(zr,Bk),e(Br,zk),e(at,Jk),e(at,Nn),T(Jr,Nn,null),e(Nn,qk),T(Rn,Nn,null),_(o,au,g),_(o,No,g),e(No,Sn),e(Sn,Nc),T(qr,Nc,null),e(No,Ek),e(No,Rc),e(Rc,Ck),_(o,su,g),_(o,st,g),T(Er,st,null),e(st,Uk),e(st,Cr),e(Cr,Ik),e(Cr,tl),e(tl,Zk),e(Cr,Gk),e(st,Wk),e(st,Ur),e(Ur,Ak),e(Ur,Ir),e(Ir,Nk),e(Ur,Rk),e(st,Sk),T(Xn,st,null),e(st,Xk),e(st,Ct),T(Zr,Ct,null),e(Ct,Vk),e(Ct,Ro),e(Ro,Pk),e(Ro,ol),e(ol,Qk),e(Ro,Yk),e(Ro,Sc),e(Sc,Lk),e(Ro,Ok),e(Ct,Hk),T(Vn,Ct,null),e(Ct,Dk),T(Pn,Ct,null),_(o,ru,g),_(o,So,g),e(So,Qn),e(Qn,Xc),T(Gr,Xc,null),e(So,Kk),e(So,Vc),e(Vc,ev),_(o,iu,g),_(o,rt,g),T(Wr,rt,null),e(rt,tv),e(rt,Ar),e(Ar,ov),e(Ar,nl),e(nl,nv),e(Ar,av),e(rt,sv),e(rt,Nr),e(Nr,rv),e(Nr,Rr),e(Rr,iv),e(Nr,dv),e(rt,lv),T(Yn,rt,null),e(rt,cv),e(rt,gt),T(Sr,gt,null),e(gt,pv),e(gt,Xo),e(Xo,hv),e(Xo,al),e(al,uv),e(Xo,mv),e(Xo,Pc),e(Pc,fv),e(Xo,gv),e(gt,_v),T(Ln,gt,null),e(gt,bv),T(On,gt,null),e(gt,yv),T(Hn,gt,null),_(o,du,g),_(o,Vo,g),e(Vo,Dn),e(Dn,Qc),T(Xr,Qc,null),e(Vo,kv),e(Vo,Yc),e(Yc,vv),_(o,lu,g),_(o,Ue,g),T(Vr,Ue,null),e(Ue,Tv),e(Ue,Lc),e(Lc,wv),e(Ue,Mv),e(Ue,Pr),e(Pr,Fv),e(Pr,sl),e(sl,xv),e(Pr,$v),e(Ue,jv),e(Ue,Qr),e(Qr,Bv),e(Qr,Yr),e(Yr,zv),e(Qr,Jv),e(Ue,qv),T(Kn,Ue,null),e(Ue,Ev),e(Ue,ro),T(Lr,ro,null),e(ro,Cv),e(ro,Po),e(Po,Uv),e(Po,rl),e(rl,Iv),e(Po,Zv),e(Po,Oc),e(Oc,Gv),e(Po,Wv),e(ro,Av),T(ea,ro,null),_(o,cu,g),_(o,Qo,g),e(Qo,ta),e(ta,Hc),T(Or,Hc,null),e(Qo,Nv),e(Qo,Dc),e(Dc,Rv),_(o,pu,g),_(o,ge,g),T(Hr,ge,null),e(ge,Sv),e(ge,Dr),e(Dr,Xv),e(Dr,il),e(il,Vv),e(Dr,Pv),e(ge,Qv),e(ge,Kr),e(Kr,Yv),e(Kr,ei),e(ei,Lv),e(Kr,Ov),e(ge,Hv),e(ge,Kc),e(Kc,Dv),e(ge,Kv),e(ge,Rt),e(Rt,ep),e(ep,ti),e(ti,eT),e(Rt,tT),e(Rt,tp),e(tp,oi),e(oi,oT),e(Rt,nT),e(Rt,op),e(op,ni),e(ni,aT),e(Rt,sT),e(Rt,np),e(np,ai),e(ai,rT),e(ge,iT),e(ge,Ut),T(si,Ut,null),e(Ut,dT),e(Ut,Yo),e(Yo,lT),e(Yo,ap),e(ap,cT),e(Yo,pT),e(Yo,sp),e(sp,hT),e(Yo,uT),e(Ut,mT),T(oa,Ut,null),e(Ut,fT),T(na,Ut,null),e(ge,gT),e(ge,aa),T(ri,aa,null),e(aa,_T),T(sa,aa,null),e(ge,bT),e(ge,ra),T(ii,ra,null),e(ra,yT),T(ia,ra,null),_(o,hu,g),_(o,Lo,g),e(Lo,da),e(da,rp),T(di,rp,null),e(Lo,kT),e(Lo,ip),e(ip,vT),_(o,uu,g),_(o,_e,g),T(li,_e,null),e(_e,TT),e(_e,ci),e(ci,wT),e(ci,dl),e(dl,MT),e(ci,FT),e(_e,xT),e(_e,pi),e(pi,$T),e(pi,hi),e(hi,jT),e(pi,BT),e(_e,zT),e(_e,dp),e(dp,JT),e(_e,qT),e(_e,St),e(St,lp),e(lp,ui),e(ui,ET),e(St,CT),e(St,cp),e(cp,mi),e(mi,UT),e(St,IT),e(St,pp),e(pp,fi),e(fi,ZT),e(St,GT),e(St,hp),e(hp,gi),e(gi,WT),e(_e,AT),e(_e,_t),T(_i,_t,null),e(_t,NT),e(_t,Oo),e(Oo,RT),e(Oo,up),e(up,ST),e(Oo,XT),e(Oo,mp),e(mp,VT),e(Oo,PT),e(_t,QT),T(la,_t,null),e(_t,YT),T(ca,_t,null),e(_t,LT),T(pa,_t,null),e(_e,OT),e(_e,ha),T(bi,ha,null),e(ha,HT),T(ua,ha,null),e(_e,DT),e(_e,ma),T(yi,ma,null),e(ma,KT),T(fa,ma,null),_(o,mu,g),_(o,Ho,g),e(Ho,ga),e(ga,fp),T(ki,fp,null),e(Ho,ew),e(Ho,gp),e(gp,tw),_(o,fu,g),_(o,O,g),T(vi,O,null),e(O,ow),e(O,_p),e(_p,nw),e(O,aw),e(O,Ti),e(Ti,sw),e(Ti,ll),e(ll,rw),e(Ti,iw),e(O,dw),e(O,wi),e(wi,lw),e(wi,Mi),e(Mi,cw),e(wi,pw),e(O,hw),e(O,bp),e(bp,uw),e(O,mw),e(O,Xt),e(Xt,yp),e(yp,Fi),e(Fi,fw),e(Xt,gw),e(Xt,kp),e(kp,xi),e(xi,_w),e(Xt,bw),e(Xt,vp),e(vp,$i),e($i,yw),e(Xt,kw),e(Xt,Tp),e(Tp,ji),e(ji,vw),e(O,Tw),e(O,It),T(Bi,It,null),e(It,ww),e(It,Do),e(Do,Mw),e(Do,wp),e(wp,Fw),e(Do,xw),e(Do,Mp),e(Mp,$w),e(Do,jw),e(It,Bw),T(_a,It,null),e(It,zw),T(ba,It,null),e(O,Jw),e(O,ya),T(zi,ya,null),e(ya,qw),T(ka,ya,null),e(O,Ew),e(O,va),T(Ji,va,null),e(va,Cw),T(Ta,va,null),_(o,gu,g),_(o,Ko,g),e(Ko,wa),e(wa,Fp),T(qi,Fp,null),e(Ko,Uw),e(Ko,xp),e(xp,Iw),_(o,_u,g),_(o,H,g),T(Ei,H,null),e(H,Zw),e(H,en),e(en,Gw),e(en,$p),e($p,Ww),e(en,Aw),e(en,jp),e(jp,Nw),e(en,Rw),e(H,Sw),e(H,Ci),e(Ci,Xw),e(Ci,cl),e(cl,Vw),e(Ci,Pw),e(H,Qw),e(H,Ui),e(Ui,Yw),e(Ui,Ii),e(Ii,Lw),e(Ui,Ow),e(H,Hw),e(H,Bp),e(Bp,Dw),e(H,Kw),e(H,Vt),e(Vt,zp),e(zp,Zi),e(Zi,e2),e(Vt,t2),e(Vt,Jp),e(Jp,Gi),e(Gi,o2),e(Vt,n2),e(Vt,qp),e(qp,Wi),e(Wi,a2),e(Vt,s2),e(Vt,Ep),e(Ep,Ai),e(Ai,r2),e(H,i2),e(H,Zt),T(Ni,Zt,null),e(Zt,d2),e(Zt,tn),e(tn,l2),e(tn,Cp),e(Cp,c2),e(tn,p2),e(tn,Up),e(Up,h2),e(tn,u2),e(Zt,m2),T(Ma,Zt,null),e(Zt,f2),T(Fa,Zt,null),e(H,g2),e(H,xa),T(Ri,xa,null),e(xa,_2),T($a,xa,null),e(H,b2),e(H,ja),T(Si,ja,null),e(ja,y2),T(Ba,ja,null),_(o,bu,g),_(o,on,g),e(on,za),e(za,Ip),T(Xi,Ip,null),e(on,k2),e(on,Zp),e(Zp,v2),_(o,yu,g),_(o,Me,g),T(Vi,Me,null),e(Me,T2),e(Me,Gp),e(Gp,w2),e(Me,M2),e(Me,Pi),e(Pi,F2),e(Pi,pl),e(pl,x2),e(Pi,$2),e(Me,j2),e(Me,Qi),e(Qi,B2),e(Qi,Yi),e(Yi,z2),e(Qi,J2),e(Me,q2),e(Me,Wp),e(Wp,E2),e(Me,C2),e(Me,Pt),e(Pt,Ap),e(Ap,Li),e(Li,U2),e(Pt,I2),e(Pt,Np),e(Np,Oi),e(Oi,Z2),e(Pt,G2),e(Pt,Rp),e(Rp,Hi),e(Hi,W2),e(Pt,A2),e(Pt,Sp),e(Sp,Di),e(Di,N2),e(Me,R2),e(Me,Gt),T(Ki,Gt,null),e(Gt,S2),e(Gt,nn),e(nn,X2),e(nn,Xp),e(Xp,V2),e(nn,P2),e(nn,Vp),e(Vp,Q2),e(nn,Y2),e(Gt,L2),T(Ja,Gt,null),e(Gt,O2),T(qa,Gt,null),ku=!0},p(o,[g]){const ed={};g&2&&(ed.$$scope={dirty:g,ctx:o}),fn.$set(ed);const Pp={};g&2&&(Pp.$$scope={dirty:g,ctx:o}),_n.$set(Pp);const Qp={};g&2&&(Qp.$$scope={dirty:g,ctx:o}),bn.$set(Qp);const Yp={};g&2&&(Yp.$$scope={dirty:g,ctx:o}),wn.$set(Yp);const td={};g&2&&(td.$$scope={dirty:g,ctx:o}),Mn.$set(td);const Lp={};g&2&&(Lp.$$scope={dirty:g,ctx:o}),$n.$set(Lp);const Op={};g&2&&(Op.$$scope={dirty:g,ctx:o}),jn.$set(Op);const Ea={};g&2&&(Ea.$$scope={dirty:g,ctx:o}),zn.$set(Ea);const Hp={};g&2&&(Hp.$$scope={dirty:g,ctx:o}),Jn.$set(Hp);const Dp={};g&2&&(Dp.$$scope={dirty:g,ctx:o}),qn.$set(Dp);const od={};g&2&&(od.$$scope={dirty:g,ctx:o}),Cn.$set(od);const Kp={};g&2&&(Kp.$$scope={dirty:g,ctx:o}),Un.$set(Kp);const eh={};g&2&&(eh.$$scope={dirty:g,ctx:o}),In.$set(eh);const th={};g&2&&(th.$$scope={dirty:g,ctx:o}),Gn.$set(th);const nd={};g&2&&(nd.$$scope={dirty:g,ctx:o}),Wn.$set(nd);const oh={};g&2&&(oh.$$scope={dirty:g,ctx:o}),Rn.$set(oh);const nh={};g&2&&(nh.$$scope={dirty:g,ctx:o}),Xn.$set(nh);const an={};g&2&&(an.$$scope={dirty:g,ctx:o}),Vn.$set(an);const ah={};g&2&&(ah.$$scope={dirty:g,ctx:o}),Pn.$set(ah);const sh={};g&2&&(sh.$$scope={dirty:g,ctx:o}),Yn.$set(sh);const rh={};g&2&&(rh.$$scope={dirty:g,ctx:o}),Ln.$set(rh);const ih={};g&2&&(ih.$$scope={dirty:g,ctx:o}),On.$set(ih);const ad={};g&2&&(ad.$$scope={dirty:g,ctx:o}),Hn.$set(ad);const dh={};g&2&&(dh.$$scope={dirty:g,ctx:o}),Kn.$set(dh);const lh={};g&2&&(lh.$$scope={dirty:g,ctx:o}),ea.$set(lh);const sd={};g&2&&(sd.$$scope={dirty:g,ctx:o}),oa.$set(sd);const ch={};g&2&&(ch.$$scope={dirty:g,ctx:o}),na.$set(ch);const Tt={};g&2&&(Tt.$$scope={dirty:g,ctx:o}),sa.$set(Tt);const ph={};g&2&&(ph.$$scope={dirty:g,ctx:o}),ia.$set(ph);const hh={};g&2&&(hh.$$scope={dirty:g,ctx:o}),la.$set(hh);const uh={};g&2&&(uh.$$scope={dirty:g,ctx:o}),ca.$set(uh);const mh={};g&2&&(mh.$$scope={dirty:g,ctx:o}),pa.$set(mh);const fh={};g&2&&(fh.$$scope={dirty:g,ctx:o}),ua.$set(fh);const sn={};g&2&&(sn.$$scope={dirty:g,ctx:o}),fa.$set(sn);const gh={};g&2&&(gh.$$scope={dirty:g,ctx:o}),_a.$set(gh);const _h={};g&2&&(_h.$$scope={dirty:g,ctx:o}),ba.$set(_h);const rd={};g&2&&(rd.$$scope={dirty:g,ctx:o}),ka.$set(rd);const bh={};g&2&&(bh.$$scope={dirty:g,ctx:o}),Ta.$set(bh);const yh={};g&2&&(yh.$$scope={dirty:g,ctx:o}),Ma.$set(yh);const kh={};g&2&&(kh.$$scope={dirty:g,ctx:o}),Fa.$set(kh);const rn={};g&2&&(rn.$$scope={dirty:g,ctx:o}),$a.$set(rn);const id={};g&2&&(id.$$scope={dirty:g,ctx:o}),Ba.$set(id);const vh={};g&2&&(vh.$$scope={dirty:g,ctx:o}),Ja.$set(vh);const Qt={};g&2&&(Qt.$$scope={dirty:g,ctx:o}),qa.$set(Qt)},i(o){ku||(w(r.$$.fragment,o),w(K.$$.fragment,o),w(Ka.$$.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(zs.$$.fragment,o),w(Zs.$$.fragment,o),w(Gs.$$.fragment,o),w(fn.$$.fragment,o),w(As.$$.fragment,o),w(Ns.$$.fragment,o),w(_n.$$.fragment,o),w(bn.$$.fragment,o),w(Xs.$$.fragment,o),w(Ps.$$.fragment,o),w(Qs.$$.fragment,o),w(Ys.$$.fragment,o),w(Os.$$.fragment,o),w(Hs.$$.fragment,o),w(wn.$$.fragment,o),w(Mn.$$.fragment,o),w(tr.$$.fragment,o),w(or.$$.fragment,o),w(nr.$$.fragment,o),w(ir.$$.fragment,o),w($n.$$.fragment,o),w(jn.$$.fragment,o),w(dr.$$.fragment,o),w(lr.$$.fragment,o),w(ur.$$.fragment,o),w(zn.$$.fragment,o),w(Jn.$$.fragment,o),w(qn.$$.fragment,o),w(mr.$$.fragment,o),w(fr.$$.fragment,o),w(yr.$$.fragment,o),w(Cn.$$.fragment,o),w(Un.$$.fragment,o),w(In.$$.fragment,o),w(kr.$$.fragment,o),w(vr.$$.fragment,o),w(Fr.$$.fragment,o),w(Gn.$$.fragment,o),w(Wn.$$.fragment,o),w(xr.$$.fragment,o),w($r.$$.fragment,o),w(Jr.$$.fragment,o),w(Rn.$$.fragment,o),w(qr.$$.fragment,o),w(Er.$$.fragment,o),w(Xn.$$.fragment,o),w(Zr.$$.fragment,o),w(Vn.$$.fragment,o),w(Pn.$$.fragment,o),w(Gr.$$.fragment,o),w(Wr.$$.fragment,o),w(Yn.$$.fragment,o),w(Sr.$$.fragment,o),w(Ln.$$.fragment,o),w(On.$$.fragment,o),w(Hn.$$.fragment,o),w(Xr.$$.fragment,o),w(Vr.$$.fragment,o),w(Kn.$$.fragment,o),w(Lr.$$.fragment,o),w(ea.$$.fragment,o),w(Or.$$.fragment,o),w(Hr.$$.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(_i.$$.fragment,o),w(la.$$.fragment,o),w(ca.$$.fragment,o),w(pa.$$.fragment,o),w(bi.$$.fragment,o),w(ua.$$.fragment,o),w(yi.$$.fragment,o),w(fa.$$.fragment,o),w(ki.$$.fragment,o),w(vi.$$.fragment,o),w(Bi.$$.fragment,o),w(_a.$$.fragment,o),w(ba.$$.fragment,o),w(zi.$$.fragment,o),w(ka.$$.fragment,o),w(Ji.$$.fragment,o),w(Ta.$$.fragment,o),w(qi.$$.fragment,o),w(Ei.$$.fragment,o),w(Ni.$$.fragment,o),w(Ma.$$.fragment,o),w(Fa.$$.fragment,o),w(Ri.$$.fragment,o),w($a.$$.fragment,o),w(Si.$$.fragment,o),w(Ba.$$.fragment,o),w(Xi.$$.fragment,o),w(Vi.$$.fragment,o),w(Ki.$$.fragment,o),w(Ja.$$.fragment,o),w(qa.$$.fragment,o),ku=!0)},o(o){M(r.$$.fragment,o),M(K.$$.fragment,o),M(Ka.$$.fragment,o),M(ss.$$.fragment,o),M(rs.$$.fragment,o),M(is.$$.fragment,o),M(ds.$$.fragment,o),M(ls.$$.fragment,o),M(Ts.$$.fragment,o),M(zs.$$.fragment,o),M(Zs.$$.fragment,o),M(Gs.$$.fragment,o),M(fn.$$.fragment,o),M(As.$$.fragment,o),M(Ns.$$.fragment,o),M(_n.$$.fragment,o),M(bn.$$.fragment,o),M(Xs.$$.fragment,o),M(Ps.$$.fragment,o),M(Qs.$$.fragment,o),M(Ys.$$.fragment,o),M(Os.$$.fragment,o),M(Hs.$$.fragment,o),M(wn.$$.fragment,o),M(Mn.$$.fragment,o),M(tr.$$.fragment,o),M(or.$$.fragment,o),M(nr.$$.fragment,o),M(ir.$$.fragment,o),M($n.$$.fragment,o),M(jn.$$.fragment,o),M(dr.$$.fragment,o),M(lr.$$.fragment,o),M(ur.$$.fragment,o),M(zn.$$.fragment,o),M(Jn.$$.fragment,o),M(qn.$$.fragment,o),M(mr.$$.fragment,o),M(fr.$$.fragment,o),M(yr.$$.fragment,o),M(Cn.$$.fragment,o),M(Un.$$.fragment,o),M(In.$$.fragment,o),M(kr.$$.fragment,o),M(vr.$$.fragment,o),M(Fr.$$.fragment,o),M(Gn.$$.fragment,o),M(Wn.$$.fragment,o),M(xr.$$.fragment,o),M($r.$$.fragment,o),M(Jr.$$.fragment,o),M(Rn.$$.fragment,o),M(qr.$$.fragment,o),M(Er.$$.fragment,o),M(Xn.$$.fragment,o),M(Zr.$$.fragment,o),M(Vn.$$.fragment,o),M(Pn.$$.fragment,o),M(Gr.$$.fragment,o),M(Wr.$$.fragment,o),M(Yn.$$.fragment,o),M(Sr.$$.fragment,o),M(Ln.$$.fragment,o),M(On.$$.fragment,o),M(Hn.$$.fragment,o),M(Xr.$$.fragment,o),M(Vr.$$.fragment,o),M(Kn.$$.fragment,o),M(Lr.$$.fragment,o),M(ea.$$.fragment,o),M(Or.$$.fragment,o),M(Hr.$$.fragment,o),M(si.$$.fragment,o),M(oa.$$.fragment,o),M(na.$$.fragment,o),M(ri.$$.fragment,o),M(sa.$$.fragment,o),M(ii.$$.fragment,o),M(ia.$$.fragment,o),M(di.$$.fragment,o),M(li.$$.fragment,o),M(_i.$$.fragment,o),M(la.$$.fragment,o),M(ca.$$.fragment,o),M(pa.$$.fragment,o),M(bi.$$.fragment,o),M(ua.$$.fragment,o),M(yi.$$.fragment,o),M(fa.$$.fragment,o),M(ki.$$.fragment,o),M(vi.$$.fragment,o),M(Bi.$$.fragment,o),M(_a.$$.fragment,o),M(ba.$$.fragment,o),M(zi.$$.fragment,o),M(ka.$$.fragment,o),M(Ji.$$.fragment,o),M(Ta.$$.fragment,o),M(qi.$$.fragment,o),M(Ei.$$.fragment,o),M(Ni.$$.fragment,o),M(Ma.$$.fragment,o),M(Fa.$$.fragment,o),M(Ri.$$.fragment,o),M($a.$$.fragment,o),M(Si.$$.fragment,o),M(Ba.$$.fragment,o),M(Xi.$$.fragment,o),M(Vi.$$.fragment,o),M(Ki.$$.fragment,o),M(Ja.$$.fragment,o),M(qa.$$.fragment,o),ku=!1},d(o){t(l),o&&t(y),o&&t(f),F(r),o&&t(P),o&&t(Z),o&&t(D),o&&t(de),o&&t(Ze),o&&t(W),F(K),o&&t(ee),o&&t(ye),o&&t(U),o&&t(xe),o&&t(Ge),o&&t(te),o&&t(I),o&&t(je),o&&t(We),o&&t(ke),o&&t(Mh),o&&t(Yt),o&&t(Fh),o&&t(yo),F(Ka),o&&t(xh),o&&t(Lt),o&&t($h),o&&t(ko),F(ss),o&&t(jh),o&&t(ht),o&&t(Bh),o&&t(Mo),F(rs),o&&t(zh),o&&t(Ot),o&&t(Jh),F(is,o),o&&t(qh),o&&t(Fo),F(ds),o&&t(Eh),o&&t(vd),o&&t(Ch),F(ls,o),o&&t(Uh),o&&t(Te),o&&t(Ih),F(Ts,o),o&&t(Zh),o&&t(ut),o&&t(Gh),F(zs,o),o&&t(Wh),o&&t(Jt),o&&t(Ah),o&&t(Ud),o&&t(Nh),o&&t(ao),o&&t(Rh),o&&t(xo),F(Zs),o&&t(Sh),o&&t(yt),F(Gs),F(fn),o&&t(Xh),o&&t(Bo),F(As),o&&t(Vh),o&&t(N),F(Ns),F(_n),F(bn),F(Xs),F(Ps),F(Qs),F(Ys),o&&t(Ph),o&&t(zo),F(Os),o&&t(Qh),o&&t(fe),F(Hs),F(wn),F(Mn),F(tr),o&&t(Yh),o&&t(Jo),F(or),o&&t(Lh),o&&t(kt),F(nr),F(ir),F($n),F(jn),o&&t(Oh),o&&t(Eo),F(dr),o&&t(Hh),o&&t(vt),F(lr),F(ur),F(zn),F(Jn),F(qn),o&&t(Dh),o&&t(Uo),F(mr),o&&t(Kh),o&&t(ot),F(fr),F(yr),F(Cn),F(Un),F(In),o&&t(eu),o&&t(Zo),F(kr),o&&t(tu),o&&t(nt),F(vr),F(Fr),F(Gn),F(Wn),o&&t(ou),o&&t(Ao),F(xr),o&&t(nu),o&&t(at),F($r),F(Jr),F(Rn),o&&t(au),o&&t(No),F(qr),o&&t(su),o&&t(st),F(Er),F(Xn),F(Zr),F(Vn),F(Pn),o&&t(ru),o&&t(So),F(Gr),o&&t(iu),o&&t(rt),F(Wr),F(Yn),F(Sr),F(Ln),F(On),F(Hn),o&&t(du),o&&t(Vo),F(Xr),o&&t(lu),o&&t(Ue),F(Vr),F(Kn),F(Lr),F(ea),o&&t(cu),o&&t(Qo),F(Or),o&&t(pu),o&&t(ge),F(Hr),F(si),F(oa),F(na),F(ri),F(sa),F(ii),F(ia),o&&t(hu),o&&t(Lo),F(di),o&&t(uu),o&&t(_e),F(li),F(_i),F(la),F(ca),F(pa),F(bi),F(ua),F(yi),F(fa),o&&t(mu),o&&t(Ho),F(ki),o&&t(fu),o&&t(O),F(vi),F(Bi),F(_a),F(ba),F(zi),F(ka),F(Ji),F(Ta),o&&t(gu),o&&t(Ko),F(qi),o&&t(_u),o&&t(H),F(Ei),F(Ni),F(Ma),F(Fa),F(Ri),F($a),F(Si),F(Ba),o&&t(bu),o&&t(on),F(Xi),o&&t(yu),o&&t(Me),F(Vi),F(Ki),F(Ja),F(qa)}}}const M$={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 F$($){return qx(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class E$ extends jx{constructor(l){super();Bx(this,l,F$,w$,zx,{})}}export{E$ as default,M$ as metadata};
