import{S as Hp,i as Up,s as Vp,e as n,k as l,w as b,t as a,M as Rp,c as r,d as o,m as p,a as s,x as T,h as d,b as c,N as Wp,G as e,g as m,y,q as w,o as P,B as N,v as Jp,L as cn}from"../../chunks/vendor-hf-doc-builder.js";import{T as br}from"../../chunks/Tip-hf-doc-builder.js";import{D as z}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ln}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as R}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as dn}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Yp($){let h,k,g,_,v;return _=new ln({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){h=n("p"),k=a("sequence pair mask has the following format:"),g=l(),b(_.$$.fragment)},l(i){h=r(i,"P",{});var f=s(h);k=d(f,"sequence pair mask has the following format:"),f.forEach(o),g=p(i),T(_.$$.fragment,i)},m(i,f){m(i,h,f),e(h,k),m(i,g,f),y(_,i,f),v=!0},p:cn,i(i){v||(w(_.$$.fragment,i),v=!0)},o(i){P(_.$$.fragment,i),v=!1},d(i){i&&o(h),i&&o(g),N(_,i)}}}function Kp($){let h,k,g,_,v;return{c(){h=n("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),v=a(`
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(i){h=r(i,"P",{});var f=s(h);k=d(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(f,"CODE",{});var q=s(g);_=d(q,"Module"),q.forEach(o),v=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(i,f){m(i,h,f),e(h,k),e(h,g),e(g,_),e(h,v)},d(i){i&&o(h)}}}function Qp($){let h,k,g,_,v;return _=new ln({props:{code:`from transformers import AutoTokenizer, ProphetNetModel

tokenizer = AutoTokenizer.from_pretrained("microsoft/prophetnet-large-uncased")
model = ProphetNetModel.from_pretrained("microsoft/prophetnet-large-uncased")

input_ids = tokenizer(
    "Studies have been shown that owning a dog is good for you", return_tensors="pt"
).input_ids  # Batch size 1
decoder_input_ids = tokenizer("Studies show that", return_tensors="pt").input_ids  # Batch size 1
outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)

last_hidden_states = outputs.last_hidden_state  # main stream hidden states
last_hidden_states_ngram = outputs.last_hidden_state_ngram  # predict hidden states`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ProphetNetModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;microsoft/prophetnet-large-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ProphetNetModel.from_pretrained(<span class="hljs-string">&quot;microsoft/prophetnet-large-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Studies have been shown that owning a dog is good for you&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>).input_ids  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = tokenizer(<span class="hljs-string">&quot;Studies show that&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state  <span class="hljs-comment"># main stream hidden states</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states_ngram = outputs.last_hidden_state_ngram  <span class="hljs-comment"># predict hidden states</span>`}}),{c(){h=n("p"),k=a("Example:"),g=l(),b(_.$$.fragment)},l(i){h=r(i,"P",{});var f=s(h);k=d(f,"Example:"),f.forEach(o),g=p(i),T(_.$$.fragment,i)},m(i,f){m(i,h,f),e(h,k),m(i,g,f),y(_,i,f),v=!0},p:cn,i(i){v||(w(_.$$.fragment,i),v=!0)},o(i){P(_.$$.fragment,i),v=!1},d(i){i&&o(h),i&&o(g),N(_,i)}}}function Xp($){let h,k,g,_,v;return{c(){h=n("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),v=a(`
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(i){h=r(i,"P",{});var f=s(h);k=d(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(f,"CODE",{});var q=s(g);_=d(q,"Module"),q.forEach(o),v=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(i,f){m(i,h,f),e(h,k),e(h,g),e(g,_),e(h,v)},d(i){i&&o(h)}}}function Zp($){let h,k,g,_,v;return _=new ln({props:{code:`from transformers import AutoTokenizer, ProphetNetEncoder
import torch

tokenizer = AutoTokenizer.from_pretrained("microsoft/prophetnet-large-uncased")
model = ProphetNetEncoder.from_pretrained("patrickvonplaten/prophetnet-large-uncased-standalone")
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, ProphetNetEncoder
<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;microsoft/prophetnet-large-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ProphetNetEncoder.from_pretrained(<span class="hljs-string">&quot;patrickvonplaten/prophetnet-large-uncased-standalone&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(){h=n("p"),k=a("Example:"),g=l(),b(_.$$.fragment)},l(i){h=r(i,"P",{});var f=s(h);k=d(f,"Example:"),f.forEach(o),g=p(i),T(_.$$.fragment,i)},m(i,f){m(i,h,f),e(h,k),m(i,g,f),y(_,i,f),v=!0},p:cn,i(i){v||(w(_.$$.fragment,i),v=!0)},o(i){P(_.$$.fragment,i),v=!1},d(i){i&&o(h),i&&o(g),N(_,i)}}}function eh($){let h,k,g,_,v;return{c(){h=n("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),v=a(`
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(i){h=r(i,"P",{});var f=s(h);k=d(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(f,"CODE",{});var q=s(g);_=d(q,"Module"),q.forEach(o),v=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(i,f){m(i,h,f),e(h,k),e(h,g),e(g,_),e(h,v)},d(i){i&&o(h)}}}function th($){let h,k,g,_,v;return _=new ln({props:{code:`from transformers import AutoTokenizer, ProphetNetDecoder
import torch

tokenizer = AutoTokenizer.from_pretrained("microsoft/prophetnet-large-uncased")
model = ProphetNetDecoder.from_pretrained("microsoft/prophetnet-large-uncased", add_cross_attention=False)
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, ProphetNetDecoder
<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;microsoft/prophetnet-large-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ProphetNetDecoder.from_pretrained(<span class="hljs-string">&quot;microsoft/prophetnet-large-uncased&quot;</span>, add_cross_attention=<span class="hljs-literal">False</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(){h=n("p"),k=a("Example:"),g=l(),b(_.$$.fragment)},l(i){h=r(i,"P",{});var f=s(h);k=d(f,"Example:"),f.forEach(o),g=p(i),T(_.$$.fragment,i)},m(i,f){m(i,h,f),e(h,k),m(i,g,f),y(_,i,f),v=!0},p:cn,i(i){v||(w(_.$$.fragment,i),v=!0)},o(i){P(_.$$.fragment,i),v=!1},d(i){i&&o(h),i&&o(g),N(_,i)}}}function oh($){let h,k,g,_,v;return{c(){h=n("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),v=a(`
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(i){h=r(i,"P",{});var f=s(h);k=d(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(f,"CODE",{});var q=s(g);_=d(q,"Module"),q.forEach(o),v=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(i,f){m(i,h,f),e(h,k),e(h,g),e(g,_),e(h,v)},d(i){i&&o(h)}}}function nh($){let h,k,g,_,v;return _=new ln({props:{code:`from transformers import AutoTokenizer, ProphetNetForConditionalGeneration

tokenizer = AutoTokenizer.from_pretrained("microsoft/prophetnet-large-uncased")
model = ProphetNetForConditionalGeneration.from_pretrained("microsoft/prophetnet-large-uncased")

input_ids = tokenizer(
    "Studies have been shown that owning a dog is good for you", return_tensors="pt"
).input_ids  # Batch size 1
decoder_input_ids = tokenizer("Studies show that", return_tensors="pt").input_ids  # Batch size 1
outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)

logits_next_token = outputs.logits  # logits to predict next token as usual
logits_ngram_next_tokens = outputs.logits_ngram  # logits to predict 2nd, 3rd, ... next tokens`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ProphetNetForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;microsoft/prophetnet-large-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ProphetNetForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;microsoft/prophetnet-large-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Studies have been shown that owning a dog is good for you&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>).input_ids  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = tokenizer(<span class="hljs-string">&quot;Studies show that&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits_next_token = outputs.logits  <span class="hljs-comment"># logits to predict next token as usual</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_ngram_next_tokens = outputs.logits_ngram  <span class="hljs-comment"># logits to predict 2nd, 3rd, ... next tokens</span>`}}),{c(){h=n("p"),k=a("Example:"),g=l(),b(_.$$.fragment)},l(i){h=r(i,"P",{});var f=s(h);k=d(f,"Example:"),f.forEach(o),g=p(i),T(_.$$.fragment,i)},m(i,f){m(i,h,f),e(h,k),m(i,g,f),y(_,i,f),v=!0},p:cn,i(i){v||(w(_.$$.fragment,i),v=!0)},o(i){P(_.$$.fragment,i),v=!1},d(i){i&&o(h),i&&o(g),N(_,i)}}}function rh($){let h,k,g,_,v;return{c(){h=n("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),v=a(`
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(i){h=r(i,"P",{});var f=s(h);k=d(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(f,"CODE",{});var q=s(g);_=d(q,"Module"),q.forEach(o),v=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(i,f){m(i,h,f),e(h,k),e(h,g),e(g,_),e(h,v)},d(i){i&&o(h)}}}function sh($){let h,k,g,_,v;return _=new ln({props:{code:`from transformers import AutoTokenizer, ProphetNetForCausalLM
import torch

tokenizer = AutoTokenizer.from_pretrained("microsoft/prophetnet-large-uncased")
model = ProphetNetForCausalLM.from_pretrained("microsoft/prophetnet-large-uncased")
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

# Model can also be used with EncoderDecoder framework
from transformers import BertTokenizer, EncoderDecoderModel, AutoTokenizer
import torch

tokenizer_enc = BertTokenizer.from_pretrained("bert-large-uncased")
tokenizer_dec = AutoTokenizer.from_pretrained("microsoft/prophetnet-large-uncased")
model = EncoderDecoderModel.from_encoder_decoder_pretrained(
    "bert-large-uncased", "microsoft/prophetnet-large-uncased"
)

ARTICLE = (
    "the us state department said wednesday it had received no "
    "formal word from bolivia that it was expelling the us ambassador there "
    "but said the charges made against him are \`\` baseless ."
)
input_ids = tokenizer_enc(ARTICLE, return_tensors="pt").input_ids
labels = tokenizer_dec(
    "us rejects charges against its ambassador in bolivia", return_tensors="pt"
).input_ids
outputs = model(input_ids=input_ids, decoder_input_ids=labels[:, :-1], labels=labels[:, 1:])

loss = outputs.loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ProphetNetForCausalLM
<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;microsoft/prophetnet-large-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ProphetNetForCausalLM.from_pretrained(<span class="hljs-string">&quot;microsoft/prophetnet-large-uncased&quot;</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><span class="hljs-comment"># Model can also be used with EncoderDecoder framework</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer, EncoderDecoderModel, AutoTokenizer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_enc = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-large-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_dec = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;microsoft/prophetnet-large-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EncoderDecoderModel.from_encoder_decoder_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;bert-large-uncased&quot;</span>, <span class="hljs-string">&quot;microsoft/prophetnet-large-uncased&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>ARTICLE = (
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;the us state department said wednesday it had received no &quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;formal word from bolivia that it was expelling the us ambassador there &quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;but said the charges made against him are \`\` baseless .&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer_enc(ARTICLE, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer_dec(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;us rejects charges against its ambassador in bolivia&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=input_ids, decoder_input_ids=labels[:, :-<span class="hljs-number">1</span>], labels=labels[:, <span class="hljs-number">1</span>:])

<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){h=n("p"),k=a("Example:"),g=l(),b(_.$$.fragment)},l(i){h=r(i,"P",{});var f=s(h);k=d(f,"Example:"),f.forEach(o),g=p(i),T(_.$$.fragment,i)},m(i,f){m(i,h,f),e(h,k),m(i,g,f),y(_,i,f),v=!0},p:cn,i(i){v||(w(_.$$.fragment,i),v=!0)},o(i){P(_.$$.fragment,i),v=!1},d(i){i&&o(h),i&&o(g),N(_,i)}}}function ah($){let h,k,g,_,v,i,f,q,Es,Tr,te,_o,go,Jc,xs,vo,ko,Yc,yr,oe,pn,Ms,Os,ct,Cs,Ss,wr,ne,Ee,hn,lt,As,un,Ds,Pr,xe,Ls,pt,js,Is,Nr,bo,Bs,$r,To,Gs,qr,yo,mn,Ws,zr,wo,Hs,Fr,Me,fn,Us,Vs,_n,Rs,Er,Oe,Js,ht,Ys,Ks,xr,re,Ce,gn,ut,Qs,vn,Xs,Mr,J,kn,Po,Zs,ea,bn,No,ta,oa,Tn,$o,na,Or,se,Se,yn,mt,ra,wn,sa,Cr,V,ft,aa,ae,da,qo,ia,ca,_t,la,pa,ha,de,ua,zo,ma,fa,Fo,_a,ga,Sr,ie,Ae,Pn,gt,va,Nn,ka,Ar,F,vt,ba,$n,Ta,ya,kt,wa,Eo,Pa,Na,$a,Y,bt,qa,qn,za,Fa,Tt,xo,Ea,zn,xa,Ma,Mo,Oa,Fn,Ca,Sa,De,yt,Aa,En,Da,La,L,wt,ja,xn,Ia,Ba,Le,Ga,ce,Wa,Mn,Ha,Ua,On,Va,Ra,Ja,je,Pt,Ya,Nt,Ka,Cn,Qa,Xa,Dr,le,Ie,Sn,$t,Za,An,ed,Lr,pe,qt,td,Dn,od,jr,he,zt,nd,Ln,rd,Ir,ue,Ft,sd,jn,ad,Br,me,Et,dd,In,id,Gr,fe,Be,Bn,xt,cd,Gn,ld,Wr,M,Mt,pd,Ot,hd,Oo,ud,md,fd,_e,_d,Ct,gd,vd,Wn,kd,bd,Td,St,yd,At,wd,Pd,Nd,j,Dt,$d,ge,qd,Co,zd,Fd,Hn,Ed,xd,Md,Ge,Od,We,Hr,ve,He,Un,Lt,Cd,Vn,Sd,Ur,E,jt,Ad,It,Dd,So,Ld,jd,Id,ke,Bd,Bt,Gd,Wd,Rn,Hd,Ud,Vd,Gt,Rd,Wt,Jd,Yd,Kd,A,Qd,Jn,Xd,Zd,Yn,ei,ti,Kn,oi,ni,Ao,ri,si,ai,I,Ht,di,be,ii,Do,ci,li,Qn,pi,hi,ui,Ue,mi,Ve,Vr,Te,Re,Xn,Ut,fi,Zn,_i,Rr,x,Vt,gi,Rt,vi,Lo,ki,bi,Ti,ye,yi,Jt,wi,Pi,er,Ni,$i,qi,Yt,zi,Kt,Fi,Ei,xi,D,Mi,tr,Oi,Ci,or,Si,Ai,nr,Di,Li,jo,ji,Ii,Bi,B,Qt,Gi,we,Wi,Io,Hi,Ui,rr,Vi,Ri,Ji,Je,Yi,Ye,Jr,Pe,Ke,sr,Xt,Ki,ar,Qi,Yr,O,Zt,Xi,eo,Zi,Bo,ec,tc,oc,Ne,nc,to,rc,sc,dr,ac,dc,ic,oo,cc,no,lc,pc,hc,G,ro,uc,$e,mc,Go,fc,_c,ir,gc,vc,kc,Qe,bc,Xe,Kr,qe,Ze,cr,so,Tc,lr,yc,Qr,C,ao,wc,io,Pc,Wo,Nc,$c,qc,ze,zc,co,Fc,Ec,pr,xc,Mc,Oc,lo,Cc,po,Sc,Ac,Dc,W,ho,Lc,Fe,jc,Ho,Ic,Bc,hr,Gc,Wc,Hc,et,Uc,tt,Xr;return i=new R({}),lt=new R({}),ut=new R({}),mt=new R({}),ft=new z({props:{name:"class transformers.ProphetNetConfig",anchor:"transformers.ProphetNetConfig",parameters:[{name:"activation_dropout",val:": typing.Optional[float] = 0.1"},{name:"activation_function",val:": typing.Union[str, typing.Callable, NoneType] = 'gelu'"},{name:"vocab_size",val:": typing.Optional[int] = 30522"},{name:"hidden_size",val:": typing.Optional[int] = 1024"},{name:"encoder_ffn_dim",val:": typing.Optional[int] = 4096"},{name:"num_encoder_layers",val:": typing.Optional[int] = 12"},{name:"num_encoder_attention_heads",val:": typing.Optional[int] = 16"},{name:"decoder_ffn_dim",val:": typing.Optional[int] = 4096"},{name:"num_decoder_layers",val:": typing.Optional[int] = 12"},{name:"num_decoder_attention_heads",val:": typing.Optional[int] = 16"},{name:"attention_dropout",val:": typing.Optional[float] = 0.1"},{name:"dropout",val:": typing.Optional[float] = 0.1"},{name:"max_position_embeddings",val:": typing.Optional[int] = 512"},{name:"init_std",val:": typing.Optional[float] = 0.02"},{name:"is_encoder_decoder",val:": typing.Optional[bool] = True"},{name:"add_cross_attention",val:": typing.Optional[bool] = True"},{name:"decoder_start_token_id",val:": typing.Optional[int] = 0"},{name:"ngram",val:": typing.Optional[int] = 2"},{name:"num_buckets",val:": typing.Optional[int] = 32"},{name:"relative_max_distance",val:": typing.Optional[int] = 128"},{name:"disable_ngram_loss",val:": typing.Optional[bool] = False"},{name:"eps",val:": typing.Optional[float] = 0.0"},{name:"use_cache",val:": typing.Optional[bool] = True"},{name:"pad_token_id",val:": typing.Optional[int] = 0"},{name:"bos_token_id",val:": typing.Optional[int] = 1"},{name:"eos_token_id",val:": typing.Optional[int] = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ProphetNetConfig.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for activations inside the fully connected layer.`,name:"activation_dropout"},{anchor:"transformers.ProphetNetConfig.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.ProphetNetConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the ProphetNET model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.ProphetNetModel">ProphetNetModel</a>.`,name:"vocab_size"},{anchor:"transformers.ProphetNetConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.ProphetNetConfig.encoder_ffn_dim",description:`<strong>encoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.ProphetNetConfig.num_encoder_layers",description:`<strong>num_encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of encoder layers.`,name:"num_encoder_layers"},{anchor:"transformers.ProphetNetConfig.num_encoder_attention_heads",description:`<strong>num_encoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_encoder_attention_heads"},{anchor:"transformers.ProphetNetConfig.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the <code>intermediate</code> (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.ProphetNetConfig.num_decoder_layers",description:`<strong>num_decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of decoder layers.`,name:"num_decoder_layers"},{anchor:"transformers.ProphetNetConfig.num_decoder_attention_heads",description:`<strong>num_decoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"num_decoder_attention_heads"},{anchor:"transformers.ProphetNetConfig.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.ProphetNetConfig.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.ProphetNetConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#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.ProphetNetConfig.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.ProphetNetConfig.add_cross_attention",description:`<strong>add_cross_attention</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether cross-attention layers should be added to the model.`,name:"add_cross_attention"},{anchor:"transformers.ProphetNetConfig.is_encoder_decoder",description:`<strong>is_encoder_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether this is an encoder/decoder model.`,name:"is_encoder_decoder"},{anchor:"transformers.ProphetNetConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.ProphetNetConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Beginning of stream token id.`,name:"bos_token_id"},{anchor:"transformers.ProphetNetConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
End of stream token id.`,name:"eos_token_id"},{anchor:"transformers.ProphetNetConfig.ngram",description:`<strong>ngram</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Number of future tokens to predict. Set to 1 to be same as traditional Language model to predict next first
token.`,name:"ngram"},{anchor:"transformers.ProphetNetConfig.num_buckets",description:`<strong>num_buckets</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The number of buckets to use for each attention layer. This is for relative position calculation. See the
[T5 paper](see <a href="https://arxiv.org/abs/1910.10683" rel="nofollow">https://arxiv.org/abs/1910.10683</a>) for more details.`,name:"num_buckets"},{anchor:"transformers.ProphetNetConfig.relative_max_distance",description:`<strong>relative_max_distance</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Relative distances greater than this number will be put into the last same bucket. This is for relative
position calculation. See the [T5 paper](see <a href="https://arxiv.org/abs/1910.10683" rel="nofollow">https://arxiv.org/abs/1910.10683</a>) for more details.`,name:"relative_max_distance"},{anchor:"transformers.ProphetNetConfig.disable_ngram_loss",description:`<strong>disable_ngram_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether be trained predicting only the next first token.`,name:"disable_ngram_loss"},{anchor:"transformers.ProphetNetConfig.eps",description:`<strong>eps</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Controls the <code>epsilon</code> parameter value for label smoothing in the loss calculation. If set to 0, no label
smoothing is performed.`,name:"eps"},{anchor:"transformers.ProphetNetConfig.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"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/configuration_prophetnet.py#L32"}}),gt=new R({}),vt=new z({props:{name:"class transformers.ProphetNetTokenizer",anchor:"transformers.ProphetNetTokenizer",parameters:[{name:"vocab_file",val:": str"},{name:"do_lower_case",val:": typing.Optional[bool] = True"},{name:"do_basic_tokenize",val:": typing.Optional[bool] = True"},{name:"never_split",val:": typing.Optional[typing.Iterable] = None"},{name:"unk_token",val:": typing.Optional[str] = '[UNK]'"},{name:"sep_token",val:": typing.Optional[str] = '[SEP]'"},{name:"x_sep_token",val:": typing.Optional[str] = '[X_SEP]'"},{name:"pad_token",val:": typing.Optional[str] = '[PAD]'"},{name:"mask_token",val:": typing.Optional[str] = '[MASK]'"},{name:"tokenize_chinese_chars",val:": typing.Optional[bool] = True"},{name:"strip_accents",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ProphetNetTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.ProphetNetTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.ProphetNetTokenizer.do_basic_tokenize",description:`<strong>do_basic_tokenize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to do basic tokenization before WordPiece.`,name:"do_basic_tokenize"},{anchor:"transformers.ProphetNetTokenizer.never_split",description:`<strong>never_split</strong> (<code>Iterable</code>, <em>optional</em>) &#x2014;
Collection of tokens which will never be split during tokenization. Only has an effect when
<code>do_basic_tokenize=True</code>`,name:"never_split"},{anchor:"transformers.ProphetNetTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&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.ProphetNetTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&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.ProphetNetTokenizer.x_sep_token",description:`<strong>x_sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[X_SEP]&quot;</code>) &#x2014;
Special second separator token, which can be generated by <a href="/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.ProphetNetForConditionalGeneration">ProphetNetForConditionalGeneration</a>. It is
used to separate bullet-point like sentences in summarization, <em>e.g.</em>.`,name:"x_sep_token"},{anchor:"transformers.ProphetNetTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.ProphetNetTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.ProphetNetTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.ProphetNetTokenizer.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters.</p>
<p>This should likely be deactivated for Japanese (see this
<a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.ProphetNetTokenizer.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original BERT).`,name:"strip_accents"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/tokenization_prophetnet.py#L275"}}),bt=new z({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.ProphetNetTokenizer.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.ProphetNetTokenizer.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.ProphetNetTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/tokenization_prophetnet.py#L488",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>
`}}),yt=new z({props:{name:"convert_tokens_to_string",anchor:"transformers.ProphetNetTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:": str"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/tokenization_prophetnet.py#L405"}}),wt=new z({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.ProphetNetTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.ProphetNetTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.ProphetNetTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/tokenization_prophetnet.py#L440",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Le=new dn({props:{anchor:"transformers.ProphetNetTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Yp]},$$scope:{ctx:$}}}),Pt=new z({props:{name:"get_special_tokens_mask",anchor:"transformers.ProphetNetTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.ProphetNetTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.ProphetNetTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.ProphetNetTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/tokenization_prophetnet.py#L410",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),$t=new R({}),qt=new z({props:{name:"class transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput",anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"logits",val:": FloatTensor = None"},{name:"logits_ngram",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_ngram_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_ngram_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Language modeling loss.`,name:"loss"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, decoder_sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the main stream language modeling head (scores for each vocabulary token before
SoftMax).`,name:"logits"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput.logits_ngram",description:`<strong>logits_ngram</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, ngram * decoder_sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the predict stream language modeling head (scores for each vocabulary token before
SoftMax).`,name:"logits_ngram"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput.past_key_values",description:`<strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
List of <code>torch.FloatTensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_attn_heads, decoder_sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.`,name:"past_key_values"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput.decoder_hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of main stream of the decoder at the output of each layer plus the initial embedding outputs.`,name:"decoder_hidden_states"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput.decoder_ngram_hidden_states",description:`<strong>decoder_ngram_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, ngram * decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the predict stream of the decoder at the output of each layer plus the initial embedding
outputs.`,name:"decoder_ngram_hidden_states"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput.decoder_attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_attn_heads, decoder_sequence_length, decoder_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.`,name:"decoder_attentions"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput.decoder_ngram_attentions",description:`<strong>decoder_ngram_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_attn_heads, decoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the predict stream of the decoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.`,name:"decoder_ngram_attentions"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput.cross_attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_attn_heads, encoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the cross-attention layer of the decoder, after the attention softmax, used to
compute the weighted average in the`,name:"cross_attentions"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput.encoder_last_hidden_state",description:`<strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, encoder_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder of the model.`,name:"encoder_last_hidden_state"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput.encoder_hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, encoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.`,name:"encoder_hidden_states"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput.encoder_attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_attn_heads, encoder_sequence_length, encoder_sequence_length)</code>. Attentions weights of the encoder, after the attention
softmax, used to compute the weighted average in the self-attention heads.`,name:"encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/modeling_prophetnet.py#L253"}}),zt=new z({props:{name:"class transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput",anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput",parameters:[{name:"last_hidden_state",val:": FloatTensor"},{name:"last_hidden_state_ngram",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_ngram_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_ngram_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, decoder_sequence_length, hidden_size)</code>) &#x2014;
Sequence of main stream 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.`,name:"last_hidden_state"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput.last_hidden_state_ngram",description:`<strong>last_hidden_state_ngram</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size,ngram * decoder_sequence_length, config.vocab_size)</code>, <em>optional</em>) &#x2014;
Sequence of predict stream hidden-states at the output of the last layer of the decoder of the model.`,name:"last_hidden_state_ngram"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput.past_key_values",description:`<strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
List of <code>torch.FloatTensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_attn_heads, decoder_sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.`,name:"past_key_values"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput.decoder_hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of main stream of the decoder at the output of each layer plus the initial embedding outputs.`,name:"decoder_hidden_states"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput.decoder_ngram_hidden_states",description:`<strong>decoder_ngram_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, ngram * decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the predict stream of the decoder at the output of each layer plus the initial embedding
outputs.`,name:"decoder_ngram_hidden_states"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput.decoder_attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_attn_heads, decoder_sequence_length, decoder_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.`,name:"decoder_attentions"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput.decoder_ngram_attentions",description:`<strong>decoder_ngram_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_attn_heads, decoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the predict stream of the decoder, after the attention softmax, used to compute the
weighted average in the`,name:"decoder_ngram_attentions"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput.cross_attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_attn_heads, encoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the cross-attention layer of the decoder, after the attention softmax, used to
compute the weighted average in the`,name:"cross_attentions"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput.encoder_last_hidden_state",description:`<strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, encoder_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder of the model.`,name:"encoder_last_hidden_state"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput.encoder_hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, encoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.`,name:"encoder_hidden_states"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput.encoder_attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_attn_heads, encoder_sequence_length, encoder_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.`,name:"encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/modeling_prophetnet.py#L338"}}),Ft=new z({props:{name:"class transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderModelOutput",anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderModelOutput",parameters:[{name:"last_hidden_state",val:": FloatTensor"},{name:"last_hidden_state_ngram",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"hidden_states_ngram",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"ngram_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderModelOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, decoder_sequence_length, hidden_size)</code>) &#x2014;
Sequence of main stream 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.`,name:"last_hidden_state"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderModelOutput.last_hidden_state_ngram",description:`<strong>last_hidden_state_ngram</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, ngram * decoder_sequence_length, config.vocab_size)</code>) &#x2014;
Sequence of predict stream hidden-states at the output of the last layer of the decoder of the model.`,name:"last_hidden_state_ngram"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderModelOutput.past_key_values",description:`<strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
List of <code>torch.FloatTensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_attn_heads, decoder_sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.`,name:"past_key_values"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderModelOutput.hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of main stream of the decoder at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderModelOutput.ngram_hidden_states",description:`<strong>ngram_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, ngram * decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the predict stream of the decoder at the output of each layer plus the initial embedding
outputs.`,name:"ngram_hidden_states"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderModelOutput.attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_attn_heads, decoder_sequence_length, decoder_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.`,name:"attentions"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderModelOutput.ngram_attentions",description:`<strong>ngram_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_attn_heads, decoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the predict stream of the decoder, after the attention softmax, used to compute the
weighted average in the`,name:"ngram_attentions"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderModelOutput.cross_attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_attn_heads, encoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the cross-attention layer of the decoder, after the attention softmax, used to
compute the weighted average in the`,name:"cross_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/modeling_prophetnet.py#L424"}}),Et=new z({props:{name:"class transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderLMOutput",anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderLMOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"logits",val:": FloatTensor = None"},{name:"logits_ngram",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"hidden_states_ngram",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"ngram_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderLMOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Language modeling loss.`,name:"loss"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderLMOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, decoder_sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the main stream language modeling head (scores for each vocabulary token before
SoftMax).`,name:"logits"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderLMOutput.logits_ngram",description:`<strong>logits_ngram</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, ngram * decoder_sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the predict stream language modeling head (scores for each vocabulary token before
SoftMax).`,name:"logits_ngram"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderLMOutput.past_key_values",description:`<strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
List of <code>torch.FloatTensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_attn_heads, decoder_sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.`,name:"past_key_values"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderLMOutput.hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of main stream of the decoder at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderLMOutput.ngram_hidden_states",description:`<strong>ngram_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, ngram * decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the predict stream of the decoder at the output of each layer plus the initial embedding
outputs.`,name:"ngram_hidden_states"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderLMOutput.attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_attn_heads, decoder_sequence_length, decoder_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.`,name:"attentions"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderLMOutput.ngram_attentions",description:`<strong>ngram_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_attn_heads, decoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the predict stream of the decoder, after the attention softmax, used to compute the
weighted average in the`,name:"ngram_attentions"},{anchor:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderLMOutput.cross_attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_attn_heads, encoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the cross-attention layer of the decoder, after the attention softmax, used to
compute the weighted average in the`,name:"cross_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/modeling_prophetnet.py#L484"}}),xt=new R({}),Mt=new z({props:{name:"class transformers.ProphetNetModel",anchor:"transformers.ProphetNetModel",parameters:[{name:"config",val:": ProphetNetConfig"}],parametersDescription:[{anchor:"transformers.ProphetNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.ProphetNetConfig">ProphetNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/modeling_prophetnet.py#L1746"}}),Dt=new z({props:{name:"forward",anchor:"transformers.ProphetNetModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.BoolTensor] = 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.Tuple] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_inputs_embeds",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.ProphetNetModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ProphetNetModel.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.ProphetNetModel.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>ProphetNet uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If
<code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.ProphetNetModel.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.`,name:"decoder_attention_mask"},{anchor:"transformers.ProphetNetModel.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.ProphetNetModel.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.ProphetNetModel.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.ProphetNetModel.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.ProphetNetModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden-states of the attention blocks. Can be used to speed up 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.ProphetNetModel.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.ProphetNetModel.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.ProphetNetModel.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.ProphetNetModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/modeling_prophetnet.py#L1780",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput"
>transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>ProphenetConfig</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, decoder_sequence_length, hidden_size)</code>) \u2014 Sequence of main stream 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>last_hidden_state_ngram</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size,ngram * decoder_sequence_length, config.vocab_size)</code>, <em>optional</em>) \u2014 Sequence of predict stream hidden-states at the output of the last layer of the decoder of the model.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>torch.FloatTensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_attn_heads, decoder_sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(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 + one for the output of each layer) of
shape <code>(batch_size, decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of main stream of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_ngram_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 + one for the output of each layer) of
shape <code>(batch_size, ngram * decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the predict stream 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_attn_heads, decoder_sequence_length, decoder_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>decoder_ngram_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_attn_heads, decoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the predict stream of the decoder, after the attention softmax, used to compute the
weighted average in the</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_attn_heads, encoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the cross-attention layer of the decoder, after the attention softmax, used to
compute the weighted average in the</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, encoder_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 + one for the output of each layer) of
shape <code>(batch_size, encoder_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_attn_heads, encoder_sequence_length, encoder_sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput"
>transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ge=new br({props:{$$slots:{default:[Kp]},$$scope:{ctx:$}}}),We=new dn({props:{anchor:"transformers.ProphetNetModel.forward.example",$$slots:{default:[Qp]},$$scope:{ctx:$}}}),Lt=new R({}),jt=new z({props:{name:"class transformers.ProphetNetEncoder",anchor:"transformers.ProphetNetEncoder",parameters:[{name:"config",val:": ProphetNetConfig"},{name:"word_embeddings",val:": Embedding = None"}],parametersDescription:[{anchor:"transformers.ProphetNetEncoder.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.ProphetNetConfig">ProphetNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/modeling_prophetnet.py#L1232"}}),Ht=new z({props:{name:"forward",anchor:"transformers.ProphetNetEncoder.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = 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.ProphetNetEncoder.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ProphetNetEncoder.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.ProphetNetEncoder.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.ProphetNetEncoder.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.ProphetNetEncoder.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.ProphetNetEncoder.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/modeling_prophetnet.py#L1262",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>ProphenetConfig</code>) 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 model.</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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ue=new br({props:{$$slots:{default:[Xp]},$$scope:{ctx:$}}}),Ve=new dn({props:{anchor:"transformers.ProphetNetEncoder.forward.example",$$slots:{default:[Zp]},$$scope:{ctx:$}}}),Ut=new R({}),Vt=new z({props:{name:"class transformers.ProphetNetDecoder",anchor:"transformers.ProphetNetDecoder",parameters:[{name:"config",val:": ProphetNetConfig"},{name:"word_embeddings",val:": typing.Optional[torch.nn.modules.sparse.Embedding] = None"}],parametersDescription:[{anchor:"transformers.ProphetNetDecoder.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.ProphetNetConfig">ProphetNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/modeling_prophetnet.py#L1372"}}),Qt=new z({props:{name:"forward",anchor:"transformers.ProphetNetDecoder.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = 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.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"inputs_embeds",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.ProphetNetDecoder.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ProphetNetDecoder.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.ProphetNetDecoder.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.ProphetNetDecoder.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.ProphetNetDecoder.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.ProphetNetDecoder.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ProphetNetDecoder.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.ProphetNetDecoder.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.ProphetNetDecoder.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.ProphetNetDecoder.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden-states of the attention blocks. Can be used to speed up 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.ProphetNetDecoder.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"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/modeling_prophetnet.py#L1409",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderModelOutput"
>transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>ProphenetConfig</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, decoder_sequence_length, hidden_size)</code>) \u2014 Sequence of main stream 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>last_hidden_state_ngram</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, ngram * decoder_sequence_length, config.vocab_size)</code>) \u2014 Sequence of predict stream hidden-states at the output of the last layer of the decoder of the model.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>torch.FloatTensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_attn_heads, decoder_sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>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 + one for the output of each layer) of
shape <code>(batch_size, decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of main stream of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>ngram_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 + one for the output of each layer) of
shape <code>(batch_size, ngram * decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the predict stream of the decoder at the output of each layer plus the 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_attn_heads, decoder_sequence_length, decoder_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>ngram_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_attn_heads, decoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the predict stream of the decoder, after the attention softmax, used to compute the
weighted average in the</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_attn_heads, encoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the cross-attention layer of the decoder, after the attention softmax, used to
compute the weighted average in the</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderModelOutput"
>transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Je=new br({props:{$$slots:{default:[eh]},$$scope:{ctx:$}}}),Ye=new dn({props:{anchor:"transformers.ProphetNetDecoder.forward.example",$$slots:{default:[th]},$$scope:{ctx:$}}}),Xt=new R({}),Zt=new z({props:{name:"class transformers.ProphetNetForConditionalGeneration",anchor:"transformers.ProphetNetForConditionalGeneration",parameters:[{name:"config",val:": ProphetNetConfig"}],parametersDescription:[{anchor:"transformers.ProphetNetForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.ProphetNetConfig">ProphetNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/modeling_prophetnet.py#L1875"}}),ro=new z({props:{name:"forward",anchor:"transformers.ProphetNetForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.BoolTensor] = 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[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.Tensor] = 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.ProphetNetForConditionalGeneration.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ProphetNetForConditionalGeneration.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.ProphetNetForConditionalGeneration.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>ProphetNet uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If
<code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.ProphetNetForConditionalGeneration.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.`,name:"decoder_attention_mask"},{anchor:"transformers.ProphetNetForConditionalGeneration.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.ProphetNetForConditionalGeneration.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.ProphetNetForConditionalGeneration.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.ProphetNetForConditionalGeneration.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.ProphetNetForConditionalGeneration.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden-states of the attention blocks. Can be used to speed up 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.ProphetNetForConditionalGeneration.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.ProphetNetForConditionalGeneration.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.ProphetNetForConditionalGeneration.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.ProphetNetForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ProphetNetForConditionalGeneration.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>[-100, 0, ..., config.vocab_size - 1]</code>. All labels set to <code>-100</code> are ignored (masked), the loss is only computed for
labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/modeling_prophetnet.py#L1902",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput"
>transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>ProphenetConfig</code>) 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, decoder_sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the main stream language modeling head (scores for each vocabulary token before
SoftMax).</p>
</li>
<li>
<p><strong>logits_ngram</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, ngram * decoder_sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the predict stream language modeling head (scores for each vocabulary token before
SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>torch.FloatTensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_attn_heads, decoder_sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(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 + one for the output of each layer) of
shape <code>(batch_size, decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of main stream of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_ngram_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 + one for the output of each layer) of
shape <code>(batch_size, ngram * decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the predict stream 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_attn_heads, decoder_sequence_length, decoder_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>decoder_ngram_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_attn_heads, decoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the predict stream 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_attn_heads, encoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the cross-attention layer of the decoder, after the attention softmax, used to
compute the weighted average in the</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, encoder_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 + one for the output of each layer) of
shape <code>(batch_size, encoder_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_attn_heads, encoder_sequence_length, encoder_sequence_length)</code>. Attentions weights of the encoder, after the attention
softmax, used to compute the weighted average in the self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput"
>transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qe=new br({props:{$$slots:{default:[oh]},$$scope:{ctx:$}}}),Xe=new dn({props:{anchor:"transformers.ProphetNetForConditionalGeneration.forward.example",$$slots:{default:[nh]},$$scope:{ctx:$}}}),so=new R({}),ao=new z({props:{name:"class transformers.ProphetNetForCausalLM",anchor:"transformers.ProphetNetForCausalLM",parameters:[{name:"config",val:": ProphetNetConfig"}],parametersDescription:[{anchor:"transformers.ProphetNetForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.ProphetNetConfig">ProphetNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/modeling_prophetnet.py#L2091"}}),ho=new z({props:{name:"forward",anchor:"transformers.ProphetNetForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = 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.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = 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.ProphetNetForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ProphetNetForCausalLM.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.ProphetNetForCausalLM.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.ProphetNetForCausalLM.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.ProphetNetForCausalLM.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.ProphetNetForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ProphetNetForCausalLM.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.ProphetNetForCausalLM.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.ProphetNetForCausalLM.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.ProphetNetForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden-states of the attention blocks. Can be used to speed up 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.ProphetNetForCausalLM.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.ProphetNetForCausalLM.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 left-to-right language modeling loss (next word prediction). Indices should be in
<code>[-100, 0, ..., config.vocab_size]</code> (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 n <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/prophetnet/modeling_prophetnet.py#L2128",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderLMOutput"
>transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>ProphenetConfig</code>) 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, decoder_sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the main stream language modeling head (scores for each vocabulary token before
SoftMax).</p>
</li>
<li>
<p><strong>logits_ngram</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, ngram * decoder_sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the predict stream language modeling head (scores for each vocabulary token before
SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>torch.FloatTensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_attn_heads, decoder_sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>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 + one for the output of each layer) of
shape <code>(batch_size, decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of main stream of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>ngram_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 + one for the output of each layer) of
shape <code>(batch_size, ngram * decoder_sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the predict stream of the decoder at the output of each layer plus the 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_attn_heads, decoder_sequence_length, decoder_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>ngram_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_attn_heads, decoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the predict stream of the decoder, after the attention softmax, used to compute the
weighted average in the</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_attn_heads, encoder_sequence_length, decoder_sequence_length)</code>.</p>
<p>Attentions weights of the cross-attention layer of the decoder, after the attention softmax, used to
compute the weighted average in the</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderLMOutput"
>transformers.models.prophetnet.modeling_prophetnet.ProphetNetDecoderLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),et=new br({props:{$$slots:{default:[rh]},$$scope:{ctx:$}}}),tt=new dn({props:{anchor:"transformers.ProphetNetForCausalLM.forward.example",$$slots:{default:[sh]},$$scope:{ctx:$}}}),{c(){h=n("meta"),k=l(),g=n("h1"),_=n("a"),v=n("span"),b(i.$$.fragment),f=l(),q=n("span"),Es=a("ProphetNet"),Tr=l(),te=n("div"),_o=n("a"),go=n("img"),xs=l(),vo=n("a"),ko=n("img"),yr=l(),oe=n("p"),pn=n("strong"),Ms=a("DISCLAIMER:"),Os=a(" If you see something strange, file a "),ct=n("a"),Cs=a("Github Issue"),Ss=a(` and assign
@patrickvonplaten`),wr=l(),ne=n("h2"),Ee=n("a"),hn=n("span"),b(lt.$$.fragment),As=l(),un=n("span"),Ds=a("Overview"),Pr=l(),xe=n("p"),Ls=a("The ProphetNet model was proposed in "),pt=n("a"),js=a("ProphetNet: Predicting Future N-gram for Sequence-to-Sequence Pre-training,"),Is=a(` by Yu Yan, Weizhen Qi, Yeyun Gong, Dayiheng Liu, Nan Duan, Jiusheng Chen, Ruofei
Zhang, Ming Zhou on 13 Jan, 2020.`),Nr=l(),bo=n("p"),Bs=a(`ProphetNet is an encoder-decoder model and can predict n-future tokens for \u201Cngram\u201D language modeling instead of just
the next token.`),$r=l(),To=n("p"),Gs=a("The abstract from the paper is the following:"),qr=l(),yo=n("p"),mn=n("em"),Ws=a(`In this paper, we present a new sequence-to-sequence pretraining model called ProphetNet, which introduces a novel
self-supervised objective named future n-gram prediction and the proposed n-stream self-attention mechanism. Instead of
the optimization of one-step ahead prediction in traditional sequence-to-sequence model, the ProphetNet is optimized by
n-step ahead prediction which predicts the next n tokens simultaneously based on previous context tokens at each time
step. The future n-gram prediction explicitly encourages the model to plan for the future tokens and prevent
overfitting on strong local correlations. We pre-train ProphetNet using a base scale dataset (16GB) and a large scale
dataset (160GB) respectively. Then we conduct experiments on CNN/DailyMail, Gigaword, and SQuAD 1.1 benchmarks for
abstractive summarization and question generation tasks. Experimental results show that ProphetNet achieves new
state-of-the-art results on all these datasets compared to the models using the same scale pretraining corpus.`),zr=l(),wo=n("p"),Hs=a("Tips:"),Fr=l(),Me=n("ul"),fn=n("li"),Us=a(`ProphetNet is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),Vs=l(),_n=n("li"),Rs=a("The model architecture is based on the original Transformer, but replaces the \u201Cstandard\u201D self-attention mechanism in the decoder by a a main self-attention mechanism and a self and n-stream (predict) self-attention mechanism."),Er=l(),Oe=n("p"),Js=a("The Authors\u2019 code can be found "),ht=n("a"),Ys=a("here"),Ks=a("."),xr=l(),re=n("h2"),Ce=n("a"),gn=n("span"),b(ut.$$.fragment),Qs=l(),vn=n("span"),Xs=a("Documentation resources"),Mr=l(),J=n("ul"),kn=n("li"),Po=n("a"),Zs=a("Causal language modeling task guide"),ea=l(),bn=n("li"),No=n("a"),ta=a("Translation task guide"),oa=l(),Tn=n("li"),$o=n("a"),na=a("Summarization task guide"),Or=l(),se=n("h2"),Se=n("a"),yn=n("span"),b(mt.$$.fragment),ra=l(),wn=n("span"),sa=a("ProphetNetConfig"),Cr=l(),V=n("div"),b(ft.$$.fragment),aa=l(),ae=n("p"),da=a("This is the configuration class to store the configuration of a "),qo=n("a"),ia=a("ProphetNetModel"),ca=a(`. It is used to instantiate a
ProphetNet 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 ProphetNet
`),_t=n("a"),la=a("microsoft/prophetnet-large-uncased"),pa=a(" architecture."),ha=l(),de=n("p"),ua=a("Configuration objects inherit from "),zo=n("a"),ma=a("PretrainedConfig"),fa=a(` and can be used to control the model outputs. Read the
documentation from `),Fo=n("a"),_a=a("PretrainedConfig"),ga=a(" for more information."),Sr=l(),ie=n("h2"),Ae=n("a"),Pn=n("span"),b(gt.$$.fragment),va=l(),Nn=n("span"),ka=a("ProphetNetTokenizer"),Ar=l(),F=n("div"),b(vt.$$.fragment),ba=l(),$n=n("p"),Ta=a("Construct a ProphetNetTokenizer. Based on WordPiece."),ya=l(),kt=n("p"),wa=a("This tokenizer inherits from "),Eo=n("a"),Pa=a("PreTrainedTokenizer"),Na=a(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),$a=l(),Y=n("div"),b(bt.$$.fragment),qa=l(),qn=n("p"),za=a(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),Fa=l(),Tt=n("ul"),xo=n("li"),Ea=a("single sequence: "),zn=n("code"),xa=a("[CLS] X [SEP]"),Ma=l(),Mo=n("li"),Oa=a("pair of sequences: "),Fn=n("code"),Ca=a("[CLS] A [SEP] B [SEP]"),Sa=l(),De=n("div"),b(yt.$$.fragment),Aa=l(),En=n("p"),Da=a("Converts a sequence of tokens (string) in a single string."),La=l(),L=n("div"),b(wt.$$.fragment),ja=l(),xn=n("p"),Ia=a("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A ProphetNet"),Ba=l(),b(Le.$$.fragment),Ga=l(),ce=n("p"),Wa=a("If "),Mn=n("code"),Ha=a("token_ids_1"),Ua=a(" is "),On=n("code"),Va=a("None"),Ra=a(", this method only returns the first portion of the mask (0s)."),Ja=l(),je=n("div"),b(Pt.$$.fragment),Ya=l(),Nt=n("p"),Ka=a(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Cn=n("code"),Qa=a("prepare_for_model"),Xa=a(" method."),Dr=l(),le=n("h2"),Ie=n("a"),Sn=n("span"),b($t.$$.fragment),Za=l(),An=n("span"),ed=a("ProphetNet specific outputs"),Lr=l(),pe=n("div"),b(qt.$$.fragment),td=l(),Dn=n("p"),od=a("Base class for sequence-to-sequence language models outputs."),jr=l(),he=n("div"),b(zt.$$.fragment),nd=l(),Ln=n("p"),rd=a(`Base class for model encoder\u2019s outputs that also contains : pre-computed hidden states that can speed up sequential
decoding.`),Ir=l(),ue=n("div"),b(Ft.$$.fragment),sd=l(),jn=n("p"),ad=a("Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),Br=l(),me=n("div"),b(Et.$$.fragment),dd=l(),In=n("p"),id=a("Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),Gr=l(),fe=n("h2"),Be=n("a"),Bn=n("span"),b(xt.$$.fragment),cd=l(),Gn=n("span"),ld=a("ProphetNetModel"),Wr=l(),M=n("div"),b(Mt.$$.fragment),pd=l(),Ot=n("p"),hd=a(`The bare ProphetNet Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Oo=n("a"),ud=a("PreTrainedModel"),md=a(`. 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.)`),fd=l(),_e=n("p"),_d=a("Original ProphetNet code can be found "),Ct=n("a"),gd=a("here"),vd=a(`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),Wn=n("code"),kd=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),bd=a("."),Td=l(),St=n("p"),yd=a("This model is a PyTorch "),At=n("a"),wd=a("torch.nn.Module"),Pd=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),Nd=l(),j=n("div"),b(Dt.$$.fragment),$d=l(),ge=n("p"),qd=a("The "),Co=n("a"),zd=a("ProphetNetModel"),Fd=a(" forward method, overrides the "),Hn=n("code"),Ed=a("__call__"),xd=a(" special method."),Md=l(),b(Ge.$$.fragment),Od=l(),b(We.$$.fragment),Hr=l(),ve=n("h2"),He=n("a"),Un=n("span"),b(Lt.$$.fragment),Cd=l(),Vn=n("span"),Sd=a("ProphetNetEncoder"),Ur=l(),E=n("div"),b(jt.$$.fragment),Ad=l(),It=n("p"),Dd=a(`The standalone encoder part of the ProphetNetModel.
This model inherits from `),So=n("a"),Ld=a("PreTrainedModel"),jd=a(`. 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.)`),Id=l(),ke=n("p"),Bd=a("Original ProphetNet code can be found "),Bt=n("a"),Gd=a("here"),Wd=a(`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),Rn=n("code"),Hd=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Ud=a("."),Vd=l(),Gt=n("p"),Rd=a("This model is a PyTorch "),Wt=n("a"),Jd=a("torch.nn.Module"),Yd=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),Kd=l(),A=n("p"),Qd=a("word_embeddings  ("),Jn=n("code"),Xd=a("torch.nn.Embeddings"),Zd=a(" of shape "),Yn=n("code"),ei=a("(config.vocab_size, config.hidden_size)"),ti=a(", "),Kn=n("em"),oi=a("optional"),ni=a(`):
The word embedding parameters. This can be used to initialize `),Ao=n("a"),ri=a("ProphetNetEncoder"),si=a(` with pre-defined word
embeddings instead of randomly initialized word embeddings.`),ai=l(),I=n("div"),b(Ht.$$.fragment),di=l(),be=n("p"),ii=a("The "),Do=n("a"),ci=a("ProphetNetEncoder"),li=a(" forward method, overrides the "),Qn=n("code"),pi=a("__call__"),hi=a(" special method."),ui=l(),b(Ue.$$.fragment),mi=l(),b(Ve.$$.fragment),Vr=l(),Te=n("h2"),Re=n("a"),Xn=n("span"),b(Ut.$$.fragment),fi=l(),Zn=n("span"),_i=a("ProphetNetDecoder"),Rr=l(),x=n("div"),b(Vt.$$.fragment),gi=l(),Rt=n("p"),vi=a(`The standalone decoder part of the ProphetNetModel.
This model inherits from `),Lo=n("a"),ki=a("PreTrainedModel"),bi=a(`. 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.)`),Ti=l(),ye=n("p"),yi=a("Original ProphetNet code can be found "),Jt=n("a"),wi=a("here"),Pi=a(`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),er=n("code"),Ni=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),$i=a("."),qi=l(),Yt=n("p"),zi=a("This model is a PyTorch "),Kt=n("a"),Fi=a("torch.nn.Module"),Ei=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),xi=l(),D=n("p"),Mi=a("word_embeddings  ("),tr=n("code"),Oi=a("torch.nn.Embeddings"),Ci=a(" of shape "),or=n("code"),Si=a("(config.vocab_size, config.hidden_size)"),Ai=a(", "),nr=n("em"),Di=a("optional"),Li=a(`):
The word embedding parameters. This can be used to initialize `),jo=n("a"),ji=a("ProphetNetEncoder"),Ii=a(` with pre-defined word
embeddings instead of randomly initialized word embeddings.`),Bi=l(),B=n("div"),b(Qt.$$.fragment),Gi=l(),we=n("p"),Wi=a("The "),Io=n("a"),Hi=a("ProphetNetDecoder"),Ui=a(" forward method, overrides the "),rr=n("code"),Vi=a("__call__"),Ri=a(" special method."),Ji=l(),b(Je.$$.fragment),Yi=l(),b(Ye.$$.fragment),Jr=l(),Pe=n("h2"),Ke=n("a"),sr=n("span"),b(Xt.$$.fragment),Ki=l(),ar=n("span"),Qi=a("ProphetNetForConditionalGeneration"),Yr=l(),O=n("div"),b(Zt.$$.fragment),Xi=l(),eo=n("p"),Zi=a(`The ProphetNet Model with a language modeling head. Can be used for sequence generation tasks.
This model inherits from `),Bo=n("a"),ec=a("PreTrainedModel"),tc=a(`. 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.)`),oc=l(),Ne=n("p"),nc=a("Original ProphetNet code can be found "),to=n("a"),rc=a("here"),sc=a(`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),dr=n("code"),ac=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),dc=a("."),ic=l(),oo=n("p"),cc=a("This model is a PyTorch "),no=n("a"),lc=a("torch.nn.Module"),pc=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),hc=l(),G=n("div"),b(ro.$$.fragment),uc=l(),$e=n("p"),mc=a("The "),Go=n("a"),fc=a("ProphetNetForConditionalGeneration"),_c=a(" forward method, overrides the "),ir=n("code"),gc=a("__call__"),vc=a(" special method."),kc=l(),b(Qe.$$.fragment),bc=l(),b(Xe.$$.fragment),Kr=l(),qe=n("h2"),Ze=n("a"),cr=n("span"),b(so.$$.fragment),Tc=l(),lr=n("span"),yc=a("ProphetNetForCausalLM"),Qr=l(),C=n("div"),b(ao.$$.fragment),wc=l(),io=n("p"),Pc=a(`The standalone decoder part of the ProphetNetModel with a lm head on top. The model can be used for causal language modeling.
This model inherits from `),Wo=n("a"),Nc=a("PreTrainedModel"),$c=a(`. 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.)`),qc=l(),ze=n("p"),zc=a("Original ProphetNet code can be found "),co=n("a"),Fc=a("here"),Ec=a(`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),pr=n("code"),xc=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Mc=a("."),Oc=l(),lo=n("p"),Cc=a("This model is a PyTorch "),po=n("a"),Sc=a("torch.nn.Module"),Ac=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),Dc=l(),W=n("div"),b(ho.$$.fragment),Lc=l(),Fe=n("p"),jc=a("The "),Ho=n("a"),Ic=a("ProphetNetForCausalLM"),Bc=a(" forward method, overrides the "),hr=n("code"),Gc=a("__call__"),Wc=a(" special method."),Hc=l(),b(et.$$.fragment),Uc=l(),b(tt.$$.fragment),this.h()},l(t){const u=Rp('[data-svelte="svelte-1phssyn"]',document.head);h=r(u,"META",{name:!0,content:!0}),u.forEach(o),k=p(t),g=r(t,"H1",{class:!0});var uo=s(g);_=r(uo,"A",{id:!0,class:!0,href:!0});var ur=s(_);v=r(ur,"SPAN",{});var mr=s(v);T(i.$$.fragment,mr),mr.forEach(o),ur.forEach(o),f=p(uo),q=r(uo,"SPAN",{});var fr=s(q);Es=d(fr,"ProphetNet"),fr.forEach(o),uo.forEach(o),Tr=p(t),te=r(t,"DIV",{class:!0});var mo=s(te);_o=r(mo,"A",{href:!0});var _r=s(_o);go=r(_r,"IMG",{alt:!0,src:!0}),_r.forEach(o),xs=p(mo),vo=r(mo,"A",{href:!0});var gr=s(vo);ko=r(gr,"IMG",{alt:!0,src:!0}),gr.forEach(o),mo.forEach(o),yr=p(t),oe=r(t,"P",{});var ot=s(oe);pn=r(ot,"STRONG",{});var vr=s(pn);Ms=d(vr,"DISCLAIMER:"),vr.forEach(o),Os=d(ot," If you see something strange, file a "),ct=r(ot,"A",{href:!0,rel:!0});var kr=s(ct);Cs=d(kr,"Github Issue"),kr.forEach(o),Ss=d(ot,` and assign
@patrickvonplaten`),ot.forEach(o),wr=p(t),ne=r(t,"H2",{class:!0});var fo=s(ne);Ee=r(fo,"A",{id:!0,class:!0,href:!0});var Kc=s(Ee);hn=r(Kc,"SPAN",{});var Qc=s(hn);T(lt.$$.fragment,Qc),Qc.forEach(o),Kc.forEach(o),As=p(fo),un=r(fo,"SPAN",{});var Xc=s(un);Ds=d(Xc,"Overview"),Xc.forEach(o),fo.forEach(o),Pr=p(t),xe=r(t,"P",{});var Zr=s(xe);Ls=d(Zr,"The ProphetNet model was proposed in "),pt=r(Zr,"A",{href:!0,rel:!0});var Zc=s(pt);js=d(Zc,"ProphetNet: Predicting Future N-gram for Sequence-to-Sequence Pre-training,"),Zc.forEach(o),Is=d(Zr,` by Yu Yan, Weizhen Qi, Yeyun Gong, Dayiheng Liu, Nan Duan, Jiusheng Chen, Ruofei
Zhang, Ming Zhou on 13 Jan, 2020.`),Zr.forEach(o),Nr=p(t),bo=r(t,"P",{});var el=s(bo);Bs=d(el,`ProphetNet is an encoder-decoder model and can predict n-future tokens for \u201Cngram\u201D language modeling instead of just
the next token.`),el.forEach(o),$r=p(t),To=r(t,"P",{});var tl=s(To);Gs=d(tl,"The abstract from the paper is the following:"),tl.forEach(o),qr=p(t),yo=r(t,"P",{});var ol=s(yo);mn=r(ol,"EM",{});var nl=s(mn);Ws=d(nl,`In this paper, we present a new sequence-to-sequence pretraining model called ProphetNet, which introduces a novel
self-supervised objective named future n-gram prediction and the proposed n-stream self-attention mechanism. Instead of
the optimization of one-step ahead prediction in traditional sequence-to-sequence model, the ProphetNet is optimized by
n-step ahead prediction which predicts the next n tokens simultaneously based on previous context tokens at each time
step. The future n-gram prediction explicitly encourages the model to plan for the future tokens and prevent
overfitting on strong local correlations. We pre-train ProphetNet using a base scale dataset (16GB) and a large scale
dataset (160GB) respectively. Then we conduct experiments on CNN/DailyMail, Gigaword, and SQuAD 1.1 benchmarks for
abstractive summarization and question generation tasks. Experimental results show that ProphetNet achieves new
state-of-the-art results on all these datasets compared to the models using the same scale pretraining corpus.`),nl.forEach(o),ol.forEach(o),zr=p(t),wo=r(t,"P",{});var rl=s(wo);Hs=d(rl,"Tips:"),rl.forEach(o),Fr=p(t),Me=r(t,"UL",{});var es=s(Me);fn=r(es,"LI",{});var sl=s(fn);Us=d(sl,`ProphetNet is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),sl.forEach(o),Vs=p(es),_n=r(es,"LI",{});var al=s(_n);Rs=d(al,"The model architecture is based on the original Transformer, but replaces the \u201Cstandard\u201D self-attention mechanism in the decoder by a a main self-attention mechanism and a self and n-stream (predict) self-attention mechanism."),al.forEach(o),es.forEach(o),Er=p(t),Oe=r(t,"P",{});var ts=s(Oe);Js=d(ts,"The Authors\u2019 code can be found "),ht=r(ts,"A",{href:!0,rel:!0});var dl=s(ht);Ys=d(dl,"here"),dl.forEach(o),Ks=d(ts,"."),ts.forEach(o),xr=p(t),re=r(t,"H2",{class:!0});var os=s(re);Ce=r(os,"A",{id:!0,class:!0,href:!0});var il=s(Ce);gn=r(il,"SPAN",{});var cl=s(gn);T(ut.$$.fragment,cl),cl.forEach(o),il.forEach(o),Qs=p(os),vn=r(os,"SPAN",{});var ll=s(vn);Xs=d(ll,"Documentation resources"),ll.forEach(o),os.forEach(o),Mr=p(t),J=r(t,"UL",{});var Uo=s(J);kn=r(Uo,"LI",{});var pl=s(kn);Po=r(pl,"A",{href:!0});var hl=s(Po);Zs=d(hl,"Causal language modeling task guide"),hl.forEach(o),pl.forEach(o),ea=p(Uo),bn=r(Uo,"LI",{});var ul=s(bn);No=r(ul,"A",{href:!0});var ml=s(No);ta=d(ml,"Translation task guide"),ml.forEach(o),ul.forEach(o),oa=p(Uo),Tn=r(Uo,"LI",{});var fl=s(Tn);$o=r(fl,"A",{href:!0});var _l=s($o);na=d(_l,"Summarization task guide"),_l.forEach(o),fl.forEach(o),Uo.forEach(o),Or=p(t),se=r(t,"H2",{class:!0});var ns=s(se);Se=r(ns,"A",{id:!0,class:!0,href:!0});var gl=s(Se);yn=r(gl,"SPAN",{});var vl=s(yn);T(mt.$$.fragment,vl),vl.forEach(o),gl.forEach(o),ra=p(ns),wn=r(ns,"SPAN",{});var kl=s(wn);sa=d(kl,"ProphetNetConfig"),kl.forEach(o),ns.forEach(o),Cr=p(t),V=r(t,"DIV",{class:!0});var Vo=s(V);T(ft.$$.fragment,Vo),aa=p(Vo),ae=r(Vo,"P",{});var Ro=s(ae);da=d(Ro,"This is the configuration class to store the configuration of a "),qo=r(Ro,"A",{href:!0});var bl=s(qo);ia=d(bl,"ProphetNetModel"),bl.forEach(o),ca=d(Ro,`. It is used to instantiate a
ProphetNet 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 ProphetNet
`),_t=r(Ro,"A",{href:!0,rel:!0});var Tl=s(_t);la=d(Tl,"microsoft/prophetnet-large-uncased"),Tl.forEach(o),pa=d(Ro," architecture."),Ro.forEach(o),ha=p(Vo),de=r(Vo,"P",{});var Jo=s(de);ua=d(Jo,"Configuration objects inherit from "),zo=r(Jo,"A",{href:!0});var yl=s(zo);ma=d(yl,"PretrainedConfig"),yl.forEach(o),fa=d(Jo,` and can be used to control the model outputs. Read the
documentation from `),Fo=r(Jo,"A",{href:!0});var wl=s(Fo);_a=d(wl,"PretrainedConfig"),wl.forEach(o),ga=d(Jo," for more information."),Jo.forEach(o),Vo.forEach(o),Sr=p(t),ie=r(t,"H2",{class:!0});var rs=s(ie);Ae=r(rs,"A",{id:!0,class:!0,href:!0});var Pl=s(Ae);Pn=r(Pl,"SPAN",{});var Nl=s(Pn);T(gt.$$.fragment,Nl),Nl.forEach(o),Pl.forEach(o),va=p(rs),Nn=r(rs,"SPAN",{});var $l=s(Nn);ka=d($l,"ProphetNetTokenizer"),$l.forEach(o),rs.forEach(o),Ar=p(t),F=r(t,"DIV",{class:!0});var S=s(F);T(vt.$$.fragment,S),ba=p(S),$n=r(S,"P",{});var ql=s($n);Ta=d(ql,"Construct a ProphetNetTokenizer. Based on WordPiece."),ql.forEach(o),ya=p(S),kt=r(S,"P",{});var ss=s(kt);wa=d(ss,"This tokenizer inherits from "),Eo=r(ss,"A",{href:!0});var zl=s(Eo);Pa=d(zl,"PreTrainedTokenizer"),zl.forEach(o),Na=d(ss,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),ss.forEach(o),$a=p(S),Y=r(S,"DIV",{class:!0});var Yo=s(Y);T(bt.$$.fragment,Yo),qa=p(Yo),qn=r(Yo,"P",{});var Fl=s(qn);za=d(Fl,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),Fl.forEach(o),Fa=p(Yo),Tt=r(Yo,"UL",{});var as=s(Tt);xo=r(as,"LI",{});var Vc=s(xo);Ea=d(Vc,"single sequence: "),zn=r(Vc,"CODE",{});var El=s(zn);xa=d(El,"[CLS] X [SEP]"),El.forEach(o),Vc.forEach(o),Ma=p(as),Mo=r(as,"LI",{});var Rc=s(Mo);Oa=d(Rc,"pair of sequences: "),Fn=r(Rc,"CODE",{});var xl=s(Fn);Ca=d(xl,"[CLS] A [SEP] B [SEP]"),xl.forEach(o),Rc.forEach(o),as.forEach(o),Yo.forEach(o),Sa=p(S),De=r(S,"DIV",{class:!0});var ds=s(De);T(yt.$$.fragment,ds),Aa=p(ds),En=r(ds,"P",{});var Ml=s(En);Da=d(Ml,"Converts a sequence of tokens (string) in a single string."),Ml.forEach(o),ds.forEach(o),La=p(S),L=r(S,"DIV",{class:!0});var nt=s(L);T(wt.$$.fragment,nt),ja=p(nt),xn=r(nt,"P",{});var Ol=s(xn);Ia=d(Ol,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A ProphetNet"),Ol.forEach(o),Ba=p(nt),T(Le.$$.fragment,nt),Ga=p(nt),ce=r(nt,"P",{});var Ko=s(ce);Wa=d(Ko,"If "),Mn=r(Ko,"CODE",{});var Cl=s(Mn);Ha=d(Cl,"token_ids_1"),Cl.forEach(o),Ua=d(Ko," is "),On=r(Ko,"CODE",{});var Sl=s(On);Va=d(Sl,"None"),Sl.forEach(o),Ra=d(Ko,", this method only returns the first portion of the mask (0s)."),Ko.forEach(o),nt.forEach(o),Ja=p(S),je=r(S,"DIV",{class:!0});var is=s(je);T(Pt.$$.fragment,is),Ya=p(is),Nt=r(is,"P",{});var cs=s(Nt);Ka=d(cs,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Cn=r(cs,"CODE",{});var Al=s(Cn);Qa=d(Al,"prepare_for_model"),Al.forEach(o),Xa=d(cs," method."),cs.forEach(o),is.forEach(o),S.forEach(o),Dr=p(t),le=r(t,"H2",{class:!0});var ls=s(le);Ie=r(ls,"A",{id:!0,class:!0,href:!0});var Dl=s(Ie);Sn=r(Dl,"SPAN",{});var Ll=s(Sn);T($t.$$.fragment,Ll),Ll.forEach(o),Dl.forEach(o),Za=p(ls),An=r(ls,"SPAN",{});var jl=s(An);ed=d(jl,"ProphetNet specific outputs"),jl.forEach(o),ls.forEach(o),Lr=p(t),pe=r(t,"DIV",{class:!0});var ps=s(pe);T(qt.$$.fragment,ps),td=p(ps),Dn=r(ps,"P",{});var Il=s(Dn);od=d(Il,"Base class for sequence-to-sequence language models outputs."),Il.forEach(o),ps.forEach(o),jr=p(t),he=r(t,"DIV",{class:!0});var hs=s(he);T(zt.$$.fragment,hs),nd=p(hs),Ln=r(hs,"P",{});var Bl=s(Ln);rd=d(Bl,`Base class for model encoder\u2019s outputs that also contains : pre-computed hidden states that can speed up sequential
decoding.`),Bl.forEach(o),hs.forEach(o),Ir=p(t),ue=r(t,"DIV",{class:!0});var us=s(ue);T(Ft.$$.fragment,us),sd=p(us),jn=r(us,"P",{});var Gl=s(jn);ad=d(Gl,"Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),Gl.forEach(o),us.forEach(o),Br=p(t),me=r(t,"DIV",{class:!0});var ms=s(me);T(Et.$$.fragment,ms),dd=p(ms),In=r(ms,"P",{});var Wl=s(In);id=d(Wl,"Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),Wl.forEach(o),ms.forEach(o),Gr=p(t),fe=r(t,"H2",{class:!0});var fs=s(fe);Be=r(fs,"A",{id:!0,class:!0,href:!0});var Hl=s(Be);Bn=r(Hl,"SPAN",{});var Ul=s(Bn);T(xt.$$.fragment,Ul),Ul.forEach(o),Hl.forEach(o),cd=p(fs),Gn=r(fs,"SPAN",{});var Vl=s(Gn);ld=d(Vl,"ProphetNetModel"),Vl.forEach(o),fs.forEach(o),Wr=p(t),M=r(t,"DIV",{class:!0});var K=s(M);T(Mt.$$.fragment,K),pd=p(K),Ot=r(K,"P",{});var _s=s(Ot);hd=d(_s,`The bare ProphetNet Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Oo=r(_s,"A",{href:!0});var Rl=s(Oo);ud=d(Rl,"PreTrainedModel"),Rl.forEach(o),md=d(_s,`. 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.)`),_s.forEach(o),fd=p(K),_e=r(K,"P",{});var Qo=s(_e);_d=d(Qo,"Original ProphetNet code can be found "),Ct=r(Qo,"A",{href:!0,rel:!0});var Jl=s(Ct);gd=d(Jl,"here"),Jl.forEach(o),vd=d(Qo,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),Wn=r(Qo,"CODE",{});var Yl=s(Wn);kd=d(Yl,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Yl.forEach(o),bd=d(Qo,"."),Qo.forEach(o),Td=p(K),St=r(K,"P",{});var gs=s(St);yd=d(gs,"This model is a PyTorch "),At=r(gs,"A",{href:!0,rel:!0});var Kl=s(At);wd=d(Kl,"torch.nn.Module"),Kl.forEach(o),Pd=d(gs,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),gs.forEach(o),Nd=p(K),j=r(K,"DIV",{class:!0});var rt=s(j);T(Dt.$$.fragment,rt),$d=p(rt),ge=r(rt,"P",{});var Xo=s(ge);qd=d(Xo,"The "),Co=r(Xo,"A",{href:!0});var Ql=s(Co);zd=d(Ql,"ProphetNetModel"),Ql.forEach(o),Fd=d(Xo," forward method, overrides the "),Hn=r(Xo,"CODE",{});var Xl=s(Hn);Ed=d(Xl,"__call__"),Xl.forEach(o),xd=d(Xo," special method."),Xo.forEach(o),Md=p(rt),T(Ge.$$.fragment,rt),Od=p(rt),T(We.$$.fragment,rt),rt.forEach(o),K.forEach(o),Hr=p(t),ve=r(t,"H2",{class:!0});var vs=s(ve);He=r(vs,"A",{id:!0,class:!0,href:!0});var Zl=s(He);Un=r(Zl,"SPAN",{});var ep=s(Un);T(Lt.$$.fragment,ep),ep.forEach(o),Zl.forEach(o),Cd=p(vs),Vn=r(vs,"SPAN",{});var tp=s(Vn);Sd=d(tp,"ProphetNetEncoder"),tp.forEach(o),vs.forEach(o),Ur=p(t),E=r(t,"DIV",{class:!0});var H=s(E);T(jt.$$.fragment,H),Ad=p(H),It=r(H,"P",{});var ks=s(It);Dd=d(ks,`The standalone encoder part of the ProphetNetModel.
This model inherits from `),So=r(ks,"A",{href:!0});var op=s(So);Ld=d(op,"PreTrainedModel"),op.forEach(o),jd=d(ks,`. 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.)`),ks.forEach(o),Id=p(H),ke=r(H,"P",{});var Zo=s(ke);Bd=d(Zo,"Original ProphetNet code can be found "),Bt=r(Zo,"A",{href:!0,rel:!0});var np=s(Bt);Gd=d(np,"here"),np.forEach(o),Wd=d(Zo,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),Rn=r(Zo,"CODE",{});var rp=s(Rn);Hd=d(rp,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),rp.forEach(o),Ud=d(Zo,"."),Zo.forEach(o),Vd=p(H),Gt=r(H,"P",{});var bs=s(Gt);Rd=d(bs,"This model is a PyTorch "),Wt=r(bs,"A",{href:!0,rel:!0});var sp=s(Wt);Jd=d(sp,"torch.nn.Module"),sp.forEach(o),Yd=d(bs,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),bs.forEach(o),Kd=p(H),A=r(H,"P",{});var Q=s(A);Qd=d(Q,"word_embeddings  ("),Jn=r(Q,"CODE",{});var ap=s(Jn);Xd=d(ap,"torch.nn.Embeddings"),ap.forEach(o),Zd=d(Q," of shape "),Yn=r(Q,"CODE",{});var dp=s(Yn);ei=d(dp,"(config.vocab_size, config.hidden_size)"),dp.forEach(o),ti=d(Q,", "),Kn=r(Q,"EM",{});var ip=s(Kn);oi=d(ip,"optional"),ip.forEach(o),ni=d(Q,`):
The word embedding parameters. This can be used to initialize `),Ao=r(Q,"A",{href:!0});var cp=s(Ao);ri=d(cp,"ProphetNetEncoder"),cp.forEach(o),si=d(Q,` with pre-defined word
embeddings instead of randomly initialized word embeddings.`),Q.forEach(o),ai=p(H),I=r(H,"DIV",{class:!0});var st=s(I);T(Ht.$$.fragment,st),di=p(st),be=r(st,"P",{});var en=s(be);ii=d(en,"The "),Do=r(en,"A",{href:!0});var lp=s(Do);ci=d(lp,"ProphetNetEncoder"),lp.forEach(o),li=d(en," forward method, overrides the "),Qn=r(en,"CODE",{});var pp=s(Qn);pi=d(pp,"__call__"),pp.forEach(o),hi=d(en," special method."),en.forEach(o),ui=p(st),T(Ue.$$.fragment,st),mi=p(st),T(Ve.$$.fragment,st),st.forEach(o),H.forEach(o),Vr=p(t),Te=r(t,"H2",{class:!0});var Ts=s(Te);Re=r(Ts,"A",{id:!0,class:!0,href:!0});var hp=s(Re);Xn=r(hp,"SPAN",{});var up=s(Xn);T(Ut.$$.fragment,up),up.forEach(o),hp.forEach(o),fi=p(Ts),Zn=r(Ts,"SPAN",{});var mp=s(Zn);_i=d(mp,"ProphetNetDecoder"),mp.forEach(o),Ts.forEach(o),Rr=p(t),x=r(t,"DIV",{class:!0});var U=s(x);T(Vt.$$.fragment,U),gi=p(U),Rt=r(U,"P",{});var ys=s(Rt);vi=d(ys,`The standalone decoder part of the ProphetNetModel.
This model inherits from `),Lo=r(ys,"A",{href:!0});var fp=s(Lo);ki=d(fp,"PreTrainedModel"),fp.forEach(o),bi=d(ys,`. 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.)`),ys.forEach(o),Ti=p(U),ye=r(U,"P",{});var tn=s(ye);yi=d(tn,"Original ProphetNet code can be found "),Jt=r(tn,"A",{href:!0,rel:!0});var _p=s(Jt);wi=d(_p,"here"),_p.forEach(o),Pi=d(tn,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),er=r(tn,"CODE",{});var gp=s(er);Ni=d(gp,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),gp.forEach(o),$i=d(tn,"."),tn.forEach(o),qi=p(U),Yt=r(U,"P",{});var ws=s(Yt);zi=d(ws,"This model is a PyTorch "),Kt=r(ws,"A",{href:!0,rel:!0});var vp=s(Kt);Fi=d(vp,"torch.nn.Module"),vp.forEach(o),Ei=d(ws,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),ws.forEach(o),xi=p(U),D=r(U,"P",{});var X=s(D);Mi=d(X,"word_embeddings  ("),tr=r(X,"CODE",{});var kp=s(tr);Oi=d(kp,"torch.nn.Embeddings"),kp.forEach(o),Ci=d(X," of shape "),or=r(X,"CODE",{});var bp=s(or);Si=d(bp,"(config.vocab_size, config.hidden_size)"),bp.forEach(o),Ai=d(X,", "),nr=r(X,"EM",{});var Tp=s(nr);Di=d(Tp,"optional"),Tp.forEach(o),Li=d(X,`):
The word embedding parameters. This can be used to initialize `),jo=r(X,"A",{href:!0});var yp=s(jo);ji=d(yp,"ProphetNetEncoder"),yp.forEach(o),Ii=d(X,` with pre-defined word
embeddings instead of randomly initialized word embeddings.`),X.forEach(o),Bi=p(U),B=r(U,"DIV",{class:!0});var at=s(B);T(Qt.$$.fragment,at),Gi=p(at),we=r(at,"P",{});var on=s(we);Wi=d(on,"The "),Io=r(on,"A",{href:!0});var wp=s(Io);Hi=d(wp,"ProphetNetDecoder"),wp.forEach(o),Ui=d(on," forward method, overrides the "),rr=r(on,"CODE",{});var Pp=s(rr);Vi=d(Pp,"__call__"),Pp.forEach(o),Ri=d(on," special method."),on.forEach(o),Ji=p(at),T(Je.$$.fragment,at),Yi=p(at),T(Ye.$$.fragment,at),at.forEach(o),U.forEach(o),Jr=p(t),Pe=r(t,"H2",{class:!0});var Ps=s(Pe);Ke=r(Ps,"A",{id:!0,class:!0,href:!0});var Np=s(Ke);sr=r(Np,"SPAN",{});var $p=s(sr);T(Xt.$$.fragment,$p),$p.forEach(o),Np.forEach(o),Ki=p(Ps),ar=r(Ps,"SPAN",{});var qp=s(ar);Qi=d(qp,"ProphetNetForConditionalGeneration"),qp.forEach(o),Ps.forEach(o),Yr=p(t),O=r(t,"DIV",{class:!0});var Z=s(O);T(Zt.$$.fragment,Z),Xi=p(Z),eo=r(Z,"P",{});var Ns=s(eo);Zi=d(Ns,`The ProphetNet Model with a language modeling head. Can be used for sequence generation tasks.
This model inherits from `),Bo=r(Ns,"A",{href:!0});var zp=s(Bo);ec=d(zp,"PreTrainedModel"),zp.forEach(o),tc=d(Ns,`. 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.)`),Ns.forEach(o),oc=p(Z),Ne=r(Z,"P",{});var nn=s(Ne);nc=d(nn,"Original ProphetNet code can be found "),to=r(nn,"A",{href:!0,rel:!0});var Fp=s(to);rc=d(Fp,"here"),Fp.forEach(o),sc=d(nn,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),dr=r(nn,"CODE",{});var Ep=s(dr);ac=d(Ep,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Ep.forEach(o),dc=d(nn,"."),nn.forEach(o),ic=p(Z),oo=r(Z,"P",{});var $s=s(oo);cc=d($s,"This model is a PyTorch "),no=r($s,"A",{href:!0,rel:!0});var xp=s(no);lc=d(xp,"torch.nn.Module"),xp.forEach(o),pc=d($s,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),$s.forEach(o),hc=p(Z),G=r(Z,"DIV",{class:!0});var dt=s(G);T(ro.$$.fragment,dt),uc=p(dt),$e=r(dt,"P",{});var rn=s($e);mc=d(rn,"The "),Go=r(rn,"A",{href:!0});var Mp=s(Go);fc=d(Mp,"ProphetNetForConditionalGeneration"),Mp.forEach(o),_c=d(rn," forward method, overrides the "),ir=r(rn,"CODE",{});var Op=s(ir);gc=d(Op,"__call__"),Op.forEach(o),vc=d(rn," special method."),rn.forEach(o),kc=p(dt),T(Qe.$$.fragment,dt),bc=p(dt),T(Xe.$$.fragment,dt),dt.forEach(o),Z.forEach(o),Kr=p(t),qe=r(t,"H2",{class:!0});var qs=s(qe);Ze=r(qs,"A",{id:!0,class:!0,href:!0});var Cp=s(Ze);cr=r(Cp,"SPAN",{});var Sp=s(cr);T(so.$$.fragment,Sp),Sp.forEach(o),Cp.forEach(o),Tc=p(qs),lr=r(qs,"SPAN",{});var Ap=s(lr);yc=d(Ap,"ProphetNetForCausalLM"),Ap.forEach(o),qs.forEach(o),Qr=p(t),C=r(t,"DIV",{class:!0});var ee=s(C);T(ao.$$.fragment,ee),wc=p(ee),io=r(ee,"P",{});var zs=s(io);Pc=d(zs,`The standalone decoder part of the ProphetNetModel with a lm head on top. The model can be used for causal language modeling.
This model inherits from `),Wo=r(zs,"A",{href:!0});var Dp=s(Wo);Nc=d(Dp,"PreTrainedModel"),Dp.forEach(o),$c=d(zs,`. 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.)`),zs.forEach(o),qc=p(ee),ze=r(ee,"P",{});var sn=s(ze);zc=d(sn,"Original ProphetNet code can be found "),co=r(sn,"A",{href:!0,rel:!0});var Lp=s(co);Fc=d(Lp,"here"),Lp.forEach(o),Ec=d(sn,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),pr=r(sn,"CODE",{});var jp=s(pr);xc=d(jp,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),jp.forEach(o),Mc=d(sn,"."),sn.forEach(o),Oc=p(ee),lo=r(ee,"P",{});var Fs=s(lo);Cc=d(Fs,"This model is a PyTorch "),po=r(Fs,"A",{href:!0,rel:!0});var Ip=s(po);Sc=d(Ip,"torch.nn.Module"),Ip.forEach(o),Ac=d(Fs,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),Fs.forEach(o),Dc=p(ee),W=r(ee,"DIV",{class:!0});var it=s(W);T(ho.$$.fragment,it),Lc=p(it),Fe=r(it,"P",{});var an=s(Fe);jc=d(an,"The "),Ho=r(an,"A",{href:!0});var Bp=s(Ho);Ic=d(Bp,"ProphetNetForCausalLM"),Bp.forEach(o),Bc=d(an," forward method, overrides the "),hr=r(an,"CODE",{});var Gp=s(hr);Gc=d(Gp,"__call__"),Gp.forEach(o),Wc=d(an," special method."),an.forEach(o),Hc=p(it),T(et.$$.fragment,it),Uc=p(it),T(tt.$$.fragment,it),it.forEach(o),ee.forEach(o),this.h()},h(){c(h,"name","hf:doc:metadata"),c(h,"content",JSON.stringify(dh)),c(_,"id","prophetnet"),c(_,"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(_,"href","#prophetnet"),c(g,"class","relative group"),c(go,"alt","Models"),Wp(go.src,Jc="https://img.shields.io/badge/All_model_pages-prophetnet-blueviolet")||c(go,"src",Jc),c(_o,"href","https://huggingface.co/models?filter=prophetnet"),c(ko,"alt","Spaces"),Wp(ko.src,Yc="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||c(ko,"src",Yc),c(vo,"href","https://huggingface.co/spaces/docs-demos/prophetnet-large-uncased"),c(te,"class","flex flex-wrap space-x-1"),c(ct,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),c(ct,"rel","nofollow"),c(Ee,"id","overview"),c(Ee,"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(Ee,"href","#overview"),c(ne,"class","relative group"),c(pt,"href","https://arxiv.org/abs/2001.04063"),c(pt,"rel","nofollow"),c(ht,"href","https://github.com/microsoft/ProphetNet"),c(ht,"rel","nofollow"),c(Ce,"id","documentation-resources"),c(Ce,"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(Ce,"href","#documentation-resources"),c(re,"class","relative group"),c(Po,"href","./tasks/language_modeling"),c(No,"href","./tasks/translation"),c($o,"href","./tasks/summarization"),c(Se,"id","transformers.ProphetNetConfig"),c(Se,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Se,"href","#transformers.ProphetNetConfig"),c(se,"class","relative group"),c(qo,"href","/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.ProphetNetModel"),c(_t,"href","https://huggingface.co/microsoft/prophetnet-large-uncased"),c(_t,"rel","nofollow"),c(zo,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(Fo,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ae,"id","transformers.ProphetNetTokenizer"),c(Ae,"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(Ae,"href","#transformers.ProphetNetTokenizer"),c(ie,"class","relative group"),c(Eo,"href","/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),c(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(Ie,"id","transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput"),c(Ie,"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(Ie,"href","#transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput"),c(le,"class","relative group"),c(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(me,"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.ProphetNetModel"),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.ProphetNetModel"),c(fe,"class","relative group"),c(Oo,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(Ct,"href","https://github.com/microsoft/ProphetNet"),c(Ct,"rel","nofollow"),c(At,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(At,"rel","nofollow"),c(Co,"href","/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.ProphetNetModel"),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(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(He,"id","transformers.ProphetNetEncoder"),c(He,"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(He,"href","#transformers.ProphetNetEncoder"),c(ve,"class","relative group"),c(So,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(Bt,"href","https://github.com/microsoft/ProphetNet"),c(Bt,"rel","nofollow"),c(Wt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Wt,"rel","nofollow"),c(Ao,"href","/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.ProphetNetEncoder"),c(Do,"href","/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.ProphetNetEncoder"),c(I,"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(Re,"id","transformers.ProphetNetDecoder"),c(Re,"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(Re,"href","#transformers.ProphetNetDecoder"),c(Te,"class","relative group"),c(Lo,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(Jt,"href","https://github.com/microsoft/ProphetNet"),c(Jt,"rel","nofollow"),c(Kt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Kt,"rel","nofollow"),c(jo,"href","/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.ProphetNetEncoder"),c(Io,"href","/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.ProphetNetDecoder"),c(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ke,"id","transformers.ProphetNetForConditionalGeneration"),c(Ke,"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(Ke,"href","#transformers.ProphetNetForConditionalGeneration"),c(Pe,"class","relative group"),c(Bo,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(to,"href","https://github.com/microsoft/ProphetNet"),c(to,"rel","nofollow"),c(no,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(no,"rel","nofollow"),c(Go,"href","/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.ProphetNetForConditionalGeneration"),c(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ze,"id","transformers.ProphetNetForCausalLM"),c(Ze,"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(Ze,"href","#transformers.ProphetNetForCausalLM"),c(qe,"class","relative group"),c(Wo,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(co,"href","https://github.com/microsoft/ProphetNet"),c(co,"rel","nofollow"),c(po,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(po,"rel","nofollow"),c(Ho,"href","/docs/transformers/v4.27.1/en/model_doc/prophetnet#transformers.ProphetNetForCausalLM"),c(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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")},m(t,u){e(document.head,h),m(t,k,u),m(t,g,u),e(g,_),e(_,v),y(i,v,null),e(g,f),e(g,q),e(q,Es),m(t,Tr,u),m(t,te,u),e(te,_o),e(_o,go),e(te,xs),e(te,vo),e(vo,ko),m(t,yr,u),m(t,oe,u),e(oe,pn),e(pn,Ms),e(oe,Os),e(oe,ct),e(ct,Cs),e(oe,Ss),m(t,wr,u),m(t,ne,u),e(ne,Ee),e(Ee,hn),y(lt,hn,null),e(ne,As),e(ne,un),e(un,Ds),m(t,Pr,u),m(t,xe,u),e(xe,Ls),e(xe,pt),e(pt,js),e(xe,Is),m(t,Nr,u),m(t,bo,u),e(bo,Bs),m(t,$r,u),m(t,To,u),e(To,Gs),m(t,qr,u),m(t,yo,u),e(yo,mn),e(mn,Ws),m(t,zr,u),m(t,wo,u),e(wo,Hs),m(t,Fr,u),m(t,Me,u),e(Me,fn),e(fn,Us),e(Me,Vs),e(Me,_n),e(_n,Rs),m(t,Er,u),m(t,Oe,u),e(Oe,Js),e(Oe,ht),e(ht,Ys),e(Oe,Ks),m(t,xr,u),m(t,re,u),e(re,Ce),e(Ce,gn),y(ut,gn,null),e(re,Qs),e(re,vn),e(vn,Xs),m(t,Mr,u),m(t,J,u),e(J,kn),e(kn,Po),e(Po,Zs),e(J,ea),e(J,bn),e(bn,No),e(No,ta),e(J,oa),e(J,Tn),e(Tn,$o),e($o,na),m(t,Or,u),m(t,se,u),e(se,Se),e(Se,yn),y(mt,yn,null),e(se,ra),e(se,wn),e(wn,sa),m(t,Cr,u),m(t,V,u),y(ft,V,null),e(V,aa),e(V,ae),e(ae,da),e(ae,qo),e(qo,ia),e(ae,ca),e(ae,_t),e(_t,la),e(ae,pa),e(V,ha),e(V,de),e(de,ua),e(de,zo),e(zo,ma),e(de,fa),e(de,Fo),e(Fo,_a),e(de,ga),m(t,Sr,u),m(t,ie,u),e(ie,Ae),e(Ae,Pn),y(gt,Pn,null),e(ie,va),e(ie,Nn),e(Nn,ka),m(t,Ar,u),m(t,F,u),y(vt,F,null),e(F,ba),e(F,$n),e($n,Ta),e(F,ya),e(F,kt),e(kt,wa),e(kt,Eo),e(Eo,Pa),e(kt,Na),e(F,$a),e(F,Y),y(bt,Y,null),e(Y,qa),e(Y,qn),e(qn,za),e(Y,Fa),e(Y,Tt),e(Tt,xo),e(xo,Ea),e(xo,zn),e(zn,xa),e(Tt,Ma),e(Tt,Mo),e(Mo,Oa),e(Mo,Fn),e(Fn,Ca),e(F,Sa),e(F,De),y(yt,De,null),e(De,Aa),e(De,En),e(En,Da),e(F,La),e(F,L),y(wt,L,null),e(L,ja),e(L,xn),e(xn,Ia),e(L,Ba),y(Le,L,null),e(L,Ga),e(L,ce),e(ce,Wa),e(ce,Mn),e(Mn,Ha),e(ce,Ua),e(ce,On),e(On,Va),e(ce,Ra),e(F,Ja),e(F,je),y(Pt,je,null),e(je,Ya),e(je,Nt),e(Nt,Ka),e(Nt,Cn),e(Cn,Qa),e(Nt,Xa),m(t,Dr,u),m(t,le,u),e(le,Ie),e(Ie,Sn),y($t,Sn,null),e(le,Za),e(le,An),e(An,ed),m(t,Lr,u),m(t,pe,u),y(qt,pe,null),e(pe,td),e(pe,Dn),e(Dn,od),m(t,jr,u),m(t,he,u),y(zt,he,null),e(he,nd),e(he,Ln),e(Ln,rd),m(t,Ir,u),m(t,ue,u),y(Ft,ue,null),e(ue,sd),e(ue,jn),e(jn,ad),m(t,Br,u),m(t,me,u),y(Et,me,null),e(me,dd),e(me,In),e(In,id),m(t,Gr,u),m(t,fe,u),e(fe,Be),e(Be,Bn),y(xt,Bn,null),e(fe,cd),e(fe,Gn),e(Gn,ld),m(t,Wr,u),m(t,M,u),y(Mt,M,null),e(M,pd),e(M,Ot),e(Ot,hd),e(Ot,Oo),e(Oo,ud),e(Ot,md),e(M,fd),e(M,_e),e(_e,_d),e(_e,Ct),e(Ct,gd),e(_e,vd),e(_e,Wn),e(Wn,kd),e(_e,bd),e(M,Td),e(M,St),e(St,yd),e(St,At),e(At,wd),e(St,Pd),e(M,Nd),e(M,j),y(Dt,j,null),e(j,$d),e(j,ge),e(ge,qd),e(ge,Co),e(Co,zd),e(ge,Fd),e(ge,Hn),e(Hn,Ed),e(ge,xd),e(j,Md),y(Ge,j,null),e(j,Od),y(We,j,null),m(t,Hr,u),m(t,ve,u),e(ve,He),e(He,Un),y(Lt,Un,null),e(ve,Cd),e(ve,Vn),e(Vn,Sd),m(t,Ur,u),m(t,E,u),y(jt,E,null),e(E,Ad),e(E,It),e(It,Dd),e(It,So),e(So,Ld),e(It,jd),e(E,Id),e(E,ke),e(ke,Bd),e(ke,Bt),e(Bt,Gd),e(ke,Wd),e(ke,Rn),e(Rn,Hd),e(ke,Ud),e(E,Vd),e(E,Gt),e(Gt,Rd),e(Gt,Wt),e(Wt,Jd),e(Gt,Yd),e(E,Kd),e(E,A),e(A,Qd),e(A,Jn),e(Jn,Xd),e(A,Zd),e(A,Yn),e(Yn,ei),e(A,ti),e(A,Kn),e(Kn,oi),e(A,ni),e(A,Ao),e(Ao,ri),e(A,si),e(E,ai),e(E,I),y(Ht,I,null),e(I,di),e(I,be),e(be,ii),e(be,Do),e(Do,ci),e(be,li),e(be,Qn),e(Qn,pi),e(be,hi),e(I,ui),y(Ue,I,null),e(I,mi),y(Ve,I,null),m(t,Vr,u),m(t,Te,u),e(Te,Re),e(Re,Xn),y(Ut,Xn,null),e(Te,fi),e(Te,Zn),e(Zn,_i),m(t,Rr,u),m(t,x,u),y(Vt,x,null),e(x,gi),e(x,Rt),e(Rt,vi),e(Rt,Lo),e(Lo,ki),e(Rt,bi),e(x,Ti),e(x,ye),e(ye,yi),e(ye,Jt),e(Jt,wi),e(ye,Pi),e(ye,er),e(er,Ni),e(ye,$i),e(x,qi),e(x,Yt),e(Yt,zi),e(Yt,Kt),e(Kt,Fi),e(Yt,Ei),e(x,xi),e(x,D),e(D,Mi),e(D,tr),e(tr,Oi),e(D,Ci),e(D,or),e(or,Si),e(D,Ai),e(D,nr),e(nr,Di),e(D,Li),e(D,jo),e(jo,ji),e(D,Ii),e(x,Bi),e(x,B),y(Qt,B,null),e(B,Gi),e(B,we),e(we,Wi),e(we,Io),e(Io,Hi),e(we,Ui),e(we,rr),e(rr,Vi),e(we,Ri),e(B,Ji),y(Je,B,null),e(B,Yi),y(Ye,B,null),m(t,Jr,u),m(t,Pe,u),e(Pe,Ke),e(Ke,sr),y(Xt,sr,null),e(Pe,Ki),e(Pe,ar),e(ar,Qi),m(t,Yr,u),m(t,O,u),y(Zt,O,null),e(O,Xi),e(O,eo),e(eo,Zi),e(eo,Bo),e(Bo,ec),e(eo,tc),e(O,oc),e(O,Ne),e(Ne,nc),e(Ne,to),e(to,rc),e(Ne,sc),e(Ne,dr),e(dr,ac),e(Ne,dc),e(O,ic),e(O,oo),e(oo,cc),e(oo,no),e(no,lc),e(oo,pc),e(O,hc),e(O,G),y(ro,G,null),e(G,uc),e(G,$e),e($e,mc),e($e,Go),e(Go,fc),e($e,_c),e($e,ir),e(ir,gc),e($e,vc),e(G,kc),y(Qe,G,null),e(G,bc),y(Xe,G,null),m(t,Kr,u),m(t,qe,u),e(qe,Ze),e(Ze,cr),y(so,cr,null),e(qe,Tc),e(qe,lr),e(lr,yc),m(t,Qr,u),m(t,C,u),y(ao,C,null),e(C,wc),e(C,io),e(io,Pc),e(io,Wo),e(Wo,Nc),e(io,$c),e(C,qc),e(C,ze),e(ze,zc),e(ze,co),e(co,Fc),e(ze,Ec),e(ze,pr),e(pr,xc),e(ze,Mc),e(C,Oc),e(C,lo),e(lo,Cc),e(lo,po),e(po,Sc),e(lo,Ac),e(C,Dc),e(C,W),y(ho,W,null),e(W,Lc),e(W,Fe),e(Fe,jc),e(Fe,Ho),e(Ho,Ic),e(Fe,Bc),e(Fe,hr),e(hr,Gc),e(Fe,Wc),e(W,Hc),y(et,W,null),e(W,Uc),y(tt,W,null),Xr=!0},p(t,[u]){const uo={};u&2&&(uo.$$scope={dirty:u,ctx:t}),Le.$set(uo);const ur={};u&2&&(ur.$$scope={dirty:u,ctx:t}),Ge.$set(ur);const mr={};u&2&&(mr.$$scope={dirty:u,ctx:t}),We.$set(mr);const fr={};u&2&&(fr.$$scope={dirty:u,ctx:t}),Ue.$set(fr);const mo={};u&2&&(mo.$$scope={dirty:u,ctx:t}),Ve.$set(mo);const _r={};u&2&&(_r.$$scope={dirty:u,ctx:t}),Je.$set(_r);const gr={};u&2&&(gr.$$scope={dirty:u,ctx:t}),Ye.$set(gr);const ot={};u&2&&(ot.$$scope={dirty:u,ctx:t}),Qe.$set(ot);const vr={};u&2&&(vr.$$scope={dirty:u,ctx:t}),Xe.$set(vr);const kr={};u&2&&(kr.$$scope={dirty:u,ctx:t}),et.$set(kr);const fo={};u&2&&(fo.$$scope={dirty:u,ctx:t}),tt.$set(fo)},i(t){Xr||(w(i.$$.fragment,t),w(lt.$$.fragment,t),w(ut.$$.fragment,t),w(mt.$$.fragment,t),w(ft.$$.fragment,t),w(gt.$$.fragment,t),w(vt.$$.fragment,t),w(bt.$$.fragment,t),w(yt.$$.fragment,t),w(wt.$$.fragment,t),w(Le.$$.fragment,t),w(Pt.$$.fragment,t),w($t.$$.fragment,t),w(qt.$$.fragment,t),w(zt.$$.fragment,t),w(Ft.$$.fragment,t),w(Et.$$.fragment,t),w(xt.$$.fragment,t),w(Mt.$$.fragment,t),w(Dt.$$.fragment,t),w(Ge.$$.fragment,t),w(We.$$.fragment,t),w(Lt.$$.fragment,t),w(jt.$$.fragment,t),w(Ht.$$.fragment,t),w(Ue.$$.fragment,t),w(Ve.$$.fragment,t),w(Ut.$$.fragment,t),w(Vt.$$.fragment,t),w(Qt.$$.fragment,t),w(Je.$$.fragment,t),w(Ye.$$.fragment,t),w(Xt.$$.fragment,t),w(Zt.$$.fragment,t),w(ro.$$.fragment,t),w(Qe.$$.fragment,t),w(Xe.$$.fragment,t),w(so.$$.fragment,t),w(ao.$$.fragment,t),w(ho.$$.fragment,t),w(et.$$.fragment,t),w(tt.$$.fragment,t),Xr=!0)},o(t){P(i.$$.fragment,t),P(lt.$$.fragment,t),P(ut.$$.fragment,t),P(mt.$$.fragment,t),P(ft.$$.fragment,t),P(gt.$$.fragment,t),P(vt.$$.fragment,t),P(bt.$$.fragment,t),P(yt.$$.fragment,t),P(wt.$$.fragment,t),P(Le.$$.fragment,t),P(Pt.$$.fragment,t),P($t.$$.fragment,t),P(qt.$$.fragment,t),P(zt.$$.fragment,t),P(Ft.$$.fragment,t),P(Et.$$.fragment,t),P(xt.$$.fragment,t),P(Mt.$$.fragment,t),P(Dt.$$.fragment,t),P(Ge.$$.fragment,t),P(We.$$.fragment,t),P(Lt.$$.fragment,t),P(jt.$$.fragment,t),P(Ht.$$.fragment,t),P(Ue.$$.fragment,t),P(Ve.$$.fragment,t),P(Ut.$$.fragment,t),P(Vt.$$.fragment,t),P(Qt.$$.fragment,t),P(Je.$$.fragment,t),P(Ye.$$.fragment,t),P(Xt.$$.fragment,t),P(Zt.$$.fragment,t),P(ro.$$.fragment,t),P(Qe.$$.fragment,t),P(Xe.$$.fragment,t),P(so.$$.fragment,t),P(ao.$$.fragment,t),P(ho.$$.fragment,t),P(et.$$.fragment,t),P(tt.$$.fragment,t),Xr=!1},d(t){o(h),t&&o(k),t&&o(g),N(i),t&&o(Tr),t&&o(te),t&&o(yr),t&&o(oe),t&&o(wr),t&&o(ne),N(lt),t&&o(Pr),t&&o(xe),t&&o(Nr),t&&o(bo),t&&o($r),t&&o(To),t&&o(qr),t&&o(yo),t&&o(zr),t&&o(wo),t&&o(Fr),t&&o(Me),t&&o(Er),t&&o(Oe),t&&o(xr),t&&o(re),N(ut),t&&o(Mr),t&&o(J),t&&o(Or),t&&o(se),N(mt),t&&o(Cr),t&&o(V),N(ft),t&&o(Sr),t&&o(ie),N(gt),t&&o(Ar),t&&o(F),N(vt),N(bt),N(yt),N(wt),N(Le),N(Pt),t&&o(Dr),t&&o(le),N($t),t&&o(Lr),t&&o(pe),N(qt),t&&o(jr),t&&o(he),N(zt),t&&o(Ir),t&&o(ue),N(Ft),t&&o(Br),t&&o(me),N(Et),t&&o(Gr),t&&o(fe),N(xt),t&&o(Wr),t&&o(M),N(Mt),N(Dt),N(Ge),N(We),t&&o(Hr),t&&o(ve),N(Lt),t&&o(Ur),t&&o(E),N(jt),N(Ht),N(Ue),N(Ve),t&&o(Vr),t&&o(Te),N(Ut),t&&o(Rr),t&&o(x),N(Vt),N(Qt),N(Je),N(Ye),t&&o(Jr),t&&o(Pe),N(Xt),t&&o(Yr),t&&o(O),N(Zt),N(ro),N(Qe),N(Xe),t&&o(Kr),t&&o(qe),N(so),t&&o(Qr),t&&o(C),N(ao),N(ho),N(et),N(tt)}}}const dh={local:"prophetnet",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.ProphetNetConfig",title:"ProphetNetConfig"},{local:"transformers.ProphetNetTokenizer",title:"ProphetNetTokenizer"},{local:"transformers.models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput",title:"ProphetNet specific outputs"},{local:"transformers.ProphetNetModel",title:"ProphetNetModel"},{local:"transformers.ProphetNetEncoder",title:"ProphetNetEncoder"},{local:"transformers.ProphetNetDecoder",title:"ProphetNetDecoder"},{local:"transformers.ProphetNetForConditionalGeneration",title:"ProphetNetForConditionalGeneration"},{local:"transformers.ProphetNetForCausalLM",title:"ProphetNetForCausalLM"}],title:"ProphetNet"};function ih($){return Jp(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class fh extends Hp{constructor(h){super();Up(this,h,ih,ah,Vp,{})}}export{fh as default,dh as metadata};
