import{S as Dc,i as Sc,s as Hc,e as n,k as c,w as k,t as a,M as Yc,c as r,d as o,m as h,a as s,x as M,h as d,b as l,N as Oc,G as e,g as f,y,q as T,o as w,B as N,v as Qc,L as Qn}from"../../chunks/vendor-hf-doc-builder.js";import{T as Hn}from"../../chunks/Tip-hf-doc-builder.js";import{D as E}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 Yn}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Kc(P){let p,b,_,g,v;return{c(){p=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){p=r(i,"P",{});var m=s(p);b=d(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(m,"CODE",{});var X=s(_);g=d(X,"Module"),X.forEach(o),v=d(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(i,m){f(i,p,m),e(p,b),e(p,_),e(_,g),e(p,v)},d(i){i&&o(p)}}}function eh(P){let p,b,_,g,v;return g=new Kn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBYTE1Qcm9waGV0TmV0TW9kZWwlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJwYXRyaWNrdm9ucGxhdGVuJTJGeHByb3BoZXRuZXQtbGFyZ2UtdW5jYXNlZC1zdGFuZGFsb25lJTIyKSUwQW1vZGVsJTIwJTNEJTIwWExNUHJvcGhldE5ldE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJwYXRyaWNrdm9ucGxhdGVuJTJGeHByb3BoZXRuZXQtbGFyZ2UtdW5jYXNlZC1zdGFuZGFsb25lJTIyKSUwQSUwQWlucHV0X2lkcyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlMjJTdHVkaWVzJTIwaGF2ZSUyMGJlZW4lMjBzaG93biUyMHRoYXQlMjBvd25pbmclMjBhJTIwZG9nJTIwaXMlMjBnb29kJTIwZm9yJTIweW91JTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUwQSkuaW5wdXRfaWRzJTIwJTIwJTIzJTIwQmF0Y2glMjBzaXplJTIwMSUwQWRlY29kZXJfaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlN0dWRpZXMlMjBzaG93JTIwdGhhdCUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLmlucHV0X2lkcyUyMCUyMCUyMyUyMEJhdGNoJTIwc2l6ZSUyMDElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRfaWRzJTNEaW5wdXRfaWRzJTJDJTIwZGVjb2Rlcl9pbnB1dF9pZHMlM0RkZWNvZGVyX2lucHV0X2lkcyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTIwJTIwJTIzJTIwbWFpbiUyMHN0cmVhbSUyMGhpZGRlbiUyMHN0YXRlcyUwQWxhc3RfaGlkZGVuX3N0YXRlc19uZ3JhbSUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGVfbmdyYW0lMjAlMjAlMjMlMjBwcmVkaWN0JTIwaGlkZGVuJTIwc3RhdGVz",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(){p=n("p"),b=a("Example:"),_=c(),k(g.$$.fragment)},l(i){p=r(i,"P",{});var m=s(p);b=d(m,"Example:"),m.forEach(o),_=h(i),M(g.$$.fragment,i)},m(i,m){f(i,p,m),e(p,b),f(i,_,m),y(g,i,m),v=!0},p:Qn,i(i){v||(T(g.$$.fragment,i),v=!0)},o(i){w(g.$$.fragment,i),v=!1},d(i){i&&o(p),i&&o(_),N(g,i)}}}function th(P){let p,b,_,g,v;return{c(){p=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){p=r(i,"P",{});var m=s(p);b=d(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(m,"CODE",{});var X=s(_);g=d(X,"Module"),X.forEach(o),v=d(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(i,m){f(i,p,m),e(p,b),e(p,_),e(_,g),e(p,v)},d(i){i&&o(p)}}}function oh(P){let p,b,_,g,v;return g=new Kn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBYTE1Qcm9waGV0TmV0RW5jb2RlciUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIycGF0cmlja3ZvbnBsYXRlbiUyRnhwcm9waGV0bmV0LWxhcmdlLXVuY2FzZWQtc3RhbmRhbG9uZSUyMiklMEFtb2RlbCUyMCUzRCUyMFhMTVByb3BoZXROZXRFbmNvZGVyLmZyb21fcHJldHJhaW5lZCglMjJwYXRyaWNrdm9ucGxhdGVuJTJGcHJvcGhldG5ldC1sYXJnZS11bmNhc2VkLXN0YW5kYWxvbmUlMjIpJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",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(){p=n("p"),b=a("Example:"),_=c(),k(g.$$.fragment)},l(i){p=r(i,"P",{});var m=s(p);b=d(m,"Example:"),m.forEach(o),_=h(i),M(g.$$.fragment,i)},m(i,m){f(i,p,m),e(p,b),f(i,_,m),y(g,i,m),v=!0},p:Qn,i(i){v||(T(g.$$.fragment,i),v=!0)},o(i){w(g.$$.fragment,i),v=!1},d(i){i&&o(p),i&&o(_),N(g,i)}}}function nh(P){let p,b,_,g,v;return{c(){p=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){p=r(i,"P",{});var m=s(p);b=d(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(m,"CODE",{});var X=s(_);g=d(X,"Module"),X.forEach(o),v=d(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(i,m){f(i,p,m),e(p,b),e(p,_),e(_,g),e(p,v)},d(i){i&&o(p)}}}function rh(P){let p,b,_,g,v;return g=new Kn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBYTE1Qcm9waGV0TmV0RGVjb2RlciUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIycGF0cmlja3ZvbnBsYXRlbiUyRnhwcm9waGV0bmV0LWxhcmdlLXVuY2FzZWQtc3RhbmRhbG9uZSUyMiklMEFtb2RlbCUyMCUzRCUyMFhMTVByb3BoZXROZXREZWNvZGVyLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJwYXRyaWNrdm9ucGxhdGVuJTJGeHByb3BoZXRuZXQtbGFyZ2UtdW5jYXNlZC1zdGFuZGFsb25lJTIyJTJDJTIwYWRkX2Nyb3NzX2F0dGVudGlvbiUzREZhbHNlJTBBKSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",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(){p=n("p"),b=a("Example:"),_=c(),k(g.$$.fragment)},l(i){p=r(i,"P",{});var m=s(p);b=d(m,"Example:"),m.forEach(o),_=h(i),M(g.$$.fragment,i)},m(i,m){f(i,p,m),e(p,b),f(i,_,m),y(g,i,m),v=!0},p:Qn,i(i){v||(T(g.$$.fragment,i),v=!0)},o(i){w(g.$$.fragment,i),v=!1},d(i){i&&o(p),i&&o(_),N(g,i)}}}function sh(P){let p,b,_,g,v;return{c(){p=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){p=r(i,"P",{});var m=s(p);b=d(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(m,"CODE",{});var X=s(_);g=d(X,"Module"),X.forEach(o),v=d(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(i,m){f(i,p,m),e(p,b),e(p,_),e(_,g),e(p,v)},d(i){i&&o(p)}}}function ah(P){let p,b,_,g,v;return g=new Kn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBYTE1Qcm9waGV0TmV0Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIycGF0cmlja3ZvbnBsYXRlbiUyRnhwcm9waGV0bmV0LWxhcmdlLXVuY2FzZWQtc3RhbmRhbG9uZSUyMiklMEFtb2RlbCUyMCUzRCUyMFhMTVByb3BoZXROZXRGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnBhdHJpY2t2b25wbGF0ZW4lMkZ4cHJvcGhldG5ldC1sYXJnZS11bmNhc2VkLXN0YW5kYWxvbmUlMjIlMEEpJTBBJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKCUwQSUyMCUyMCUyMCUyMCUyMlN0dWRpZXMlMjBoYXZlJTIwYmVlbiUyMHNob3duJTIwdGhhdCUyMG93bmluZyUyMGElMjBkb2clMjBpcyUyMGdvb2QlMjBmb3IlMjB5b3UlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTBBKS5pbnB1dF9pZHMlMjAlMjAlMjMlMjBCYXRjaCUyMHNpemUlMjAxJTBBZGVjb2Rlcl9pbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyU3R1ZGllcyUyMHNob3clMjB0aGF0JTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikuaW5wdXRfaWRzJTIwJTIwJTIzJTIwQmF0Y2glMjBzaXplJTIwMSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dF9pZHMlM0RpbnB1dF9pZHMlMkMlMjBkZWNvZGVyX2lucHV0X2lkcyUzRGRlY29kZXJfaW5wdXRfaWRzKSUwQSUwQWxvZ2l0c19uZXh0X3Rva2VuJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlMjAlMjAlMjMlMjBsb2dpdHMlMjB0byUyMHByZWRpY3QlMjBuZXh0JTIwdG9rZW4lMjBhcyUyMHVzdWFsJTBBbG9naXRzX25ncmFtX25leHRfdG9rZW5zJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHNfbmdyYW0lMjAlMjAlMjMlMjBsb2dpdHMlMjB0byUyMHByZWRpY3QlMjAybmQlMkMlMjAzcmQlMkMlMjAuLi4lMjBuZXh0JTIwdG9rZW5z",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(){p=n("p"),b=a("Example:"),_=c(),k(g.$$.fragment)},l(i){p=r(i,"P",{});var m=s(p);b=d(m,"Example:"),m.forEach(o),_=h(i),M(g.$$.fragment,i)},m(i,m){f(i,p,m),e(p,b),f(i,_,m),y(g,i,m),v=!0},p:Qn,i(i){v||(T(g.$$.fragment,i),v=!0)},o(i){w(g.$$.fragment,i),v=!1},d(i){i&&o(p),i&&o(_),N(g,i)}}}function dh(P){let p,b,_,g,v;return{c(){p=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){p=r(i,"P",{});var m=s(p);b=d(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(m,"CODE",{});var X=s(_);g=d(X,"Module"),X.forEach(o),v=d(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(i,m){f(i,p,m),e(p,b),e(p,_),e(_,g),e(p,v)},d(i){i&&o(p)}}}function ih(P){let p,b,_,g,v;return g=new Kn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBYTE1Qcm9waGV0TmV0Rm9yQ2F1c2FsTE0lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnBhdHJpY2t2b25wbGF0ZW4lMkZ4cHJvcGhldG5ldC1sYXJnZS11bmNhc2VkLXN0YW5kYWxvbmUlMjIpJTBBbW9kZWwlMjAlM0QlMjBYTE1Qcm9waGV0TmV0Rm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMnBhdHJpY2t2b25wbGF0ZW4lMkZ4cHJvcGhldG5ldC1sYXJnZS11bmNhc2VkLXN0YW5kYWxvbmUlMjIpJTBBYXNzZXJ0JTIwbW9kZWwuY29uZmlnLmlzX2RlY29kZXIlMkMlMjBmJTIyJTdCbW9kZWwuX19jbGFzc19fJTdEJTIwaGFzJTIwdG8lMjBiZSUyMGNvbmZpZ3VyZWQlMjBhcyUyMGElMjBkZWNvZGVyLiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlMEElMEElMjMlMjBNb2RlbCUyMGNhbiUyMGFsc28lMjBiZSUyMHVzZWQlMjB3aXRoJTIwRW5jb2RlckRlY29kZXIlMjBmcmFtZXdvcmslMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQmVydFRva2VuaXplciUyQyUyMEVuY29kZXJEZWNvZGVyTW9kZWwlMkMlMjBBdXRvVG9rZW5pemVyJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXJfZW5jJTIwJTNEJTIwQmVydFRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1sYXJnZS11bmNhc2VkJTIyKSUwQXRva2VuaXplcl9kZWMlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJwYXRyaWNrdm9ucGxhdGVuJTJGeHByb3BoZXRuZXQtbGFyZ2UtdW5jYXNlZC1zdGFuZGFsb25lJTIyKSUwQW1vZGVsJTIwJTNEJTIwRW5jb2RlckRlY29kZXJNb2RlbC5mcm9tX2VuY29kZXJfZGVjb2Rlcl9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmJlcnQtbGFyZ2UtdW5jYXNlZCUyMiUyQyUyMCUyMnBhdHJpY2t2b25wbGF0ZW4lMkZ4cHJvcGhldG5ldC1sYXJnZS11bmNhc2VkLXN0YW5kYWxvbmUlMjIlMEEpJTBBJTBBQVJUSUNMRSUyMCUzRCUyMCglMEElMjAlMjAlMjAlMjAlMjJ0aGUlMjB1cyUyMHN0YXRlJTIwZGVwYXJ0bWVudCUyMHNhaWQlMjB3ZWRuZXNkYXklMjBpdCUyMGhhZCUyMHJlY2VpdmVkJTIwbm8lMjAlMjIlMEElMjAlMjAlMjAlMjAlMjJmb3JtYWwlMjB3b3JkJTIwZnJvbSUyMGJvbGl2aWElMjB0aGF0JTIwaXQlMjB3YXMlMjBleHBlbGxpbmclMjB0aGUlMjB1cyUyMGFtYmFzc2Fkb3IlMjB0aGVyZSUyMCUyMiUwQSUyMCUyMCUyMCUyMCUyMmJ1dCUyMHNhaWQlMjB0aGUlMjBjaGFyZ2VzJTIwbWFkZSUyMGFnYWluc3QlMjBoaW0lMjBhcmUlMjAlNjAlNjAlMjBiYXNlbGVzcyUyMC4lMjIlMEEpJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyX2VuYyhBUlRJQ0xFJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikuaW5wdXRfaWRzJTBBbGFiZWxzJTIwJTNEJTIwdG9rZW5pemVyX2RlYyglMEElMjAlMjAlMjAlMjAlMjJ1cyUyMHJlamVjdHMlMjBjaGFyZ2VzJTIwYWdhaW5zdCUyMGl0cyUyMGFtYmFzc2Fkb3IlMjBpbiUyMGJvbGl2aWElMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTBBKS5pbnB1dF9pZHMlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRfaWRzJTNEaW5wdXRfaWRzJTJDJTIwZGVjb2Rlcl9pbnB1dF9pZHMlM0RsYWJlbHMlNUIlM0ElMkMlMjAlM0EtMSU1RCUyQyUyMGxhYmVscyUzRGxhYmVscyU1QiUzQSUyQyUyMDElM0ElNUQpJTBBJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcw==",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(){p=n("p"),b=a("Example:"),_=c(),k(g.$$.fragment)},l(i){p=r(i,"P",{});var m=s(p);b=d(m,"Example:"),m.forEach(o),_=h(i),M(g.$$.fragment,i)},m(i,m){f(i,p,m),e(p,b),f(i,_,m),y(g,i,m),v=!0},p:Qn,i(i){v||(T(g.$$.fragment,i),v=!0)},o(i){w(g.$$.fragment,i),v=!1},d(i){i&&o(p),i&&o(_),N(g,i)}}}function lh(P){let p,b,_,g,v,i,m,X,es,er,te,oo,no,sl,ts,ro,so,al,tr,oe,Ho,os,ns,tt,rs,ss,or,ne,we,Yo,ot,as,Qo,ds,nr,Ne,is,nt,ls,cs,rr,ao,hs,sr,io,ps,ar,lo,Ko,us,dr,Pe,ms,rt,fs,gs,ir,co,_s,lr,ho,en,vs,cr,re,Xe,tn,st,bs,on,ks,hr,O,nn,po,Ms,ys,rn,uo,Ts,ws,sn,mo,Ns,pr,se,Le,an,at,Ps,dn,Xs,ur,A,dt,Ls,ae,$s,fo,zs,Es,it,xs,Cs,js,de,qs,go,Fs,Js,_o,Is,Gs,mr,ie,$e,ln,lt,Us,cn,Ws,fr,L,ct,Zs,V,Bs,vo,Rs,As,bo,Vs,Os,ht,Ds,Ss,Hs,pt,Ys,ko,Qs,Ks,ea,D,ut,ta,hn,oa,na,mt,Mo,ra,pn,sa,aa,yo,da,un,ia,la,ze,ft,ca,mn,ha,pa,Ee,gt,ua,fn,ma,fa,xe,_t,ga,vt,_a,gn,va,ba,gr,le,Ce,_n,bt,ka,vn,Ma,_r,x,kt,ya,Mt,Ta,To,wa,Na,Pa,ce,Xa,yt,La,$a,bn,za,Ea,xa,Tt,Ca,wt,ja,qa,Fa,I,Nt,Ja,he,Ia,wo,Ga,Ua,kn,Wa,Za,Ba,je,Ra,qe,vr,pe,Fe,Mn,Pt,Aa,yn,Va,br,$,Xt,Oa,Lt,Da,No,Sa,Ha,Ya,ue,Qa,$t,Ka,ed,Tn,td,od,nd,zt,rd,Et,sd,ad,dd,F,id,wn,ld,cd,Nn,hd,pd,Pn,ud,md,Po,fd,gd,_d,G,xt,vd,me,bd,Xo,kd,Md,Xn,yd,Td,wd,Je,Nd,Ie,kr,fe,Ge,Ln,Ct,Pd,$n,Xd,Mr,z,jt,Ld,qt,$d,Lo,zd,Ed,xd,ge,Cd,Ft,jd,qd,zn,Fd,Jd,Id,Jt,Gd,It,Ud,Wd,Zd,J,Bd,En,Rd,Ad,xn,Vd,Od,Cn,Dd,Sd,$o,Hd,Yd,Qd,U,Gt,Kd,_e,ei,zo,ti,oi,jn,ni,ri,si,Ue,ai,We,yr,ve,Ze,qn,Ut,di,Fn,ii,Tr,C,Wt,li,Zt,ci,Eo,hi,pi,ui,be,mi,Bt,fi,gi,Jn,_i,vi,bi,Rt,ki,At,Mi,yi,Ti,W,Vt,wi,ke,Ni,xo,Pi,Xi,In,Li,$i,zi,Be,Ei,Re,wr,Me,Ae,Gn,Ot,xi,Un,Ci,Nr,j,Dt,ji,St,qi,Co,Fi,Ji,Ii,ye,Gi,Ht,Ui,Wi,Wn,Zi,Bi,Ri,Yt,Ai,Qt,Vi,Oi,Di,Z,Kt,Si,Te,Hi,jo,Yi,Qi,Zn,Ki,el,tl,Ve,ol,Oe,Pr;return i=new ee({}),ot=new ee({}),st=new ee({}),at=new ee({}),dt=new E({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.31.0/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.31.0/src/transformers/models/xlm_prophetnet/configuration_xlm_prophetnet.py#L33"}}),lt=new ee({}),ct=new E({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.31.0/src/transformers/models/xlm_prophetnet/tokenization_xlm_prophetnet.py#L59"}}),ut=new E({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.31.0/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 E({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.31.0/src/transformers/models/xlm_prophetnet/tokenization_xlm_prophetnet.py#L294"}}),gt=new E({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.31.0/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 E({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.31.0/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>
`}}),bt=new ee({}),kt=new E({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.31.0/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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py#L1770"}}),Nt=new E({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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/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.31.0/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>
`}}),je=new Hn({props:{$$slots:{default:[Kc]},$$scope:{ctx:P}}}),qe=new Yn({props:{anchor:"transformers.XLMProphetNetModel.forward.example",$$slots:{default:[eh]},$$scope:{ctx:P}}}),Pt=new ee({}),Xt=new E({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.31.0/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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py#L1252"}}),xt=new E({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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py#L1282",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/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.31.0/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.31.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Je=new Hn({props:{$$slots:{default:[th]},$$scope:{ctx:P}}}),Ie=new Yn({props:{anchor:"transformers.XLMProphetNetEncoder.forward.example",$$slots:{default:[oh]},$$scope:{ctx:P}}}),Ct=new ee({}),jt=new E({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.31.0/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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py#L1393"}}),Gt=new E({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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.0/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.31.0/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.31.0/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>
`}}),Ue=new Hn({props:{$$slots:{default:[nh]},$$scope:{ctx:P}}}),We=new Yn({props:{anchor:"transformers.XLMProphetNetDecoder.forward.example",$$slots:{default:[rh]},$$scope:{ctx:P}}}),Ut=new ee({}),Wt=new E({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.31.0/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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py#L1900"}}),Vt=new E({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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.0/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.31.0/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py#L1923",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.31.0/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>
`}}),Be=new Hn({props:{$$slots:{default:[sh]},$$scope:{ctx:P}}}),Re=new Yn({props:{anchor:"transformers.XLMProphetNetForConditionalGeneration.forward.example",$$slots:{default:[ah]},$$scope:{ctx:P}}}),Ot=new ee({}),Dt=new E({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.31.0/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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py#L2115"}}),Kt=new E({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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.0/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.31.0/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py#L2152",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.31.0/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>
`}}),Ve=new Hn({props:{$$slots:{default:[dh]},$$scope:{ctx:P}}}),Oe=new Yn({props:{anchor:"transformers.XLMProphetNetForCausalLM.forward.example",$$slots:{default:[ih]},$$scope:{ctx:P}}}),{c(){p=n("meta"),b=c(),_=n("h1"),g=n("a"),v=n("span"),k(i.$$.fragment),m=c(),X=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"),Ho=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"),we=n("a"),Yo=n("span"),k(ot.$$.fragment),as=c(),Qo=n("span"),ds=a("Overview"),nr=c(),Ne=n("p"),is=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"),hs=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"),ps=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.`),dr=c(),Pe=n("p"),ms=a("The Authors\u2019 code can be found "),rt=n("a"),fs=a("here"),gs=a("."),ir=c(),co=n("p"),_s=a("Tips:"),lr=c(),ho=n("ul"),en=n("li"),vs=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"),Xe=n("a"),tn=n("span"),k(st.$$.fragment),bs=c(),on=n("span"),ks=a("Documentation resources"),hr=c(),O=n("ul"),nn=n("li"),po=n("a"),Ms=a("Causal language modeling task guide"),ys=c(),rn=n("li"),uo=n("a"),Ts=a("Translation task guide"),ws=c(),sn=n("li"),mo=n("a"),Ns=a("Summarization task guide"),pr=c(),se=n("h2"),Le=n("a"),an=n("span"),k(at.$$.fragment),Ps=c(),dn=n("span"),Xs=a("XLMProphetNetConfig"),ur=c(),A=n("div"),k(dt.$$.fragment),Ls=c(),ae=n("p"),$s=a("This is the configuration class to store the configuration of a "),fo=n("a"),zs=a("XLMProphetNetModel"),Es=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
`),it=n("a"),xs=a("microsoft/xprophetnet-large-wiki100-cased"),Cs=a(`
architecture.`),js=c(),de=n("p"),qs=a("Configuration objects inherit from "),go=n("a"),Fs=a("PretrainedConfig"),Js=a(` and can be used to control the model outputs. Read the
documentation from `),_o=n("a"),Is=a("PretrainedConfig"),Gs=a(" for more information."),mr=c(),ie=n("h2"),$e=n("a"),ln=n("span"),k(lt.$$.fragment),Us=c(),cn=n("span"),Ws=a("XLMProphetNetTokenizer"),fr=c(),L=n("div"),k(ct.$$.fragment),Zs=c(),V=n("p"),Bs=a("Adapted from "),vo=n("a"),Rs=a("RobertaTokenizer"),As=a(" and "),bo=n("a"),Vs=a("XLNetTokenizer"),Os=a(`. Based on
`),ht=n("a"),Ds=a("SentencePiece"),Ss=a("."),Hs=c(),pt=n("p"),Ys=a("This tokenizer inherits from "),ko=n("a"),Qs=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(),D=n("div"),k(ut.$$.fragment),ta=c(),hn=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"),Mo=n("li"),ra=a("single sequence: "),pn=n("code"),sa=a("X [SEP]"),aa=c(),yo=n("li"),da=a("pair of sequences: "),un=n("code"),ia=a("A [SEP] B [SEP]"),la=c(),ze=n("div"),k(ft.$$.fragment),ca=c(),mn=n("p"),ha=a("Converts a sequence of tokens (strings for sub-words) in a single string."),pa=c(),Ee=n("div"),k(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"),k(_t.$$.fragment),ga=c(),vt=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"),va=a("prepare_for_model"),ba=a(" method."),gr=c(),le=n("h2"),Ce=n("a"),_n=n("span"),k(bt.$$.fragment),ka=c(),vn=n("span"),Ma=a("XLMProphetNetModel"),_r=c(),x=n("div"),k(kt.$$.fragment),ya=c(),Mt=n("p"),Ta=a(`The bare XLMProphetNet Model outputting raw hidden-states without any specific head on top.
This model inherits from `),To=n("a"),wa=a("PreTrainedModel"),Na=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.)`),Pa=c(),ce=n("p"),Xa=a("Original ProphetNet code can be found "),yt=n("a"),La=a("here"),$a=a(`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),bn=n("code"),za=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Ea=a("."),xa=c(),Tt=n("p"),Ca=a("This model is a PyTorch "),wt=n("a"),ja=a("torch.nn.Module"),qa=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.`),Fa=c(),I=n("div"),k(Nt.$$.fragment),Ja=c(),he=n("p"),Ia=a("The "),wo=n("a"),Ga=a("XLMProphetNetModel"),Ua=a(" forward method, overrides the "),kn=n("code"),Wa=a("__call__"),Za=a(" special method."),Ba=c(),k(je.$$.fragment),Ra=c(),k(qe.$$.fragment),vr=c(),pe=n("h2"),Fe=n("a"),Mn=n("span"),k(Pt.$$.fragment),Aa=c(),yn=n("span"),Va=a("XLMProphetNetEncoder"),br=c(),$=n("div"),k(Xt.$$.fragment),Oa=c(),Lt=n("p"),Da=a(`The standalone encoder part of the XLMProphetNetModel.
This model inherits from `),No=n("a"),Sa=a("PreTrainedModel"),Ha=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.)`),Ya=c(),ue=n("p"),Qa=a("Original ProphetNet code can be found "),$t=n("a"),Ka=a("here"),ed=a(`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),Tn=n("code"),td=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),od=a("."),nd=c(),zt=n("p"),rd=a("This model is a PyTorch "),Et=n("a"),sd=a("torch.nn.Module"),ad=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.`),dd=c(),F=n("p"),id=a("word_embeddings  ("),wn=n("code"),ld=a("torch.nn.Embeddings"),cd=a(" of shape "),Nn=n("code"),hd=a("(config.vocab_size, config.hidden_size)"),pd=a(", "),Pn=n("em"),ud=a("optional"),md=a(`):
The word embedding parameters. This can be used to initialize `),Po=n("a"),fd=a("XLMProphetNetEncoder"),gd=a(` with pre-defined word
embeddings instead of randomly initialized word embeddings.`),_d=c(),G=n("div"),k(xt.$$.fragment),vd=c(),me=n("p"),bd=a("The "),Xo=n("a"),kd=a("XLMProphetNetEncoder"),Md=a(" forward method, overrides the "),Xn=n("code"),yd=a("__call__"),Td=a(" special method."),wd=c(),k(Je.$$.fragment),Nd=c(),k(Ie.$$.fragment),kr=c(),fe=n("h2"),Ge=n("a"),Ln=n("span"),k(Ct.$$.fragment),Pd=c(),$n=n("span"),Xd=a("XLMProphetNetDecoder"),Mr=c(),z=n("div"),k(jt.$$.fragment),Ld=c(),qt=n("p"),$d=a(`The standalone decoder part of the XLMProphetNetModel.
This model inherits from `),Lo=n("a"),zd=a("PreTrainedModel"),Ed=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.)`),xd=c(),ge=n("p"),Cd=a("Original ProphetNet code can be found "),Ft=n("a"),jd=a("here"),qd=a(`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),zn=n("code"),Fd=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Jd=a("."),Id=c(),Jt=n("p"),Gd=a("This model is a PyTorch "),It=n("a"),Ud=a("torch.nn.Module"),Wd=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.`),Zd=c(),J=n("p"),Bd=a("word_embeddings  ("),En=n("code"),Rd=a("torch.nn.Embeddings"),Ad=a(" of shape "),xn=n("code"),Vd=a("(config.vocab_size, config.hidden_size)"),Od=a(", "),Cn=n("em"),Dd=a("optional"),Sd=a(`):
The word embedding parameters. This can be used to initialize `),$o=n("a"),Hd=a("XLMProphetNetEncoder"),Yd=a(` with pre-defined word
embeddings instead of randomly initialized word embeddings.`),Qd=c(),U=n("div"),k(Gt.$$.fragment),Kd=c(),_e=n("p"),ei=a("The "),zo=n("a"),ti=a("XLMProphetNetDecoder"),oi=a(" forward method, overrides the "),jn=n("code"),ni=a("__call__"),ri=a(" special method."),si=c(),k(Ue.$$.fragment),ai=c(),k(We.$$.fragment),yr=c(),ve=n("h2"),Ze=n("a"),qn=n("span"),k(Ut.$$.fragment),di=c(),Fn=n("span"),ii=a("XLMProphetNetForConditionalGeneration"),Tr=c(),C=n("div"),k(Wt.$$.fragment),li=c(),Zt=n("p"),ci=a(`The XLMProphetNet Model with a language modeling head. Can be used for sequence generation tasks.
This model inherits from `),Eo=n("a"),hi=a("PreTrainedModel"),pi=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.)`),ui=c(),be=n("p"),mi=a("Original ProphetNet code can be found "),Bt=n("a"),fi=a("here"),gi=a(`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),Jn=n("code"),_i=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),vi=a("."),bi=c(),Rt=n("p"),ki=a("This model is a PyTorch "),At=n("a"),Mi=a("torch.nn.Module"),yi=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.`),Ti=c(),W=n("div"),k(Vt.$$.fragment),wi=c(),ke=n("p"),Ni=a("The "),xo=n("a"),Pi=a("XLMProphetNetForConditionalGeneration"),Xi=a(" forward method, overrides the "),In=n("code"),Li=a("__call__"),$i=a(" special method."),zi=c(),k(Be.$$.fragment),Ei=c(),k(Re.$$.fragment),wr=c(),Me=n("h2"),Ae=n("a"),Gn=n("span"),k(Ot.$$.fragment),xi=c(),Un=n("span"),Ci=a("XLMProphetNetForCausalLM"),Nr=c(),j=n("div"),k(Dt.$$.fragment),ji=c(),St=n("p"),qi=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 `),Co=n("a"),Fi=a("PreTrainedModel"),Ji=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.)`),Ii=c(),ye=n("p"),Gi=a("Original ProphetNet code can be found "),Ht=n("a"),Ui=a("here"),Wi=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"),Zi=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Bi=a("."),Ri=c(),Yt=n("p"),Ai=a("This model is a PyTorch "),Qt=n("a"),Vi=a("torch.nn.Module"),Oi=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.`),Di=c(),Z=n("div"),k(Kt.$$.fragment),Si=c(),Te=n("p"),Hi=a("The "),jo=n("a"),Yi=a("XLMProphetNetForCausalLM"),Qi=a(" forward method, overrides the "),Zn=n("code"),Ki=a("__call__"),el=a(" special method."),tl=c(),k(Ve.$$.fragment),ol=c(),k(Oe.$$.fragment),this.h()},l(t){const u=Yc('[data-svelte="svelte-1phssyn"]',document.head);p=r(u,"META",{name:!0,content:!0}),u.forEach(o),b=h(t),_=r(t,"H1",{class:!0});var eo=s(_);g=r(eo,"A",{id:!0,class:!0,href:!0});var Bn=s(g);v=r(Bn,"SPAN",{});var Rn=s(v);M(i.$$.fragment,Rn),Rn.forEach(o),Bn.forEach(o),m=h(eo),X=r(eo,"SPAN",{});var An=s(X);es=d(An,"XLM-ProphetNet"),An.forEach(o),eo.forEach(o),er=h(t),te=r(t,"DIV",{class:!0});var to=s(te);oo=r(to,"A",{href:!0});var Vn=s(oo);no=r(Vn,"IMG",{alt:!0,src:!0}),Vn.forEach(o),ts=h(to),ro=r(to,"A",{href:!0});var On=s(ro);so=r(On,"IMG",{alt:!0,src:!0}),On.forEach(o),to.forEach(o),tr=h(t),oe=r(t,"P",{});var De=s(oe);Ho=r(De,"STRONG",{});var Dn=s(Ho);os=d(Dn,"DISCLAIMER:"),Dn.forEach(o),ns=d(De," If you see something strange, file a "),tt=r(De,"A",{href:!0,rel:!0});var Sn=s(tt);rs=d(Sn,"Github Issue"),Sn.forEach(o),ss=d(De,` and assign
@patrickvonplaten`),De.forEach(o),or=h(t),ne=r(t,"H2",{class:!0});var Xr=s(ne);we=r(Xr,"A",{id:!0,class:!0,href:!0});var dl=s(we);Yo=r(dl,"SPAN",{});var il=s(Yo);M(ot.$$.fragment,il),il.forEach(o),dl.forEach(o),as=h(Xr),Qo=r(Xr,"SPAN",{});var ll=s(Qo);ds=d(ll,"Overview"),ll.forEach(o),Xr.forEach(o),nr=h(t),Ne=r(t,"P",{});var Lr=s(Ne);is=d(Lr,"The XLM-ProphetNet model was proposed in "),nt=r(Lr,"A",{href:!0,rel:!0});var cl=s(nt);ls=d(cl,"ProphetNet: Predicting Future N-gram for Sequence-to-Sequence Pre-training,"),cl.forEach(o),cs=d(Lr,` by Yu Yan, Weizhen Qi, Yeyun Gong, Dayiheng Liu, Nan Duan, Jiusheng Chen, Ruofei
Zhang, Ming Zhou on 13 Jan, 2020.`),Lr.forEach(o),rr=h(t),ao=r(t,"P",{});var hl=s(ao);hs=d(hl,`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.`),hl.forEach(o),sr=h(t),io=r(t,"P",{});var pl=s(io);ps=d(pl,"The abstract from the paper is the following:"),pl.forEach(o),ar=h(t),lo=r(t,"P",{});var ul=s(lo);Ko=r(ul,"EM",{});var ml=s(Ko);us=d(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),dr=h(t),Pe=r(t,"P",{});var $r=s(Pe);ms=d($r,"The Authors\u2019 code can be found "),rt=r($r,"A",{href:!0,rel:!0});var fl=s(rt);fs=d(fl,"here"),fl.forEach(o),gs=d($r,"."),$r.forEach(o),ir=h(t),co=r(t,"P",{});var gl=s(co);_s=d(gl,"Tips:"),gl.forEach(o),lr=h(t),ho=r(t,"UL",{});var _l=s(ho);en=r(_l,"LI",{});var vl=s(en);vs=d(vl,"XLM-ProphetNet\u2019s model architecture and pretraining objective is same as ProphetNet, but XLM-ProphetNet was pre-trained on the cross-lingual dataset XGLUE."),vl.forEach(o),_l.forEach(o),cr=h(t),re=r(t,"H2",{class:!0});var zr=s(re);Xe=r(zr,"A",{id:!0,class:!0,href:!0});var bl=s(Xe);tn=r(bl,"SPAN",{});var kl=s(tn);M(st.$$.fragment,kl),kl.forEach(o),bl.forEach(o),bs=h(zr),on=r(zr,"SPAN",{});var Ml=s(on);ks=d(Ml,"Documentation resources"),Ml.forEach(o),zr.forEach(o),hr=h(t),O=r(t,"UL",{});var qo=s(O);nn=r(qo,"LI",{});var yl=s(nn);po=r(yl,"A",{href:!0});var Tl=s(po);Ms=d(Tl,"Causal language modeling task guide"),Tl.forEach(o),yl.forEach(o),ys=h(qo),rn=r(qo,"LI",{});var wl=s(rn);uo=r(wl,"A",{href:!0});var Nl=s(uo);Ts=d(Nl,"Translation task guide"),Nl.forEach(o),wl.forEach(o),ws=h(qo),sn=r(qo,"LI",{});var Pl=s(sn);mo=r(Pl,"A",{href:!0});var Xl=s(mo);Ns=d(Xl,"Summarization task guide"),Xl.forEach(o),Pl.forEach(o),qo.forEach(o),pr=h(t),se=r(t,"H2",{class:!0});var Er=s(se);Le=r(Er,"A",{id:!0,class:!0,href:!0});var Ll=s(Le);an=r(Ll,"SPAN",{});var $l=s(an);M(at.$$.fragment,$l),$l.forEach(o),Ll.forEach(o),Ps=h(Er),dn=r(Er,"SPAN",{});var zl=s(dn);Xs=d(zl,"XLMProphetNetConfig"),zl.forEach(o),Er.forEach(o),ur=h(t),A=r(t,"DIV",{class:!0});var Fo=s(A);M(dt.$$.fragment,Fo),Ls=h(Fo),ae=r(Fo,"P",{});var Jo=s(ae);$s=d(Jo,"This is the configuration class to store the configuration of a "),fo=r(Jo,"A",{href:!0});var El=s(fo);zs=d(El,"XLMProphetNetModel"),El.forEach(o),Es=d(Jo,`. 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
`),it=r(Jo,"A",{href:!0,rel:!0});var xl=s(it);xs=d(xl,"microsoft/xprophetnet-large-wiki100-cased"),xl.forEach(o),Cs=d(Jo,`
architecture.`),Jo.forEach(o),js=h(Fo),de=r(Fo,"P",{});var Io=s(de);qs=d(Io,"Configuration objects inherit from "),go=r(Io,"A",{href:!0});var Cl=s(go);Fs=d(Cl,"PretrainedConfig"),Cl.forEach(o),Js=d(Io,` and can be used to control the model outputs. Read the
documentation from `),_o=r(Io,"A",{href:!0});var jl=s(_o);Is=d(jl,"PretrainedConfig"),jl.forEach(o),Gs=d(Io," for more information."),Io.forEach(o),Fo.forEach(o),mr=h(t),ie=r(t,"H2",{class:!0});var xr=s(ie);$e=r(xr,"A",{id:!0,class:!0,href:!0});var ql=s($e);ln=r(ql,"SPAN",{});var Fl=s(ln);M(lt.$$.fragment,Fl),Fl.forEach(o),ql.forEach(o),Us=h(xr),cn=r(xr,"SPAN",{});var Jl=s(cn);Ws=d(Jl,"XLMProphetNetTokenizer"),Jl.forEach(o),xr.forEach(o),fr=h(t),L=r(t,"DIV",{class:!0});var q=s(L);M(ct.$$.fragment,q),Zs=h(q),V=r(q,"P",{});var Se=s(V);Bs=d(Se,"Adapted from "),vo=r(Se,"A",{href:!0});var Il=s(vo);Rs=d(Il,"RobertaTokenizer"),Il.forEach(o),As=d(Se," and "),bo=r(Se,"A",{href:!0});var Gl=s(bo);Vs=d(Gl,"XLNetTokenizer"),Gl.forEach(o),Os=d(Se,`. Based on
`),ht=r(Se,"A",{href:!0,rel:!0});var Ul=s(ht);Ds=d(Ul,"SentencePiece"),Ul.forEach(o),Ss=d(Se,"."),Se.forEach(o),Hs=h(q),pt=r(q,"P",{});var Cr=s(pt);Ys=d(Cr,"This tokenizer inherits from "),ko=r(Cr,"A",{href:!0});var Wl=s(ko);Qs=d(Wl,"PreTrainedTokenizer"),Wl.forEach(o),Ks=d(Cr,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Cr.forEach(o),ea=h(q),D=r(q,"DIV",{class:!0});var Go=s(D);M(ut.$$.fragment,Go),ta=h(Go),hn=r(Go,"P",{});var Zl=s(hn);oa=d(Zl,`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:`),Zl.forEach(o),na=h(Go),mt=r(Go,"UL",{});var jr=s(mt);Mo=r(jr,"LI",{});var nl=s(Mo);ra=d(nl,"single sequence: "),pn=r(nl,"CODE",{});var Bl=s(pn);sa=d(Bl,"X [SEP]"),Bl.forEach(o),nl.forEach(o),aa=h(jr),yo=r(jr,"LI",{});var rl=s(yo);da=d(rl,"pair of sequences: "),un=r(rl,"CODE",{});var Rl=s(un);ia=d(Rl,"A [SEP] B [SEP]"),Rl.forEach(o),rl.forEach(o),jr.forEach(o),Go.forEach(o),la=h(q),ze=r(q,"DIV",{class:!0});var qr=s(ze);M(ft.$$.fragment,qr),ca=h(qr),mn=r(qr,"P",{});var Al=s(mn);ha=d(Al,"Converts a sequence of tokens (strings for sub-words) in a single string."),Al.forEach(o),qr.forEach(o),pa=h(q),Ee=r(q,"DIV",{class:!0});var Fr=s(Ee);M(gt.$$.fragment,Fr),ua=h(Fr),fn=r(Fr,"P",{});var Vl=s(fn);ma=d(Vl,`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.`),Vl.forEach(o),Fr.forEach(o),fa=h(q),xe=r(q,"DIV",{class:!0});var Jr=s(xe);M(_t.$$.fragment,Jr),ga=h(Jr),vt=r(Jr,"P",{});var Ir=s(vt);_a=d(Ir,`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(Ir,"CODE",{});var Ol=s(gn);va=d(Ol,"prepare_for_model"),Ol.forEach(o),ba=d(Ir," method."),Ir.forEach(o),Jr.forEach(o),q.forEach(o),gr=h(t),le=r(t,"H2",{class:!0});var Gr=s(le);Ce=r(Gr,"A",{id:!0,class:!0,href:!0});var Dl=s(Ce);_n=r(Dl,"SPAN",{});var Sl=s(_n);M(bt.$$.fragment,Sl),Sl.forEach(o),Dl.forEach(o),ka=h(Gr),vn=r(Gr,"SPAN",{});var Hl=s(vn);Ma=d(Hl,"XLMProphetNetModel"),Hl.forEach(o),Gr.forEach(o),_r=h(t),x=r(t,"DIV",{class:!0});var S=s(x);M(kt.$$.fragment,S),ya=h(S),Mt=r(S,"P",{});var Ur=s(Mt);Ta=d(Ur,`The bare XLMProphetNet Model outputting raw hidden-states without any specific head on top.
This model inherits from `),To=r(Ur,"A",{href:!0});var Yl=s(To);wa=d(Yl,"PreTrainedModel"),Yl.forEach(o),Na=d(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),Pa=h(S),ce=r(S,"P",{});var Uo=s(ce);Xa=d(Uo,"Original ProphetNet code can be found "),yt=r(Uo,"A",{href:!0,rel:!0});var Ql=s(yt);La=d(Ql,"here"),Ql.forEach(o),$a=d(Uo,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),bn=r(Uo,"CODE",{});var Kl=s(bn);za=d(Kl,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Kl.forEach(o),Ea=d(Uo,"."),Uo.forEach(o),xa=h(S),Tt=r(S,"P",{});var Wr=s(Tt);Ca=d(Wr,"This model is a PyTorch "),wt=r(Wr,"A",{href:!0,rel:!0});var ec=s(wt);ja=d(ec,"torch.nn.Module"),ec.forEach(o),qa=d(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),Fa=h(S),I=r(S,"DIV",{class:!0});var He=s(I);M(Nt.$$.fragment,He),Ja=h(He),he=r(He,"P",{});var Wo=s(he);Ia=d(Wo,"The "),wo=r(Wo,"A",{href:!0});var tc=s(wo);Ga=d(tc,"XLMProphetNetModel"),tc.forEach(o),Ua=d(Wo," forward method, overrides the "),kn=r(Wo,"CODE",{});var oc=s(kn);Wa=d(oc,"__call__"),oc.forEach(o),Za=d(Wo," special method."),Wo.forEach(o),Ba=h(He),M(je.$$.fragment,He),Ra=h(He),M(qe.$$.fragment,He),He.forEach(o),S.forEach(o),vr=h(t),pe=r(t,"H2",{class:!0});var Zr=s(pe);Fe=r(Zr,"A",{id:!0,class:!0,href:!0});var nc=s(Fe);Mn=r(nc,"SPAN",{});var rc=s(Mn);M(Pt.$$.fragment,rc),rc.forEach(o),nc.forEach(o),Aa=h(Zr),yn=r(Zr,"SPAN",{});var sc=s(yn);Va=d(sc,"XLMProphetNetEncoder"),sc.forEach(o),Zr.forEach(o),br=h(t),$=r(t,"DIV",{class:!0});var B=s($);M(Xt.$$.fragment,B),Oa=h(B),Lt=r(B,"P",{});var Br=s(Lt);Da=d(Br,`The standalone encoder part of the XLMProphetNetModel.
This model inherits from `),No=r(Br,"A",{href:!0});var ac=s(No);Sa=d(ac,"PreTrainedModel"),ac.forEach(o),Ha=d(Br,`. 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.)`),Br.forEach(o),Ya=h(B),ue=r(B,"P",{});var Zo=s(ue);Qa=d(Zo,"Original ProphetNet code can be found "),$t=r(Zo,"A",{href:!0,rel:!0});var dc=s($t);Ka=d(dc,"here"),dc.forEach(o),ed=d(Zo,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),Tn=r(Zo,"CODE",{});var ic=s(Tn);td=d(ic,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),ic.forEach(o),od=d(Zo,"."),Zo.forEach(o),nd=h(B),zt=r(B,"P",{});var Rr=s(zt);rd=d(Rr,"This model is a PyTorch "),Et=r(Rr,"A",{href:!0,rel:!0});var lc=s(Et);sd=d(lc,"torch.nn.Module"),lc.forEach(o),ad=d(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),dd=h(B),F=r(B,"P",{});var H=s(F);id=d(H,"word_embeddings  ("),wn=r(H,"CODE",{});var cc=s(wn);ld=d(cc,"torch.nn.Embeddings"),cc.forEach(o),cd=d(H," of shape "),Nn=r(H,"CODE",{});var hc=s(Nn);hd=d(hc,"(config.vocab_size, config.hidden_size)"),hc.forEach(o),pd=d(H,", "),Pn=r(H,"EM",{});var pc=s(Pn);ud=d(pc,"optional"),pc.forEach(o),md=d(H,`):
The word embedding parameters. This can be used to initialize `),Po=r(H,"A",{href:!0});var uc=s(Po);fd=d(uc,"XLMProphetNetEncoder"),uc.forEach(o),gd=d(H,` with pre-defined word
embeddings instead of randomly initialized word embeddings.`),H.forEach(o),_d=h(B),G=r(B,"DIV",{class:!0});var Ye=s(G);M(xt.$$.fragment,Ye),vd=h(Ye),me=r(Ye,"P",{});var Bo=s(me);bd=d(Bo,"The "),Xo=r(Bo,"A",{href:!0});var mc=s(Xo);kd=d(mc,"XLMProphetNetEncoder"),mc.forEach(o),Md=d(Bo," forward method, overrides the "),Xn=r(Bo,"CODE",{});var fc=s(Xn);yd=d(fc,"__call__"),fc.forEach(o),Td=d(Bo," special method."),Bo.forEach(o),wd=h(Ye),M(Je.$$.fragment,Ye),Nd=h(Ye),M(Ie.$$.fragment,Ye),Ye.forEach(o),B.forEach(o),kr=h(t),fe=r(t,"H2",{class:!0});var Ar=s(fe);Ge=r(Ar,"A",{id:!0,class:!0,href:!0});var gc=s(Ge);Ln=r(gc,"SPAN",{});var _c=s(Ln);M(Ct.$$.fragment,_c),_c.forEach(o),gc.forEach(o),Pd=h(Ar),$n=r(Ar,"SPAN",{});var vc=s($n);Xd=d(vc,"XLMProphetNetDecoder"),vc.forEach(o),Ar.forEach(o),Mr=h(t),z=r(t,"DIV",{class:!0});var R=s(z);M(jt.$$.fragment,R),Ld=h(R),qt=r(R,"P",{});var Vr=s(qt);$d=d(Vr,`The standalone decoder part of the XLMProphetNetModel.
This model inherits from `),Lo=r(Vr,"A",{href:!0});var bc=s(Lo);zd=d(bc,"PreTrainedModel"),bc.forEach(o),Ed=d(Vr,`. 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.)`),Vr.forEach(o),xd=h(R),ge=r(R,"P",{});var Ro=s(ge);Cd=d(Ro,"Original ProphetNet code can be found "),Ft=r(Ro,"A",{href:!0,rel:!0});var kc=s(Ft);jd=d(kc,"here"),kc.forEach(o),qd=d(Ro,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),zn=r(Ro,"CODE",{});var Mc=s(zn);Fd=d(Mc,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Mc.forEach(o),Jd=d(Ro,"."),Ro.forEach(o),Id=h(R),Jt=r(R,"P",{});var Or=s(Jt);Gd=d(Or,"This model is a PyTorch "),It=r(Or,"A",{href:!0,rel:!0});var yc=s(It);Ud=d(yc,"torch.nn.Module"),yc.forEach(o),Wd=d(Or,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),Or.forEach(o),Zd=h(R),J=r(R,"P",{});var Y=s(J);Bd=d(Y,"word_embeddings  ("),En=r(Y,"CODE",{});var Tc=s(En);Rd=d(Tc,"torch.nn.Embeddings"),Tc.forEach(o),Ad=d(Y," of shape "),xn=r(Y,"CODE",{});var wc=s(xn);Vd=d(wc,"(config.vocab_size, config.hidden_size)"),wc.forEach(o),Od=d(Y,", "),Cn=r(Y,"EM",{});var Nc=s(Cn);Dd=d(Nc,"optional"),Nc.forEach(o),Sd=d(Y,`):
The word embedding parameters. This can be used to initialize `),$o=r(Y,"A",{href:!0});var Pc=s($o);Hd=d(Pc,"XLMProphetNetEncoder"),Pc.forEach(o),Yd=d(Y,` with pre-defined word
embeddings instead of randomly initialized word embeddings.`),Y.forEach(o),Qd=h(R),U=r(R,"DIV",{class:!0});var Qe=s(U);M(Gt.$$.fragment,Qe),Kd=h(Qe),_e=r(Qe,"P",{});var Ao=s(_e);ei=d(Ao,"The "),zo=r(Ao,"A",{href:!0});var Xc=s(zo);ti=d(Xc,"XLMProphetNetDecoder"),Xc.forEach(o),oi=d(Ao," forward method, overrides the "),jn=r(Ao,"CODE",{});var Lc=s(jn);ni=d(Lc,"__call__"),Lc.forEach(o),ri=d(Ao," special method."),Ao.forEach(o),si=h(Qe),M(Ue.$$.fragment,Qe),ai=h(Qe),M(We.$$.fragment,Qe),Qe.forEach(o),R.forEach(o),yr=h(t),ve=r(t,"H2",{class:!0});var Dr=s(ve);Ze=r(Dr,"A",{id:!0,class:!0,href:!0});var $c=s(Ze);qn=r($c,"SPAN",{});var zc=s(qn);M(Ut.$$.fragment,zc),zc.forEach(o),$c.forEach(o),di=h(Dr),Fn=r(Dr,"SPAN",{});var Ec=s(Fn);ii=d(Ec,"XLMProphetNetForConditionalGeneration"),Ec.forEach(o),Dr.forEach(o),Tr=h(t),C=r(t,"DIV",{class:!0});var Q=s(C);M(Wt.$$.fragment,Q),li=h(Q),Zt=r(Q,"P",{});var Sr=s(Zt);ci=d(Sr,`The XLMProphetNet Model with a language modeling head. Can be used for sequence generation tasks.
This model inherits from `),Eo=r(Sr,"A",{href:!0});var xc=s(Eo);hi=d(xc,"PreTrainedModel"),xc.forEach(o),pi=d(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),ui=h(Q),be=r(Q,"P",{});var Vo=s(be);mi=d(Vo,"Original ProphetNet code can be found "),Bt=r(Vo,"A",{href:!0,rel:!0});var Cc=s(Bt);fi=d(Cc,"here"),Cc.forEach(o),gi=d(Vo,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),Jn=r(Vo,"CODE",{});var jc=s(Jn);_i=d(jc,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),jc.forEach(o),vi=d(Vo,"."),Vo.forEach(o),bi=h(Q),Rt=r(Q,"P",{});var Hr=s(Rt);ki=d(Hr,"This model is a PyTorch "),At=r(Hr,"A",{href:!0,rel:!0});var qc=s(At);Mi=d(qc,"torch.nn.Module"),qc.forEach(o),yi=d(Hr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),Hr.forEach(o),Ti=h(Q),W=r(Q,"DIV",{class:!0});var Ke=s(W);M(Vt.$$.fragment,Ke),wi=h(Ke),ke=r(Ke,"P",{});var Oo=s(ke);Ni=d(Oo,"The "),xo=r(Oo,"A",{href:!0});var Fc=s(xo);Pi=d(Fc,"XLMProphetNetForConditionalGeneration"),Fc.forEach(o),Xi=d(Oo," forward method, overrides the "),In=r(Oo,"CODE",{});var Jc=s(In);Li=d(Jc,"__call__"),Jc.forEach(o),$i=d(Oo," special method."),Oo.forEach(o),zi=h(Ke),M(Be.$$.fragment,Ke),Ei=h(Ke),M(Re.$$.fragment,Ke),Ke.forEach(o),Q.forEach(o),wr=h(t),Me=r(t,"H2",{class:!0});var Yr=s(Me);Ae=r(Yr,"A",{id:!0,class:!0,href:!0});var Ic=s(Ae);Gn=r(Ic,"SPAN",{});var Gc=s(Gn);M(Ot.$$.fragment,Gc),Gc.forEach(o),Ic.forEach(o),xi=h(Yr),Un=r(Yr,"SPAN",{});var Uc=s(Un);Ci=d(Uc,"XLMProphetNetForCausalLM"),Uc.forEach(o),Yr.forEach(o),Nr=h(t),j=r(t,"DIV",{class:!0});var K=s(j);M(Dt.$$.fragment,K),ji=h(K),St=r(K,"P",{});var Qr=s(St);qi=d(Qr,`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 `),Co=r(Qr,"A",{href:!0});var Wc=s(Co);Fi=d(Wc,"PreTrainedModel"),Wc.forEach(o),Ji=d(Qr,`. 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.)`),Qr.forEach(o),Ii=h(K),ye=r(K,"P",{});var Do=s(ye);Gi=d(Do,"Original ProphetNet code can be found "),Ht=r(Do,"A",{href:!0,rel:!0});var Zc=s(Ht);Ui=d(Zc,"here"),Zc.forEach(o),Wi=d(Do,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),Wn=r(Do,"CODE",{});var Bc=s(Wn);Zi=d(Bc,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Bc.forEach(o),Bi=d(Do,"."),Do.forEach(o),Ri=h(K),Yt=r(K,"P",{});var Kr=s(Yt);Ai=d(Kr,"This model is a PyTorch "),Qt=r(Kr,"A",{href:!0,rel:!0});var Rc=s(Qt);Vi=d(Rc,"torch.nn.Module"),Rc.forEach(o),Oi=d(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),Di=h(K),Z=r(K,"DIV",{class:!0});var et=s(Z);M(Kt.$$.fragment,et),Si=h(et),Te=r(et,"P",{});var So=s(Te);Hi=d(So,"The "),jo=r(So,"A",{href:!0});var Ac=s(jo);Yi=d(Ac,"XLMProphetNetForCausalLM"),Ac.forEach(o),Qi=d(So," forward method, overrides the "),Zn=r(So,"CODE",{});var Vc=s(Zn);Ki=d(Vc,"__call__"),Vc.forEach(o),el=d(So," special method."),So.forEach(o),tl=h(et),M(Ve.$$.fragment,et),ol=h(et),M(Oe.$$.fragment,et),et.forEach(o),K.forEach(o),this.h()},h(){l(p,"name","hf:doc:metadata"),l(p,"content",JSON.stringify(ch)),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"),Oc(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"),Oc(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(we,"id","overview"),l(we,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(we,"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(Xe,"id","documentation-resources"),l(Xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Xe,"href","#documentation-resources"),l(re,"class","relative group"),l(po,"href","../tasks/language_modeling"),l(uo,"href","../tasks/translation"),l(mo,"href","../tasks/summarization"),l(Le,"id","transformers.XLMProphetNetConfig"),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","#transformers.XLMProphetNetConfig"),l(se,"class","relative group"),l(fo,"href","/docs/transformers/v4.31.0/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetModel"),l(it,"href","https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased"),l(it,"rel","nofollow"),l(go,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(_o,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(A,"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,"id","transformers.XLMProphetNetTokenizer"),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.XLMProphetNetTokenizer"),l(ie,"class","relative group"),l(vo,"href","/docs/transformers/v4.31.0/en/model_doc/roberta#transformers.RobertaTokenizer"),l(bo,"href","/docs/transformers/v4.31.0/en/model_doc/xlnet#transformers.XLNetTokenizer"),l(ht,"href","https://github.com/google/sentencepiece"),l(ht,"rel","nofollow"),l(ko,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),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(ze,"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,"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(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(Ce,"id","transformers.XLMProphetNetModel"),l(Ce,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Ce,"href","#transformers.XLMProphetNetModel"),l(le,"class","relative group"),l(To,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),l(yt,"href","https://github.com/microsoft/ProphetNet"),l(yt,"rel","nofollow"),l(wt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(wt,"rel","nofollow"),l(wo,"href","/docs/transformers/v4.31.0/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetModel"),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(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(Fe,"id","transformers.XLMProphetNetEncoder"),l(Fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Fe,"href","#transformers.XLMProphetNetEncoder"),l(pe,"class","relative group"),l(No,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),l($t,"href","https://github.com/microsoft/ProphetNet"),l($t,"rel","nofollow"),l(Et,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Et,"rel","nofollow"),l(Po,"href","/docs/transformers/v4.31.0/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetEncoder"),l(Xo,"href","/docs/transformers/v4.31.0/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetEncoder"),l(G,"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(Ge,"id","transformers.XLMProphetNetDecoder"),l(Ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Ge,"href","#transformers.XLMProphetNetDecoder"),l(fe,"class","relative group"),l(Lo,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),l(Ft,"href","https://github.com/microsoft/ProphetNet"),l(Ft,"rel","nofollow"),l(It,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(It,"rel","nofollow"),l($o,"href","/docs/transformers/v4.31.0/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetEncoder"),l(zo,"href","/docs/transformers/v4.31.0/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetDecoder"),l(U,"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(Ze,"id","transformers.XLMProphetNetForConditionalGeneration"),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.XLMProphetNetForConditionalGeneration"),l(ve,"class","relative group"),l(Eo,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),l(Bt,"href","https://github.com/microsoft/ProphetNet"),l(Bt,"rel","nofollow"),l(At,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(At,"rel","nofollow"),l(xo,"href","/docs/transformers/v4.31.0/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetForConditionalGeneration"),l(W,"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"),l(Ae,"id","transformers.XLMProphetNetForCausalLM"),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.XLMProphetNetForCausalLM"),l(Me,"class","relative group"),l(Co,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),l(Ht,"href","https://github.com/microsoft/ProphetNet"),l(Ht,"rel","nofollow"),l(Qt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Qt,"rel","nofollow"),l(jo,"href","/docs/transformers/v4.31.0/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetForCausalLM"),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(j,"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,p),f(t,b,u),f(t,_,u),e(_,g),e(g,v),y(i,v,null),e(_,m),e(_,X),e(X,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,Ho),e(Ho,os),e(oe,ns),e(oe,tt),e(tt,rs),e(oe,ss),f(t,or,u),f(t,ne,u),e(ne,we),e(we,Yo),y(ot,Yo,null),e(ne,as),e(ne,Qo),e(Qo,ds),f(t,nr,u),f(t,Ne,u),e(Ne,is),e(Ne,nt),e(nt,ls),e(Ne,cs),f(t,rr,u),f(t,ao,u),e(ao,hs),f(t,sr,u),f(t,io,u),e(io,ps),f(t,ar,u),f(t,lo,u),e(lo,Ko),e(Ko,us),f(t,dr,u),f(t,Pe,u),e(Pe,ms),e(Pe,rt),e(rt,fs),e(Pe,gs),f(t,ir,u),f(t,co,u),e(co,_s),f(t,lr,u),f(t,ho,u),e(ho,en),e(en,vs),f(t,cr,u),f(t,re,u),e(re,Xe),e(Xe,tn),y(st,tn,null),e(re,bs),e(re,on),e(on,ks),f(t,hr,u),f(t,O,u),e(O,nn),e(nn,po),e(po,Ms),e(O,ys),e(O,rn),e(rn,uo),e(uo,Ts),e(O,ws),e(O,sn),e(sn,mo),e(mo,Ns),f(t,pr,u),f(t,se,u),e(se,Le),e(Le,an),y(at,an,null),e(se,Ps),e(se,dn),e(dn,Xs),f(t,ur,u),f(t,A,u),y(dt,A,null),e(A,Ls),e(A,ae),e(ae,$s),e(ae,fo),e(fo,zs),e(ae,Es),e(ae,it),e(it,xs),e(ae,Cs),e(A,js),e(A,de),e(de,qs),e(de,go),e(go,Fs),e(de,Js),e(de,_o),e(_o,Is),e(de,Gs),f(t,mr,u),f(t,ie,u),e(ie,$e),e($e,ln),y(lt,ln,null),e(ie,Us),e(ie,cn),e(cn,Ws),f(t,fr,u),f(t,L,u),y(ct,L,null),e(L,Zs),e(L,V),e(V,Bs),e(V,vo),e(vo,Rs),e(V,As),e(V,bo),e(bo,Vs),e(V,Os),e(V,ht),e(ht,Ds),e(V,Ss),e(L,Hs),e(L,pt),e(pt,Ys),e(pt,ko),e(ko,Qs),e(pt,Ks),e(L,ea),e(L,D),y(ut,D,null),e(D,ta),e(D,hn),e(hn,oa),e(D,na),e(D,mt),e(mt,Mo),e(Mo,ra),e(Mo,pn),e(pn,sa),e(mt,aa),e(mt,yo),e(yo,da),e(yo,un),e(un,ia),e(L,la),e(L,ze),y(ft,ze,null),e(ze,ca),e(ze,mn),e(mn,ha),e(L,pa),e(L,Ee),y(gt,Ee,null),e(Ee,ua),e(Ee,fn),e(fn,ma),e(L,fa),e(L,xe),y(_t,xe,null),e(xe,ga),e(xe,vt),e(vt,_a),e(vt,gn),e(gn,va),e(vt,ba),f(t,gr,u),f(t,le,u),e(le,Ce),e(Ce,_n),y(bt,_n,null),e(le,ka),e(le,vn),e(vn,Ma),f(t,_r,u),f(t,x,u),y(kt,x,null),e(x,ya),e(x,Mt),e(Mt,Ta),e(Mt,To),e(To,wa),e(Mt,Na),e(x,Pa),e(x,ce),e(ce,Xa),e(ce,yt),e(yt,La),e(ce,$a),e(ce,bn),e(bn,za),e(ce,Ea),e(x,xa),e(x,Tt),e(Tt,Ca),e(Tt,wt),e(wt,ja),e(Tt,qa),e(x,Fa),e(x,I),y(Nt,I,null),e(I,Ja),e(I,he),e(he,Ia),e(he,wo),e(wo,Ga),e(he,Ua),e(he,kn),e(kn,Wa),e(he,Za),e(I,Ba),y(je,I,null),e(I,Ra),y(qe,I,null),f(t,vr,u),f(t,pe,u),e(pe,Fe),e(Fe,Mn),y(Pt,Mn,null),e(pe,Aa),e(pe,yn),e(yn,Va),f(t,br,u),f(t,$,u),y(Xt,$,null),e($,Oa),e($,Lt),e(Lt,Da),e(Lt,No),e(No,Sa),e(Lt,Ha),e($,Ya),e($,ue),e(ue,Qa),e(ue,$t),e($t,Ka),e(ue,ed),e(ue,Tn),e(Tn,td),e(ue,od),e($,nd),e($,zt),e(zt,rd),e(zt,Et),e(Et,sd),e(zt,ad),e($,dd),e($,F),e(F,id),e(F,wn),e(wn,ld),e(F,cd),e(F,Nn),e(Nn,hd),e(F,pd),e(F,Pn),e(Pn,ud),e(F,md),e(F,Po),e(Po,fd),e(F,gd),e($,_d),e($,G),y(xt,G,null),e(G,vd),e(G,me),e(me,bd),e(me,Xo),e(Xo,kd),e(me,Md),e(me,Xn),e(Xn,yd),e(me,Td),e(G,wd),y(Je,G,null),e(G,Nd),y(Ie,G,null),f(t,kr,u),f(t,fe,u),e(fe,Ge),e(Ge,Ln),y(Ct,Ln,null),e(fe,Pd),e(fe,$n),e($n,Xd),f(t,Mr,u),f(t,z,u),y(jt,z,null),e(z,Ld),e(z,qt),e(qt,$d),e(qt,Lo),e(Lo,zd),e(qt,Ed),e(z,xd),e(z,ge),e(ge,Cd),e(ge,Ft),e(Ft,jd),e(ge,qd),e(ge,zn),e(zn,Fd),e(ge,Jd),e(z,Id),e(z,Jt),e(Jt,Gd),e(Jt,It),e(It,Ud),e(Jt,Wd),e(z,Zd),e(z,J),e(J,Bd),e(J,En),e(En,Rd),e(J,Ad),e(J,xn),e(xn,Vd),e(J,Od),e(J,Cn),e(Cn,Dd),e(J,Sd),e(J,$o),e($o,Hd),e(J,Yd),e(z,Qd),e(z,U),y(Gt,U,null),e(U,Kd),e(U,_e),e(_e,ei),e(_e,zo),e(zo,ti),e(_e,oi),e(_e,jn),e(jn,ni),e(_e,ri),e(U,si),y(Ue,U,null),e(U,ai),y(We,U,null),f(t,yr,u),f(t,ve,u),e(ve,Ze),e(Ze,qn),y(Ut,qn,null),e(ve,di),e(ve,Fn),e(Fn,ii),f(t,Tr,u),f(t,C,u),y(Wt,C,null),e(C,li),e(C,Zt),e(Zt,ci),e(Zt,Eo),e(Eo,hi),e(Zt,pi),e(C,ui),e(C,be),e(be,mi),e(be,Bt),e(Bt,fi),e(be,gi),e(be,Jn),e(Jn,_i),e(be,vi),e(C,bi),e(C,Rt),e(Rt,ki),e(Rt,At),e(At,Mi),e(Rt,yi),e(C,Ti),e(C,W),y(Vt,W,null),e(W,wi),e(W,ke),e(ke,Ni),e(ke,xo),e(xo,Pi),e(ke,Xi),e(ke,In),e(In,Li),e(ke,$i),e(W,zi),y(Be,W,null),e(W,Ei),y(Re,W,null),f(t,wr,u),f(t,Me,u),e(Me,Ae),e(Ae,Gn),y(Ot,Gn,null),e(Me,xi),e(Me,Un),e(Un,Ci),f(t,Nr,u),f(t,j,u),y(Dt,j,null),e(j,ji),e(j,St),e(St,qi),e(St,Co),e(Co,Fi),e(St,Ji),e(j,Ii),e(j,ye),e(ye,Gi),e(ye,Ht),e(Ht,Ui),e(ye,Wi),e(ye,Wn),e(Wn,Zi),e(ye,Bi),e(j,Ri),e(j,Yt),e(Yt,Ai),e(Yt,Qt),e(Qt,Vi),e(Yt,Oi),e(j,Di),e(j,Z),y(Kt,Z,null),e(Z,Si),e(Z,Te),e(Te,Hi),e(Te,jo),e(jo,Yi),e(Te,Qi),e(Te,Zn),e(Zn,Ki),e(Te,el),e(Z,tl),y(Ve,Z,null),e(Z,ol),y(Oe,Z,null),Pr=!0},p(t,[u]){const eo={};u&2&&(eo.$$scope={dirty:u,ctx:t}),je.$set(eo);const Bn={};u&2&&(Bn.$$scope={dirty:u,ctx:t}),qe.$set(Bn);const Rn={};u&2&&(Rn.$$scope={dirty:u,ctx:t}),Je.$set(Rn);const An={};u&2&&(An.$$scope={dirty:u,ctx:t}),Ie.$set(An);const to={};u&2&&(to.$$scope={dirty:u,ctx:t}),Ue.$set(to);const Vn={};u&2&&(Vn.$$scope={dirty:u,ctx:t}),We.$set(Vn);const On={};u&2&&(On.$$scope={dirty:u,ctx:t}),Be.$set(On);const De={};u&2&&(De.$$scope={dirty:u,ctx:t}),Re.$set(De);const Dn={};u&2&&(Dn.$$scope={dirty:u,ctx:t}),Ve.$set(Dn);const Sn={};u&2&&(Sn.$$scope={dirty:u,ctx:t}),Oe.$set(Sn)},i(t){Pr||(T(i.$$.fragment,t),T(ot.$$.fragment,t),T(st.$$.fragment,t),T(at.$$.fragment,t),T(dt.$$.fragment,t),T(lt.$$.fragment,t),T(ct.$$.fragment,t),T(ut.$$.fragment,t),T(ft.$$.fragment,t),T(gt.$$.fragment,t),T(_t.$$.fragment,t),T(bt.$$.fragment,t),T(kt.$$.fragment,t),T(Nt.$$.fragment,t),T(je.$$.fragment,t),T(qe.$$.fragment,t),T(Pt.$$.fragment,t),T(Xt.$$.fragment,t),T(xt.$$.fragment,t),T(Je.$$.fragment,t),T(Ie.$$.fragment,t),T(Ct.$$.fragment,t),T(jt.$$.fragment,t),T(Gt.$$.fragment,t),T(Ue.$$.fragment,t),T(We.$$.fragment,t),T(Ut.$$.fragment,t),T(Wt.$$.fragment,t),T(Vt.$$.fragment,t),T(Be.$$.fragment,t),T(Re.$$.fragment,t),T(Ot.$$.fragment,t),T(Dt.$$.fragment,t),T(Kt.$$.fragment,t),T(Ve.$$.fragment,t),T(Oe.$$.fragment,t),Pr=!0)},o(t){w(i.$$.fragment,t),w(ot.$$.fragment,t),w(st.$$.fragment,t),w(at.$$.fragment,t),w(dt.$$.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(bt.$$.fragment,t),w(kt.$$.fragment,t),w(Nt.$$.fragment,t),w(je.$$.fragment,t),w(qe.$$.fragment,t),w(Pt.$$.fragment,t),w(Xt.$$.fragment,t),w(xt.$$.fragment,t),w(Je.$$.fragment,t),w(Ie.$$.fragment,t),w(Ct.$$.fragment,t),w(jt.$$.fragment,t),w(Gt.$$.fragment,t),w(Ue.$$.fragment,t),w(We.$$.fragment,t),w(Ut.$$.fragment,t),w(Wt.$$.fragment,t),w(Vt.$$.fragment,t),w(Be.$$.fragment,t),w(Re.$$.fragment,t),w(Ot.$$.fragment,t),w(Dt.$$.fragment,t),w(Kt.$$.fragment,t),w(Ve.$$.fragment,t),w(Oe.$$.fragment,t),Pr=!1},d(t){o(p),t&&o(b),t&&o(_),N(i),t&&o(er),t&&o(te),t&&o(tr),t&&o(oe),t&&o(or),t&&o(ne),N(ot),t&&o(nr),t&&o(Ne),t&&o(rr),t&&o(ao),t&&o(sr),t&&o(io),t&&o(ar),t&&o(lo),t&&o(dr),t&&o(Pe),t&&o(ir),t&&o(co),t&&o(lr),t&&o(ho),t&&o(cr),t&&o(re),N(st),t&&o(hr),t&&o(O),t&&o(pr),t&&o(se),N(at),t&&o(ur),t&&o(A),N(dt),t&&o(mr),t&&o(ie),N(lt),t&&o(fr),t&&o(L),N(ct),N(ut),N(ft),N(gt),N(_t),t&&o(gr),t&&o(le),N(bt),t&&o(_r),t&&o(x),N(kt),N(Nt),N(je),N(qe),t&&o(vr),t&&o(pe),N(Pt),t&&o(br),t&&o($),N(Xt),N(xt),N(Je),N(Ie),t&&o(kr),t&&o(fe),N(Ct),t&&o(Mr),t&&o(z),N(jt),N(Gt),N(Ue),N(We),t&&o(yr),t&&o(ve),N(Ut),t&&o(Tr),t&&o(C),N(Wt),N(Vt),N(Be),N(Re),t&&o(wr),t&&o(Me),N(Ot),t&&o(Nr),t&&o(j),N(Dt),N(Kt),N(Ve),N(Oe)}}}const ch={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 hh(P){return Qc(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class vh extends Dc{constructor(p){super();Sc(this,p,hh,lh,Hc,{})}}export{vh as default,ch as metadata};
