import{S as Dc,i as Sc,s as Hc,e as n,k as c,w as v,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,k,_,g,b;return{c(){p=n("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),b=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);k=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),b=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,k),e(p,_),e(_,g),e(p,b)},d(i){i&&o(p)}}}function eh(P){let p,k,_,g,b;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"),k=a("Example:"),_=c(),v(g.$$.fragment)},l(i){p=r(i,"P",{});var m=s(p);k=d(m,"Example:"),m.forEach(o),_=h(i),M(g.$$.fragment,i)},m(i,m){f(i,p,m),e(p,k),f(i,_,m),y(g,i,m),b=!0},p:Qn,i(i){b||(T(g.$$.fragment,i),b=!0)},o(i){w(g.$$.fragment,i),b=!1},d(i){i&&o(p),i&&o(_),N(g,i)}}}function th(P){let p,k,_,g,b;return{c(){p=n("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),b=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);k=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),b=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,k),e(p,_),e(_,g),e(p,b)},d(i){i&&o(p)}}}function oh(P){let p,k,_,g,b;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"),k=a("Example:"),_=c(),v(g.$$.fragment)},l(i){p=r(i,"P",{});var m=s(p);k=d(m,"Example:"),m.forEach(o),_=h(i),M(g.$$.fragment,i)},m(i,m){f(i,p,m),e(p,k),f(i,_,m),y(g,i,m),b=!0},p:Qn,i(i){b||(T(g.$$.fragment,i),b=!0)},o(i){w(g.$$.fragment,i),b=!1},d(i){i&&o(p),i&&o(_),N(g,i)}}}function nh(P){let p,k,_,g,b;return{c(){p=n("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),b=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);k=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),b=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,k),e(p,_),e(_,g),e(p,b)},d(i){i&&o(p)}}}function rh(P){let p,k,_,g,b;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"),k=a("Example:"),_=c(),v(g.$$.fragment)},l(i){p=r(i,"P",{});var m=s(p);k=d(m,"Example:"),m.forEach(o),_=h(i),M(g.$$.fragment,i)},m(i,m){f(i,p,m),e(p,k),f(i,_,m),y(g,i,m),b=!0},p:Qn,i(i){b||(T(g.$$.fragment,i),b=!0)},o(i){w(g.$$.fragment,i),b=!1},d(i){i&&o(p),i&&o(_),N(g,i)}}}function sh(P){let p,k,_,g,b;return{c(){p=n("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),b=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);k=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),b=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,k),e(p,_),e(_,g),e(p,b)},d(i){i&&o(p)}}}function ah(P){let p,k,_,g,b;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"),k=a("Example:"),_=c(),v(g.$$.fragment)},l(i){p=r(i,"P",{});var m=s(p);k=d(m,"Example:"),m.forEach(o),_=h(i),M(g.$$.fragment,i)},m(i,m){f(i,p,m),e(p,k),f(i,_,m),y(g,i,m),b=!0},p:Qn,i(i){b||(T(g.$$.fragment,i),b=!0)},o(i){w(g.$$.fragment,i),b=!1},d(i){i&&o(p),i&&o(_),N(g,i)}}}function dh(P){let p,k,_,g,b;return{c(){p=n("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),b=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);k=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),b=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,k),e(p,_),e(_,g),e(p,b)},d(i){i&&o(p)}}}function ih(P){let p,k,_,g,b;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"),k=a("Example:"),_=c(),v(g.$$.fragment)},l(i){p=r(i,"P",{});var m=s(p);k=d(m,"Example:"),m.forEach(o),_=h(i),M(g.$$.fragment,i)},m(i,m){f(i,p,m),e(p,k),f(i,_,m),y(g,i,m),b=!0},p:Qn,i(i){b||(T(g.$$.fragment,i),b=!0)},o(i){w(g.$$.fragment,i),b=!1},d(i){i&&o(p),i&&o(_),N(g,i)}}}function lh(P){let p,k,_,g,b,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,bs,cr,re,Xe,tn,st,ks,on,vs,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,zs,fo,$s,Es,it,xs,js,Cs,de,qs,go,Fs,Js,_o,Is,Gs,mr,ie,ze,ln,lt,Us,cn,Bs,fr,L,ct,Ws,V,Zs,bo,Rs,As,ko,Vs,Os,ht,Ds,Ss,Hs,pt,Ys,vo,Qs,Ks,ea,D,ut,ta,hn,oa,na,mt,Mo,ra,pn,sa,aa,yo,da,un,ia,la,$e,ft,ca,mn,ha,pa,Ee,gt,ua,fn,ma,fa,xe,_t,ga,bt,_a,gn,ba,ka,gr,le,je,_n,kt,va,bn,Ma,_r,x,vt,ya,Mt,Ta,To,wa,Na,Pa,ce,Xa,yt,La,za,kn,$a,Ea,xa,Tt,ja,wt,Ca,qa,Fa,I,Nt,Ja,he,Ia,wo,Ga,Ua,vn,Ba,Wa,Za,Ce,Ra,qe,br,pe,Fe,Mn,Pt,Aa,yn,Va,kr,z,Xt,Oa,Lt,Da,No,Sa,Ha,Ya,ue,Qa,zt,Ka,ed,Tn,td,od,nd,$t,rd,Et,sd,ad,dd,F,id,wn,ld,cd,Nn,hd,pd,Pn,ud,md,Po,fd,gd,_d,G,xt,bd,me,kd,Xo,vd,Md,Xn,yd,Td,wd,Je,Nd,Ie,vr,fe,Ge,Ln,jt,Pd,zn,Xd,Mr,$,Ct,Ld,qt,zd,Lo,$d,Ed,xd,ge,jd,Ft,Cd,qd,$n,Fd,Jd,Id,Jt,Gd,It,Ud,Bd,Wd,J,Zd,En,Rd,Ad,xn,Vd,Od,jn,Dd,Sd,zo,Hd,Yd,Qd,U,Gt,Kd,_e,ei,$o,ti,oi,Cn,ni,ri,si,Ue,ai,Be,yr,be,We,qn,Ut,di,Fn,ii,Tr,j,Bt,li,Wt,ci,Eo,hi,pi,ui,ke,mi,Zt,fi,gi,Jn,_i,bi,ki,Rt,vi,At,Mi,yi,Ti,B,Vt,wi,ve,Ni,xo,Pi,Xi,In,Li,zi,$i,Ze,Ei,Re,wr,Me,Ae,Gn,Ot,xi,Un,ji,Nr,C,Dt,Ci,St,qi,jo,Fi,Ji,Ii,ye,Gi,Ht,Ui,Bi,Bn,Wi,Zi,Ri,Yt,Ai,Qt,Vi,Oi,Di,W,Kt,Si,Te,Hi,Co,Yi,Qi,Wn,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.33.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.33.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.33.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.33.0/src/transformers/models/xlm_prophetnet/tokenization_xlm_prophetnet.py#L320",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.33.0/src/transformers/models/xlm_prophetnet/tokenization_xlm_prophetnet.py#L298"}}),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.33.0/src/transformers/models/xlm_prophetnet/tokenization_xlm_prophetnet.py#L247",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.33.0/src/transformers/models/xlm_prophetnet/tokenization_xlm_prophetnet.py#L219",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>
`}}),kt=new ee({}),vt=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.33.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.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/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.33.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>
`}}),Ce=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.33.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.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py#L1282",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.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}}}),jt=new ee({}),Ct=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.33.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.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.33.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.33.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.33.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}}}),Be=new Yn({props:{anchor:"transformers.XLMProphetNetDecoder.forward.example",$$slots:{default:[rh]},$$scope:{ctx:P}}}),Ut=new ee({}),Bt=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.33.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.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#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.33.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.33.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.33.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>
`}}),Ze=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.33.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.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.33.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.33.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.33.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"),k=c(),_=n("h1"),g=n("a"),b=n("span"),v(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"),v(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"),bs=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"),v(st.$$.fragment),ks=c(),on=n("span"),vs=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"),v(at.$$.fragment),Ps=c(),dn=n("span"),Xs=a("XLMProphetNetConfig"),ur=c(),A=n("div"),v(dt.$$.fragment),Ls=c(),ae=n("p"),zs=a("This is the configuration class to store the configuration of a "),fo=n("a"),$s=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"),js=a(`
architecture.`),Cs=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"),ze=n("a"),ln=n("span"),v(lt.$$.fragment),Us=c(),cn=n("span"),Bs=a("XLMProphetNetTokenizer"),fr=c(),L=n("div"),v(ct.$$.fragment),Ws=c(),V=n("p"),Zs=a("Adapted from "),bo=n("a"),Rs=a("RobertaTokenizer"),As=a(" and "),ko=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 "),vo=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"),v(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(),$e=n("div"),v(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"),v(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"),v(_t.$$.fragment),ga=c(),bt=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"),ba=a("prepare_for_model"),ka=a(" method."),gr=c(),le=n("h2"),je=n("a"),_n=n("span"),v(kt.$$.fragment),va=c(),bn=n("span"),Ma=a("XLMProphetNetModel"),_r=c(),x=n("div"),v(vt.$$.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"),za=a(`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),kn=n("code"),$a=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Ea=a("."),xa=c(),Tt=n("p"),ja=a("This model is a PyTorch "),wt=n("a"),Ca=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"),v(Nt.$$.fragment),Ja=c(),he=n("p"),Ia=a("The "),wo=n("a"),Ga=a("XLMProphetNetModel"),Ua=a(" forward method, overrides the "),vn=n("code"),Ba=a("__call__"),Wa=a(" special method."),Za=c(),v(Ce.$$.fragment),Ra=c(),v(qe.$$.fragment),br=c(),pe=n("h2"),Fe=n("a"),Mn=n("span"),v(Pt.$$.fragment),Aa=c(),yn=n("span"),Va=a("XLMProphetNetEncoder"),kr=c(),z=n("div"),v(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 "),zt=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(),$t=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"),v(xt.$$.fragment),bd=c(),me=n("p"),kd=a("The "),Xo=n("a"),vd=a("XLMProphetNetEncoder"),Md=a(" forward method, overrides the "),Xn=n("code"),yd=a("__call__"),Td=a(" special method."),wd=c(),v(Je.$$.fragment),Nd=c(),v(Ie.$$.fragment),vr=c(),fe=n("h2"),Ge=n("a"),Ln=n("span"),v(jt.$$.fragment),Pd=c(),zn=n("span"),Xd=a("XLMProphetNetDecoder"),Mr=c(),$=n("div"),v(Ct.$$.fragment),Ld=c(),qt=n("p"),zd=a(`The standalone decoder part of the XLMProphetNetModel.
This model inherits from `),Lo=n("a"),$d=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"),jd=a("Original ProphetNet code can be found "),Ft=n("a"),Cd=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 `),$n=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"),Bd=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),Wd=c(),J=n("p"),Zd=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(", "),jn=n("em"),Dd=a("optional"),Sd=a(`):
The word embedding parameters. This can be used to initialize `),zo=n("a"),Hd=a("XLMProphetNetEncoder"),Yd=a(` with pre-defined word
embeddings instead of randomly initialized word embeddings.`),Qd=c(),U=n("div"),v(Gt.$$.fragment),Kd=c(),_e=n("p"),ei=a("The "),$o=n("a"),ti=a("XLMProphetNetDecoder"),oi=a(" forward method, overrides the "),Cn=n("code"),ni=a("__call__"),ri=a(" special method."),si=c(),v(Ue.$$.fragment),ai=c(),v(Be.$$.fragment),yr=c(),be=n("h2"),We=n("a"),qn=n("span"),v(Ut.$$.fragment),di=c(),Fn=n("span"),ii=a("XLMProphetNetForConditionalGeneration"),Tr=c(),j=n("div"),v(Bt.$$.fragment),li=c(),Wt=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(),ke=n("p"),mi=a("Original ProphetNet code can be found "),Zt=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"),bi=a("."),ki=c(),Rt=n("p"),vi=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(),B=n("div"),v(Vt.$$.fragment),wi=c(),ve=n("p"),Ni=a("The "),xo=n("a"),Pi=a("XLMProphetNetForConditionalGeneration"),Xi=a(" forward method, overrides the "),In=n("code"),Li=a("__call__"),zi=a(" special method."),$i=c(),v(Ze.$$.fragment),Ei=c(),v(Re.$$.fragment),wr=c(),Me=n("h2"),Ae=n("a"),Gn=n("span"),v(Ot.$$.fragment),xi=c(),Un=n("span"),ji=a("XLMProphetNetForCausalLM"),Nr=c(),C=n("div"),v(Dt.$$.fragment),Ci=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 `),jo=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"),Bi=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"),Wi=a("convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Zi=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(),W=n("div"),v(Kt.$$.fragment),Si=c(),Te=n("p"),Hi=a("The "),Co=n("a"),Yi=a("XLMProphetNetForCausalLM"),Qi=a(" forward method, overrides the "),Wn=n("code"),Ki=a("__call__"),el=a(" special method."),tl=c(),v(Ve.$$.fragment),ol=c(),v(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),k=h(t),_=r(t,"H1",{class:!0});var eo=s(_);g=r(eo,"A",{id:!0,class:!0,href:!0});var Zn=s(g);b=r(Zn,"SPAN",{});var Rn=s(b);M(i.$$.fragment,Rn),Rn.forEach(o),Zn.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 zr=s(Pe);ms=d(zr,"The Authors\u2019 code can be found "),rt=r(zr,"A",{href:!0,rel:!0});var fl=s(rt);fs=d(fl,"here"),fl.forEach(o),gs=d(zr,"."),zr.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 bl=s(en);bs=d(bl,"XLM-ProphetNet\u2019s model architecture and pretraining objective is same as ProphetNet, but XLM-ProphetNet was pre-trained on the cross-lingual dataset XGLUE."),bl.forEach(o),_l.forEach(o),cr=h(t),re=r(t,"H2",{class:!0});var $r=s(re);Xe=r($r,"A",{id:!0,class:!0,href:!0});var kl=s(Xe);tn=r(kl,"SPAN",{});var vl=s(tn);M(st.$$.fragment,vl),vl.forEach(o),kl.forEach(o),ks=h($r),on=r($r,"SPAN",{});var Ml=s(on);vs=d(Ml,"Documentation resources"),Ml.forEach(o),$r.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 zl=s(an);M(at.$$.fragment,zl),zl.forEach(o),Ll.forEach(o),Ps=h(Er),dn=r(Er,"SPAN",{});var $l=s(dn);Xs=d($l,"XLMProphetNetConfig"),$l.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);zs=d(Jo,"This is the configuration class to store the configuration of a "),fo=r(Jo,"A",{href:!0});var El=s(fo);$s=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),js=d(Jo,`
architecture.`),Jo.forEach(o),Cs=h(Fo),de=r(Fo,"P",{});var Io=s(de);qs=d(Io,"Configuration objects inherit from "),go=r(Io,"A",{href:!0});var jl=s(go);Fs=d(jl,"PretrainedConfig"),jl.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 Cl=s(_o);Is=d(Cl,"PretrainedConfig"),Cl.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);ze=r(xr,"A",{id:!0,class:!0,href:!0});var ql=s(ze);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);Bs=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),Ws=h(q),V=r(q,"P",{});var Se=s(V);Zs=d(Se,"Adapted from "),bo=r(Se,"A",{href:!0});var Il=s(bo);Rs=d(Il,"RobertaTokenizer"),Il.forEach(o),As=d(Se," and "),ko=r(Se,"A",{href:!0});var Gl=s(ko);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 jr=s(pt);Ys=d(jr,"This tokenizer inherits from "),vo=r(jr,"A",{href:!0});var Bl=s(vo);Qs=d(Bl,"PreTrainedTokenizer"),Bl.forEach(o),Ks=d(jr,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),jr.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 Wl=s(hn);oa=d(Wl,`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:`),Wl.forEach(o),na=h(Go),mt=r(Go,"UL",{});var Cr=s(mt);Mo=r(Cr,"LI",{});var nl=s(Mo);ra=d(nl,"single sequence: "),pn=r(nl,"CODE",{});var Zl=s(pn);sa=d(Zl,"X [SEP]"),Zl.forEach(o),nl.forEach(o),aa=h(Cr),yo=r(Cr,"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),Cr.forEach(o),Go.forEach(o),la=h(q),$e=r(q,"DIV",{class:!0});var qr=s($e);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),bt=r(Jr,"P",{});var Ir=s(bt);_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);ba=d(Ol,"prepare_for_model"),Ol.forEach(o),ka=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);je=r(Gr,"A",{id:!0,class:!0,href:!0});var Dl=s(je);_n=r(Dl,"SPAN",{});var Sl=s(_n);M(kt.$$.fragment,Sl),Sl.forEach(o),Dl.forEach(o),va=h(Gr),bn=r(Gr,"SPAN",{});var Hl=s(bn);Ma=d(Hl,"XLMProphetNetModel"),Hl.forEach(o),Gr.forEach(o),_r=h(t),x=r(t,"DIV",{class:!0});var S=s(x);M(vt.$$.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),za=d(Uo,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),kn=r(Uo,"CODE",{});var Kl=s(kn);$a=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 Br=s(Tt);ja=d(Br,"This model is a PyTorch "),wt=r(Br,"A",{href:!0,rel:!0});var ec=s(wt);Ca=d(ec,"torch.nn.Module"),ec.forEach(o),qa=d(Br,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.`),Br.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 Bo=s(he);Ia=d(Bo,"The "),wo=r(Bo,"A",{href:!0});var tc=s(wo);Ga=d(tc,"XLMProphetNetModel"),tc.forEach(o),Ua=d(Bo," forward method, overrides the "),vn=r(Bo,"CODE",{});var oc=s(vn);Ba=d(oc,"__call__"),oc.forEach(o),Wa=d(Bo," special method."),Bo.forEach(o),Za=h(He),M(Ce.$$.fragment,He),Ra=h(He),M(qe.$$.fragment,He),He.forEach(o),S.forEach(o),br=h(t),pe=r(t,"H2",{class:!0});var Wr=s(pe);Fe=r(Wr,"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(Wr),yn=r(Wr,"SPAN",{});var sc=s(yn);Va=d(sc,"XLMProphetNetEncoder"),sc.forEach(o),Wr.forEach(o),kr=h(t),z=r(t,"DIV",{class:!0});var Z=s(z);M(Xt.$$.fragment,Z),Oa=h(Z),Lt=r(Z,"P",{});var Zr=s(Lt);Da=d(Zr,`The standalone encoder part of the XLMProphetNetModel.
This model inherits from `),No=r(Zr,"A",{href:!0});var ac=s(No);Sa=d(ac,"PreTrainedModel"),ac.forEach(o),Ha=d(Zr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Zr.forEach(o),Ya=h(Z),ue=r(Z,"P",{});var Wo=s(ue);Qa=d(Wo,"Original ProphetNet code can be found "),zt=r(Wo,"A",{href:!0,rel:!0});var dc=s(zt);Ka=d(dc,"here"),dc.forEach(o),ed=d(Wo,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),Tn=r(Wo,"CODE",{});var ic=s(Tn);td=d(ic,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),ic.forEach(o),od=d(Wo,"."),Wo.forEach(o),nd=h(Z),$t=r(Z,"P",{});var Rr=s($t);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(Z),F=r(Z,"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(Z),G=r(Z,"DIV",{class:!0});var Ye=s(G);M(xt.$$.fragment,Ye),bd=h(Ye),me=r(Ye,"P",{});var Zo=s(me);kd=d(Zo,"The "),Xo=r(Zo,"A",{href:!0});var mc=s(Xo);vd=d(mc,"XLMProphetNetEncoder"),mc.forEach(o),Md=d(Zo," forward method, overrides the "),Xn=r(Zo,"CODE",{});var fc=s(Xn);yd=d(fc,"__call__"),fc.forEach(o),Td=d(Zo," special method."),Zo.forEach(o),wd=h(Ye),M(Je.$$.fragment,Ye),Nd=h(Ye),M(Ie.$$.fragment,Ye),Ye.forEach(o),Z.forEach(o),vr=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(jt.$$.fragment,_c),_c.forEach(o),gc.forEach(o),Pd=h(Ar),zn=r(Ar,"SPAN",{});var bc=s(zn);Xd=d(bc,"XLMProphetNetDecoder"),bc.forEach(o),Ar.forEach(o),Mr=h(t),$=r(t,"DIV",{class:!0});var R=s($);M(Ct.$$.fragment,R),Ld=h(R),qt=r(R,"P",{});var Vr=s(qt);zd=d(Vr,`The standalone decoder part of the XLMProphetNetModel.
This model inherits from `),Lo=r(Vr,"A",{href:!0});var kc=s(Lo);$d=d(kc,"PreTrainedModel"),kc.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);jd=d(Ro,"Original ProphetNet code can be found "),Ft=r(Ro,"A",{href:!0,rel:!0});var vc=s(Ft);Cd=d(vc,"here"),vc.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 `),$n=r(Ro,"CODE",{});var Mc=s($n);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),Bd=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),Wd=h(R),J=r(R,"P",{});var Y=s(J);Zd=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,", "),jn=r(Y,"EM",{});var Nc=s(jn);Dd=d(Nc,"optional"),Nc.forEach(o),Sd=d(Y,`):
The word embedding parameters. This can be used to initialize `),zo=r(Y,"A",{href:!0});var Pc=s(zo);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 "),$o=r(Ao,"A",{href:!0});var Xc=s($o);ti=d(Xc,"XLMProphetNetDecoder"),Xc.forEach(o),oi=d(Ao," forward method, overrides the "),Cn=r(Ao,"CODE",{});var Lc=s(Cn);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(Be.$$.fragment,Qe),Qe.forEach(o),R.forEach(o),yr=h(t),be=r(t,"H2",{class:!0});var Dr=s(be);We=r(Dr,"A",{id:!0,class:!0,href:!0});var zc=s(We);qn=r(zc,"SPAN",{});var $c=s(qn);M(Ut.$$.fragment,$c),$c.forEach(o),zc.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),j=r(t,"DIV",{class:!0});var Q=s(j);M(Bt.$$.fragment,Q),li=h(Q),Wt=r(Q,"P",{});var Sr=s(Wt);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),ke=r(Q,"P",{});var Vo=s(ke);mi=d(Vo,"Original ProphetNet code can be found "),Zt=r(Vo,"A",{href:!0,rel:!0});var jc=s(Zt);fi=d(jc,"here"),jc.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 Cc=s(Jn);_i=d(Cc,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Cc.forEach(o),bi=d(Vo,"."),Vo.forEach(o),ki=h(Q),Rt=r(Q,"P",{});var Hr=s(Rt);vi=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),B=r(Q,"DIV",{class:!0});var Ke=s(B);M(Vt.$$.fragment,Ke),wi=h(Ke),ve=r(Ke,"P",{});var Oo=s(ve);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),zi=d(Oo," special method."),Oo.forEach(o),$i=h(Ke),M(Ze.$$.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);ji=d(Uc,"XLMProphetNetForCausalLM"),Uc.forEach(o),Yr.forEach(o),Nr=h(t),C=r(t,"DIV",{class:!0});var K=s(C);M(Dt.$$.fragment,K),Ci=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 `),jo=r(Qr,"A",{href:!0});var Bc=s(jo);Fi=d(Bc,"PreTrainedModel"),Bc.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 Wc=s(Ht);Ui=d(Wc,"here"),Wc.forEach(o),Bi=d(Do,`. Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `),Bn=r(Do,"CODE",{});var Zc=s(Bn);Wi=d(Zc,"convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py"),Zc.forEach(o),Zi=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),W=r(K,"DIV",{class:!0});var et=s(W);M(Kt.$$.fragment,et),Si=h(et),Te=r(et,"P",{});var So=s(Te);Hi=d(So,"The "),Co=r(So,"A",{href:!0});var Ac=s(Co);Yi=d(Ac,"XLMProphetNetForCausalLM"),Ac.forEach(o),Qi=d(So," forward method, overrides the "),Wn=r(So,"CODE",{});var Vc=s(Wn);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.33.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.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(_o,"href","/docs/transformers/v4.33.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(ze,"id","transformers.XLMProphetNetTokenizer"),l(ze,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ze,"href","#transformers.XLMProphetNetTokenizer"),l(ie,"class","relative group"),l(bo,"href","/docs/transformers/v4.33.0/en/model_doc/roberta#transformers.RobertaTokenizer"),l(ko,"href","/docs/transformers/v4.33.0/en/model_doc/xlnet#transformers.XLNetTokenizer"),l(ht,"href","https://github.com/google/sentencepiece"),l(ht,"rel","nofollow"),l(vo,"href","/docs/transformers/v4.33.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($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(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(je,"id","transformers.XLMProphetNetModel"),l(je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(je,"href","#transformers.XLMProphetNetModel"),l(le,"class","relative group"),l(To,"href","/docs/transformers/v4.33.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.33.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.33.0/en/main_classes/model#transformers.PreTrainedModel"),l(zt,"href","https://github.com/microsoft/ProphetNet"),l(zt,"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.33.0/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetEncoder"),l(Xo,"href","/docs/transformers/v4.33.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(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(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.33.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(zo,"href","/docs/transformers/v4.33.0/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetEncoder"),l($o,"href","/docs/transformers/v4.33.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($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(We,"id","transformers.XLMProphetNetForConditionalGeneration"),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","#transformers.XLMProphetNetForConditionalGeneration"),l(be,"class","relative group"),l(Eo,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),l(Zt,"href","https://github.com/microsoft/ProphetNet"),l(Zt,"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.33.0/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetForConditionalGeneration"),l(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(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(jo,"href","/docs/transformers/v4.33.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(Co,"href","/docs/transformers/v4.33.0/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetForCausalLM"),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")},m(t,u){e(document.head,p),f(t,k,u),f(t,_,u),e(_,g),e(g,b),y(i,b,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,bs),f(t,cr,u),f(t,re,u),e(re,Xe),e(Xe,tn),y(st,tn,null),e(re,ks),e(re,on),e(on,vs),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,zs),e(ae,fo),e(fo,$s),e(ae,Es),e(ae,it),e(it,xs),e(ae,js),e(A,Cs),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,ze),e(ze,ln),y(lt,ln,null),e(ie,Us),e(ie,cn),e(cn,Bs),f(t,fr,u),f(t,L,u),y(ct,L,null),e(L,Ws),e(L,V),e(V,Zs),e(V,bo),e(bo,Rs),e(V,As),e(V,ko),e(ko,Vs),e(V,Os),e(V,ht),e(ht,Ds),e(V,Ss),e(L,Hs),e(L,pt),e(pt,Ys),e(pt,vo),e(vo,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,$e),y(ft,$e,null),e($e,ca),e($e,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,bt),e(bt,_a),e(bt,gn),e(gn,ba),e(bt,ka),f(t,gr,u),f(t,le,u),e(le,je),e(je,_n),y(kt,_n,null),e(le,va),e(le,bn),e(bn,Ma),f(t,_r,u),f(t,x,u),y(vt,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,za),e(ce,kn),e(kn,$a),e(ce,Ea),e(x,xa),e(x,Tt),e(Tt,ja),e(Tt,wt),e(wt,Ca),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,vn),e(vn,Ba),e(he,Wa),e(I,Za),y(Ce,I,null),e(I,Ra),y(qe,I,null),f(t,br,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,kr,u),f(t,z,u),y(Xt,z,null),e(z,Oa),e(z,Lt),e(Lt,Da),e(Lt,No),e(No,Sa),e(Lt,Ha),e(z,Ya),e(z,ue),e(ue,Qa),e(ue,zt),e(zt,Ka),e(ue,ed),e(ue,Tn),e(Tn,td),e(ue,od),e(z,nd),e(z,$t),e($t,rd),e($t,Et),e(Et,sd),e($t,ad),e(z,dd),e(z,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(z,_d),e(z,G),y(xt,G,null),e(G,bd),e(G,me),e(me,kd),e(me,Xo),e(Xo,vd),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,vr,u),f(t,fe,u),e(fe,Ge),e(Ge,Ln),y(jt,Ln,null),e(fe,Pd),e(fe,zn),e(zn,Xd),f(t,Mr,u),f(t,$,u),y(Ct,$,null),e($,Ld),e($,qt),e(qt,zd),e(qt,Lo),e(Lo,$d),e(qt,Ed),e($,xd),e($,ge),e(ge,jd),e(ge,Ft),e(Ft,Cd),e(ge,qd),e(ge,$n),e($n,Fd),e(ge,Jd),e($,Id),e($,Jt),e(Jt,Gd),e(Jt,It),e(It,Ud),e(Jt,Bd),e($,Wd),e($,J),e(J,Zd),e(J,En),e(En,Rd),e(J,Ad),e(J,xn),e(xn,Vd),e(J,Od),e(J,jn),e(jn,Dd),e(J,Sd),e(J,zo),e(zo,Hd),e(J,Yd),e($,Qd),e($,U),y(Gt,U,null),e(U,Kd),e(U,_e),e(_e,ei),e(_e,$o),e($o,ti),e(_e,oi),e(_e,Cn),e(Cn,ni),e(_e,ri),e(U,si),y(Ue,U,null),e(U,ai),y(Be,U,null),f(t,yr,u),f(t,be,u),e(be,We),e(We,qn),y(Ut,qn,null),e(be,di),e(be,Fn),e(Fn,ii),f(t,Tr,u),f(t,j,u),y(Bt,j,null),e(j,li),e(j,Wt),e(Wt,ci),e(Wt,Eo),e(Eo,hi),e(Wt,pi),e(j,ui),e(j,ke),e(ke,mi),e(ke,Zt),e(Zt,fi),e(ke,gi),e(ke,Jn),e(Jn,_i),e(ke,bi),e(j,ki),e(j,Rt),e(Rt,vi),e(Rt,At),e(At,Mi),e(Rt,yi),e(j,Ti),e(j,B),y(Vt,B,null),e(B,wi),e(B,ve),e(ve,Ni),e(ve,xo),e(xo,Pi),e(ve,Xi),e(ve,In),e(In,Li),e(ve,zi),e(B,$i),y(Ze,B,null),e(B,Ei),y(Re,B,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,ji),f(t,Nr,u),f(t,C,u),y(Dt,C,null),e(C,Ci),e(C,St),e(St,qi),e(St,jo),e(jo,Fi),e(St,Ji),e(C,Ii),e(C,ye),e(ye,Gi),e(ye,Ht),e(Ht,Ui),e(ye,Bi),e(ye,Bn),e(Bn,Wi),e(ye,Zi),e(C,Ri),e(C,Yt),e(Yt,Ai),e(Yt,Qt),e(Qt,Vi),e(Yt,Oi),e(C,Di),e(C,W),y(Kt,W,null),e(W,Si),e(W,Te),e(Te,Hi),e(Te,Co),e(Co,Yi),e(Te,Qi),e(Te,Wn),e(Wn,Ki),e(Te,el),e(W,tl),y(Ve,W,null),e(W,ol),y(Oe,W,null),Pr=!0},p(t,[u]){const eo={};u&2&&(eo.$$scope={dirty:u,ctx:t}),Ce.$set(eo);const Zn={};u&2&&(Zn.$$scope={dirty:u,ctx:t}),qe.$set(Zn);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}),Be.$set(Vn);const On={};u&2&&(On.$$scope={dirty:u,ctx:t}),Ze.$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(kt.$$.fragment,t),T(vt.$$.fragment,t),T(Nt.$$.fragment,t),T(Ce.$$.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(jt.$$.fragment,t),T(Ct.$$.fragment,t),T(Gt.$$.fragment,t),T(Ue.$$.fragment,t),T(Be.$$.fragment,t),T(Ut.$$.fragment,t),T(Bt.$$.fragment,t),T(Vt.$$.fragment,t),T(Ze.$$.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(kt.$$.fragment,t),w(vt.$$.fragment,t),w(Nt.$$.fragment,t),w(Ce.$$.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(jt.$$.fragment,t),w(Ct.$$.fragment,t),w(Gt.$$.fragment,t),w(Ue.$$.fragment,t),w(Be.$$.fragment,t),w(Ut.$$.fragment,t),w(Bt.$$.fragment,t),w(Vt.$$.fragment,t),w(Ze.$$.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(k),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(kt),t&&o(_r),t&&o(x),N(vt),N(Nt),N(Ce),N(qe),t&&o(br),t&&o(pe),N(Pt),t&&o(kr),t&&o(z),N(Xt),N(xt),N(Je),N(Ie),t&&o(vr),t&&o(fe),N(jt),t&&o(Mr),t&&o($),N(Ct),N(Gt),N(Ue),N(Be),t&&o(yr),t&&o(be),N(Ut),t&&o(Tr),t&&o(j),N(Bt),N(Vt),N(Ze),N(Re),t&&o(wr),t&&o(Me),N(Ot),t&&o(Nr),t&&o(C),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 bh extends Dc{constructor(p){super();Sc(this,p,hh,lh,Hc,{})}}export{bh as default,ch as metadata};
