import{S as vd,i as yd,s as Td,e as n,k as h,w as v,t as i,M as wd,c as a,d as o,m as u,a as s,x as y,h as d,b as c,G as e,g,y as T,q as w,o as P,B as L,v as Pd,L as jt}from"../../chunks/vendor-hf-doc-builder.js";import{T as ei}from"../../chunks/Tip-hf-doc-builder.js";import{D as X}from"../../chunks/Docstring-hf-doc-builder.js";import{C as he}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as pe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Et}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ld($){let l,k,_,m,b;return m=new he({props:{code:`from transformers import PLBartConfig, PLBartModel

# Initializing a PLBART uclanlp/plbart-base style configuration
configuration = PLBartConfig()

# Initializing a model (with random weights) from the uclanlp/plbart-base style configuration
model = PLBartModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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(){l=n("p"),k=i("Example:"),_=h(),v(m.$$.fragment)},l(r){l=a(r,"P",{});var f=s(l);k=d(f,"Example:"),f.forEach(o),_=u(r),y(m.$$.fragment,r)},m(r,f){g(r,l,f),e(l,k),g(r,_,f),T(m,r,f),b=!0},p:jt,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){P(m.$$.fragment,r),b=!1},d(r){r&&o(l),r&&o(_),L(m,r)}}}function $d($){let l,k,_,m,b;return m=new he({props:{code:`from transformers import PLBartTokenizer

tokenizer = PLBartTokenizer.from_pretrained("uclanlp/plbart-python-en_XX", src_lang="python", tgt_lang="en_XX")
example_python_phrase = "def maximum(a,b,c):NEW_LINE_INDENTreturn max([a,b,c])"
expected_translation_english = "Returns the maximum value of a b c."
inputs = tokenizer(example_python_phrase, text_target=expected_translation_english, return_tensors="pt")`,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(){l=n("p"),k=i("Examples:"),_=h(),v(m.$$.fragment)},l(r){l=a(r,"P",{});var f=s(l);k=d(f,"Examples:"),f.forEach(o),_=u(r),y(m.$$.fragment,r)},m(r,f){g(r,l,f),e(l,k),g(r,_,f),T(m,r,f),b=!0},p:jt,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){P(m.$$.fragment,r),b=!1},d(r){r&&o(l),r&&o(_),L(m,r)}}}function qd($){let l,k,_,m,b;return{c(){l=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var f=s(l);k=d(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(f,"CODE",{});var B=s(_);m=d(B,"Module"),B.forEach(o),b=d(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(r,f){g(r,l,f),e(l,k),e(l,_),e(_,m),e(l,b)},d(r){r&&o(l)}}}function zd($){let l,k,_,m,b;return m=new he({props:{code:`from transformers import AutoTokenizer, PLBartModel
import torch

tokenizer = AutoTokenizer.from_pretrained("uclanlp/plbart-base")
model = PLBartModel.from_pretrained("uclanlp/plbart-base")

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

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

model = PLBartForConditionalGeneration.from_pretrained("uclanlp/plbart-base")
tokenizer = AutoTokenizer.from_pretrained("uclanlp/plbart-base")

# en_XX is the language symbol id <LID> for English
TXT = "<s> Is 0 the <mask> Fibonacci number ? </s> en_XX"
input_ids = tokenizer([TXT], add_special_tokens=False, return_tensors="pt").input_ids

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

tokenizer.decode(predictions).split()`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, 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(){l=n("p"),k=i("Mask-filling example:"),_=h(),v(m.$$.fragment)},l(r){l=a(r,"P",{});var f=s(l);k=d(f,"Mask-filling example:"),f.forEach(o),_=u(r),y(m.$$.fragment,r)},m(r,f){g(r,l,f),e(l,k),g(r,_,f),T(m,r,f),b=!0},p:jt,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){P(m.$$.fragment,r),b=!1},d(r){r&&o(l),r&&o(_),L(m,r)}}}function Cd($){let l,k,_,m,b;return{c(){l=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var f=s(l);k=d(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(f,"CODE",{});var B=s(_);m=d(B,"Module"),B.forEach(o),b=d(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(r,f){g(r,l,f),e(l,k),e(l,_),e(_,m),e(l,b)},d(r){r&&o(l)}}}function Fd($){let l,k,_,m,b;return m=new he({props:{code:`import torch
from transformers import AutoTokenizer, PLBartForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("uclanlp/plbart-base")
model = PLBartForSequenceClassification.from_pretrained("uclanlp/plbart-base")

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

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

predicted_class_id = logits.argmax().item()

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = PLBartForSequenceClassification.from_pretrained("uclanlp/plbart-base", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, 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(){l=n("p"),k=i("Example of single-label classification:"),_=h(),v(m.$$.fragment)},l(r){l=a(r,"P",{});var f=s(l);k=d(f,"Example of single-label classification:"),f.forEach(o),_=u(r),y(m.$$.fragment,r)},m(r,f){g(r,l,f),e(l,k),g(r,_,f),T(m,r,f),b=!0},p:jt,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){P(m.$$.fragment,r),b=!1},d(r){r&&o(l),r&&o(_),L(m,r)}}}function Ed($){let l,k,_,m,b;return m=new he({props:{code:`import torch
from transformers import AutoTokenizer, PLBartForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("uclanlp/plbart-base")
model = PLBartForSequenceClassification.from_pretrained("uclanlp/plbart-base", problem_type="multi_label_classification")

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

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

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

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = PLBartForSequenceClassification.from_pretrained(
    "uclanlp/plbart-base", num_labels=num_labels, problem_type="multi_label_classification"
)

labels = torch.sum(
    torch.nn.functional.one_hot(predicted_class_ids[None, :].clone(), num_classes=num_labels), dim=1
).to(torch.float)
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, 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(){l=n("p"),k=i("Example of multi-label classification:"),_=h(),v(m.$$.fragment)},l(r){l=a(r,"P",{});var f=s(l);k=d(f,"Example of multi-label classification:"),f.forEach(o),_=u(r),y(m.$$.fragment,r)},m(r,f){g(r,l,f),e(l,k),g(r,_,f),T(m,r,f),b=!0},p:jt,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){P(m.$$.fragment,r),b=!1},d(r){r&&o(l),r&&o(_),L(m,r)}}}function jd($){let l,k,_,m,b;return m=new he({props:{code:`from transformers import AutoTokenizer, PLBartForCausalLM

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

logits = outputs.logits
expected_shape = [1, inputs.input_ids.shape[-1], model.config.vocab_size]
list(logits.shape) == expected_shape`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, 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(){l=n("p"),k=i("Example:"),_=h(),v(m.$$.fragment)},l(r){l=a(r,"P",{});var f=s(l);k=d(f,"Example:"),f.forEach(o),_=u(r),y(m.$$.fragment,r)},m(r,f){g(r,l,f),e(l,k),g(r,_,f),T(m,r,f),b=!0},p:jt,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){P(m.$$.fragment,r),b=!1},d(r){r&&o(l),r&&o(_),L(m,r)}}}function Md($){let l,k,_,m,b,r,f,B,Qn,on,I,so,Yn,Zn,De,ea,ta,Xe,oa,na,nn,J,ue,ro,Ge,aa,io,sa,an,G,ra,Re,ia,da,lo,la,ca,sn,Mt,pa,rn,At,co,ha,dn,R,ua,We,ma,fa,He,ga,_a,ln,K,me,po,Ue,ba,ho,ka,cn,x,va,uo,ya,Ta,mo,wa,Pa,fo,La,$a,go,qa,za,pn,fe,Ba,Ve,xa,Ca,hn,M,Fa,Je,_o,Ea,ja,Ma,bo,Aa,Sa,ko,Na,Oa,un,St,vo,Ia,mn,Ke,fn,Nt,Qe,yo,Da,Xa,Q,Ga,To,Ra,Wa,wo,Ha,Ua,gn,Ye,_n,Y,ge,Po,Ze,Va,Lo,Ja,bn,F,et,Ka,Z,Qa,Ot,Ya,Za,tt,es,ts,os,ee,ns,It,as,ss,Dt,rs,is,ds,_e,kn,te,be,$o,ot,ls,qo,cs,vn,q,nt,ps,zo,hs,us,D,ms,Xt,fs,gs,Gt,_s,bs,at,ks,vs,ys,oe,Ts,Bo,ws,Ps,xo,Ls,$s,qs,ke,zs,A,st,Bs,rt,xs,Co,Cs,Fs,Es,it,dt,Fo,js,Ms,Eo,As,Ss,lt,jo,Ns,Os,Mo,Is,Ds,Ao,Xs,yn,ne,ve,So,ct,Gs,No,Rs,Tn,E,pt,Ws,ht,Hs,Rt,Us,Vs,Js,ut,Ks,mt,Qs,Ys,Zs,S,ft,er,ae,tr,Wt,or,nr,Oo,ar,sr,rr,ye,ir,Te,wn,se,we,Io,gt,dr,Do,lr,Pn,j,_t,cr,bt,pr,Ht,hr,ur,mr,kt,fr,vt,gr,_r,br,N,yt,kr,re,vr,Ut,yr,Tr,Xo,wr,Pr,Lr,Pe,$r,Le,Ln,ie,$e,Go,Tt,qr,Ro,zr,$n,z,wt,Br,Wo,xr,Cr,Pt,Fr,Vt,Er,jr,Mr,Lt,Ar,$t,Sr,Nr,Or,C,qt,Ir,de,Dr,Jt,Xr,Gr,Ho,Rr,Wr,Hr,qe,Ur,ze,Vr,Be,qn,le,xe,Uo,zt,Jr,Vo,Kr,zn,ce,Bt,Qr,Ce,xt,Yr,Fe,Bn;return r=new pe({}),Ge=new pe({}),Ue=new pe({}),Ke=new he({props:{code:`from transformers import PLBartForConditionalGeneration, PLBartTokenizer

tokenizer = PLBartTokenizer.from_pretrained("uclanlp/plbart-base", src_lang="en_XX", tgt_lang="python")
example_python_phrase = "def maximum(a,b,c):NEW_LINE_INDENTreturn max([a,b,c])"
expected_translation_english = "Returns the maximum value of a b c."
inputs = tokenizer(example_python_phrase, text_target=expected_translation_english, return_tensors="pt")
model(**inputs)`,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)`}}),Ye=new he({props:{code:`from transformers import PLBartForConditionalGeneration, PLBartTokenizer

tokenizer = PLBartTokenizer.from_pretrained("uclanlp/plbart-python-en_XX", src_lang="python", tgt_lang="en_XX")
example_python_phrase = "def maximum(a,b,c):NEW_LINE_INDENTreturn max([a,b,c])"
inputs = tokenizer(example_python_phrase, return_tensors="pt")
model = PLBartForConditionalGeneration.from_pretrained("uclanlp/plbart-python-en_XX")
translated_tokens = model.generate(**inputs, decoder_start_token_id=tokenizer.lang_code_to_id["en_XX"])
tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)[0]`,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>`}}),Ze=new pe({}),et=new X({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/main/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/main/src/transformers/models/plbart/configuration_plbart.py#L32"}}),_e=new Et({props:{anchor:"transformers.PLBartConfig.example",$$slots:{default:[Ld]},$$scope:{ctx:$}}}),ot=new pe({}),nt=new X({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/main/src/transformers/models/plbart/tokenization_plbart.py#L106"}}),ke=new Et({props:{anchor:"transformers.PLBartTokenizer.example",$$slots:{default:[$d]},$$scope:{ctx:$}}}),st=new X({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/main/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>
`}}),ct=new pe({}),pt=new X({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/plbart/modeling_plbart.py#L1124"}}),ft=new X({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:" = 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a> or <code>PLBartMultiTokenizer</code> depending on the checkpoint.
See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a> or <code>PLBartMultiTokenizer</code> depending on the checkpoint.
See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/plbart/modeling_plbart.py#L1152",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ye=new ei({props:{$$slots:{default:[qd]},$$scope:{ctx:$}}}),Te=new Et({props:{anchor:"transformers.PLBartModel.forward.example",$$slots:{default:[zd]},$$scope:{ctx:$}}}),gt=new pe({}),_t=new X({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/plbart/modeling_plbart.py#L1241"}}),yt=new X({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:" = 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a> or <code>PLBartMultiTokenizer</code> depending on the checkpoint.
See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a> or <code>PLBartMultiTokenizer</code> depending on the checkpoint.
See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>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/main/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/main/src/transformers/models/plbart/modeling_plbart.py#L1286",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Pe=new ei({props:{$$slots:{default:[Bd]},$$scope:{ctx:$}}}),Le=new Et({props:{anchor:"transformers.PLBartForConditionalGeneration.forward.example",$$slots:{default:[xd]},$$scope:{ctx:$}}}),Tt=new pe({}),wt=new X({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/plbart/modeling_plbart.py#L1413"}}),qt=new X({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a> or <code>PLBartMultiTokenizer</code> depending on the checkpoint.
See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a> or <code>PLBartMultiTokenizer</code> depending on the checkpoint.
See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>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/main/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/main/src/transformers/models/plbart/modeling_plbart.py#L1428",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput"
>transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput"
>transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qe=new ei({props:{$$slots:{default:[Cd]},$$scope:{ctx:$}}}),ze=new Et({props:{anchor:"transformers.PLBartForSequenceClassification.forward.example",$$slots:{default:[Fd]},$$scope:{ctx:$}}}),Be=new Et({props:{anchor:"transformers.PLBartForSequenceClassification.forward.example-2",$$slots:{default:[Ed]},$$scope:{ctx:$}}}),zt=new pe({}),Bt=new X({props:{name:"class transformers.PLBartForCausalLM",anchor:"transformers.PLBartForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/plbart/modeling_plbart.py#L1549"}}),xt=new X({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/plbart/modeling_plbart.py#L1582",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fe=new Et({props:{anchor:"transformers.PLBartForCausalLM.forward.example",$$slots:{default:[jd]},$$scope:{ctx:$}}}),{c(){l=n("meta"),k=h(),_=n("h1"),m=n("a"),b=n("span"),v(r.$$.fragment),f=h(),B=n("span"),Qn=i("PLBart"),on=h(),I=n("p"),so=n("strong"),Yn=i("DISCLAIMER:"),Zn=i(" If you see something strange, file a "),De=n("a"),ea=i("Github Issue"),ta=i(` and assign
`),Xe=n("a"),oa=i("@gchhablani"),na=i("."),nn=h(),J=n("h2"),ue=n("a"),ro=n("span"),v(Ge.$$.fragment),aa=h(),io=n("span"),sa=i("Overview of PLBart"),an=h(),G=n("p"),ra=i("The PLBART model was proposed in "),Re=n("a"),ia=i("Unified Pre-training for Program Understanding and Generation"),da=i(` 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 `),lo=n("code"),la=i("plbart-base"),ca=i(` has been trained using multilingual denoising task
on Java, Python and English.`),sn=h(),Mt=n("p"),pa=i("According to the abstract"),rn=h(),At=n("p"),co=n("em"),ha=i(`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.`),dn=h(),R=n("p"),ua=i("This model was contributed by "),We=n("a"),ma=i("gchhablani"),fa=i(". The Authors\u2019 code can be found "),He=n("a"),ga=i("here"),_a=i("."),ln=h(),K=n("h3"),me=n("a"),po=n("span"),v(Ue.$$.fragment),ba=h(),ho=n("span"),ka=i("Training of PLBart"),cn=h(),x=n("p"),va=i(`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 `),uo=n("code"),ya=i("X [eos, src_lang_code]"),Ta=i(" where "),mo=n("code"),wa=i("X"),Pa=i(` is the source text. The
target text format is `),fo=n("code"),La=i("[tgt_lang_code] X [eos]"),$a=i(". "),go=n("code"),qa=i("bos"),za=i(" is never used."),pn=h(),fe=n("p"),Ba=i("However, for fine-tuning, in some cases no language token is provided in cases where a single language is used. Please refer to "),Ve=n("a"),xa=i("the paper"),Ca=i(" to learn more about this."),hn=h(),M=n("p"),Fa=i("In cases where the language code is needed, the regular "),Je=n("a"),_o=n("strong"),Ea=i("call"),ja=i("()"),Ma=i(` will encode source text format
when you pass texts as the first argument or with the keyword argument `),bo=n("code"),Aa=i("text"),Sa=i(`, and will encode target text format if
it\u2019s passed with the `),ko=n("code"),Na=i("text_target"),Oa=i(" keyword argument."),un=h(),St=n("ul"),vo=n("li"),Ia=i("Supervised training"),mn=h(),v(Ke.$$.fragment),fn=h(),Nt=n("ul"),Qe=n("li"),yo=n("p"),Da=i("Generation"),Xa=h(),Q=n("p"),Ga=i("While generating the target text set the "),To=n("code"),Ra=i("decoder_start_token_id"),Wa=i(` to the target language id. The following
example shows how to translate Python to English using the `),wo=n("code"),Ha=i("uclanlp/plbart-python-en_XX"),Ua=i(" model."),gn=h(),v(Ye.$$.fragment),_n=h(),Y=n("h2"),ge=n("a"),Po=n("span"),v(Ze.$$.fragment),Va=h(),Lo=n("span"),Ja=i("PLBartConfig"),bn=h(),F=n("div"),v(et.$$.fragment),Ka=h(),Z=n("p"),Qa=i("This is the configuration class to store the configuration of a "),Ot=n("a"),Ya=i("PLBartModel"),Za=i(`. 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
`),tt=n("a"),es=i("uclanlp/plbart-base"),ts=i(" architecture."),os=h(),ee=n("p"),ns=i("Configuration objects inherit from "),It=n("a"),as=i("PretrainedConfig"),ss=i(` and can be used to control the model outputs. Read the
documentation from `),Dt=n("a"),rs=i("PretrainedConfig"),is=i(" for more information."),ds=h(),v(_e.$$.fragment),kn=h(),te=n("h2"),be=n("a"),$o=n("span"),v(ot.$$.fragment),ls=h(),qo=n("span"),cs=i("PLBartTokenizer"),vn=h(),q=n("div"),v(nt.$$.fragment),ps=h(),zo=n("p"),hs=i("Construct an PLBART tokenizer."),us=h(),D=n("p"),ms=i("Adapted from "),Xt=n("a"),fs=i("RobertaTokenizer"),gs=i(" and "),Gt=n("a"),_s=i("XLNetTokenizer"),bs=i(`. Based on
`),at=n("a"),ks=i("SentencePiece"),vs=i("."),ys=h(),oe=n("p"),Ts=i("The tokenization method is "),Bo=n("code"),ws=i("<tokens> <eos> <language code>"),Ps=i(" for source language documents, and "),xo=n("code"),Ls=i("<language code> <tokens> <eos>"),$s=i(" for target language documents."),qs=h(),v(ke.$$.fragment),zs=h(),A=n("div"),v(st.$$.fragment),Bs=h(),rt=n("p"),xs=i(`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 `),Co=n("code"),Cs=i("X"),Fs=i(" represents the sequence:"),Es=h(),it=n("ul"),dt=n("li"),Fo=n("code"),js=i("input_ids"),Ms=i(" (for encoder) "),Eo=n("code"),As=i("X [eos, src_lang_code]"),Ss=h(),lt=n("li"),jo=n("code"),Ns=i("decoder_input_ids"),Os=i(": (for decoder) "),Mo=n("code"),Is=i("X [eos, tgt_lang_code]"),Ds=h(),Ao=n("p"),Xs=i(`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),yn=h(),ne=n("h2"),ve=n("a"),So=n("span"),v(ct.$$.fragment),Gs=h(),No=n("span"),Rs=i("PLBartModel"),Tn=h(),E=n("div"),v(pt.$$.fragment),Ws=h(),ht=n("p"),Hs=i(`The bare PLBART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Rt=n("a"),Us=i("PreTrainedModel"),Vs=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Js=h(),ut=n("p"),Ks=i("This model is also a PyTorch "),mt=n("a"),Qs=i("torch.nn.Module"),Ys=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Zs=h(),S=n("div"),v(ft.$$.fragment),er=h(),ae=n("p"),tr=i("The "),Wt=n("a"),or=i("PLBartModel"),nr=i(" forward method, overrides the "),Oo=n("code"),ar=i("__call__"),sr=i(" special method."),rr=h(),v(ye.$$.fragment),ir=h(),v(Te.$$.fragment),wn=h(),se=n("h2"),we=n("a"),Io=n("span"),v(gt.$$.fragment),dr=h(),Do=n("span"),lr=i("PLBartForConditionalGeneration"),Pn=h(),j=n("div"),v(_t.$$.fragment),cr=h(),bt=n("p"),pr=i(`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 `),Ht=n("a"),hr=i("PreTrainedModel"),ur=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),mr=h(),kt=n("p"),fr=i("This model is also a PyTorch "),vt=n("a"),gr=i("torch.nn.Module"),_r=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),br=h(),N=n("div"),v(yt.$$.fragment),kr=h(),re=n("p"),vr=i("The "),Ut=n("a"),yr=i("PLBartForConditionalGeneration"),Tr=i(" forward method, overrides the "),Xo=n("code"),wr=i("__call__"),Pr=i(" special method."),Lr=h(),v(Pe.$$.fragment),$r=h(),v(Le.$$.fragment),Ln=h(),ie=n("h2"),$e=n("a"),Go=n("span"),v(Tt.$$.fragment),qr=h(),Ro=n("span"),zr=i("PLBartForSequenceClassification"),$n=h(),z=n("div"),v(wt.$$.fragment),Br=h(),Wo=n("p"),xr=i(`PLBart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for code
classification.`),Cr=h(),Pt=n("p"),Fr=i("This model inherits from "),Vt=n("a"),Er=i("PreTrainedModel"),jr=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Mr=h(),Lt=n("p"),Ar=i("This model is also a PyTorch "),$t=n("a"),Sr=i("torch.nn.Module"),Nr=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Or=h(),C=n("div"),v(qt.$$.fragment),Ir=h(),de=n("p"),Dr=i("The "),Jt=n("a"),Xr=i("PLBartForSequenceClassification"),Gr=i(" forward method, overrides the "),Ho=n("code"),Rr=i("__call__"),Wr=i(" special method."),Hr=h(),v(qe.$$.fragment),Ur=h(),v(ze.$$.fragment),Vr=h(),v(Be.$$.fragment),qn=h(),le=n("h2"),xe=n("a"),Uo=n("span"),v(zt.$$.fragment),Jr=h(),Vo=n("span"),Kr=i("PLBartForCausalLM"),zn=h(),ce=n("div"),v(Bt.$$.fragment),Qr=h(),Ce=n("div"),v(xt.$$.fragment),Yr=h(),v(Fe.$$.fragment),this.h()},l(t){const p=wd('[data-svelte="svelte-1phssyn"]',document.head);l=a(p,"META",{name:!0,content:!0}),p.forEach(o),k=u(t),_=a(t,"H1",{class:!0});var Ct=s(_);m=a(Ct,"A",{id:!0,class:!0,href:!0});var Jo=s(m);b=a(Jo,"SPAN",{});var Ko=s(b);y(r.$$.fragment,Ko),Ko.forEach(o),Jo.forEach(o),f=u(Ct),B=a(Ct,"SPAN",{});var Qo=s(B);Qn=d(Qo,"PLBart"),Qo.forEach(o),Ct.forEach(o),on=u(t),I=a(t,"P",{});var W=s(I);so=a(W,"STRONG",{});var Yo=s(so);Yn=d(Yo,"DISCLAIMER:"),Yo.forEach(o),Zn=d(W," If you see something strange, file a "),De=a(W,"A",{href:!0,rel:!0});var Zo=s(De);ea=d(Zo,"Github Issue"),Zo.forEach(o),ta=d(W,` and assign
`),Xe=a(W,"A",{href:!0,rel:!0});var en=s(Xe);oa=d(en,"@gchhablani"),en.forEach(o),na=d(W,"."),W.forEach(o),nn=u(t),J=a(t,"H2",{class:!0});var Ft=s(J);ue=a(Ft,"A",{id:!0,class:!0,href:!0});var tn=s(ue);ro=a(tn,"SPAN",{});var ti=s(ro);y(Ge.$$.fragment,ti),ti.forEach(o),tn.forEach(o),aa=u(Ft),io=a(Ft,"SPAN",{});var oi=s(io);sa=d(oi,"Overview of PLBart"),oi.forEach(o),Ft.forEach(o),an=u(t),G=a(t,"P",{});var Kt=s(G);ra=d(Kt,"The PLBART model was proposed in "),Re=a(Kt,"A",{href:!0,rel:!0});var ni=s(Re);ia=d(ni,"Unified Pre-training for Program Understanding and Generation"),ni.forEach(o),da=d(Kt,` 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 `),lo=a(Kt,"CODE",{});var ai=s(lo);la=d(ai,"plbart-base"),ai.forEach(o),ca=d(Kt,` has been trained using multilingual denoising task
on Java, Python and English.`),Kt.forEach(o),sn=u(t),Mt=a(t,"P",{});var si=s(Mt);pa=d(si,"According to the abstract"),si.forEach(o),rn=u(t),At=a(t,"P",{});var ri=s(At);co=a(ri,"EM",{});var ii=s(co);ha=d(ii,`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.`),ii.forEach(o),ri.forEach(o),dn=u(t),R=a(t,"P",{});var Qt=s(R);ua=d(Qt,"This model was contributed by "),We=a(Qt,"A",{href:!0,rel:!0});var di=s(We);ma=d(di,"gchhablani"),di.forEach(o),fa=d(Qt,". The Authors\u2019 code can be found "),He=a(Qt,"A",{href:!0,rel:!0});var li=s(He);ga=d(li,"here"),li.forEach(o),_a=d(Qt,"."),Qt.forEach(o),ln=u(t),K=a(t,"H3",{class:!0});var xn=s(K);me=a(xn,"A",{id:!0,class:!0,href:!0});var ci=s(me);po=a(ci,"SPAN",{});var pi=s(po);y(Ue.$$.fragment,pi),pi.forEach(o),ci.forEach(o),ba=u(xn),ho=a(xn,"SPAN",{});var hi=s(ho);ka=d(hi,"Training of PLBart"),hi.forEach(o),xn.forEach(o),cn=u(t),x=a(t,"P",{});var H=s(x);va=d(H,`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 `),uo=a(H,"CODE",{});var ui=s(uo);ya=d(ui,"X [eos, src_lang_code]"),ui.forEach(o),Ta=d(H," where "),mo=a(H,"CODE",{});var mi=s(mo);wa=d(mi,"X"),mi.forEach(o),Pa=d(H,` is the source text. The
target text format is `),fo=a(H,"CODE",{});var fi=s(fo);La=d(fi,"[tgt_lang_code] X [eos]"),fi.forEach(o),$a=d(H,". "),go=a(H,"CODE",{});var gi=s(go);qa=d(gi,"bos"),gi.forEach(o),za=d(H," is never used."),H.forEach(o),pn=u(t),fe=a(t,"P",{});var Cn=s(fe);Ba=d(Cn,"However, for fine-tuning, in some cases no language token is provided in cases where a single language is used. Please refer to "),Ve=a(Cn,"A",{href:!0,rel:!0});var _i=s(Ve);xa=d(_i,"the paper"),_i.forEach(o),Ca=d(Cn," to learn more about this."),Cn.forEach(o),hn=u(t),M=a(t,"P",{});var Ee=s(M);Fa=d(Ee,"In cases where the language code is needed, the regular "),Je=a(Ee,"A",{href:!0});var Zr=s(Je);_o=a(Zr,"STRONG",{});var bi=s(_o);Ea=d(bi,"call"),bi.forEach(o),ja=d(Zr,"()"),Zr.forEach(o),Ma=d(Ee,` will encode source text format
when you pass texts as the first argument or with the keyword argument `),bo=a(Ee,"CODE",{});var ki=s(bo);Aa=d(ki,"text"),ki.forEach(o),Sa=d(Ee,`, and will encode target text format if
it\u2019s passed with the `),ko=a(Ee,"CODE",{});var vi=s(ko);Na=d(vi,"text_target"),vi.forEach(o),Oa=d(Ee," keyword argument."),Ee.forEach(o),un=u(t),St=a(t,"UL",{});var yi=s(St);vo=a(yi,"LI",{});var Ti=s(vo);Ia=d(Ti,"Supervised training"),Ti.forEach(o),yi.forEach(o),mn=u(t),y(Ke.$$.fragment,t),fn=u(t),Nt=a(t,"UL",{});var wi=s(Nt);Qe=a(wi,"LI",{});var Fn=s(Qe);yo=a(Fn,"P",{});var Pi=s(yo);Da=d(Pi,"Generation"),Pi.forEach(o),Xa=u(Fn),Q=a(Fn,"P",{});var Yt=s(Q);Ga=d(Yt,"While generating the target text set the "),To=a(Yt,"CODE",{});var Li=s(To);Ra=d(Li,"decoder_start_token_id"),Li.forEach(o),Wa=d(Yt,` to the target language id. The following
example shows how to translate Python to English using the `),wo=a(Yt,"CODE",{});var $i=s(wo);Ha=d($i,"uclanlp/plbart-python-en_XX"),$i.forEach(o),Ua=d(Yt," model."),Yt.forEach(o),Fn.forEach(o),wi.forEach(o),gn=u(t),y(Ye.$$.fragment,t),_n=u(t),Y=a(t,"H2",{class:!0});var En=s(Y);ge=a(En,"A",{id:!0,class:!0,href:!0});var qi=s(ge);Po=a(qi,"SPAN",{});var zi=s(Po);y(Ze.$$.fragment,zi),zi.forEach(o),qi.forEach(o),Va=u(En),Lo=a(En,"SPAN",{});var Bi=s(Lo);Ja=d(Bi,"PLBartConfig"),Bi.forEach(o),En.forEach(o),bn=u(t),F=a(t,"DIV",{class:!0});var je=s(F);y(et.$$.fragment,je),Ka=u(je),Z=a(je,"P",{});var Zt=s(Z);Qa=d(Zt,"This is the configuration class to store the configuration of a "),Ot=a(Zt,"A",{href:!0});var xi=s(Ot);Ya=d(xi,"PLBartModel"),xi.forEach(o),Za=d(Zt,`. 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
`),tt=a(Zt,"A",{href:!0,rel:!0});var Ci=s(tt);es=d(Ci,"uclanlp/plbart-base"),Ci.forEach(o),ts=d(Zt," architecture."),Zt.forEach(o),os=u(je),ee=a(je,"P",{});var eo=s(ee);ns=d(eo,"Configuration objects inherit from "),It=a(eo,"A",{href:!0});var Fi=s(It);as=d(Fi,"PretrainedConfig"),Fi.forEach(o),ss=d(eo,` and can be used to control the model outputs. Read the
documentation from `),Dt=a(eo,"A",{href:!0});var Ei=s(Dt);rs=d(Ei,"PretrainedConfig"),Ei.forEach(o),is=d(eo," for more information."),eo.forEach(o),ds=u(je),y(_e.$$.fragment,je),je.forEach(o),kn=u(t),te=a(t,"H2",{class:!0});var jn=s(te);be=a(jn,"A",{id:!0,class:!0,href:!0});var ji=s(be);$o=a(ji,"SPAN",{});var Mi=s($o);y(ot.$$.fragment,Mi),Mi.forEach(o),ji.forEach(o),ls=u(jn),qo=a(jn,"SPAN",{});var Ai=s(qo);cs=d(Ai,"PLBartTokenizer"),Ai.forEach(o),jn.forEach(o),vn=u(t),q=a(t,"DIV",{class:!0});var O=s(q);y(nt.$$.fragment,O),ps=u(O),zo=a(O,"P",{});var Si=s(zo);hs=d(Si,"Construct an PLBART tokenizer."),Si.forEach(o),us=u(O),D=a(O,"P",{});var Me=s(D);ms=d(Me,"Adapted from "),Xt=a(Me,"A",{href:!0});var Ni=s(Xt);fs=d(Ni,"RobertaTokenizer"),Ni.forEach(o),gs=d(Me," and "),Gt=a(Me,"A",{href:!0});var Oi=s(Gt);_s=d(Oi,"XLNetTokenizer"),Oi.forEach(o),bs=d(Me,`. Based on
`),at=a(Me,"A",{href:!0,rel:!0});var Ii=s(at);ks=d(Ii,"SentencePiece"),Ii.forEach(o),vs=d(Me,"."),Me.forEach(o),ys=u(O),oe=a(O,"P",{});var to=s(oe);Ts=d(to,"The tokenization method is "),Bo=a(to,"CODE",{});var Di=s(Bo);ws=d(Di,"<tokens> <eos> <language code>"),Di.forEach(o),Ps=d(to," for source language documents, and "),xo=a(to,"CODE",{});var Xi=s(xo);Ls=d(Xi,"<language code> <tokens> <eos>"),Xi.forEach(o),$s=d(to," for target language documents."),to.forEach(o),qs=u(O),y(ke.$$.fragment,O),zs=u(O),A=a(O,"DIV",{class:!0});var Ae=s(A);y(st.$$.fragment,Ae),Bs=u(Ae),rt=a(Ae,"P",{});var Mn=s(rt);xs=d(Mn,`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 `),Co=a(Mn,"CODE",{});var Gi=s(Co);Cs=d(Gi,"X"),Gi.forEach(o),Fs=d(Mn," represents the sequence:"),Mn.forEach(o),Es=u(Ae),it=a(Ae,"UL",{});var An=s(it);dt=a(An,"LI",{});var Sn=s(dt);Fo=a(Sn,"CODE",{});var Ri=s(Fo);js=d(Ri,"input_ids"),Ri.forEach(o),Ms=d(Sn," (for encoder) "),Eo=a(Sn,"CODE",{});var Wi=s(Eo);As=d(Wi,"X [eos, src_lang_code]"),Wi.forEach(o),Sn.forEach(o),Ss=u(An),lt=a(An,"LI",{});var Nn=s(lt);jo=a(Nn,"CODE",{});var Hi=s(jo);Ns=d(Hi,"decoder_input_ids"),Hi.forEach(o),Os=d(Nn,": (for decoder) "),Mo=a(Nn,"CODE",{});var Ui=s(Mo);Is=d(Ui,"X [eos, tgt_lang_code]"),Ui.forEach(o),Nn.forEach(o),An.forEach(o),Ds=u(Ae),Ao=a(Ae,"P",{});var Vi=s(Ao);Xs=d(Vi,`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),Vi.forEach(o),Ae.forEach(o),O.forEach(o),yn=u(t),ne=a(t,"H2",{class:!0});var On=s(ne);ve=a(On,"A",{id:!0,class:!0,href:!0});var Ji=s(ve);So=a(Ji,"SPAN",{});var Ki=s(So);y(ct.$$.fragment,Ki),Ki.forEach(o),Ji.forEach(o),Gs=u(On),No=a(On,"SPAN",{});var Qi=s(No);Rs=d(Qi,"PLBartModel"),Qi.forEach(o),On.forEach(o),Tn=u(t),E=a(t,"DIV",{class:!0});var Se=s(E);y(pt.$$.fragment,Se),Ws=u(Se),ht=a(Se,"P",{});var In=s(ht);Hs=d(In,`The bare PLBART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Rt=a(In,"A",{href:!0});var Yi=s(Rt);Us=d(Yi,"PreTrainedModel"),Yi.forEach(o),Vs=d(In,`. 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.)`),In.forEach(o),Js=u(Se),ut=a(Se,"P",{});var Dn=s(ut);Ks=d(Dn,"This model is also a PyTorch "),mt=a(Dn,"A",{href:!0,rel:!0});var Zi=s(mt);Qs=d(Zi,"torch.nn.Module"),Zi.forEach(o),Ys=d(Dn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Dn.forEach(o),Zs=u(Se),S=a(Se,"DIV",{class:!0});var Ne=s(S);y(ft.$$.fragment,Ne),er=u(Ne),ae=a(Ne,"P",{});var oo=s(ae);tr=d(oo,"The "),Wt=a(oo,"A",{href:!0});var ed=s(Wt);or=d(ed,"PLBartModel"),ed.forEach(o),nr=d(oo," forward method, overrides the "),Oo=a(oo,"CODE",{});var td=s(Oo);ar=d(td,"__call__"),td.forEach(o),sr=d(oo," special method."),oo.forEach(o),rr=u(Ne),y(ye.$$.fragment,Ne),ir=u(Ne),y(Te.$$.fragment,Ne),Ne.forEach(o),Se.forEach(o),wn=u(t),se=a(t,"H2",{class:!0});var Xn=s(se);we=a(Xn,"A",{id:!0,class:!0,href:!0});var od=s(we);Io=a(od,"SPAN",{});var nd=s(Io);y(gt.$$.fragment,nd),nd.forEach(o),od.forEach(o),dr=u(Xn),Do=a(Xn,"SPAN",{});var ad=s(Do);lr=d(ad,"PLBartForConditionalGeneration"),ad.forEach(o),Xn.forEach(o),Pn=u(t),j=a(t,"DIV",{class:!0});var Oe=s(j);y(_t.$$.fragment,Oe),cr=u(Oe),bt=a(Oe,"P",{});var Gn=s(bt);pr=d(Gn,`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 `),Ht=a(Gn,"A",{href:!0});var sd=s(Ht);hr=d(sd,"PreTrainedModel"),sd.forEach(o),ur=d(Gn,`. 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.)`),Gn.forEach(o),mr=u(Oe),kt=a(Oe,"P",{});var Rn=s(kt);fr=d(Rn,"This model is also a PyTorch "),vt=a(Rn,"A",{href:!0,rel:!0});var rd=s(vt);gr=d(rd,"torch.nn.Module"),rd.forEach(o),_r=d(Rn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Rn.forEach(o),br=u(Oe),N=a(Oe,"DIV",{class:!0});var Ie=s(N);y(yt.$$.fragment,Ie),kr=u(Ie),re=a(Ie,"P",{});var no=s(re);vr=d(no,"The "),Ut=a(no,"A",{href:!0});var id=s(Ut);yr=d(id,"PLBartForConditionalGeneration"),id.forEach(o),Tr=d(no," forward method, overrides the "),Xo=a(no,"CODE",{});var dd=s(Xo);wr=d(dd,"__call__"),dd.forEach(o),Pr=d(no," special method."),no.forEach(o),Lr=u(Ie),y(Pe.$$.fragment,Ie),$r=u(Ie),y(Le.$$.fragment,Ie),Ie.forEach(o),Oe.forEach(o),Ln=u(t),ie=a(t,"H2",{class:!0});var Wn=s(ie);$e=a(Wn,"A",{id:!0,class:!0,href:!0});var ld=s($e);Go=a(ld,"SPAN",{});var cd=s(Go);y(Tt.$$.fragment,cd),cd.forEach(o),ld.forEach(o),qr=u(Wn),Ro=a(Wn,"SPAN",{});var pd=s(Ro);zr=d(pd,"PLBartForSequenceClassification"),pd.forEach(o),Wn.forEach(o),$n=u(t),z=a(t,"DIV",{class:!0});var U=s(z);y(wt.$$.fragment,U),Br=u(U),Wo=a(U,"P",{});var hd=s(Wo);xr=d(hd,`PLBart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for code
classification.`),hd.forEach(o),Cr=u(U),Pt=a(U,"P",{});var Hn=s(Pt);Fr=d(Hn,"This model inherits from "),Vt=a(Hn,"A",{href:!0});var ud=s(Vt);Er=d(ud,"PreTrainedModel"),ud.forEach(o),jr=d(Hn,`. 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.)`),Hn.forEach(o),Mr=u(U),Lt=a(U,"P",{});var Un=s(Lt);Ar=d(Un,"This model is also a PyTorch "),$t=a(Un,"A",{href:!0,rel:!0});var md=s($t);Sr=d(md,"torch.nn.Module"),md.forEach(o),Nr=d(Un,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Un.forEach(o),Or=u(U),C=a(U,"DIV",{class:!0});var V=s(C);y(qt.$$.fragment,V),Ir=u(V),de=a(V,"P",{});var ao=s(de);Dr=d(ao,"The "),Jt=a(ao,"A",{href:!0});var fd=s(Jt);Xr=d(fd,"PLBartForSequenceClassification"),fd.forEach(o),Gr=d(ao," forward method, overrides the "),Ho=a(ao,"CODE",{});var gd=s(Ho);Rr=d(gd,"__call__"),gd.forEach(o),Wr=d(ao," special method."),ao.forEach(o),Hr=u(V),y(qe.$$.fragment,V),Ur=u(V),y(ze.$$.fragment,V),Vr=u(V),y(Be.$$.fragment,V),V.forEach(o),U.forEach(o),qn=u(t),le=a(t,"H2",{class:!0});var Vn=s(le);xe=a(Vn,"A",{id:!0,class:!0,href:!0});var _d=s(xe);Uo=a(_d,"SPAN",{});var bd=s(Uo);y(zt.$$.fragment,bd),bd.forEach(o),_d.forEach(o),Jr=u(Vn),Vo=a(Vn,"SPAN",{});var kd=s(Vo);Kr=d(kd,"PLBartForCausalLM"),kd.forEach(o),Vn.forEach(o),zn=u(t),ce=a(t,"DIV",{class:!0});var Jn=s(ce);y(Bt.$$.fragment,Jn),Qr=u(Jn),Ce=a(Jn,"DIV",{class:!0});var Kn=s(Ce);y(xt.$$.fragment,Kn),Yr=u(Kn),y(Fe.$$.fragment,Kn),Kn.forEach(o),Jn.forEach(o),this.h()},h(){c(l,"name","hf:doc:metadata"),c(l,"content",JSON.stringify(Ad)),c(m,"id","plbart"),c(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"),c(m,"href","#plbart"),c(_,"class","relative group"),c(De,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),c(De,"rel","nofollow"),c(Xe,"href","https://www.github.com/gchhablani"),c(Xe,"rel","nofollow"),c(ue,"id","overview-of-plbart"),c(ue,"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"),c(ue,"href","#overview-of-plbart"),c(J,"class","relative group"),c(Re,"href","https://arxiv.org/abs/2103.06333"),c(Re,"rel","nofollow"),c(We,"href","https://huggingface.co/gchhablani"),c(We,"rel","nofollow"),c(He,"href","https://github.com/wasiahmad/PLBART"),c(He,"rel","nofollow"),c(me,"id","training-of-plbart"),c(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"),c(me,"href","#training-of-plbart"),c(K,"class","relative group"),c(Ve,"href","https://arxiv.org/abs/2103.06333"),c(Ve,"rel","nofollow"),c(Je,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"),c(ge,"id","transformers.PLBartConfig"),c(ge,"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"),c(ge,"href","#transformers.PLBartConfig"),c(Y,"class","relative group"),c(Ot,"href","/docs/transformers/main/en/model_doc/plbart#transformers.PLBartModel"),c(tt,"href","https://huggingface.co/uclanlp/plbart-base"),c(tt,"rel","nofollow"),c(It,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(Dt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(be,"id","transformers.PLBartTokenizer"),c(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"),c(be,"href","#transformers.PLBartTokenizer"),c(te,"class","relative group"),c(Xt,"href","/docs/transformers/main/en/model_doc/roberta#transformers.RobertaTokenizer"),c(Gt,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetTokenizer"),c(at,"href","https://github.com/google/sentencepiece"),c(at,"rel","nofollow"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ve,"id","transformers.PLBartModel"),c(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"),c(ve,"href","#transformers.PLBartModel"),c(ne,"class","relative group"),c(Rt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(mt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(mt,"rel","nofollow"),c(Wt,"href","/docs/transformers/main/en/model_doc/plbart#transformers.PLBartModel"),c(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(we,"id","transformers.PLBartForConditionalGeneration"),c(we,"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"),c(we,"href","#transformers.PLBartForConditionalGeneration"),c(se,"class","relative group"),c(Ht,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(vt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(vt,"rel","nofollow"),c(Ut,"href","/docs/transformers/main/en/model_doc/plbart#transformers.PLBartForConditionalGeneration"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c($e,"id","transformers.PLBartForSequenceClassification"),c($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"),c($e,"href","#transformers.PLBartForSequenceClassification"),c(ie,"class","relative group"),c(Vt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c($t,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c($t,"rel","nofollow"),c(Jt,"href","/docs/transformers/main/en/model_doc/plbart#transformers.PLBartForSequenceClassification"),c(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(xe,"id","transformers.PLBartForCausalLM"),c(xe,"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"),c(xe,"href","#transformers.PLBartForCausalLM"),c(le,"class","relative group"),c(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ce,"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,p){e(document.head,l),g(t,k,p),g(t,_,p),e(_,m),e(m,b),T(r,b,null),e(_,f),e(_,B),e(B,Qn),g(t,on,p),g(t,I,p),e(I,so),e(so,Yn),e(I,Zn),e(I,De),e(De,ea),e(I,ta),e(I,Xe),e(Xe,oa),e(I,na),g(t,nn,p),g(t,J,p),e(J,ue),e(ue,ro),T(Ge,ro,null),e(J,aa),e(J,io),e(io,sa),g(t,an,p),g(t,G,p),e(G,ra),e(G,Re),e(Re,ia),e(G,da),e(G,lo),e(lo,la),e(G,ca),g(t,sn,p),g(t,Mt,p),e(Mt,pa),g(t,rn,p),g(t,At,p),e(At,co),e(co,ha),g(t,dn,p),g(t,R,p),e(R,ua),e(R,We),e(We,ma),e(R,fa),e(R,He),e(He,ga),e(R,_a),g(t,ln,p),g(t,K,p),e(K,me),e(me,po),T(Ue,po,null),e(K,ba),e(K,ho),e(ho,ka),g(t,cn,p),g(t,x,p),e(x,va),e(x,uo),e(uo,ya),e(x,Ta),e(x,mo),e(mo,wa),e(x,Pa),e(x,fo),e(fo,La),e(x,$a),e(x,go),e(go,qa),e(x,za),g(t,pn,p),g(t,fe,p),e(fe,Ba),e(fe,Ve),e(Ve,xa),e(fe,Ca),g(t,hn,p),g(t,M,p),e(M,Fa),e(M,Je),e(Je,_o),e(_o,Ea),e(Je,ja),e(M,Ma),e(M,bo),e(bo,Aa),e(M,Sa),e(M,ko),e(ko,Na),e(M,Oa),g(t,un,p),g(t,St,p),e(St,vo),e(vo,Ia),g(t,mn,p),T(Ke,t,p),g(t,fn,p),g(t,Nt,p),e(Nt,Qe),e(Qe,yo),e(yo,Da),e(Qe,Xa),e(Qe,Q),e(Q,Ga),e(Q,To),e(To,Ra),e(Q,Wa),e(Q,wo),e(wo,Ha),e(Q,Ua),g(t,gn,p),T(Ye,t,p),g(t,_n,p),g(t,Y,p),e(Y,ge),e(ge,Po),T(Ze,Po,null),e(Y,Va),e(Y,Lo),e(Lo,Ja),g(t,bn,p),g(t,F,p),T(et,F,null),e(F,Ka),e(F,Z),e(Z,Qa),e(Z,Ot),e(Ot,Ya),e(Z,Za),e(Z,tt),e(tt,es),e(Z,ts),e(F,os),e(F,ee),e(ee,ns),e(ee,It),e(It,as),e(ee,ss),e(ee,Dt),e(Dt,rs),e(ee,is),e(F,ds),T(_e,F,null),g(t,kn,p),g(t,te,p),e(te,be),e(be,$o),T(ot,$o,null),e(te,ls),e(te,qo),e(qo,cs),g(t,vn,p),g(t,q,p),T(nt,q,null),e(q,ps),e(q,zo),e(zo,hs),e(q,us),e(q,D),e(D,ms),e(D,Xt),e(Xt,fs),e(D,gs),e(D,Gt),e(Gt,_s),e(D,bs),e(D,at),e(at,ks),e(D,vs),e(q,ys),e(q,oe),e(oe,Ts),e(oe,Bo),e(Bo,ws),e(oe,Ps),e(oe,xo),e(xo,Ls),e(oe,$s),e(q,qs),T(ke,q,null),e(q,zs),e(q,A),T(st,A,null),e(A,Bs),e(A,rt),e(rt,xs),e(rt,Co),e(Co,Cs),e(rt,Fs),e(A,Es),e(A,it),e(it,dt),e(dt,Fo),e(Fo,js),e(dt,Ms),e(dt,Eo),e(Eo,As),e(it,Ss),e(it,lt),e(lt,jo),e(jo,Ns),e(lt,Os),e(lt,Mo),e(Mo,Is),e(A,Ds),e(A,Ao),e(Ao,Xs),g(t,yn,p),g(t,ne,p),e(ne,ve),e(ve,So),T(ct,So,null),e(ne,Gs),e(ne,No),e(No,Rs),g(t,Tn,p),g(t,E,p),T(pt,E,null),e(E,Ws),e(E,ht),e(ht,Hs),e(ht,Rt),e(Rt,Us),e(ht,Vs),e(E,Js),e(E,ut),e(ut,Ks),e(ut,mt),e(mt,Qs),e(ut,Ys),e(E,Zs),e(E,S),T(ft,S,null),e(S,er),e(S,ae),e(ae,tr),e(ae,Wt),e(Wt,or),e(ae,nr),e(ae,Oo),e(Oo,ar),e(ae,sr),e(S,rr),T(ye,S,null),e(S,ir),T(Te,S,null),g(t,wn,p),g(t,se,p),e(se,we),e(we,Io),T(gt,Io,null),e(se,dr),e(se,Do),e(Do,lr),g(t,Pn,p),g(t,j,p),T(_t,j,null),e(j,cr),e(j,bt),e(bt,pr),e(bt,Ht),e(Ht,hr),e(bt,ur),e(j,mr),e(j,kt),e(kt,fr),e(kt,vt),e(vt,gr),e(kt,_r),e(j,br),e(j,N),T(yt,N,null),e(N,kr),e(N,re),e(re,vr),e(re,Ut),e(Ut,yr),e(re,Tr),e(re,Xo),e(Xo,wr),e(re,Pr),e(N,Lr),T(Pe,N,null),e(N,$r),T(Le,N,null),g(t,Ln,p),g(t,ie,p),e(ie,$e),e($e,Go),T(Tt,Go,null),e(ie,qr),e(ie,Ro),e(Ro,zr),g(t,$n,p),g(t,z,p),T(wt,z,null),e(z,Br),e(z,Wo),e(Wo,xr),e(z,Cr),e(z,Pt),e(Pt,Fr),e(Pt,Vt),e(Vt,Er),e(Pt,jr),e(z,Mr),e(z,Lt),e(Lt,Ar),e(Lt,$t),e($t,Sr),e(Lt,Nr),e(z,Or),e(z,C),T(qt,C,null),e(C,Ir),e(C,de),e(de,Dr),e(de,Jt),e(Jt,Xr),e(de,Gr),e(de,Ho),e(Ho,Rr),e(de,Wr),e(C,Hr),T(qe,C,null),e(C,Ur),T(ze,C,null),e(C,Vr),T(Be,C,null),g(t,qn,p),g(t,le,p),e(le,xe),e(xe,Uo),T(zt,Uo,null),e(le,Jr),e(le,Vo),e(Vo,Kr),g(t,zn,p),g(t,ce,p),T(Bt,ce,null),e(ce,Qr),e(ce,Ce),T(xt,Ce,null),e(Ce,Yr),T(Fe,Ce,null),Bn=!0},p(t,[p]){const Ct={};p&2&&(Ct.$$scope={dirty:p,ctx:t}),_e.$set(Ct);const Jo={};p&2&&(Jo.$$scope={dirty:p,ctx:t}),ke.$set(Jo);const Ko={};p&2&&(Ko.$$scope={dirty:p,ctx:t}),ye.$set(Ko);const Qo={};p&2&&(Qo.$$scope={dirty:p,ctx:t}),Te.$set(Qo);const W={};p&2&&(W.$$scope={dirty:p,ctx:t}),Pe.$set(W);const Yo={};p&2&&(Yo.$$scope={dirty:p,ctx:t}),Le.$set(Yo);const Zo={};p&2&&(Zo.$$scope={dirty:p,ctx:t}),qe.$set(Zo);const en={};p&2&&(en.$$scope={dirty:p,ctx:t}),ze.$set(en);const Ft={};p&2&&(Ft.$$scope={dirty:p,ctx:t}),Be.$set(Ft);const tn={};p&2&&(tn.$$scope={dirty:p,ctx:t}),Fe.$set(tn)},i(t){Bn||(w(r.$$.fragment,t),w(Ge.$$.fragment,t),w(Ue.$$.fragment,t),w(Ke.$$.fragment,t),w(Ye.$$.fragment,t),w(Ze.$$.fragment,t),w(et.$$.fragment,t),w(_e.$$.fragment,t),w(ot.$$.fragment,t),w(nt.$$.fragment,t),w(ke.$$.fragment,t),w(st.$$.fragment,t),w(ct.$$.fragment,t),w(pt.$$.fragment,t),w(ft.$$.fragment,t),w(ye.$$.fragment,t),w(Te.$$.fragment,t),w(gt.$$.fragment,t),w(_t.$$.fragment,t),w(yt.$$.fragment,t),w(Pe.$$.fragment,t),w(Le.$$.fragment,t),w(Tt.$$.fragment,t),w(wt.$$.fragment,t),w(qt.$$.fragment,t),w(qe.$$.fragment,t),w(ze.$$.fragment,t),w(Be.$$.fragment,t),w(zt.$$.fragment,t),w(Bt.$$.fragment,t),w(xt.$$.fragment,t),w(Fe.$$.fragment,t),Bn=!0)},o(t){P(r.$$.fragment,t),P(Ge.$$.fragment,t),P(Ue.$$.fragment,t),P(Ke.$$.fragment,t),P(Ye.$$.fragment,t),P(Ze.$$.fragment,t),P(et.$$.fragment,t),P(_e.$$.fragment,t),P(ot.$$.fragment,t),P(nt.$$.fragment,t),P(ke.$$.fragment,t),P(st.$$.fragment,t),P(ct.$$.fragment,t),P(pt.$$.fragment,t),P(ft.$$.fragment,t),P(ye.$$.fragment,t),P(Te.$$.fragment,t),P(gt.$$.fragment,t),P(_t.$$.fragment,t),P(yt.$$.fragment,t),P(Pe.$$.fragment,t),P(Le.$$.fragment,t),P(Tt.$$.fragment,t),P(wt.$$.fragment,t),P(qt.$$.fragment,t),P(qe.$$.fragment,t),P(ze.$$.fragment,t),P(Be.$$.fragment,t),P(zt.$$.fragment,t),P(Bt.$$.fragment,t),P(xt.$$.fragment,t),P(Fe.$$.fragment,t),Bn=!1},d(t){o(l),t&&o(k),t&&o(_),L(r),t&&o(on),t&&o(I),t&&o(nn),t&&o(J),L(Ge),t&&o(an),t&&o(G),t&&o(sn),t&&o(Mt),t&&o(rn),t&&o(At),t&&o(dn),t&&o(R),t&&o(ln),t&&o(K),L(Ue),t&&o(cn),t&&o(x),t&&o(pn),t&&o(fe),t&&o(hn),t&&o(M),t&&o(un),t&&o(St),t&&o(mn),L(Ke,t),t&&o(fn),t&&o(Nt),t&&o(gn),L(Ye,t),t&&o(_n),t&&o(Y),L(Ze),t&&o(bn),t&&o(F),L(et),L(_e),t&&o(kn),t&&o(te),L(ot),t&&o(vn),t&&o(q),L(nt),L(ke),L(st),t&&o(yn),t&&o(ne),L(ct),t&&o(Tn),t&&o(E),L(pt),L(ft),L(ye),L(Te),t&&o(wn),t&&o(se),L(gt),t&&o(Pn),t&&o(j),L(_t),L(yt),L(Pe),L(Le),t&&o(Ln),t&&o(ie),L(Tt),t&&o($n),t&&o(z),L(wt),L(qt),L(qe),L(ze),L(Be),t&&o(qn),t&&o(le),L(zt),t&&o(zn),t&&o(ce),L(Bt),L(xt),L(Fe)}}}const Ad={local:"plbart",sections:[{local:"overview-of-plbart",sections:[{local:"training-of-plbart",title:"Training of PLBart"}],title:"Overview of PLBart"},{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 Sd($){return Pd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Rd extends vd{constructor(l){super();yd(this,l,Sd,Md,Td,{})}}export{Rd as default,Ad as metadata};
