import{s as Hn,o as Jn,n as B}from"../chunks/scheduler.bdbef820.js";import{S as Zn,i as En,g as p,s as a,r as f,A as Dn,h as m,f as s,c as r,j as P,u,x as h,k as U,y as i,a as l,v as g,d as _,t as b,w as k}from"../chunks/index.33f81d56.js";import{T as Mt}from"../chunks/Tip.34194030.js";import{D as Z}from"../chunks/Docstring.b9574034.js";import{C as Ye}from"../chunks/CodeBlock.3bad7fc9.js";import{E as tt}from"../chunks/ExampleCodeBlock.633185da.js";import{H as E,E as Vn}from"../chunks/index.9edc4842.js";function Bn(M){let t,v="Example:",d,c,y;return c=new Ye({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`,wrap:!1}}),{c(){t=p("p"),t.textContent=v,d=a(),f(c.$$.fragment)},l(n){t=m(n,"P",{"data-svelte-h":!0}),h(t)!=="svelte-11lpom8"&&(t.textContent=v),d=r(n),u(c.$$.fragment,n)},m(n,T){l(n,t,T),l(n,d,T),g(c,n,T),y=!0},p:B,i(n){y||(_(c.$$.fragment,n),y=!0)},o(n){b(c.$$.fragment,n),y=!1},d(n){n&&(s(t),s(d)),k(c,n)}}}function Sn(M){let t,v="be encoded differently whether it is at the beginning of the sentence (without space) or not:",d,c,y;return c=new Ye({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>]`,wrap:!1}}),{c(){t=p("p"),t.textContent=v,d=a(),f(c.$$.fragment)},l(n){t=m(n,"P",{"data-svelte-h":!0}),h(t)!=="svelte-12atnao"&&(t.textContent=v),d=r(n),u(c.$$.fragment,n)},m(n,T){l(n,t,T),l(n,d,T),g(c,n,T),y=!0},p:B,i(n){y||(_(c.$$.fragment,n),y=!0)},o(n){b(c.$$.fragment,n),y=!1},d(n){n&&(s(t),s(d)),k(c,n)}}}function An(M){let t,v="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(){t=p("p"),t.innerHTML=v},l(d){t=m(d,"P",{"data-svelte-h":!0}),h(t)!=="svelte-jhmxzm"&&(t.innerHTML=v)},m(d,c){l(d,t,c)},p:B,d(d){d&&s(t)}}}function On(M){let t,v="be encoded differently whether it is at the beginning of the sentence (without space) or not:",d,c,y;return c=new Ye({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>]`,wrap:!1}}),{c(){t=p("p"),t.textContent=v,d=a(),f(c.$$.fragment)},l(n){t=m(n,"P",{"data-svelte-h":!0}),h(t)!=="svelte-12atnao"&&(t.textContent=v),d=r(n),u(c.$$.fragment,n)},m(n,T){l(n,t,T),l(n,d,T),g(c,n,T),y=!0},p:B,i(n){y||(_(c.$$.fragment,n),y=!0)},o(n){b(c.$$.fragment,n),y=!1},d(n){n&&(s(t),s(d)),k(c,n)}}}function Rn(M){let t,v="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(){t=p("p"),t.innerHTML=v},l(d){t=m(d,"P",{"data-svelte-h":!0}),h(t)!=="svelte-9gg91e"&&(t.innerHTML=v)},m(d,c){l(d,t,c)},p:B,d(d){d&&s(t)}}}function Qn(M){let t,v="pair mask has the following format:",d,c,y;return c=new Ye({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`,wrap:!1}}),{c(){t=p("p"),t.textContent=v,d=a(),f(c.$$.fragment)},l(n){t=m(n,"P",{"data-svelte-h":!0}),h(t)!=="svelte-qjgeij"&&(t.textContent=v),d=r(n),u(c.$$.fragment,n)},m(n,T){l(n,t,T),l(n,d,T),g(c,n,T),y=!0},p:B,i(n){y||(_(c.$$.fragment,n),y=!0)},o(n){b(c.$$.fragment,n),y=!1},d(n){n&&(s(t),s(d)),k(c,n)}}}function Xn(M){let t,v=`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(){t=p("p"),t.innerHTML=v},l(d){t=m(d,"P",{"data-svelte-h":!0}),h(t)!=="svelte-fincs2"&&(t.innerHTML=v)},m(d,c){l(d,t,c)},p:B,d(d){d&&s(t)}}}function Yn(M){let t,v=`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(){t=p("p"),t.innerHTML=v},l(d){t=m(d,"P",{"data-svelte-h":!0}),h(t)!=="svelte-fincs2"&&(t.innerHTML=v)},m(d,c){l(d,t,c)},p:B,d(d){d&&s(t)}}}function Kn(M){let t,v="Example:",d,c,y;return c=new Ye({props:{code:"",highlighted:"",wrap:!1}}),{c(){t=p("p"),t.textContent=v,d=a(),f(c.$$.fragment)},l(n){t=m(n,"P",{"data-svelte-h":!0}),h(t)!=="svelte-11lpom8"&&(t.textContent=v),d=r(n),u(c.$$.fragment,n)},m(n,T){l(n,t,T),l(n,d,T),g(c,n,T),y=!0},p:B,i(n){y||(_(c.$$.fragment,n),y=!0)},o(n){b(c.$$.fragment,n),y=!1},d(n){n&&(s(t),s(d)),k(c,n)}}}function eo(M){let t,v,d,c,y,n,T,nt,ne,cn='CodeGen モデルは、<a href="https://arxiv.org/abs/2203.13474" rel="nofollow">A Conversational Paradigm for Program Synthesis</a> で Erik Nijkamp、Bo Pang、林宏明、Lifu Tu、Huan Wang、Yingbo Zhou、Silvio Savarese、Caiming Xiong およびカイミン・ションさん。',ot,oe,pn='CodeGen は、<a href="https://pile.eleuther.ai/" rel="nofollow">The Pile</a>、BigQuery、BigPython で順次トレーニングされたプログラム合成用の自己回帰言語モデルです。',st,se,mn="論文の要約は次のとおりです。",at,ae,hn='<em>プログラム合成は、与えられた問題仕様の解決策としてコンピューター プログラムを生成することを目的としています。我々は、大規模な言語モデルを介した会話型プログラム合成アプローチを提案します。これは、従来のアプローチで直面した広大なプログラム空間とユーザーの意図の仕様を検索するという課題に対処します。私たちの新しいアプローチでは、仕様とプログラムを作成するプロセスを、ユーザーとシステムの間の複数回の対話として捉えます。これはプログラム合成をシーケンス予測問題として扱い、仕様が自然言語で表現され、目的のプログラムが条件付きでサンプリングされます。私たちは、自然言語とプログラミング言語のデータに基づいて、CodeGen と呼ばれる大規模な言語モデルのファミリーをトレーニングします。データの監視が弱く、データ サイズとモデル サイズが拡大すると、単純な自己回帰言語モデリングから会話能力が生まれます。会話型プログラム合成におけるモデルの動作を研究するために、マルチターン プログラミング ベンチマーク (MTPB) を開発します。このベンチマークでは、各問題を解決するには、ユーザーとモデル間のマルチターン会話を介したマルチステップ合成が必要です。私たちの調査結果は、会話機能の出現と、提案されている会話プログラム合成パラダイムの有効性を示しています。さらに、私たちのモデル CodeGen (TPU-v4 でトレーニングされた最大 16B パラメーターを含む) は、HumanEval ベンチマークで OpenAI の Codex を上回ります。私たちはチェックポイントを含むトレーニング ライブラリ JaxFormer をオープン ソースのコントリビューションとして利用できるようにしています: <a href="https://github.com/salesforce/codegen" rel="nofollow">この https URL</a></em>。',rt,re,fn=`このモデルは <a href="https://huggingface.co/rooa" rel="nofollow">林 宏明</a> によって寄稿されました。
元のコードは <a href="https://github.com/salesforce/codegen" rel="nofollow">ここ</a> にあります。`,it,ie,dt,de,un='<li>CodeGen モデル <a href="https://huggingface.co/models?other=codegen" rel="nofollow">チェックポイント</a> は、可変サイズのさまざまな事前トレーニング データで利用できます。</li> <li>形式は「Salesforce/codegen-{size}-{data}」です。ここで、<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>: パイルで事前トレーニング済み</li> <li><code>multi</code>: <code>nl</code> で初期化され、複数のプログラミング言語データでさらに事前トレーニングされます。</li> <li><code>mono</code>: <code>multi</code> で初期化され、Python データでさらに事前トレーニングされます。</li></ul></li></ul></li> <li>たとえば、<code>Salesforce/codegen-350M-mono</code> は、Pile、複数のプログラミング言語、および Python で順次事前トレーニングされた 3 億 5,000 万のパラメーターのチェックポイントを提供します。</li>',lt,le,ct,ce,pt,pe,mt,me,gn='<li><a href="../tasks/language_modeling">因果言語モデリング タスク ガイド</a></li>',ht,he,ft,N,fe,xt,ze,_n=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/ja/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/main/ja/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the documentation from
<a href="/docs/transformers/main/ja/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Gt,S,ut,ue,gt,C,ge,zt,je,bn="Construct a CodeGen tokenizer. Based on byte-level Byte-Pair-Encoding.",jt,Le,kn="This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will",Lt,A,Ft,Fe,yn=`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.`,qt,O,It,qe,vn=`This tokenizer inherits from <a href="/docs/transformers/main/ja/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.`,Pt,Ie,_e,_t,be,bt,$,ke,Ut,Pe,Tn=`Construct a “fast” CodeGen tokenizer (backed by HuggingFace’s <em>tokenizers</em> library). Based on byte-level
Byte-Pair-Encoding.`,Nt,Ue,$n="This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will",Wt,R,Ht,Ne,Cn=`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.`,Jt,Q,Zt,We,wn=`This tokenizer inherits from <a href="/docs/transformers/main/ja/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.`,Et,F,ye,Dt,He,Mn="Create a mask from the two sequences passed to be used in a sequence-pair classification task. A sequence",Vt,X,Bt,Je,xn="If <code>token_ids_1</code> is <code>None</code>, this method only returns the first portion of the mask (0s).",St,q,ve,At,Ze,Gn=`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`,Ot,Ee,zn="Similar to doing <code>self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))</code>.",Rt,De,jn=`”]\`.
kwargs (additional keyword arguments, <em>optional</em>):
Will be passed to the underlying model specific decode method.`,kt,Te,yt,G,$e,Qt,Ve,Ln="The bare Codegen Model outputting raw hidden-states without any specific head on top.",Xt,Be,Fn=`This model inherits from <a href="/docs/transformers/main/ja/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Yt,Se,qn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Kt,J,Ce,en,Ae,In='The <a href="/docs/transformers/main/ja/model_doc/codegen#transformers.CodeGenModel">CodeGenModel</a> forward method, overrides the <code>__call__</code> special method.',tn,Y,vt,we,Tt,z,Me,nn,Oe,Pn="The CodeGen Model transformer with a language modeling head on top.",on,Re,Un=`This model inherits from <a href="/docs/transformers/main/ja/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,sn,Qe,Nn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,an,I,xe,rn,Xe,Wn='The <a href="/docs/transformers/main/ja/model_doc/codegen#transformers.CodeGenForCausalLM">CodeGenForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',dn,K,ln,ee,$t,Ge,Ct,Ke,wt;return y=new E({props:{title:"CodeGen",local:"codegen",headingTag:"h1"}}),T=new E({props:{title:"Overview",local:"overview",headingTag:"h2"}}),ie=new E({props:{title:"Checkpoint Naming",local:"checkpoint-naming",headingTag:"h2"}}),le=new E({props:{title:"Usage example",local:"usage-example",headingTag:"h2"}}),ce=new Ye({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()`,wrap:!1}}),pe=new E({props:{title:"Resources",local:"resources",headingTag:"h2"}}),he=new E({props:{title:"CodeGenConfig",local:"transformers.CodeGenConfig",headingTag:"h2"}}),fe=new Z({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/ja/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_ctx",description:`<strong>n_ctx</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
This attribute is used in <code>CodeGenModel.__init__</code> without any real effect.`,name:"n_ctx"},{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>) &#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.0) &#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.0) &#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.0) &#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-05) &#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"},{anchor:"transformers.CodeGenConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 50256) &#x2014;
Beginning of stream token id.`,name:"bos_token_id"},{anchor:"transformers.CodeGenConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 50256) &#x2014;
End of stream token id.`,name:"eos_token_id"},{anchor:"transformers.CodeGenConfig.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model&#x2019;s input and output word embeddings should be tied. Note that this is only relevant if the
model has a output word embedding layer.`,name:"tie_word_embeddings"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/codegen/configuration_codegen.py#L29"}}),S=new tt({props:{anchor:"transformers.CodeGenConfig.example",$$slots:{default:[Bn]},$$scope:{ctx:M}}}),ue=new E({props:{title:"CodeGenTokenizer",local:"transformers.CodeGenTokenizer",headingTag:"h2"}}),ge=new Z({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:"return_token_type_ids",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>&quot;&lt;|endoftext|&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.CodeGenTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|endoftext|&gt;&quot;</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>&quot;&lt;|endoftext|&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.CodeGenTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_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"},{anchor:"transformers.CodeGenTokenizer.add_bos_token",description:`<strong>add_bos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to add a beginning of sequence token at the start of sequences.`,name:"add_bos_token"},{anchor:"transformers.CodeGenTokenizer.return_token_type_ids",description:`<strong>return_token_type_ids</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to return token type IDs.`,name:"return_token_type_ids"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/codegen/tokenization_codegen.py#L84"}}),A=new tt({props:{anchor:"transformers.CodeGenTokenizer.example",$$slots:{default:[Sn]},$$scope:{ctx:M}}}),O=new Mt({props:{$$slots:{default:[An]},$$scope:{ctx:M}}}),_e=new Z({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#L308"}}),be=new E({props:{title:"CodeGenTokenizerFast",local:"transformers.CodeGenTokenizerFast",headingTag:"h2"}}),ke=new Z({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:"return_token_type_ids",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CodeGenTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.CodeGenTokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.CodeGenTokenizerFast.tokenizer_file",description:`<strong>tokenizer_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Path to <a href="https://github.com/huggingface/tokenizers" rel="nofollow">tokenizers</a> file (generally has a .json extension) that
contains everything needed to load the tokenizer.`,name:"tokenizer_file"},{anchor:"transformers.CodeGenTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|endoftext|&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.CodeGenTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|endoftext|&gt;&quot;</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>&quot;&lt;|endoftext|&gt;&quot;</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.return_token_type_ids",description:`<strong>return_token_type_ids</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to return token type IDs.`,name:"return_token_type_ids"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/codegen/tokenization_codegen_fast.py#L42"}}),R=new tt({props:{anchor:"transformers.CodeGenTokenizerFast.example",$$slots:{default:[On]},$$scope:{ctx:M}}}),Q=new Mt({props:{$$slots:{default:[Rn]},$$scope:{ctx:M}}}),ye=new Z({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.CodeGenTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.CodeGenTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.CodeGenTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/codegen/tokenization_codegen_fast.py#L158",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),X=new tt({props:{anchor:"transformers.CodeGenTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[Qn]},$$scope:{ctx:M}}}),ve=new Z({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:": typing.Optional[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#L191",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The decoded sentence.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>str</code></p>
`}}),Te=new E({props:{title:"CodeGenModel",local:"transformers.CodeGenModel",headingTag:"h2"}}),$e=new Z({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/ja/model_doc/codegen#transformers.CodeGenModel">CodeGenModel</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/ja/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#L325"}}),Ce=new Z({props:{name:"forward",anchor:"transformers.CodeGenModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Union[transformers.cache_utils.Cache, typing.Tuple[typing.Tuple[torch.Tensor]], NoneType] = 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"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CodeGenModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/ja/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/ja/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/ja/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.CodeGenModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Union[~cache_utils.Cache, Tuple[Tuple[torch.Tensor]], NoneType]</code>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <code>Cache</code> instance, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li>
<li>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>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{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_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.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.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.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/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.CodeGenModel.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/codegen/modeling_codegen.py#L349",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/ja/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/ja/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>Cache</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — It is a <code>Cache</code> instance. For more details, see our <a
  href="https://huggingface.co/docs/transformers/en/kv_cache"
  rel="nofollow"
>kv cache guide</a>.</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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/ja/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Y=new Mt({props:{$$slots:{default:[Xn]},$$scope:{ctx:M}}}),we=new E({props:{title:"CodeGenForCausalLM",local:"transformers.CodeGenForCausalLM",headingTag:"h2"}}),Me=new Z({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/ja/model_doc/codegen#transformers.CodeGenForCausalLM">CodeGenForCausalLM</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/ja/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#L620"}}),xe=new Z({props:{name:"forward",anchor:"transformers.CodeGenForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Union[transformers.cache_utils.Cache, typing.Tuple[typing.Tuple[torch.Tensor]], NoneType] = 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"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CodeGenForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/ja/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/ja/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/ja/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.CodeGenForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Union[~cache_utils.Cache, Tuple[Tuple[torch.Tensor]], NoneType]</code>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <code>Cache</code> instance, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li>
<li>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>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{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_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.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.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"},{anchor:"transformers.CodeGenForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.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/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.CodeGenForCausalLM.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/codegen/modeling_codegen.py#L642",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/ja/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/ja/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>Cache</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — It is a <code>Cache</code> instance. For more details, see our <a
  href="https://huggingface.co/docs/transformers/en/kv_cache"
  rel="nofollow"
>kv cache guide</a>.</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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/ja/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),K=new Mt({props:{$$slots:{default:[Yn]},$$scope:{ctx:M}}}),ee=new tt({props:{anchor:"transformers.CodeGenForCausalLM.forward.example",$$slots:{default:[Kn]},$$scope:{ctx:M}}}),Ge=new Vn({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ja/model_doc/codegen.md"}}),{c(){t=p("meta"),v=a(),d=p("p"),c=a(),f(y.$$.fragment),n=a(),f(T.$$.fragment),nt=a(),ne=p("p"),ne.innerHTML=cn,ot=a(),oe=p("p"),oe.innerHTML=pn,st=a(),se=p("p"),se.textContent=mn,at=a(),ae=p("p"),ae.innerHTML=hn,rt=a(),re=p("p"),re.innerHTML=fn,it=a(),f(ie.$$.fragment),dt=a(),de=p("ul"),de.innerHTML=un,lt=a(),f(le.$$.fragment),ct=a(),f(ce.$$.fragment),pt=a(),f(pe.$$.fragment),mt=a(),me=p("ul"),me.innerHTML=gn,ht=a(),f(he.$$.fragment),ft=a(),N=p("div"),f(fe.$$.fragment),xt=a(),ze=p("p"),ze.innerHTML=_n,Gt=a(),f(S.$$.fragment),ut=a(),f(ue.$$.fragment),gt=a(),C=p("div"),f(ge.$$.fragment),zt=a(),je=p("p"),je.textContent=bn,jt=a(),Le=p("p"),Le.textContent=kn,Lt=a(),f(A.$$.fragment),Ft=a(),Fe=p("p"),Fe.innerHTML=yn,qt=a(),f(O.$$.fragment),It=a(),qe=p("p"),qe.innerHTML=vn,Pt=a(),Ie=p("div"),f(_e.$$.fragment),_t=a(),f(be.$$.fragment),bt=a(),$=p("div"),f(ke.$$.fragment),Ut=a(),Pe=p("p"),Pe.innerHTML=Tn,Nt=a(),Ue=p("p"),Ue.textContent=$n,Wt=a(),f(R.$$.fragment),Ht=a(),Ne=p("p"),Ne.innerHTML=Cn,Jt=a(),f(Q.$$.fragment),Zt=a(),We=p("p"),We.innerHTML=wn,Et=a(),F=p("div"),f(ye.$$.fragment),Dt=a(),He=p("p"),He.textContent=Mn,Vt=a(),f(X.$$.fragment),Bt=a(),Je=p("p"),Je.innerHTML=xn,St=a(),q=p("div"),f(ve.$$.fragment),At=a(),Ze=p("p"),Ze.textContent=Gn,Ot=a(),Ee=p("p"),Ee.innerHTML=zn,Rt=a(),De=p("p"),De.innerHTML=jn,kt=a(),f(Te.$$.fragment),yt=a(),G=p("div"),f($e.$$.fragment),Qt=a(),Ve=p("p"),Ve.textContent=Ln,Xt=a(),Be=p("p"),Be.innerHTML=Fn,Yt=a(),Se=p("p"),Se.innerHTML=qn,Kt=a(),J=p("div"),f(Ce.$$.fragment),en=a(),Ae=p("p"),Ae.innerHTML=In,tn=a(),f(Y.$$.fragment),vt=a(),f(we.$$.fragment),Tt=a(),z=p("div"),f(Me.$$.fragment),nn=a(),Oe=p("p"),Oe.textContent=Pn,on=a(),Re=p("p"),Re.innerHTML=Un,sn=a(),Qe=p("p"),Qe.innerHTML=Nn,an=a(),I=p("div"),f(xe.$$.fragment),rn=a(),Xe=p("p"),Xe.innerHTML=Wn,dn=a(),f(K.$$.fragment),ln=a(),f(ee.$$.fragment),$t=a(),f(Ge.$$.fragment),Ct=a(),Ke=p("p"),this.h()},l(e){const o=Dn("svelte-u9bgzb",document.head);t=m(o,"META",{name:!0,content:!0}),o.forEach(s),v=r(e),d=m(e,"P",{}),P(d).forEach(s),c=r(e),u(y.$$.fragment,e),n=r(e),u(T.$$.fragment,e),nt=r(e),ne=m(e,"P",{"data-svelte-h":!0}),h(ne)!=="svelte-q59cvd"&&(ne.innerHTML=cn),ot=r(e),oe=m(e,"P",{"data-svelte-h":!0}),h(oe)!=="svelte-1hp0w03"&&(oe.innerHTML=pn),st=r(e),se=m(e,"P",{"data-svelte-h":!0}),h(se)!=="svelte-1cv3nri"&&(se.textContent=mn),at=r(e),ae=m(e,"P",{"data-svelte-h":!0}),h(ae)!=="svelte-2kukrw"&&(ae.innerHTML=hn),rt=r(e),re=m(e,"P",{"data-svelte-h":!0}),h(re)!=="svelte-afgjqw"&&(re.innerHTML=fn),it=r(e),u(ie.$$.fragment,e),dt=r(e),de=m(e,"UL",{"data-svelte-h":!0}),h(de)!=="svelte-1d2of2"&&(de.innerHTML=un),lt=r(e),u(le.$$.fragment,e),ct=r(e),u(ce.$$.fragment,e),pt=r(e),u(pe.$$.fragment,e),mt=r(e),me=m(e,"UL",{"data-svelte-h":!0}),h(me)!=="svelte-1wya6pw"&&(me.innerHTML=gn),ht=r(e),u(he.$$.fragment,e),ft=r(e),N=m(e,"DIV",{class:!0});var D=P(N);u(fe.$$.fragment,D),xt=r(D),ze=m(D,"P",{"data-svelte-h":!0}),h(ze)!=="svelte-gowtl3"&&(ze.innerHTML=_n),Gt=r(D),u(S.$$.fragment,D),D.forEach(s),ut=r(e),u(ue.$$.fragment,e),gt=r(e),C=m(e,"DIV",{class:!0});var x=P(C);u(ge.$$.fragment,x),zt=r(x),je=m(x,"P",{"data-svelte-h":!0}),h(je)!=="svelte-3tmseo"&&(je.textContent=bn),jt=r(x),Le=m(x,"P",{"data-svelte-h":!0}),h(Le)!=="svelte-1s077p3"&&(Le.textContent=kn),Lt=r(x),u(A.$$.fragment,x),Ft=r(x),Fe=m(x,"P",{"data-svelte-h":!0}),h(Fe)!=="svelte-1jfcabo"&&(Fe.innerHTML=yn),qt=r(x),u(O.$$.fragment,x),It=r(x),qe=m(x,"P",{"data-svelte-h":!0}),h(qe)!=="svelte-rs9us"&&(qe.innerHTML=vn),Pt=r(x),Ie=m(x,"DIV",{class:!0});var et=P(Ie);u(_e.$$.fragment,et),et.forEach(s),x.forEach(s),_t=r(e),u(be.$$.fragment,e),bt=r(e),$=m(e,"DIV",{class:!0});var w=P($);u(ke.$$.fragment,w),Ut=r(w),Pe=m(w,"P",{"data-svelte-h":!0}),h(Pe)!=="svelte-ct13nj"&&(Pe.innerHTML=Tn),Nt=r(w),Ue=m(w,"P",{"data-svelte-h":!0}),h(Ue)!=="svelte-1s077p3"&&(Ue.textContent=$n),Wt=r(w),u(R.$$.fragment,w),Ht=r(w),Ne=m(w,"P",{"data-svelte-h":!0}),h(Ne)!=="svelte-1afeqmz"&&(Ne.innerHTML=Cn),Jt=r(w),u(Q.$$.fragment,w),Zt=r(w),We=m(w,"P",{"data-svelte-h":!0}),h(We)!=="svelte-y6yfrk"&&(We.innerHTML=wn),Et=r(w),F=m(w,"DIV",{class:!0});var W=P(F);u(ye.$$.fragment,W),Dt=r(W),He=m(W,"P",{"data-svelte-h":!0}),h(He)!=="svelte-1oby08q"&&(He.textContent=Mn),Vt=r(W),u(X.$$.fragment,W),Bt=r(W),Je=m(W,"P",{"data-svelte-h":!0}),h(Je)!=="svelte-owoxgn"&&(Je.innerHTML=xn),W.forEach(s),St=r(w),q=m(w,"DIV",{class:!0});var H=P(q);u(ve.$$.fragment,H),At=r(H),Ze=m(H,"P",{"data-svelte-h":!0}),h(Ze)!=="svelte-vbfkpu"&&(Ze.textContent=Gn),Ot=r(H),Ee=m(H,"P",{"data-svelte-h":!0}),h(Ee)!=="svelte-125uxon"&&(Ee.innerHTML=zn),Rt=r(H),De=m(H,"P",{"data-svelte-h":!0}),h(De)!=="svelte-zuidod"&&(De.innerHTML=jn),H.forEach(s),w.forEach(s),kt=r(e),u(Te.$$.fragment,e),yt=r(e),G=m(e,"DIV",{class:!0});var j=P(G);u($e.$$.fragment,j),Qt=r(j),Ve=m(j,"P",{"data-svelte-h":!0}),h(Ve)!=="svelte-14u75xd"&&(Ve.textContent=Ln),Xt=r(j),Be=m(j,"P",{"data-svelte-h":!0}),h(Be)!=="svelte-eisylu"&&(Be.innerHTML=Fn),Yt=r(j),Se=m(j,"P",{"data-svelte-h":!0}),h(Se)!=="svelte-hswkmf"&&(Se.innerHTML=qn),Kt=r(j),J=m(j,"DIV",{class:!0});var V=P(J);u(Ce.$$.fragment,V),en=r(V),Ae=m(V,"P",{"data-svelte-h":!0}),h(Ae)!=="svelte-17ynvn4"&&(Ae.innerHTML=In),tn=r(V),u(Y.$$.fragment,V),V.forEach(s),j.forEach(s),vt=r(e),u(we.$$.fragment,e),Tt=r(e),z=m(e,"DIV",{class:!0});var L=P(z);u(Me.$$.fragment,L),nn=r(L),Oe=m(L,"P",{"data-svelte-h":!0}),h(Oe)!=="svelte-8jmfdo"&&(Oe.textContent=Pn),on=r(L),Re=m(L,"P",{"data-svelte-h":!0}),h(Re)!=="svelte-eisylu"&&(Re.innerHTML=Un),sn=r(L),Qe=m(L,"P",{"data-svelte-h":!0}),h(Qe)!=="svelte-hswkmf"&&(Qe.innerHTML=Nn),an=r(L),I=m(L,"DIV",{class:!0});var te=P(I);u(xe.$$.fragment,te),rn=r(te),Xe=m(te,"P",{"data-svelte-h":!0}),h(Xe)!=="svelte-1rb94ao"&&(Xe.innerHTML=Wn),dn=r(te),u(K.$$.fragment,te),ln=r(te),u(ee.$$.fragment,te),te.forEach(s),L.forEach(s),$t=r(e),u(Ge.$$.fragment,e),Ct=r(e),Ke=m(e,"P",{}),P(Ke).forEach(s),this.h()},h(){U(t,"name","hf:doc:metadata"),U(t,"content",to),U(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){i(document.head,t),l(e,v,o),l(e,d,o),l(e,c,o),g(y,e,o),l(e,n,o),g(T,e,o),l(e,nt,o),l(e,ne,o),l(e,ot,o),l(e,oe,o),l(e,st,o),l(e,se,o),l(e,at,o),l(e,ae,o),l(e,rt,o),l(e,re,o),l(e,it,o),g(ie,e,o),l(e,dt,o),l(e,de,o),l(e,lt,o),g(le,e,o),l(e,ct,o),g(ce,e,o),l(e,pt,o),g(pe,e,o),l(e,mt,o),l(e,me,o),l(e,ht,o),g(he,e,o),l(e,ft,o),l(e,N,o),g(fe,N,null),i(N,xt),i(N,ze),i(N,Gt),g(S,N,null),l(e,ut,o),g(ue,e,o),l(e,gt,o),l(e,C,o),g(ge,C,null),i(C,zt),i(C,je),i(C,jt),i(C,Le),i(C,Lt),g(A,C,null),i(C,Ft),i(C,Fe),i(C,qt),g(O,C,null),i(C,It),i(C,qe),i(C,Pt),i(C,Ie),g(_e,Ie,null),l(e,_t,o),g(be,e,o),l(e,bt,o),l(e,$,o),g(ke,$,null),i($,Ut),i($,Pe),i($,Nt),i($,Ue),i($,Wt),g(R,$,null),i($,Ht),i($,Ne),i($,Jt),g(Q,$,null),i($,Zt),i($,We),i($,Et),i($,F),g(ye,F,null),i(F,Dt),i(F,He),i(F,Vt),g(X,F,null),i(F,Bt),i(F,Je),i($,St),i($,q),g(ve,q,null),i(q,At),i(q,Ze),i(q,Ot),i(q,Ee),i(q,Rt),i(q,De),l(e,kt,o),g(Te,e,o),l(e,yt,o),l(e,G,o),g($e,G,null),i(G,Qt),i(G,Ve),i(G,Xt),i(G,Be),i(G,Yt),i(G,Se),i(G,Kt),i(G,J),g(Ce,J,null),i(J,en),i(J,Ae),i(J,tn),g(Y,J,null),l(e,vt,o),g(we,e,o),l(e,Tt,o),l(e,z,o),g(Me,z,null),i(z,nn),i(z,Oe),i(z,on),i(z,Re),i(z,sn),i(z,Qe),i(z,an),i(z,I),g(xe,I,null),i(I,rn),i(I,Xe),i(I,dn),g(K,I,null),i(I,ln),g(ee,I,null),l(e,$t,o),g(Ge,e,o),l(e,Ct,o),l(e,Ke,o),wt=!0},p(e,[o]){const D={};o&2&&(D.$$scope={dirty:o,ctx:e}),S.$set(D);const x={};o&2&&(x.$$scope={dirty:o,ctx:e}),A.$set(x);const et={};o&2&&(et.$$scope={dirty:o,ctx:e}),O.$set(et);const w={};o&2&&(w.$$scope={dirty:o,ctx:e}),R.$set(w);const W={};o&2&&(W.$$scope={dirty:o,ctx:e}),Q.$set(W);const H={};o&2&&(H.$$scope={dirty:o,ctx:e}),X.$set(H);const j={};o&2&&(j.$$scope={dirty:o,ctx:e}),Y.$set(j);const V={};o&2&&(V.$$scope={dirty:o,ctx:e}),K.$set(V);const L={};o&2&&(L.$$scope={dirty:o,ctx:e}),ee.$set(L)},i(e){wt||(_(y.$$.fragment,e),_(T.$$.fragment,e),_(ie.$$.fragment,e),_(le.$$.fragment,e),_(ce.$$.fragment,e),_(pe.$$.fragment,e),_(he.$$.fragment,e),_(fe.$$.fragment,e),_(S.$$.fragment,e),_(ue.$$.fragment,e),_(ge.$$.fragment,e),_(A.$$.fragment,e),_(O.$$.fragment,e),_(_e.$$.fragment,e),_(be.$$.fragment,e),_(ke.$$.fragment,e),_(R.$$.fragment,e),_(Q.$$.fragment,e),_(ye.$$.fragment,e),_(X.$$.fragment,e),_(ve.$$.fragment,e),_(Te.$$.fragment,e),_($e.$$.fragment,e),_(Ce.$$.fragment,e),_(Y.$$.fragment,e),_(we.$$.fragment,e),_(Me.$$.fragment,e),_(xe.$$.fragment,e),_(K.$$.fragment,e),_(ee.$$.fragment,e),_(Ge.$$.fragment,e),wt=!0)},o(e){b(y.$$.fragment,e),b(T.$$.fragment,e),b(ie.$$.fragment,e),b(le.$$.fragment,e),b(ce.$$.fragment,e),b(pe.$$.fragment,e),b(he.$$.fragment,e),b(fe.$$.fragment,e),b(S.$$.fragment,e),b(ue.$$.fragment,e),b(ge.$$.fragment,e),b(A.$$.fragment,e),b(O.$$.fragment,e),b(_e.$$.fragment,e),b(be.$$.fragment,e),b(ke.$$.fragment,e),b(R.$$.fragment,e),b(Q.$$.fragment,e),b(ye.$$.fragment,e),b(X.$$.fragment,e),b(ve.$$.fragment,e),b(Te.$$.fragment,e),b($e.$$.fragment,e),b(Ce.$$.fragment,e),b(Y.$$.fragment,e),b(we.$$.fragment,e),b(Me.$$.fragment,e),b(xe.$$.fragment,e),b(K.$$.fragment,e),b(ee.$$.fragment,e),b(Ge.$$.fragment,e),wt=!1},d(e){e&&(s(v),s(d),s(c),s(n),s(nt),s(ne),s(ot),s(oe),s(st),s(se),s(at),s(ae),s(rt),s(re),s(it),s(dt),s(de),s(lt),s(ct),s(pt),s(mt),s(me),s(ht),s(ft),s(N),s(ut),s(gt),s(C),s(_t),s(bt),s($),s(kt),s(yt),s(G),s(vt),s(Tt),s(z),s($t),s(Ct),s(Ke)),s(t),k(y,e),k(T,e),k(ie,e),k(le,e),k(ce,e),k(pe,e),k(he,e),k(fe),k(S),k(ue,e),k(ge),k(A),k(O),k(_e),k(be,e),k(ke),k(R),k(Q),k(ye),k(X),k(ve),k(Te,e),k($e),k(Ce),k(Y),k(we,e),k(Me),k(xe),k(K),k(ee),k(Ge,e)}}}const to='{"title":"CodeGen","local":"codegen","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Checkpoint Naming","local":"checkpoint-naming","sections":[],"depth":2},{"title":"Usage example","local":"usage-example","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"CodeGenConfig","local":"transformers.CodeGenConfig","sections":[],"depth":2},{"title":"CodeGenTokenizer","local":"transformers.CodeGenTokenizer","sections":[],"depth":2},{"title":"CodeGenTokenizerFast","local":"transformers.CodeGenTokenizerFast","sections":[],"depth":2},{"title":"CodeGenModel","local":"transformers.CodeGenModel","sections":[],"depth":2},{"title":"CodeGenForCausalLM","local":"transformers.CodeGenForCausalLM","sections":[],"depth":2}],"depth":1}';function no(M){return Jn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class po extends Zn{constructor(t){super(),En(this,t,no,eo,Hn,{})}}export{po as component};
