import{s as qn,o as Fn,n as E}from"../chunks/scheduler.9bc65507.js";import{S as Jn,i as Ln,g as p,s as a,r as f,A as In,h as m,f as s,c as r,j as F,u,x as v,k as J,y as d,a as c,v as h,d as g,t as _,w as b}from"../chunks/index.707bf1b6.js";import{T as Tt}from"../chunks/Tip.c2ecdbf4.js";import{D as B}from"../chunks/Docstring.570ddb64.js";import{C as ze}from"../chunks/CodeBlock.54a9f38d.js";import{E as Oe}from"../chunks/ExampleCodeBlock.bc2be6bc.js";import{H as P,E as Wn}from"../chunks/EditOnGithub.922df6ba.js";function Zn(T){let n,$="Example:",l,i,k;return i=new ze({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(){n=p("p"),n.textContent=$,l=a(),f(i.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),v(n)!=="svelte-11lpom8"&&(n.textContent=$),l=r(t),u(i.$$.fragment,t)},m(t,C){c(t,n,C),c(t,l,C),h(i,t,C),k=!0},p:E,i(t){k||(g(i.$$.fragment,t),k=!0)},o(t){_(i.$$.fragment,t),k=!1},d(t){t&&(s(n),s(l)),b(i,t)}}}function Vn(T){let n,$="be encoded differently whether it is at the beginning of the sentence (without space) or not:",l,i,k;return i=new ze({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(){n=p("p"),n.textContent=$,l=a(),f(i.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),v(n)!=="svelte-12atnao"&&(n.textContent=$),l=r(t),u(i.$$.fragment,t)},m(t,C){c(t,n,C),c(t,l,C),h(i,t,C),k=!0},p:E,i(t){k||(g(i.$$.fragment,t),k=!0)},o(t){_(i.$$.fragment,t),k=!1},d(t){t&&(s(n),s(l)),b(i,t)}}}function Nn(T){let n,$="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(){n=p("p"),n.innerHTML=$},l(l){n=m(l,"P",{"data-svelte-h":!0}),v(n)!=="svelte-jhmxzm"&&(n.innerHTML=$)},m(l,i){c(l,n,i)},p:E,d(l){l&&s(n)}}}function Hn(T){let n,$="be encoded differently whether it is at the beginning of the sentence (without space) or not:",l,i,k;return i=new ze({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(){n=p("p"),n.textContent=$,l=a(),f(i.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),v(n)!=="svelte-12atnao"&&(n.textContent=$),l=r(t),u(i.$$.fragment,t)},m(t,C){c(t,n,C),c(t,l,C),h(i,t,C),k=!0},p:E,i(t){k||(g(i.$$.fragment,t),k=!0)},o(t){_(i.$$.fragment,t),k=!1},d(t){t&&(s(n),s(l)),b(i,t)}}}function Bn(T){let n,$="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(){n=p("p"),n.innerHTML=$},l(l){n=m(l,"P",{"data-svelte-h":!0}),v(n)!=="svelte-9gg91e"&&(n.innerHTML=$)},m(l,i){c(l,n,i)},p:E,d(l){l&&s(n)}}}function Pn(T){let n,$="pair mask has the following format:",l,i,k;return i=new ze({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(){n=p("p"),n.textContent=$,l=a(),f(i.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),v(n)!=="svelte-qjgeij"&&(n.textContent=$),l=r(t),u(i.$$.fragment,t)},m(t,C){c(t,n,C),c(t,l,C),h(i,t,C),k=!0},p:E,i(t){k||(g(i.$$.fragment,t),k=!0)},o(t){_(i.$$.fragment,t),k=!1},d(t){t&&(s(n),s(l)),b(i,t)}}}function En(T){let n,$=`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(){n=p("p"),n.innerHTML=$},l(l){n=m(l,"P",{"data-svelte-h":!0}),v(n)!=="svelte-fincs2"&&(n.innerHTML=$)},m(l,i){c(l,n,i)},p:E,d(l){l&&s(n)}}}function Rn(T){let n,$="Example:",l,i,k;return i=new ze({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`,wrap:!1}}),{c(){n=p("p"),n.textContent=$,l=a(),f(i.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),v(n)!=="svelte-11lpom8"&&(n.textContent=$),l=r(t),u(i.$$.fragment,t)},m(t,C){c(t,n,C),c(t,l,C),h(i,t,C),k=!0},p:E,i(t){k||(g(i.$$.fragment,t),k=!0)},o(t){_(i.$$.fragment,t),k=!1},d(t){t&&(s(n),s(l)),b(i,t)}}}function Dn(T){let n,$=`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(){n=p("p"),n.innerHTML=$},l(l){n=m(l,"P",{"data-svelte-h":!0}),v(n)!=="svelte-fincs2"&&(n.innerHTML=$)},m(l,i){c(l,n,i)},p:E,d(l){l&&s(n)}}}function Sn(T){let n,$="Example:",l,i,k;return i=new ze({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`,wrap:!1}}),{c(){n=p("p"),n.textContent=$,l=a(),f(i.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),v(n)!=="svelte-11lpom8"&&(n.textContent=$),l=r(t),u(i.$$.fragment,t)},m(t,C){c(t,n,C),c(t,l,C),h(i,t,C),k=!0},p:E,i(t){k||(g(i.$$.fragment,t),k=!0)},o(t){_(i.$$.fragment,t),k=!1},d(t){t&&(s(n),s(l)),b(i,t)}}}function Xn(T){let n,$,l,i,k,t,C,et,oe,an='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 およびカイミン・ションさん。',tt,se,rn='CodeGen は、<a href="https://pile.eleuther.ai/" rel="nofollow">The Pile</a>、BigQuery、BigPython で順次トレーニングされたプログラム合成用の自己回帰言語モデルです。',nt,ae,ln="論文の要約は次のとおりです。",ot,re,dn='<em>プログラム合成は、与えられた問題仕様の解決策としてコンピューター プログラムを生成することを目的としています。我々は、大規模な言語モデルを介した会話型プログラム合成アプローチを提案します。これは、従来のアプローチで直面した広大なプログラム空間とユーザーの意図の仕様を検索するという課題に対処します。私たちの新しいアプローチでは、仕様とプログラムを作成するプロセスを、ユーザーとシステムの間の複数回の対話として捉えます。これはプログラム合成をシーケンス予測問題として扱い、仕様が自然言語で表現され、目的のプログラムが条件付きでサンプリングされます。私たちは、自然言語とプログラミング言語のデータに基づいて、CodeGen と呼ばれる大規模な言語モデルのファミリーをトレーニングします。データの監視が弱く、データ サイズとモデル サイズが拡大すると、単純な自己回帰言語モデリングから会話能力が生まれます。会話型プログラム合成におけるモデルの動作を研究するために、マルチターン プログラミング ベンチマーク (MTPB) を開発します。このベンチマークでは、各問題を解決するには、ユーザーとモデル間のマルチターン会話を介したマルチステップ合成が必要です。私たちの調査結果は、会話機能の出現と、提案されている会話プログラム合成パラダイムの有効性を示しています。さらに、私たちのモデル CodeGen (TPU-v4 でトレーニングされた最大 16B パラメーターを含む) は、HumanEval ベンチマークで OpenAI の Codex を上回ります。私たちはチェックポイントを含むトレーニング ライブラリ JaxFormer をオープン ソースのコントリビューションとして利用できるようにしています: <a href="https://github.com/salesforce/codegen" rel="nofollow">この https URL</a></em>。',st,ie,cn=`このモデルは <a href="https://huggingface.co/rooa" rel="nofollow">林 宏明</a> によって寄稿されました。
元のコードは <a href="https://github.com/salesforce/codegen" rel="nofollow">ここ</a> にあります。`,at,le,rt,de,pn='<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>',it,ce,lt,pe,dt,me,ct,fe,mn='<li><a href="../tasks/language_modeling">因果言語モデリング タスク ガイド</a></li>',pt,ue,mt,L,he,Mt,Ue,fn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.40.2/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/v4.40.2/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/v4.40.2/ja/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,wt,S,ft,ge,ut,M,_e,xt,qe,un="Construct a CodeGen tokenizer. Based on byte-level Byte-Pair-Encoding.",Gt,Fe,hn="This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will",jt,X,zt,Je,gn=`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.`,Ut,A,qt,Le,_n=`This tokenizer inherits from <a href="/docs/transformers/v4.40.2/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.`,Ft,Ie,be,ht,ke,gt,y,ve,Jt,We,bn=`Construct a “fast” CodeGen tokenizer (backed by HuggingFace’s <em>tokenizers</em> library). Based on byte-level
Byte-Pair-Encoding.`,Lt,Ze,kn="This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will",It,Q,Wt,Ve,vn=`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.`,Zt,O,Vt,Ne,$n=`This tokenizer inherits from <a href="/docs/transformers/v4.40.2/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.`,Nt,j,$e,Ht,He,Cn="Create a mask from the two sequences passed to be used in a sequence-pair classification task. A sequence",Bt,Y,Pt,Be,yn="If <code>token_ids_1</code> is <code>None</code>, this method only returns the first portion of the mask (0s).",Et,z,Ce,Rt,Pe,Tn=`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`,Dt,Ee,Mn="Similar to doing <code>self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))</code>.",St,Re,wn=`”]\`.
kwargs (additional keyword arguments, <em>optional</em>):
Will be passed to the underlying model specific decode method.`,_t,ye,bt,I,Te,Xt,De,xn=`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.`,At,U,Me,Qt,Se,Gn='The <a href="/docs/transformers/v4.40.2/ja/model_doc/codegen#transformers.CodeGenModel">CodeGenModel</a> forward method, overrides the <code>__call__</code> special method.',Ot,K,Yt,ee,kt,we,vt,G,xe,Kt,Xe,jn="The CodeGen Model transformer with a language modeling head on top.",en,Ae,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,q,Ge,nn,Qe,Un='The <a href="/docs/transformers/v4.40.2/ja/model_doc/codegen#transformers.CodeGenForCausalLM">CodeGenForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',on,te,sn,ne,$t,je,Ct,Ye,yt;return k=new P({props:{title:"CodeGen",local:"codegen",headingTag:"h1"}}),C=new P({props:{title:"Overview",local:"overview",headingTag:"h2"}}),le=new P({props:{title:"Checkpoint Naming",local:"checkpoint-naming",headingTag:"h2"}}),ce=new P({props:{title:"Usage example",local:"usage-example",headingTag:"h2"}}),pe=new ze({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}}),me=new P({props:{title:"Resources",local:"resources",headingTag:"h2"}}),ue=new P({props:{title:"CodeGenConfig",local:"transformers.CodeGenConfig",headingTag:"h2"}}),he=new B({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.40.2/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/v4.40.2/src/transformers/models/codegen/configuration_codegen.py#L31"}}),S=new Oe({props:{anchor:"transformers.CodeGenConfig.example",$$slots:{default:[Zn]},$$scope:{ctx:T}}}),ge=new P({props:{title:"CodeGenTokenizer",local:"transformers.CodeGenTokenizer",headingTag:"h2"}}),_e=new B({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/v4.40.2/src/transformers/models/codegen/tokenization_codegen.py#L85"}}),X=new Oe({props:{anchor:"transformers.CodeGenTokenizer.example",$$slots:{default:[Vn]},$$scope:{ctx:T}}}),A=new Tt({props:{$$slots:{default:[Nn]},$$scope:{ctx:T}}}),be=new B({props:{name:"save_vocabulary",anchor:"transformers.CodeGenTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": Optional = None"}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/codegen/tokenization_codegen.py#L309"}}),ke=new P({props:{title:"CodeGenTokenizerFast",local:"transformers.CodeGenTokenizerFast",headingTag:"h2"}}),ve=new B({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/v4.40.2/src/transformers/models/codegen/tokenization_codegen_fast.py#L45"}}),Q=new Oe({props:{anchor:"transformers.CodeGenTokenizerFast.example",$$slots:{default:[Hn]},$$scope:{ctx:T}}}),O=new Tt({props:{$$slots:{default:[Bn]},$$scope:{ctx:T}}}),$e=new B({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.CodeGenTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = 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/v4.40.2/src/transformers/models/codegen/tokenization_codegen_fast.py#L169",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>
`}}),Y=new Oe({props:{anchor:"transformers.CodeGenTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[Pn]},$$scope:{ctx:T}}}),Ce=new B({props:{name:"decode",anchor:"transformers.CodeGenTokenizerFast.decode",parameters:[{name:"token_ids",val:": Union"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"truncate_before_pattern",val:": Optional = 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.40.2/src/transformers/models/codegen/tokenization_codegen_fast.py#L202",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>
`}}),ye=new P({props:{title:"CodeGenModel",local:"transformers.CodeGenModel",headingTag:"h2"}}),Te=new B({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.40.2/ja/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.40.2/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/v4.40.2/src/transformers/models/codegen/modeling_codegen.py#L391"}}),Me=new B({props:{name:"forward",anchor:"transformers.CodeGenModel.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"past_key_values",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"token_type_ids",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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.40.2/ja/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.40.2/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.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.40.2/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/codegen/modeling_codegen.py#L418",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.40.2/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/v4.40.2/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>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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.40.2/ja/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),K=new Tt({props:{$$slots:{default:[En]},$$scope:{ctx:T}}}),ee=new Oe({props:{anchor:"transformers.CodeGenModel.forward.example",$$slots:{default:[Rn]},$$scope:{ctx:T}}}),we=new P({props:{title:"CodeGenForCausalLM",local:"transformers.CodeGenForCausalLM",headingTag:"h2"}}),xe=new B({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.40.2/ja/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.40.2/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/v4.40.2/src/transformers/models/codegen/modeling_codegen.py#L574"}}),Ge=new B({props:{name:"forward",anchor:"transformers.CodeGenForCausalLM.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"past_key_values",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"token_type_ids",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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.40.2/ja/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.40.2/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.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.40.2/ja/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.40.2/src/transformers/models/codegen/modeling_codegen.py#L633",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.40.2/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/v4.40.2/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>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:`<script context="module">export const metadata = 'undefined';<\/script>


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