import{S as zi,i as Ii,s as Fi,e as n,k as c,w as T,t as a,M as qi,c as s,d as t,m as h,a as i,x as b,h as r,b as l,G as e,g as m,y as k,q as C,o as w,B as P,v as Ai,L as mr}from"../../chunks/vendor-hf-doc-builder.js";import{T as un}from"../../chunks/Tip-hf-doc-builder.js";import{D as ie}from"../../chunks/Docstring-hf-doc-builder.js";import{C as gr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as $e}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as fr}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Si(E){let p,y,g,_,v;return _=new gr({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdQVEJpZ0NvZGVDb25maWclMkMlMjBHUFRCaWdDb2RlTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwR1BUQmlnQ29kZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwR1BUQmlnQ29kZUNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBHUFRCaWdDb2RlTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPTBigCodeConfig, GPTBigCodeModel

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

<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 = GPTBigCodeModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){p=n("p"),y=a("Example:"),g=c(),T(_.$$.fragment)},l(d){p=s(d,"P",{});var f=i(p);y=r(f,"Example:"),f.forEach(t),g=h(d),b(_.$$.fragment,d)},m(d,f){m(d,p,f),e(p,y),m(d,g,f),k(_,d,f),v=!0},p:mr,i(d){v||(C(_.$$.fragment,d),v=!0)},o(d){w(_.$$.fragment,d),v=!1},d(d){d&&t(p),d&&t(g),P(_,d)}}}function Ni(E){let p,y,g,_,v;return{c(){p=n("p"),y=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){p=s(d,"P",{});var f=i(p);y=r(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var B=i(g);_=r(B,"Module"),B.forEach(t),v=r(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(d,f){m(d,p,f),e(p,y),e(p,g),e(g,_),e(p,v)},d(d){d&&t(p)}}}function Oi(E){let p,y,g,_,v;return _=new gr({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBHUFRCaWdDb2RlTW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmJpZ2NvZGUlMkZncHRfYmlnY29kZS1zYW50YWNvZGVyJTIyKSUwQW1vZGVsJTIwJTNEJTIwR1BUQmlnQ29kZU1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJiaWdjb2RlJTJGZ3B0X2JpZ2NvZGUtc2FudGFjb2RlciUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GPTBigCodeModel
<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;bigcode/gpt_bigcode-santacoder&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTBigCodeModel.from_pretrained(<span class="hljs-string">&quot;bigcode/gpt_bigcode-santacoder&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){p=n("p"),y=a("Example:"),g=c(),T(_.$$.fragment)},l(d){p=s(d,"P",{});var f=i(p);y=r(f,"Example:"),f.forEach(t),g=h(d),b(_.$$.fragment,d)},m(d,f){m(d,p,f),e(p,y),m(d,g,f),k(_,d,f),v=!0},p:mr,i(d){v||(C(_.$$.fragment,d),v=!0)},o(d){w(_.$$.fragment,d),v=!1},d(d){d&&t(p),d&&t(g),P(_,d)}}}function Wi(E){let p,y,g,_,v;return{c(){p=n("p"),y=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){p=s(d,"P",{});var f=i(p);y=r(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var B=i(g);_=r(B,"Module"),B.forEach(t),v=r(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(d,f){m(d,p,f),e(p,y),e(p,g),e(g,_),e(p,v)},d(d){d&&t(p)}}}function Ji(E){let p,y,g,_,v;return _=new gr({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEdQVEJpZ0NvZGVGb3JDYXVzYWxMTSUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmJpZ2NvZGUlMkZncHRfYmlnY29kZS1zYW50YWNvZGVyJTIyKSUwQW1vZGVsJTIwJTNEJTIwR1BUQmlnQ29kZUZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJiaWdjb2RlJTJGZ3B0X2JpZ2NvZGUtc2FudGFjb2RlciUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEaW5wdXRzJTVCJTIyaW5wdXRfaWRzJTIyJTVEKSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",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, GPTBigCodeForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bigcode/gpt_bigcode-santacoder&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTBigCodeForCausalLM.from_pretrained(<span class="hljs-string">&quot;bigcode/gpt_bigcode-santacoder&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){p=n("p"),y=a("Example:"),g=c(),T(_.$$.fragment)},l(d){p=s(d,"P",{});var f=i(p);y=r(f,"Example:"),f.forEach(t),g=h(d),b(_.$$.fragment,d)},m(d,f){m(d,p,f),e(p,y),m(d,g,f),k(_,d,f),v=!0},p:mr,i(d){v||(C(_.$$.fragment,d),v=!0)},o(d){w(_.$$.fragment,d),v=!1},d(d){d&&t(p),d&&t(g),P(_,d)}}}function Li(E){let p,y,g,_,v;return{c(){p=n("p"),y=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){p=s(d,"P",{});var f=i(p);y=r(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var B=i(g);_=r(B,"Module"),B.forEach(t),v=r(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(d,f){m(d,p,f),e(p,y),e(p,g),e(g,_),e(p,v)},d(d){d&&t(p)}}}function Ui(E){let p,y,g,_,v;return{c(){p=n("p"),y=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){p=s(d,"P",{});var f=i(p);y=r(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var B=i(g);_=r(B,"Module"),B.forEach(t),v=r(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(d,f){m(d,p,f),e(p,y),e(p,g),e(g,_),e(p,v)},d(d){d&&t(p)}}}function ji(E){let p,y,g,_,v,d,f,B,fn,Bt,Z,de,No,Ge,mn,Oo,gn,Et,le,_n,Be,vn,yn,xt,po,Tn,zt,uo,fo,bn,Ee,kn,It,ce,Cn,xe,wn,Pn,Ft,R,he,Wo,ze,Mn,Jo,$n,qt,mo,Gn,At,M,Lo,Bn,En,V,xn,Uo,zn,In,jo,Fn,qn,An,Do,Sn,Nn,Zo,On,Wn,S,Jn,Ro,Ln,Un,Vo,jn,Dn,Ho,Zn,Rn,Qo,Vn,Hn,Yo,Qn,Yn,Xo,Xn,Kn,Ko,es,os,et,ts,ns,Ie,ss,ot,as,rs,St,Fe,is,qe,ds,Nt,H,pe,tt,Ae,ls,nt,cs,Ot,q,Se,hs,Q,ps,go,us,fs,Ne,ms,gs,_s,Y,vs,_o,ys,Ts,vo,bs,ks,Cs,ue,Wt,X,fe,st,Oe,ws,at,Ps,Jt,x,We,Ms,rt,$s,Gs,Je,Bs,yo,Es,xs,zs,Le,Is,Ue,Fs,qs,As,N,je,Ss,K,Ns,To,Os,Ws,it,Js,Ls,Us,me,js,ge,Lt,ee,_e,dt,De,Ds,lt,Zs,Ut,z,Ze,Rs,ct,Vs,Hs,Re,Qs,bo,Ys,Xs,Ks,Ve,ea,He,oa,ta,na,O,Qe,sa,oe,aa,ko,ra,ia,ht,da,la,ca,ve,ha,ye,jt,te,Te,pt,Ye,pa,ut,ua,Dt,G,Xe,fa,ft,ma,ga,Co,wo,_a,va,ya,A,Ta,mt,ba,ka,gt,Ca,wa,_t,Pa,Ma,vt,$a,Ga,Ba,Ke,Ea,Po,xa,za,Ia,eo,Fa,oo,qa,Aa,Sa,W,to,Na,ne,Oa,Mo,Wa,Ja,yt,La,Ua,ja,be,Zt,se,ke,Tt,no,Da,bt,Za,Rt,I,so,Ra,kt,Va,Ha,ao,Qa,$o,Ya,Xa,Ka,ro,er,io,or,tr,nr,J,lo,sr,ae,ar,Go,rr,ir,Ct,dr,lr,cr,Ce,Vt;return d=new $e({}),Ge=new $e({}),ze=new $e({}),Ae=new $e({}),Se=new ie({props:{name:"class transformers.GPTBigCodeConfig",anchor:"transformers.GPTBigCodeConfig",parameters:[{name:"vocab_size",val:" = 50257"},{name:"n_positions",val:" = 1024"},{name:"n_embd",val:" = 768"},{name:"n_layer",val:" = 12"},{name:"n_head",val:" = 12"},{name:"n_inner",val:" = None"},{name:"activation_function",val:" = 'gelu_pytorch_tanh'"},{name:"resid_pdrop",val:" = 0.1"},{name:"embd_pdrop",val:" = 0.1"},{name:"attn_pdrop",val:" = 0.1"},{name:"layer_norm_epsilon",val:" = 1e-05"},{name:"initializer_range",val:" = 0.02"},{name:"scale_attn_weights",val:" = True"},{name:"use_cache",val:" = True"},{name:"bos_token_id",val:" = 50256"},{name:"eos_token_id",val:" = 50256"},{name:"attention_softmax_in_fp32",val:" = True"},{name:"scale_attention_softmax_in_fp32",val:" = True"},{name:"multi_query",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GPTBigCodeConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50257) &#x2014;
Vocabulary size of the GPT-2 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.31.0/en/model_doc/gpt_bigcode#transformers.GPTBigCodeModel">GPTBigCodeModel</a>.`,name:"vocab_size"},{anchor:"transformers.GPTBigCodeConfig.n_positions",description:`<strong>n_positions</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#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.GPTBigCodeConfig.n_embd",description:`<strong>n_embd</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the embeddings and hidden states.`,name:"n_embd"},{anchor:"transformers.GPTBigCodeConfig.n_layer",description:`<strong>n_layer</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"n_layer"},{anchor:"transformers.GPTBigCodeConfig.n_head",description:`<strong>n_head</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"n_head"},{anchor:"transformers.GPTBigCodeConfig.n_inner",description:`<strong>n_inner</strong> (<code>int</code>, <em>optional</em>, defaults to None) &#x2014;
Dimensionality of the inner feed-forward layers. <code>None</code> will set it to 4 times n_embd`,name:"n_inner"},{anchor:"transformers.GPTBigCodeConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;gelu_pytorch_tanh&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;, &quot;gelu_pytorch_tanh&quot;]</code>.`,name:"activation_function"},{anchor:"transformers.GPTBigCodeConfig.resid_pdrop",description:`<strong>resid_pdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"resid_pdrop"},{anchor:"transformers.GPTBigCodeConfig.embd_pdrop",description:`<strong>embd_pdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the embeddings.`,name:"embd_pdrop"},{anchor:"transformers.GPTBigCodeConfig.attn_pdrop",description:`<strong>attn_pdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention.`,name:"attn_pdrop"},{anchor:"transformers.GPTBigCodeConfig.layer_norm_epsilon",description:`<strong>layer_norm_epsilon</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon to use in the layer normalization layers.`,name:"layer_norm_epsilon"},{anchor:"transformers.GPTBigCodeConfig.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.GPTBigCodeConfig.scale_attn_weights",description:`<strong>scale_attn_weights</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Scale attention weights by dividing by sqrt(hidden_size)..`,name:"scale_attn_weights"},{anchor:"transformers.GPTBigCodeConfig.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.GPTBigCodeConfig.attention_softmax_in_fp32",description:`<strong>attention_softmax_in_fp32</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to call the fused softmax in float32.`,name:"attention_softmax_in_fp32"},{anchor:"transformers.GPTBigCodeConfig.scale_attention_softmax_in_fp32",description:`<strong>scale_attention_softmax_in_fp32</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to scale the attention softmax in float32.`,name:"scale_attention_softmax_in_fp32"},{anchor:"transformers.GPTBigCodeConfig.attention_type",description:`<strong>attention_type</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use Multi-Query Attion (<code>True</code>) or Multi-Head Attention (<code>False</code>).`,name:"attention_type"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py#L28"}}),ue=new fr({props:{anchor:"transformers.GPTBigCodeConfig.example",$$slots:{default:[Si]},$$scope:{ctx:E}}}),Oe=new $e({}),We=new ie({props:{name:"class transformers.GPTBigCodeModel",anchor:"transformers.GPTBigCodeModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTBigCodeModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/gpt_bigcode#transformers.GPTBigCodeConfig">GPTBigCodeConfig</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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py#L502"}}),je=new ie({props:{name:"forward",anchor:"transformers.GPTBigCodeModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GPTBigCodeModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else
<code>past_key_values[0][0].shape[-2]</code> (<code>sequence_length</code> of input past key value states). Indices of input
sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.GPTBigCodeModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[torch.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"past_key_values"},{anchor:"transformers.GPTBigCodeModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</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>If <code>past_key_values</code> is used, <code>attention_mask</code> needs to contain the masking strategy that was used for
<code>past_key_values</code>. In other words, the <code>attention_mask</code> always has to have the length:
<code>len(past_key_values) + len(input_ids)</code></p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.GPTBigCodeModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, input_ids_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.GPTBigCodeModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTBigCodeModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</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.GPTBigCodeModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.GPTBigCodeModel.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.GPTBigCodeModel.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.GPTBigCodeModel.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.GPTBigCodeModel.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py#L531",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/gpt_bigcode#transformers.GPTBigCodeConfig"
>GPTBigCodeConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),me=new un({props:{$$slots:{default:[Ni]},$$scope:{ctx:E}}}),ge=new fr({props:{anchor:"transformers.GPTBigCodeModel.forward.example",$$slots:{default:[Oi]},$$scope:{ctx:E}}}),De=new $e({}),Ze=new ie({props:{name:"class transformers.GPTBigCodeForCausalLM",anchor:"transformers.GPTBigCodeForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTBigCodeForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/gpt_bigcode#transformers.GPTBigCodeConfig">GPTBigCodeConfig</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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py#L722"}}),Qe=new ie({props:{name:"forward",anchor:"transformers.GPTBigCodeForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GPTBigCodeForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else
<code>past_key_values[0][0].shape[-2]</code> (<code>sequence_length</code> of input past key value states). Indices of input
sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.GPTBigCodeForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[torch.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"past_key_values"},{anchor:"transformers.GPTBigCodeForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</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>If <code>past_key_values</code> is used, <code>attention_mask</code> needs to contain the masking strategy that was used for
<code>past_key_values</code>. In other words, the <code>attention_mask</code> always has to have the length:
<code>len(past_key_values) + len(input_ids)</code></p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.GPTBigCodeForCausalLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, input_ids_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.GPTBigCodeForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTBigCodeForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</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.GPTBigCodeForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.GPTBigCodeForCausalLM.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.GPTBigCodeForCausalLM.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.GPTBigCodeForCausalLM.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.GPTBigCodeForCausalLM.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GPTBigCodeForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.Tensor</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.31.0/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py#L776",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/gpt_bigcode#transformers.GPTBigCodeConfig"
>GPTBigCodeConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ve=new un({props:{$$slots:{default:[Wi]},$$scope:{ctx:E}}}),ye=new fr({props:{anchor:"transformers.GPTBigCodeForCausalLM.forward.example",$$slots:{default:[Ji]},$$scope:{ctx:E}}}),Ye=new $e({}),Xe=new ie({props:{name:"class transformers.GPTBigCodeForSequenceClassification",anchor:"transformers.GPTBigCodeForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTBigCodeForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/gpt_bigcode#transformers.GPTBigCodeConfig">GPTBigCodeConfig</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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py#L875"}}),to=new ie({props:{name:"forward",anchor:"transformers.GPTBigCodeForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GPTBigCodeForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else
<code>past_key_values[0][0].shape[-2]</code> (<code>sequence_length</code> of input past key value states). Indices of input
sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.GPTBigCodeForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[torch.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"past_key_values"},{anchor:"transformers.GPTBigCodeForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</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>If <code>past_key_values</code> is used, <code>attention_mask</code> needs to contain the masking strategy that was used for
<code>past_key_values</code>. In other words, the <code>attention_mask</code> always has to have the length:
<code>len(past_key_values) + len(input_ids)</code></p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.GPTBigCodeForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, input_ids_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.GPTBigCodeForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTBigCodeForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</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.GPTBigCodeForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.GPTBigCodeForSequenceClassification.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.GPTBigCodeForSequenceClassification.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.GPTBigCodeForSequenceClassification.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.GPTBigCodeForSequenceClassification.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GPTBigCodeForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py#L885"}}),be=new un({props:{$$slots:{default:[Li]},$$scope:{ctx:E}}}),no=new $e({}),so=new ie({props:{name:"class transformers.GPTBigCodeForTokenClassification",anchor:"transformers.GPTBigCodeForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTBigCodeForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/gpt_bigcode#transformers.GPTBigCodeConfig">GPTBigCodeConfig</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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py#L991"}}),lo=new ie({props:{name:"forward",anchor:"transformers.GPTBigCodeForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GPTBigCodeForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else
<code>past_key_values[0][0].shape[-2]</code> (<code>sequence_length</code> of input past key value states). Indices of input
sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.GPTBigCodeForTokenClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[torch.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"past_key_values"},{anchor:"transformers.GPTBigCodeForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</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>If <code>past_key_values</code> is used, <code>attention_mask</code> needs to contain the masking strategy that was used for
<code>past_key_values</code>. In other words, the <code>attention_mask</code> always has to have the length:
<code>len(past_key_values) + len(input_ids)</code></p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.GPTBigCodeForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, input_ids_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.GPTBigCodeForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTBigCodeForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</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.GPTBigCodeForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.GPTBigCodeForTokenClassification.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.GPTBigCodeForTokenClassification.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.GPTBigCodeForTokenClassification.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.GPTBigCodeForTokenClassification.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GPTBigCodeForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py#L1009"}}),Ce=new un({props:{$$slots:{default:[Ui]},$$scope:{ctx:E}}}),{c(){p=n("meta"),y=c(),g=n("h1"),_=n("a"),v=n("span"),T(d.$$.fragment),f=c(),B=n("span"),fn=a("GPTBigCode"),Bt=c(),Z=n("h2"),de=n("a"),No=n("span"),T(Ge.$$.fragment),mn=c(),Oo=n("span"),gn=a("Overview"),Et=c(),le=n("p"),_n=a("The GPTBigCode model was proposed in "),Be=n("a"),vn=a("SantaCoder: don\u2019t reach for the stars!"),yn=a(" by BigCode. The listed authors are: Loubna Ben Allal, Raymond Li, Denis Kocetkov, Chenghao Mou, Christopher Akiki, Carlos Munoz Ferrandis, Niklas Muennighoff, Mayank Mishra, Alex Gu, Manan Dey, Logesh Kumar Umapathi, Carolyn Jane Anderson, Yangtian Zi, Joel Lamy Poirier, Hailey Schoelkopf, Sergey Troshin, Dmitry Abulkhanov, Manuel Romero, Michael Lappert, Francesco De Toni, Bernardo Garc\xEDa del R\xEDo, Qian Liu, Shamik Bose, Urvashi Bhattacharyya, Terry Yue Zhuo, Ian Yu, Paulo Villegas, Marco Zocca, Sourab Mangrulkar, David Lansky, Huu Nguyen, Danish Contractor, Luis Villa, Jia Li, Dzmitry Bahdanau, Yacine Jernite, Sean Hughes, Daniel Fried, Arjun Guha, Harm de Vries, Leandro von Werra."),xt=c(),po=n("p"),Tn=a("The abstract from the paper is the following:uery"),zt=c(),uo=n("p"),fo=n("em"),bn=a("The BigCode project is an open-scientific collaboration working on the responsible development of large language models for code. This tech report describes the progress of the collaboration until December 2022, outlining the current state of the Personally Identifiable Information (PII) redaction pipeline, the experiments conducted to de-risk the model architecture, and the experiments investigating better preprocessing methods for the training data. We train 1.1B parameter models on the Java, JavaScript, and Python subsets of The Stack and evaluate them on the MultiPL-E text-to-code benchmark. We find that more aggressive filtering of near-duplicates can further boost performance and, surprisingly, that selecting files from repositories with 5+ GitHub stars deteriorates performance significantly. Our best model outperforms previous open-source multilingual code generation models (InCoder-6.7B and CodeGen-Multi-2.7B) in both left-to-right generation and infilling on the Java, JavaScript, and Python portions of MultiPL-E, despite being a substantially smaller model. All models are released under an OpenRAIL license at "),Ee=n("a"),kn=a("this https URL."),It=c(),ce=n("p"),Cn=a("The model is a an optimized "),xe=n("a"),wn=a("GPT2 model"),Pn=a(" with support for Multi-Query Attention."),Ft=c(),R=n("h2"),he=n("a"),Wo=n("span"),T(ze.$$.fragment),Mn=c(),Jo=n("span"),$n=a("Technical details"),qt=c(),mo=n("p"),Gn=a("The main differences compared to GPT2."),At=c(),M=n("ul"),Lo=n("li"),Bn=a("Added support for Multi-Query Attention."),En=c(),V=n("li"),xn=a("Use "),Uo=n("code"),zn=a("gelu_pytorch_tanh"),In=a(" instead of classic "),jo=n("code"),Fn=a("gelu"),qn=a("."),An=c(),Do=n("li"),Sn=a("Avoid unnecessary synchronizations (this has since been added to GPT2 in #20061, but wasn\u2019t in the reference codebase)."),Nn=c(),Zo=n("li"),On=a("Use Linear layers instead of Conv1D (good speedup but makes the checkpoints incompatible)."),Wn=c(),S=n("li"),Jn=a("Merge "),Ro=n("code"),Ln=a("_attn"),Un=a(" and "),Vo=n("code"),jn=a("_upcast_and_reordered_attn"),Dn=a(". Always merge the matmul with scaling. Rename "),Ho=n("code"),Zn=a("reorder_and_upcast_attn"),Rn=a("->"),Qo=n("code"),Vn=a("attention_softmax_in_fp32"),Hn=c(),Yo=n("li"),Qn=a("Cache the attention mask value to avoid recreating it every time."),Yn=c(),Xo=n("li"),Xn=a("Use jit to fuse the attention fp32 casting, masking, softmax, and scaling."),Kn=c(),Ko=n("li"),es=a("Combine the attention and causal masks into a single one, pre-computed for the whole model instead of every layer."),os=c(),et=n("li"),ts=a("Merge the key and value caches into one (this changes the format of layer_past/ present, does it risk creating problems?)"),ns=c(),Ie=n("li"),ss=a("Use the memory layout (self.num_heads, 3, self.head_dim) instead of "),ot=n("code"),as=a("(3, self.num_heads, self.head_dim)"),rs=a(" for the QKV tensor with MHA. (prevents an overhead with the merged key and values, but makes the checkpoints incompatible with the original gpt2 model)."),St=c(),Fe=n("p"),is=a("You can read more about the optimizations in the "),qe=n("a"),ds=a("original pull request"),Nt=c(),H=n("h2"),pe=n("a"),tt=n("span"),T(Ae.$$.fragment),ls=c(),nt=n("span"),cs=a("GPTBigCodeConfig"),Ot=c(),q=n("div"),T(Se.$$.fragment),hs=c(),Q=n("p"),ps=a("This is the configuration class to store the configuration of a "),go=n("a"),us=a("GPTBigCodeModel"),fs=a(`. It is used to instantiate a
GPTBigCode 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 GPTBigCode
`),Ne=n("a"),ms=a("gpt_bigcode"),gs=a(" architecture."),_s=c(),Y=n("p"),vs=a("Configuration objects inherit from "),_o=n("a"),ys=a("PretrainedConfig"),Ts=a(` and can be used to control the model outputs. Read the
documentation from `),vo=n("a"),bs=a("PretrainedConfig"),ks=a(" for more information."),Cs=c(),T(ue.$$.fragment),Wt=c(),X=n("h2"),fe=n("a"),st=n("span"),T(Oe.$$.fragment),ws=c(),at=n("span"),Ps=a("GPTBigCodeModel"),Jt=c(),x=n("div"),T(We.$$.fragment),Ms=c(),rt=n("p"),$s=a("The bare GPT_BIGCODE Model transformer outputting raw hidden-states without any specific head on top."),Gs=c(),Je=n("p"),Bs=a("This model inherits from "),yo=n("a"),Es=a("PreTrainedModel"),xs=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.)`),zs=c(),Le=n("p"),Is=a("This model is also a PyTorch "),Ue=n("a"),Fs=a("torch.nn.Module"),qs=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),As=c(),N=n("div"),T(je.$$.fragment),Ss=c(),K=n("p"),Ns=a("The "),To=n("a"),Os=a("GPTBigCodeModel"),Ws=a(" forward method, overrides the "),it=n("code"),Js=a("__call__"),Ls=a(" special method."),Us=c(),T(me.$$.fragment),js=c(),T(ge.$$.fragment),Lt=c(),ee=n("h2"),_e=n("a"),dt=n("span"),T(De.$$.fragment),Ds=c(),lt=n("span"),Zs=a("GPTBigCodeForCausalLM"),Ut=c(),z=n("div"),T(Ze.$$.fragment),Rs=c(),ct=n("p"),Vs=a(`The GPT_BIGCODE Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Hs=c(),Re=n("p"),Qs=a("This model inherits from "),bo=n("a"),Ys=a("PreTrainedModel"),Xs=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.)`),Ks=c(),Ve=n("p"),ea=a("This model is also a PyTorch "),He=n("a"),oa=a("torch.nn.Module"),ta=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),na=c(),O=n("div"),T(Qe.$$.fragment),sa=c(),oe=n("p"),aa=a("The "),ko=n("a"),ra=a("GPTBigCodeForCausalLM"),ia=a(" forward method, overrides the "),ht=n("code"),da=a("__call__"),la=a(" special method."),ca=c(),T(ve.$$.fragment),ha=c(),T(ye.$$.fragment),jt=c(),te=n("h2"),Te=n("a"),pt=n("span"),T(Ye.$$.fragment),pa=c(),ut=n("span"),ua=a("GPTBigCodeForSequenceClassification"),Dt=c(),G=n("div"),T(Xe.$$.fragment),fa=c(),ft=n("p"),ma=a("The GPTBigCode Model transformer with a sequence classification head on top (linear layer)."),ga=c(),Co=n("p"),wo=n("a"),_a=a("GPTBigCodeForSequenceClassification"),va=a(` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1) do.`),ya=c(),A=n("p"),Ta=a(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),mt=n("code"),ba=a("pad_token_id"),ka=a(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),gt=n("code"),Ca=a("pad_token_id"),wa=a(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),_t=n("code"),Pa=a("inputs_embeds"),Ma=a(" are passed instead of "),vt=n("code"),$a=a("input_ids"),Ga=a(`, it does the same (take the last value in
each row of the batch).`),Ba=c(),Ke=n("p"),Ea=a("This model inherits from "),Po=n("a"),xa=a("PreTrainedModel"),za=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.)`),Ia=c(),eo=n("p"),Fa=a("This model is also a PyTorch "),oo=n("a"),qa=a("torch.nn.Module"),Aa=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sa=c(),W=n("div"),T(to.$$.fragment),Na=c(),ne=n("p"),Oa=a("The "),Mo=n("a"),Wa=a("GPTBigCodeForSequenceClassification"),Ja=a(" forward method, overrides the "),yt=n("code"),La=a("__call__"),Ua=a(" special method."),ja=c(),T(be.$$.fragment),Zt=c(),se=n("h2"),ke=n("a"),Tt=n("span"),T(no.$$.fragment),Da=c(),bt=n("span"),Za=a("GPTBigCodeForTokenClassification"),Rt=c(),I=n("div"),T(so.$$.fragment),Ra=c(),kt=n("p"),Va=a(`GPT_BIGCODE Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g.
for Named-Entity-Recognition (NER) tasks.`),Ha=c(),ao=n("p"),Qa=a("This model inherits from "),$o=n("a"),Ya=a("PreTrainedModel"),Xa=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.)`),Ka=c(),ro=n("p"),er=a("This model is also a PyTorch "),io=n("a"),or=a("torch.nn.Module"),tr=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),nr=c(),J=n("div"),T(lo.$$.fragment),sr=c(),ae=n("p"),ar=a("The "),Go=n("a"),rr=a("GPTBigCodeForTokenClassification"),ir=a(" forward method, overrides the "),Ct=n("code"),dr=a("__call__"),lr=a(" special method."),cr=c(),T(Ce.$$.fragment),this.h()},l(o){const u=qi('[data-svelte="svelte-1phssyn"]',document.head);p=s(u,"META",{name:!0,content:!0}),u.forEach(t),y=h(o),g=s(o,"H1",{class:!0});var co=i(g);_=s(co,"A",{id:!0,class:!0,href:!0});var wt=i(_);v=s(wt,"SPAN",{});var Pt=i(v);b(d.$$.fragment,Pt),Pt.forEach(t),wt.forEach(t),f=h(co),B=s(co,"SPAN",{});var Mt=i(B);fn=r(Mt,"GPTBigCode"),Mt.forEach(t),co.forEach(t),Bt=h(o),Z=s(o,"H2",{class:!0});var ho=i(Z);de=s(ho,"A",{id:!0,class:!0,href:!0});var $t=i(de);No=s($t,"SPAN",{});var Gt=i(No);b(Ge.$$.fragment,Gt),Gt.forEach(t),$t.forEach(t),mn=h(ho),Oo=s(ho,"SPAN",{});var _r=i(Oo);gn=r(_r,"Overview"),_r.forEach(t),ho.forEach(t),Et=h(o),le=s(o,"P",{});var Ht=i(le);_n=r(Ht,"The GPTBigCode model was proposed in "),Be=s(Ht,"A",{href:!0,rel:!0});var vr=i(Be);vn=r(vr,"SantaCoder: don\u2019t reach for the stars!"),vr.forEach(t),yn=r(Ht," by BigCode. The listed authors are: Loubna Ben Allal, Raymond Li, Denis Kocetkov, Chenghao Mou, Christopher Akiki, Carlos Munoz Ferrandis, Niklas Muennighoff, Mayank Mishra, Alex Gu, Manan Dey, Logesh Kumar Umapathi, Carolyn Jane Anderson, Yangtian Zi, Joel Lamy Poirier, Hailey Schoelkopf, Sergey Troshin, Dmitry Abulkhanov, Manuel Romero, Michael Lappert, Francesco De Toni, Bernardo Garc\xEDa del R\xEDo, Qian Liu, Shamik Bose, Urvashi Bhattacharyya, Terry Yue Zhuo, Ian Yu, Paulo Villegas, Marco Zocca, Sourab Mangrulkar, David Lansky, Huu Nguyen, Danish Contractor, Luis Villa, Jia Li, Dzmitry Bahdanau, Yacine Jernite, Sean Hughes, Daniel Fried, Arjun Guha, Harm de Vries, Leandro von Werra."),Ht.forEach(t),xt=h(o),po=s(o,"P",{});var yr=i(po);Tn=r(yr,"The abstract from the paper is the following:uery"),yr.forEach(t),zt=h(o),uo=s(o,"P",{});var Tr=i(uo);fo=s(Tr,"EM",{});var hr=i(fo);bn=r(hr,"The BigCode project is an open-scientific collaboration working on the responsible development of large language models for code. This tech report describes the progress of the collaboration until December 2022, outlining the current state of the Personally Identifiable Information (PII) redaction pipeline, the experiments conducted to de-risk the model architecture, and the experiments investigating better preprocessing methods for the training data. We train 1.1B parameter models on the Java, JavaScript, and Python subsets of The Stack and evaluate them on the MultiPL-E text-to-code benchmark. We find that more aggressive filtering of near-duplicates can further boost performance and, surprisingly, that selecting files from repositories with 5+ GitHub stars deteriorates performance significantly. Our best model outperforms previous open-source multilingual code generation models (InCoder-6.7B and CodeGen-Multi-2.7B) in both left-to-right generation and infilling on the Java, JavaScript, and Python portions of MultiPL-E, despite being a substantially smaller model. All models are released under an OpenRAIL license at "),Ee=s(hr,"A",{href:!0,rel:!0});var br=i(Ee);kn=r(br,"this https URL."),br.forEach(t),hr.forEach(t),Tr.forEach(t),It=h(o),ce=s(o,"P",{});var Qt=i(ce);Cn=r(Qt,"The model is a an optimized "),xe=s(Qt,"A",{href:!0,rel:!0});var kr=i(xe);wn=r(kr,"GPT2 model"),kr.forEach(t),Pn=r(Qt," with support for Multi-Query Attention."),Qt.forEach(t),Ft=h(o),R=s(o,"H2",{class:!0});var Yt=i(R);he=s(Yt,"A",{id:!0,class:!0,href:!0});var Cr=i(he);Wo=s(Cr,"SPAN",{});var wr=i(Wo);b(ze.$$.fragment,wr),wr.forEach(t),Cr.forEach(t),Mn=h(Yt),Jo=s(Yt,"SPAN",{});var Pr=i(Jo);$n=r(Pr,"Technical details"),Pr.forEach(t),Yt.forEach(t),qt=h(o),mo=s(o,"P",{});var Mr=i(mo);Gn=r(Mr,"The main differences compared to GPT2."),Mr.forEach(t),At=h(o),M=s(o,"UL",{});var $=i(M);Lo=s($,"LI",{});var $r=i(Lo);Bn=r($r,"Added support for Multi-Query Attention."),$r.forEach(t),En=h($),V=s($,"LI",{});var Bo=i(V);xn=r(Bo,"Use "),Uo=s(Bo,"CODE",{});var Gr=i(Uo);zn=r(Gr,"gelu_pytorch_tanh"),Gr.forEach(t),In=r(Bo," instead of classic "),jo=s(Bo,"CODE",{});var Br=i(jo);Fn=r(Br,"gelu"),Br.forEach(t),qn=r(Bo,"."),Bo.forEach(t),An=h($),Do=s($,"LI",{});var Er=i(Do);Sn=r(Er,"Avoid unnecessary synchronizations (this has since been added to GPT2 in #20061, but wasn\u2019t in the reference codebase)."),Er.forEach(t),Nn=h($),Zo=s($,"LI",{});var xr=i(Zo);On=r(xr,"Use Linear layers instead of Conv1D (good speedup but makes the checkpoints incompatible)."),xr.forEach(t),Wn=h($),S=s($,"LI",{});var re=i(S);Jn=r(re,"Merge "),Ro=s(re,"CODE",{});var zr=i(Ro);Ln=r(zr,"_attn"),zr.forEach(t),Un=r(re," and "),Vo=s(re,"CODE",{});var Ir=i(Vo);jn=r(Ir,"_upcast_and_reordered_attn"),Ir.forEach(t),Dn=r(re,". Always merge the matmul with scaling. Rename "),Ho=s(re,"CODE",{});var Fr=i(Ho);Zn=r(Fr,"reorder_and_upcast_attn"),Fr.forEach(t),Rn=r(re,"->"),Qo=s(re,"CODE",{});var qr=i(Qo);Vn=r(qr,"attention_softmax_in_fp32"),qr.forEach(t),re.forEach(t),Hn=h($),Yo=s($,"LI",{});var Ar=i(Yo);Qn=r(Ar,"Cache the attention mask value to avoid recreating it every time."),Ar.forEach(t),Yn=h($),Xo=s($,"LI",{});var Sr=i(Xo);Xn=r(Sr,"Use jit to fuse the attention fp32 casting, masking, softmax, and scaling."),Sr.forEach(t),Kn=h($),Ko=s($,"LI",{});var Nr=i(Ko);es=r(Nr,"Combine the attention and causal masks into a single one, pre-computed for the whole model instead of every layer."),Nr.forEach(t),os=h($),et=s($,"LI",{});var Or=i(et);ts=r(Or,"Merge the key and value caches into one (this changes the format of layer_past/ present, does it risk creating problems?)"),Or.forEach(t),ns=h($),Ie=s($,"LI",{});var Xt=i(Ie);ss=r(Xt,"Use the memory layout (self.num_heads, 3, self.head_dim) instead of "),ot=s(Xt,"CODE",{});var Wr=i(ot);as=r(Wr,"(3, self.num_heads, self.head_dim)"),Wr.forEach(t),rs=r(Xt," for the QKV tensor with MHA. (prevents an overhead with the merged key and values, but makes the checkpoints incompatible with the original gpt2 model)."),Xt.forEach(t),$.forEach(t),St=h(o),Fe=s(o,"P",{});var pr=i(Fe);is=r(pr,"You can read more about the optimizations in the "),qe=s(pr,"A",{href:!0,rel:!0});var Jr=i(qe);ds=r(Jr,"original pull request"),Jr.forEach(t),pr.forEach(t),Nt=h(o),H=s(o,"H2",{class:!0});var Kt=i(H);pe=s(Kt,"A",{id:!0,class:!0,href:!0});var Lr=i(pe);tt=s(Lr,"SPAN",{});var Ur=i(tt);b(Ae.$$.fragment,Ur),Ur.forEach(t),Lr.forEach(t),ls=h(Kt),nt=s(Kt,"SPAN",{});var jr=i(nt);cs=r(jr,"GPTBigCodeConfig"),jr.forEach(t),Kt.forEach(t),Ot=h(o),q=s(o,"DIV",{class:!0});var we=i(q);b(Se.$$.fragment,we),hs=h(we),Q=s(we,"P",{});var Eo=i(Q);ps=r(Eo,"This is the configuration class to store the configuration of a "),go=s(Eo,"A",{href:!0});var Dr=i(go);us=r(Dr,"GPTBigCodeModel"),Dr.forEach(t),fs=r(Eo,`. It is used to instantiate a
GPTBigCode 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 GPTBigCode
`),Ne=s(Eo,"A",{href:!0,rel:!0});var Zr=i(Ne);ms=r(Zr,"gpt_bigcode"),Zr.forEach(t),gs=r(Eo," architecture."),Eo.forEach(t),_s=h(we),Y=s(we,"P",{});var xo=i(Y);vs=r(xo,"Configuration objects inherit from "),_o=s(xo,"A",{href:!0});var Rr=i(_o);ys=r(Rr,"PretrainedConfig"),Rr.forEach(t),Ts=r(xo,` and can be used to control the model outputs. Read the
documentation from `),vo=s(xo,"A",{href:!0});var Vr=i(vo);bs=r(Vr,"PretrainedConfig"),Vr.forEach(t),ks=r(xo," for more information."),xo.forEach(t),Cs=h(we),b(ue.$$.fragment,we),we.forEach(t),Wt=h(o),X=s(o,"H2",{class:!0});var en=i(X);fe=s(en,"A",{id:!0,class:!0,href:!0});var Hr=i(fe);st=s(Hr,"SPAN",{});var Qr=i(st);b(Oe.$$.fragment,Qr),Qr.forEach(t),Hr.forEach(t),ws=h(en),at=s(en,"SPAN",{});var Yr=i(at);Ps=r(Yr,"GPTBigCodeModel"),Yr.forEach(t),en.forEach(t),Jt=h(o),x=s(o,"DIV",{class:!0});var L=i(x);b(We.$$.fragment,L),Ms=h(L),rt=s(L,"P",{});var Xr=i(rt);$s=r(Xr,"The bare GPT_BIGCODE Model transformer outputting raw hidden-states without any specific head on top."),Xr.forEach(t),Gs=h(L),Je=s(L,"P",{});var on=i(Je);Bs=r(on,"This model inherits from "),yo=s(on,"A",{href:!0});var Kr=i(yo);Es=r(Kr,"PreTrainedModel"),Kr.forEach(t),xs=r(on,`. 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.)`),on.forEach(t),zs=h(L),Le=s(L,"P",{});var tn=i(Le);Is=r(tn,"This model is also a PyTorch "),Ue=s(tn,"A",{href:!0,rel:!0});var ei=i(Ue);Fs=r(ei,"torch.nn.Module"),ei.forEach(t),qs=r(tn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),tn.forEach(t),As=h(L),N=s(L,"DIV",{class:!0});var Pe=i(N);b(je.$$.fragment,Pe),Ss=h(Pe),K=s(Pe,"P",{});var zo=i(K);Ns=r(zo,"The "),To=s(zo,"A",{href:!0});var oi=i(To);Os=r(oi,"GPTBigCodeModel"),oi.forEach(t),Ws=r(zo," forward method, overrides the "),it=s(zo,"CODE",{});var ti=i(it);Js=r(ti,"__call__"),ti.forEach(t),Ls=r(zo," special method."),zo.forEach(t),Us=h(Pe),b(me.$$.fragment,Pe),js=h(Pe),b(ge.$$.fragment,Pe),Pe.forEach(t),L.forEach(t),Lt=h(o),ee=s(o,"H2",{class:!0});var nn=i(ee);_e=s(nn,"A",{id:!0,class:!0,href:!0});var ni=i(_e);dt=s(ni,"SPAN",{});var si=i(dt);b(De.$$.fragment,si),si.forEach(t),ni.forEach(t),Ds=h(nn),lt=s(nn,"SPAN",{});var ai=i(lt);Zs=r(ai,"GPTBigCodeForCausalLM"),ai.forEach(t),nn.forEach(t),Ut=h(o),z=s(o,"DIV",{class:!0});var U=i(z);b(Ze.$$.fragment,U),Rs=h(U),ct=s(U,"P",{});var ri=i(ct);Vs=r(ri,`The GPT_BIGCODE Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),ri.forEach(t),Hs=h(U),Re=s(U,"P",{});var sn=i(Re);Qs=r(sn,"This model inherits from "),bo=s(sn,"A",{href:!0});var ii=i(bo);Ys=r(ii,"PreTrainedModel"),ii.forEach(t),Xs=r(sn,`. 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.forEach(t),Ks=h(U),Ve=s(U,"P",{});var an=i(Ve);ea=r(an,"This model is also a PyTorch "),He=s(an,"A",{href:!0,rel:!0});var di=i(He);oa=r(di,"torch.nn.Module"),di.forEach(t),ta=r(an,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),an.forEach(t),na=h(U),O=s(U,"DIV",{class:!0});var Me=i(O);b(Qe.$$.fragment,Me),sa=h(Me),oe=s(Me,"P",{});var Io=i(oe);aa=r(Io,"The "),ko=s(Io,"A",{href:!0});var li=i(ko);ra=r(li,"GPTBigCodeForCausalLM"),li.forEach(t),ia=r(Io," forward method, overrides the "),ht=s(Io,"CODE",{});var ci=i(ht);da=r(ci,"__call__"),ci.forEach(t),la=r(Io," special method."),Io.forEach(t),ca=h(Me),b(ve.$$.fragment,Me),ha=h(Me),b(ye.$$.fragment,Me),Me.forEach(t),U.forEach(t),jt=h(o),te=s(o,"H2",{class:!0});var rn=i(te);Te=s(rn,"A",{id:!0,class:!0,href:!0});var hi=i(Te);pt=s(hi,"SPAN",{});var pi=i(pt);b(Ye.$$.fragment,pi),pi.forEach(t),hi.forEach(t),pa=h(rn),ut=s(rn,"SPAN",{});var ui=i(ut);ua=r(ui,"GPTBigCodeForSequenceClassification"),ui.forEach(t),rn.forEach(t),Dt=h(o),G=s(o,"DIV",{class:!0});var F=i(G);b(Xe.$$.fragment,F),fa=h(F),ft=s(F,"P",{});var fi=i(ft);ma=r(fi,"The GPTBigCode Model transformer with a sequence classification head on top (linear layer)."),fi.forEach(t),ga=h(F),Co=s(F,"P",{});var ur=i(Co);wo=s(ur,"A",{href:!0});var mi=i(wo);_a=r(mi,"GPTBigCodeForSequenceClassification"),mi.forEach(t),va=r(ur,` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1) do.`),ur.forEach(t),ya=h(F),A=s(F,"P",{});var j=i(A);Ta=r(j,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),mt=s(j,"CODE",{});var gi=i(mt);ba=r(gi,"pad_token_id"),gi.forEach(t),ka=r(j,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),gt=s(j,"CODE",{});var _i=i(gt);Ca=r(_i,"pad_token_id"),_i.forEach(t),wa=r(j,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),_t=s(j,"CODE",{});var vi=i(_t);Pa=r(vi,"inputs_embeds"),vi.forEach(t),Ma=r(j," are passed instead of "),vt=s(j,"CODE",{});var yi=i(vt);$a=r(yi,"input_ids"),yi.forEach(t),Ga=r(j,`, it does the same (take the last value in
each row of the batch).`),j.forEach(t),Ba=h(F),Ke=s(F,"P",{});var dn=i(Ke);Ea=r(dn,"This model inherits from "),Po=s(dn,"A",{href:!0});var Ti=i(Po);xa=r(Ti,"PreTrainedModel"),Ti.forEach(t),za=r(dn,`. 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.)`),dn.forEach(t),Ia=h(F),eo=s(F,"P",{});var ln=i(eo);Fa=r(ln,"This model is also a PyTorch "),oo=s(ln,"A",{href:!0,rel:!0});var bi=i(oo);qa=r(bi,"torch.nn.Module"),bi.forEach(t),Aa=r(ln,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ln.forEach(t),Sa=h(F),W=s(F,"DIV",{class:!0});var Fo=i(W);b(to.$$.fragment,Fo),Na=h(Fo),ne=s(Fo,"P",{});var qo=i(ne);Oa=r(qo,"The "),Mo=s(qo,"A",{href:!0});var ki=i(Mo);Wa=r(ki,"GPTBigCodeForSequenceClassification"),ki.forEach(t),Ja=r(qo," forward method, overrides the "),yt=s(qo,"CODE",{});var Ci=i(yt);La=r(Ci,"__call__"),Ci.forEach(t),Ua=r(qo," special method."),qo.forEach(t),ja=h(Fo),b(be.$$.fragment,Fo),Fo.forEach(t),F.forEach(t),Zt=h(o),se=s(o,"H2",{class:!0});var cn=i(se);ke=s(cn,"A",{id:!0,class:!0,href:!0});var wi=i(ke);Tt=s(wi,"SPAN",{});var Pi=i(Tt);b(no.$$.fragment,Pi),Pi.forEach(t),wi.forEach(t),Da=h(cn),bt=s(cn,"SPAN",{});var Mi=i(bt);Za=r(Mi,"GPTBigCodeForTokenClassification"),Mi.forEach(t),cn.forEach(t),Rt=h(o),I=s(o,"DIV",{class:!0});var D=i(I);b(so.$$.fragment,D),Ra=h(D),kt=s(D,"P",{});var $i=i(kt);Va=r($i,`GPT_BIGCODE Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g.
for Named-Entity-Recognition (NER) tasks.`),$i.forEach(t),Ha=h(D),ao=s(D,"P",{});var hn=i(ao);Qa=r(hn,"This model inherits from "),$o=s(hn,"A",{href:!0});var Gi=i($o);Ya=r(Gi,"PreTrainedModel"),Gi.forEach(t),Xa=r(hn,`. 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.)`),hn.forEach(t),Ka=h(D),ro=s(D,"P",{});var pn=i(ro);er=r(pn,"This model is also a PyTorch "),io=s(pn,"A",{href:!0,rel:!0});var Bi=i(io);or=r(Bi,"torch.nn.Module"),Bi.forEach(t),tr=r(pn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pn.forEach(t),nr=h(D),J=s(D,"DIV",{class:!0});var Ao=i(J);b(lo.$$.fragment,Ao),sr=h(Ao),ae=s(Ao,"P",{});var So=i(ae);ar=r(So,"The "),Go=s(So,"A",{href:!0});var Ei=i(Go);rr=r(Ei,"GPTBigCodeForTokenClassification"),Ei.forEach(t),ir=r(So," forward method, overrides the "),Ct=s(So,"CODE",{});var xi=i(Ct);dr=r(xi,"__call__"),xi.forEach(t),lr=r(So," special method."),So.forEach(t),cr=h(Ao),b(Ce.$$.fragment,Ao),Ao.forEach(t),D.forEach(t),this.h()},h(){l(p,"name","hf:doc:metadata"),l(p,"content",JSON.stringify(Di)),l(_,"id","gptbigcode"),l(_,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(_,"href","#gptbigcode"),l(g,"class","relative group"),l(de,"id","overview"),l(de,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(de,"href","#overview"),l(Z,"class","relative group"),l(Be,"href","https://arxiv.org/abs/2301.03988"),l(Be,"rel","nofollow"),l(Ee,"href","https://huggingface.co/bigcode"),l(Ee,"rel","nofollow"),l(xe,"href","https://huggingface.co/docs/transformers/model_doc/gpt2"),l(xe,"rel","nofollow"),l(he,"id","technical-details"),l(he,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(he,"href","#technical-details"),l(R,"class","relative group"),l(qe,"href","https://github.com/huggingface/transformers/pull/22575"),l(qe,"rel","nofollow"),l(pe,"id","transformers.GPTBigCodeConfig"),l(pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(pe,"href","#transformers.GPTBigCodeConfig"),l(H,"class","relative group"),l(go,"href","/docs/transformers/v4.31.0/en/model_doc/gpt_bigcode#transformers.GPTBigCodeModel"),l(Ne,"href","https://huggingface.co/gpt_bigcode"),l(Ne,"rel","nofollow"),l(_o,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(vo,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(fe,"id","transformers.GPTBigCodeModel"),l(fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(fe,"href","#transformers.GPTBigCodeModel"),l(X,"class","relative group"),l(yo,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),l(Ue,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Ue,"rel","nofollow"),l(To,"href","/docs/transformers/v4.31.0/en/model_doc/gpt_bigcode#transformers.GPTBigCodeModel"),l(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(_e,"id","transformers.GPTBigCodeForCausalLM"),l(_e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(_e,"href","#transformers.GPTBigCodeForCausalLM"),l(ee,"class","relative group"),l(bo,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),l(He,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(He,"rel","nofollow"),l(ko,"href","/docs/transformers/v4.31.0/en/model_doc/gpt_bigcode#transformers.GPTBigCodeForCausalLM"),l(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Te,"id","transformers.GPTBigCodeForSequenceClassification"),l(Te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Te,"href","#transformers.GPTBigCodeForSequenceClassification"),l(te,"class","relative group"),l(wo,"href","/docs/transformers/v4.31.0/en/model_doc/gpt_bigcode#transformers.GPTBigCodeForSequenceClassification"),l(Po,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),l(oo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(oo,"rel","nofollow"),l(Mo,"href","/docs/transformers/v4.31.0/en/model_doc/gpt_bigcode#transformers.GPTBigCodeForSequenceClassification"),l(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ke,"id","transformers.GPTBigCodeForTokenClassification"),l(ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ke,"href","#transformers.GPTBigCodeForTokenClassification"),l(se,"class","relative group"),l($o,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),l(io,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(io,"rel","nofollow"),l(Go,"href","/docs/transformers/v4.31.0/en/model_doc/gpt_bigcode#transformers.GPTBigCodeForTokenClassification"),l(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,u){e(document.head,p),m(o,y,u),m(o,g,u),e(g,_),e(_,v),k(d,v,null),e(g,f),e(g,B),e(B,fn),m(o,Bt,u),m(o,Z,u),e(Z,de),e(de,No),k(Ge,No,null),e(Z,mn),e(Z,Oo),e(Oo,gn),m(o,Et,u),m(o,le,u),e(le,_n),e(le,Be),e(Be,vn),e(le,yn),m(o,xt,u),m(o,po,u),e(po,Tn),m(o,zt,u),m(o,uo,u),e(uo,fo),e(fo,bn),e(fo,Ee),e(Ee,kn),m(o,It,u),m(o,ce,u),e(ce,Cn),e(ce,xe),e(xe,wn),e(ce,Pn),m(o,Ft,u),m(o,R,u),e(R,he),e(he,Wo),k(ze,Wo,null),e(R,Mn),e(R,Jo),e(Jo,$n),m(o,qt,u),m(o,mo,u),e(mo,Gn),m(o,At,u),m(o,M,u),e(M,Lo),e(Lo,Bn),e(M,En),e(M,V),e(V,xn),e(V,Uo),e(Uo,zn),e(V,In),e(V,jo),e(jo,Fn),e(V,qn),e(M,An),e(M,Do),e(Do,Sn),e(M,Nn),e(M,Zo),e(Zo,On),e(M,Wn),e(M,S),e(S,Jn),e(S,Ro),e(Ro,Ln),e(S,Un),e(S,Vo),e(Vo,jn),e(S,Dn),e(S,Ho),e(Ho,Zn),e(S,Rn),e(S,Qo),e(Qo,Vn),e(M,Hn),e(M,Yo),e(Yo,Qn),e(M,Yn),e(M,Xo),e(Xo,Xn),e(M,Kn),e(M,Ko),e(Ko,es),e(M,os),e(M,et),e(et,ts),e(M,ns),e(M,Ie),e(Ie,ss),e(Ie,ot),e(ot,as),e(Ie,rs),m(o,St,u),m(o,Fe,u),e(Fe,is),e(Fe,qe),e(qe,ds),m(o,Nt,u),m(o,H,u),e(H,pe),e(pe,tt),k(Ae,tt,null),e(H,ls),e(H,nt),e(nt,cs),m(o,Ot,u),m(o,q,u),k(Se,q,null),e(q,hs),e(q,Q),e(Q,ps),e(Q,go),e(go,us),e(Q,fs),e(Q,Ne),e(Ne,ms),e(Q,gs),e(q,_s),e(q,Y),e(Y,vs),e(Y,_o),e(_o,ys),e(Y,Ts),e(Y,vo),e(vo,bs),e(Y,ks),e(q,Cs),k(ue,q,null),m(o,Wt,u),m(o,X,u),e(X,fe),e(fe,st),k(Oe,st,null),e(X,ws),e(X,at),e(at,Ps),m(o,Jt,u),m(o,x,u),k(We,x,null),e(x,Ms),e(x,rt),e(rt,$s),e(x,Gs),e(x,Je),e(Je,Bs),e(Je,yo),e(yo,Es),e(Je,xs),e(x,zs),e(x,Le),e(Le,Is),e(Le,Ue),e(Ue,Fs),e(Le,qs),e(x,As),e(x,N),k(je,N,null),e(N,Ss),e(N,K),e(K,Ns),e(K,To),e(To,Os),e(K,Ws),e(K,it),e(it,Js),e(K,Ls),e(N,Us),k(me,N,null),e(N,js),k(ge,N,null),m(o,Lt,u),m(o,ee,u),e(ee,_e),e(_e,dt),k(De,dt,null),e(ee,Ds),e(ee,lt),e(lt,Zs),m(o,Ut,u),m(o,z,u),k(Ze,z,null),e(z,Rs),e(z,ct),e(ct,Vs),e(z,Hs),e(z,Re),e(Re,Qs),e(Re,bo),e(bo,Ys),e(Re,Xs),e(z,Ks),e(z,Ve),e(Ve,ea),e(Ve,He),e(He,oa),e(Ve,ta),e(z,na),e(z,O),k(Qe,O,null),e(O,sa),e(O,oe),e(oe,aa),e(oe,ko),e(ko,ra),e(oe,ia),e(oe,ht),e(ht,da),e(oe,la),e(O,ca),k(ve,O,null),e(O,ha),k(ye,O,null),m(o,jt,u),m(o,te,u),e(te,Te),e(Te,pt),k(Ye,pt,null),e(te,pa),e(te,ut),e(ut,ua),m(o,Dt,u),m(o,G,u),k(Xe,G,null),e(G,fa),e(G,ft),e(ft,ma),e(G,ga),e(G,Co),e(Co,wo),e(wo,_a),e(Co,va),e(G,ya),e(G,A),e(A,Ta),e(A,mt),e(mt,ba),e(A,ka),e(A,gt),e(gt,Ca),e(A,wa),e(A,_t),e(_t,Pa),e(A,Ma),e(A,vt),e(vt,$a),e(A,Ga),e(G,Ba),e(G,Ke),e(Ke,Ea),e(Ke,Po),e(Po,xa),e(Ke,za),e(G,Ia),e(G,eo),e(eo,Fa),e(eo,oo),e(oo,qa),e(eo,Aa),e(G,Sa),e(G,W),k(to,W,null),e(W,Na),e(W,ne),e(ne,Oa),e(ne,Mo),e(Mo,Wa),e(ne,Ja),e(ne,yt),e(yt,La),e(ne,Ua),e(W,ja),k(be,W,null),m(o,Zt,u),m(o,se,u),e(se,ke),e(ke,Tt),k(no,Tt,null),e(se,Da),e(se,bt),e(bt,Za),m(o,Rt,u),m(o,I,u),k(so,I,null),e(I,Ra),e(I,kt),e(kt,Va),e(I,Ha),e(I,ao),e(ao,Qa),e(ao,$o),e($o,Ya),e(ao,Xa),e(I,Ka),e(I,ro),e(ro,er),e(ro,io),e(io,or),e(ro,tr),e(I,nr),e(I,J),k(lo,J,null),e(J,sr),e(J,ae),e(ae,ar),e(ae,Go),e(Go,rr),e(ae,ir),e(ae,Ct),e(Ct,dr),e(ae,lr),e(J,cr),k(Ce,J,null),Vt=!0},p(o,[u]){const co={};u&2&&(co.$$scope={dirty:u,ctx:o}),ue.$set(co);const wt={};u&2&&(wt.$$scope={dirty:u,ctx:o}),me.$set(wt);const Pt={};u&2&&(Pt.$$scope={dirty:u,ctx:o}),ge.$set(Pt);const Mt={};u&2&&(Mt.$$scope={dirty:u,ctx:o}),ve.$set(Mt);const ho={};u&2&&(ho.$$scope={dirty:u,ctx:o}),ye.$set(ho);const $t={};u&2&&($t.$$scope={dirty:u,ctx:o}),be.$set($t);const Gt={};u&2&&(Gt.$$scope={dirty:u,ctx:o}),Ce.$set(Gt)},i(o){Vt||(C(d.$$.fragment,o),C(Ge.$$.fragment,o),C(ze.$$.fragment,o),C(Ae.$$.fragment,o),C(Se.$$.fragment,o),C(ue.$$.fragment,o),C(Oe.$$.fragment,o),C(We.$$.fragment,o),C(je.$$.fragment,o),C(me.$$.fragment,o),C(ge.$$.fragment,o),C(De.$$.fragment,o),C(Ze.$$.fragment,o),C(Qe.$$.fragment,o),C(ve.$$.fragment,o),C(ye.$$.fragment,o),C(Ye.$$.fragment,o),C(Xe.$$.fragment,o),C(to.$$.fragment,o),C(be.$$.fragment,o),C(no.$$.fragment,o),C(so.$$.fragment,o),C(lo.$$.fragment,o),C(Ce.$$.fragment,o),Vt=!0)},o(o){w(d.$$.fragment,o),w(Ge.$$.fragment,o),w(ze.$$.fragment,o),w(Ae.$$.fragment,o),w(Se.$$.fragment,o),w(ue.$$.fragment,o),w(Oe.$$.fragment,o),w(We.$$.fragment,o),w(je.$$.fragment,o),w(me.$$.fragment,o),w(ge.$$.fragment,o),w(De.$$.fragment,o),w(Ze.$$.fragment,o),w(Qe.$$.fragment,o),w(ve.$$.fragment,o),w(ye.$$.fragment,o),w(Ye.$$.fragment,o),w(Xe.$$.fragment,o),w(to.$$.fragment,o),w(be.$$.fragment,o),w(no.$$.fragment,o),w(so.$$.fragment,o),w(lo.$$.fragment,o),w(Ce.$$.fragment,o),Vt=!1},d(o){t(p),o&&t(y),o&&t(g),P(d),o&&t(Bt),o&&t(Z),P(Ge),o&&t(Et),o&&t(le),o&&t(xt),o&&t(po),o&&t(zt),o&&t(uo),o&&t(It),o&&t(ce),o&&t(Ft),o&&t(R),P(ze),o&&t(qt),o&&t(mo),o&&t(At),o&&t(M),o&&t(St),o&&t(Fe),o&&t(Nt),o&&t(H),P(Ae),o&&t(Ot),o&&t(q),P(Se),P(ue),o&&t(Wt),o&&t(X),P(Oe),o&&t(Jt),o&&t(x),P(We),P(je),P(me),P(ge),o&&t(Lt),o&&t(ee),P(De),o&&t(Ut),o&&t(z),P(Ze),P(Qe),P(ve),P(ye),o&&t(jt),o&&t(te),P(Ye),o&&t(Dt),o&&t(G),P(Xe),P(to),P(be),o&&t(Zt),o&&t(se),P(no),o&&t(Rt),o&&t(I),P(so),P(lo),P(Ce)}}}const Di={local:"gptbigcode",sections:[{local:"overview",title:"Overview"},{local:"technical-details",title:"Technical details"},{local:"transformers.GPTBigCodeConfig",title:"GPTBigCodeConfig"},{local:"transformers.GPTBigCodeModel",title:"GPTBigCodeModel"},{local:"transformers.GPTBigCodeForCausalLM",title:"GPTBigCodeForCausalLM"},{local:"transformers.GPTBigCodeForSequenceClassification",title:"GPTBigCodeForSequenceClassification"},{local:"transformers.GPTBigCodeForTokenClassification",title:"GPTBigCodeForTokenClassification"}],title:"GPTBigCode"};function Zi(E){return Ai(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ki extends zi{constructor(p){super();Ii(this,p,Zi,ji,Fi,{})}}export{Ki as default,Di as metadata};
