import{S as Vc,i as Yc,s as Jc,e as n,k as c,w as b,t as a,M as Qc,c as r,d as o,m as p,a as s,x as y,h as i,b as l,N as Rc,G as e,g as f,y as T,q as w,o as P,B as M,v as Zc,L as Zn}from"../../chunks/vendor-hf-doc-builder.js";import{T as Jn}from"../../chunks/Tip-hf-doc-builder.js";import{D as q}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Kn}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ee}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Qn}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Kc(N){let h,v,_,g,k;return{c(){h=n("p"),v=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),k=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(d){h=r(d,"P",{});var m=s(h);v=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(m,"CODE",{});var L=s(_);g=i(L,"Module"),L.forEach(o),k=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(d,m){f(d,h,m),e(h,v),e(h,_),e(_,g),e(h,k)},d(d){d&&o(h)}}}function ep(N){let h,v,_,g,k;return g=new Kn({props:{code:`from transformers import AutoTokenizer, XLMProphetNetModel

tokenizer = AutoTokenizer.from_pretrained("patrickvonplaten/xprophetnet-large-uncased-standalone")
model = XLMProphetNetModel.from_pretrained("patrickvonplaten/xprophetnet-large-uncased-standalone")

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, XLMProphetNetModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;patrickvonplaten/xprophetnet-large-uncased-standalone&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMProphetNetModel.from_pretrained(<span class="hljs-string">&quot;patrickvonplaten/xprophetnet-large-uncased-standalone&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"),v=a("Example:"),_=c(),b(g.$$.fragment)},l(d){h=r(d,"P",{});var m=s(h);v=i(m,"Example:"),m.forEach(o),_=p(d),y(g.$$.fragment,d)},m(d,m){f(d,h,m),e(h,v),f(d,_,m),T(g,d,m),k=!0},p:Zn,i(d){k||(w(g.$$.fragment,d),k=!0)},o(d){P(g.$$.fragment,d),k=!1},d(d){d&&o(h),d&&o(_),M(g,d)}}}function tp(N){let h,v,_,g,k;return{c(){h=n("p"),v=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),k=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(d){h=r(d,"P",{});var m=s(h);v=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(m,"CODE",{});var L=s(_);g=i(L,"Module"),L.forEach(o),k=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(d,m){f(d,h,m),e(h,v),e(h,_),e(_,g),e(h,k)},d(d){d&&o(h)}}}function op(N){let h,v,_,g,k;return g=new Kn({props:{code:`from transformers import AutoTokenizer, XLMProphetNetEncoder
import torch

tokenizer = AutoTokenizer.from_pretrained("patrickvonplaten/xprophetnet-large-uncased-standalone")
model = XLMProphetNetEncoder.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, XLMProphetNetEncoder
<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;patrickvonplaten/xprophetnet-large-uncased-standalone&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMProphetNetEncoder.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"),v=a("Example:"),_=c(),b(g.$$.fragment)},l(d){h=r(d,"P",{});var m=s(h);v=i(m,"Example:"),m.forEach(o),_=p(d),y(g.$$.fragment,d)},m(d,m){f(d,h,m),e(h,v),f(d,_,m),T(g,d,m),k=!0},p:Zn,i(d){k||(w(g.$$.fragment,d),k=!0)},o(d){P(g.$$.fragment,d),k=!1},d(d){d&&o(h),d&&o(_),M(g,d)}}}function np(N){let h,v,_,g,k;return{c(){h=n("p"),v=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),k=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(d){h=r(d,"P",{});var m=s(h);v=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(m,"CODE",{});var L=s(_);g=i(L,"Module"),L.forEach(o),k=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(d,m){f(d,h,m),e(h,v),e(h,_),e(_,g),e(h,k)},d(d){d&&o(h)}}}function rp(N){let h,v,_,g,k;return g=new Kn({props:{code:`from transformers import AutoTokenizer, XLMProphetNetDecoder
import torch

tokenizer = AutoTokenizer.from_pretrained("patrickvonplaten/xprophetnet-large-uncased-standalone")
model = XLMProphetNetDecoder.from_pretrained(
    "patrickvonplaten/xprophetnet-large-uncased-standalone", 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, XLMProphetNetDecoder
<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;patrickvonplaten/xprophetnet-large-uncased-standalone&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMProphetNetDecoder.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;patrickvonplaten/xprophetnet-large-uncased-standalone&quot;</span>, add_cross_attention=<span class="hljs-literal">False</span>
<span class="hljs-meta">... </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"),v=a("Example:"),_=c(),b(g.$$.fragment)},l(d){h=r(d,"P",{});var m=s(h);v=i(m,"Example:"),m.forEach(o),_=p(d),y(g.$$.fragment,d)},m(d,m){f(d,h,m),e(h,v),f(d,_,m),T(g,d,m),k=!0},p:Zn,i(d){k||(w(g.$$.fragment,d),k=!0)},o(d){P(g.$$.fragment,d),k=!1},d(d){d&&o(h),d&&o(_),M(g,d)}}}function sp(N){let h,v,_,g,k;return{c(){h=n("p"),v=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),k=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(d){h=r(d,"P",{});var m=s(h);v=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(m,"CODE",{});var L=s(_);g=i(L,"Module"),L.forEach(o),k=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(d,m){f(d,h,m),e(h,v),e(h,_),e(_,g),e(h,k)},d(d){d&&o(h)}}}function ap(N){let h,v,_,g,k;return g=new Kn({props:{code:`from transformers import AutoTokenizer, XLMProphetNetForConditionalGeneration

tokenizer = AutoTokenizer.from_pretrained("patrickvonplaten/xprophetnet-large-uncased-standalone")
model = XLMProphetNetForConditionalGeneration.from_pretrained(
    "patrickvonplaten/xprophetnet-large-uncased-standalone"
)

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, XLMProphetNetForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;patrickvonplaten/xprophetnet-large-uncased-standalone&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMProphetNetForConditionalGeneration.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;patrickvonplaten/xprophetnet-large-uncased-standalone&quot;</span>
<span class="hljs-meta">... </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"),v=a("Example:"),_=c(),b(g.$$.fragment)},l(d){h=r(d,"P",{});var m=s(h);v=i(m,"Example:"),m.forEach(o),_=p(d),y(g.$$.fragment,d)},m(d,m){f(d,h,m),e(h,v),f(d,_,m),T(g,d,m),k=!0},p:Zn,i(d){k||(w(g.$$.fragment,d),k=!0)},o(d){P(g.$$.fragment,d),k=!1},d(d){d&&o(h),d&&o(_),M(g,d)}}}function ip(N){let h,v,_,g,k;return{c(){h=n("p"),v=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),k=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(d){h=r(d,"P",{});var m=s(h);v=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(m,"CODE",{});var L=s(_);g=i(L,"Module"),L.forEach(o),k=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(d,m){f(d,h,m),e(h,v),e(h,_),e(_,g),e(h,k)},d(d){d&&o(h)}}}function dp(N){let h,v,_,g,k;return g=new Kn({props:{code:`from transformers import AutoTokenizer, XLMProphetNetForCausalLM
import torch

tokenizer = AutoTokenizer.from_pretrained("patrickvonplaten/xprophetnet-large-uncased-standalone")
model = XLMProphetNetForCausalLM.from_pretrained("patrickvonplaten/xprophetnet-large-uncased-standalone")
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("patrickvonplaten/xprophetnet-large-uncased-standalone")
model = EncoderDecoderModel.from_encoder_decoder_pretrained(
    "bert-large-uncased", "patrickvonplaten/xprophetnet-large-uncased-standalone"
)

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, XLMProphetNetForCausalLM
<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;patrickvonplaten/xprophetnet-large-uncased-standalone&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMProphetNetForCausalLM.from_pretrained(<span class="hljs-string">&quot;patrickvonplaten/xprophetnet-large-uncased-standalone&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;patrickvonplaten/xprophetnet-large-uncased-standalone&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;patrickvonplaten/xprophetnet-large-uncased-standalone&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"),v=a("Example:"),_=c(),b(g.$$.fragment)},l(d){h=r(d,"P",{});var m=s(h);v=i(m,"Example:"),m.forEach(o),_=p(d),y(g.$$.fragment,d)},m(d,m){f(d,h,m),e(h,v),f(d,_,m),T(g,d,m),k=!0},p:Zn,i(d){k||(w(g.$$.fragment,d),k=!0)},o(d){P(g.$$.fragment,d),k=!1},d(d){d&&o(h),d&&o(_),M(g,d)}}}function lp(N){let h,v,_,g,k,d,m,L,es,er,te,oo,no,sl,ts,ro,so,al,tr,oe,Jo,os,ns,tt,rs,ss,or,ne,Pe,Qo,ot,as,Zo,is,nr,Me,ds,nt,ls,cs,rr,ao,ps,sr,io,hs,ar,lo,Ko,us,ir,Ne,ms,rt,fs,gs,dr,co,_s,lr,po,en,ks,cr,re,Le,tn,st,vs,on,bs,pr,R,nn,ho,ys,Ts,rn,uo,ws,Ps,sn,mo,Ms,hr,se,$e,an,at,Ns,dn,Ls,ur,H,it,$s,ae,zs,fo,xs,qs,dt,Xs,Es,Cs,ie,Fs,go,As,Os,_o,Ds,js,mr,de,ze,ln,lt,Ss,cn,Is,fr,$,ct,Bs,U,Gs,ko,Ws,Hs,vo,Us,Rs,pt,Vs,Ys,Js,ht,Qs,bo,Zs,Ks,ea,V,ut,ta,pn,oa,na,mt,yo,ra,hn,sa,aa,To,ia,un,da,la,xe,ft,ca,mn,pa,ha,qe,gt,ua,fn,ma,fa,Xe,_t,ga,kt,_a,gn,ka,va,gr,le,Ee,_n,vt,ba,kn,ya,_r,X,bt,Ta,yt,wa,wo,Pa,Ma,Na,ce,La,Tt,$a,za,vn,xa,qa,Xa,wt,Ea,Pt,Ca,Fa,Aa,D,Mt,Oa,pe,Da,Po,ja,Sa,bn,Ia,Ba,Ga,Ce,Wa,Fe,kr,he,Ae,yn,Nt,Ha,Tn,Ua,vr,z,Lt,Ra,$t,Va,Mo,Ya,Ja,Qa,ue,Za,zt,Ka,ei,wn,ti,oi,ni,xt,ri,qt,si,ai,ii,A,di,Pn,li,ci,Mn,pi,hi,Nn,ui,mi,No,fi,gi,_i,j,Xt,ki,me,vi,Lo,bi,yi,Ln,Ti,wi,Pi,Oe,Mi,De,br,fe,je,$n,Et,Ni,zn,Li,yr,x,Ct,$i,Ft,zi,$o,xi,qi,Xi,ge,Ei,At,Ci,Fi,xn,Ai,Oi,Di,Ot,ji,Dt,Si,Ii,Bi,O,Gi,qn,Wi,Hi,Xn,Ui,Ri,En,Vi,Yi,zo,Ji,Qi,Zi,S,jt,Ki,_e,ed,xo,td,od,Cn,nd,rd,sd,Se,ad,Ie,Tr,ke,Be,Fn,St,id,An,dd,wr,E,It,ld,Bt,cd,qo,pd,hd,ud,ve,md,Gt,fd,gd,On,_d,kd,vd,Wt,bd,Ht,yd,Td,wd,I,Ut,Pd,be,Md,Xo,Nd,Ld,Dn,$d,zd,xd,Ge,qd,We,Pr,ye,He,jn,Rt,Xd,Sn,Ed,Mr,C,Vt,Cd,Yt,Fd,Eo,Ad,Od,Dd,Te,jd,Jt,Sd,Id,In,Bd,Gd,Wd,Qt,Hd,Zt,Ud,Rd,Vd,B,Kt,Yd,we,Jd,Co,Qd,Zd,Bn,Kd,el,tl,Ue,ol,Re,Nr;return d=new ee({}),ot=new ee({}),st=new ee({}),at=new ee({}),it=new q({props:{name:"class transformers.XLMProphetNetConfig",anchor:"transformers.XLMProphetNetConfig",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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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/xlm-prophetnet#transformers.XLMProphetNetModel">XLMProphetNetModel</a>.`,name:"vocab_size"},{anchor:"transformers.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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.XLMProphetNetConfig.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/xlm_prophetnet/configuration_xlm_prophetnet.py#L33"}}),lt=new ee({}),ct=new q({props:{name:"class transformers.XLMProphetNetTokenizer",anchor:"transformers.XLMProphetNetTokenizer",parameters:[{name:"vocab_file",val:""},{name:"bos_token",val:" = '[SEP]'"},{name:"eos_token",val:" = '[SEP]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"unk_token",val:" = '[UNK]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XLMProphetNetTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.XLMProphetNetTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the beginning of
sequence. The token used is the <code>cls_token</code>.</p>

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

					</div>`,name:"eos_token"},{anchor:"transformers.XLMProphetNetTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.XLMProphetNetTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.XLMProphetNetTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.XLMProphetNetTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.XLMProphetNetTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&gt;&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.XLMProphetNetTokenizer.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>, defaults to <code>[&quot;&lt;s&gt;NOTUSED&quot;, &quot;&lt;/s&gt;NOTUSED&quot;]</code>) &#x2014;
Additional special tokens used by the tokenizer.`,name:"additional_special_tokens"},{anchor:"transformers.XLMProphetNetTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:</p>
<ul>
<li>
<p><code>enable_sampling</code>: Enable subword regularization.</p>
</li>
<li>
<p><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.</p>
<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul>
</li>
<li>
<p><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</p>
</li>
</ul>`,name:"sp_model_kwargs"},{anchor:"transformers.XLMProphetNetTokenizer.sp_model",description:`<strong>sp_model</strong> (<code>SentencePieceProcessor</code>) &#x2014;
The <em>SentencePiece</em> processor that is used for every conversion (string, tokens and IDs).`,name:"sp_model"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/xlm_prophetnet/tokenization_xlm_prophetnet.py#L59"}}),ut=new q({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.XLMProphetNetTokenizer.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.XLMProphetNetTokenizer.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.XLMProphetNetTokenizer.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/xlm_prophetnet/tokenization_xlm_prophetnet.py#L316",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>
`}}),ft=new q({props:{name:"convert_tokens_to_string",anchor:"transformers.XLMProphetNetTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/xlm_prophetnet/tokenization_xlm_prophetnet.py#L294"}}),gt=new q({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.XLMProphetNetTokenizer.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.XLMProphetNetTokenizer.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.XLMProphetNetTokenizer.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/xlm_prophetnet/tokenization_xlm_prophetnet.py#L243",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),_t=new q({props:{name:"get_special_tokens_mask",anchor:"transformers.XLMProphetNetTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.XLMProphetNetTokenizer.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.XLMProphetNetTokenizer.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.XLMProphetNetTokenizer.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/xlm_prophetnet/tokenization_xlm_prophetnet.py#L215",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>
`}}),vt=new ee({}),bt=new q({props:{name:"class transformers.XLMProphetNetModel",anchor:"transformers.XLMProphetNetModel",parameters:[{name:"config",val:": XLMProphetNetConfig"}],parametersDescription:[{anchor:"transformers.XLMProphetNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetConfig">XLMProphetNetConfig</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/xlm_prophetnet/modeling_xlm_prophetnet.py#L1770"}}),Mt=new q({props:{name:"forward",anchor:"transformers.XLMProphetNetModel.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.XLMProphetNetModel.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.XLMProphetNetModel.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.XLMProphetNetModel.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>XLMProphetNet 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.XLMProphetNetModel.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.XLMProphetNetModel.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.XLMProphetNetModel.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.XLMProphetNetModel.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.XLMProphetNetModel.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.XLMProphetNetModel.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.XLMProphetNetModel.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.XLMProphetNetModel.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.XLMProphetNetModel.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.XLMProphetNetModel.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/xlm_prophetnet/modeling_xlm_prophetnet.py#L1804",returnDescription:`
<p>A <code>transformers.models.xlm_prophetnet.modeling_xlm_prophetnet.XLMProphetNetSeq2SeqModelOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetConfig"
>XLMProphetNetConfig</a>) 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><code>transformers.models.xlm_prophetnet.modeling_xlm_prophetnet.XLMProphetNetSeq2SeqModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ce=new Jn({props:{$$slots:{default:[Kc]},$$scope:{ctx:N}}}),Fe=new Qn({props:{anchor:"transformers.XLMProphetNetModel.forward.example",$$slots:{default:[ep]},$$scope:{ctx:N}}}),Nt=new ee({}),Lt=new q({props:{name:"class transformers.XLMProphetNetEncoder",anchor:"transformers.XLMProphetNetEncoder",parameters:[{name:"config",val:": XLMProphetNetConfig"},{name:"word_embeddings",val:": Embedding = None"}],parametersDescription:[{anchor:"transformers.XLMProphetNetEncoder.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetConfig">XLMProphetNetConfig</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/xlm_prophetnet/modeling_xlm_prophetnet.py#L1252"}}),Xt=new q({props:{name:"forward",anchor:"transformers.XLMProphetNetEncoder.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.XLMProphetNetEncoder.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.XLMProphetNetEncoder.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.XLMProphetNetEncoder.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.XLMProphetNetEncoder.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.XLMProphetNetEncoder.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.XLMProphetNetEncoder.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/xlm_prophetnet/modeling_xlm_prophetnet.py#L1282",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 (<a
  href="/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetConfig"
>XLMProphetNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the 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>
`}}),Oe=new Jn({props:{$$slots:{default:[tp]},$$scope:{ctx:N}}}),De=new Qn({props:{anchor:"transformers.XLMProphetNetEncoder.forward.example",$$slots:{default:[op]},$$scope:{ctx:N}}}),Et=new ee({}),Ct=new q({props:{name:"class transformers.XLMProphetNetDecoder",anchor:"transformers.XLMProphetNetDecoder",parameters:[{name:"config",val:": XLMProphetNetConfig"},{name:"word_embeddings",val:": typing.Optional[torch.nn.modules.sparse.Embedding] = None"}],parametersDescription:[{anchor:"transformers.XLMProphetNetDecoder.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetConfig">XLMProphetNetConfig</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/xlm_prophetnet/modeling_xlm_prophetnet.py#L1393"}}),jt=new q({props:{name:"forward",anchor:"transformers.XLMProphetNetDecoder.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.XLMProphetNetDecoder.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.XLMProphetNetDecoder.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.XLMProphetNetDecoder.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.XLMProphetNetDecoder.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.XLMProphetNetDecoder.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.XLMProphetNetDecoder.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.XLMProphetNetDecoder.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.XLMProphetNetDecoder.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.XLMProphetNetDecoder.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.XLMProphetNetDecoder.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.XLMProphetNetDecoder.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/xlm_prophetnet/modeling_xlm_prophetnet.py#L1430",returnDescription:`
<p>A <code>transformers.models.xlm_prophetnet.modeling_xlm_prophetnet.XLMProphetNetDecoderModelOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetConfig"
>XLMProphetNetConfig</a>) 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><code>transformers.models.xlm_prophetnet.modeling_xlm_prophetnet.XLMProphetNetDecoderModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Se=new Jn({props:{$$slots:{default:[np]},$$scope:{ctx:N}}}),Ie=new Qn({props:{anchor:"transformers.XLMProphetNetDecoder.forward.example",$$slots:{default:[rp]},$$scope:{ctx:N}}}),St=new ee({}),It=new q({props:{name:"class transformers.XLMProphetNetForConditionalGeneration",anchor:"transformers.XLMProphetNetForConditionalGeneration",parameters:[{name:"config",val:": XLMProphetNetConfig"}],parametersDescription:[{anchor:"transformers.XLMProphetNetForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetConfig">XLMProphetNetConfig</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/xlm_prophetnet/modeling_xlm_prophetnet.py#L1900"}}),Ut=new q({props:{name:"forward",anchor:"transformers.XLMProphetNetForConditionalGeneration.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.XLMProphetNetForConditionalGeneration.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.XLMProphetNetForConditionalGeneration.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.XLMProphetNetForConditionalGeneration.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>XLMProphetNet 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.XLMProphetNetForConditionalGeneration.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.XLMProphetNetForConditionalGeneration.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.XLMProphetNetForConditionalGeneration.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.XLMProphetNetForConditionalGeneration.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.XLMProphetNetForConditionalGeneration.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.XLMProphetNetForConditionalGeneration.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.XLMProphetNetForConditionalGeneration.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.XLMProphetNetForConditionalGeneration.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.XLMProphetNetForConditionalGeneration.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.XLMProphetNetForConditionalGeneration.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.XLMProphetNetForConditionalGeneration.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/xlm_prophetnet/modeling_xlm_prophetnet.py#L1927",returnDescription:`
<p>A <code>transformers.models.xlm_prophetnet.modeling_xlm_prophetnet.XLMProphetNetSeq2SeqLMOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetConfig"
>XLMProphetNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 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><code>transformers.models.xlm_prophetnet.modeling_xlm_prophetnet.XLMProphetNetSeq2SeqLMOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ge=new Jn({props:{$$slots:{default:[sp]},$$scope:{ctx:N}}}),We=new Qn({props:{anchor:"transformers.XLMProphetNetForConditionalGeneration.forward.example",$$slots:{default:[ap]},$$scope:{ctx:N}}}),Rt=new ee({}),Vt=new q({props:{name:"class transformers.XLMProphetNetForCausalLM",anchor:"transformers.XLMProphetNetForCausalLM",parameters:[{name:"config",val:": XLMProphetNetConfig"}],parametersDescription:[{anchor:"transformers.XLMProphetNetForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetConfig">XLMProphetNetConfig</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/xlm_prophetnet/modeling_xlm_prophetnet.py#L2119"}}),Kt=new q({props:{name:"forward",anchor:"transformers.XLMProphetNetForCausalLM.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.XLMProphetNetForCausalLM.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.XLMProphetNetForCausalLM.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.XLMProphetNetForCausalLM.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.XLMProphetNetForCausalLM.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.XLMProphetNetForCausalLM.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.XLMProphetNetForCausalLM.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.XLMProphetNetForCausalLM.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.XLMProphetNetForCausalLM.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.XLMProphetNetForCausalLM.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.XLMProphetNetForCausalLM.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.XLMProphetNetForCausalLM.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.XLMProphetNetForCausalLM.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/xlm_prophetnet/modeling_xlm_prophetnet.py#L2156",returnDescription:`
<p>A <code>transformers.models.xlm_prophetnet.modeling_xlm_prophetnet.XLMProphetNetDecoderLMOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetConfig"
>XLMProphetNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 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><code>transformers.models.xlm_prophetnet.modeling_xlm_prophetnet.XLMProphetNetDecoderLMOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ue=new Jn({props:{$$slots:{default:[ip]},$$scope:{ctx:N}}}),Re=new Qn({props:{anchor:"transformers.XLMProphetNetForCausalLM.forward.example",$$slots:{default:[dp]},$$scope:{ctx:N}}}),{c(){h=n("meta"),v=c(),_=n("h1"),g=n("a"),k=n("span"),b(d.$$.fragment),m=c(),L=n("span"),es=a("XLM-ProphetNet"),er=c(),te=n("div"),oo=n("a"),no=n("img"),ts=c(),ro=n("a"),so=n("img"),tr=c(),oe=n("p"),Jo=n("strong"),os=a("DISCLAIMER:"),ns=a(" If you see something strange, file a "),tt=n("a"),rs=a("Github Issue"),ss=a(` and assign
@patrickvonplaten`),or=c(),ne=n("h2"),Pe=n("a"),Qo=n("span"),b(ot.$$.fragment),as=c(),Zo=n("span"),is=a("Overview"),nr=c(),Me=n("p"),ds=a("The XLM-ProphetNet model was proposed in "),nt=n("a"),ls=a("ProphetNet: Predicting Future N-gram for Sequence-to-Sequence Pre-training,"),cs=a(` by Yu Yan, Weizhen Qi, Yeyun Gong, Dayiheng Liu, Nan Duan, Jiusheng Chen, Ruofei
Zhang, Ming Zhou on 13 Jan, 2020.`),rr=c(),ao=n("p"),ps=a(`XLM-ProphetNet is an encoder-decoder model and can predict n-future tokens for \u201Cngram\u201D language modeling instead of
just the next token. Its architecture is identical to ProhpetNet, but the model was trained on the multi-lingual
\u201Cwiki100\u201D Wikipedia dump.`),sr=c(),io=n("p"),hs=a("The abstract from the paper is the following:"),ar=c(),lo=n("p"),Ko=n("em"),us=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.`),ir=c(),Ne=n("p"),ms=a("The Authors\u2019 code can be found "),rt=n("a"),fs=a("here"),gs=a("."),dr=c(),co=n("p"),_s=a("Tips:"),lr=c(),po=n("ul"),en=n("li"),ks=a("XLM-ProphetNet\u2019s model architecture and pretraining objective is same as ProphetNet, but XLM-ProphetNet was pre-trained on the cross-lingual dataset XGLUE."),cr=c(),re=n("h2"),Le=n("a"),tn=n("span"),b(st.$$.fragment),vs=c(),on=n("span"),bs=a("Documentation resources"),pr=c(),R=n("ul"),nn=n("li"),ho=n("a"),ys=a("Causal language modeling task guide"),Ts=c(),rn=n("li"),uo=n("a"),ws=a("Translation task guide"),Ps=c(),sn=n("li"),mo=n("a"),Ms=a("Summarization task guide"),hr=c(),se=n("h2"),$e=n("a"),an=n("span"),b(at.$$.fragment),Ns=c(),dn=n("span"),Ls=a("XLMProphetNetConfig"),ur=c(),H=n("div"),b(it.$$.fragment),$s=c(),ae=n("p"),zs=a("This is the configuration class to store the configuration of a "),fo=n("a"),xs=a("XLMProphetNetModel"),qs=a(`. It is used to instantiate a
XLMProphetNet 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 XLMProphetNet
`),dt=n("a"),Xs=a("microsoft/xprophetnet-large-wiki100-cased"),Es=a(`
architecture.`),Cs=c(),ie=n("p"),Fs=a("Configuration objects inherit from "),go=n("a"),As=a("PretrainedConfig"),Os=a(` and can be used to control the model outputs. Read the
documentation from `),_o=n("a"),Ds=a("PretrainedConfig"),js=a(" for more information."),mr=c(),de=n("h2"),ze=n("a"),ln=n("span"),b(lt.$$.fragment),Ss=c(),cn=n("span"),Is=a("XLMProphetNetTokenizer"),fr=c(),$=n("div"),b(ct.$$.fragment),Bs=c(),U=n("p"),Gs=a("Adapted from "),ko=n("a"),Ws=a("RobertaTokenizer"),Hs=a(" and "),vo=n("a"),Us=a("XLNetTokenizer"),Rs=a(`. Based on
`),pt=n("a"),Vs=a("SentencePiece"),Ys=a("."),Js=c(),ht=n("p"),Qs=a("This tokenizer inherits from "),bo=n("a"),Zs=a("PreTrainedTokenizer"),Ks=a(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),ea=c(),V=n("div"),b(ut.$$.fragment),ta=c(),pn=n("p"),oa=a(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A XLMProphetNet sequence has the following format:`),na=c(),mt=n("ul"),yo=n("li"),ra=a("single sequence: "),hn=n("code"),sa=a("X [SEP]"),aa=c(),To=n("li"),ia=a("pair of sequences: "),un=n("code"),da=a("A [SEP] B [SEP]"),la=c(),xe=n("div"),b(ft.$$.fragment),ca=c(),mn=n("p"),pa=a("Converts a sequence of tokens (strings for sub-words) in a single string."),ha=c(),qe=n("div"),b(gt.$$.fragment),ua=c(),fn=n("p"),ma=a(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. XLMProphetNet
does not make use of token type ids, therefore a list of zeros is returned.`),fa=c(),Xe=n("div"),b(_t.$$.fragment),ga=c(),kt=n("p"),_a=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 `),gn=n("code"),ka=a("prepare_for_model"),va=a(" method."),gr=c(),le=n("h2"),Ee=n("a"),_n=n("span"),b(vt.$$.fragment),ba=c(),kn=n("span"),ya=a("XLMProphetNetModel"),_r=c(),X=n("div"),b(bt.$$.fragment),Ta=c(),yt=n("p"),wa=a(`The bare XLMProphetNet Model outputting raw hidden-states without any specific head on top.
This model inherits from `),wo=n("a"),Pa=a("PreTrainedModel"),Ma=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.)`),Na=c(),ce=n("p"),La=a("Original ProphetNet code can be found "),Tt=n("a"),$a=a("here"),za=a(`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),vn=n("code"),xa=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),qa=a("."),Xa=c(),wt=n("p"),Ea=a("This model is a PyTorch "),Pt=n("a"),Ca=a("torch.nn.Module"),Fa=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.`),Aa=c(),D=n("div"),b(Mt.$$.fragment),Oa=c(),pe=n("p"),Da=a("The "),Po=n("a"),ja=a("XLMProphetNetModel"),Sa=a(" forward method, overrides the "),bn=n("code"),Ia=a("__call__"),Ba=a(" special method."),Ga=c(),b(Ce.$$.fragment),Wa=c(),b(Fe.$$.fragment),kr=c(),he=n("h2"),Ae=n("a"),yn=n("span"),b(Nt.$$.fragment),Ha=c(),Tn=n("span"),Ua=a("XLMProphetNetEncoder"),vr=c(),z=n("div"),b(Lt.$$.fragment),Ra=c(),$t=n("p"),Va=a(`The standalone encoder part of the XLMProphetNetModel.
This model inherits from `),Mo=n("a"),Ya=a("PreTrainedModel"),Ja=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.)`),Qa=c(),ue=n("p"),Za=a("Original ProphetNet code can be found "),zt=n("a"),Ka=a("here"),ei=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"),ti=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),oi=a("."),ni=c(),xt=n("p"),ri=a("This model is a PyTorch "),qt=n("a"),si=a("torch.nn.Module"),ai=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.`),ii=c(),A=n("p"),di=a("word_embeddings  ("),Pn=n("code"),li=a("torch.nn.Embeddings"),ci=a(" of shape "),Mn=n("code"),pi=a("(config.vocab_size, config.hidden_size)"),hi=a(", "),Nn=n("em"),ui=a("optional"),mi=a(`):
The word embedding parameters. This can be used to initialize `),No=n("a"),fi=a("XLMProphetNetEncoder"),gi=a(` with pre-defined word
embeddings instead of randomly initialized word embeddings.`),_i=c(),j=n("div"),b(Xt.$$.fragment),ki=c(),me=n("p"),vi=a("The "),Lo=n("a"),bi=a("XLMProphetNetEncoder"),yi=a(" forward method, overrides the "),Ln=n("code"),Ti=a("__call__"),wi=a(" special method."),Pi=c(),b(Oe.$$.fragment),Mi=c(),b(De.$$.fragment),br=c(),fe=n("h2"),je=n("a"),$n=n("span"),b(Et.$$.fragment),Ni=c(),zn=n("span"),Li=a("XLMProphetNetDecoder"),yr=c(),x=n("div"),b(Ct.$$.fragment),$i=c(),Ft=n("p"),zi=a(`The standalone decoder part of the XLMProphetNetModel.
This model inherits from `),$o=n("a"),xi=a("PreTrainedModel"),qi=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.)`),Xi=c(),ge=n("p"),Ei=a("Original ProphetNet code can be found "),At=n("a"),Ci=a("here"),Fi=a(`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),xn=n("code"),Ai=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Oi=a("."),Di=c(),Ot=n("p"),ji=a("This model is a PyTorch "),Dt=n("a"),Si=a("torch.nn.Module"),Ii=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.`),Bi=c(),O=n("p"),Gi=a("word_embeddings  ("),qn=n("code"),Wi=a("torch.nn.Embeddings"),Hi=a(" of shape "),Xn=n("code"),Ui=a("(config.vocab_size, config.hidden_size)"),Ri=a(", "),En=n("em"),Vi=a("optional"),Yi=a(`):
The word embedding parameters. This can be used to initialize `),zo=n("a"),Ji=a("XLMProphetNetEncoder"),Qi=a(` with pre-defined word
embeddings instead of randomly initialized word embeddings.`),Zi=c(),S=n("div"),b(jt.$$.fragment),Ki=c(),_e=n("p"),ed=a("The "),xo=n("a"),td=a("XLMProphetNetDecoder"),od=a(" forward method, overrides the "),Cn=n("code"),nd=a("__call__"),rd=a(" special method."),sd=c(),b(Se.$$.fragment),ad=c(),b(Ie.$$.fragment),Tr=c(),ke=n("h2"),Be=n("a"),Fn=n("span"),b(St.$$.fragment),id=c(),An=n("span"),dd=a("XLMProphetNetForConditionalGeneration"),wr=c(),E=n("div"),b(It.$$.fragment),ld=c(),Bt=n("p"),cd=a(`The XLMProphetNet Model with a language modeling head. Can be used for sequence generation tasks.
This model inherits from `),qo=n("a"),pd=a("PreTrainedModel"),hd=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.)`),ud=c(),ve=n("p"),md=a("Original ProphetNet code can be found "),Gt=n("a"),fd=a("here"),gd=a(`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),On=n("code"),_d=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),kd=a("."),vd=c(),Wt=n("p"),bd=a("This model is a PyTorch "),Ht=n("a"),yd=a("torch.nn.Module"),Td=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.`),wd=c(),I=n("div"),b(Ut.$$.fragment),Pd=c(),be=n("p"),Md=a("The "),Xo=n("a"),Nd=a("XLMProphetNetForConditionalGeneration"),Ld=a(" forward method, overrides the "),Dn=n("code"),$d=a("__call__"),zd=a(" special method."),xd=c(),b(Ge.$$.fragment),qd=c(),b(We.$$.fragment),Pr=c(),ye=n("h2"),He=n("a"),jn=n("span"),b(Rt.$$.fragment),Xd=c(),Sn=n("span"),Ed=a("XLMProphetNetForCausalLM"),Mr=c(),C=n("div"),b(Vt.$$.fragment),Cd=c(),Yt=n("p"),Fd=a(`The standalone decoder part of the XLMProphetNetModel with a lm head on top. The model can be used for causal language modeling.
This model inherits from `),Eo=n("a"),Ad=a("PreTrainedModel"),Od=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.)`),Dd=c(),Te=n("p"),jd=a("Original ProphetNet code can be found "),Jt=n("a"),Sd=a("here"),Id=a(`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),In=n("code"),Bd=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Gd=a("."),Wd=c(),Qt=n("p"),Hd=a("This model is a PyTorch "),Zt=n("a"),Ud=a("torch.nn.Module"),Rd=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.`),Vd=c(),B=n("div"),b(Kt.$$.fragment),Yd=c(),we=n("p"),Jd=a("The "),Co=n("a"),Qd=a("XLMProphetNetForCausalLM"),Zd=a(" forward method, overrides the "),Bn=n("code"),Kd=a("__call__"),el=a(" special method."),tl=c(),b(Ue.$$.fragment),ol=c(),b(Re.$$.fragment),this.h()},l(t){const u=Qc('[data-svelte="svelte-1phssyn"]',document.head);h=r(u,"META",{name:!0,content:!0}),u.forEach(o),v=p(t),_=r(t,"H1",{class:!0});var eo=s(_);g=r(eo,"A",{id:!0,class:!0,href:!0});var Gn=s(g);k=r(Gn,"SPAN",{});var Wn=s(k);y(d.$$.fragment,Wn),Wn.forEach(o),Gn.forEach(o),m=p(eo),L=r(eo,"SPAN",{});var Hn=s(L);es=i(Hn,"XLM-ProphetNet"),Hn.forEach(o),eo.forEach(o),er=p(t),te=r(t,"DIV",{class:!0});var to=s(te);oo=r(to,"A",{href:!0});var Un=s(oo);no=r(Un,"IMG",{alt:!0,src:!0}),Un.forEach(o),ts=p(to),ro=r(to,"A",{href:!0});var Rn=s(ro);so=r(Rn,"IMG",{alt:!0,src:!0}),Rn.forEach(o),to.forEach(o),tr=p(t),oe=r(t,"P",{});var Ve=s(oe);Jo=r(Ve,"STRONG",{});var Vn=s(Jo);os=i(Vn,"DISCLAIMER:"),Vn.forEach(o),ns=i(Ve," If you see something strange, file a "),tt=r(Ve,"A",{href:!0,rel:!0});var Yn=s(tt);rs=i(Yn,"Github Issue"),Yn.forEach(o),ss=i(Ve,` and assign
@patrickvonplaten`),Ve.forEach(o),or=p(t),ne=r(t,"H2",{class:!0});var Lr=s(ne);Pe=r(Lr,"A",{id:!0,class:!0,href:!0});var il=s(Pe);Qo=r(il,"SPAN",{});var dl=s(Qo);y(ot.$$.fragment,dl),dl.forEach(o),il.forEach(o),as=p(Lr),Zo=r(Lr,"SPAN",{});var ll=s(Zo);is=i(ll,"Overview"),ll.forEach(o),Lr.forEach(o),nr=p(t),Me=r(t,"P",{});var $r=s(Me);ds=i($r,"The XLM-ProphetNet model was proposed in "),nt=r($r,"A",{href:!0,rel:!0});var cl=s(nt);ls=i(cl,"ProphetNet: Predicting Future N-gram for Sequence-to-Sequence Pre-training,"),cl.forEach(o),cs=i($r,` by Yu Yan, Weizhen Qi, Yeyun Gong, Dayiheng Liu, Nan Duan, Jiusheng Chen, Ruofei
Zhang, Ming Zhou on 13 Jan, 2020.`),$r.forEach(o),rr=p(t),ao=r(t,"P",{});var pl=s(ao);ps=i(pl,`XLM-ProphetNet is an encoder-decoder model and can predict n-future tokens for \u201Cngram\u201D language modeling instead of
just the next token. Its architecture is identical to ProhpetNet, but the model was trained on the multi-lingual
\u201Cwiki100\u201D Wikipedia dump.`),pl.forEach(o),sr=p(t),io=r(t,"P",{});var hl=s(io);hs=i(hl,"The abstract from the paper is the following:"),hl.forEach(o),ar=p(t),lo=r(t,"P",{});var ul=s(lo);Ko=r(ul,"EM",{});var ml=s(Ko);us=i(ml,`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.`),ml.forEach(o),ul.forEach(o),ir=p(t),Ne=r(t,"P",{});var zr=s(Ne);ms=i(zr,"The Authors\u2019 code can be found "),rt=r(zr,"A",{href:!0,rel:!0});var fl=s(rt);fs=i(fl,"here"),fl.forEach(o),gs=i(zr,"."),zr.forEach(o),dr=p(t),co=r(t,"P",{});var gl=s(co);_s=i(gl,"Tips:"),gl.forEach(o),lr=p(t),po=r(t,"UL",{});var _l=s(po);en=r(_l,"LI",{});var kl=s(en);ks=i(kl,"XLM-ProphetNet\u2019s model architecture and pretraining objective is same as ProphetNet, but XLM-ProphetNet was pre-trained on the cross-lingual dataset XGLUE."),kl.forEach(o),_l.forEach(o),cr=p(t),re=r(t,"H2",{class:!0});var xr=s(re);Le=r(xr,"A",{id:!0,class:!0,href:!0});var vl=s(Le);tn=r(vl,"SPAN",{});var bl=s(tn);y(st.$$.fragment,bl),bl.forEach(o),vl.forEach(o),vs=p(xr),on=r(xr,"SPAN",{});var yl=s(on);bs=i(yl,"Documentation resources"),yl.forEach(o),xr.forEach(o),pr=p(t),R=r(t,"UL",{});var Fo=s(R);nn=r(Fo,"LI",{});var Tl=s(nn);ho=r(Tl,"A",{href:!0});var wl=s(ho);ys=i(wl,"Causal language modeling task guide"),wl.forEach(o),Tl.forEach(o),Ts=p(Fo),rn=r(Fo,"LI",{});var Pl=s(rn);uo=r(Pl,"A",{href:!0});var Ml=s(uo);ws=i(Ml,"Translation task guide"),Ml.forEach(o),Pl.forEach(o),Ps=p(Fo),sn=r(Fo,"LI",{});var Nl=s(sn);mo=r(Nl,"A",{href:!0});var Ll=s(mo);Ms=i(Ll,"Summarization task guide"),Ll.forEach(o),Nl.forEach(o),Fo.forEach(o),hr=p(t),se=r(t,"H2",{class:!0});var qr=s(se);$e=r(qr,"A",{id:!0,class:!0,href:!0});var $l=s($e);an=r($l,"SPAN",{});var zl=s(an);y(at.$$.fragment,zl),zl.forEach(o),$l.forEach(o),Ns=p(qr),dn=r(qr,"SPAN",{});var xl=s(dn);Ls=i(xl,"XLMProphetNetConfig"),xl.forEach(o),qr.forEach(o),ur=p(t),H=r(t,"DIV",{class:!0});var Ao=s(H);y(it.$$.fragment,Ao),$s=p(Ao),ae=r(Ao,"P",{});var Oo=s(ae);zs=i(Oo,"This is the configuration class to store the configuration of a "),fo=r(Oo,"A",{href:!0});var ql=s(fo);xs=i(ql,"XLMProphetNetModel"),ql.forEach(o),qs=i(Oo,`. It is used to instantiate a
XLMProphetNet 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 XLMProphetNet
`),dt=r(Oo,"A",{href:!0,rel:!0});var Xl=s(dt);Xs=i(Xl,"microsoft/xprophetnet-large-wiki100-cased"),Xl.forEach(o),Es=i(Oo,`
architecture.`),Oo.forEach(o),Cs=p(Ao),ie=r(Ao,"P",{});var Do=s(ie);Fs=i(Do,"Configuration objects inherit from "),go=r(Do,"A",{href:!0});var El=s(go);As=i(El,"PretrainedConfig"),El.forEach(o),Os=i(Do,` and can be used to control the model outputs. Read the
documentation from `),_o=r(Do,"A",{href:!0});var Cl=s(_o);Ds=i(Cl,"PretrainedConfig"),Cl.forEach(o),js=i(Do," for more information."),Do.forEach(o),Ao.forEach(o),mr=p(t),de=r(t,"H2",{class:!0});var Xr=s(de);ze=r(Xr,"A",{id:!0,class:!0,href:!0});var Fl=s(ze);ln=r(Fl,"SPAN",{});var Al=s(ln);y(lt.$$.fragment,Al),Al.forEach(o),Fl.forEach(o),Ss=p(Xr),cn=r(Xr,"SPAN",{});var Ol=s(cn);Is=i(Ol,"XLMProphetNetTokenizer"),Ol.forEach(o),Xr.forEach(o),fr=p(t),$=r(t,"DIV",{class:!0});var F=s($);y(ct.$$.fragment,F),Bs=p(F),U=r(F,"P",{});var Ye=s(U);Gs=i(Ye,"Adapted from "),ko=r(Ye,"A",{href:!0});var Dl=s(ko);Ws=i(Dl,"RobertaTokenizer"),Dl.forEach(o),Hs=i(Ye," and "),vo=r(Ye,"A",{href:!0});var jl=s(vo);Us=i(jl,"XLNetTokenizer"),jl.forEach(o),Rs=i(Ye,`. Based on
`),pt=r(Ye,"A",{href:!0,rel:!0});var Sl=s(pt);Vs=i(Sl,"SentencePiece"),Sl.forEach(o),Ys=i(Ye,"."),Ye.forEach(o),Js=p(F),ht=r(F,"P",{});var Er=s(ht);Qs=i(Er,"This tokenizer inherits from "),bo=r(Er,"A",{href:!0});var Il=s(bo);Zs=i(Il,"PreTrainedTokenizer"),Il.forEach(o),Ks=i(Er,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Er.forEach(o),ea=p(F),V=r(F,"DIV",{class:!0});var jo=s(V);y(ut.$$.fragment,jo),ta=p(jo),pn=r(jo,"P",{});var Bl=s(pn);oa=i(Bl,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A XLMProphetNet sequence has the following format:`),Bl.forEach(o),na=p(jo),mt=r(jo,"UL",{});var Cr=s(mt);yo=r(Cr,"LI",{});var nl=s(yo);ra=i(nl,"single sequence: "),hn=r(nl,"CODE",{});var Gl=s(hn);sa=i(Gl,"X [SEP]"),Gl.forEach(o),nl.forEach(o),aa=p(Cr),To=r(Cr,"LI",{});var rl=s(To);ia=i(rl,"pair of sequences: "),un=r(rl,"CODE",{});var Wl=s(un);da=i(Wl,"A [SEP] B [SEP]"),Wl.forEach(o),rl.forEach(o),Cr.forEach(o),jo.forEach(o),la=p(F),xe=r(F,"DIV",{class:!0});var Fr=s(xe);y(ft.$$.fragment,Fr),ca=p(Fr),mn=r(Fr,"P",{});var Hl=s(mn);pa=i(Hl,"Converts a sequence of tokens (strings for sub-words) in a single string."),Hl.forEach(o),Fr.forEach(o),ha=p(F),qe=r(F,"DIV",{class:!0});var Ar=s(qe);y(gt.$$.fragment,Ar),ua=p(Ar),fn=r(Ar,"P",{});var Ul=s(fn);ma=i(Ul,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. XLMProphetNet
does not make use of token type ids, therefore a list of zeros is returned.`),Ul.forEach(o),Ar.forEach(o),fa=p(F),Xe=r(F,"DIV",{class:!0});var Or=s(Xe);y(_t.$$.fragment,Or),ga=p(Or),kt=r(Or,"P",{});var Dr=s(kt);_a=i(Dr,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),gn=r(Dr,"CODE",{});var Rl=s(gn);ka=i(Rl,"prepare_for_model"),Rl.forEach(o),va=i(Dr," method."),Dr.forEach(o),Or.forEach(o),F.forEach(o),gr=p(t),le=r(t,"H2",{class:!0});var jr=s(le);Ee=r(jr,"A",{id:!0,class:!0,href:!0});var Vl=s(Ee);_n=r(Vl,"SPAN",{});var Yl=s(_n);y(vt.$$.fragment,Yl),Yl.forEach(o),Vl.forEach(o),ba=p(jr),kn=r(jr,"SPAN",{});var Jl=s(kn);ya=i(Jl,"XLMProphetNetModel"),Jl.forEach(o),jr.forEach(o),_r=p(t),X=r(t,"DIV",{class:!0});var Y=s(X);y(bt.$$.fragment,Y),Ta=p(Y),yt=r(Y,"P",{});var Sr=s(yt);wa=i(Sr,`The bare XLMProphetNet Model outputting raw hidden-states without any specific head on top.
This model inherits from `),wo=r(Sr,"A",{href:!0});var Ql=s(wo);Pa=i(Ql,"PreTrainedModel"),Ql.forEach(o),Ma=i(Sr,`. 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.)`),Sr.forEach(o),Na=p(Y),ce=r(Y,"P",{});var So=s(ce);La=i(So,"Original ProphetNet code can be found "),Tt=r(So,"A",{href:!0,rel:!0});var Zl=s(Tt);$a=i(Zl,"here"),Zl.forEach(o),za=i(So,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),vn=r(So,"CODE",{});var Kl=s(vn);xa=i(Kl,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Kl.forEach(o),qa=i(So,"."),So.forEach(o),Xa=p(Y),wt=r(Y,"P",{});var Ir=s(wt);Ea=i(Ir,"This model is a PyTorch "),Pt=r(Ir,"A",{href:!0,rel:!0});var ec=s(Pt);Ca=i(ec,"torch.nn.Module"),ec.forEach(o),Fa=i(Ir,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),Ir.forEach(o),Aa=p(Y),D=r(Y,"DIV",{class:!0});var Je=s(D);y(Mt.$$.fragment,Je),Oa=p(Je),pe=r(Je,"P",{});var Io=s(pe);Da=i(Io,"The "),Po=r(Io,"A",{href:!0});var tc=s(Po);ja=i(tc,"XLMProphetNetModel"),tc.forEach(o),Sa=i(Io," forward method, overrides the "),bn=r(Io,"CODE",{});var oc=s(bn);Ia=i(oc,"__call__"),oc.forEach(o),Ba=i(Io," special method."),Io.forEach(o),Ga=p(Je),y(Ce.$$.fragment,Je),Wa=p(Je),y(Fe.$$.fragment,Je),Je.forEach(o),Y.forEach(o),kr=p(t),he=r(t,"H2",{class:!0});var Br=s(he);Ae=r(Br,"A",{id:!0,class:!0,href:!0});var nc=s(Ae);yn=r(nc,"SPAN",{});var rc=s(yn);y(Nt.$$.fragment,rc),rc.forEach(o),nc.forEach(o),Ha=p(Br),Tn=r(Br,"SPAN",{});var sc=s(Tn);Ua=i(sc,"XLMProphetNetEncoder"),sc.forEach(o),Br.forEach(o),vr=p(t),z=r(t,"DIV",{class:!0});var G=s(z);y(Lt.$$.fragment,G),Ra=p(G),$t=r(G,"P",{});var Gr=s($t);Va=i(Gr,`The standalone encoder part of the XLMProphetNetModel.
This model inherits from `),Mo=r(Gr,"A",{href:!0});var ac=s(Mo);Ya=i(ac,"PreTrainedModel"),ac.forEach(o),Ja=i(Gr,`. 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.)`),Gr.forEach(o),Qa=p(G),ue=r(G,"P",{});var Bo=s(ue);Za=i(Bo,"Original ProphetNet code can be found "),zt=r(Bo,"A",{href:!0,rel:!0});var ic=s(zt);Ka=i(ic,"here"),ic.forEach(o),ei=i(Bo,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),wn=r(Bo,"CODE",{});var dc=s(wn);ti=i(dc,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),dc.forEach(o),oi=i(Bo,"."),Bo.forEach(o),ni=p(G),xt=r(G,"P",{});var Wr=s(xt);ri=i(Wr,"This model is a PyTorch "),qt=r(Wr,"A",{href:!0,rel:!0});var lc=s(qt);si=i(lc,"torch.nn.Module"),lc.forEach(o),ai=i(Wr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),Wr.forEach(o),ii=p(G),A=r(G,"P",{});var J=s(A);di=i(J,"word_embeddings  ("),Pn=r(J,"CODE",{});var cc=s(Pn);li=i(cc,"torch.nn.Embeddings"),cc.forEach(o),ci=i(J," of shape "),Mn=r(J,"CODE",{});var pc=s(Mn);pi=i(pc,"(config.vocab_size, config.hidden_size)"),pc.forEach(o),hi=i(J,", "),Nn=r(J,"EM",{});var hc=s(Nn);ui=i(hc,"optional"),hc.forEach(o),mi=i(J,`):
The word embedding parameters. This can be used to initialize `),No=r(J,"A",{href:!0});var uc=s(No);fi=i(uc,"XLMProphetNetEncoder"),uc.forEach(o),gi=i(J,` with pre-defined word
embeddings instead of randomly initialized word embeddings.`),J.forEach(o),_i=p(G),j=r(G,"DIV",{class:!0});var Qe=s(j);y(Xt.$$.fragment,Qe),ki=p(Qe),me=r(Qe,"P",{});var Go=s(me);vi=i(Go,"The "),Lo=r(Go,"A",{href:!0});var mc=s(Lo);bi=i(mc,"XLMProphetNetEncoder"),mc.forEach(o),yi=i(Go," forward method, overrides the "),Ln=r(Go,"CODE",{});var fc=s(Ln);Ti=i(fc,"__call__"),fc.forEach(o),wi=i(Go," special method."),Go.forEach(o),Pi=p(Qe),y(Oe.$$.fragment,Qe),Mi=p(Qe),y(De.$$.fragment,Qe),Qe.forEach(o),G.forEach(o),br=p(t),fe=r(t,"H2",{class:!0});var Hr=s(fe);je=r(Hr,"A",{id:!0,class:!0,href:!0});var gc=s(je);$n=r(gc,"SPAN",{});var _c=s($n);y(Et.$$.fragment,_c),_c.forEach(o),gc.forEach(o),Ni=p(Hr),zn=r(Hr,"SPAN",{});var kc=s(zn);Li=i(kc,"XLMProphetNetDecoder"),kc.forEach(o),Hr.forEach(o),yr=p(t),x=r(t,"DIV",{class:!0});var W=s(x);y(Ct.$$.fragment,W),$i=p(W),Ft=r(W,"P",{});var Ur=s(Ft);zi=i(Ur,`The standalone decoder part of the XLMProphetNetModel.
This model inherits from `),$o=r(Ur,"A",{href:!0});var vc=s($o);xi=i(vc,"PreTrainedModel"),vc.forEach(o),qi=i(Ur,`. 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.)`),Ur.forEach(o),Xi=p(W),ge=r(W,"P",{});var Wo=s(ge);Ei=i(Wo,"Original ProphetNet code can be found "),At=r(Wo,"A",{href:!0,rel:!0});var bc=s(At);Ci=i(bc,"here"),bc.forEach(o),Fi=i(Wo,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),xn=r(Wo,"CODE",{});var yc=s(xn);Ai=i(yc,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),yc.forEach(o),Oi=i(Wo,"."),Wo.forEach(o),Di=p(W),Ot=r(W,"P",{});var Rr=s(Ot);ji=i(Rr,"This model is a PyTorch "),Dt=r(Rr,"A",{href:!0,rel:!0});var Tc=s(Dt);Si=i(Tc,"torch.nn.Module"),Tc.forEach(o),Ii=i(Rr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),Rr.forEach(o),Bi=p(W),O=r(W,"P",{});var Q=s(O);Gi=i(Q,"word_embeddings  ("),qn=r(Q,"CODE",{});var wc=s(qn);Wi=i(wc,"torch.nn.Embeddings"),wc.forEach(o),Hi=i(Q," of shape "),Xn=r(Q,"CODE",{});var Pc=s(Xn);Ui=i(Pc,"(config.vocab_size, config.hidden_size)"),Pc.forEach(o),Ri=i(Q,", "),En=r(Q,"EM",{});var Mc=s(En);Vi=i(Mc,"optional"),Mc.forEach(o),Yi=i(Q,`):
The word embedding parameters. This can be used to initialize `),zo=r(Q,"A",{href:!0});var Nc=s(zo);Ji=i(Nc,"XLMProphetNetEncoder"),Nc.forEach(o),Qi=i(Q,` with pre-defined word
embeddings instead of randomly initialized word embeddings.`),Q.forEach(o),Zi=p(W),S=r(W,"DIV",{class:!0});var Ze=s(S);y(jt.$$.fragment,Ze),Ki=p(Ze),_e=r(Ze,"P",{});var Ho=s(_e);ed=i(Ho,"The "),xo=r(Ho,"A",{href:!0});var Lc=s(xo);td=i(Lc,"XLMProphetNetDecoder"),Lc.forEach(o),od=i(Ho," forward method, overrides the "),Cn=r(Ho,"CODE",{});var $c=s(Cn);nd=i($c,"__call__"),$c.forEach(o),rd=i(Ho," special method."),Ho.forEach(o),sd=p(Ze),y(Se.$$.fragment,Ze),ad=p(Ze),y(Ie.$$.fragment,Ze),Ze.forEach(o),W.forEach(o),Tr=p(t),ke=r(t,"H2",{class:!0});var Vr=s(ke);Be=r(Vr,"A",{id:!0,class:!0,href:!0});var zc=s(Be);Fn=r(zc,"SPAN",{});var xc=s(Fn);y(St.$$.fragment,xc),xc.forEach(o),zc.forEach(o),id=p(Vr),An=r(Vr,"SPAN",{});var qc=s(An);dd=i(qc,"XLMProphetNetForConditionalGeneration"),qc.forEach(o),Vr.forEach(o),wr=p(t),E=r(t,"DIV",{class:!0});var Z=s(E);y(It.$$.fragment,Z),ld=p(Z),Bt=r(Z,"P",{});var Yr=s(Bt);cd=i(Yr,`The XLMProphetNet Model with a language modeling head. Can be used for sequence generation tasks.
This model inherits from `),qo=r(Yr,"A",{href:!0});var Xc=s(qo);pd=i(Xc,"PreTrainedModel"),Xc.forEach(o),hd=i(Yr,`. 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.)`),Yr.forEach(o),ud=p(Z),ve=r(Z,"P",{});var Uo=s(ve);md=i(Uo,"Original ProphetNet code can be found "),Gt=r(Uo,"A",{href:!0,rel:!0});var Ec=s(Gt);fd=i(Ec,"here"),Ec.forEach(o),gd=i(Uo,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),On=r(Uo,"CODE",{});var Cc=s(On);_d=i(Cc,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Cc.forEach(o),kd=i(Uo,"."),Uo.forEach(o),vd=p(Z),Wt=r(Z,"P",{});var Jr=s(Wt);bd=i(Jr,"This model is a PyTorch "),Ht=r(Jr,"A",{href:!0,rel:!0});var Fc=s(Ht);yd=i(Fc,"torch.nn.Module"),Fc.forEach(o),Td=i(Jr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),Jr.forEach(o),wd=p(Z),I=r(Z,"DIV",{class:!0});var Ke=s(I);y(Ut.$$.fragment,Ke),Pd=p(Ke),be=r(Ke,"P",{});var Ro=s(be);Md=i(Ro,"The "),Xo=r(Ro,"A",{href:!0});var Ac=s(Xo);Nd=i(Ac,"XLMProphetNetForConditionalGeneration"),Ac.forEach(o),Ld=i(Ro," forward method, overrides the "),Dn=r(Ro,"CODE",{});var Oc=s(Dn);$d=i(Oc,"__call__"),Oc.forEach(o),zd=i(Ro," special method."),Ro.forEach(o),xd=p(Ke),y(Ge.$$.fragment,Ke),qd=p(Ke),y(We.$$.fragment,Ke),Ke.forEach(o),Z.forEach(o),Pr=p(t),ye=r(t,"H2",{class:!0});var Qr=s(ye);He=r(Qr,"A",{id:!0,class:!0,href:!0});var Dc=s(He);jn=r(Dc,"SPAN",{});var jc=s(jn);y(Rt.$$.fragment,jc),jc.forEach(o),Dc.forEach(o),Xd=p(Qr),Sn=r(Qr,"SPAN",{});var Sc=s(Sn);Ed=i(Sc,"XLMProphetNetForCausalLM"),Sc.forEach(o),Qr.forEach(o),Mr=p(t),C=r(t,"DIV",{class:!0});var K=s(C);y(Vt.$$.fragment,K),Cd=p(K),Yt=r(K,"P",{});var Zr=s(Yt);Fd=i(Zr,`The standalone decoder part of the XLMProphetNetModel with a lm head on top. The model can be used for causal language modeling.
This model inherits from `),Eo=r(Zr,"A",{href:!0});var Ic=s(Eo);Ad=i(Ic,"PreTrainedModel"),Ic.forEach(o),Od=i(Zr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Zr.forEach(o),Dd=p(K),Te=r(K,"P",{});var Vo=s(Te);jd=i(Vo,"Original ProphetNet code can be found "),Jt=r(Vo,"A",{href:!0,rel:!0});var Bc=s(Jt);Sd=i(Bc,"here"),Bc.forEach(o),Id=i(Vo,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),In=r(Vo,"CODE",{});var Gc=s(In);Bd=i(Gc,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Gc.forEach(o),Gd=i(Vo,"."),Vo.forEach(o),Wd=p(K),Qt=r(K,"P",{});var Kr=s(Qt);Hd=i(Kr,"This model is a PyTorch "),Zt=r(Kr,"A",{href:!0,rel:!0});var Wc=s(Zt);Ud=i(Wc,"torch.nn.Module"),Wc.forEach(o),Rd=i(Kr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),Kr.forEach(o),Vd=p(K),B=r(K,"DIV",{class:!0});var et=s(B);y(Kt.$$.fragment,et),Yd=p(et),we=r(et,"P",{});var Yo=s(we);Jd=i(Yo,"The "),Co=r(Yo,"A",{href:!0});var Hc=s(Co);Qd=i(Hc,"XLMProphetNetForCausalLM"),Hc.forEach(o),Zd=i(Yo," forward method, overrides the "),Bn=r(Yo,"CODE",{});var Uc=s(Bn);Kd=i(Uc,"__call__"),Uc.forEach(o),el=i(Yo," special method."),Yo.forEach(o),tl=p(et),y(Ue.$$.fragment,et),ol=p(et),y(Re.$$.fragment,et),et.forEach(o),K.forEach(o),this.h()},h(){l(h,"name","hf:doc:metadata"),l(h,"content",JSON.stringify(cp)),l(g,"id","xlmprophetnet"),l(g,"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"),l(g,"href","#xlmprophetnet"),l(_,"class","relative group"),l(no,"alt","Models"),Rc(no.src,sl="https://img.shields.io/badge/All_model_pages-xprophetnet-blueviolet")||l(no,"src",sl),l(oo,"href","https://huggingface.co/models?filter=xprophetnet"),l(so,"alt","Spaces"),Rc(so.src,al="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||l(so,"src",al),l(ro,"href","https://huggingface.co/spaces/docs-demos/xprophetnet-large-wiki100-cased-xglue-ntg"),l(te,"class","flex flex-wrap space-x-1"),l(tt,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),l(tt,"rel","nofollow"),l(Pe,"id","overview"),l(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Pe,"href","#overview"),l(ne,"class","relative group"),l(nt,"href","https://arxiv.org/abs/2001.04063"),l(nt,"rel","nofollow"),l(rt,"href","https://github.com/microsoft/ProphetNet"),l(rt,"rel","nofollow"),l(Le,"id","documentation-resources"),l(Le,"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"),l(Le,"href","#documentation-resources"),l(re,"class","relative group"),l(ho,"href","./tasks/language_modeling"),l(uo,"href","./tasks/translation"),l(mo,"href","./tasks/summarization"),l($e,"id","transformers.XLMProphetNetConfig"),l($e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l($e,"href","#transformers.XLMProphetNetConfig"),l(se,"class","relative group"),l(fo,"href","/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetModel"),l(dt,"href","https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased"),l(dt,"rel","nofollow"),l(go,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(_o,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ze,"id","transformers.XLMProphetNetTokenizer"),l(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"),l(ze,"href","#transformers.XLMProphetNetTokenizer"),l(de,"class","relative group"),l(ko,"href","/docs/transformers/v4.27.1/en/model_doc/roberta#transformers.RobertaTokenizer"),l(vo,"href","/docs/transformers/v4.27.1/en/model_doc/xlnet#transformers.XLNetTokenizer"),l(pt,"href","https://github.com/google/sentencepiece"),l(pt,"rel","nofollow"),l(bo,"href","/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ee,"id","transformers.XLMProphetNetModel"),l(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"),l(Ee,"href","#transformers.XLMProphetNetModel"),l(le,"class","relative group"),l(wo,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),l(Tt,"href","https://github.com/microsoft/ProphetNet"),l(Tt,"rel","nofollow"),l(Pt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Pt,"rel","nofollow"),l(Po,"href","/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetModel"),l(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ae,"id","transformers.XLMProphetNetEncoder"),l(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"),l(Ae,"href","#transformers.XLMProphetNetEncoder"),l(he,"class","relative group"),l(Mo,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),l(zt,"href","https://github.com/microsoft/ProphetNet"),l(zt,"rel","nofollow"),l(qt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(qt,"rel","nofollow"),l(No,"href","/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetEncoder"),l(Lo,"href","/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetEncoder"),l(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(je,"id","transformers.XLMProphetNetDecoder"),l(je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(je,"href","#transformers.XLMProphetNetDecoder"),l(fe,"class","relative group"),l($o,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),l(At,"href","https://github.com/microsoft/ProphetNet"),l(At,"rel","nofollow"),l(Dt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Dt,"rel","nofollow"),l(zo,"href","/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetEncoder"),l(xo,"href","/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetDecoder"),l(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Be,"id","transformers.XLMProphetNetForConditionalGeneration"),l(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"),l(Be,"href","#transformers.XLMProphetNetForConditionalGeneration"),l(ke,"class","relative group"),l(qo,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),l(Gt,"href","https://github.com/microsoft/ProphetNet"),l(Gt,"rel","nofollow"),l(Ht,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Ht,"rel","nofollow"),l(Xo,"href","/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetForConditionalGeneration"),l(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(He,"id","transformers.XLMProphetNetForCausalLM"),l(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"),l(He,"href","#transformers.XLMProphetNetForCausalLM"),l(ye,"class","relative group"),l(Eo,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),l(Jt,"href","https://github.com/microsoft/ProphetNet"),l(Jt,"rel","nofollow"),l(Zt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Zt,"rel","nofollow"),l(Co,"href","/docs/transformers/v4.27.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetForCausalLM"),l(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(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),f(t,v,u),f(t,_,u),e(_,g),e(g,k),T(d,k,null),e(_,m),e(_,L),e(L,es),f(t,er,u),f(t,te,u),e(te,oo),e(oo,no),e(te,ts),e(te,ro),e(ro,so),f(t,tr,u),f(t,oe,u),e(oe,Jo),e(Jo,os),e(oe,ns),e(oe,tt),e(tt,rs),e(oe,ss),f(t,or,u),f(t,ne,u),e(ne,Pe),e(Pe,Qo),T(ot,Qo,null),e(ne,as),e(ne,Zo),e(Zo,is),f(t,nr,u),f(t,Me,u),e(Me,ds),e(Me,nt),e(nt,ls),e(Me,cs),f(t,rr,u),f(t,ao,u),e(ao,ps),f(t,sr,u),f(t,io,u),e(io,hs),f(t,ar,u),f(t,lo,u),e(lo,Ko),e(Ko,us),f(t,ir,u),f(t,Ne,u),e(Ne,ms),e(Ne,rt),e(rt,fs),e(Ne,gs),f(t,dr,u),f(t,co,u),e(co,_s),f(t,lr,u),f(t,po,u),e(po,en),e(en,ks),f(t,cr,u),f(t,re,u),e(re,Le),e(Le,tn),T(st,tn,null),e(re,vs),e(re,on),e(on,bs),f(t,pr,u),f(t,R,u),e(R,nn),e(nn,ho),e(ho,ys),e(R,Ts),e(R,rn),e(rn,uo),e(uo,ws),e(R,Ps),e(R,sn),e(sn,mo),e(mo,Ms),f(t,hr,u),f(t,se,u),e(se,$e),e($e,an),T(at,an,null),e(se,Ns),e(se,dn),e(dn,Ls),f(t,ur,u),f(t,H,u),T(it,H,null),e(H,$s),e(H,ae),e(ae,zs),e(ae,fo),e(fo,xs),e(ae,qs),e(ae,dt),e(dt,Xs),e(ae,Es),e(H,Cs),e(H,ie),e(ie,Fs),e(ie,go),e(go,As),e(ie,Os),e(ie,_o),e(_o,Ds),e(ie,js),f(t,mr,u),f(t,de,u),e(de,ze),e(ze,ln),T(lt,ln,null),e(de,Ss),e(de,cn),e(cn,Is),f(t,fr,u),f(t,$,u),T(ct,$,null),e($,Bs),e($,U),e(U,Gs),e(U,ko),e(ko,Ws),e(U,Hs),e(U,vo),e(vo,Us),e(U,Rs),e(U,pt),e(pt,Vs),e(U,Ys),e($,Js),e($,ht),e(ht,Qs),e(ht,bo),e(bo,Zs),e(ht,Ks),e($,ea),e($,V),T(ut,V,null),e(V,ta),e(V,pn),e(pn,oa),e(V,na),e(V,mt),e(mt,yo),e(yo,ra),e(yo,hn),e(hn,sa),e(mt,aa),e(mt,To),e(To,ia),e(To,un),e(un,da),e($,la),e($,xe),T(ft,xe,null),e(xe,ca),e(xe,mn),e(mn,pa),e($,ha),e($,qe),T(gt,qe,null),e(qe,ua),e(qe,fn),e(fn,ma),e($,fa),e($,Xe),T(_t,Xe,null),e(Xe,ga),e(Xe,kt),e(kt,_a),e(kt,gn),e(gn,ka),e(kt,va),f(t,gr,u),f(t,le,u),e(le,Ee),e(Ee,_n),T(vt,_n,null),e(le,ba),e(le,kn),e(kn,ya),f(t,_r,u),f(t,X,u),T(bt,X,null),e(X,Ta),e(X,yt),e(yt,wa),e(yt,wo),e(wo,Pa),e(yt,Ma),e(X,Na),e(X,ce),e(ce,La),e(ce,Tt),e(Tt,$a),e(ce,za),e(ce,vn),e(vn,xa),e(ce,qa),e(X,Xa),e(X,wt),e(wt,Ea),e(wt,Pt),e(Pt,Ca),e(wt,Fa),e(X,Aa),e(X,D),T(Mt,D,null),e(D,Oa),e(D,pe),e(pe,Da),e(pe,Po),e(Po,ja),e(pe,Sa),e(pe,bn),e(bn,Ia),e(pe,Ba),e(D,Ga),T(Ce,D,null),e(D,Wa),T(Fe,D,null),f(t,kr,u),f(t,he,u),e(he,Ae),e(Ae,yn),T(Nt,yn,null),e(he,Ha),e(he,Tn),e(Tn,Ua),f(t,vr,u),f(t,z,u),T(Lt,z,null),e(z,Ra),e(z,$t),e($t,Va),e($t,Mo),e(Mo,Ya),e($t,Ja),e(z,Qa),e(z,ue),e(ue,Za),e(ue,zt),e(zt,Ka),e(ue,ei),e(ue,wn),e(wn,ti),e(ue,oi),e(z,ni),e(z,xt),e(xt,ri),e(xt,qt),e(qt,si),e(xt,ai),e(z,ii),e(z,A),e(A,di),e(A,Pn),e(Pn,li),e(A,ci),e(A,Mn),e(Mn,pi),e(A,hi),e(A,Nn),e(Nn,ui),e(A,mi),e(A,No),e(No,fi),e(A,gi),e(z,_i),e(z,j),T(Xt,j,null),e(j,ki),e(j,me),e(me,vi),e(me,Lo),e(Lo,bi),e(me,yi),e(me,Ln),e(Ln,Ti),e(me,wi),e(j,Pi),T(Oe,j,null),e(j,Mi),T(De,j,null),f(t,br,u),f(t,fe,u),e(fe,je),e(je,$n),T(Et,$n,null),e(fe,Ni),e(fe,zn),e(zn,Li),f(t,yr,u),f(t,x,u),T(Ct,x,null),e(x,$i),e(x,Ft),e(Ft,zi),e(Ft,$o),e($o,xi),e(Ft,qi),e(x,Xi),e(x,ge),e(ge,Ei),e(ge,At),e(At,Ci),e(ge,Fi),e(ge,xn),e(xn,Ai),e(ge,Oi),e(x,Di),e(x,Ot),e(Ot,ji),e(Ot,Dt),e(Dt,Si),e(Ot,Ii),e(x,Bi),e(x,O),e(O,Gi),e(O,qn),e(qn,Wi),e(O,Hi),e(O,Xn),e(Xn,Ui),e(O,Ri),e(O,En),e(En,Vi),e(O,Yi),e(O,zo),e(zo,Ji),e(O,Qi),e(x,Zi),e(x,S),T(jt,S,null),e(S,Ki),e(S,_e),e(_e,ed),e(_e,xo),e(xo,td),e(_e,od),e(_e,Cn),e(Cn,nd),e(_e,rd),e(S,sd),T(Se,S,null),e(S,ad),T(Ie,S,null),f(t,Tr,u),f(t,ke,u),e(ke,Be),e(Be,Fn),T(St,Fn,null),e(ke,id),e(ke,An),e(An,dd),f(t,wr,u),f(t,E,u),T(It,E,null),e(E,ld),e(E,Bt),e(Bt,cd),e(Bt,qo),e(qo,pd),e(Bt,hd),e(E,ud),e(E,ve),e(ve,md),e(ve,Gt),e(Gt,fd),e(ve,gd),e(ve,On),e(On,_d),e(ve,kd),e(E,vd),e(E,Wt),e(Wt,bd),e(Wt,Ht),e(Ht,yd),e(Wt,Td),e(E,wd),e(E,I),T(Ut,I,null),e(I,Pd),e(I,be),e(be,Md),e(be,Xo),e(Xo,Nd),e(be,Ld),e(be,Dn),e(Dn,$d),e(be,zd),e(I,xd),T(Ge,I,null),e(I,qd),T(We,I,null),f(t,Pr,u),f(t,ye,u),e(ye,He),e(He,jn),T(Rt,jn,null),e(ye,Xd),e(ye,Sn),e(Sn,Ed),f(t,Mr,u),f(t,C,u),T(Vt,C,null),e(C,Cd),e(C,Yt),e(Yt,Fd),e(Yt,Eo),e(Eo,Ad),e(Yt,Od),e(C,Dd),e(C,Te),e(Te,jd),e(Te,Jt),e(Jt,Sd),e(Te,Id),e(Te,In),e(In,Bd),e(Te,Gd),e(C,Wd),e(C,Qt),e(Qt,Hd),e(Qt,Zt),e(Zt,Ud),e(Qt,Rd),e(C,Vd),e(C,B),T(Kt,B,null),e(B,Yd),e(B,we),e(we,Jd),e(we,Co),e(Co,Qd),e(we,Zd),e(we,Bn),e(Bn,Kd),e(we,el),e(B,tl),T(Ue,B,null),e(B,ol),T(Re,B,null),Nr=!0},p(t,[u]){const eo={};u&2&&(eo.$$scope={dirty:u,ctx:t}),Ce.$set(eo);const Gn={};u&2&&(Gn.$$scope={dirty:u,ctx:t}),Fe.$set(Gn);const Wn={};u&2&&(Wn.$$scope={dirty:u,ctx:t}),Oe.$set(Wn);const Hn={};u&2&&(Hn.$$scope={dirty:u,ctx:t}),De.$set(Hn);const to={};u&2&&(to.$$scope={dirty:u,ctx:t}),Se.$set(to);const Un={};u&2&&(Un.$$scope={dirty:u,ctx:t}),Ie.$set(Un);const Rn={};u&2&&(Rn.$$scope={dirty:u,ctx:t}),Ge.$set(Rn);const Ve={};u&2&&(Ve.$$scope={dirty:u,ctx:t}),We.$set(Ve);const Vn={};u&2&&(Vn.$$scope={dirty:u,ctx:t}),Ue.$set(Vn);const Yn={};u&2&&(Yn.$$scope={dirty:u,ctx:t}),Re.$set(Yn)},i(t){Nr||(w(d.$$.fragment,t),w(ot.$$.fragment,t),w(st.$$.fragment,t),w(at.$$.fragment,t),w(it.$$.fragment,t),w(lt.$$.fragment,t),w(ct.$$.fragment,t),w(ut.$$.fragment,t),w(ft.$$.fragment,t),w(gt.$$.fragment,t),w(_t.$$.fragment,t),w(vt.$$.fragment,t),w(bt.$$.fragment,t),w(Mt.$$.fragment,t),w(Ce.$$.fragment,t),w(Fe.$$.fragment,t),w(Nt.$$.fragment,t),w(Lt.$$.fragment,t),w(Xt.$$.fragment,t),w(Oe.$$.fragment,t),w(De.$$.fragment,t),w(Et.$$.fragment,t),w(Ct.$$.fragment,t),w(jt.$$.fragment,t),w(Se.$$.fragment,t),w(Ie.$$.fragment,t),w(St.$$.fragment,t),w(It.$$.fragment,t),w(Ut.$$.fragment,t),w(Ge.$$.fragment,t),w(We.$$.fragment,t),w(Rt.$$.fragment,t),w(Vt.$$.fragment,t),w(Kt.$$.fragment,t),w(Ue.$$.fragment,t),w(Re.$$.fragment,t),Nr=!0)},o(t){P(d.$$.fragment,t),P(ot.$$.fragment,t),P(st.$$.fragment,t),P(at.$$.fragment,t),P(it.$$.fragment,t),P(lt.$$.fragment,t),P(ct.$$.fragment,t),P(ut.$$.fragment,t),P(ft.$$.fragment,t),P(gt.$$.fragment,t),P(_t.$$.fragment,t),P(vt.$$.fragment,t),P(bt.$$.fragment,t),P(Mt.$$.fragment,t),P(Ce.$$.fragment,t),P(Fe.$$.fragment,t),P(Nt.$$.fragment,t),P(Lt.$$.fragment,t),P(Xt.$$.fragment,t),P(Oe.$$.fragment,t),P(De.$$.fragment,t),P(Et.$$.fragment,t),P(Ct.$$.fragment,t),P(jt.$$.fragment,t),P(Se.$$.fragment,t),P(Ie.$$.fragment,t),P(St.$$.fragment,t),P(It.$$.fragment,t),P(Ut.$$.fragment,t),P(Ge.$$.fragment,t),P(We.$$.fragment,t),P(Rt.$$.fragment,t),P(Vt.$$.fragment,t),P(Kt.$$.fragment,t),P(Ue.$$.fragment,t),P(Re.$$.fragment,t),Nr=!1},d(t){o(h),t&&o(v),t&&o(_),M(d),t&&o(er),t&&o(te),t&&o(tr),t&&o(oe),t&&o(or),t&&o(ne),M(ot),t&&o(nr),t&&o(Me),t&&o(rr),t&&o(ao),t&&o(sr),t&&o(io),t&&o(ar),t&&o(lo),t&&o(ir),t&&o(Ne),t&&o(dr),t&&o(co),t&&o(lr),t&&o(po),t&&o(cr),t&&o(re),M(st),t&&o(pr),t&&o(R),t&&o(hr),t&&o(se),M(at),t&&o(ur),t&&o(H),M(it),t&&o(mr),t&&o(de),M(lt),t&&o(fr),t&&o($),M(ct),M(ut),M(ft),M(gt),M(_t),t&&o(gr),t&&o(le),M(vt),t&&o(_r),t&&o(X),M(bt),M(Mt),M(Ce),M(Fe),t&&o(kr),t&&o(he),M(Nt),t&&o(vr),t&&o(z),M(Lt),M(Xt),M(Oe),M(De),t&&o(br),t&&o(fe),M(Et),t&&o(yr),t&&o(x),M(Ct),M(jt),M(Se),M(Ie),t&&o(Tr),t&&o(ke),M(St),t&&o(wr),t&&o(E),M(It),M(Ut),M(Ge),M(We),t&&o(Pr),t&&o(ye),M(Rt),t&&o(Mr),t&&o(C),M(Vt),M(Kt),M(Ue),M(Re)}}}const cp={local:"xlmprophetnet",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.XLMProphetNetConfig",title:"XLMProphetNetConfig"},{local:"transformers.XLMProphetNetTokenizer",title:"XLMProphetNetTokenizer"},{local:"transformers.XLMProphetNetModel",title:"XLMProphetNetModel"},{local:"transformers.XLMProphetNetEncoder",title:"XLMProphetNetEncoder"},{local:"transformers.XLMProphetNetDecoder",title:"XLMProphetNetDecoder"},{local:"transformers.XLMProphetNetForConditionalGeneration",title:"XLMProphetNetForConditionalGeneration"},{local:"transformers.XLMProphetNetForCausalLM",title:"XLMProphetNetForCausalLM"}],title:"XLM-ProphetNet"};function pp(N){return Zc(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class kp extends Vc{constructor(h){super();Yc(this,h,pp,lp,Jc,{})}}export{kp as default,cp as metadata};
