import{S as Ah,i as Wh,s as Bh,e as n,k as l,w as T,t as a,M as Lh,c as r,d as o,m as h,a as s,x as b,h as d,b as c,N as Dh,G as e,g as m,y as k,q as w,o as M,B as N,v as Rh,L as cn}from"../../chunks/vendor-hf-doc-builder.js";import{T as Tr}from"../../chunks/Tip-hf-doc-builder.js";import{D as $}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ln}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as L}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as dn}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Xh(P){let p,v,g,_,y;return _=new ln({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){p=n("p"),v=a("sequence pair mask has the following format:"),g=l(),T(_.$$.fragment)},l(i){p=r(i,"P",{});var f=s(p);v=d(f,"sequence pair mask has the following format:"),f.forEach(o),g=h(i),b(_.$$.fragment,i)},m(i,f){m(i,p,f),e(p,v),m(i,g,f),k(_,i,f),y=!0},p:cn,i(i){y||(w(_.$$.fragment,i),y=!0)},o(i){M(_.$$.fragment,i),y=!1},d(i){i&&o(p),i&&o(g),N(_,i)}}}function Hh(P){let p,v,g,_,y;return{c(){p=n("p"),v=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),y=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 f=s(p);v=d(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(f,"CODE",{});var z=s(g);_=d(z,"Module"),z.forEach(o),y=d(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(i,f){m(i,p,f),e(p,v),e(p,g),e(g,_),e(p,y)},d(i){i&&o(p)}}}function Qh(P){let p,v,g,_,y;return _=new ln({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBQcm9waGV0TmV0TW9kZWwlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZwcm9waGV0bmV0LWxhcmdlLXVuY2FzZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBQcm9waGV0TmV0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRnByb3BoZXRuZXQtbGFyZ2UtdW5jYXNlZCUyMiklMEElMEFpbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIoJTBBJTIwJTIwJTIwJTIwJTIyU3R1ZGllcyUyMGhhdmUlMjBiZWVuJTIwc2hvd24lMjB0aGF0JTIwb3duaW5nJTIwYSUyMGRvZyUyMGlzJTIwZ29vZCUyMGZvciUyMHlvdSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMEEpLmlucHV0X2lkcyUyMCUyMCUyMyUyMEJhdGNoJTIwc2l6ZSUyMDElMEFkZWNvZGVyX2lucHV0X2lkcyUyMCUzRCUyMHRva2VuaXplciglMjJTdHVkaWVzJTIwc2hvdyUyMHRoYXQlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF9pZHMlMjAlMjAlMjMlMjBCYXRjaCUyMHNpemUlMjAxJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0X2lkcyUzRGlucHV0X2lkcyUyQyUyMGRlY29kZXJfaW5wdXRfaWRzJTNEZGVjb2Rlcl9pbnB1dF9pZHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUyMCUyMCUyMyUyMG1haW4lMjBzdHJlYW0lMjBoaWRkZW4lMjBzdGF0ZXMlMEFsYXN0X2hpZGRlbl9zdGF0ZXNfbmdyYW0lMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlX25ncmFtJTIwJTIwJTIzJTIwcHJlZGljdCUyMGhpZGRlbiUyMHN0YXRlcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ProphetNetModel

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;microsoft/prophetnet-large-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ProphetNetEncoder.from_pretrained(<span class="hljs-string">&quot;patrickvonplaten/prophetnet-large-uncased-standalone&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;microsoft/prophetnet-large-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ProphetNetDecoder.from_pretrained(<span class="hljs-string">&quot;microsoft/prophetnet-large-uncased&quot;</span>, add_cross_attention=<span class="hljs-literal">False</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>logits_next_token = outputs.logits  <span class="hljs-comment"># logits to predict next token as usual</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_ngram_next_tokens = outputs.logits_ngram  <span class="hljs-comment"># logits to predict 2nd, 3rd, ... next tokens</span>`}}),{c(){p=n("p"),v=a("Example:"),g=l(),T(_.$$.fragment)},l(i){p=r(i,"P",{});var f=s(p);v=d(f,"Example:"),f.forEach(o),g=h(i),b(_.$$.fragment,i)},m(i,f){m(i,p,f),e(p,v),m(i,g,f),k(_,i,f),y=!0},p:cn,i(i){y||(w(_.$$.fragment,i),y=!0)},o(i){M(_.$$.fragment,i),y=!1},d(i){i&&o(p),i&&o(g),N(_,i)}}}function rp(P){let p,v,g,_,y;return{c(){p=n("p"),v=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),y=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 f=s(p);v=d(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(f,"CODE",{});var z=s(g);_=d(z,"Module"),z.forEach(o),y=d(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(i,f){m(i,p,f),e(p,v),e(p,g),e(g,_),e(p,y)},d(i){i&&o(p)}}}function sp(P){let p,v,g,_,y;return _=new ln({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBQcm9waGV0TmV0Rm9yQ2F1c2FsTE0lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRnByb3BoZXRuZXQtbGFyZ2UtdW5jYXNlZCUyMiklMEFtb2RlbCUyMCUzRCUyMFByb3BoZXROZXRGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGcHJvcGhldG5ldC1sYXJnZS11bmNhc2VkJTIyKSUwQWFzc2VydCUyMG1vZGVsLmNvbmZpZy5pc19kZWNvZGVyJTJDJTIwZiUyMiU3Qm1vZGVsLl9fY2xhc3NfXyU3RCUyMGhhcyUyMHRvJTIwYmUlMjBjb25maWd1cmVkJTIwYXMlMjBhJTIwZGVjb2Rlci4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBJTBBJTIzJTIwTW9kZWwlMjBjYW4lMjBhbHNvJTIwYmUlMjB1c2VkJTIwd2l0aCUyMEVuY29kZXJEZWNvZGVyJTIwZnJhbWV3b3JrJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJlcnRUb2tlbml6ZXIlMkMlMjBFbmNvZGVyRGVjb2Rlck1vZGVsJTJDJTIwQXV0b1Rva2VuaXplciUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyX2VuYyUyMCUzRCUyMEJlcnRUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmJlcnQtbGFyZ2UtdW5jYXNlZCUyMiklMEF0b2tlbml6ZXJfZGVjJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGcHJvcGhldG5ldC1sYXJnZS11bmNhc2VkJTIyKSUwQW1vZGVsJTIwJTNEJTIwRW5jb2RlckRlY29kZXJNb2RlbC5mcm9tX2VuY29kZXJfZGVjb2Rlcl9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmJlcnQtbGFyZ2UtdW5jYXNlZCUyMiUyQyUyMCUyMm1pY3Jvc29mdCUyRnByb3BoZXRuZXQtbGFyZ2UtdW5jYXNlZCUyMiUwQSklMEElMEFBUlRJQ0xFJTIwJTNEJTIwKCUwQSUyMCUyMCUyMCUyMCUyMnRoZSUyMHVzJTIwc3RhdGUlMjBkZXBhcnRtZW50JTIwc2FpZCUyMHdlZG5lc2RheSUyMGl0JTIwaGFkJTIwcmVjZWl2ZWQlMjBubyUyMCUyMiUwQSUyMCUyMCUyMCUyMCUyMmZvcm1hbCUyMHdvcmQlMjBmcm9tJTIwYm9saXZpYSUyMHRoYXQlMjBpdCUyMHdhcyUyMGV4cGVsbGluZyUyMHRoZSUyMHVzJTIwYW1iYXNzYWRvciUyMHRoZXJlJTIwJTIyJTBBJTIwJTIwJTIwJTIwJTIyYnV0JTIwc2FpZCUyMHRoZSUyMGNoYXJnZXMlMjBtYWRlJTIwYWdhaW5zdCUyMGhpbSUyMGFyZSUyMCU2MCU2MCUyMGJhc2VsZXNzJTIwLiUyMiUwQSklMEFpbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXJfZW5jKEFSVElDTEUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF9pZHMlMEFsYWJlbHMlMjAlM0QlMjB0b2tlbml6ZXJfZGVjKCUwQSUyMCUyMCUyMCUyMCUyMnVzJTIwcmVqZWN0cyUyMGNoYXJnZXMlMjBhZ2FpbnN0JTIwaXRzJTIwYW1iYXNzYWRvciUyMGluJTIwYm9saXZpYSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMEEpLmlucHV0X2lkcyUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dF9pZHMlM0RpbnB1dF9pZHMlMkMlMjBkZWNvZGVyX2lucHV0X2lkcyUzRGxhYmVscyU1QiUzQSUyQyUyMCUzQS0xJTVEJTJDJTIwbGFiZWxzJTNEbGFiZWxzJTVCJTNBJTJDJTIwMSUzQSU1RCklMEElMEFsb3NzJTIwJTNEJTIwb3V0cHV0cy5sb3Nz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ProphetNetForCausalLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;microsoft/prophetnet-large-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ProphetNetForCausalLM.from_pretrained(<span class="hljs-string">&quot;microsoft/prophetnet-large-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> model.config.is_decoder, <span class="hljs-string">f&quot;<span class="hljs-subst">{model.__class__}</span> has to be configured as a decoder.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Model can also be used with EncoderDecoder framework</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer, EncoderDecoderModel, AutoTokenizer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

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

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