import{S as as,i as ss,s as is,e as a,k as h,w as v,t as n,M as ls,c as s,d as o,m as p,a as i,x as T,h as r,b as d,G as e,g as u,y as k,q as w,o as M,B,v as ds,L as Kr}from"../../chunks/vendor-hf-doc-builder.js";import{T as rs}from"../../chunks/Tip-hf-doc-builder.js";import{D as Oe}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Yt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as kt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Qr}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function cs(U){let m,y,_,f,b;return f=new Yt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJlcnRHZW5lcmF0aW9uQ29uZmlnJTJDJTIwQmVydEdlbmVyYXRpb25FbmNvZGVyJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEJlcnRHZW5lcmF0aW9uJTIwY29uZmlnJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMEJlcnRHZW5lcmF0aW9uQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGNvbmZpZyUwQW1vZGVsJTIwJTNEJTIwQmVydEdlbmVyYXRpb25FbmNvZGVyKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertGenerationConfig, BertGenerationEncoder

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BertGeneration config</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BertGenerationConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the config</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertGenerationEncoder(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){m=a("p"),y=n("Examples:"),_=h(),v(f.$$.fragment)},l(l){m=s(l,"P",{});var g=i(m);y=r(g,"Examples:"),g.forEach(o),_=p(l),T(f.$$.fragment,l)},m(l,g){u(l,m,g),e(m,y),u(l,_,g),k(f,l,g),b=!0},p:Kr,i(l){b||(w(f.$$.fragment,l),b=!0)},o(l){M(f.$$.fragment,l),b=!1},d(l){l&&o(m),l&&o(_),B(f,l)}}}function hs(U){let m,y,_,f,b;return{c(){m=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),f=n("Module"),b=n(`
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(l){m=s(l,"P",{});var g=i(m);y=r(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(g,"CODE",{});var q=i(_);f=r(q,"Module"),q.forEach(o),b=r(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(l,g){u(l,m,g),e(m,y),e(m,_),e(_,f),e(m,b)},d(l){l&&o(m)}}}function ps(U){let m,y,_,f,b;return f=new Yt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCZXJ0R2VuZXJhdGlvbkVuY29kZXIlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmJlcnRfZm9yX3NlcV9nZW5lcmF0aW9uX0wtMjRfYmJjX2VuY29kZXIlMjIpJTBBbW9kZWwlMjAlM0QlMjBCZXJ0R2VuZXJhdGlvbkVuY29kZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmJlcnRfZm9yX3NlcV9nZW5lcmF0aW9uX0wtMjRfYmJjX2VuY29kZXIlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertGenerationEncoder
<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;google/bert_for_seq_generation_L-24_bbc_encoder&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertGenerationEncoder.from_pretrained(<span class="hljs-string">&quot;google/bert_for_seq_generation_L-24_bbc_encoder&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(){m=a("p"),y=n("Example:"),_=h(),v(f.$$.fragment)},l(l){m=s(l,"P",{});var g=i(m);y=r(g,"Example:"),g.forEach(o),_=p(l),T(f.$$.fragment,l)},m(l,g){u(l,m,g),e(m,y),u(l,_,g),k(f,l,g),b=!0},p:Kr,i(l){b||(w(f.$$.fragment,l),b=!0)},o(l){M(f.$$.fragment,l),b=!1},d(l){l&&o(m),l&&o(_),B(f,l)}}}function ms(U){let m,y,_,f,b;return{c(){m=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),f=n("Module"),b=n(`
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(l){m=s(l,"P",{});var g=i(m);y=r(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(g,"CODE",{});var q=i(_);f=r(q,"Module"),q.forEach(o),b=r(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(l,g){u(l,m,g),e(m,y),e(m,_),e(_,f),e(m,b)},d(l){l&&o(m)}}}function us(U){let m,y,_,f,b;return f=new Yt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCZXJ0R2VuZXJhdGlvbkRlY29kZXIlMkMlMjBCZXJ0R2VuZXJhdGlvbkNvbmZpZyUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGYmVydF9mb3Jfc2VxX2dlbmVyYXRpb25fTC0yNF9iYmNfZW5jb2RlciUyMiklMEFjb25maWclMjAlM0QlMjBCZXJ0R2VuZXJhdGlvbkNvbmZpZy5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGYmVydF9mb3Jfc2VxX2dlbmVyYXRpb25fTC0yNF9iYmNfZW5jb2RlciUyMiklMEFjb25maWcuaXNfZGVjb2RlciUyMCUzRCUyMFRydWUlMEFtb2RlbCUyMCUzRCUyMEJlcnRHZW5lcmF0aW9uRGVjb2Rlci5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyZ29vZ2xlJTJGYmVydF9mb3Jfc2VxX2dlbmVyYXRpb25fTC0yNF9iYmNfZW5jb2RlciUyMiUyQyUyMGNvbmZpZyUzRGNvbmZpZyUwQSklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90b2tlbl90eXBlX2lkcyUzREZhbHNlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBcHJlZGljdGlvbl9sb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertGenerationDecoder, BertGenerationConfig
<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;google/bert_for_seq_generation_L-24_bbc_encoder&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config = BertGenerationConfig.from_pretrained(<span class="hljs-string">&quot;google/bert_for_seq_generation_L-24_bbc_encoder&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config.is_decoder = <span class="hljs-literal">True</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertGenerationDecoder.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;google/bert_for_seq_generation_L-24_bbc_encoder&quot;</span>, config=config
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_token_type_ids=<span class="hljs-literal">False</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>prediction_logits = outputs.logits`}}),{c(){m=a("p"),y=n("Example:"),_=h(),v(f.$$.fragment)},l(l){m=s(l,"P",{});var g=i(m);y=r(g,"Example:"),g.forEach(o),_=p(l),T(f.$$.fragment,l)},m(l,g){u(l,m,g),e(m,y),u(l,_,g),k(f,l,g),b=!0},p:Kr,i(l){b||(w(f.$$.fragment,l),b=!0)},o(l){M(f.$$.fragment,l),b=!1},d(l){l&&o(m),l&&o(_),B(f,l)}}}function fs(U){let m,y,_,f,b,l,g,q,Ro,Ht,N,H,wt,pe,Co,Mt,qo,Qt,I,Io,Le,Vo,xo,me,Wo,No,Kt,Ye,Xo,eo,He,Bt,Po,to,Qe,So,oo,Ke,ue,Fo,et,Ao,Do,no,fe,ro,tt,ge,Oo,ot,Lo,Yo,ao,_e,so,nt,Ho,io,Q,V,rt,Qo,Ko,at,en,tn,Gt,on,nn,rn,Et,an,lo,x,sn,be,ln,dn,ye,cn,hn,co,X,K,Jt,ve,pn,zt,mn,ho,j,Te,un,P,fn,$t,gn,_n,ke,bn,yn,vn,S,Tn,st,kn,wn,it,Mn,Bn,Gn,ee,po,F,te,jt,we,En,Zt,Jn,mo,Z,Me,zn,Be,$n,Ge,jn,Zn,Un,Ee,Rn,lt,Cn,qn,In,dt,Je,uo,A,oe,Ut,ze,Vn,Rt,xn,fo,G,$e,Wn,Ct,Nn,Xn,je,Pn,ct,Sn,Fn,An,Ze,Dn,Ue,On,Ln,Yn,Re,Hn,Ce,Qn,Kn,er,D,tr,ht,or,nr,qe,rr,ar,sr,E,ir,qt,lr,dr,It,cr,hr,Vt,pr,mr,xt,ur,fr,Wt,gr,_r,Nt,br,yr,vr,R,Ie,Tr,O,kr,pt,wr,Mr,Xt,Br,Gr,Er,ne,Jr,re,go,L,ae,Pt,Ve,zr,St,$r,_o,z,xe,jr,We,Zr,Ft,Ur,Rr,Cr,Ne,qr,mt,Ir,Vr,xr,Xe,Wr,Pe,Nr,Xr,Pr,C,Se,Sr,Y,Fr,ut,Ar,Dr,At,Or,Lr,Yr,se,Hr,ie,bo;return l=new kt({}),pe=new kt({}),fe=new Yt({props:{code:"JTIzJTIwbGV2ZXJhZ2UlMjBjaGVja3BvaW50cyUyMGZvciUyMEJlcnQyQmVydCUyMG1vZGVsLi4uJTBBJTIzJTIwdXNlJTIwQkVSVCdzJTIwY2xzJTIwdG9rZW4lMjBhcyUyMEJPUyUyMHRva2VuJTIwYW5kJTIwc2VwJTIwdG9rZW4lMjBhcyUyMEVPUyUyMHRva2VuJTBBZW5jb2RlciUyMCUzRCUyMEJlcnRHZW5lcmF0aW9uRW5jb2Rlci5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1sYXJnZS11bmNhc2VkJTIyJTJDJTIwYm9zX3Rva2VuX2lkJTNEMTAxJTJDJTIwZW9zX3Rva2VuX2lkJTNEMTAyKSUwQSUyMyUyMGFkZCUyMGNyb3NzJTIwYXR0ZW50aW9uJTIwbGF5ZXJzJTIwYW5kJTIwdXNlJTIwQkVSVCdzJTIwY2xzJTIwdG9rZW4lMjBhcyUyMEJPUyUyMHRva2VuJTIwYW5kJTIwc2VwJTIwdG9rZW4lMjBhcyUyMEVPUyUyMHRva2VuJTBBZGVjb2RlciUyMCUzRCUyMEJlcnRHZW5lcmF0aW9uRGVjb2Rlci5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyYmVydC1sYXJnZS11bmNhc2VkJTIyJTJDJTIwYWRkX2Nyb3NzX2F0dGVudGlvbiUzRFRydWUlMkMlMjBpc19kZWNvZGVyJTNEVHJ1ZSUyQyUyMGJvc190b2tlbl9pZCUzRDEwMSUyQyUyMGVvc190b2tlbl9pZCUzRDEwMiUwQSklMEFiZXJ0MmJlcnQlMjAlM0QlMjBFbmNvZGVyRGVjb2Rlck1vZGVsKGVuY29kZXIlM0RlbmNvZGVyJTJDJTIwZGVjb2RlciUzRGRlY29kZXIpJTBBJTBBJTIzJTIwY3JlYXRlJTIwdG9rZW5pemVyLi4uJTBBdG9rZW5pemVyJTIwJTNEJTIwQmVydFRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1sYXJnZS11bmNhc2VkJTIyKSUwQSUwQWlucHV0X2lkcyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlMjJUaGlzJTIwaXMlMjBhJTIwbG9uZyUyMGFydGljbGUlMjB0byUyMHN1bW1hcml6ZSUyMiUyQyUyMGFkZF9zcGVjaWFsX3Rva2VucyUzREZhbHNlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUwQSkuaW5wdXRfaWRzJTBBbGFiZWxzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlRoaXMlMjBpcyUyMGElMjBzaG9ydCUyMHN1bW1hcnklMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF9pZHMlMEElMEElMjMlMjB0cmFpbi4uLiUwQWxvc3MlMjAlM0QlMjBiZXJ0MmJlcnQoaW5wdXRfaWRzJTNEaW5wdXRfaWRzJTJDJTIwZGVjb2Rlcl9pbnB1dF9pZHMlM0RsYWJlbHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMpLmxvc3MlMEFsb3NzLmJhY2t3YXJkKCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># leverage checkpoints for Bert2Bert model...</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># use BERT&#x27;s cls token as BOS token and sep token as EOS token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoder = BertGenerationEncoder.from_pretrained(<span class="hljs-string">&quot;bert-large-uncased&quot;</span>, bos_token_id=<span class="hljs-number">101</span>, eos_token_id=<span class="hljs-number">102</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># add cross attention layers and use BERT&#x27;s cls token as BOS token and sep token as EOS token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder = BertGenerationDecoder.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;bert-large-uncased&quot;</span>, add_cross_attention=<span class="hljs-literal">True</span>, is_decoder=<span class="hljs-literal">True</span>, bos_token_id=<span class="hljs-number">101</span>, eos_token_id=<span class="hljs-number">102</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>bert2bert = EncoderDecoderModel(encoder=encoder, decoder=decoder)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># create tokenizer...</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-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;This is a long article to summarize&quot;</span>, add_special_tokens=<span class="hljs-literal">False</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>labels = tokenizer(<span class="hljs-string">&quot;This is a short summary&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># train...</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = bert2bert(input_ids=input_ids, decoder_input_ids=labels, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span>loss.backward()`}}),_e=new Yt({props:{code:"JTIzJTIwaW5zdGFudGlhdGUlMjBzZW50ZW5jZSUyMGZ1c2lvbiUyMG1vZGVsJTBBc2VudGVuY2VfZnVzZXIlMjAlM0QlMjBFbmNvZGVyRGVjb2Rlck1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZyb2JlcnRhMnJvYmVydGFfTC0yNF9kaXNjb2Z1c2UlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGcm9iZXJ0YTJyb2JlcnRhX0wtMjRfZGlzY29mdXNlJTIyKSUwQSUwQWlucHV0X2lkcyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlMjJUaGlzJTIwaXMlMjB0aGUlMjBmaXJzdCUyMHNlbnRlbmNlLiUyMFRoaXMlMjBpcyUyMHRoZSUyMHNlY29uZCUyMHNlbnRlbmNlLiUyMiUyQyUyMGFkZF9zcGVjaWFsX3Rva2VucyUzREZhbHNlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUwQSkuaW5wdXRfaWRzJTBBJTBBb3V0cHV0cyUyMCUzRCUyMHNlbnRlbmNlX2Z1c2VyLmdlbmVyYXRlKGlucHV0X2lkcyklMEElMEFwcmludCh0b2tlbml6ZXIuZGVjb2RlKG91dHB1dHMlNUIwJTVEKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># instantiate sentence fusion model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>sentence_fuser = EncoderDecoderModel.from_pretrained(<span class="hljs-string">&quot;google/roberta2roberta_L-24_discofuse&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/roberta2roberta_L-24_discofuse&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;This is the first sentence. This is the second sentence.&quot;</span>, add_special_tokens=<span class="hljs-literal">False</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 = sentence_fuser.generate(input_ids)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(outputs[<span class="hljs-number">0</span>]))`}}),ve=new kt({}),Te=new Oe({props:{name:"class transformers.BertGenerationConfig",anchor:"transformers.BertGenerationConfig",parameters:[{name:"vocab_size",val:" = 50358"},{name:"hidden_size",val:" = 1024"},{name:"num_hidden_layers",val:" = 24"},{name:"num_attention_heads",val:" = 16"},{name:"intermediate_size",val:" = 4096"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 2"},{name:"eos_token_id",val:" = 1"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BertGenerationConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50358) &#x2014;
Vocabulary size of the BERT model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <code>BertGeneration</code>.`,name:"vocab_size"},{anchor:"transformers.BertGenerationConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.BertGenerationConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.BertGenerationConfig.num_attention_heads",description:`<strong>num_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_attention_heads"},{anchor:"transformers.BertGenerationConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often called feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.BertGenerationConfig.hidden_act",description:`<strong>hidden_act</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:"hidden_act"},{anchor:"transformers.BertGenerationConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</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:"hidden_dropout_prob"},{anchor:"transformers.BertGenerationConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.BertGenerationConfig.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.BertGenerationConfig.initializer_range",description:`<strong>initializer_range</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:"initializer_range"},{anchor:"transformers.BertGenerationConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.BertGenerationConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.BertGenerationConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model is used as a decoder or not. If <code>False</code>, the model is used as an encoder.`,name:"is_decoder"},{anchor:"transformers.BertGenerationConfig.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). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bert_generation/configuration_bert_generation.py#L20"}}),ee=new Qr({props:{anchor:"transformers.BertGenerationConfig.example",$$slots:{default:[cs]},$$scope:{ctx:U}}}),we=new kt({}),Me=new Oe({props:{name:"class transformers.BertGenerationTokenizer",anchor:"transformers.BertGenerationTokenizer",parameters:[{name:"vocab_file",val:""},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"sep_token",val:" = '<::::>'"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BertGenerationTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a <em>.spm</em> extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.BertGenerationTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.BertGenerationTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The begin of sequence token.`,name:"bos_token"},{anchor:"transformers.BertGenerationTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.BertGenerationTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.BertGenerationTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:</p>
<ul>
<li>
<p><code>enable_sampling</code>: Enable subword regularization.</p>
</li>
<li>
<p><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.</p>
<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul>
</li>
<li>
<p><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</p>
</li>
</ul>`,name:"sp_model_kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bert_generation/tokenization_bert_generation.py#L43"}}),Je=new Oe({props:{name:"save_vocabulary",anchor:"transformers.BertGenerationTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bert_generation/tokenization_bert_generation.py#L166"}}),ze=new kt({}),$e=new Oe({props:{name:"class transformers.BertGenerationEncoder",anchor:"transformers.BertGenerationEncoder",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertGenerationEncoder.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/bert-generation#transformers.BertGenerationConfig">BertGenerationConfig</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.32.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.32.0/src/transformers/models/bert_generation/modeling_bert_generation.py#L677"}}),Ie=new Oe({props:{name:"forward",anchor:"transformers.BertGenerationEncoder.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",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:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = 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.BertGenerationEncoder.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertGenerationEncoder.forward.attention_mask",description:`<strong>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 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.BertGenerationEncoder.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BertGenerationEncoder.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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:"head_mask"},{anchor:"transformers.BertGenerationEncoder.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertGenerationEncoder.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.BertGenerationEncoder.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.BertGenerationEncoder.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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertGenerationEncoder.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.BertGenerationEncoder.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>: <code>1</code> for
tokens that are NOT MASKED, <code>0</code> for MASKED tokens.`,name:"encoder_attention_mask"},{anchor:"transformers.BertGenerationEncoder.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.BertGenerationEncoder.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"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bert_generation/modeling_bert_generation.py#L718",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/bert-generation#transformers.BertGenerationConfig"
>BertGenerationConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<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>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) 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, 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>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=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 of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ne=new rs({props:{$$slots:{default:[hs]},$$scope:{ctx:U}}}),re=new Qr({props:{anchor:"transformers.BertGenerationEncoder.forward.example",$$slots:{default:[ps]},$$scope:{ctx:U}}}),Ve=new kt({}),xe=new Oe({props:{name:"class transformers.BertGenerationDecoder",anchor:"transformers.BertGenerationDecoder",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertGenerationDecoder.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/bert-generation#transformers.BertGenerationConfig">BertGenerationConfig</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.32.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.32.0/src/transformers/models/bert_generation/modeling_bert_generation.py#L864"}}),Se=new Oe({props:{name:"forward",anchor:"transformers.BertGenerationDecoder.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",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:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = 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.BertGenerationDecoder.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertGenerationDecoder.forward.attention_mask",description:`<strong>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 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.BertGenerationDecoder.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BertGenerationDecoder.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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:"head_mask"},{anchor:"transformers.BertGenerationDecoder.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertGenerationDecoder.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.BertGenerationDecoder.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.BertGenerationDecoder.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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertGenerationDecoder.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.BertGenerationDecoder.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>:</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:"encoder_attention_mask"},{anchor:"transformers.BertGenerationDecoder.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 in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.BertGenerationDecoder.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.BertGenerationDecoder.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"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bert_generation/modeling_bert_generation.py#L885",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/bert-generation#transformers.BertGenerationConfig"
>BertGenerationConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</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>
<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_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),se=new rs({props:{$$slots:{default:[ms]},$$scope:{ctx:U}}}),ie=new Qr({props:{anchor:"transformers.BertGenerationDecoder.forward.example",$$slots:{default:[us]},$$scope:{ctx:U}}}),{c(){m=a("meta"),y=h(),_=a("h1"),f=a("a"),b=a("span"),v(l.$$.fragment),g=h(),q=a("span"),Ro=n("BertGeneration"),Ht=h(),N=a("h2"),H=a("a"),wt=a("span"),v(pe.$$.fragment),Co=h(),Mt=a("span"),qo=n("Overview"),Qt=h(),I=a("p"),Io=n(`The BertGeneration model is a BERT model that can be leveraged for sequence-to-sequence tasks using
`),Le=a("a"),Vo=n("EncoderDecoderModel"),xo=n(" as proposed in "),me=a("a"),Wo=n(`Leveraging Pre-trained Checkpoints for Sequence Generation
Tasks`),No=n(" by Sascha Rothe, Shashi Narayan, Aliaksei Severyn."),Kt=h(),Ye=a("p"),Xo=n("The abstract from the paper is the following:"),eo=h(),He=a("p"),Bt=a("em"),Po=n(`Unsupervised pretraining of large neural models has recently revolutionized Natural Language Processing. By
warm-starting from the publicly released checkpoints, NLP practitioners have pushed the state-of-the-art on multiple
benchmarks while saving significant amounts of compute time. So far the focus has been mainly on the Natural Language
Understanding tasks. In this paper, we demonstrate the efficacy of pre-trained checkpoints for Sequence Generation. We
developed a Transformer-based sequence-to-sequence model that is compatible with publicly available pre-trained BERT,
GPT-2 and RoBERTa checkpoints and conducted an extensive empirical study on the utility of initializing our model, both
encoder and decoder, with these checkpoints. Our models result in new state-of-the-art results on Machine Translation,
Text Summarization, Sentence Splitting, and Sentence Fusion.`),to=h(),Qe=a("p"),So=n("Usage:"),oo=h(),Ke=a("ul"),ue=a("li"),Fo=n("The model can be used in combination with the "),et=a("a"),Ao=n("EncoderDecoderModel"),Do=n(` to leverage two pretrained
BERT checkpoints for subsequent fine-tuning.`),no=h(),v(fe.$$.fragment),ro=h(),tt=a("ul"),ge=a("li"),Oo=n("Pretrained "),ot=a("a"),Lo=n("EncoderDecoderModel"),Yo=n(" are also directly available in the model hub, e.g.,"),ao=h(),v(_e.$$.fragment),so=h(),nt=a("p"),Ho=n("Tips:"),io=h(),Q=a("ul"),V=a("li"),rt=a("a"),Qo=n("BertGenerationEncoder"),Ko=n(" and "),at=a("a"),en=n("BertGenerationDecoder"),tn=n(` should be used in
combination with `),Gt=a("code"),on=n("EncoderDecoder"),nn=n("."),rn=h(),Et=a("li"),an=n(`For summarization, sentence splitting, sentence fusion and translation, no special tokens are required for the input.
Therefore, no EOS token should be added to the end of the input.`),lo=h(),x=a("p"),sn=n("This model was contributed by "),be=a("a"),ln=n("patrickvonplaten"),dn=n(`. The original code can be
found `),ye=a("a"),cn=n("here"),hn=n("."),co=h(),X=a("h2"),K=a("a"),Jt=a("span"),v(ve.$$.fragment),pn=h(),zt=a("span"),mn=n("BertGenerationConfig"),ho=h(),j=a("div"),v(Te.$$.fragment),un=h(),P=a("p"),fn=n("This is the configuration class to store the configuration of a "),$t=a("code"),gn=n("BertGenerationPreTrainedModel"),_n=n(`. It is used to
instantiate a BertGeneration 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 BertGeneration
`),ke=a("a"),bn=n("google/bert_for_seq_generation_L-24_bbc_encoder"),yn=n(`
architecture.`),vn=h(),S=a("p"),Tn=n("Configuration objects inherit from "),st=a("a"),kn=n("PretrainedConfig"),wn=n(` and can be used to control the model outputs. Read the
documentation from `),it=a("a"),Mn=n("PretrainedConfig"),Bn=n(" for more information."),Gn=h(),v(ee.$$.fragment),po=h(),F=a("h2"),te=a("a"),jt=a("span"),v(we.$$.fragment),En=h(),Zt=a("span"),Jn=n("BertGenerationTokenizer"),mo=h(),Z=a("div"),v(Me.$$.fragment),zn=h(),Be=a("p"),$n=n("Construct a BertGeneration tokenizer. Based on "),Ge=a("a"),jn=n("SentencePiece"),Zn=n("."),Un=h(),Ee=a("p"),Rn=n("This tokenizer inherits from "),lt=a("a"),Cn=n("PreTrainedTokenizer"),qn=n(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),In=h(),dt=a("div"),v(Je.$$.fragment),uo=h(),A=a("h2"),oe=a("a"),Ut=a("span"),v(ze.$$.fragment),Vn=h(),Rt=a("span"),xn=n("BertGenerationEncoder"),fo=h(),G=a("div"),v($e.$$.fragment),Wn=h(),Ct=a("p"),Nn=n("The bare BertGeneration model transformer outputting raw hidden-states without any specific head on top."),Xn=h(),je=a("p"),Pn=n("This model inherits from "),ct=a("a"),Sn=n("PreTrainedModel"),Fn=n(`. 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.)`),An=h(),Ze=a("p"),Dn=n("This model is also a PyTorch "),Ue=a("a"),On=n("torch.nn.Module"),Ln=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Yn=h(),Re=a("p"),Hn=n(`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),Ce=a("a"),Qn=n(`Attention is
all you need`),Kn=n(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),er=h(),D=a("p"),tr=n("This model should be used when leveraging Bert or Roberta checkpoints for the "),ht=a("a"),or=n("EncoderDecoderModel"),nr=n(` class as
described in `),qe=a("a"),rr=n("Leveraging Pre-trained Checkpoints for Sequence Generation Tasks"),ar=n(`
by Sascha Rothe, Shashi Narayan, and Aliaksei Severyn.`),sr=h(),E=a("p"),ir=n("To behave as an decoder the model needs to be initialized with the "),qt=a("code"),lr=n("is_decoder"),dr=n(` argument of the configuration set
to `),It=a("code"),cr=n("True"),hr=n(". To be used in a Seq2Seq model, the model needs to initialized with both "),Vt=a("code"),pr=n("is_decoder"),mr=n(` argument and
`),xt=a("code"),ur=n("add_cross_attention"),fr=n(" set to "),Wt=a("code"),gr=n("True"),_r=n("; an "),Nt=a("code"),br=n("encoder_hidden_states"),yr=n(" is then expected as an input to the forward pass."),vr=h(),R=a("div"),v(Ie.$$.fragment),Tr=h(),O=a("p"),kr=n("The "),pt=a("a"),wr=n("BertGenerationEncoder"),Mr=n(" forward method, overrides the "),Xt=a("code"),Br=n("__call__"),Gr=n(" special method."),Er=h(),v(ne.$$.fragment),Jr=h(),v(re.$$.fragment),go=h(),L=a("h2"),ae=a("a"),Pt=a("span"),v(Ve.$$.fragment),zr=h(),St=a("span"),$r=n("BertGenerationDecoder"),_o=h(),z=a("div"),v(xe.$$.fragment),jr=h(),We=a("p"),Zr=n("BertGeneration Model with a "),Ft=a("code"),Ur=n("language modeling"),Rr=n(" head on top for CLM fine-tuning."),Cr=h(),Ne=a("p"),qr=n("This model inherits from "),mt=a("a"),Ir=n("PreTrainedModel"),Vr=n(`. 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.)`),xr=h(),Xe=a("p"),Wr=n("This model is also a PyTorch "),Pe=a("a"),Nr=n("torch.nn.Module"),Xr=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Pr=h(),C=a("div"),v(Se.$$.fragment),Sr=h(),Y=a("p"),Fr=n("The "),ut=a("a"),Ar=n("BertGenerationDecoder"),Dr=n(" forward method, overrides the "),At=a("code"),Or=n("__call__"),Lr=n(" special method."),Yr=h(),v(se.$$.fragment),Hr=h(),v(ie.$$.fragment),this.h()},l(t){const c=ls('[data-svelte="svelte-1phssyn"]',document.head);m=s(c,"META",{name:!0,content:!0}),c.forEach(o),y=p(t),_=s(t,"H1",{class:!0});var Fe=i(_);f=s(Fe,"A",{id:!0,class:!0,href:!0});var Dt=i(f);b=s(Dt,"SPAN",{});var Ot=i(b);T(l.$$.fragment,Ot),Ot.forEach(o),Dt.forEach(o),g=p(Fe),q=s(Fe,"SPAN",{});var Lt=i(q);Ro=r(Lt,"BertGeneration"),Lt.forEach(o),Fe.forEach(o),Ht=p(t),N=s(t,"H2",{class:!0});var Ae=i(N);H=s(Ae,"A",{id:!0,class:!0,href:!0});var ea=i(H);wt=s(ea,"SPAN",{});var ta=i(wt);T(pe.$$.fragment,ta),ta.forEach(o),ea.forEach(o),Co=p(Ae),Mt=s(Ae,"SPAN",{});var oa=i(Mt);qo=r(oa,"Overview"),oa.forEach(o),Ae.forEach(o),Qt=p(t),I=s(t,"P",{});var ft=i(I);Io=r(ft,`The BertGeneration model is a BERT model that can be leveraged for sequence-to-sequence tasks using
`),Le=s(ft,"A",{href:!0});var na=i(Le);Vo=r(na,"EncoderDecoderModel"),na.forEach(o),xo=r(ft," as proposed in "),me=s(ft,"A",{href:!0,rel:!0});var ra=i(me);Wo=r(ra,`Leveraging Pre-trained Checkpoints for Sequence Generation
Tasks`),ra.forEach(o),No=r(ft," by Sascha Rothe, Shashi Narayan, Aliaksei Severyn."),ft.forEach(o),Kt=p(t),Ye=s(t,"P",{});var aa=i(Ye);Xo=r(aa,"The abstract from the paper is the following:"),aa.forEach(o),eo=p(t),He=s(t,"P",{});var sa=i(He);Bt=s(sa,"EM",{});var ia=i(Bt);Po=r(ia,`Unsupervised pretraining of large neural models has recently revolutionized Natural Language Processing. By
warm-starting from the publicly released checkpoints, NLP practitioners have pushed the state-of-the-art on multiple
benchmarks while saving significant amounts of compute time. So far the focus has been mainly on the Natural Language
Understanding tasks. In this paper, we demonstrate the efficacy of pre-trained checkpoints for Sequence Generation. We
developed a Transformer-based sequence-to-sequence model that is compatible with publicly available pre-trained BERT,
GPT-2 and RoBERTa checkpoints and conducted an extensive empirical study on the utility of initializing our model, both
encoder and decoder, with these checkpoints. Our models result in new state-of-the-art results on Machine Translation,
Text Summarization, Sentence Splitting, and Sentence Fusion.`),ia.forEach(o),sa.forEach(o),to=p(t),Qe=s(t,"P",{});var la=i(Qe);So=r(la,"Usage:"),la.forEach(o),oo=p(t),Ke=s(t,"UL",{});var da=i(Ke);ue=s(da,"LI",{});var yo=i(ue);Fo=r(yo,"The model can be used in combination with the "),et=s(yo,"A",{href:!0});var ca=i(et);Ao=r(ca,"EncoderDecoderModel"),ca.forEach(o),Do=r(yo,` to leverage two pretrained
BERT checkpoints for subsequent fine-tuning.`),yo.forEach(o),da.forEach(o),no=p(t),T(fe.$$.fragment,t),ro=p(t),tt=s(t,"UL",{});var ha=i(tt);ge=s(ha,"LI",{});var vo=i(ge);Oo=r(vo,"Pretrained "),ot=s(vo,"A",{href:!0});var pa=i(ot);Lo=r(pa,"EncoderDecoderModel"),pa.forEach(o),Yo=r(vo," are also directly available in the model hub, e.g.,"),vo.forEach(o),ha.forEach(o),ao=p(t),T(_e.$$.fragment,t),so=p(t),nt=s(t,"P",{});var ma=i(nt);Ho=r(ma,"Tips:"),ma.forEach(o),io=p(t),Q=s(t,"UL",{});var To=i(Q);V=s(To,"LI",{});var De=i(V);rt=s(De,"A",{href:!0});var ua=i(rt);Qo=r(ua,"BertGenerationEncoder"),ua.forEach(o),Ko=r(De," and "),at=s(De,"A",{href:!0});var fa=i(at);en=r(fa,"BertGenerationDecoder"),fa.forEach(o),tn=r(De,` should be used in
combination with `),Gt=s(De,"CODE",{});var ga=i(Gt);on=r(ga,"EncoderDecoder"),ga.forEach(o),nn=r(De,"."),De.forEach(o),rn=p(To),Et=s(To,"LI",{});var _a=i(Et);an=r(_a,`For summarization, sentence splitting, sentence fusion and translation, no special tokens are required for the input.
Therefore, no EOS token should be added to the end of the input.`),_a.forEach(o),To.forEach(o),lo=p(t),x=s(t,"P",{});var gt=i(x);sn=r(gt,"This model was contributed by "),be=s(gt,"A",{href:!0,rel:!0});var ba=i(be);ln=r(ba,"patrickvonplaten"),ba.forEach(o),dn=r(gt,`. The original code can be
found `),ye=s(gt,"A",{href:!0,rel:!0});var ya=i(ye);cn=r(ya,"here"),ya.forEach(o),hn=r(gt,"."),gt.forEach(o),co=p(t),X=s(t,"H2",{class:!0});var ko=i(X);K=s(ko,"A",{id:!0,class:!0,href:!0});var va=i(K);Jt=s(va,"SPAN",{});var Ta=i(Jt);T(ve.$$.fragment,Ta),Ta.forEach(o),va.forEach(o),pn=p(ko),zt=s(ko,"SPAN",{});var ka=i(zt);mn=r(ka,"BertGenerationConfig"),ka.forEach(o),ko.forEach(o),ho=p(t),j=s(t,"DIV",{class:!0});var le=i(j);T(Te.$$.fragment,le),un=p(le),P=s(le,"P",{});var _t=i(P);fn=r(_t,"This is the configuration class to store the configuration of a "),$t=s(_t,"CODE",{});var wa=i($t);gn=r(wa,"BertGenerationPreTrainedModel"),wa.forEach(o),_n=r(_t,`. It is used to
instantiate a BertGeneration 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 BertGeneration
`),ke=s(_t,"A",{href:!0,rel:!0});var Ma=i(ke);bn=r(Ma,"google/bert_for_seq_generation_L-24_bbc_encoder"),Ma.forEach(o),yn=r(_t,`
architecture.`),_t.forEach(o),vn=p(le),S=s(le,"P",{});var bt=i(S);Tn=r(bt,"Configuration objects inherit from "),st=s(bt,"A",{href:!0});var Ba=i(st);kn=r(Ba,"PretrainedConfig"),Ba.forEach(o),wn=r(bt,` and can be used to control the model outputs. Read the
documentation from `),it=s(bt,"A",{href:!0});var Ga=i(it);Mn=r(Ga,"PretrainedConfig"),Ga.forEach(o),Bn=r(bt," for more information."),bt.forEach(o),Gn=p(le),T(ee.$$.fragment,le),le.forEach(o),po=p(t),F=s(t,"H2",{class:!0});var wo=i(F);te=s(wo,"A",{id:!0,class:!0,href:!0});var Ea=i(te);jt=s(Ea,"SPAN",{});var Ja=i(jt);T(we.$$.fragment,Ja),Ja.forEach(o),Ea.forEach(o),En=p(wo),Zt=s(wo,"SPAN",{});var za=i(Zt);Jn=r(za,"BertGenerationTokenizer"),za.forEach(o),wo.forEach(o),mo=p(t),Z=s(t,"DIV",{class:!0});var de=i(Z);T(Me.$$.fragment,de),zn=p(de),Be=s(de,"P",{});var Mo=i(Be);$n=r(Mo,"Construct a BertGeneration tokenizer. Based on "),Ge=s(Mo,"A",{href:!0,rel:!0});var $a=i(Ge);jn=r($a,"SentencePiece"),$a.forEach(o),Zn=r(Mo,"."),Mo.forEach(o),Un=p(de),Ee=s(de,"P",{});var Bo=i(Ee);Rn=r(Bo,"This tokenizer inherits from "),lt=s(Bo,"A",{href:!0});var ja=i(lt);Cn=r(ja,"PreTrainedTokenizer"),ja.forEach(o),qn=r(Bo,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Bo.forEach(o),In=p(de),dt=s(de,"DIV",{class:!0});var Za=i(dt);T(Je.$$.fragment,Za),Za.forEach(o),de.forEach(o),uo=p(t),A=s(t,"H2",{class:!0});var Go=i(A);oe=s(Go,"A",{id:!0,class:!0,href:!0});var Ua=i(oe);Ut=s(Ua,"SPAN",{});var Ra=i(Ut);T(ze.$$.fragment,Ra),Ra.forEach(o),Ua.forEach(o),Vn=p(Go),Rt=s(Go,"SPAN",{});var Ca=i(Rt);xn=r(Ca,"BertGenerationEncoder"),Ca.forEach(o),Go.forEach(o),fo=p(t),G=s(t,"DIV",{class:!0});var J=i(G);T($e.$$.fragment,J),Wn=p(J),Ct=s(J,"P",{});var qa=i(Ct);Nn=r(qa,"The bare BertGeneration model transformer outputting raw hidden-states without any specific head on top."),qa.forEach(o),Xn=p(J),je=s(J,"P",{});var Eo=i(je);Pn=r(Eo,"This model inherits from "),ct=s(Eo,"A",{href:!0});var Ia=i(ct);Sn=r(Ia,"PreTrainedModel"),Ia.forEach(o),Fn=r(Eo,`. 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.)`),Eo.forEach(o),An=p(J),Ze=s(J,"P",{});var Jo=i(Ze);Dn=r(Jo,"This model is also a PyTorch "),Ue=s(Jo,"A",{href:!0,rel:!0});var Va=i(Ue);On=r(Va,"torch.nn.Module"),Va.forEach(o),Ln=r(Jo,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Jo.forEach(o),Yn=p(J),Re=s(J,"P",{});var zo=i(Re);Hn=r(zo,`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),Ce=s(zo,"A",{href:!0,rel:!0});var xa=i(Ce);Qn=r(xa,`Attention is
all you need`),xa.forEach(o),Kn=r(zo,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),zo.forEach(o),er=p(J),D=s(J,"P",{});var yt=i(D);tr=r(yt,"This model should be used when leveraging Bert or Roberta checkpoints for the "),ht=s(yt,"A",{href:!0});var Wa=i(ht);or=r(Wa,"EncoderDecoderModel"),Wa.forEach(o),nr=r(yt,` class as
described in `),qe=s(yt,"A",{href:!0,rel:!0});var Na=i(qe);rr=r(Na,"Leveraging Pre-trained Checkpoints for Sequence Generation Tasks"),Na.forEach(o),ar=r(yt,`
by Sascha Rothe, Shashi Narayan, and Aliaksei Severyn.`),yt.forEach(o),sr=p(J),E=s(J,"P",{});var $=i(E);ir=r($,"To behave as an decoder the model needs to be initialized with the "),qt=s($,"CODE",{});var Xa=i(qt);lr=r(Xa,"is_decoder"),Xa.forEach(o),dr=r($,` argument of the configuration set
to `),It=s($,"CODE",{});var Pa=i(It);cr=r(Pa,"True"),Pa.forEach(o),hr=r($,". To be used in a Seq2Seq model, the model needs to initialized with both "),Vt=s($,"CODE",{});var Sa=i(Vt);pr=r(Sa,"is_decoder"),Sa.forEach(o),mr=r($,` argument and
`),xt=s($,"CODE",{});var Fa=i(xt);ur=r(Fa,"add_cross_attention"),Fa.forEach(o),fr=r($," set to "),Wt=s($,"CODE",{});var Aa=i(Wt);gr=r(Aa,"True"),Aa.forEach(o),_r=r($,"; an "),Nt=s($,"CODE",{});var Da=i(Nt);br=r(Da,"encoder_hidden_states"),Da.forEach(o),yr=r($," is then expected as an input to the forward pass."),$.forEach(o),vr=p(J),R=s(J,"DIV",{class:!0});var ce=i(R);T(Ie.$$.fragment,ce),Tr=p(ce),O=s(ce,"P",{});var vt=i(O);kr=r(vt,"The "),pt=s(vt,"A",{href:!0});var Oa=i(pt);wr=r(Oa,"BertGenerationEncoder"),Oa.forEach(o),Mr=r(vt," forward method, overrides the "),Xt=s(vt,"CODE",{});var La=i(Xt);Br=r(La,"__call__"),La.forEach(o),Gr=r(vt," special method."),vt.forEach(o),Er=p(ce),T(ne.$$.fragment,ce),Jr=p(ce),T(re.$$.fragment,ce),ce.forEach(o),J.forEach(o),go=p(t),L=s(t,"H2",{class:!0});var $o=i(L);ae=s($o,"A",{id:!0,class:!0,href:!0});var Ya=i(ae);Pt=s(Ya,"SPAN",{});var Ha=i(Pt);T(Ve.$$.fragment,Ha),Ha.forEach(o),Ya.forEach(o),zr=p($o),St=s($o,"SPAN",{});var Qa=i(St);$r=r(Qa,"BertGenerationDecoder"),Qa.forEach(o),$o.forEach(o),_o=p(t),z=s(t,"DIV",{class:!0});var W=i(z);T(xe.$$.fragment,W),jr=p(W),We=s(W,"P",{});var jo=i(We);Zr=r(jo,"BertGeneration Model with a "),Ft=s(jo,"CODE",{});var Ka=i(Ft);Ur=r(Ka,"language modeling"),Ka.forEach(o),Rr=r(jo," head on top for CLM fine-tuning."),jo.forEach(o),Cr=p(W),Ne=s(W,"P",{});var Zo=i(Ne);qr=r(Zo,"This model inherits from "),mt=s(Zo,"A",{href:!0});var es=i(mt);Ir=r(es,"PreTrainedModel"),es.forEach(o),Vr=r(Zo,`. 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.)`),Zo.forEach(o),xr=p(W),Xe=s(W,"P",{});var Uo=i(Xe);Wr=r(Uo,"This model is also a PyTorch "),Pe=s(Uo,"A",{href:!0,rel:!0});var ts=i(Pe);Nr=r(ts,"torch.nn.Module"),ts.forEach(o),Xr=r(Uo,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Uo.forEach(o),Pr=p(W),C=s(W,"DIV",{class:!0});var he=i(C);T(Se.$$.fragment,he),Sr=p(he),Y=s(he,"P",{});var Tt=i(Y);Fr=r(Tt,"The "),ut=s(Tt,"A",{href:!0});var os=i(ut);Ar=r(os,"BertGenerationDecoder"),os.forEach(o),Dr=r(Tt," forward method, overrides the "),At=s(Tt,"CODE",{});var ns=i(At);Or=r(ns,"__call__"),ns.forEach(o),Lr=r(Tt," special method."),Tt.forEach(o),Yr=p(he),T(se.$$.fragment,he),Hr=p(he),T(ie.$$.fragment,he),he.forEach(o),W.forEach(o),this.h()},h(){d(m,"name","hf:doc:metadata"),d(m,"content",JSON.stringify(gs)),d(f,"id","bertgeneration"),d(f,"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"),d(f,"href","#bertgeneration"),d(_,"class","relative group"),d(H,"id","overview"),d(H,"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"),d(H,"href","#overview"),d(N,"class","relative group"),d(Le,"href","/docs/transformers/v4.32.0/en/model_doc/encoder-decoder#transformers.EncoderDecoderModel"),d(me,"href","https://arxiv.org/abs/1907.12461"),d(me,"rel","nofollow"),d(et,"href","/docs/transformers/v4.32.0/en/model_doc/encoder-decoder#transformers.EncoderDecoderModel"),d(ot,"href","/docs/transformers/v4.32.0/en/model_doc/encoder-decoder#transformers.EncoderDecoderModel"),d(rt,"href","/docs/transformers/v4.32.0/en/model_doc/bert-generation#transformers.BertGenerationEncoder"),d(at,"href","/docs/transformers/v4.32.0/en/model_doc/bert-generation#transformers.BertGenerationDecoder"),d(be,"href","https://huggingface.co/patrickvonplaten"),d(be,"rel","nofollow"),d(ye,"href","https://tfhub.dev/s?module-type=text-generation&subtype=module,placeholder"),d(ye,"rel","nofollow"),d(K,"id","transformers.BertGenerationConfig"),d(K,"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"),d(K,"href","#transformers.BertGenerationConfig"),d(X,"class","relative group"),d(ke,"href","https://huggingface.co/google/bert_for_seq_generation_L-24_bbc_encoder"),d(ke,"rel","nofollow"),d(st,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(it,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(te,"id","transformers.BertGenerationTokenizer"),d(te,"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"),d(te,"href","#transformers.BertGenerationTokenizer"),d(F,"class","relative group"),d(Ge,"href","https://github.com/google/sentencepiece"),d(Ge,"rel","nofollow"),d(lt,"href","/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),d(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(oe,"id","transformers.BertGenerationEncoder"),d(oe,"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"),d(oe,"href","#transformers.BertGenerationEncoder"),d(A,"class","relative group"),d(ct,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),d(Ue,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ue,"rel","nofollow"),d(Ce,"href","https://arxiv.org/abs/1706.03762"),d(Ce,"rel","nofollow"),d(ht,"href","/docs/transformers/v4.32.0/en/model_doc/encoder-decoder#transformers.EncoderDecoderModel"),d(qe,"href","https://arxiv.org/abs/1907.12461"),d(qe,"rel","nofollow"),d(pt,"href","/docs/transformers/v4.32.0/en/model_doc/bert-generation#transformers.BertGenerationEncoder"),d(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ae,"id","transformers.BertGenerationDecoder"),d(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"),d(ae,"href","#transformers.BertGenerationDecoder"),d(L,"class","relative group"),d(mt,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),d(Pe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Pe,"rel","nofollow"),d(ut,"href","/docs/transformers/v4.32.0/en/model_doc/bert-generation#transformers.BertGenerationDecoder"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(z,"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,c){e(document.head,m),u(t,y,c),u(t,_,c),e(_,f),e(f,b),k(l,b,null),e(_,g),e(_,q),e(q,Ro),u(t,Ht,c),u(t,N,c),e(N,H),e(H,wt),k(pe,wt,null),e(N,Co),e(N,Mt),e(Mt,qo),u(t,Qt,c),u(t,I,c),e(I,Io),e(I,Le),e(Le,Vo),e(I,xo),e(I,me),e(me,Wo),e(I,No),u(t,Kt,c),u(t,Ye,c),e(Ye,Xo),u(t,eo,c),u(t,He,c),e(He,Bt),e(Bt,Po),u(t,to,c),u(t,Qe,c),e(Qe,So),u(t,oo,c),u(t,Ke,c),e(Ke,ue),e(ue,Fo),e(ue,et),e(et,Ao),e(ue,Do),u(t,no,c),k(fe,t,c),u(t,ro,c),u(t,tt,c),e(tt,ge),e(ge,Oo),e(ge,ot),e(ot,Lo),e(ge,Yo),u(t,ao,c),k(_e,t,c),u(t,so,c),u(t,nt,c),e(nt,Ho),u(t,io,c),u(t,Q,c),e(Q,V),e(V,rt),e(rt,Qo),e(V,Ko),e(V,at),e(at,en),e(V,tn),e(V,Gt),e(Gt,on),e(V,nn),e(Q,rn),e(Q,Et),e(Et,an),u(t,lo,c),u(t,x,c),e(x,sn),e(x,be),e(be,ln),e(x,dn),e(x,ye),e(ye,cn),e(x,hn),u(t,co,c),u(t,X,c),e(X,K),e(K,Jt),k(ve,Jt,null),e(X,pn),e(X,zt),e(zt,mn),u(t,ho,c),u(t,j,c),k(Te,j,null),e(j,un),e(j,P),e(P,fn),e(P,$t),e($t,gn),e(P,_n),e(P,ke),e(ke,bn),e(P,yn),e(j,vn),e(j,S),e(S,Tn),e(S,st),e(st,kn),e(S,wn),e(S,it),e(it,Mn),e(S,Bn),e(j,Gn),k(ee,j,null),u(t,po,c),u(t,F,c),e(F,te),e(te,jt),k(we,jt,null),e(F,En),e(F,Zt),e(Zt,Jn),u(t,mo,c),u(t,Z,c),k(Me,Z,null),e(Z,zn),e(Z,Be),e(Be,$n),e(Be,Ge),e(Ge,jn),e(Be,Zn),e(Z,Un),e(Z,Ee),e(Ee,Rn),e(Ee,lt),e(lt,Cn),e(Ee,qn),e(Z,In),e(Z,dt),k(Je,dt,null),u(t,uo,c),u(t,A,c),e(A,oe),e(oe,Ut),k(ze,Ut,null),e(A,Vn),e(A,Rt),e(Rt,xn),u(t,fo,c),u(t,G,c),k($e,G,null),e(G,Wn),e(G,Ct),e(Ct,Nn),e(G,Xn),e(G,je),e(je,Pn),e(je,ct),e(ct,Sn),e(je,Fn),e(G,An),e(G,Ze),e(Ze,Dn),e(Ze,Ue),e(Ue,On),e(Ze,Ln),e(G,Yn),e(G,Re),e(Re,Hn),e(Re,Ce),e(Ce,Qn),e(Re,Kn),e(G,er),e(G,D),e(D,tr),e(D,ht),e(ht,or),e(D,nr),e(D,qe),e(qe,rr),e(D,ar),e(G,sr),e(G,E),e(E,ir),e(E,qt),e(qt,lr),e(E,dr),e(E,It),e(It,cr),e(E,hr),e(E,Vt),e(Vt,pr),e(E,mr),e(E,xt),e(xt,ur),e(E,fr),e(E,Wt),e(Wt,gr),e(E,_r),e(E,Nt),e(Nt,br),e(E,yr),e(G,vr),e(G,R),k(Ie,R,null),e(R,Tr),e(R,O),e(O,kr),e(O,pt),e(pt,wr),e(O,Mr),e(O,Xt),e(Xt,Br),e(O,Gr),e(R,Er),k(ne,R,null),e(R,Jr),k(re,R,null),u(t,go,c),u(t,L,c),e(L,ae),e(ae,Pt),k(Ve,Pt,null),e(L,zr),e(L,St),e(St,$r),u(t,_o,c),u(t,z,c),k(xe,z,null),e(z,jr),e(z,We),e(We,Zr),e(We,Ft),e(Ft,Ur),e(We,Rr),e(z,Cr),e(z,Ne),e(Ne,qr),e(Ne,mt),e(mt,Ir),e(Ne,Vr),e(z,xr),e(z,Xe),e(Xe,Wr),e(Xe,Pe),e(Pe,Nr),e(Xe,Xr),e(z,Pr),e(z,C),k(Se,C,null),e(C,Sr),e(C,Y),e(Y,Fr),e(Y,ut),e(ut,Ar),e(Y,Dr),e(Y,At),e(At,Or),e(Y,Lr),e(C,Yr),k(se,C,null),e(C,Hr),k(ie,C,null),bo=!0},p(t,[c]){const Fe={};c&2&&(Fe.$$scope={dirty:c,ctx:t}),ee.$set(Fe);const Dt={};c&2&&(Dt.$$scope={dirty:c,ctx:t}),ne.$set(Dt);const Ot={};c&2&&(Ot.$$scope={dirty:c,ctx:t}),re.$set(Ot);const Lt={};c&2&&(Lt.$$scope={dirty:c,ctx:t}),se.$set(Lt);const Ae={};c&2&&(Ae.$$scope={dirty:c,ctx:t}),ie.$set(Ae)},i(t){bo||(w(l.$$.fragment,t),w(pe.$$.fragment,t),w(fe.$$.fragment,t),w(_e.$$.fragment,t),w(ve.$$.fragment,t),w(Te.$$.fragment,t),w(ee.$$.fragment,t),w(we.$$.fragment,t),w(Me.$$.fragment,t),w(Je.$$.fragment,t),w(ze.$$.fragment,t),w($e.$$.fragment,t),w(Ie.$$.fragment,t),w(ne.$$.fragment,t),w(re.$$.fragment,t),w(Ve.$$.fragment,t),w(xe.$$.fragment,t),w(Se.$$.fragment,t),w(se.$$.fragment,t),w(ie.$$.fragment,t),bo=!0)},o(t){M(l.$$.fragment,t),M(pe.$$.fragment,t),M(fe.$$.fragment,t),M(_e.$$.fragment,t),M(ve.$$.fragment,t),M(Te.$$.fragment,t),M(ee.$$.fragment,t),M(we.$$.fragment,t),M(Me.$$.fragment,t),M(Je.$$.fragment,t),M(ze.$$.fragment,t),M($e.$$.fragment,t),M(Ie.$$.fragment,t),M(ne.$$.fragment,t),M(re.$$.fragment,t),M(Ve.$$.fragment,t),M(xe.$$.fragment,t),M(Se.$$.fragment,t),M(se.$$.fragment,t),M(ie.$$.fragment,t),bo=!1},d(t){o(m),t&&o(y),t&&o(_),B(l),t&&o(Ht),t&&o(N),B(pe),t&&o(Qt),t&&o(I),t&&o(Kt),t&&o(Ye),t&&o(eo),t&&o(He),t&&o(to),t&&o(Qe),t&&o(oo),t&&o(Ke),t&&o(no),B(fe,t),t&&o(ro),t&&o(tt),t&&o(ao),B(_e,t),t&&o(so),t&&o(nt),t&&o(io),t&&o(Q),t&&o(lo),t&&o(x),t&&o(co),t&&o(X),B(ve),t&&o(ho),t&&o(j),B(Te),B(ee),t&&o(po),t&&o(F),B(we),t&&o(mo),t&&o(Z),B(Me),B(Je),t&&o(uo),t&&o(A),B(ze),t&&o(fo),t&&o(G),B($e),B(Ie),B(ne),B(re),t&&o(go),t&&o(L),B(Ve),t&&o(_o),t&&o(z),B(xe),B(Se),B(se),B(ie)}}}const gs={local:"bertgeneration",sections:[{local:"overview",title:"Overview"},{local:"transformers.BertGenerationConfig",title:"BertGenerationConfig"},{local:"transformers.BertGenerationTokenizer",title:"BertGenerationTokenizer"},{local:"transformers.BertGenerationEncoder",title:"BertGenerationEncoder"},{local:"transformers.BertGenerationDecoder",title:"BertGenerationDecoder"}],title:"BertGeneration"};function _s(U){return ds(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ms extends as{constructor(m){super();ss(this,m,_s,fs,is,{})}}export{Ms as default,gs as metadata};
