import{S as rd,i as id,s as ld,e as n,k as p,w as v,t as r,M as dd,c as a,d as o,m as h,a as s,x as k,h as i,b as d,G as e,g,y as T,q as w,o as M,B,v as cd,L as Rt}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ci}from"../../chunks/Tip-hf-doc-builder.js";import{D as N}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ue}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as O}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Wt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function pd(z){let c,y,_,m,b;return m=new ue({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBMQmFydENvbmZpZyUyQyUyMFBMQmFydE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFBMQkFSVCUyMHVjbGFubHAlMkZwbGJhcnQtYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBQTEJhcnRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwdWNsYW5scCUyRnBsYmFydC1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBQTEJhcnRNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PLBartConfig, PLBartModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a PLBART uclanlp/plbart-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = PLBartConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the uclanlp/plbart-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PLBartModel(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(){c=n("p"),y=r("Example:"),_=p(),v(m.$$.fragment)},l(l){c=a(l,"P",{});var f=s(c);y=i(f,"Example:"),f.forEach(o),_=h(l),k(m.$$.fragment,l)},m(l,f){g(l,c,f),e(c,y),g(l,_,f),T(m,l,f),b=!0},p:Rt,i(l){b||(w(m.$$.fragment,l),b=!0)},o(l){M(m.$$.fragment,l),b=!1},d(l){l&&o(c),l&&o(_),B(m,l)}}}function hd(z){let c,y,_,m,b;return m=new ue({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBMQmFydFRva2VuaXplciUwQSUwQXRva2VuaXplciUyMCUzRCUyMFBMQmFydFRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydWNsYW5scCUyRnBsYmFydC1weXRob24tZW5fWFglMjIlMkMlMjBzcmNfbGFuZyUzRCUyMnB5dGhvbiUyMiUyQyUyMHRndF9sYW5nJTNEJTIyZW5fWFglMjIpJTBBZXhhbXBsZV9weXRob25fcGhyYXNlJTIwJTNEJTIwJTIyZGVmJTIwbWF4aW11bShhJTJDYiUyQ2MpJTNBTkVXX0xJTkVfSU5ERU5UcmV0dXJuJTIwbWF4KCU1QmElMkNiJTJDYyU1RCklMjIlMEFleHBlY3RlZF90cmFuc2xhdGlvbl9lbmdsaXNoJTIwJTNEJTIwJTIyUmV0dXJucyUyMHRoZSUyMG1heGltdW0lMjB2YWx1ZSUyMG9mJTIwYSUyMGIlMjBjLiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihleGFtcGxlX3B5dGhvbl9waHJhc2UlMkMlMjB0ZXh0X3RhcmdldCUzRGV4cGVjdGVkX3RyYW5zbGF0aW9uX2VuZ2xpc2glMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PLBartTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = PLBartTokenizer.from_pretrained(<span class="hljs-string">&quot;uclanlp/plbart-python-en_XX&quot;</span>, src_lang=<span class="hljs-string">&quot;python&quot;</span>, tgt_lang=<span class="hljs-string">&quot;en_XX&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>example_python_phrase = <span class="hljs-string">&quot;def maximum(a,b,c):NEW_LINE_INDENTreturn max([a,b,c])&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>expected_translation_english = <span class="hljs-string">&quot;Returns the maximum value of a b c.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(example_python_phrase, text_target=expected_translation_english, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)`}}),{c(){c=n("p"),y=r("Examples:"),_=p(),v(m.$$.fragment)},l(l){c=a(l,"P",{});var f=s(c);y=i(f,"Examples:"),f.forEach(o),_=h(l),k(m.$$.fragment,l)},m(l,f){g(l,c,f),e(c,y),g(l,_,f),T(m,l,f),b=!0},p:Rt,i(l){b||(w(m.$$.fragment,l),b=!0)},o(l){M(m.$$.fragment,l),b=!1},d(l){l&&o(c),l&&o(_),B(m,l)}}}function ud(z){let c,y,_,m,b;return{c(){c=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),m=r("Module"),b=r(`
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(l){c=a(l,"P",{});var f=s(c);y=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(f,"CODE",{});var C=s(_);m=i(C,"Module"),C.forEach(o),b=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){g(l,c,f),e(c,y),e(c,_),e(_,m),e(c,b)},d(l){l&&o(c)}}}function md(z){let c,y,_,m,b;return m=new ue({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBQTEJhcnRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydWNsYW5scCUyRnBsYmFydC1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwUExCYXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnVjbGFubHAlMkZwbGJhcnQtYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, PLBartModel
<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;uclanlp/plbart-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PLBartModel.from_pretrained(<span class="hljs-string">&quot;uclanlp/plbart-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(){c=n("p"),y=r("Example:"),_=p(),v(m.$$.fragment)},l(l){c=a(l,"P",{});var f=s(c);y=i(f,"Example:"),f.forEach(o),_=h(l),k(m.$$.fragment,l)},m(l,f){g(l,c,f),e(c,y),g(l,_,f),T(m,l,f),b=!0},p:Rt,i(l){b||(w(m.$$.fragment,l),b=!0)},o(l){M(m.$$.fragment,l),b=!1},d(l){l&&o(c),l&&o(_),B(m,l)}}}function fd(z){let c,y,_,m,b;return{c(){c=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),m=r("Module"),b=r(`
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(l){c=a(l,"P",{});var f=s(c);y=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(f,"CODE",{});var C=s(_);m=i(C,"Module"),C.forEach(o),b=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){g(l,c,f),e(c,y),e(c,_),e(_,m),e(c,b)},d(l){l&&o(c)}}}function gd(z){let c,y,_,m,b;return m=new ue({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBQTEJhcnRGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEFtb2RlbCUyMCUzRCUyMFBMQmFydEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydWNsYW5scCUyRnBsYmFydC1iYXNlJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnVjbGFubHAlMkZwbGJhcnQtYmFzZSUyMiklMEElMEElMjMlMjBlbl9YWCUyMGlzJTIwdGhlJTIwbGFuZ3VhZ2UlMjBzeW1ib2wlMjBpZCUyMCUzQ0xJRCUzRSUyMGZvciUyMEVuZ2xpc2glMEFUWFQlMjAlM0QlMjAlMjIlM0NzJTNFJTIwSXMlMjAwJTIwdGhlJTIwJTNDbWFzayUzRSUyMEZpYm9uYWNjaSUyMG51bWJlciUyMCUzRiUyMCUzQyUyRnMlM0UlMjBlbl9YWCUyMiUwQWlucHV0X2lkcyUyMCUzRCUyMHRva2VuaXplciglNUJUWFQlNUQlMkMlMjBhZGRfc3BlY2lhbF90b2tlbnMlM0RGYWxzZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLmlucHV0X2lkcyUwQSUwQWxvZ2l0cyUyMCUzRCUyMG1vZGVsKGlucHV0X2lkcykubG9naXRzJTBBbWFza2VkX2luZGV4JTIwJTNEJTIwKGlucHV0X2lkcyU1QjAlNUQlMjAlM0QlM0QlMjB0b2tlbml6ZXIubWFza190b2tlbl9pZCkubm9uemVybygpLml0ZW0oKSUwQXByb2JzJTIwJTNEJTIwbG9naXRzJTVCMCUyQyUyMG1hc2tlZF9pbmRleCU1RC5zb2Z0bWF4KGRpbSUzRDApJTBBdmFsdWVzJTJDJTIwcHJlZGljdGlvbnMlMjAlM0QlMjBwcm9icy50b3BrKDUpJTBBJTBBdG9rZW5pemVyLmRlY29kZShwcmVkaWN0aW9ucykuc3BsaXQoKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, PLBartForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = PLBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;uclanlp/plbart-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;uclanlp/plbart-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># en_XX is the language symbol id &lt;LID&gt; for English</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>TXT = <span class="hljs-string">&quot;&lt;s&gt; Is 0 the &lt;mask&gt; Fibonacci number ? &lt;/s&gt; en_XX&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer([TXT], add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids

<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;first&#x27;</span>, <span class="hljs-string">&#x27;same&#x27;</span>, <span class="hljs-string">&#x27;highest&#x27;</span>, <span class="hljs-string">&#x27;result&#x27;</span>, <span class="hljs-string">&#x27;number&#x27;</span>]`}}),{c(){c=n("p"),y=r("Mask-filling example:"),_=p(),v(m.$$.fragment)},l(l){c=a(l,"P",{});var f=s(c);y=i(f,"Mask-filling example:"),f.forEach(o),_=h(l),k(m.$$.fragment,l)},m(l,f){g(l,c,f),e(c,y),g(l,_,f),T(m,l,f),b=!0},p:Rt,i(l){b||(w(m.$$.fragment,l),b=!0)},o(l){M(m.$$.fragment,l),b=!1},d(l){l&&o(c),l&&o(_),B(m,l)}}}function _d(z){let c,y,_,m,b;return{c(){c=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),m=r("Module"),b=r(`
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(l){c=a(l,"P",{});var f=s(c);y=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(f,"CODE",{});var C=s(_);m=i(C,"Module"),C.forEach(o),b=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){g(l,c,f),e(c,y),e(c,_),e(_,m),e(c,b)},d(l){l&&o(c)}}}function bd(z){let c,y,_,m,b;return m=new ue({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMFBMQmFydEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ1Y2xhbmxwJTJGcGxiYXJ0LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBQTEJhcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ1Y2xhbmxwJTJGcGxiYXJ0LWJhc2UlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwbG9naXRzLmFyZ21heCgpLml0ZW0oKSUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMFBMQmFydEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMnVjbGFubHAlMkZwbGJhcnQtYmFzZSUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, PLBartForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;uclanlp/plbart-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PLBartForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;uclanlp/plbart-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><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){c=n("p"),y=r("Example of single-label classification:"),_=p(),v(m.$$.fragment)},l(l){c=a(l,"P",{});var f=s(c);y=i(f,"Example of single-label classification:"),f.forEach(o),_=h(l),k(m.$$.fragment,l)},m(l,f){g(l,c,f),e(c,y),g(l,_,f),T(m,l,f),b=!0},p:Rt,i(l){b||(w(m.$$.fragment,l),b=!0)},o(l){M(m.$$.fragment,l),b=!1},d(l){l&&o(c),l&&o(_),B(m,l)}}}function yd(z){let c,y,_,m,b;return m=new ue({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMFBMQmFydEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ1Y2xhbmxwJTJGcGxiYXJ0LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBQTEJhcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ1Y2xhbmxwJTJGcGxiYXJ0LWJhc2UlMjIlMkMlMjBwcm9ibGVtX3R5cGUlM0QlMjJtdWx0aV9sYWJlbF9jbGFzc2lmaWNhdGlvbiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJhbmdlKDAlMkMlMjBsb2dpdHMuc2hhcGUlNUItMSU1RCklNUJ0b3JjaC5zaWdtb2lkKGxvZ2l0cykuc3F1ZWV6ZShkaW0lM0QwKSUyMCUzRSUyMDAuNSU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMFBMQmFydEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnVjbGFubHAlMkZwbGJhcnQtYmFzZSUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, PLBartForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;uclanlp/plbart-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PLBartForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;uclanlp/plbart-base&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 = PLBartForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;uclanlp/plbart-base&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(){c=n("p"),y=r("Example of multi-label classification:"),_=p(),v(m.$$.fragment)},l(l){c=a(l,"P",{});var f=s(c);y=i(f,"Example of multi-label classification:"),f.forEach(o),_=h(l),k(m.$$.fragment,l)},m(l,f){g(l,c,f),e(c,y),g(l,_,f),T(m,l,f),b=!0},p:Rt,i(l){b||(w(m.$$.fragment,l),b=!0)},o(l){M(m.$$.fragment,l),b=!1},d(l){l&&o(c),l&&o(_),B(m,l)}}}function vd(z){let c,y,_,m,b;return m=new ue({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBQTEJhcnRGb3JDYXVzYWxMTSUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnVjbGFubHAlMkZwbGJhcnQtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMFBMQmFydEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJ1Y2xhbmxwJTJGcGxiYXJ0LWJhc2UlMjIlMkMlMjBhZGRfY3Jvc3NfYXR0ZW50aW9uJTNERmFsc2UpJTBBYXNzZXJ0JTIwbW9kZWwuY29uZmlnLmlzX2RlY29kZXIlMkMlMjBmJTIyJTdCbW9kZWwuX19jbGFzc19fJTdEJTIwaGFzJTIwdG8lMjBiZSUyMGNvbmZpZ3VyZWQlMjBhcyUyMGElMjBkZWNvZGVyLiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlMEFleHBlY3RlZF9zaGFwZSUyMCUzRCUyMCU1QjElMkMlMjBpbnB1dHMuaW5wdXRfaWRzLnNoYXBlJTVCLTElNUQlMkMlMjBtb2RlbC5jb25maWcudm9jYWJfc2l6ZSU1RCUwQWxpc3QobG9naXRzLnNoYXBlKSUyMCUzRCUzRCUyMGV4cGVjdGVkX3NoYXBl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, PLBartForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;uclanlp/plbart-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PLBartForCausalLM.from_pretrained(<span class="hljs-string">&quot;uclanlp/plbart-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(){c=n("p"),y=r("Example:"),_=p(),v(m.$$.fragment)},l(l){c=a(l,"P",{});var f=s(c);y=i(f,"Example:"),f.forEach(o),_=h(l),k(m.$$.fragment,l)},m(l,f){g(l,c,f),e(c,y),g(l,_,f),T(m,l,f),b=!0},p:Rt,i(l){b||(w(m.$$.fragment,l),b=!0)},o(l){M(m.$$.fragment,l),b=!1},d(l){l&&o(c),l&&o(_),B(m,l)}}}function kd(z){let c,y,_,m,b,l,f,C,ba,kn,R,fo,ya,va,Ae,ka,Ta,Ve,wa,Ma,Tn,H,me,go,Qe,Ba,_o,za,wn,Z,Pa,Ye,La,Ca,bo,$a,Fa,Mn,It,Ua,Bn,Nt,yo,ja,zn,X,Ja,Oe,xa,qa,He,Ea,Ga,Pn,D,fe,vo,De,Wa,ko,Ra,Ln,$,Ia,To,Na,Za,wo,Xa,Sa,Mo,Aa,Va,Bo,Qa,Ya,Cn,ge,Oa,Ke,Ha,Da,$n,x,Ka,et,zo,es,ts,os,Po,ns,as,Lo,ss,rs,Fn,Zt,Co,is,Un,tt,jn,Xt,ot,$o,ls,ds,K,cs,Fo,ps,hs,Uo,us,ms,Jn,nt,xn,ee,_e,jo,at,fs,Jo,gs,qn,q,xo,St,_s,bs,qo,At,ys,vs,Eo,Vt,ks,Ts,Go,Qt,ws,En,te,be,Wo,st,Ms,Ro,Bs,Gn,U,rt,zs,oe,Ps,Yt,Ls,Cs,it,$s,Fs,Us,ne,js,Ot,Js,xs,Ht,qs,Es,Gs,ye,Wn,ae,ve,Io,lt,Ws,No,Rs,Rn,P,dt,Is,Zo,Ns,Zs,I,Xs,Dt,Ss,As,Kt,Vs,Qs,ct,Ys,Os,Hs,ke,Ds,Xo,Ks,er,So,tr,Ao,Te,or,we,nr,E,pt,ar,ht,sr,Vo,rr,ir,lr,ut,mt,Qo,dr,cr,Yo,pr,hr,ft,Oo,ur,mr,Ho,fr,gr,Do,_r,In,se,Me,Ko,gt,br,en,yr,Nn,j,_t,vr,bt,kr,eo,Tr,wr,Mr,yt,Br,vt,zr,Pr,Lr,G,kt,Cr,re,$r,to,Fr,Ur,tn,jr,Jr,xr,Be,qr,ze,Zn,ie,Pe,on,Tt,Er,nn,Gr,Xn,J,wt,Wr,Mt,Rr,oo,Ir,Nr,Zr,Bt,Xr,zt,Sr,Ar,Vr,W,Pt,Qr,le,Yr,no,Or,Hr,an,Dr,Kr,ei,Le,ti,Ce,Sn,de,$e,sn,Lt,oi,rn,ni,An,L,Ct,ai,ln,si,ri,$t,ii,ao,li,di,ci,Ft,pi,Ut,hi,ui,mi,F,jt,fi,ce,gi,so,_i,bi,dn,yi,vi,ki,Fe,Ti,Ue,wi,je,Vn,pe,Je,cn,Jt,Mi,pn,Bi,Qn,he,xt,zi,xe,qt,Pi,qe,Yn;return l=new O({}),Qe=new O({}),De=new O({}),tt=new ue({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBMQmFydEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUyQyUyMFBMQmFydFRva2VuaXplciUwQSUwQXRva2VuaXplciUyMCUzRCUyMFBMQmFydFRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydWNsYW5scCUyRnBsYmFydC1iYXNlJTIyJTJDJTIwc3JjX2xhbmclM0QlMjJlbl9YWCUyMiUyQyUyMHRndF9sYW5nJTNEJTIycHl0aG9uJTIyKSUwQWV4YW1wbGVfcHl0aG9uX3BocmFzZSUyMCUzRCUyMCUyMmRlZiUyMG1heGltdW0oYSUyQ2IlMkNjKSUzQU5FV19MSU5FX0lOREVOVHJldHVybiUyMG1heCglNUJhJTJDYiUyQ2MlNUQpJTIyJTBBZXhwZWN0ZWRfdHJhbnNsYXRpb25fZW5nbGlzaCUyMCUzRCUyMCUyMlJldHVybnMlMjB0aGUlMjBtYXhpbXVtJTIwdmFsdWUlMjBvZiUyMGElMjBiJTIwYy4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoZXhhbXBsZV9weXRob25fcGhyYXNlJTJDJTIwdGV4dF90YXJnZXQlM0RleHBlY3RlZF90cmFuc2xhdGlvbl9lbmdsaXNoJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFtb2RlbCgqKmlucHV0cyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PLBartForConditionalGeneration, PLBartTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = PLBartTokenizer.from_pretrained(<span class="hljs-string">&quot;uclanlp/plbart-base&quot;</span>, src_lang=<span class="hljs-string">&quot;en_XX&quot;</span>, tgt_lang=<span class="hljs-string">&quot;python&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>example_python_phrase = <span class="hljs-string">&quot;def maximum(a,b,c):NEW_LINE_INDENTreturn max([a,b,c])&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>expected_translation_english = <span class="hljs-string">&quot;Returns the maximum value of a b c.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(example_python_phrase, text_target=expected_translation_english, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model(**inputs)`}}),nt=new ue({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBMQmFydEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUyQyUyMFBMQmFydFRva2VuaXplciUwQSUwQXRva2VuaXplciUyMCUzRCUyMFBMQmFydFRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydWNsYW5scCUyRnBsYmFydC1weXRob24tZW5fWFglMjIlMkMlMjBzcmNfbGFuZyUzRCUyMnB5dGhvbiUyMiUyQyUyMHRndF9sYW5nJTNEJTIyZW5fWFglMjIpJTBBZXhhbXBsZV9weXRob25fcGhyYXNlJTIwJTNEJTIwJTIyZGVmJTIwbWF4aW11bShhJTJDYiUyQ2MpJTNBTkVXX0xJTkVfSU5ERU5UcmV0dXJuJTIwbWF4KCU1QmElMkNiJTJDYyU1RCklMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoZXhhbXBsZV9weXRob25fcGhyYXNlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFtb2RlbCUyMCUzRCUyMFBMQmFydEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydWNsYW5scCUyRnBsYmFydC1weXRob24tZW5fWFglMjIpJTBBdHJhbnNsYXRlZF90b2tlbnMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyUyQyUyMGRlY29kZXJfc3RhcnRfdG9rZW5faWQlM0R0b2tlbml6ZXIubGFuZ19jb2RlX3RvX2lkJTVCJTIyZW5fWFglMjIlNUQpJTBBdG9rZW5pemVyLmJhdGNoX2RlY29kZSh0cmFuc2xhdGVkX3Rva2VucyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PLBartForConditionalGeneration, PLBartTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = PLBartTokenizer.from_pretrained(<span class="hljs-string">&quot;uclanlp/plbart-python-en_XX&quot;</span>, src_lang=<span class="hljs-string">&quot;python&quot;</span>, tgt_lang=<span class="hljs-string">&quot;en_XX&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>example_python_phrase = <span class="hljs-string">&quot;def maximum(a,b,c):NEW_LINE_INDENTreturn max([a,b,c])&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(example_python_phrase, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PLBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;uclanlp/plbart-python-en_XX&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>translated_tokens = model.generate(**inputs, decoder_start_token_id=tokenizer.lang_code_to_id[<span class="hljs-string">&quot;en_XX&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(translated_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;Returns the maximum value of a b c.&quot;</span>`}}),at=new O({}),st=new O({}),rt=new N({props:{name:"class transformers.PLBartConfig",anchor:"transformers.PLBartConfig",parameters:[{name:"vocab_size",val:" = 50005"},{name:"max_position_embeddings",val:" = 1024"},{name:"encoder_layers",val:" = 6"},{name:"encoder_ffn_dim",val:" = 3072"},{name:"encoder_attention_heads",val:" = 12"},{name:"decoder_layers",val:" = 6"},{name:"decoder_ffn_dim",val:" = 3072"},{name:"decoder_attention_heads",val:" = 12"},{name:"encoder_layerdrop",val:" = 0.0"},{name:"decoder_layerdrop",val:" = 0.0"},{name:"use_cache",val:" = True"},{name:"is_encoder_decoder",val:" = True"},{name:"activation_function",val:" = 'gelu'"},{name:"d_model",val:" = 768"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.1"},{name:"activation_dropout",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"classifier_dropout",val:" = 0.0"},{name:"scale_embedding",val:" = True"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"forced_eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PLBartConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50005) &#x2014;
Vocabulary size of the PLBART 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.33.0/en/model_doc/plbart#transformers.PLBartModel">PLBartModel</a>.`,name:"vocab_size"},{anchor:"transformers.PLBartConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.PLBartConfig.encoder_layers",description:`<strong>encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of encoder layers.`,name:"encoder_layers"},{anchor:"transformers.PLBartConfig.decoder_layers",description:`<strong>decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of decoder layers.`,name:"decoder_layers"},{anchor:"transformers.PLBartConfig.encoder_attention_heads",description:`<strong>encoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"encoder_attention_heads"},{anchor:"transformers.PLBartConfig.decoder_attention_heads",description:`<strong>decoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"decoder_attention_heads"},{anchor:"transformers.PLBartConfig.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.PLBartConfig.encoder_ffn_dim",description:`<strong>encoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.PLBartConfig.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.PLBartConfig.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.PLBartConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.PLBartConfig.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.PLBartConfig.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.PLBartConfig.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.PLBartConfig.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.PLBartConfig.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.PLBartConfig.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.PLBartConfig.scale_embedding",description:`<strong>scale_embedding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Scale embeddings by diving by sqrt(d_model).`,name:"scale_embedding"},{anchor:"transformers.PLBartConfig.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.PLBartConfig.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.33.0/src/transformers/models/plbart/configuration_plbart.py#L32"}}),ye=new Wt({props:{anchor:"transformers.PLBartConfig.example",$$slots:{default:[pd]},$$scope:{ctx:z}}}),lt=new O({}),dt=new N({props:{name:"class transformers.PLBartTokenizer",anchor:"transformers.PLBartTokenizer",parameters:[{name:"vocab_file",val:""},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"language_codes",val:" = 'base'"},{name:"tokenizer_file",val:" = None"},{name:"src_lang",val:" = None"},{name:"tgt_lang",val:" = None"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"additional_special_tokens",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PLBartTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.PLBartTokenizer.src_lang",description:`<strong>src_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A string representing the source language.`,name:"src_lang"},{anchor:"transformers.PLBartTokenizer.tgt_lang",description:`<strong>tgt_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A string representing the target language.`,name:"tgt_lang"},{anchor:"transformers.PLBartTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The start of sequence token.`,name:"bos_token"},{anchor:"transformers.PLBartTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.PLBartTokenizer.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.PLBartTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The cls token, which is a special token used as the first token for all tasks.`,name:"cls_token"},{anchor:"transformers.PLBartTokenizer.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.PLBartTokenizer.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.PLBartTokenizer.mask_token(str,",description:`<strong>mask_token(<code>str</code>,</strong> <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 masking tasks. This
is only used in the <code>&quot;base&quot;</code> tokenizer type. For <code>&quot;multi&quot;</code> tokenizer, masking is never done for the
downstream tasks.`,name:"mask_token(str,"},{anchor:"transformers.PLBartTokenizer.language_codes",description:`<strong>language_codes</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;base&quot;</code>) &#x2014;
What language codes to use. Should be one of <code>&quot;base&quot;</code> or <code>&quot;multi&quot;</code>.`,name:"language_codes"},{anchor:"transformers.PLBartTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:<ul>
<li><code>enable_sampling</code>: Enable subword regularization.</li>
<li><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul></li>
<li><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</li>
</ul>`,name:"sp_model_kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/plbart/tokenization_plbart.py#L106"}}),we=new Wt({props:{anchor:"transformers.PLBartTokenizer.example",$$slots:{default:[hd]},$$scope:{ctx:z}}}),pt=new N({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.PLBartTokenizer.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.PLBartTokenizer.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.PLBartTokenizer.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.33.0/src/transformers/models/plbart/tokenization_plbart.py#L333",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>
`}}),gt=new O({}),_t=new N({props:{name:"class transformers.PLBartModel",anchor:"transformers.PLBartModel",parameters:[{name:"config",val:": PLBartConfig"}],parametersDescription:[{anchor:"transformers.PLBartModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/plbart#transformers.PLBartConfig">PLBartConfig</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.33.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.33.0/src/transformers/models/plbart/modeling_plbart.py#L1134"}}),kt=new N({props:{name:"forward",anchor:"transformers.PLBartModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.LongTensor] = 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.PLBartModel.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a> or <code>PLBartMultiTokenizer</code> depending on the checkpoint.
See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.33.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.PLBartModel.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.PLBartModel.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a> or <code>PLBartMultiTokenizer</code> depending on the checkpoint.
See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.33.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>PLBart uses a specific language id token as the starting token for <code>decoder_input_ids</code> generation that
varies according to source and target language, <em>e.g.</em> 50003 for <em>en_XX</em>, and 50001 for <em>java</em>. If
<code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.PLBartModel.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> ( &#x2014;
obj:<em>torch.LongTensor</em> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>): Default behavior:
generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also be used by default.`,name:"decoder_attention_mask"},{anchor:"transformers.PLBartModel.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.PLBartModel.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.PLBartModel.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> ( &#x2014;
obj:<em>torch.Tensor</em> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>): 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.PLBartModel.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.PLBartModel.forward.past_key_values",description:`<strong>past_key_values</strong> ( &#x2014;
obj:<em>tuple(tuple(torch.FloatTensor))</em>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when
<code>config.use_cache=True</code>): 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>.`,name:"past_key_values"},{anchor:"transformers.PLBartModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> ( &#x2014;
obj:<em>torch.FloatTensor</em> 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:"inputs_embeds"},{anchor:"transformers.PLBartModel.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> ( &#x2014;
obj:<em>torch.FloatTensor</em> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>):
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.PLBartModel.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.PLBartModel.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.PLBartModel.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.PLBartModel.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.33.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.33.0/src/transformers/models/plbart/modeling_plbart.py#L1162",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/plbart#transformers.PLBartConfig"
>PLBartConfig</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.33.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Be=new Ci({props:{$$slots:{default:[ud]},$$scope:{ctx:z}}}),ze=new Wt({props:{anchor:"transformers.PLBartModel.forward.example",$$slots:{default:[md]},$$scope:{ctx:z}}}),Tt=new O({}),wt=new N({props:{name:"class transformers.PLBartForConditionalGeneration",anchor:"transformers.PLBartForConditionalGeneration",parameters:[{name:"config",val:": PLBartConfig"}],parametersDescription:[{anchor:"transformers.PLBartForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/plbart#transformers.PLBartConfig">PLBartConfig</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.33.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.33.0/src/transformers/models/plbart/modeling_plbart.py#L1251"}}),Pt=new N({props:{name:"forward",anchor:"transformers.PLBartForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.LongTensor] = 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.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.PLBartForConditionalGeneration.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a> or <code>PLBartMultiTokenizer</code> depending on the checkpoint.
See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.33.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.PLBartForConditionalGeneration.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.PLBartForConditionalGeneration.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a> or <code>PLBartMultiTokenizer</code> depending on the checkpoint.
See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.33.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>PLBart uses a specific language id token as the starting token for <code>decoder_input_ids</code> generation that
varies according to source and target language, <em>e.g.</em> 50003 for <em>en_XX</em>, and 50001 for <em>java</em>. If
<code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.PLBartForConditionalGeneration.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> ( &#x2014;
obj:<em>torch.LongTensor</em> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>): Default behavior:
generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also be used by default.`,name:"decoder_attention_mask"},{anchor:"transformers.PLBartForConditionalGeneration.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.PLBartForConditionalGeneration.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.PLBartForConditionalGeneration.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> ( &#x2014;
obj:<em>torch.Tensor</em> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>): 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.PLBartForConditionalGeneration.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.PLBartForConditionalGeneration.forward.past_key_values",description:`<strong>past_key_values</strong> ( &#x2014;
obj:<em>tuple(tuple(torch.FloatTensor))</em>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when
<code>config.use_cache=True</code>): 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>.`,name:"past_key_values"},{anchor:"transformers.PLBartForConditionalGeneration.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> ( &#x2014;
obj:<em>torch.FloatTensor</em> 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:"inputs_embeds"},{anchor:"transformers.PLBartForConditionalGeneration.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> ( &#x2014;
obj:<em>torch.FloatTensor</em> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>):
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.PLBartForConditionalGeneration.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.PLBartForConditionalGeneration.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.PLBartForConditionalGeneration.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.PLBartForConditionalGeneration.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.PLBartForConditionalGeneration.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.33.0/src/transformers/models/plbart/modeling_plbart.py#L1290",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/plbart#transformers.PLBartConfig"
>PLBartConfig</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.33.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Le=new Ci({props:{$$slots:{default:[fd]},$$scope:{ctx:z}}}),Ce=new Wt({props:{anchor:"transformers.PLBartForConditionalGeneration.forward.example",$$slots:{default:[gd]},$$scope:{ctx:z}}}),Lt=new O({}),Ct=new N({props:{name:"class transformers.PLBartForSequenceClassification",anchor:"transformers.PLBartForSequenceClassification",parameters:[{name:"config",val:": PLBartConfig"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PLBartForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/plbart#transformers.PLBartConfig">PLBartConfig</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.33.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.33.0/src/transformers/models/plbart/modeling_plbart.py#L1417"}}),jt=new N({props:{name:"forward",anchor:"transformers.PLBartForSequenceClassification.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.PLBartForSequenceClassification.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a> or <code>PLBartMultiTokenizer</code> depending on the checkpoint.
See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.33.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.PLBartForSequenceClassification.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.PLBartForSequenceClassification.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a> or <code>PLBartMultiTokenizer</code> depending on the checkpoint.
See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.33.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>PLBart uses a specific language id token as the starting token for <code>decoder_input_ids</code> generation that
varies according to source and target language, <em>e.g.</em> 50003 for <em>en_XX</em>, and 50001 for <em>java</em>. If
<code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.PLBartForSequenceClassification.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> ( &#x2014;
obj:<em>torch.LongTensor</em> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>): Default behavior:
generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also be used by default.`,name:"decoder_attention_mask"},{anchor:"transformers.PLBartForSequenceClassification.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.PLBartForSequenceClassification.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.PLBartForSequenceClassification.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> ( &#x2014;
obj:<em>torch.Tensor</em> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>): 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.PLBartForSequenceClassification.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.PLBartForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> ( &#x2014;
obj:<em>tuple(tuple(torch.FloatTensor))</em>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when
<code>config.use_cache=True</code>): 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>.`,name:"past_key_values"},{anchor:"transformers.PLBartForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> ( &#x2014;
obj:<em>torch.FloatTensor</em> 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:"inputs_embeds"},{anchor:"transformers.PLBartForSequenceClassification.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> ( &#x2014;
obj:<em>torch.FloatTensor</em> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>):
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.PLBartForSequenceClassification.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.PLBartForSequenceClassification.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.PLBartForSequenceClassification.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.PLBartForSequenceClassification.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.PLBartForSequenceClassification.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.33.0/src/transformers/models/plbart/modeling_plbart.py#L1433",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/plbart#transformers.PLBartConfig"
>PLBartConfig</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.33.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput"
>transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fe=new Ci({props:{$$slots:{default:[_d]},$$scope:{ctx:z}}}),Ue=new Wt({props:{anchor:"transformers.PLBartForSequenceClassification.forward.example",$$slots:{default:[bd]},$$scope:{ctx:z}}}),je=new Wt({props:{anchor:"transformers.PLBartForSequenceClassification.forward.example-2",$$slots:{default:[yd]},$$scope:{ctx:z}}}),Jt=new O({}),xt=new N({props:{name:"class transformers.PLBartForCausalLM",anchor:"transformers.PLBartForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/plbart/modeling_plbart.py#L1555"}}),qt=new N({props:{name:"forward",anchor:"transformers.PLBartForCausalLM.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.PLBartForCausalLM.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.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.PLBartForCausalLM.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.PLBartForCausalLM.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.PLBartForCausalLM.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.PLBartForCausalLM.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.PLBartForCausalLM.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.PLBartForCausalLM.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.PLBartForCausalLM.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.PLBartForCausalLM.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.PLBartForCausalLM.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.PLBartForCausalLM.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.PLBartForCausalLM.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.33.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.33.0/src/transformers/models/plbart/modeling_plbart.py#L1588",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/plbart#transformers.PLBartConfig"
>PLBartConfig</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.33.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qe=new Wt({props:{anchor:"transformers.PLBartForCausalLM.forward.example",$$slots:{default:[vd]},$$scope:{ctx:z}}}),{c(){c=n("meta"),y=p(),_=n("h1"),m=n("a"),b=n("span"),v(l.$$.fragment),f=p(),C=n("span"),ba=r("PLBart"),kn=p(),R=n("p"),fo=n("strong"),ya=r("DISCLAIMER:"),va=r(" If you see something strange, file a "),Ae=n("a"),ka=r("Github Issue"),Ta=r(` and assign
`),Ve=n("a"),wa=r("@gchhablani"),Ma=r("."),Tn=p(),H=n("h2"),me=n("a"),go=n("span"),v(Qe.$$.fragment),Ba=p(),_o=n("span"),za=r("Overview of PLBart"),wn=p(),Z=n("p"),Pa=r("The PLBART model was proposed in "),Ye=n("a"),La=r("Unified Pre-training for Program Understanding and Generation"),Ca=r(` by Wasi Uddin Ahmad, Saikat Chakraborty, Baishakhi Ray, Kai-Wei Chang.
This is a BART-like model which can be used to perform code-summarization, code-generation, and code-translation tasks. The pre-trained model `),bo=n("code"),$a=r("plbart-base"),Fa=r(` has been trained using multilingual denoising task
on Java, Python and English.`),Mn=p(),It=n("p"),Ua=r("According to the abstract"),Bn=p(),Nt=n("p"),yo=n("em"),ja=r(`Code summarization and generation empower conversion between programming language (PL) and natural language (NL),
while code translation avails the migration of legacy code from one PL to another. This paper introduces PLBART,
a sequence-to-sequence model capable of performing a broad spectrum of program and language understanding and generation tasks.
PLBART is pre-trained on an extensive collection of Java and Python functions and associated NL text via denoising autoencoding.
Experiments on code summarization in the English language, code generation, and code translation in seven programming languages
show that PLBART outperforms or rivals state-of-the-art models. Moreover, experiments on discriminative tasks, e.g., program
repair, clone detection, and vulnerable code detection, demonstrate PLBART\u2019s effectiveness in program understanding.
Furthermore, analysis reveals that PLBART learns program syntax, style (e.g., identifier naming convention), logical flow
(e.g., if block inside an else block is equivalent to else if block) that are crucial to program semantics and thus excels
even with limited annotations.`),zn=p(),X=n("p"),Ja=r("This model was contributed by "),Oe=n("a"),xa=r("gchhablani"),qa=r(". The Authors\u2019 code can be found "),He=n("a"),Ea=r("here"),Ga=r("."),Pn=p(),D=n("h3"),fe=n("a"),vo=n("span"),v(De.$$.fragment),Wa=p(),ko=n("span"),Ra=r("Training of PLBart"),Ln=p(),$=n("p"),Ia=r(`PLBart is a multilingual encoder-decoder (sequence-to-sequence) model primarily intended for code-to-text, text-to-code, code-to-code tasks. As the
model is multilingual it expects the sequences in a different format. A special language id token is added in both the
source and target text. The source text format is `),To=n("code"),Na=r("X [eos, src_lang_code]"),Za=r(" where "),wo=n("code"),Xa=r("X"),Sa=r(` is the source text. The
target text format is `),Mo=n("code"),Aa=r("[tgt_lang_code] X [eos]"),Va=r(". "),Bo=n("code"),Qa=r("bos"),Ya=r(" is never used."),Cn=p(),ge=n("p"),Oa=r("However, for fine-tuning, in some cases no language token is provided in cases where a single language is used. Please refer to "),Ke=n("a"),Ha=r("the paper"),Da=r(" to learn more about this."),$n=p(),x=n("p"),Ka=r("In cases where the language code is needed, the regular "),et=n("a"),zo=n("strong"),es=r("call"),ts=r("()"),os=r(` will encode source text format
when you pass texts as the first argument or with the keyword argument `),Po=n("code"),ns=r("text"),as=r(`, and will encode target text format if
it\u2019s passed with the `),Lo=n("code"),ss=r("text_target"),rs=r(" keyword argument."),Fn=p(),Zt=n("ul"),Co=n("li"),is=r("Supervised training"),Un=p(),v(tt.$$.fragment),jn=p(),Xt=n("ul"),ot=n("li"),$o=n("p"),ls=r("Generation"),ds=p(),K=n("p"),cs=r("While generating the target text set the "),Fo=n("code"),ps=r("decoder_start_token_id"),hs=r(` to the target language id. The following
example shows how to translate Python to English using the `),Uo=n("code"),us=r("uclanlp/plbart-python-en_XX"),ms=r(" model."),Jn=p(),v(nt.$$.fragment),xn=p(),ee=n("h2"),_e=n("a"),jo=n("span"),v(at.$$.fragment),fs=p(),Jo=n("span"),gs=r("Documentation resources"),qn=p(),q=n("ul"),xo=n("li"),St=n("a"),_s=r("Text classification task guide"),bs=p(),qo=n("li"),At=n("a"),ys=r("Causal language modeling task guide"),vs=p(),Eo=n("li"),Vt=n("a"),ks=r("Translation task guide"),Ts=p(),Go=n("li"),Qt=n("a"),ws=r("Summarization task guide"),En=p(),te=n("h2"),be=n("a"),Wo=n("span"),v(st.$$.fragment),Ms=p(),Ro=n("span"),Bs=r("PLBartConfig"),Gn=p(),U=n("div"),v(rt.$$.fragment),zs=p(),oe=n("p"),Ps=r("This is the configuration class to store the configuration of a "),Yt=n("a"),Ls=r("PLBartModel"),Cs=r(`. It is used to instantiate an
PLBART 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 PLBART
`),it=n("a"),$s=r("uclanlp/plbart-base"),Fs=r(" architecture."),Us=p(),ne=n("p"),js=r("Configuration objects inherit from "),Ot=n("a"),Js=r("PretrainedConfig"),xs=r(` and can be used to control the model outputs. Read the
documentation from `),Ht=n("a"),qs=r("PretrainedConfig"),Es=r(" for more information."),Gs=p(),v(ye.$$.fragment),Wn=p(),ae=n("h2"),ve=n("a"),Io=n("span"),v(lt.$$.fragment),Ws=p(),No=n("span"),Rs=r("PLBartTokenizer"),Rn=p(),P=n("div"),v(dt.$$.fragment),Is=p(),Zo=n("p"),Ns=r("Construct an PLBART tokenizer."),Zs=p(),I=n("p"),Xs=r("Adapted from "),Dt=n("a"),Ss=r("RobertaTokenizer"),As=r(" and "),Kt=n("a"),Vs=r("XLNetTokenizer"),Qs=r(`. Based on
`),ct=n("a"),Ys=r("SentencePiece"),Os=r("."),Hs=p(),ke=n("p"),Ds=r("The tokenization method is "),Xo=n("code"),Ks=r("<tokens> <eos> <language code>"),er=r(" for source language documents, and `"),So=n("language"),tr=p(),Ao=n("tokens"),Te=n("eos"),or=r("` for target language documents.\n"),v(we.$$.fragment),nr=p(),E=n("div"),v(pt.$$.fragment),ar=p(),ht=n("p"),sr=r(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An PLBART sequence has the following format, where `),Vo=n("code"),rr=r("X"),ir=r(" represents the sequence:"),lr=p(),ut=n("ul"),mt=n("li"),Qo=n("code"),dr=r("input_ids"),cr=r(" (for encoder) "),Yo=n("code"),pr=r("X [eos, src_lang_code]"),hr=p(),ft=n("li"),Oo=n("code"),ur=r("decoder_input_ids"),mr=r(": (for decoder) "),Ho=n("code"),fr=r("X [eos, tgt_lang_code]"),gr=p(),Do=n("p"),_r=r(`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),In=p(),se=n("h2"),Me=n("a"),Ko=n("span"),v(gt.$$.fragment),br=p(),en=n("span"),yr=r("PLBartModel"),Nn=p(),j=n("div"),v(_t.$$.fragment),vr=p(),bt=n("p"),kr=r(`The bare PLBART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),eo=n("a"),Tr=r("PreTrainedModel"),wr=r(`. 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.)`),Mr=p(),yt=n("p"),Br=r("This model is also a PyTorch "),vt=n("a"),zr=r("torch.nn.Module"),Pr=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Lr=p(),G=n("div"),v(kt.$$.fragment),Cr=p(),re=n("p"),$r=r("The "),to=n("a"),Fr=r("PLBartModel"),Ur=r(" forward method, overrides the "),tn=n("code"),jr=r("__call__"),Jr=r(" special method."),xr=p(),v(Be.$$.fragment),qr=p(),v(ze.$$.fragment),Zn=p(),ie=n("h2"),Pe=n("a"),on=n("span"),v(Tt.$$.fragment),Er=p(),nn=n("span"),Gr=r("PLBartForConditionalGeneration"),Xn=p(),J=n("div"),v(wt.$$.fragment),Wr=p(),Mt=n("p"),Rr=r(`The PLBART Model with a language modeling head. Can be used for code-to-text, text-to-code and code-to-code.
This model inherits from `),oo=n("a"),Ir=r("PreTrainedModel"),Nr=r(`. 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.)`),Zr=p(),Bt=n("p"),Xr=r("This model is also a PyTorch "),zt=n("a"),Sr=r("torch.nn.Module"),Ar=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Vr=p(),W=n("div"),v(Pt.$$.fragment),Qr=p(),le=n("p"),Yr=r("The "),no=n("a"),Or=r("PLBartForConditionalGeneration"),Hr=r(" forward method, overrides the "),an=n("code"),Dr=r("__call__"),Kr=r(" special method."),ei=p(),v(Le.$$.fragment),ti=p(),v(Ce.$$.fragment),Sn=p(),de=n("h2"),$e=n("a"),sn=n("span"),v(Lt.$$.fragment),oi=p(),rn=n("span"),ni=r("PLBartForSequenceClassification"),An=p(),L=n("div"),v(Ct.$$.fragment),ai=p(),ln=n("p"),si=r(`PLBart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for code
classification.`),ri=p(),$t=n("p"),ii=r("This model inherits from "),ao=n("a"),li=r("PreTrainedModel"),di=r(`. 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.)`),ci=p(),Ft=n("p"),pi=r("This model is also a PyTorch "),Ut=n("a"),hi=r("torch.nn.Module"),ui=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),mi=p(),F=n("div"),v(jt.$$.fragment),fi=p(),ce=n("p"),gi=r("The "),so=n("a"),_i=r("PLBartForSequenceClassification"),bi=r(" forward method, overrides the "),dn=n("code"),yi=r("__call__"),vi=r(" special method."),ki=p(),v(Fe.$$.fragment),Ti=p(),v(Ue.$$.fragment),wi=p(),v(je.$$.fragment),Vn=p(),pe=n("h2"),Je=n("a"),cn=n("span"),v(Jt.$$.fragment),Mi=p(),pn=n("span"),Bi=r("PLBartForCausalLM"),Qn=p(),he=n("div"),v(xt.$$.fragment),zi=p(),xe=n("div"),v(qt.$$.fragment),Pi=p(),v(qe.$$.fragment),this.h()},l(t){const u=dd('[data-svelte="svelte-1phssyn"]',document.head);c=a(u,"META",{name:!0,content:!0}),u.forEach(o),y=h(t),_=a(t,"H1",{class:!0});var Et=s(_);m=a(Et,"A",{id:!0,class:!0,href:!0});var hn=s(m);b=a(hn,"SPAN",{});var un=s(b);k(l.$$.fragment,un),un.forEach(o),hn.forEach(o),f=h(Et),C=a(Et,"SPAN",{});var mn=s(C);ba=i(mn,"PLBart"),mn.forEach(o),Et.forEach(o),kn=h(t),R=a(t,"P",{});var S=s(R);fo=a(S,"STRONG",{});var fn=s(fo);ya=i(fn,"DISCLAIMER:"),fn.forEach(o),va=i(S," If you see something strange, file a "),Ae=a(S,"A",{href:!0,rel:!0});var gn=s(Ae);ka=i(gn,"Github Issue"),gn.forEach(o),Ta=i(S,` and assign
`),Ve=a(S,"A",{href:!0,rel:!0});var _n=s(Ve);wa=i(_n,"@gchhablani"),_n.forEach(o),Ma=i(S,"."),S.forEach(o),Tn=h(t),H=a(t,"H2",{class:!0});var Gt=s(H);me=a(Gt,"A",{id:!0,class:!0,href:!0});var bn=s(me);go=a(bn,"SPAN",{});var $i=s(go);k(Qe.$$.fragment,$i),$i.forEach(o),bn.forEach(o),Ba=h(Gt),_o=a(Gt,"SPAN",{});var Fi=s(_o);za=i(Fi,"Overview of PLBart"),Fi.forEach(o),Gt.forEach(o),wn=h(t),Z=a(t,"P",{});var ro=s(Z);Pa=i(ro,"The PLBART model was proposed in "),Ye=a(ro,"A",{href:!0,rel:!0});var Ui=s(Ye);La=i(Ui,"Unified Pre-training for Program Understanding and Generation"),Ui.forEach(o),Ca=i(ro,` by Wasi Uddin Ahmad, Saikat Chakraborty, Baishakhi Ray, Kai-Wei Chang.
This is a BART-like model which can be used to perform code-summarization, code-generation, and code-translation tasks. The pre-trained model `),bo=a(ro,"CODE",{});var ji=s(bo);$a=i(ji,"plbart-base"),ji.forEach(o),Fa=i(ro,` has been trained using multilingual denoising task
on Java, Python and English.`),ro.forEach(o),Mn=h(t),It=a(t,"P",{});var Ji=s(It);Ua=i(Ji,"According to the abstract"),Ji.forEach(o),Bn=h(t),Nt=a(t,"P",{});var xi=s(Nt);yo=a(xi,"EM",{});var qi=s(yo);ja=i(qi,`Code summarization and generation empower conversion between programming language (PL) and natural language (NL),
while code translation avails the migration of legacy code from one PL to another. This paper introduces PLBART,
a sequence-to-sequence model capable of performing a broad spectrum of program and language understanding and generation tasks.
PLBART is pre-trained on an extensive collection of Java and Python functions and associated NL text via denoising autoencoding.
Experiments on code summarization in the English language, code generation, and code translation in seven programming languages
show that PLBART outperforms or rivals state-of-the-art models. Moreover, experiments on discriminative tasks, e.g., program
repair, clone detection, and vulnerable code detection, demonstrate PLBART\u2019s effectiveness in program understanding.
Furthermore, analysis reveals that PLBART learns program syntax, style (e.g., identifier naming convention), logical flow
(e.g., if block inside an else block is equivalent to else if block) that are crucial to program semantics and thus excels
even with limited annotations.`),qi.forEach(o),xi.forEach(o),zn=h(t),X=a(t,"P",{});var io=s(X);Ja=i(io,"This model was contributed by "),Oe=a(io,"A",{href:!0,rel:!0});var Ei=s(Oe);xa=i(Ei,"gchhablani"),Ei.forEach(o),qa=i(io,". The Authors\u2019 code can be found "),He=a(io,"A",{href:!0,rel:!0});var Gi=s(He);Ea=i(Gi,"here"),Gi.forEach(o),Ga=i(io,"."),io.forEach(o),Pn=h(t),D=a(t,"H3",{class:!0});var On=s(D);fe=a(On,"A",{id:!0,class:!0,href:!0});var Wi=s(fe);vo=a(Wi,"SPAN",{});var Ri=s(vo);k(De.$$.fragment,Ri),Ri.forEach(o),Wi.forEach(o),Wa=h(On),ko=a(On,"SPAN",{});var Ii=s(ko);Ra=i(Ii,"Training of PLBart"),Ii.forEach(o),On.forEach(o),Ln=h(t),$=a(t,"P",{});var A=s($);Ia=i(A,`PLBart is a multilingual encoder-decoder (sequence-to-sequence) model primarily intended for code-to-text, text-to-code, code-to-code tasks. As the
model is multilingual it expects the sequences in a different format. A special language id token is added in both the
source and target text. The source text format is `),To=a(A,"CODE",{});var Ni=s(To);Na=i(Ni,"X [eos, src_lang_code]"),Ni.forEach(o),Za=i(A," where "),wo=a(A,"CODE",{});var Zi=s(wo);Xa=i(Zi,"X"),Zi.forEach(o),Sa=i(A,` is the source text. The
target text format is `),Mo=a(A,"CODE",{});var Xi=s(Mo);Aa=i(Xi,"[tgt_lang_code] X [eos]"),Xi.forEach(o),Va=i(A,". "),Bo=a(A,"CODE",{});var Si=s(Bo);Qa=i(Si,"bos"),Si.forEach(o),Ya=i(A," is never used."),A.forEach(o),Cn=h(t),ge=a(t,"P",{});var Hn=s(ge);Oa=i(Hn,"However, for fine-tuning, in some cases no language token is provided in cases where a single language is used. Please refer to "),Ke=a(Hn,"A",{href:!0,rel:!0});var Ai=s(Ke);Ha=i(Ai,"the paper"),Ai.forEach(o),Da=i(Hn," to learn more about this."),Hn.forEach(o),$n=h(t),x=a(t,"P",{});var Ee=s(x);Ka=i(Ee,"In cases where the language code is needed, the regular "),et=a(Ee,"A",{href:!0});var Li=s(et);zo=a(Li,"STRONG",{});var Vi=s(zo);es=i(Vi,"call"),Vi.forEach(o),ts=i(Li,"()"),Li.forEach(o),os=i(Ee,` will encode source text format
when you pass texts as the first argument or with the keyword argument `),Po=a(Ee,"CODE",{});var Qi=s(Po);ns=i(Qi,"text"),Qi.forEach(o),as=i(Ee,`, and will encode target text format if
it\u2019s passed with the `),Lo=a(Ee,"CODE",{});var Yi=s(Lo);ss=i(Yi,"text_target"),Yi.forEach(o),rs=i(Ee," keyword argument."),Ee.forEach(o),Fn=h(t),Zt=a(t,"UL",{});var Oi=s(Zt);Co=a(Oi,"LI",{});var Hi=s(Co);is=i(Hi,"Supervised training"),Hi.forEach(o),Oi.forEach(o),Un=h(t),k(tt.$$.fragment,t),jn=h(t),Xt=a(t,"UL",{});var Di=s(Xt);ot=a(Di,"LI",{});var Dn=s(ot);$o=a(Dn,"P",{});var Ki=s($o);ls=i(Ki,"Generation"),Ki.forEach(o),ds=h(Dn),K=a(Dn,"P",{});var lo=s(K);cs=i(lo,"While generating the target text set the "),Fo=a(lo,"CODE",{});var el=s(Fo);ps=i(el,"decoder_start_token_id"),el.forEach(o),hs=i(lo,` to the target language id. The following
example shows how to translate Python to English using the `),Uo=a(lo,"CODE",{});var tl=s(Uo);us=i(tl,"uclanlp/plbart-python-en_XX"),tl.forEach(o),ms=i(lo," model."),lo.forEach(o),Dn.forEach(o),Di.forEach(o),Jn=h(t),k(nt.$$.fragment,t),xn=h(t),ee=a(t,"H2",{class:!0});var Kn=s(ee);_e=a(Kn,"A",{id:!0,class:!0,href:!0});var ol=s(_e);jo=a(ol,"SPAN",{});var nl=s(jo);k(at.$$.fragment,nl),nl.forEach(o),ol.forEach(o),fs=h(Kn),Jo=a(Kn,"SPAN",{});var al=s(Jo);gs=i(al,"Documentation resources"),al.forEach(o),Kn.forEach(o),qn=h(t),q=a(t,"UL",{});var Ge=s(q);xo=a(Ge,"LI",{});var sl=s(xo);St=a(sl,"A",{href:!0});var rl=s(St);_s=i(rl,"Text classification task guide"),rl.forEach(o),sl.forEach(o),bs=h(Ge),qo=a(Ge,"LI",{});var il=s(qo);At=a(il,"A",{href:!0});var ll=s(At);ys=i(ll,"Causal language modeling task guide"),ll.forEach(o),il.forEach(o),vs=h(Ge),Eo=a(Ge,"LI",{});var dl=s(Eo);Vt=a(dl,"A",{href:!0});var cl=s(Vt);ks=i(cl,"Translation task guide"),cl.forEach(o),dl.forEach(o),Ts=h(Ge),Go=a(Ge,"LI",{});var pl=s(Go);Qt=a(pl,"A",{href:!0});var hl=s(Qt);ws=i(hl,"Summarization task guide"),hl.forEach(o),pl.forEach(o),Ge.forEach(o),En=h(t),te=a(t,"H2",{class:!0});var ea=s(te);be=a(ea,"A",{id:!0,class:!0,href:!0});var ul=s(be);Wo=a(ul,"SPAN",{});var ml=s(Wo);k(st.$$.fragment,ml),ml.forEach(o),ul.forEach(o),Ms=h(ea),Ro=a(ea,"SPAN",{});var fl=s(Ro);Bs=i(fl,"PLBartConfig"),fl.forEach(o),ea.forEach(o),Gn=h(t),U=a(t,"DIV",{class:!0});var We=s(U);k(rt.$$.fragment,We),zs=h(We),oe=a(We,"P",{});var co=s(oe);Ps=i(co,"This is the configuration class to store the configuration of a "),Yt=a(co,"A",{href:!0});var gl=s(Yt);Ls=i(gl,"PLBartModel"),gl.forEach(o),Cs=i(co,`. It is used to instantiate an
PLBART 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 PLBART
`),it=a(co,"A",{href:!0,rel:!0});var _l=s(it);$s=i(_l,"uclanlp/plbart-base"),_l.forEach(o),Fs=i(co," architecture."),co.forEach(o),Us=h(We),ne=a(We,"P",{});var po=s(ne);js=i(po,"Configuration objects inherit from "),Ot=a(po,"A",{href:!0});var bl=s(Ot);Js=i(bl,"PretrainedConfig"),bl.forEach(o),xs=i(po,` and can be used to control the model outputs. Read the
documentation from `),Ht=a(po,"A",{href:!0});var yl=s(Ht);qs=i(yl,"PretrainedConfig"),yl.forEach(o),Es=i(po," for more information."),po.forEach(o),Gs=h(We),k(ye.$$.fragment,We),We.forEach(o),Wn=h(t),ae=a(t,"H2",{class:!0});var ta=s(ae);ve=a(ta,"A",{id:!0,class:!0,href:!0});var vl=s(ve);Io=a(vl,"SPAN",{});var kl=s(Io);k(lt.$$.fragment,kl),kl.forEach(o),vl.forEach(o),Ws=h(ta),No=a(ta,"SPAN",{});var Tl=s(No);Rs=i(Tl,"PLBartTokenizer"),Tl.forEach(o),ta.forEach(o),Rn=h(t),P=a(t,"DIV",{class:!0});var V=s(P);k(dt.$$.fragment,V),Is=h(V),Zo=a(V,"P",{});var wl=s(Zo);Ns=i(wl,"Construct an PLBART tokenizer."),wl.forEach(o),Zs=h(V),I=a(V,"P",{});var Re=s(I);Xs=i(Re,"Adapted from "),Dt=a(Re,"A",{href:!0});var Ml=s(Dt);Ss=i(Ml,"RobertaTokenizer"),Ml.forEach(o),As=i(Re," and "),Kt=a(Re,"A",{href:!0});var Bl=s(Kt);Vs=i(Bl,"XLNetTokenizer"),Bl.forEach(o),Qs=i(Re,`. Based on
`),ct=a(Re,"A",{href:!0,rel:!0});var zl=s(ct);Ys=i(zl,"SentencePiece"),zl.forEach(o),Os=i(Re,"."),Re.forEach(o),Hs=h(V),ke=a(V,"P",{});var yn=s(ke);Ds=i(yn,"The tokenization method is "),Xo=a(yn,"CODE",{});var Pl=s(Xo);Ks=i(Pl,"<tokens> <eos> <language code>"),Pl.forEach(o),er=i(yn," for source language documents, and `"),So=a(yn,"LANGUAGE",{code:!0}),s(So).forEach(o),yn.forEach(o),tr=h(V),Ao=a(V,"TOKENS",{});var Ll=s(Ao);Te=a(Ll,"EOS",{});var vn=s(Te);or=i(vn,"` for target language documents.\n"),k(we.$$.fragment,vn),nr=h(vn),E=a(vn,"DIV",{class:!0});var Ie=s(E);k(pt.$$.fragment,Ie),ar=h(Ie),ht=a(Ie,"P",{});var oa=s(ht);sr=i(oa,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An PLBART sequence has the following format, where `),Vo=a(oa,"CODE",{});var Cl=s(Vo);rr=i(Cl,"X"),Cl.forEach(o),ir=i(oa," represents the sequence:"),oa.forEach(o),lr=h(Ie),ut=a(Ie,"UL",{});var na=s(ut);mt=a(na,"LI",{});var aa=s(mt);Qo=a(aa,"CODE",{});var $l=s(Qo);dr=i($l,"input_ids"),$l.forEach(o),cr=i(aa," (for encoder) "),Yo=a(aa,"CODE",{});var Fl=s(Yo);pr=i(Fl,"X [eos, src_lang_code]"),Fl.forEach(o),aa.forEach(o),hr=h(na),ft=a(na,"LI",{});var sa=s(ft);Oo=a(sa,"CODE",{});var Ul=s(Oo);ur=i(Ul,"decoder_input_ids"),Ul.forEach(o),mr=i(sa,": (for decoder) "),Ho=a(sa,"CODE",{});var jl=s(Ho);fr=i(jl,"X [eos, tgt_lang_code]"),jl.forEach(o),sa.forEach(o),na.forEach(o),gr=h(Ie),Do=a(Ie,"P",{});var Jl=s(Do);_r=i(Jl,`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),Jl.forEach(o),Ie.forEach(o),vn.forEach(o),Ll.forEach(o),V.forEach(o),In=h(t),se=a(t,"H2",{class:!0});var ra=s(se);Me=a(ra,"A",{id:!0,class:!0,href:!0});var xl=s(Me);Ko=a(xl,"SPAN",{});var ql=s(Ko);k(gt.$$.fragment,ql),ql.forEach(o),xl.forEach(o),br=h(ra),en=a(ra,"SPAN",{});var El=s(en);yr=i(El,"PLBartModel"),El.forEach(o),ra.forEach(o),Nn=h(t),j=a(t,"DIV",{class:!0});var Ne=s(j);k(_t.$$.fragment,Ne),vr=h(Ne),bt=a(Ne,"P",{});var ia=s(bt);kr=i(ia,`The bare PLBART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),eo=a(ia,"A",{href:!0});var Gl=s(eo);Tr=i(Gl,"PreTrainedModel"),Gl.forEach(o),wr=i(ia,`. 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.)`),ia.forEach(o),Mr=h(Ne),yt=a(Ne,"P",{});var la=s(yt);Br=i(la,"This model is also a PyTorch "),vt=a(la,"A",{href:!0,rel:!0});var Wl=s(vt);zr=i(Wl,"torch.nn.Module"),Wl.forEach(o),Pr=i(la,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),la.forEach(o),Lr=h(Ne),G=a(Ne,"DIV",{class:!0});var Ze=s(G);k(kt.$$.fragment,Ze),Cr=h(Ze),re=a(Ze,"P",{});var ho=s(re);$r=i(ho,"The "),to=a(ho,"A",{href:!0});var Rl=s(to);Fr=i(Rl,"PLBartModel"),Rl.forEach(o),Ur=i(ho," forward method, overrides the "),tn=a(ho,"CODE",{});var Il=s(tn);jr=i(Il,"__call__"),Il.forEach(o),Jr=i(ho," special method."),ho.forEach(o),xr=h(Ze),k(Be.$$.fragment,Ze),qr=h(Ze),k(ze.$$.fragment,Ze),Ze.forEach(o),Ne.forEach(o),Zn=h(t),ie=a(t,"H2",{class:!0});var da=s(ie);Pe=a(da,"A",{id:!0,class:!0,href:!0});var Nl=s(Pe);on=a(Nl,"SPAN",{});var Zl=s(on);k(Tt.$$.fragment,Zl),Zl.forEach(o),Nl.forEach(o),Er=h(da),nn=a(da,"SPAN",{});var Xl=s(nn);Gr=i(Xl,"PLBartForConditionalGeneration"),Xl.forEach(o),da.forEach(o),Xn=h(t),J=a(t,"DIV",{class:!0});var Xe=s(J);k(wt.$$.fragment,Xe),Wr=h(Xe),Mt=a(Xe,"P",{});var ca=s(Mt);Rr=i(ca,`The PLBART Model with a language modeling head. Can be used for code-to-text, text-to-code and code-to-code.
This model inherits from `),oo=a(ca,"A",{href:!0});var Sl=s(oo);Ir=i(Sl,"PreTrainedModel"),Sl.forEach(o),Nr=i(ca,`. 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.)`),ca.forEach(o),Zr=h(Xe),Bt=a(Xe,"P",{});var pa=s(Bt);Xr=i(pa,"This model is also a PyTorch "),zt=a(pa,"A",{href:!0,rel:!0});var Al=s(zt);Sr=i(Al,"torch.nn.Module"),Al.forEach(o),Ar=i(pa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pa.forEach(o),Vr=h(Xe),W=a(Xe,"DIV",{class:!0});var Se=s(W);k(Pt.$$.fragment,Se),Qr=h(Se),le=a(Se,"P",{});var uo=s(le);Yr=i(uo,"The "),no=a(uo,"A",{href:!0});var Vl=s(no);Or=i(Vl,"PLBartForConditionalGeneration"),Vl.forEach(o),Hr=i(uo," forward method, overrides the "),an=a(uo,"CODE",{});var Ql=s(an);Dr=i(Ql,"__call__"),Ql.forEach(o),Kr=i(uo," special method."),uo.forEach(o),ei=h(Se),k(Le.$$.fragment,Se),ti=h(Se),k(Ce.$$.fragment,Se),Se.forEach(o),Xe.forEach(o),Sn=h(t),de=a(t,"H2",{class:!0});var ha=s(de);$e=a(ha,"A",{id:!0,class:!0,href:!0});var Yl=s($e);sn=a(Yl,"SPAN",{});var Ol=s(sn);k(Lt.$$.fragment,Ol),Ol.forEach(o),Yl.forEach(o),oi=h(ha),rn=a(ha,"SPAN",{});var Hl=s(rn);ni=i(Hl,"PLBartForSequenceClassification"),Hl.forEach(o),ha.forEach(o),An=h(t),L=a(t,"DIV",{class:!0});var Q=s(L);k(Ct.$$.fragment,Q),ai=h(Q),ln=a(Q,"P",{});var Dl=s(ln);si=i(Dl,`PLBart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for code
classification.`),Dl.forEach(o),ri=h(Q),$t=a(Q,"P",{});var ua=s($t);ii=i(ua,"This model inherits from "),ao=a(ua,"A",{href:!0});var Kl=s(ao);li=i(Kl,"PreTrainedModel"),Kl.forEach(o),di=i(ua,`. 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.)`),ua.forEach(o),ci=h(Q),Ft=a(Q,"P",{});var ma=s(Ft);pi=i(ma,"This model is also a PyTorch "),Ut=a(ma,"A",{href:!0,rel:!0});var ed=s(Ut);hi=i(ed,"torch.nn.Module"),ed.forEach(o),ui=i(ma,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ma.forEach(o),mi=h(Q),F=a(Q,"DIV",{class:!0});var Y=s(F);k(jt.$$.fragment,Y),fi=h(Y),ce=a(Y,"P",{});var mo=s(ce);gi=i(mo,"The "),so=a(mo,"A",{href:!0});var td=s(so);_i=i(td,"PLBartForSequenceClassification"),td.forEach(o),bi=i(mo," forward method, overrides the "),dn=a(mo,"CODE",{});var od=s(dn);yi=i(od,"__call__"),od.forEach(o),vi=i(mo," special method."),mo.forEach(o),ki=h(Y),k(Fe.$$.fragment,Y),Ti=h(Y),k(Ue.$$.fragment,Y),wi=h(Y),k(je.$$.fragment,Y),Y.forEach(o),Q.forEach(o),Vn=h(t),pe=a(t,"H2",{class:!0});var fa=s(pe);Je=a(fa,"A",{id:!0,class:!0,href:!0});var nd=s(Je);cn=a(nd,"SPAN",{});var ad=s(cn);k(Jt.$$.fragment,ad),ad.forEach(o),nd.forEach(o),Mi=h(fa),pn=a(fa,"SPAN",{});var sd=s(pn);Bi=i(sd,"PLBartForCausalLM"),sd.forEach(o),fa.forEach(o),Qn=h(t),he=a(t,"DIV",{class:!0});var ga=s(he);k(xt.$$.fragment,ga),zi=h(ga),xe=a(ga,"DIV",{class:!0});var _a=s(xe);k(qt.$$.fragment,_a),Pi=h(_a),k(qe.$$.fragment,_a),_a.forEach(o),ga.forEach(o),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(Td)),d(m,"id","plbart"),d(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"),d(m,"href","#plbart"),d(_,"class","relative group"),d(Ae,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),d(Ae,"rel","nofollow"),d(Ve,"href","https://www.github.com/gchhablani"),d(Ve,"rel","nofollow"),d(me,"id","overview-of-plbart"),d(me,"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"),d(me,"href","#overview-of-plbart"),d(H,"class","relative group"),d(Ye,"href","https://arxiv.org/abs/2103.06333"),d(Ye,"rel","nofollow"),d(Oe,"href","https://huggingface.co/gchhablani"),d(Oe,"rel","nofollow"),d(He,"href","https://github.com/wasiahmad/PLBART"),d(He,"rel","nofollow"),d(fe,"id","training-of-plbart"),d(fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(fe,"href","#training-of-plbart"),d(D,"class","relative group"),d(Ke,"href","https://arxiv.org/abs/2103.06333"),d(Ke,"rel","nofollow"),d(et,"href","/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"),d(_e,"id","documentation-resources"),d(_e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(_e,"href","#documentation-resources"),d(ee,"class","relative group"),d(St,"href","../tasks/sequence_classification"),d(At,"href","../tasks/language_modeling"),d(Vt,"href","../tasks/translation"),d(Qt,"href","../tasks/summarization"),d(be,"id","transformers.PLBartConfig"),d(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"),d(be,"href","#transformers.PLBartConfig"),d(te,"class","relative group"),d(Yt,"href","/docs/transformers/v4.33.0/en/model_doc/plbart#transformers.PLBartModel"),d(it,"href","https://huggingface.co/uclanlp/plbart-base"),d(it,"rel","nofollow"),d(Ot,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(Ht,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ve,"id","transformers.PLBartTokenizer"),d(ve,"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"),d(ve,"href","#transformers.PLBartTokenizer"),d(ae,"class","relative group"),d(Dt,"href","/docs/transformers/v4.33.0/en/model_doc/roberta#transformers.RobertaTokenizer"),d(Kt,"href","/docs/transformers/v4.33.0/en/model_doc/xlnet#transformers.XLNetTokenizer"),d(ct,"href","https://github.com/google/sentencepiece"),d(ct,"rel","nofollow"),d(So,"code",""),d(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Me,"id","transformers.PLBartModel"),d(Me,"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"),d(Me,"href","#transformers.PLBartModel"),d(se,"class","relative group"),d(eo,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),d(vt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(vt,"rel","nofollow"),d(to,"href","/docs/transformers/v4.33.0/en/model_doc/plbart#transformers.PLBartModel"),d(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Pe,"id","transformers.PLBartForConditionalGeneration"),d(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Pe,"href","#transformers.PLBartForConditionalGeneration"),d(ie,"class","relative group"),d(oo,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),d(zt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(zt,"rel","nofollow"),d(no,"href","/docs/transformers/v4.33.0/en/model_doc/plbart#transformers.PLBartForConditionalGeneration"),d(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($e,"id","transformers.PLBartForSequenceClassification"),d($e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d($e,"href","#transformers.PLBartForSequenceClassification"),d(de,"class","relative group"),d(ao,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),d(Ut,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ut,"rel","nofollow"),d(so,"href","/docs/transformers/v4.33.0/en/model_doc/plbart#transformers.PLBartForSequenceClassification"),d(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Je,"id","transformers.PLBartForCausalLM"),d(Je,"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"),d(Je,"href","#transformers.PLBartForCausalLM"),d(pe,"class","relative group"),d(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,u){e(document.head,c),g(t,y,u),g(t,_,u),e(_,m),e(m,b),T(l,b,null),e(_,f),e(_,C),e(C,ba),g(t,kn,u),g(t,R,u),e(R,fo),e(fo,ya),e(R,va),e(R,Ae),e(Ae,ka),e(R,Ta),e(R,Ve),e(Ve,wa),e(R,Ma),g(t,Tn,u),g(t,H,u),e(H,me),e(me,go),T(Qe,go,null),e(H,Ba),e(H,_o),e(_o,za),g(t,wn,u),g(t,Z,u),e(Z,Pa),e(Z,Ye),e(Ye,La),e(Z,Ca),e(Z,bo),e(bo,$a),e(Z,Fa),g(t,Mn,u),g(t,It,u),e(It,Ua),g(t,Bn,u),g(t,Nt,u),e(Nt,yo),e(yo,ja),g(t,zn,u),g(t,X,u),e(X,Ja),e(X,Oe),e(Oe,xa),e(X,qa),e(X,He),e(He,Ea),e(X,Ga),g(t,Pn,u),g(t,D,u),e(D,fe),e(fe,vo),T(De,vo,null),e(D,Wa),e(D,ko),e(ko,Ra),g(t,Ln,u),g(t,$,u),e($,Ia),e($,To),e(To,Na),e($,Za),e($,wo),e(wo,Xa),e($,Sa),e($,Mo),e(Mo,Aa),e($,Va),e($,Bo),e(Bo,Qa),e($,Ya),g(t,Cn,u),g(t,ge,u),e(ge,Oa),e(ge,Ke),e(Ke,Ha),e(ge,Da),g(t,$n,u),g(t,x,u),e(x,Ka),e(x,et),e(et,zo),e(zo,es),e(et,ts),e(x,os),e(x,Po),e(Po,ns),e(x,as),e(x,Lo),e(Lo,ss),e(x,rs),g(t,Fn,u),g(t,Zt,u),e(Zt,Co),e(Co,is),g(t,Un,u),T(tt,t,u),g(t,jn,u),g(t,Xt,u),e(Xt,ot),e(ot,$o),e($o,ls),e(ot,ds),e(ot,K),e(K,cs),e(K,Fo),e(Fo,ps),e(K,hs),e(K,Uo),e(Uo,us),e(K,ms),g(t,Jn,u),T(nt,t,u),g(t,xn,u),g(t,ee,u),e(ee,_e),e(_e,jo),T(at,jo,null),e(ee,fs),e(ee,Jo),e(Jo,gs),g(t,qn,u),g(t,q,u),e(q,xo),e(xo,St),e(St,_s),e(q,bs),e(q,qo),e(qo,At),e(At,ys),e(q,vs),e(q,Eo),e(Eo,Vt),e(Vt,ks),e(q,Ts),e(q,Go),e(Go,Qt),e(Qt,ws),g(t,En,u),g(t,te,u),e(te,be),e(be,Wo),T(st,Wo,null),e(te,Ms),e(te,Ro),e(Ro,Bs),g(t,Gn,u),g(t,U,u),T(rt,U,null),e(U,zs),e(U,oe),e(oe,Ps),e(oe,Yt),e(Yt,Ls),e(oe,Cs),e(oe,it),e(it,$s),e(oe,Fs),e(U,Us),e(U,ne),e(ne,js),e(ne,Ot),e(Ot,Js),e(ne,xs),e(ne,Ht),e(Ht,qs),e(ne,Es),e(U,Gs),T(ye,U,null),g(t,Wn,u),g(t,ae,u),e(ae,ve),e(ve,Io),T(lt,Io,null),e(ae,Ws),e(ae,No),e(No,Rs),g(t,Rn,u),g(t,P,u),T(dt,P,null),e(P,Is),e(P,Zo),e(Zo,Ns),e(P,Zs),e(P,I),e(I,Xs),e(I,Dt),e(Dt,Ss),e(I,As),e(I,Kt),e(Kt,Vs),e(I,Qs),e(I,ct),e(ct,Ys),e(I,Os),e(P,Hs),e(P,ke),e(ke,Ds),e(ke,Xo),e(Xo,Ks),e(ke,er),e(ke,So),e(P,tr),e(P,Ao),e(Ao,Te),e(Te,or),T(we,Te,null),e(Te,nr),e(Te,E),T(pt,E,null),e(E,ar),e(E,ht),e(ht,sr),e(ht,Vo),e(Vo,rr),e(ht,ir),e(E,lr),e(E,ut),e(ut,mt),e(mt,Qo),e(Qo,dr),e(mt,cr),e(mt,Yo),e(Yo,pr),e(ut,hr),e(ut,ft),e(ft,Oo),e(Oo,ur),e(ft,mr),e(ft,Ho),e(Ho,fr),e(E,gr),e(E,Do),e(Do,_r),g(t,In,u),g(t,se,u),e(se,Me),e(Me,Ko),T(gt,Ko,null),e(se,br),e(se,en),e(en,yr),g(t,Nn,u),g(t,j,u),T(_t,j,null),e(j,vr),e(j,bt),e(bt,kr),e(bt,eo),e(eo,Tr),e(bt,wr),e(j,Mr),e(j,yt),e(yt,Br),e(yt,vt),e(vt,zr),e(yt,Pr),e(j,Lr),e(j,G),T(kt,G,null),e(G,Cr),e(G,re),e(re,$r),e(re,to),e(to,Fr),e(re,Ur),e(re,tn),e(tn,jr),e(re,Jr),e(G,xr),T(Be,G,null),e(G,qr),T(ze,G,null),g(t,Zn,u),g(t,ie,u),e(ie,Pe),e(Pe,on),T(Tt,on,null),e(ie,Er),e(ie,nn),e(nn,Gr),g(t,Xn,u),g(t,J,u),T(wt,J,null),e(J,Wr),e(J,Mt),e(Mt,Rr),e(Mt,oo),e(oo,Ir),e(Mt,Nr),e(J,Zr),e(J,Bt),e(Bt,Xr),e(Bt,zt),e(zt,Sr),e(Bt,Ar),e(J,Vr),e(J,W),T(Pt,W,null),e(W,Qr),e(W,le),e(le,Yr),e(le,no),e(no,Or),e(le,Hr),e(le,an),e(an,Dr),e(le,Kr),e(W,ei),T(Le,W,null),e(W,ti),T(Ce,W,null),g(t,Sn,u),g(t,de,u),e(de,$e),e($e,sn),T(Lt,sn,null),e(de,oi),e(de,rn),e(rn,ni),g(t,An,u),g(t,L,u),T(Ct,L,null),e(L,ai),e(L,ln),e(ln,si),e(L,ri),e(L,$t),e($t,ii),e($t,ao),e(ao,li),e($t,di),e(L,ci),e(L,Ft),e(Ft,pi),e(Ft,Ut),e(Ut,hi),e(Ft,ui),e(L,mi),e(L,F),T(jt,F,null),e(F,fi),e(F,ce),e(ce,gi),e(ce,so),e(so,_i),e(ce,bi),e(ce,dn),e(dn,yi),e(ce,vi),e(F,ki),T(Fe,F,null),e(F,Ti),T(Ue,F,null),e(F,wi),T(je,F,null),g(t,Vn,u),g(t,pe,u),e(pe,Je),e(Je,cn),T(Jt,cn,null),e(pe,Mi),e(pe,pn),e(pn,Bi),g(t,Qn,u),g(t,he,u),T(xt,he,null),e(he,zi),e(he,xe),T(qt,xe,null),e(xe,Pi),T(qe,xe,null),Yn=!0},p(t,[u]){const Et={};u&2&&(Et.$$scope={dirty:u,ctx:t}),ye.$set(Et);const hn={};u&2&&(hn.$$scope={dirty:u,ctx:t}),we.$set(hn);const un={};u&2&&(un.$$scope={dirty:u,ctx:t}),Be.$set(un);const mn={};u&2&&(mn.$$scope={dirty:u,ctx:t}),ze.$set(mn);const S={};u&2&&(S.$$scope={dirty:u,ctx:t}),Le.$set(S);const fn={};u&2&&(fn.$$scope={dirty:u,ctx:t}),Ce.$set(fn);const gn={};u&2&&(gn.$$scope={dirty:u,ctx:t}),Fe.$set(gn);const _n={};u&2&&(_n.$$scope={dirty:u,ctx:t}),Ue.$set(_n);const Gt={};u&2&&(Gt.$$scope={dirty:u,ctx:t}),je.$set(Gt);const bn={};u&2&&(bn.$$scope={dirty:u,ctx:t}),qe.$set(bn)},i(t){Yn||(w(l.$$.fragment,t),w(Qe.$$.fragment,t),w(De.$$.fragment,t),w(tt.$$.fragment,t),w(nt.$$.fragment,t),w(at.$$.fragment,t),w(st.$$.fragment,t),w(rt.$$.fragment,t),w(ye.$$.fragment,t),w(lt.$$.fragment,t),w(dt.$$.fragment,t),w(we.$$.fragment,t),w(pt.$$.fragment,t),w(gt.$$.fragment,t),w(_t.$$.fragment,t),w(kt.$$.fragment,t),w(Be.$$.fragment,t),w(ze.$$.fragment,t),w(Tt.$$.fragment,t),w(wt.$$.fragment,t),w(Pt.$$.fragment,t),w(Le.$$.fragment,t),w(Ce.$$.fragment,t),w(Lt.$$.fragment,t),w(Ct.$$.fragment,t),w(jt.$$.fragment,t),w(Fe.$$.fragment,t),w(Ue.$$.fragment,t),w(je.$$.fragment,t),w(Jt.$$.fragment,t),w(xt.$$.fragment,t),w(qt.$$.fragment,t),w(qe.$$.fragment,t),Yn=!0)},o(t){M(l.$$.fragment,t),M(Qe.$$.fragment,t),M(De.$$.fragment,t),M(tt.$$.fragment,t),M(nt.$$.fragment,t),M(at.$$.fragment,t),M(st.$$.fragment,t),M(rt.$$.fragment,t),M(ye.$$.fragment,t),M(lt.$$.fragment,t),M(dt.$$.fragment,t),M(we.$$.fragment,t),M(pt.$$.fragment,t),M(gt.$$.fragment,t),M(_t.$$.fragment,t),M(kt.$$.fragment,t),M(Be.$$.fragment,t),M(ze.$$.fragment,t),M(Tt.$$.fragment,t),M(wt.$$.fragment,t),M(Pt.$$.fragment,t),M(Le.$$.fragment,t),M(Ce.$$.fragment,t),M(Lt.$$.fragment,t),M(Ct.$$.fragment,t),M(jt.$$.fragment,t),M(Fe.$$.fragment,t),M(Ue.$$.fragment,t),M(je.$$.fragment,t),M(Jt.$$.fragment,t),M(xt.$$.fragment,t),M(qt.$$.fragment,t),M(qe.$$.fragment,t),Yn=!1},d(t){o(c),t&&o(y),t&&o(_),B(l),t&&o(kn),t&&o(R),t&&o(Tn),t&&o(H),B(Qe),t&&o(wn),t&&o(Z),t&&o(Mn),t&&o(It),t&&o(Bn),t&&o(Nt),t&&o(zn),t&&o(X),t&&o(Pn),t&&o(D),B(De),t&&o(Ln),t&&o($),t&&o(Cn),t&&o(ge),t&&o($n),t&&o(x),t&&o(Fn),t&&o(Zt),t&&o(Un),B(tt,t),t&&o(jn),t&&o(Xt),t&&o(Jn),B(nt,t),t&&o(xn),t&&o(ee),B(at),t&&o(qn),t&&o(q),t&&o(En),t&&o(te),B(st),t&&o(Gn),t&&o(U),B(rt),B(ye),t&&o(Wn),t&&o(ae),B(lt),t&&o(Rn),t&&o(P),B(dt),B(we),B(pt),t&&o(In),t&&o(se),B(gt),t&&o(Nn),t&&o(j),B(_t),B(kt),B(Be),B(ze),t&&o(Zn),t&&o(ie),B(Tt),t&&o(Xn),t&&o(J),B(wt),B(Pt),B(Le),B(Ce),t&&o(Sn),t&&o(de),B(Lt),t&&o(An),t&&o(L),B(Ct),B(jt),B(Fe),B(Ue),B(je),t&&o(Vn),t&&o(pe),B(Jt),t&&o(Qn),t&&o(he),B(xt),B(qt),B(qe)}}}const Td={local:"plbart",sections:[{local:"overview-of-plbart",sections:[{local:"training-of-plbart",title:"Training of PLBart"}],title:"Overview of PLBart"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.PLBartConfig",title:"PLBartConfig"},{local:"transformers.PLBartTokenizer",title:"PLBartTokenizer"},{local:"transformers.PLBartModel",title:"PLBartModel"},{local:"transformers.PLBartForConditionalGeneration",title:"PLBartForConditionalGeneration"},{local:"transformers.PLBartForSequenceClassification",title:"PLBartForSequenceClassification"},{local:"transformers.PLBartForCausalLM",title:"PLBartForCausalLM"}],title:"PLBart"};function wd(z){return cd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $d extends rd{constructor(c){super();id(this,c,wd,kd,ld,{})}}export{$d as default,Td as metadata};
