import{s as ts,o as os,n as A}from"../chunks/scheduler.9bc65507.js";import{S as ns,i as ss,g as n,s as l,u as _,A as as,h as s,f as t,c as d,j as f,v,y as u,k as m,o,a as c,w as b,d as k,t as y,x as C}from"../chunks/index.78c82d43.js";import{T as vo}from"../chunks/Tip.87d55b76.js";import{D as R}from"../chunks/Docstring.f3d04bd2.js";import{C as Ct}from"../chunks/CodeBlock.48618ec2.js";import{I as P}from"../chunks/IconCopyLink.bedaa44d.js";import{E as qt}from"../chunks/ExampleCodeBlock.872b014d.js";function rs(x){let r,w="Example:",p,h,g;return h=new Ct({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(){r=n("p"),r.textContent=w,p=l(),_(h.$$.fragment)},l(a){r=s(a,"P",{"data-svelte-h":!0}),u(r)!=="svelte-11lpom8"&&(r.textContent=w),p=d(a),v(h.$$.fragment,a)},m(a,$){c(a,r,$),c(a,p,$),b(h,a,$),g=!0},p:A,i(a){g||(k(h.$$.fragment,a),g=!0)},o(a){y(h.$$.fragment,a),g=!1},d(a){a&&(t(r),t(p)),C(h,a)}}}function is(x){let r,w="be encoded differently whether it is at the beginning of the sentence (without space) or not:",p,h,g;return h=new Ct({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(){r=n("p"),r.textContent=w,p=l(),_(h.$$.fragment)},l(a){r=s(a,"P",{"data-svelte-h":!0}),u(r)!=="svelte-12atnao"&&(r.textContent=w),p=d(a),v(h.$$.fragment,a)},m(a,$){c(a,r,$),c(a,p,$),b(h,a,$),g=!0},p:A,i(a){g||(k(h.$$.fragment,a),g=!0)},o(a){y(h.$$.fragment,a),g=!1},d(a){a&&(t(r),t(p)),C(h,a)}}}function ls(x){let r,w="When used with <code>is_split_into_words=True</code>, this tokenizer will add a space before each word (even the first one).";return{c(){r=n("p"),r.innerHTML=w},l(p){r=s(p,"P",{"data-svelte-h":!0}),u(r)!=="svelte-jhmxzm"&&(r.innerHTML=w)},m(p,h){c(p,r,h)},p:A,d(p){p&&t(r)}}}function ds(x){let r,w="be encoded differently whether it is at the beginning of the sentence (without space) or not:",p,h,g;return h=new Ct({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(){r=n("p"),r.textContent=w,p=l(),_(h.$$.fragment)},l(a){r=s(a,"P",{"data-svelte-h":!0}),u(r)!=="svelte-12atnao"&&(r.textContent=w),p=d(a),v(h.$$.fragment,a)},m(a,$){c(a,r,$),c(a,p,$),b(h,a,$),g=!0},p:A,i(a){g||(k(h.$$.fragment,a),g=!0)},o(a){y(h.$$.fragment,a),g=!1},d(a){a&&(t(r),t(p)),C(h,a)}}}function cs(x){let r,w="When used with <code>is_split_into_words=True</code>, this tokenizer needs to be instantiated with <code>add_prefix_space=True</code>.";return{c(){r=n("p"),r.innerHTML=w},l(p){r=s(p,"P",{"data-svelte-h":!0}),u(r)!=="svelte-9gg91e"&&(r.innerHTML=w)},m(p,h){c(p,r,h)},p:A,d(p){p&&t(r)}}}function ps(x){let r,w=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=n("p"),r.innerHTML=w},l(p){r=s(p,"P",{"data-svelte-h":!0}),u(r)!=="svelte-fincs2"&&(r.innerHTML=w)},m(p,h){c(p,r,h)},p:A,d(p){p&&t(r)}}}function hs(x){let r,w="Example:",p,h,g;return h=new Ct({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(){r=n("p"),r.textContent=w,p=l(),_(h.$$.fragment)},l(a){r=s(a,"P",{"data-svelte-h":!0}),u(r)!=="svelte-11lpom8"&&(r.textContent=w),p=d(a),v(h.$$.fragment,a)},m(a,$){c(a,r,$),c(a,p,$),b(h,a,$),g=!0},p:A,i(a){g||(k(h.$$.fragment,a),g=!0)},o(a){y(h.$$.fragment,a),g=!1},d(a){a&&(t(r),t(p)),C(h,a)}}}function ms(x){let r,w=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=n("p"),r.innerHTML=w},l(p){r=s(p,"P",{"data-svelte-h":!0}),u(r)!=="svelte-fincs2"&&(r.innerHTML=w)},m(p,h){c(p,r,h)},p:A,d(p){p&&t(r)}}}function us(x){let r,w="Example:",p,h,g;return h=new Ct({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(){r=n("p"),r.textContent=w,p=l(),_(h.$$.fragment)},l(a){r=s(a,"P",{"data-svelte-h":!0}),u(r)!=="svelte-11lpom8"&&(r.textContent=w),p=d(a),v(h.$$.fragment,a)},m(a,$){c(a,r,$),c(a,p,$),b(h,a,$),g=!0},p:A,i(a){g||(k(h.$$.fragment,a),g=!0)},o(a){y(h.$$.fragment,a),g=!1},d(a){a&&(t(r),t(p)),C(h,a)}}}function fs(x){let r,w,p,h,g,a,$,ge,bo,Re,an="CodeGen",Ht,W,D,wt,_e,ko,Ae,rn="Overview",Et,ve,ln='The CodeGen model was proposed in <a href="https://arxiv.org/abs/2203.13474" rel="nofollow">A Conversational Paradigm for Program Synthesis</a> by Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, and Caiming Xiong.',It,be,dn='CodeGen is an autoregressive language model for program synthesis trained sequentially on <a href="https://pile.eleuther.ai/" rel="nofollow">The Pile</a>, BigQuery, and BigPython.',Vt,ke,cn="The abstract from the paper is the following:",Bt,ye,pn='<em>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’s Codex on the HumanEval benchmark. We make the training library JaxFormer including checkpoints available as open source contribution: <a href="https://github.com/salesforce/codegen" rel="nofollow">this https URL</a>.</em>',St,Ce,hn=`This model was contributed by <a href="https://huggingface.co/rooa" rel="nofollow">Hiroaki Hayashi</a>.
The original code can be found <a href="https://github.com/salesforce/codegen" rel="nofollow">here</a>.`,Rt,Z,X,$t,we,yo,De,mn="Checkpoint Naming",At,$e,un='<li>CodeGen model <a href="https://huggingface.co/models?other=codegen" rel="nofollow">checkpoints</a> are available on different pre-training data with variable sizes.</li> <li>The format is: <code>Salesforce/codegen-{size}-{data}</code>, where<ul><li><code>size</code>: <code>350M</code>, <code>2B</code>, <code>6B</code>, <code>16B</code></li> <li><code>data</code>: <ul><li><code>nl</code>: Pre-trained on the Pile</li> <li><code>multi</code>: Initialized with <code>nl</code>, then further pre-trained on multiple programming languages data</li> <li><code>mono</code>: Initialized with <code>multi</code>, then further pre-trained on Python data</li></ul></li></ul></li> <li>For example, <code>Salesforce/codegen-350M-mono</code> offers a 350 million-parameter checkpoint pre-trained sequentially on the Pile, multiple programming languages, and Python.</li>',Dt,q,Q,Tt,Te,Co,Xe,fn="How to use",Xt,Me,Qt,H,O,Mt,xe,wo,Qe,gn="Documentation resources",Ot,Ge,_n='<li><a href="../tasks/language_modeling">Causal language modeling task guide</a></li>',Yt,E,Y,xt,ze,$o,Oe,vn="CodeGenConfig",Kt,N,je,To,Ye,bn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.33.3/en/model_doc/codegen#transformers.CodeGenModel">CodeGenModel</a>. 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
<a href="https://huggingface.co/Salesforce/codegen-2B-mono" rel="nofollow">Salesforce/codegen-2B-mono</a> architecture. Configuration objects
inherit from <a href="/docs/transformers/v4.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the documentation from
<a href="/docs/transformers/v4.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Mo,K,eo,I,ee,Gt,Fe,xo,Ke,kn="CodeGenTokenizer",to,T,Ue,Go,et,yn="Construct a CodeGen tokenizer. Based on byte-level Byte-Pair-Encoding.",zo,tt,Cn="This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will",jo,te,Fo,ot,wn=`You can get around that behavior by passing <code>add_prefix_space=True</code> 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.`,Uo,oe,Lo,nt,$n=`This tokenizer inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`,No,st,Le,oo,V,ne,zt,Ne,Jo,at,Tn="CodeGenTokenizerFast",no,M,Je,Po,rt,Mn=`Construct a “fast” CodeGen tokenizer (backed by HuggingFace’s <em>tokenizers</em> library). Based on byte-level
Byte-Pair-Encoding.`,Wo,it,xn="This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will",Zo,se,qo,lt,Gn=`You can get around that behavior by passing <code>add_prefix_space=True</code> when instantiating this tokenizer, but since
the model was not pretrained this way, it might yield a decrease in performance.`,Ho,ae,Eo,dt,zn=`This tokenizer inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a> which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`,Io,F,Pe,Vo,ct,jn=`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`,Bo,pt,Fn="Similar to doing <code>self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))</code>.",So,ht,Un=`”]\`.
kwargs (additional keyword arguments, <em>optional</em>):
Will be passed to the underlying model specific decode method.`,so,B,re,jt,We,Ro,mt,Ln="CodeGenModel",ao,J,Ze,Ao,ut,Nn=`The bare CodeGen Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,Do,U,qe,Xo,ft,Jn='The <a href="/docs/transformers/v4.33.3/en/model_doc/codegen#transformers.CodeGenModel">CodeGenModel</a> forward method, overrides the <code>__call__</code> special method.',Qo,ie,Oo,le,ro,S,de,Ft,He,Yo,gt,Pn="CodeGenForCausalLM",io,j,Ee,Ko,_t,Wn="The CodeGen Model transformer with a language modeling head on top.",en,vt,Zn=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,tn,L,Ie,on,bt,qn='The <a href="/docs/transformers/v4.33.3/en/model_doc/codegen#transformers.CodeGenForCausalLM">CodeGenForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',nn,ce,sn,pe,lo,Ut,co;return ge=new P({}),_e=new P({}),we=new P({}),Te=new P({}),Me=new Ct({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()`}}),xe=new P({}),ze=new P({}),je=new R({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/v4.33.3/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/v4.33.3/src/transformers/models/codegen/configuration_codegen.py#L44"}}),K=new qt({props:{anchor:"transformers.CodeGenConfig.example",$$slots:{default:[rs]},$$scope:{ctx:x}}}),Fe=new P({}),Ue=new R({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/v4.33.3/src/transformers/models/codegen/tokenization_codegen.py#L98"}}),te=new qt({props:{anchor:"transformers.CodeGenTokenizer.example",$$slots:{default:[is]},$$scope:{ctx:x}}}),oe=new vo({props:{$$slots:{default:[ls]},$$scope:{ctx:x}}}),Le=new R({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/v4.33.3/src/transformers/models/codegen/tokenization_codegen.py#L284"}}),Ne=new P({}),Je=new R({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/v4.33.3/src/transformers/models/codegen/tokenization_codegen_fast.py#L63"}}),se=new qt({props:{anchor:"transformers.CodeGenTokenizerFast.example",$$slots:{default:[ds]},$$scope:{ctx:x}}}),ae=new vo({props:{$$slots:{default:[cs]},$$scope:{ctx:x}}}),Pe=new R({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/v4.33.3/src/transformers/models/codegen/tokenization_codegen_fast.py#L186",returnDescription:`
<p>The decoded sentence.</p>
`,returnType:`
<p><code>str</code></p>
`}}),We=new P({}),Ze=new R({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/v4.33.3/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/v4.33.3/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/codegen/modeling_codegen.py#L410"}}),qe=new R({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/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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/v4.33.3/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/codegen/modeling_codegen.py#L433",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.3/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/v4.33.3/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>) — 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>) — 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>) — 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>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ie=new vo({props:{$$slots:{default:[ps]},$$scope:{ctx:x}}}),le=new qt({props:{anchor:"transformers.CodeGenModel.forward.example",$$slots:{default:[hs]},$$scope:{ctx:x}}}),He=new P({}),Ee=new R({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/v4.33.3/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/v4.33.3/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/codegen/modeling_codegen.py#L604"}}),Ie=new R({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/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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/v4.33.3/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/v4.33.3/src/transformers/models/codegen/modeling_codegen.py#L648",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.3/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/v4.33.3/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) — 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>) — 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>) — 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>) — 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>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ce=new vo({props:{$$slots:{default:[ms]},$$scope:{ctx:x}}}),pe=new qt({props:{anchor:"transformers.CodeGenForCausalLM.forward.example",$$slots:{default:[us]},$$scope:{ctx:x}}}),{c(){r=n("meta"),w=l(),p=n("p"),h=l(),g=n("h1"),a=n("a"),$=n("span"),_(ge.$$.fragment),bo=l(),Re=n("span"),Re.textContent=an,Ht=l(),W=n("h2"),D=n("a"),wt=n("span"),_(_e.$$.fragment),ko=l(),Ae=n("span"),Ae.textContent=rn,Et=l(),ve=n("p"),ve.innerHTML=ln,It=l(),be=n("p"),be.innerHTML=dn,Vt=l(),ke=n("p"),ke.textContent=cn,Bt=l(),ye=n("p"),ye.innerHTML=pn,St=l(),Ce=n("p"),Ce.innerHTML=hn,Rt=l(),Z=n("h2"),X=n("a"),$t=n("span"),_(we.$$.fragment),yo=l(),De=n("span"),De.textContent=mn,At=l(),$e=n("ul"),$e.innerHTML=un,Dt=l(),q=n("h2"),Q=n("a"),Tt=n("span"),_(Te.$$.fragment),Co=l(),Xe=n("span"),Xe.textContent=fn,Xt=l(),_(Me.$$.fragment),Qt=l(),H=n("h2"),O=n("a"),Mt=n("span"),_(xe.$$.fragment),wo=l(),Qe=n("span"),Qe.textContent=gn,Ot=l(),Ge=n("ul"),Ge.innerHTML=_n,Yt=l(),E=n("h2"),Y=n("a"),xt=n("span"),_(ze.$$.fragment),$o=l(),Oe=n("span"),Oe.textContent=vn,Kt=l(),N=n("div"),_(je.$$.fragment),To=l(),Ye=n("p"),Ye.innerHTML=bn,Mo=l(),_(K.$$.fragment),eo=l(),I=n("h2"),ee=n("a"),Gt=n("span"),_(Fe.$$.fragment),xo=l(),Ke=n("span"),Ke.textContent=kn,to=l(),T=n("div"),_(Ue.$$.fragment),Go=l(),et=n("p"),et.textContent=yn,zo=l(),tt=n("p"),tt.textContent=Cn,jo=l(),_(te.$$.fragment),Fo=l(),ot=n("p"),ot.innerHTML=wn,Uo=l(),_(oe.$$.fragment),Lo=l(),nt=n("p"),nt.innerHTML=$n,No=l(),st=n("div"),_(Le.$$.fragment),oo=l(),V=n("h2"),ne=n("a"),zt=n("span"),_(Ne.$$.fragment),Jo=l(),at=n("span"),at.textContent=Tn,no=l(),M=n("div"),_(Je.$$.fragment),Po=l(),rt=n("p"),rt.innerHTML=Mn,Wo=l(),it=n("p"),it.textContent=xn,Zo=l(),_(se.$$.fragment),qo=l(),lt=n("p"),lt.innerHTML=Gn,Ho=l(),_(ae.$$.fragment),Eo=l(),dt=n("p"),dt.innerHTML=zn,Io=l(),F=n("div"),_(Pe.$$.fragment),Vo=l(),ct=n("p"),ct.textContent=jn,Bo=l(),pt=n("p"),pt.innerHTML=Fn,So=l(),ht=n("p"),ht.innerHTML=Un,so=l(),B=n("h2"),re=n("a"),jt=n("span"),_(We.$$.fragment),Ro=l(),mt=n("span"),mt.textContent=Ln,ao=l(),J=n("div"),_(Ze.$$.fragment),Ao=l(),ut=n("p"),ut.innerHTML=Nn,Do=l(),U=n("div"),_(qe.$$.fragment),Xo=l(),ft=n("p"),ft.innerHTML=Jn,Qo=l(),_(ie.$$.fragment),Oo=l(),_(le.$$.fragment),ro=l(),S=n("h2"),de=n("a"),Ft=n("span"),_(He.$$.fragment),Yo=l(),gt=n("span"),gt.textContent=Pn,io=l(),j=n("div"),_(Ee.$$.fragment),Ko=l(),_t=n("p"),_t.textContent=Wn,en=l(),vt=n("p"),vt.innerHTML=Zn,tn=l(),L=n("div"),_(Ie.$$.fragment),on=l(),bt=n("p"),bt.innerHTML=qn,nn=l(),_(ce.$$.fragment),sn=l(),_(pe.$$.fragment),lo=l(),Ut=n("p"),this.h()},l(e){const i=as("svelte-1phssyn",document.head);r=s(i,"META",{name:!0,content:!0}),i.forEach(t),w=d(e),p=s(e,"P",{}),f(p).forEach(t),h=d(e),g=s(e,"H1",{class:!0});var Ve=f(g);a=s(Ve,"A",{id:!0,class:!0,href:!0});var Lt=f(a);$=s(Lt,"SPAN",{});var Nt=f($);v(ge.$$.fragment,Nt),Nt.forEach(t),Lt.forEach(t),bo=d(Ve),Re=s(Ve,"SPAN",{"data-svelte-h":!0}),u(Re)!=="svelte-1wap18a"&&(Re.textContent=an),Ve.forEach(t),Ht=d(e),W=s(e,"H2",{class:!0});var Be=f(W);D=s(Be,"A",{id:!0,class:!0,href:!0});var Jt=f(D);wt=s(Jt,"SPAN",{});var Pt=f(wt);v(_e.$$.fragment,Pt),Pt.forEach(t),Jt.forEach(t),ko=d(Be),Ae=s(Be,"SPAN",{"data-svelte-h":!0}),u(Ae)!=="svelte-1jsw1pg"&&(Ae.textContent=rn),Be.forEach(t),Et=d(e),ve=s(e,"P",{"data-svelte-h":!0}),u(ve)!=="svelte-18sg9sp"&&(ve.innerHTML=ln),It=d(e),be=s(e,"P",{"data-svelte-h":!0}),u(be)!=="svelte-1otqweb"&&(be.innerHTML=dn),Vt=d(e),ke=s(e,"P",{"data-svelte-h":!0}),u(ke)!=="svelte-vfdo9a"&&(ke.textContent=cn),Bt=d(e),ye=s(e,"P",{"data-svelte-h":!0}),u(ye)!=="svelte-wlq8gq"&&(ye.innerHTML=pn),St=d(e),Ce=s(e,"P",{"data-svelte-h":!0}),u(Ce)!=="svelte-1tmo4v6"&&(Ce.innerHTML=hn),Rt=d(e),Z=s(e,"H2",{class:!0});var Se=f(Z);X=s(Se,"A",{id:!0,class:!0,href:!0});var Wt=f(X);$t=s(Wt,"SPAN",{});var Zt=f($t);v(we.$$.fragment,Zt),Zt.forEach(t),Wt.forEach(t),yo=d(Se),De=s(Se,"SPAN",{"data-svelte-h":!0}),u(De)!=="svelte-1ldx2fh"&&(De.textContent=mn),Se.forEach(t),At=d(e),$e=s(e,"UL",{"data-svelte-h":!0}),u($e)!=="svelte-df3ea3"&&($e.innerHTML=un),Dt=d(e),q=s(e,"H2",{class:!0});var po=f(q);Q=s(po,"A",{id:!0,class:!0,href:!0});var Hn=f(Q);Tt=s(Hn,"SPAN",{});var En=f(Tt);v(Te.$$.fragment,En),En.forEach(t),Hn.forEach(t),Co=d(po),Xe=s(po,"SPAN",{"data-svelte-h":!0}),u(Xe)!=="svelte-2d5skl"&&(Xe.textContent=fn),po.forEach(t),Xt=d(e),v(Me.$$.fragment,e),Qt=d(e),H=s(e,"H2",{class:!0});var ho=f(H);O=s(ho,"A",{id:!0,class:!0,href:!0});var In=f(O);Mt=s(In,"SPAN",{});var Vn=f(Mt);v(xe.$$.fragment,Vn),Vn.forEach(t),In.forEach(t),wo=d(ho),Qe=s(ho,"SPAN",{"data-svelte-h":!0}),u(Qe)!=="svelte-n3f0j0"&&(Qe.textContent=gn),ho.forEach(t),Ot=d(e),Ge=s(e,"UL",{"data-svelte-h":!0}),u(Ge)!=="svelte-162aebv"&&(Ge.innerHTML=_n),Yt=d(e),E=s(e,"H2",{class:!0});var mo=f(E);Y=s(mo,"A",{id:!0,class:!0,href:!0});var Bn=f(Y);xt=s(Bn,"SPAN",{});var Sn=f(xt);v(ze.$$.fragment,Sn),Sn.forEach(t),Bn.forEach(t),$o=d(mo),Oe=s(mo,"SPAN",{"data-svelte-h":!0}),u(Oe)!=="svelte-c1dz1g"&&(Oe.textContent=vn),mo.forEach(t),Kt=d(e),N=s(e,"DIV",{class:!0});var kt=f(N);v(je.$$.fragment,kt),To=d(kt),Ye=s(kt,"P",{"data-svelte-h":!0}),u(Ye)!=="svelte-k5ladf"&&(Ye.innerHTML=bn),Mo=d(kt),v(K.$$.fragment,kt),kt.forEach(t),eo=d(e),I=s(e,"H2",{class:!0});var uo=f(I);ee=s(uo,"A",{id:!0,class:!0,href:!0});var Rn=f(ee);Gt=s(Rn,"SPAN",{});var An=f(Gt);v(Fe.$$.fragment,An),An.forEach(t),Rn.forEach(t),xo=d(uo),Ke=s(uo,"SPAN",{"data-svelte-h":!0}),u(Ke)!=="svelte-19cf0ln"&&(Ke.textContent=kn),uo.forEach(t),to=d(e),T=s(e,"DIV",{class:!0});var G=f(T);v(Ue.$$.fragment,G),Go=d(G),et=s(G,"P",{"data-svelte-h":!0}),u(et)!=="svelte-3tmseo"&&(et.textContent=yn),zo=d(G),tt=s(G,"P",{"data-svelte-h":!0}),u(tt)!=="svelte-1s077p3"&&(tt.textContent=Cn),jo=d(G),v(te.$$.fragment,G),Fo=d(G),ot=s(G,"P",{"data-svelte-h":!0}),u(ot)!=="svelte-1jfcabo"&&(ot.innerHTML=wn),Uo=d(G),v(oe.$$.fragment,G),Lo=d(G),nt=s(G,"P",{"data-svelte-h":!0}),u(nt)!=="svelte-14xlfoy"&&(nt.innerHTML=$n),No=d(G),st=s(G,"DIV",{class:!0});var Dn=f(st);v(Le.$$.fragment,Dn),Dn.forEach(t),G.forEach(t),oo=d(e),V=s(e,"H2",{class:!0});var fo=f(V);ne=s(fo,"A",{id:!0,class:!0,href:!0});var Xn=f(ne);zt=s(Xn,"SPAN",{});var Qn=f(zt);v(Ne.$$.fragment,Qn),Qn.forEach(t),Xn.forEach(t),Jo=d(fo),at=s(fo,"SPAN",{"data-svelte-h":!0}),u(at)!=="svelte-ylt8z9"&&(at.textContent=Tn),fo.forEach(t),no=d(e),M=s(e,"DIV",{class:!0});var z=f(M);v(Je.$$.fragment,z),Po=d(z),rt=s(z,"P",{"data-svelte-h":!0}),u(rt)!=="svelte-ct13nj"&&(rt.innerHTML=Mn),Wo=d(z),it=s(z,"P",{"data-svelte-h":!0}),u(it)!=="svelte-1s077p3"&&(it.textContent=xn),Zo=d(z),v(se.$$.fragment,z),qo=d(z),lt=s(z,"P",{"data-svelte-h":!0}),u(lt)!=="svelte-1afeqmz"&&(lt.innerHTML=Gn),Ho=d(z),v(ae.$$.fragment,z),Eo=d(z),dt=s(z,"P",{"data-svelte-h":!0}),u(dt)!=="svelte-10uwgx2"&&(dt.innerHTML=zn),Io=d(z),F=s(z,"DIV",{class:!0});var he=f(F);v(Pe.$$.fragment,he),Vo=d(he),ct=s(he,"P",{"data-svelte-h":!0}),u(ct)!=="svelte-vbfkpu"&&(ct.textContent=jn),Bo=d(he),pt=s(he,"P",{"data-svelte-h":!0}),u(pt)!=="svelte-125uxon"&&(pt.innerHTML=Fn),So=d(he),ht=s(he,"P",{"data-svelte-h":!0}),u(ht)!=="svelte-zuidod"&&(ht.innerHTML=Un),he.forEach(t),z.forEach(t),so=d(e),B=s(e,"H2",{class:!0});var go=f(B);re=s(go,"A",{id:!0,class:!0,href:!0});var On=f(re);jt=s(On,"SPAN",{});var Yn=f(jt);v(We.$$.fragment,Yn),Yn.forEach(t),On.forEach(t),Ro=d(go),mt=s(go,"SPAN",{"data-svelte-h":!0}),u(mt)!=="svelte-45r8kr"&&(mt.textContent=Ln),go.forEach(t),ao=d(e),J=s(e,"DIV",{class:!0});var yt=f(J);v(Ze.$$.fragment,yt),Ao=d(yt),ut=s(yt,"P",{"data-svelte-h":!0}),u(ut)!=="svelte-4cc469"&&(ut.innerHTML=Nn),Do=d(yt),U=s(yt,"DIV",{class:!0});var me=f(U);v(qe.$$.fragment,me),Xo=d(me),ft=s(me,"P",{"data-svelte-h":!0}),u(ft)!=="svelte-yjg25u"&&(ft.innerHTML=Jn),Qo=d(me),v(ie.$$.fragment,me),Oo=d(me),v(le.$$.fragment,me),me.forEach(t),yt.forEach(t),ro=d(e),S=s(e,"H2",{class:!0});var _o=f(S);de=s(_o,"A",{id:!0,class:!0,href:!0});var Kn=f(de);Ft=s(Kn,"SPAN",{});var es=f(Ft);v(He.$$.fragment,es),es.forEach(t),Kn.forEach(t),Yo=d(_o),gt=s(_o,"SPAN",{"data-svelte-h":!0}),u(gt)!=="svelte-1ufqj8b"&&(gt.textContent=Pn),_o.forEach(t),io=d(e),j=s(e,"DIV",{class:!0});var ue=f(j);v(Ee.$$.fragment,ue),Ko=d(ue),_t=s(ue,"P",{"data-svelte-h":!0}),u(_t)!=="svelte-8jmfdo"&&(_t.textContent=Wn),en=d(ue),vt=s(ue,"P",{"data-svelte-h":!0}),u(vt)!=="svelte-68lg8f"&&(vt.innerHTML=Zn),tn=d(ue),L=s(ue,"DIV",{class:!0});var fe=f(L);v(Ie.$$.fragment,fe),on=d(fe),bt=s(fe,"P",{"data-svelte-h":!0}),u(bt)!=="svelte-wx09j6"&&(bt.innerHTML=qn),nn=d(fe),v(ce.$$.fragment,fe),sn=d(fe),v(pe.$$.fragment,fe),fe.forEach(t),ue.forEach(t),lo=d(e),Ut=s(e,"P",{}),f(Ut).forEach(t),this.h()},h(){m(r,"name","hf:doc:metadata"),m(r,"content",JSON.stringify(gs)),m(a,"id","codegen"),m(a,"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"),m(a,"href","#codegen"),m(g,"class","relative group"),m(D,"id","overview"),m(D,"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"),m(D,"href","#overview"),m(W,"class","relative group"),m(X,"id","checkpoint-naming"),m(X,"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"),m(X,"href","#checkpoint-naming"),m(Z,"class","relative group"),m(Q,"id","how-to-use"),m(Q,"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"),m(Q,"href","#how-to-use"),m(q,"class","relative group"),m(O,"id","documentation-resources"),m(O,"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"),m(O,"href","#documentation-resources"),m(H,"class","relative group"),m(Y,"id","transformers.CodeGenConfig"),m(Y,"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"),m(Y,"href","#transformers.CodeGenConfig"),m(E,"class","relative group"),m(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ee,"id","transformers.CodeGenTokenizer"),m(ee,"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"),m(ee,"href","#transformers.CodeGenTokenizer"),m(I,"class","relative group"),m(st,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ne,"id","transformers.CodeGenTokenizerFast"),m(ne,"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"),m(ne,"href","#transformers.CodeGenTokenizerFast"),m(V,"class","relative group"),m(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(re,"id","transformers.CodeGenModel"),m(re,"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"),m(re,"href","#transformers.CodeGenModel"),m(B,"class","relative group"),m(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(de,"id","transformers.CodeGenForCausalLM"),m(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"),m(de,"href","#transformers.CodeGenForCausalLM"),m(S,"class","relative group"),m(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,i){o(document.head,r),c(e,w,i),c(e,p,i),c(e,h,i),c(e,g,i),o(g,a),o(a,$),b(ge,$,null),o(g,bo),o(g,Re),c(e,Ht,i),c(e,W,i),o(W,D),o(D,wt),b(_e,wt,null),o(W,ko),o(W,Ae),c(e,Et,i),c(e,ve,i),c(e,It,i),c(e,be,i),c(e,Vt,i),c(e,ke,i),c(e,Bt,i),c(e,ye,i),c(e,St,i),c(e,Ce,i),c(e,Rt,i),c(e,Z,i),o(Z,X),o(X,$t),b(we,$t,null),o(Z,yo),o(Z,De),c(e,At,i),c(e,$e,i),c(e,Dt,i),c(e,q,i),o(q,Q),o(Q,Tt),b(Te,Tt,null),o(q,Co),o(q,Xe),c(e,Xt,i),b(Me,e,i),c(e,Qt,i),c(e,H,i),o(H,O),o(O,Mt),b(xe,Mt,null),o(H,wo),o(H,Qe),c(e,Ot,i),c(e,Ge,i),c(e,Yt,i),c(e,E,i),o(E,Y),o(Y,xt),b(ze,xt,null),o(E,$o),o(E,Oe),c(e,Kt,i),c(e,N,i),b(je,N,null),o(N,To),o(N,Ye),o(N,Mo),b(K,N,null),c(e,eo,i),c(e,I,i),o(I,ee),o(ee,Gt),b(Fe,Gt,null),o(I,xo),o(I,Ke),c(e,to,i),c(e,T,i),b(Ue,T,null),o(T,Go),o(T,et),o(T,zo),o(T,tt),o(T,jo),b(te,T,null),o(T,Fo),o(T,ot),o(T,Uo),b(oe,T,null),o(T,Lo),o(T,nt),o(T,No),o(T,st),b(Le,st,null),c(e,oo,i),c(e,V,i),o(V,ne),o(ne,zt),b(Ne,zt,null),o(V,Jo),o(V,at),c(e,no,i),c(e,M,i),b(Je,M,null),o(M,Po),o(M,rt),o(M,Wo),o(M,it),o(M,Zo),b(se,M,null),o(M,qo),o(M,lt),o(M,Ho),b(ae,M,null),o(M,Eo),o(M,dt),o(M,Io),o(M,F),b(Pe,F,null),o(F,Vo),o(F,ct),o(F,Bo),o(F,pt),o(F,So),o(F,ht),c(e,so,i),c(e,B,i),o(B,re),o(re,jt),b(We,jt,null),o(B,Ro),o(B,mt),c(e,ao,i),c(e,J,i),b(Ze,J,null),o(J,Ao),o(J,ut),o(J,Do),o(J,U),b(qe,U,null),o(U,Xo),o(U,ft),o(U,Qo),b(ie,U,null),o(U,Oo),b(le,U,null),c(e,ro,i),c(e,S,i),o(S,de),o(de,Ft),b(He,Ft,null),o(S,Yo),o(S,gt),c(e,io,i),c(e,j,i),b(Ee,j,null),o(j,Ko),o(j,_t),o(j,en),o(j,vt),o(j,tn),o(j,L),b(Ie,L,null),o(L,on),o(L,bt),o(L,nn),b(ce,L,null),o(L,sn),b(pe,L,null),c(e,lo,i),c(e,Ut,i),co=!0},p(e,[i]){const Ve={};i&2&&(Ve.$$scope={dirty:i,ctx:e}),K.$set(Ve);const Lt={};i&2&&(Lt.$$scope={dirty:i,ctx:e}),te.$set(Lt);const Nt={};i&2&&(Nt.$$scope={dirty:i,ctx:e}),oe.$set(Nt);const Be={};i&2&&(Be.$$scope={dirty:i,ctx:e}),se.$set(Be);const Jt={};i&2&&(Jt.$$scope={dirty:i,ctx:e}),ae.$set(Jt);const Pt={};i&2&&(Pt.$$scope={dirty:i,ctx:e}),ie.$set(Pt);const Se={};i&2&&(Se.$$scope={dirty:i,ctx:e}),le.$set(Se);const Wt={};i&2&&(Wt.$$scope={dirty:i,ctx:e}),ce.$set(Wt);const Zt={};i&2&&(Zt.$$scope={dirty:i,ctx:e}),pe.$set(Zt)},i(e){co||(k(ge.$$.fragment,e),k(_e.$$.fragment,e),k(we.$$.fragment,e),k(Te.$$.fragment,e),k(Me.$$.fragment,e),k(xe.$$.fragment,e),k(ze.$$.fragment,e),k(je.$$.fragment,e),k(K.$$.fragment,e),k(Fe.$$.fragment,e),k(Ue.$$.fragment,e),k(te.$$.fragment,e),k(oe.$$.fragment,e),k(Le.$$.fragment,e),k(Ne.$$.fragment,e),k(Je.$$.fragment,e),k(se.$$.fragment,e),k(ae.$$.fragment,e),k(Pe.$$.fragment,e),k(We.$$.fragment,e),k(Ze.$$.fragment,e),k(qe.$$.fragment,e),k(ie.$$.fragment,e),k(le.$$.fragment,e),k(He.$$.fragment,e),k(Ee.$$.fragment,e),k(Ie.$$.fragment,e),k(ce.$$.fragment,e),k(pe.$$.fragment,e),co=!0)},o(e){y(ge.$$.fragment,e),y(_e.$$.fragment,e),y(we.$$.fragment,e),y(Te.$$.fragment,e),y(Me.$$.fragment,e),y(xe.$$.fragment,e),y(ze.$$.fragment,e),y(je.$$.fragment,e),y(K.$$.fragment,e),y(Fe.$$.fragment,e),y(Ue.$$.fragment,e),y(te.$$.fragment,e),y(oe.$$.fragment,e),y(Le.$$.fragment,e),y(Ne.$$.fragment,e),y(Je.$$.fragment,e),y(se.$$.fragment,e),y(ae.$$.fragment,e),y(Pe.$$.fragment,e),y(We.$$.fragment,e),y(Ze.$$.fragment,e),y(qe.$$.fragment,e),y(ie.$$.fragment,e),y(le.$$.fragment,e),y(He.$$.fragment,e),y(Ee.$$.fragment,e),y(Ie.$$.fragment,e),y(ce.$$.fragment,e),y(pe.$$.fragment,e),co=!1},d(e){e&&(t(w),t(p),t(h),t(g),t(Ht),t(W),t(Et),t(ve),t(It),t(be),t(Vt),t(ke),t(Bt),t(ye),t(St),t(Ce),t(Rt),t(Z),t(At),t($e),t(Dt),t(q),t(Xt),t(Qt),t(H),t(Ot),t(Ge),t(Yt),t(E),t(Kt),t(N),t(eo),t(I),t(to),t(T),t(oo),t(V),t(no),t(M),t(so),t(B),t(ao),t(J),t(ro),t(S),t(io),t(j),t(lo),t(Ut)),t(r),C(ge),C(_e),C(we),C(Te),C(Me,e),C(xe),C(ze),C(je),C(K),C(Fe),C(Ue),C(te),C(oe),C(Le),C(Ne),C(Je),C(se),C(ae),C(Pe),C(We),C(Ze),C(qe),C(ie),C(le),C(He),C(Ee),C(Ie),C(ce),C(pe)}}}const gs={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 _s(x){return os(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ts extends ns{constructor(r){super(),ss(this,r,_s,fs,ts,{})}}export{Ts as component};
