import{S as Di,i as Ri,s as Hi,e as n,k as p,w as y,t as r,M as Oi,c as a,d as t,m as h,a as s,x as k,h as i,b as c,G as e,g,y as w,q as C,o as $,B as T,v as Xi,L as Dt}from"../../chunks/vendor-hf-doc-builder.js";import{T as qn}from"../../chunks/Tip-hf-doc-builder.js";import{D as re}from"../../chunks/Docstring-hf-doc-builder.js";import{C as So}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as R}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as St}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Qi(E){let d,v,_,f,b;return f=new So({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENvZGVHZW5Db25maWclMkMlMjBDb2RlR2VuTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ29kZUdlbiUyMDZCJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBDb2RlR2VuQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMENvZGVHZW5Nb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CodeGenConfig, CodeGenModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CodeGen 6B configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = CodeGenConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CodeGenModel(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(){d=n("p"),v=r("Example:"),_=p(),y(f.$$.fragment)},l(l){d=a(l,"P",{});var u=s(d);v=i(u,"Example:"),u.forEach(t),_=h(l),k(f.$$.fragment,l)},m(l,u){g(l,d,u),e(d,v),g(l,_,u),w(f,l,u),b=!0},p:Dt,i(l){b||(C(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(_),T(f,l)}}}function Yi(E){let d,v,_,f,b;return f=new So({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENvZGVHZW5Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBDb2RlR2VuVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJTYWxlc2ZvcmNlJTJGY29kZWdlbi0zNTBNLW1vbm8lMjIpJTBBdG9rZW5pemVyKCUyMkhlbGxvJTIwd29ybGQlMjIpJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTBBJTBBdG9rZW5pemVyKCUyMiUyMEhlbGxvJTIwd29ybGQlMjIpJTVCJTIyaW5wdXRfaWRzJTIyJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CodeGenTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = CodeGenTokenizer.from_pretrained(<span class="hljs-string">&quot;Salesforce/codegen-350M-mono&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot;Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">15496</span>, <span class="hljs-number">995</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot; Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">18435</span>, <span class="hljs-number">995</span>]`}}),{c(){d=n("p"),v=r("be encoded differently whether it is at the beginning of the sentence (without space) or not:"),_=p(),y(f.$$.fragment)},l(l){d=a(l,"P",{});var u=s(d);v=i(u,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),u.forEach(t),_=h(l),k(f.$$.fragment,l)},m(l,u){g(l,d,u),e(d,v),g(l,_,u),w(f,l,u),b=!0},p:Dt,i(l){b||(C(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(_),T(f,l)}}}function Ki(E){let d,v,_,f,b;return{c(){d=n("p"),v=r("When used with "),_=n("code"),f=r("is_split_into_words=True"),b=r(", this tokenizer will add a space before each word (even the first one).")},l(l){d=a(l,"P",{});var u=s(d);v=i(u,"When used with "),_=a(u,"CODE",{});var z=s(_);f=i(z,"is_split_into_words=True"),z.forEach(t),b=i(u,", this tokenizer will add a space before each word (even the first one)."),u.forEach(t)},m(l,u){g(l,d,u),e(d,v),e(d,_),e(_,f),e(d,b)},d(l){l&&t(d)}}}function el(E){let d,v,_,f,b;return f=new So({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENvZGVHZW5Ub2tlbml6ZXJGYXN0JTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQ29kZUdlblRva2VuaXplckZhc3QuZnJvbV9wcmV0cmFpbmVkKCUyMlNhbGVzZm9yY2UlMkZjb2RlZ2VuLTM1ME0tbW9ubyUyMiklMEF0b2tlbml6ZXIoJTIySGVsbG8lMjB3b3JsZCUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEElMEF0b2tlbml6ZXIoJTIyJTIwSGVsbG8lMjB3b3JsZCUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CodeGenTokenizerFast

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = CodeGenTokenizerFast.from_pretrained(<span class="hljs-string">&quot;Salesforce/codegen-350M-mono&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot;Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">15496</span>, <span class="hljs-number">995</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot; Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">18435</span>, <span class="hljs-number">995</span>]`}}),{c(){d=n("p"),v=r("be encoded differently whether it is at the beginning of the sentence (without space) or not:"),_=p(),y(f.$$.fragment)},l(l){d=a(l,"P",{});var u=s(d);v=i(u,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),u.forEach(t),_=h(l),k(f.$$.fragment,l)},m(l,u){g(l,d,u),e(d,v),g(l,_,u),w(f,l,u),b=!0},p:Dt,i(l){b||(C(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(_),T(f,l)}}}function ol(E){let d,v,_,f,b,l,u,z;return{c(){d=n("p"),v=r("When used with "),_=n("code"),f=r("is_split_into_words=True"),b=r(", this tokenizer needs to be instantiated with "),l=n("code"),u=r("add_prefix_space=True"),z=r(".")},l(H){d=a(H,"P",{});var F=s(d);v=i(F,"When used with "),_=a(F,"CODE",{});var I=s(_);f=i(I,"is_split_into_words=True"),I.forEach(t),b=i(F,", this tokenizer needs to be instantiated with "),l=a(F,"CODE",{});var Z=s(l);u=i(Z,"add_prefix_space=True"),Z.forEach(t),z=i(F,"."),F.forEach(t)},m(H,F){g(H,d,F),e(d,v),e(d,_),e(_,f),e(d,b),e(d,l),e(l,u),e(d,z)},d(H){H&&t(d)}}}function tl(E){let d,v,_,f,b;return{c(){d=n("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),f=r("Module"),b=r(`
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){d=a(l,"P",{});var u=s(d);v=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=s(_);f=i(z,"Module"),z.forEach(t),b=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){g(l,d,u),e(d,v),e(d,_),e(_,f),e(d,b)},d(l){l&&t(d)}}}function nl(E){let d,v,_,f,b;return f=new So({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBDb2RlR2VuTW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMlNhbGVzZm9yY2UlMkZjb2RlZ2VuLTJCLW1vbm8lMjIpJTBBbW9kZWwlMjAlM0QlMjBDb2RlR2VuTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMlNhbGVzZm9yY2UlMkZjb2RlZ2VuLTJCLW1vbm8lMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, CodeGenModel
<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;Salesforce/codegen-2B-mono&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CodeGenModel.from_pretrained(<span class="hljs-string">&quot;Salesforce/codegen-2B-mono&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(){d=n("p"),v=r("Example:"),_=p(),y(f.$$.fragment)},l(l){d=a(l,"P",{});var u=s(d);v=i(u,"Example:"),u.forEach(t),_=h(l),k(f.$$.fragment,l)},m(l,u){g(l,d,u),e(d,v),g(l,_,u),w(f,l,u),b=!0},p:Dt,i(l){b||(C(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(_),T(f,l)}}}function al(E){let d,v,_,f,b;return{c(){d=n("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),f=r("Module"),b=r(`
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){d=a(l,"P",{});var u=s(d);v=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=s(_);f=i(z,"Module"),z.forEach(t),b=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){g(l,d,u),e(d,v),e(d,_),e(_,f),e(d,b)},d(l){l&&t(d)}}}function sl(E){let d,v,_,f,b;return f=new So({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMENvZGVHZW5Gb3JDYXVzYWxMTSUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMlNhbGVzZm9yY2UlMkZjb2RlZ2VuLTJCLW1vbm8lMjIpJTBBbW9kZWwlMjAlM0QlMjBDb2RlR2VuRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMlNhbGVzZm9yY2UlMkZjb2RlZ2VuLTJCLW1vbm8lMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCklMEFsb3NzJTIwJTNEJTIwb3V0cHV0cy5sb3NzJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, CodeGenForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;Salesforce/codegen-2B-mono&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CodeGenForCausalLM.from_pretrained(<span class="hljs-string">&quot;Salesforce/codegen-2B-mono&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, labels=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=n("p"),v=r("Example:"),_=p(),y(f.$$.fragment)},l(l){d=a(l,"P",{});var u=s(d);v=i(u,"Example:"),u.forEach(t),_=h(l),k(f.$$.fragment,l)},m(l,u){g(l,d,u),e(d,v),g(l,_,u),w(f,l,u),b=!0},p:Dt,i(l){b||(C(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(_),T(f,l)}}}function rl(E){let d,v,_,f,b,l,u,z,H,F,I,Z,Do,Pe,Zn,Ro,Bn,Rt,ie,Vn,Ue,Ln,An,Ht,le,Sn,We,Dn,Rn,Ot,To,Hn,Xt,Mo,Ie,On,Ne,Xn,Qn,Qt,L,Yn,Je,Kn,ea,qe,oa,ta,Yt,O,de,Ho,Ze,na,Oo,aa,Kt,A,Be,sa,Ve,ra,ia,la,ce,da,Xo,ca,pa,Le,P,Qo,ha,ma,Yo,fa,ua,Ko,ga,_a,et,ba,va,ot,ya,ka,Ae,tt,wa,Ca,X,Go,nt,$a,Ta,Ma,pe,at,Ga,Ea,st,za,xa,ja,he,rt,Fa,Pa,it,Ua,Wa,Ia,Se,Na,lt,Ja,qa,en,Q,me,dt,De,Za,ct,Ba,on,Re,tn,Y,fe,pt,He,Va,ht,La,nn,Eo,mt,zo,Aa,an,K,ue,ft,Oe,Sa,ut,Da,sn,B,Xe,Ra,U,Ha,xo,Oa,Xa,Qe,Qa,Ya,jo,Ka,es,Fo,os,ts,ns,ge,rn,ee,_e,gt,Ye,as,_t,ss,ln,M,Ke,rs,bt,is,ls,vt,ds,cs,be,ps,eo,hs,yt,ms,fs,us,ve,gs,oo,_s,Po,bs,vs,ys,Uo,to,dn,oe,ye,kt,no,ks,wt,ws,cn,G,ao,Cs,so,$s,Ct,Ts,Ms,Gs,$t,Es,zs,ke,xs,ro,js,Tt,Fs,Ps,Us,we,Ws,io,Is,Wo,Ns,Js,qs,N,lo,Zs,Mt,Bs,Vs,co,Ls,Gt,As,Ss,Ds,po,Rs,Et,Hs,Os,pn,te,Ce,zt,ho,Xs,xt,Qs,hn,V,mo,Ys,fo,Ks,uo,er,or,tr,J,go,nr,ne,ar,Io,sr,rr,jt,ir,lr,dr,$e,cr,Te,mn,ae,Me,Ft,_o,pr,Pt,hr,fn,W,bo,mr,Ut,fr,ur,vo,gr,yo,_r,br,vr,q,ko,yr,se,kr,No,wr,Cr,Wt,$r,Tr,Mr,Ge,Gr,Ee,un;return l=new R({}),Pe=new R({}),Ze=new R({}),De=new R({}),Re=new So({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQXV0b1Rva2VuaXplciUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJTYWxlc2ZvcmNlJTJGY29kZWdlbi0zNTBNLW1vbm8lMjIlMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBJTBBdGV4dCUyMCUzRCUyMCUyMmRlZiUyMGhlbGxvX3dvcmxkKCklM0ElMjIlMEElMEFjb21wbGV0aW9uJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKip0b2tlbml6ZXIodGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpKSUwQSUwQXByaW50KHRva2VuaXplci5kZWNvZGUoY29tcGxldGlvbiU1QjAlNUQpKSUwQQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>checkpoint = <span class="hljs-string">&quot;Salesforce/codegen-350M-mono&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(checkpoint)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(checkpoint)

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;def hello_world():&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>completion = model.generate(**tokenizer(text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(completion[<span class="hljs-number">0</span>]))
<span class="hljs-keyword">def</span> <span class="hljs-title function_">hello_world</span>():
    <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Hello World&quot;</span>)

hello_world()`}}),He=new R({}),Oe=new R({}),Xe=new re({props:{name:"class transformers.CodeGenConfig",anchor:"transformers.CodeGenConfig",parameters:[{name:"vocab_size",val:" = 50400"},{name:"n_positions",val:" = 2048"},{name:"n_ctx",val:" = 2048"},{name:"n_embd",val:" = 4096"},{name:"n_layer",val:" = 28"},{name:"n_head",val:" = 16"},{name:"rotary_dim",val:" = 64"},{name:"n_inner",val:" = None"},{name:"activation_function",val:" = 'gelu_new'"},{name:"resid_pdrop",val:" = 0.0"},{name:"embd_pdrop",val:" = 0.0"},{name:"attn_pdrop",val:" = 0.0"},{name:"layer_norm_epsilon",val:" = 1e-05"},{name:"initializer_range",val:" = 0.02"},{name:"use_cache",val:" = True"},{name:"bos_token_id",val:" = 50256"},{name:"eos_token_id",val:" = 50256"},{name:"tie_word_embeddings",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CodeGenConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50400) &#x2014;
Vocabulary size of the CodeGen model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/codegen#transformers.CodeGenModel">CodeGenModel</a>.`,name:"vocab_size"},{anchor:"transformers.CodeGenConfig.n_positions",description:`<strong>n_positions</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#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:"n_positions"},{anchor:"transformers.CodeGenConfig.n_embd",description:`<strong>n_embd</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the embeddings and hidden states.`,name:"n_embd"},{anchor:"transformers.CodeGenConfig.n_layer",description:`<strong>n_layer</strong> (<code>int</code>, <em>optional</em>, defaults to 28) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"n_layer"},{anchor:"transformers.CodeGenConfig.n_head",description:`<strong>n_head</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"n_head"},{anchor:"transformers.CodeGenConfig.rotary_dim",description:`<strong>rotary_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Number of dimensions in the embedding that Rotary Position Embedding is applied to.`,name:"rotary_dim"},{anchor:"transformers.CodeGenConfig.n_inner",description:`<strong>n_inner</strong> (<code>int</code>, <em>optional</em>, defaults to None) &#x2014;
Dimensionality of the inner feed-forward layers. <code>None</code> will set it to 4 times n_embd`,name:"n_inner"},{anchor:"transformers.CodeGenConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;gelu_new&quot;</code>) &#x2014;
Activation function, to be selected in the list <code>[&quot;relu&quot;, &quot;silu&quot;, &quot;gelu&quot;, &quot;tanh&quot;, &quot;gelu_new&quot;]</code>.`,name:"activation_function"},{anchor:"transformers.CodeGenConfig.resid_pdrop",description:`<strong>resid_pdrop</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:"resid_pdrop"},{anchor:"transformers.CodeGenConfig.embd_pdrop",description:`<strong>embd_pdrop</strong> (<code>int</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the embeddings.`,name:"embd_pdrop"},{anchor:"transformers.CodeGenConfig.attn_pdrop",description:`<strong>attn_pdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention.`,name:"attn_pdrop"},{anchor:"transformers.CodeGenConfig.layer_norm_epsilon",description:`<strong>layer_norm_epsilon</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon to use in the layer normalization layers.`,name:"layer_norm_epsilon"},{anchor:"transformers.CodeGenConfig.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.CodeGenConfig.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/main/src/transformers/models/codegen/configuration_codegen.py#L44"}}),ge=new St({props:{anchor:"transformers.CodeGenConfig.example",$$slots:{default:[Qi]},$$scope:{ctx:E}}}),Ye=new R({}),Ke=new re({props:{name:"class transformers.CodeGenTokenizer",anchor:"transformers.CodeGenTokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"errors",val:" = 'replace'"},{name:"unk_token",val:" = '<|endoftext|>'"},{name:"bos_token",val:" = '<|endoftext|>'"},{name:"eos_token",val:" = '<|endoftext|>'"},{name:"pad_token",val:" = None"},{name:"add_prefix_space",val:" = False"},{name:"add_bos_token",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CodeGenTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.CodeGenTokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.CodeGenTokenizer.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;replace&quot;</code>) &#x2014;
Paradigm to follow when decoding bytes to UTF-8. See
<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.CodeGenTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</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.CodeGenTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The beginning of sequence token.`,name:"bos_token"},{anchor:"transformers.CodeGenTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.CodeGenTokenizer.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an initial space to the input. This allows to treat the leading word just as any
other word. (CodeGen tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/codegen/tokenization_codegen.py#L98"}}),be=new St({props:{anchor:"transformers.CodeGenTokenizer.example",$$slots:{default:[Yi]},$$scope:{ctx:E}}}),ve=new qn({props:{$$slots:{default:[Ki]},$$scope:{ctx:E}}}),to=new re({props:{name:"save_vocabulary",anchor:"transformers.CodeGenTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/codegen/tokenization_codegen.py#L284"}}),no=new R({}),ao=new re({props:{name:"class transformers.CodeGenTokenizerFast",anchor:"transformers.CodeGenTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"merges_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"unk_token",val:" = '<|endoftext|>'"},{name:"bos_token",val:" = '<|endoftext|>'"},{name:"eos_token",val:" = '<|endoftext|>'"},{name:"add_prefix_space",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CodeGenTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.CodeGenTokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.CodeGenTokenizerFast.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;replace&quot;</code>) &#x2014;
Paradigm to follow when decoding bytes to UTF-8. See
<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.CodeGenTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</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.CodeGenTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The beginning of sequence token.`,name:"bos_token"},{anchor:"transformers.CodeGenTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.CodeGenTokenizerFast.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an initial space to the input. This allows to treat the leading word just as any
other word. (CodeGen tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"},{anchor:"transformers.CodeGenTokenizerFast.trim_offsets",description:`<strong>trim_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the post-processing step should trim offsets to avoid including whitespaces.`,name:"trim_offsets"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/codegen/tokenization_codegen_fast.py#L63"}}),ke=new St({props:{anchor:"transformers.CodeGenTokenizerFast.example",$$slots:{default:[el]},$$scope:{ctx:E}}}),we=new qn({props:{$$slots:{default:[ol]},$$scope:{ctx:E}}}),lo=new re({props:{name:"decode",anchor:"transformers.CodeGenTokenizerFast.decode",parameters:[{name:"token_ids",val:": typing.Union[int, typing.List[int], ForwardRef('np.ndarray'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor')]"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"truncate_before_pattern",val:": typing.Optional[typing.List[str]] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CodeGenTokenizerFast.decode.token_ids",description:`<strong>token_ids</strong> (<code>Union[int, List[int], np.ndarray, torch.Tensor, tf.Tensor]</code>) &#x2014;
List of tokenized input ids. Can be obtained using the <code>__call__</code> method.`,name:"token_ids"},{anchor:"transformers.CodeGenTokenizerFast.decode.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"},{anchor:"transformers.CodeGenTokenizerFast.decode.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to clean up the tokenization spaces. If <code>None</code>, will default to
<code>self.clean_up_tokenization_spaces</code> (available in the <code>tokenizer_config</code>).`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.CodeGenTokenizerFast.decode.truncate_before_pattern",description:`<strong>truncate_before_pattern</strong> (<code>List[str]</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
A list of regular expression strings that will be used to truncate the returned string. This can be
used to remove extra pieces of code (e.g. truncate if observing a comment symbol &#x201D;#&#x201D; at the beginning
of a new line). An example pattern could be \`[&#x201D;^#&#x201D;, re.escape(&#x201D;&lt;|endoftext|&gt;&#x201D;), &#x201D;^&apos;&apos;&apos;&#x201D;, &#x201D;`,name:"truncate_before_pattern"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/codegen/tokenization_codegen_fast.py#L186",returnDescription:`
<p>The decoded sentence.</p>
`,returnType:`
<p><code>str</code></p>
`}}),ho=new R({}),mo=new re({props:{name:"class transformers.CodeGenModel",anchor:"transformers.CodeGenModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.CodeGenModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/codegen#transformers.CodeGenConfig">CodeGenConfig</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/main/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/main/src/transformers/models/codegen/modeling_codegen.py#L410"}}),go=new re({props:{name:"forward",anchor:"transformers.CodeGenModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[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.CodeGenModel.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 <code>AutoProcenizer</code>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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.CodeGenModel.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.CodeGenModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.CodeGenModel.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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CodeGenModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_attention_heads,)</code> or <code>(n_layer, num_attention_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.CodeGenModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_dim)</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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.CodeGenModel.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.CodeGenModel.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.CodeGenModel.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/codegen/modeling_codegen.py#L433",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</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/main/en/model_doc/codegen#transformers.CodeGenConfig"
>CodeGenConfig</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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$e=new qn({props:{$$slots:{default:[tl]},$$scope:{ctx:E}}}),Te=new St({props:{anchor:"transformers.CodeGenModel.forward.example",$$slots:{default:[nl]},$$scope:{ctx:E}}}),_o=new R({}),bo=new re({props:{name:"class transformers.CodeGenForCausalLM",anchor:"transformers.CodeGenForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.CodeGenForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/codegen#transformers.CodeGenConfig">CodeGenConfig</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/main/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/main/src/transformers/models/codegen/modeling_codegen.py#L604"}}),ko=new re({props:{name:"forward",anchor:"transformers.CodeGenForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.CodeGenForCausalLM.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 <code>AutoProcenizer</code>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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.CodeGenForCausalLM.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.CodeGenForCausalLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.CodeGenForCausalLM.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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CodeGenForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_attention_heads,)</code> or <code>(n_layer, num_attention_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.CodeGenForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_dim)</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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.CodeGenForCausalLM.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.CodeGenForCausalLM.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.CodeGenForCausalLM.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.CodeGenForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for language modeling. Note that the labels <strong>are shifted</strong> inside the model, i.e. you can set
<code>labels = input_ids</code> Indices are selected in <code>[-100, 0, ..., config.vocab_size]</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/main/src/transformers/models/codegen/modeling_codegen.py#L648",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</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/main/en/model_doc/codegen#transformers.CodeGenConfig"
>CodeGenConfig</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>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>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ge=new qn({props:{$$slots:{default:[al]},$$scope:{ctx:E}}}),Ee=new St({props:{anchor:"transformers.CodeGenForCausalLM.forward.example",$$slots:{default:[sl]},$$scope:{ctx:E}}}),{c(){d=n("meta"),v=p(),_=n("h1"),f=n("a"),b=n("span"),y(l.$$.fragment),u=p(),z=n("span"),H=r("CodeGen"),F=p(),I=n("h2"),Z=n("a"),Do=n("span"),y(Pe.$$.fragment),Zn=p(),Ro=n("span"),Bn=r("Overview"),Rt=p(),ie=n("p"),Vn=r("The CodeGen model was proposed in "),Ue=n("a"),Ln=r("A Conversational Paradigm for Program Synthesis"),An=r(" by Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, and Caiming Xiong."),Ht=p(),le=n("p"),Sn=r("CodeGen is an autoregressive language model for program synthesis trained sequentially on "),We=n("a"),Dn=r("The Pile"),Rn=r(", BigQuery, and BigPython."),Ot=p(),To=n("p"),Hn=r("The abstract from the paper is the following:"),Xt=p(),Mo=n("p"),Ie=n("em"),On=r("Program synthesis strives to generate a computer program as a solution to a given problem specification. We propose a conversational program synthesis approach via large language models, which addresses the challenges of searching over a vast program space and user intent specification faced in prior approaches. Our new approach casts the process of writing a specification and program as a multi-turn conversation between a user and a system. It treats program synthesis as a sequence prediction problem, in which the specification is expressed in natural language and the desired program is conditionally sampled. We train a family of large language models, called CodeGen, on natural language and programming language data. With weak supervision in the data and the scaling up of data size and model size, conversational capacities emerge from the simple autoregressive language modeling. To study the model behavior on conversational program synthesis, we develop a multi-turn programming benchmark (MTPB), where solving each problem requires multi-step synthesis via multi-turn conversation between the user and the model. Our findings show the emergence of conversational capabilities and the effectiveness of the proposed conversational program synthesis paradigm. In addition, our model CodeGen (with up to 16B parameters trained on TPU-v4) outperforms OpenAI\u2019s Codex on the HumanEval benchmark. We make the training library JaxFormer including checkpoints available as open source contribution: "),Ne=n("a"),Xn=r("this https URL"),Qn=r("."),Qt=p(),L=n("p"),Yn=r("This model was contributed by "),Je=n("a"),Kn=r("Hiroaki Hayashi"),ea=r(`.
The original code can be found `),qe=n("a"),oa=r("here"),ta=r("."),Yt=p(),O=n("h2"),de=n("a"),Ho=n("span"),y(Ze.$$.fragment),na=p(),Oo=n("span"),aa=r("Checkpoint Naming"),Kt=p(),A=n("ul"),Be=n("li"),sa=r("CodeGen model "),Ve=n("a"),ra=r("checkpoints"),ia=r(" are available on different pre-training data with variable sizes."),la=p(),ce=n("li"),da=r("The format is: "),Xo=n("code"),ca=r("Salesforce/codegen-{size}-{data}"),pa=r(", where"),Le=n("ul"),P=n("li"),Qo=n("code"),ha=r("size"),ma=r(": "),Yo=n("code"),fa=r("350M"),ua=r(", "),Ko=n("code"),ga=r("2B"),_a=r(", "),et=n("code"),ba=r("6B"),va=r(", "),ot=n("code"),ya=r("16B"),ka=p(),Ae=n("li"),tt=n("code"),wa=r("data"),Ca=r(": "),X=n("ul"),Go=n("li"),nt=n("code"),$a=r("nl"),Ta=r(": Pre-trained on the Pile"),Ma=p(),pe=n("li"),at=n("code"),Ga=r("multi"),Ea=r(": Initialized with "),st=n("code"),za=r("nl"),xa=r(", then further pre-trained on multiple programming languages data"),ja=p(),he=n("li"),rt=n("code"),Fa=r("mono"),Pa=r(": Initialized with "),it=n("code"),Ua=r("multi"),Wa=r(", then further pre-trained on Python data"),Ia=p(),Se=n("li"),Na=r("For example, "),lt=n("code"),Ja=r("Salesforce/codegen-350M-mono"),qa=r(" offers a 350 million-parameter checkpoint pre-trained sequentially on the Pile, multiple programming languages, and Python."),en=p(),Q=n("h2"),me=n("a"),dt=n("span"),y(De.$$.fragment),Za=p(),ct=n("span"),Ba=r("How to use"),on=p(),y(Re.$$.fragment),tn=p(),Y=n("h2"),fe=n("a"),pt=n("span"),y(He.$$.fragment),Va=p(),ht=n("span"),La=r("Documentation resources"),nn=p(),Eo=n("ul"),mt=n("li"),zo=n("a"),Aa=r("Causal language modeling task guide"),an=p(),K=n("h2"),ue=n("a"),ft=n("span"),y(Oe.$$.fragment),Sa=p(),ut=n("span"),Da=r("CodeGenConfig"),sn=p(),B=n("div"),y(Xe.$$.fragment),Ra=p(),U=n("p"),Ha=r("This is the configuration class to store the configuration of a "),xo=n("a"),Oa=r("CodeGenModel"),Xa=r(`. It is used to instantiate a
CodeGen 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 CodeGen
`),Qe=n("a"),Qa=r("Salesforce/codegen-2B-mono"),Ya=r(` architecture. Configuration objects
inherit from `),jo=n("a"),Ka=r("PretrainedConfig"),es=r(` and can be used to control the model outputs. Read the documentation from
`),Fo=n("a"),os=r("PretrainedConfig"),ts=r(" for more information."),ns=p(),y(ge.$$.fragment),rn=p(),ee=n("h2"),_e=n("a"),gt=n("span"),y(Ye.$$.fragment),as=p(),_t=n("span"),ss=r("CodeGenTokenizer"),ln=p(),M=n("div"),y(Ke.$$.fragment),rs=p(),bt=n("p"),is=r("Construct a CodeGen tokenizer. Based on byte-level Byte-Pair-Encoding."),ls=p(),vt=n("p"),ds=r("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),cs=p(),y(be.$$.fragment),ps=p(),eo=n("p"),hs=r("You can get around that behavior by passing "),yt=n("code"),ms=r("add_prefix_space=True"),fs=r(` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),us=p(),y(ve.$$.fragment),gs=p(),oo=n("p"),_s=r("This tokenizer inherits from "),Po=n("a"),bs=r("PreTrainedTokenizer"),vs=r(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),ys=p(),Uo=n("div"),y(to.$$.fragment),dn=p(),oe=n("h2"),ye=n("a"),kt=n("span"),y(no.$$.fragment),ks=p(),wt=n("span"),ws=r("CodeGenTokenizerFast"),cn=p(),G=n("div"),y(ao.$$.fragment),Cs=p(),so=n("p"),$s=r("Construct a \u201Cfast\u201D CodeGen tokenizer (backed by HuggingFace\u2019s "),Ct=n("em"),Ts=r("tokenizers"),Ms=r(` library). Based on byte-level
Byte-Pair-Encoding.`),Gs=p(),$t=n("p"),Es=r("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),zs=p(),y(ke.$$.fragment),xs=p(),ro=n("p"),js=r("You can get around that behavior by passing "),Tt=n("code"),Fs=r("add_prefix_space=True"),Ps=r(` when instantiating this tokenizer, but since
the model was not pretrained this way, it might yield a decrease in performance.`),Us=p(),y(we.$$.fragment),Ws=p(),io=n("p"),Is=r("This tokenizer inherits from "),Wo=n("a"),Ns=r("PreTrainedTokenizerFast"),Js=r(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),qs=p(),N=n("div"),y(lo.$$.fragment),Zs=p(),Mt=n("p"),Bs=r(`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),Vs=p(),co=n("p"),Ls=r("Similar to doing "),Gt=n("code"),As=r("self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Ss=r("."),Ds=p(),po=n("p"),Rs=r("\u201D]`.\nkwargs (additional keyword arguments, "),Et=n("em"),Hs=r("optional"),Os=r(`):
Will be passed to the underlying model specific decode method.`),pn=p(),te=n("h2"),Ce=n("a"),zt=n("span"),y(ho.$$.fragment),Xs=p(),xt=n("span"),Qs=r("CodeGenModel"),hn=p(),V=n("div"),y(mo.$$.fragment),Ys=p(),fo=n("p"),Ks=r(`The bare CodeGen Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),uo=n("a"),er=r("torch.nn.Module"),or=r(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),tr=p(),J=n("div"),y(go.$$.fragment),nr=p(),ne=n("p"),ar=r("The "),Io=n("a"),sr=r("CodeGenModel"),rr=r(" forward method, overrides the "),jt=n("code"),ir=r("__call__"),lr=r(" special method."),dr=p(),y($e.$$.fragment),cr=p(),y(Te.$$.fragment),mn=p(),ae=n("h2"),Me=n("a"),Ft=n("span"),y(_o.$$.fragment),pr=p(),Pt=n("span"),hr=r("CodeGenForCausalLM"),fn=p(),W=n("div"),y(bo.$$.fragment),mr=p(),Ut=n("p"),fr=r("The CodeGen Model transformer with a language modeling head on top."),ur=p(),vo=n("p"),gr=r("This model is a PyTorch "),yo=n("a"),_r=r("torch.nn.Module"),br=r(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),vr=p(),q=n("div"),y(ko.$$.fragment),yr=p(),se=n("p"),kr=r("The "),No=n("a"),wr=r("CodeGenForCausalLM"),Cr=r(" forward method, overrides the "),Wt=n("code"),$r=r("__call__"),Tr=r(" special method."),Mr=p(),y(Ge.$$.fragment),Gr=p(),y(Ee.$$.fragment),this.h()},l(o){const m=Oi('[data-svelte="svelte-1phssyn"]',document.head);d=a(m,"META",{name:!0,content:!0}),m.forEach(t),v=h(o),_=a(o,"H1",{class:!0});var wo=s(_);f=a(wo,"A",{id:!0,class:!0,href:!0});var It=s(f);b=a(It,"SPAN",{});var Nt=s(b);k(l.$$.fragment,Nt),Nt.forEach(t),It.forEach(t),u=h(wo),z=a(wo,"SPAN",{});var Jt=s(z);H=i(Jt,"CodeGen"),Jt.forEach(t),wo.forEach(t),F=h(o),I=a(o,"H2",{class:!0});var Co=s(I);Z=a(Co,"A",{id:!0,class:!0,href:!0});var qt=s(Z);Do=a(qt,"SPAN",{});var Zt=s(Do);k(Pe.$$.fragment,Zt),Zt.forEach(t),qt.forEach(t),Zn=h(Co),Ro=a(Co,"SPAN",{});var Bt=s(Ro);Bn=i(Bt,"Overview"),Bt.forEach(t),Co.forEach(t),Rt=h(o),ie=a(o,"P",{});var $o=s(ie);Vn=i($o,"The CodeGen model was proposed in "),Ue=a($o,"A",{href:!0,rel:!0});var zr=s(Ue);Ln=i(zr,"A Conversational Paradigm for Program Synthesis"),zr.forEach(t),An=i($o," by Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, and Caiming Xiong."),$o.forEach(t),Ht=h(o),le=a(o,"P",{});var gn=s(le);Sn=i(gn,"CodeGen is an autoregressive language model for program synthesis trained sequentially on "),We=a(gn,"A",{href:!0,rel:!0});var xr=s(We);Dn=i(xr,"The Pile"),xr.forEach(t),Rn=i(gn,", BigQuery, and BigPython."),gn.forEach(t),Ot=h(o),To=a(o,"P",{});var jr=s(To);Hn=i(jr,"The abstract from the paper is the following:"),jr.forEach(t),Xt=h(o),Mo=a(o,"P",{});var Fr=s(Mo);Ie=a(Fr,"EM",{});var _n=s(Ie);On=i(_n,"Program synthesis strives to generate a computer program as a solution to a given problem specification. We propose a conversational program synthesis approach via large language models, which addresses the challenges of searching over a vast program space and user intent specification faced in prior approaches. Our new approach casts the process of writing a specification and program as a multi-turn conversation between a user and a system. It treats program synthesis as a sequence prediction problem, in which the specification is expressed in natural language and the desired program is conditionally sampled. We train a family of large language models, called CodeGen, on natural language and programming language data. With weak supervision in the data and the scaling up of data size and model size, conversational capacities emerge from the simple autoregressive language modeling. To study the model behavior on conversational program synthesis, we develop a multi-turn programming benchmark (MTPB), where solving each problem requires multi-step synthesis via multi-turn conversation between the user and the model. Our findings show the emergence of conversational capabilities and the effectiveness of the proposed conversational program synthesis paradigm. In addition, our model CodeGen (with up to 16B parameters trained on TPU-v4) outperforms OpenAI\u2019s Codex on the HumanEval benchmark. We make the training library JaxFormer including checkpoints available as open source contribution: "),Ne=a(_n,"A",{href:!0,rel:!0});var Pr=s(Ne);Xn=i(Pr,"this https URL"),Pr.forEach(t),Qn=i(_n,"."),_n.forEach(t),Fr.forEach(t),Qt=h(o),L=a(o,"P",{});var Jo=s(L);Yn=i(Jo,"This model was contributed by "),Je=a(Jo,"A",{href:!0,rel:!0});var Ur=s(Je);Kn=i(Ur,"Hiroaki Hayashi"),Ur.forEach(t),ea=i(Jo,`.
The original code can be found `),qe=a(Jo,"A",{href:!0,rel:!0});var Wr=s(qe);oa=i(Wr,"here"),Wr.forEach(t),ta=i(Jo,"."),Jo.forEach(t),Yt=h(o),O=a(o,"H2",{class:!0});var bn=s(O);de=a(bn,"A",{id:!0,class:!0,href:!0});var Ir=s(de);Ho=a(Ir,"SPAN",{});var Nr=s(Ho);k(Ze.$$.fragment,Nr),Nr.forEach(t),Ir.forEach(t),na=h(bn),Oo=a(bn,"SPAN",{});var Jr=s(Oo);aa=i(Jr,"Checkpoint Naming"),Jr.forEach(t),bn.forEach(t),Kt=h(o),A=a(o,"UL",{});var qo=s(A);Be=a(qo,"LI",{});var vn=s(Be);sa=i(vn,"CodeGen model "),Ve=a(vn,"A",{href:!0,rel:!0});var qr=s(Ve);ra=i(qr,"checkpoints"),qr.forEach(t),ia=i(vn," are available on different pre-training data with variable sizes."),vn.forEach(t),la=h(qo),ce=a(qo,"LI",{});var Vt=s(ce);da=i(Vt,"The format is: "),Xo=a(Vt,"CODE",{});var Zr=s(Xo);ca=i(Zr,"Salesforce/codegen-{size}-{data}"),Zr.forEach(t),pa=i(Vt,", where"),Le=a(Vt,"UL",{});var yn=s(Le);P=a(yn,"LI",{});var S=s(P);Qo=a(S,"CODE",{});var Br=s(Qo);ha=i(Br,"size"),Br.forEach(t),ma=i(S,": "),Yo=a(S,"CODE",{});var Vr=s(Yo);fa=i(Vr,"350M"),Vr.forEach(t),ua=i(S,", "),Ko=a(S,"CODE",{});var Lr=s(Ko);ga=i(Lr,"2B"),Lr.forEach(t),_a=i(S,", "),et=a(S,"CODE",{});var Ar=s(et);ba=i(Ar,"6B"),Ar.forEach(t),va=i(S,", "),ot=a(S,"CODE",{});var Sr=s(ot);ya=i(Sr,"16B"),Sr.forEach(t),S.forEach(t),ka=h(yn),Ae=a(yn,"LI",{});var kn=s(Ae);tt=a(kn,"CODE",{});var Dr=s(tt);wa=i(Dr,"data"),Dr.forEach(t),Ca=i(kn,": "),X=a(kn,"UL",{});var Zo=s(X);Go=a(Zo,"LI",{});var Er=s(Go);nt=a(Er,"CODE",{});var Rr=s(nt);$a=i(Rr,"nl"),Rr.forEach(t),Ta=i(Er,": Pre-trained on the Pile"),Er.forEach(t),Ma=h(Zo),pe=a(Zo,"LI",{});var Lt=s(pe);at=a(Lt,"CODE",{});var Hr=s(at);Ga=i(Hr,"multi"),Hr.forEach(t),Ea=i(Lt,": Initialized with "),st=a(Lt,"CODE",{});var Or=s(st);za=i(Or,"nl"),Or.forEach(t),xa=i(Lt,", then further pre-trained on multiple programming languages data"),Lt.forEach(t),ja=h(Zo),he=a(Zo,"LI",{});var At=s(he);rt=a(At,"CODE",{});var Xr=s(rt);Fa=i(Xr,"mono"),Xr.forEach(t),Pa=i(At,": Initialized with "),it=a(At,"CODE",{});var Qr=s(it);Ua=i(Qr,"multi"),Qr.forEach(t),Wa=i(At,", then further pre-trained on Python data"),At.forEach(t),Zo.forEach(t),kn.forEach(t),yn.forEach(t),Vt.forEach(t),Ia=h(qo),Se=a(qo,"LI",{});var wn=s(Se);Na=i(wn,"For example, "),lt=a(wn,"CODE",{});var Yr=s(lt);Ja=i(Yr,"Salesforce/codegen-350M-mono"),Yr.forEach(t),qa=i(wn," offers a 350 million-parameter checkpoint pre-trained sequentially on the Pile, multiple programming languages, and Python."),wn.forEach(t),qo.forEach(t),en=h(o),Q=a(o,"H2",{class:!0});var Cn=s(Q);me=a(Cn,"A",{id:!0,class:!0,href:!0});var Kr=s(me);dt=a(Kr,"SPAN",{});var ei=s(dt);k(De.$$.fragment,ei),ei.forEach(t),Kr.forEach(t),Za=h(Cn),ct=a(Cn,"SPAN",{});var oi=s(ct);Ba=i(oi,"How to use"),oi.forEach(t),Cn.forEach(t),on=h(o),k(Re.$$.fragment,o),tn=h(o),Y=a(o,"H2",{class:!0});var $n=s(Y);fe=a($n,"A",{id:!0,class:!0,href:!0});var ti=s(fe);pt=a(ti,"SPAN",{});var ni=s(pt);k(He.$$.fragment,ni),ni.forEach(t),ti.forEach(t),Va=h($n),ht=a($n,"SPAN",{});var ai=s(ht);La=i(ai,"Documentation resources"),ai.forEach(t),$n.forEach(t),nn=h(o),Eo=a(o,"UL",{});var si=s(Eo);mt=a(si,"LI",{});var ri=s(mt);zo=a(ri,"A",{href:!0});var ii=s(zo);Aa=i(ii,"Causal language modeling task guide"),ii.forEach(t),ri.forEach(t),si.forEach(t),an=h(o),K=a(o,"H2",{class:!0});var Tn=s(K);ue=a(Tn,"A",{id:!0,class:!0,href:!0});var li=s(ue);ft=a(li,"SPAN",{});var di=s(ft);k(Oe.$$.fragment,di),di.forEach(t),li.forEach(t),Sa=h(Tn),ut=a(Tn,"SPAN",{});var ci=s(ut);Da=i(ci,"CodeGenConfig"),ci.forEach(t),Tn.forEach(t),sn=h(o),B=a(o,"DIV",{class:!0});var Bo=s(B);k(Xe.$$.fragment,Bo),Ra=h(Bo),U=a(Bo,"P",{});var D=s(U);Ha=i(D,"This is the configuration class to store the configuration of a "),xo=a(D,"A",{href:!0});var pi=s(xo);Oa=i(pi,"CodeGenModel"),pi.forEach(t),Xa=i(D,`. It is used to instantiate a
CodeGen 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 CodeGen
`),Qe=a(D,"A",{href:!0,rel:!0});var hi=s(Qe);Qa=i(hi,"Salesforce/codegen-2B-mono"),hi.forEach(t),Ya=i(D,` architecture. Configuration objects
inherit from `),jo=a(D,"A",{href:!0});var mi=s(jo);Ka=i(mi,"PretrainedConfig"),mi.forEach(t),es=i(D,` and can be used to control the model outputs. Read the documentation from
`),Fo=a(D,"A",{href:!0});var fi=s(Fo);os=i(fi,"PretrainedConfig"),fi.forEach(t),ts=i(D," for more information."),D.forEach(t),ns=h(Bo),k(ge.$$.fragment,Bo),Bo.forEach(t),rn=h(o),ee=a(o,"H2",{class:!0});var Mn=s(ee);_e=a(Mn,"A",{id:!0,class:!0,href:!0});var ui=s(_e);gt=a(ui,"SPAN",{});var gi=s(gt);k(Ye.$$.fragment,gi),gi.forEach(t),ui.forEach(t),as=h(Mn),_t=a(Mn,"SPAN",{});var _i=s(_t);ss=i(_i,"CodeGenTokenizer"),_i.forEach(t),Mn.forEach(t),ln=h(o),M=a(o,"DIV",{class:!0});var x=s(M);k(Ke.$$.fragment,x),rs=h(x),bt=a(x,"P",{});var bi=s(bt);is=i(bi,"Construct a CodeGen tokenizer. Based on byte-level Byte-Pair-Encoding."),bi.forEach(t),ls=h(x),vt=a(x,"P",{});var vi=s(vt);ds=i(vi,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),vi.forEach(t),cs=h(x),k(be.$$.fragment,x),ps=h(x),eo=a(x,"P",{});var Gn=s(eo);hs=i(Gn,"You can get around that behavior by passing "),yt=a(Gn,"CODE",{});var yi=s(yt);ms=i(yi,"add_prefix_space=True"),yi.forEach(t),fs=i(Gn,` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),Gn.forEach(t),us=h(x),k(ve.$$.fragment,x),gs=h(x),oo=a(x,"P",{});var En=s(oo);_s=i(En,"This tokenizer inherits from "),Po=a(En,"A",{href:!0});var ki=s(Po);bs=i(ki,"PreTrainedTokenizer"),ki.forEach(t),vs=i(En,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),En.forEach(t),ys=h(x),Uo=a(x,"DIV",{class:!0});var wi=s(Uo);k(to.$$.fragment,wi),wi.forEach(t),x.forEach(t),dn=h(o),oe=a(o,"H2",{class:!0});var zn=s(oe);ye=a(zn,"A",{id:!0,class:!0,href:!0});var Ci=s(ye);kt=a(Ci,"SPAN",{});var $i=s(kt);k(no.$$.fragment,$i),$i.forEach(t),Ci.forEach(t),ks=h(zn),wt=a(zn,"SPAN",{});var Ti=s(wt);ws=i(Ti,"CodeGenTokenizerFast"),Ti.forEach(t),zn.forEach(t),cn=h(o),G=a(o,"DIV",{class:!0});var j=s(G);k(ao.$$.fragment,j),Cs=h(j),so=a(j,"P",{});var xn=s(so);$s=i(xn,"Construct a \u201Cfast\u201D CodeGen tokenizer (backed by HuggingFace\u2019s "),Ct=a(xn,"EM",{});var Mi=s(Ct);Ts=i(Mi,"tokenizers"),Mi.forEach(t),Ms=i(xn,` library). Based on byte-level
Byte-Pair-Encoding.`),xn.forEach(t),Gs=h(j),$t=a(j,"P",{});var Gi=s($t);Es=i(Gi,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Gi.forEach(t),zs=h(j),k(ke.$$.fragment,j),xs=h(j),ro=a(j,"P",{});var jn=s(ro);js=i(jn,"You can get around that behavior by passing "),Tt=a(jn,"CODE",{});var Ei=s(Tt);Fs=i(Ei,"add_prefix_space=True"),Ei.forEach(t),Ps=i(jn,` when instantiating this tokenizer, but since
the model was not pretrained this way, it might yield a decrease in performance.`),jn.forEach(t),Us=h(j),k(we.$$.fragment,j),Ws=h(j),io=a(j,"P",{});var Fn=s(io);Is=i(Fn,"This tokenizer inherits from "),Wo=a(Fn,"A",{href:!0});var zi=s(Wo);Ns=i(zi,"PreTrainedTokenizerFast"),zi.forEach(t),Js=i(Fn,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Fn.forEach(t),qs=h(j),N=a(j,"DIV",{class:!0});var ze=s(N);k(lo.$$.fragment,ze),Zs=h(ze),Mt=a(ze,"P",{});var xi=s(Mt);Bs=i(xi,`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),xi.forEach(t),Vs=h(ze),co=a(ze,"P",{});var Pn=s(co);Ls=i(Pn,"Similar to doing "),Gt=a(Pn,"CODE",{});var ji=s(Gt);As=i(ji,"self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),ji.forEach(t),Ss=i(Pn,"."),Pn.forEach(t),Ds=h(ze),po=a(ze,"P",{});var Un=s(po);Rs=i(Un,"\u201D]`.\nkwargs (additional keyword arguments, "),Et=a(Un,"EM",{});var Fi=s(Et);Hs=i(Fi,"optional"),Fi.forEach(t),Os=i(Un,`):
Will be passed to the underlying model specific decode method.`),Un.forEach(t),ze.forEach(t),j.forEach(t),pn=h(o),te=a(o,"H2",{class:!0});var Wn=s(te);Ce=a(Wn,"A",{id:!0,class:!0,href:!0});var Pi=s(Ce);zt=a(Pi,"SPAN",{});var Ui=s(zt);k(ho.$$.fragment,Ui),Ui.forEach(t),Pi.forEach(t),Xs=h(Wn),xt=a(Wn,"SPAN",{});var Wi=s(xt);Qs=i(Wi,"CodeGenModel"),Wi.forEach(t),Wn.forEach(t),hn=h(o),V=a(o,"DIV",{class:!0});var Vo=s(V);k(mo.$$.fragment,Vo),Ys=h(Vo),fo=a(Vo,"P",{});var In=s(fo);Ks=i(In,`The bare CodeGen Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),uo=a(In,"A",{href:!0,rel:!0});var Ii=s(uo);er=i(Ii,"torch.nn.Module"),Ii.forEach(t),or=i(In,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),In.forEach(t),tr=h(Vo),J=a(Vo,"DIV",{class:!0});var xe=s(J);k(go.$$.fragment,xe),nr=h(xe),ne=a(xe,"P",{});var Lo=s(ne);ar=i(Lo,"The "),Io=a(Lo,"A",{href:!0});var Ni=s(Io);sr=i(Ni,"CodeGenModel"),Ni.forEach(t),rr=i(Lo," forward method, overrides the "),jt=a(Lo,"CODE",{});var Ji=s(jt);ir=i(Ji,"__call__"),Ji.forEach(t),lr=i(Lo," special method."),Lo.forEach(t),dr=h(xe),k($e.$$.fragment,xe),cr=h(xe),k(Te.$$.fragment,xe),xe.forEach(t),Vo.forEach(t),mn=h(o),ae=a(o,"H2",{class:!0});var Nn=s(ae);Me=a(Nn,"A",{id:!0,class:!0,href:!0});var qi=s(Me);Ft=a(qi,"SPAN",{});var Zi=s(Ft);k(_o.$$.fragment,Zi),Zi.forEach(t),qi.forEach(t),pr=h(Nn),Pt=a(Nn,"SPAN",{});var Bi=s(Pt);hr=i(Bi,"CodeGenForCausalLM"),Bi.forEach(t),Nn.forEach(t),fn=h(o),W=a(o,"DIV",{class:!0});var je=s(W);k(bo.$$.fragment,je),mr=h(je),Ut=a(je,"P",{});var Vi=s(Ut);fr=i(Vi,"The CodeGen Model transformer with a language modeling head on top."),Vi.forEach(t),ur=h(je),vo=a(je,"P",{});var Jn=s(vo);gr=i(Jn,"This model is a PyTorch "),yo=a(Jn,"A",{href:!0,rel:!0});var Li=s(yo);_r=i(Li,"torch.nn.Module"),Li.forEach(t),br=i(Jn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Jn.forEach(t),vr=h(je),q=a(je,"DIV",{class:!0});var Fe=s(q);k(ko.$$.fragment,Fe),yr=h(Fe),se=a(Fe,"P",{});var Ao=s(se);kr=i(Ao,"The "),No=a(Ao,"A",{href:!0});var Ai=s(No);wr=i(Ai,"CodeGenForCausalLM"),Ai.forEach(t),Cr=i(Ao," forward method, overrides the "),Wt=a(Ao,"CODE",{});var Si=s(Wt);$r=i(Si,"__call__"),Si.forEach(t),Tr=i(Ao," special method."),Ao.forEach(t),Mr=h(Fe),k(Ge.$$.fragment,Fe),Gr=h(Fe),k(Ee.$$.fragment,Fe),Fe.forEach(t),je.forEach(t),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(il)),c(f,"id","codegen"),c(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"),c(f,"href","#codegen"),c(_,"class","relative group"),c(Z,"id","overview"),c(Z,"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(Z,"href","#overview"),c(I,"class","relative group"),c(Ue,"href","https://arxiv.org/abs/2203.13474"),c(Ue,"rel","nofollow"),c(We,"href","https://pile.eleuther.ai/"),c(We,"rel","nofollow"),c(Ne,"href","https://github.com/salesforce/codegen"),c(Ne,"rel","nofollow"),c(Je,"href","https://huggingface.co/rooa"),c(Je,"rel","nofollow"),c(qe,"href","https://github.com/salesforce/codegen"),c(qe,"rel","nofollow"),c(de,"id","checkpoint-naming"),c(de,"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(de,"href","#checkpoint-naming"),c(O,"class","relative group"),c(Ve,"href","https://huggingface.co/models?other=codegen"),c(Ve,"rel","nofollow"),c(me,"id","how-to-use"),c(me,"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(me,"href","#how-to-use"),c(Q,"class","relative group"),c(fe,"id","documentation-resources"),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","#documentation-resources"),c(Y,"class","relative group"),c(zo,"href","../tasks/language_modeling"),c(ue,"id","transformers.CodeGenConfig"),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.CodeGenConfig"),c(K,"class","relative group"),c(xo,"href","/docs/transformers/main/en/model_doc/codegen#transformers.CodeGenModel"),c(Qe,"href","https://huggingface.co/Salesforce/codegen-2B-mono"),c(Qe,"rel","nofollow"),c(jo,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(Fo,"href","/docs/transformers/main/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(_e,"id","transformers.CodeGenTokenizer"),c(_e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(_e,"href","#transformers.CodeGenTokenizer"),c(ee,"class","relative group"),c(Po,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),c(Uo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ye,"id","transformers.CodeGenTokenizerFast"),c(ye,"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(ye,"href","#transformers.CodeGenTokenizerFast"),c(oe,"class","relative group"),c(Wo,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(Ce,"id","transformers.CodeGenModel"),c(Ce,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ce,"href","#transformers.CodeGenModel"),c(te,"class","relative group"),c(uo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(uo,"rel","nofollow"),c(Io,"href","/docs/transformers/main/en/model_doc/codegen#transformers.CodeGenModel"),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(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(Me,"id","transformers.CodeGenForCausalLM"),c(Me,"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(Me,"href","#transformers.CodeGenForCausalLM"),c(ae,"class","relative group"),c(yo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(yo,"rel","nofollow"),c(No,"href","/docs/transformers/main/en/model_doc/codegen#transformers.CodeGenForCausalLM"),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(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,m){e(document.head,d),g(o,v,m),g(o,_,m),e(_,f),e(f,b),w(l,b,null),e(_,u),e(_,z),e(z,H),g(o,F,m),g(o,I,m),e(I,Z),e(Z,Do),w(Pe,Do,null),e(I,Zn),e(I,Ro),e(Ro,Bn),g(o,Rt,m),g(o,ie,m),e(ie,Vn),e(ie,Ue),e(Ue,Ln),e(ie,An),g(o,Ht,m),g(o,le,m),e(le,Sn),e(le,We),e(We,Dn),e(le,Rn),g(o,Ot,m),g(o,To,m),e(To,Hn),g(o,Xt,m),g(o,Mo,m),e(Mo,Ie),e(Ie,On),e(Ie,Ne),e(Ne,Xn),e(Ie,Qn),g(o,Qt,m),g(o,L,m),e(L,Yn),e(L,Je),e(Je,Kn),e(L,ea),e(L,qe),e(qe,oa),e(L,ta),g(o,Yt,m),g(o,O,m),e(O,de),e(de,Ho),w(Ze,Ho,null),e(O,na),e(O,Oo),e(Oo,aa),g(o,Kt,m),g(o,A,m),e(A,Be),e(Be,sa),e(Be,Ve),e(Ve,ra),e(Be,ia),e(A,la),e(A,ce),e(ce,da),e(ce,Xo),e(Xo,ca),e(ce,pa),e(ce,Le),e(Le,P),e(P,Qo),e(Qo,ha),e(P,ma),e(P,Yo),e(Yo,fa),e(P,ua),e(P,Ko),e(Ko,ga),e(P,_a),e(P,et),e(et,ba),e(P,va),e(P,ot),e(ot,ya),e(Le,ka),e(Le,Ae),e(Ae,tt),e(tt,wa),e(Ae,Ca),e(Ae,X),e(X,Go),e(Go,nt),e(nt,$a),e(Go,Ta),e(X,Ma),e(X,pe),e(pe,at),e(at,Ga),e(pe,Ea),e(pe,st),e(st,za),e(pe,xa),e(X,ja),e(X,he),e(he,rt),e(rt,Fa),e(he,Pa),e(he,it),e(it,Ua),e(he,Wa),e(A,Ia),e(A,Se),e(Se,Na),e(Se,lt),e(lt,Ja),e(Se,qa),g(o,en,m),g(o,Q,m),e(Q,me),e(me,dt),w(De,dt,null),e(Q,Za),e(Q,ct),e(ct,Ba),g(o,on,m),w(Re,o,m),g(o,tn,m),g(o,Y,m),e(Y,fe),e(fe,pt),w(He,pt,null),e(Y,Va),e(Y,ht),e(ht,La),g(o,nn,m),g(o,Eo,m),e(Eo,mt),e(mt,zo),e(zo,Aa),g(o,an,m),g(o,K,m),e(K,ue),e(ue,ft),w(Oe,ft,null),e(K,Sa),e(K,ut),e(ut,Da),g(o,sn,m),g(o,B,m),w(Xe,B,null),e(B,Ra),e(B,U),e(U,Ha),e(U,xo),e(xo,Oa),e(U,Xa),e(U,Qe),e(Qe,Qa),e(U,Ya),e(U,jo),e(jo,Ka),e(U,es),e(U,Fo),e(Fo,os),e(U,ts),e(B,ns),w(ge,B,null),g(o,rn,m),g(o,ee,m),e(ee,_e),e(_e,gt),w(Ye,gt,null),e(ee,as),e(ee,_t),e(_t,ss),g(o,ln,m),g(o,M,m),w(Ke,M,null),e(M,rs),e(M,bt),e(bt,is),e(M,ls),e(M,vt),e(vt,ds),e(M,cs),w(be,M,null),e(M,ps),e(M,eo),e(eo,hs),e(eo,yt),e(yt,ms),e(eo,fs),e(M,us),w(ve,M,null),e(M,gs),e(M,oo),e(oo,_s),e(oo,Po),e(Po,bs),e(oo,vs),e(M,ys),e(M,Uo),w(to,Uo,null),g(o,dn,m),g(o,oe,m),e(oe,ye),e(ye,kt),w(no,kt,null),e(oe,ks),e(oe,wt),e(wt,ws),g(o,cn,m),g(o,G,m),w(ao,G,null),e(G,Cs),e(G,so),e(so,$s),e(so,Ct),e(Ct,Ts),e(so,Ms),e(G,Gs),e(G,$t),e($t,Es),e(G,zs),w(ke,G,null),e(G,xs),e(G,ro),e(ro,js),e(ro,Tt),e(Tt,Fs),e(ro,Ps),e(G,Us),w(we,G,null),e(G,Ws),e(G,io),e(io,Is),e(io,Wo),e(Wo,Ns),e(io,Js),e(G,qs),e(G,N),w(lo,N,null),e(N,Zs),e(N,Mt),e(Mt,Bs),e(N,Vs),e(N,co),e(co,Ls),e(co,Gt),e(Gt,As),e(co,Ss),e(N,Ds),e(N,po),e(po,Rs),e(po,Et),e(Et,Hs),e(po,Os),g(o,pn,m),g(o,te,m),e(te,Ce),e(Ce,zt),w(ho,zt,null),e(te,Xs),e(te,xt),e(xt,Qs),g(o,hn,m),g(o,V,m),w(mo,V,null),e(V,Ys),e(V,fo),e(fo,Ks),e(fo,uo),e(uo,er),e(fo,or),e(V,tr),e(V,J),w(go,J,null),e(J,nr),e(J,ne),e(ne,ar),e(ne,Io),e(Io,sr),e(ne,rr),e(ne,jt),e(jt,ir),e(ne,lr),e(J,dr),w($e,J,null),e(J,cr),w(Te,J,null),g(o,mn,m),g(o,ae,m),e(ae,Me),e(Me,Ft),w(_o,Ft,null),e(ae,pr),e(ae,Pt),e(Pt,hr),g(o,fn,m),g(o,W,m),w(bo,W,null),e(W,mr),e(W,Ut),e(Ut,fr),e(W,ur),e(W,vo),e(vo,gr),e(vo,yo),e(yo,_r),e(vo,br),e(W,vr),e(W,q),w(ko,q,null),e(q,yr),e(q,se),e(se,kr),e(se,No),e(No,wr),e(se,Cr),e(se,Wt),e(Wt,$r),e(se,Tr),e(q,Mr),w(Ge,q,null),e(q,Gr),w(Ee,q,null),un=!0},p(o,[m]){const wo={};m&2&&(wo.$$scope={dirty:m,ctx:o}),ge.$set(wo);const It={};m&2&&(It.$$scope={dirty:m,ctx:o}),be.$set(It);const Nt={};m&2&&(Nt.$$scope={dirty:m,ctx:o}),ve.$set(Nt);const Jt={};m&2&&(Jt.$$scope={dirty:m,ctx:o}),ke.$set(Jt);const Co={};m&2&&(Co.$$scope={dirty:m,ctx:o}),we.$set(Co);const qt={};m&2&&(qt.$$scope={dirty:m,ctx:o}),$e.$set(qt);const Zt={};m&2&&(Zt.$$scope={dirty:m,ctx:o}),Te.$set(Zt);const Bt={};m&2&&(Bt.$$scope={dirty:m,ctx:o}),Ge.$set(Bt);const $o={};m&2&&($o.$$scope={dirty:m,ctx:o}),Ee.$set($o)},i(o){un||(C(l.$$.fragment,o),C(Pe.$$.fragment,o),C(Ze.$$.fragment,o),C(De.$$.fragment,o),C(Re.$$.fragment,o),C(He.$$.fragment,o),C(Oe.$$.fragment,o),C(Xe.$$.fragment,o),C(ge.$$.fragment,o),C(Ye.$$.fragment,o),C(Ke.$$.fragment,o),C(be.$$.fragment,o),C(ve.$$.fragment,o),C(to.$$.fragment,o),C(no.$$.fragment,o),C(ao.$$.fragment,o),C(ke.$$.fragment,o),C(we.$$.fragment,o),C(lo.$$.fragment,o),C(ho.$$.fragment,o),C(mo.$$.fragment,o),C(go.$$.fragment,o),C($e.$$.fragment,o),C(Te.$$.fragment,o),C(_o.$$.fragment,o),C(bo.$$.fragment,o),C(ko.$$.fragment,o),C(Ge.$$.fragment,o),C(Ee.$$.fragment,o),un=!0)},o(o){$(l.$$.fragment,o),$(Pe.$$.fragment,o),$(Ze.$$.fragment,o),$(De.$$.fragment,o),$(Re.$$.fragment,o),$(He.$$.fragment,o),$(Oe.$$.fragment,o),$(Xe.$$.fragment,o),$(ge.$$.fragment,o),$(Ye.$$.fragment,o),$(Ke.$$.fragment,o),$(be.$$.fragment,o),$(ve.$$.fragment,o),$(to.$$.fragment,o),$(no.$$.fragment,o),$(ao.$$.fragment,o),$(ke.$$.fragment,o),$(we.$$.fragment,o),$(lo.$$.fragment,o),$(ho.$$.fragment,o),$(mo.$$.fragment,o),$(go.$$.fragment,o),$($e.$$.fragment,o),$(Te.$$.fragment,o),$(_o.$$.fragment,o),$(bo.$$.fragment,o),$(ko.$$.fragment,o),$(Ge.$$.fragment,o),$(Ee.$$.fragment,o),un=!1},d(o){t(d),o&&t(v),o&&t(_),T(l),o&&t(F),o&&t(I),T(Pe),o&&t(Rt),o&&t(ie),o&&t(Ht),o&&t(le),o&&t(Ot),o&&t(To),o&&t(Xt),o&&t(Mo),o&&t(Qt),o&&t(L),o&&t(Yt),o&&t(O),T(Ze),o&&t(Kt),o&&t(A),o&&t(en),o&&t(Q),T(De),o&&t(on),T(Re,o),o&&t(tn),o&&t(Y),T(He),o&&t(nn),o&&t(Eo),o&&t(an),o&&t(K),T(Oe),o&&t(sn),o&&t(B),T(Xe),T(ge),o&&t(rn),o&&t(ee),T(Ye),o&&t(ln),o&&t(M),T(Ke),T(be),T(ve),T(to),o&&t(dn),o&&t(oe),T(no),o&&t(cn),o&&t(G),T(ao),T(ke),T(we),T(lo),o&&t(pn),o&&t(te),T(ho),o&&t(hn),o&&t(V),T(mo),T(go),T($e),T(Te),o&&t(mn),o&&t(ae),T(_o),o&&t(fn),o&&t(W),T(bo),T(ko),T(Ge),T(Ee)}}}const il={local:"codegen",sections:[{local:"overview",title:"Overview"},{local:"checkpoint-naming",title:"Checkpoint Naming"},{local:"how-to-use",title:"How to use"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.CodeGenConfig",title:"CodeGenConfig"},{local:"transformers.CodeGenTokenizer",title:"CodeGenTokenizer"},{local:"transformers.CodeGenTokenizerFast",title:"CodeGenTokenizerFast"},{local:"transformers.CodeGenModel",title:"CodeGenModel"},{local:"transformers.CodeGenForCausalLM",title:"CodeGenForCausalLM"}],title:"CodeGen"};function ll(E){return Xi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ul extends Di{constructor(d){super();Ri(this,d,ll,rl,Hi,{})}}export{ul as default,il as metadata};
