import{S as xi,i as Ii,s as Fi,e as n,k as c,w as T,t as s,M as qi,c as a,d as t,m as h,a as i,x as b,h as r,b as l,G as e,g as f,y as k,q as C,o as w,B as P,v as Ai,L as fr}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 mr}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=s("Example:"),g=c(),T(_.$$.fragment)},l(d){p=a(d,"P",{});var m=i(p);y=r(m,"Example:"),m.forEach(t),g=h(d),b(_.$$.fragment,d)},m(d,m){f(d,p,m),e(p,y),f(d,g,m),k(_,d,m),v=!0},p:fr,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=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=s("Module"),v=s(`
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=a(d,"P",{});var m=i(p);y=r(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(m,"CODE",{});var B=i(g);_=r(B,"Module"),B.forEach(t),v=r(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(d,m){f(d,p,m),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=s("Example:"),g=c(),T(_.$$.fragment)},l(d){p=a(d,"P",{});var m=i(p);y=r(m,"Example:"),m.forEach(t),g=h(d),b(_.$$.fragment,d)},m(d,m){f(d,p,m),e(p,y),f(d,g,m),k(_,d,m),v=!0},p:fr,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=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=s("Module"),v=s(`
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=a(d,"P",{});var m=i(p);y=r(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(m,"CODE",{});var B=i(g);_=r(B,"Module"),B.forEach(t),v=r(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(d,m){f(d,p,m),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=s("Example:"),g=c(),T(_.$$.fragment)},l(d){p=a(d,"P",{});var m=i(p);y=r(m,"Example:"),m.forEach(t),g=h(d),b(_.$$.fragment,d)},m(d,m){f(d,p,m),e(p,y),f(d,g,m),k(_,d,m),v=!0},p:fr,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=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=s("Module"),v=s(`
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=a(d,"P",{});var m=i(p);y=r(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(m,"CODE",{});var B=i(g);_=r(B,"Module"),B.forEach(t),v=r(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(d,m){f(d,p,m),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=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=s("Module"),v=s(`
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=a(d,"P",{});var m=i(p);y=r(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(m,"CODE",{});var B=i(g);_=r(B,"Module"),B.forEach(t),v=r(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(d,m){f(d,p,m),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,m,B,mn,Bt,Z,de,No,Ge,fn,Oo,gn,Et,le,_n,Be,vn,yn,zt,po,Tn,xt,uo,mo,bn,Ee,kn,It,ce,Cn,ze,wn,Pn,Ft,R,he,Wo,xe,Mn,Jo,$n,qt,fo,Gn,At,M,Lo,Bn,En,V,zn,Uo,xn,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,ea,oa,et,ta,na,Ie,aa,ot,sa,ra,St,Fe,ia,qe,da,Nt,H,pe,tt,Ae,la,nt,ca,Ot,q,Se,ha,Q,pa,go,ua,ma,Ne,fa,ga,_a,Y,va,_o,ya,Ta,vo,ba,ka,Ca,ue,Wt,X,me,at,Oe,wa,st,Pa,Jt,z,We,Ma,rt,$a,Ga,Je,Ba,yo,Ea,za,xa,Le,Ia,Ue,Fa,qa,Aa,N,je,Sa,K,Na,To,Oa,Wa,it,Ja,La,Ua,fe,ja,ge,Lt,ee,_e,dt,De,Da,lt,Za,Ut,x,Ze,Ra,ct,Va,Ha,Re,Qa,bo,Ya,Xa,Ka,Ve,es,He,os,ts,ns,O,Qe,as,oe,ss,ko,rs,is,ht,ds,ls,cs,ve,hs,ye,jt,te,Te,pt,Ye,ps,ut,us,Dt,G,Xe,ms,mt,fs,gs,Co,wo,_s,vs,ys,A,Ts,ft,bs,ks,gt,Cs,ws,_t,Ps,Ms,vt,$s,Gs,Bs,Ke,Es,Po,zs,xs,Is,eo,Fs,oo,qs,As,Ss,W,to,Ns,ne,Os,Mo,Ws,Js,yt,Ls,Us,js,be,Zt,ae,ke,Tt,no,Ds,bt,Zs,Rt,I,ao,Rs,kt,Vs,Hs,so,Qs,$o,Ys,Xs,Ks,ro,er,io,or,tr,nr,J,lo,ar,se,sr,Go,rr,ir,Ct,dr,lr,cr,Ce,Vt;return d=new $e({}),Ge=new $e({}),xe=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/main/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/main/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py#L28"}}),ue=new mr({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py#L531",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),fe=new un({props:{$$slots:{default:[Ni]},$$scope:{ctx:E}}}),ge=new mr({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py#L723"}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py#L777",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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 mr({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py#L876"}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py#L886"}}),be=new un({props:{$$slots:{default:[Li]},$$scope:{ctx:E}}}),no=new $e({}),ao=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py#L994"}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py#L1012"}}),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),m=c(),B=n("span"),mn=s("GPTBigCode"),Bt=c(),Z=n("h2"),de=n("a"),No=n("span"),T(Ge.$$.fragment),fn=c(),Oo=n("span"),gn=s("Overview"),Et=c(),le=n("p"),_n=s("The GPTBigCode model was proposed in "),Be=n("a"),vn=s("SantaCoder: don\u2019t reach for the stars!"),yn=s(" 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."),zt=c(),po=n("p"),Tn=s("The abstract from the paper is the following:uery"),xt=c(),uo=n("p"),mo=n("em"),bn=s("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=s("this https URL."),It=c(),ce=n("p"),Cn=s("The model is a an optimized "),ze=n("a"),wn=s("GPT2 model"),Pn=s(" with support for Multi-Query Attention."),Ft=c(),R=n("h2"),he=n("a"),Wo=n("span"),T(xe.$$.fragment),Mn=c(),Jo=n("span"),$n=s("Technical details"),qt=c(),fo=n("p"),Gn=s("The main differences compared to GPT2."),At=c(),M=n("ul"),Lo=n("li"),Bn=s("Added support for Multi-Query Attention."),En=c(),V=n("li"),zn=s("Use "),Uo=n("code"),xn=s("gelu_pytorch_tanh"),In=s(" instead of classic "),jo=n("code"),Fn=s("gelu"),qn=s("."),An=c(),Do=n("li"),Sn=s("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=s("Use Linear layers instead of Conv1D (good speedup but makes the checkpoints incompatible)."),Wn=c(),S=n("li"),Jn=s("Merge "),Ro=n("code"),Ln=s("_attn"),Un=s(" and "),Vo=n("code"),jn=s("_upcast_and_reordered_attn"),Dn=s(". Always merge the matmul with scaling. Rename "),Ho=n("code"),Zn=s("reorder_and_upcast_attn"),Rn=s("->"),Qo=n("code"),Vn=s("attention_softmax_in_fp32"),Hn=c(),Yo=n("li"),Qn=s("Cache the attention mask value to avoid recreating it every time."),Yn=c(),Xo=n("li"),Xn=s("Use jit to fuse the attention fp32 casting, masking, softmax, and scaling."),Kn=c(),Ko=n("li"),ea=s("Combine the attention and causal masks into a single one, pre-computed for the whole model instead of every layer."),oa=c(),et=n("li"),ta=s("Merge the key and value caches into one (this changes the format of layer_past/ present, does it risk creating problems?)"),na=c(),Ie=n("li"),aa=s("Use the memory layout (self.num_heads, 3, self.head_dim) instead of "),ot=n("code"),sa=s("(3, self.num_heads, self.head_dim)"),ra=s(" 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"),ia=s("You can read more about the optimizations in the "),qe=n("a"),da=s("original pull request"),Nt=c(),H=n("h2"),pe=n("a"),tt=n("span"),T(Ae.$$.fragment),la=c(),nt=n("span"),ca=s("GPTBigCodeConfig"),Ot=c(),q=n("div"),T(Se.$$.fragment),ha=c(),Q=n("p"),pa=s("This is the configuration class to store the configuration of a "),go=n("a"),ua=s("GPTBigCodeModel"),ma=s(`. 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"),fa=s("gpt_bigcode"),ga=s(" architecture."),_a=c(),Y=n("p"),va=s("Configuration objects inherit from "),_o=n("a"),ya=s("PretrainedConfig"),Ta=s(` and can be used to control the model outputs. Read the
documentation from `),vo=n("a"),ba=s("PretrainedConfig"),ka=s(" for more information."),Ca=c(),T(ue.$$.fragment),Wt=c(),X=n("h2"),me=n("a"),at=n("span"),T(Oe.$$.fragment),wa=c(),st=n("span"),Pa=s("GPTBigCodeModel"),Jt=c(),z=n("div"),T(We.$$.fragment),Ma=c(),rt=n("p"),$a=s("The bare GPT_BIGCODE Model transformer outputting raw hidden-states without any specific head on top."),Ga=c(),Je=n("p"),Ba=s("This model inherits from "),yo=n("a"),Ea=s("PreTrainedModel"),za=s(`. 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.)`),xa=c(),Le=n("p"),Ia=s("This model is also a PyTorch "),Ue=n("a"),Fa=s("torch.nn.Module"),qa=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Aa=c(),N=n("div"),T(je.$$.fragment),Sa=c(),K=n("p"),Na=s("The "),To=n("a"),Oa=s("GPTBigCodeModel"),Wa=s(" forward method, overrides the "),it=n("code"),Ja=s("__call__"),La=s(" special method."),Ua=c(),T(fe.$$.fragment),ja=c(),T(ge.$$.fragment),Lt=c(),ee=n("h2"),_e=n("a"),dt=n("span"),T(De.$$.fragment),Da=c(),lt=n("span"),Za=s("GPTBigCodeForCausalLM"),Ut=c(),x=n("div"),T(Ze.$$.fragment),Ra=c(),ct=n("p"),Va=s(`The GPT_BIGCODE Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Ha=c(),Re=n("p"),Qa=s("This model inherits from "),bo=n("a"),Ya=s("PreTrainedModel"),Xa=s(`. 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(),Ve=n("p"),es=s("This model is also a PyTorch "),He=n("a"),os=s("torch.nn.Module"),ts=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ns=c(),O=n("div"),T(Qe.$$.fragment),as=c(),oe=n("p"),ss=s("The "),ko=n("a"),rs=s("GPTBigCodeForCausalLM"),is=s(" forward method, overrides the "),ht=n("code"),ds=s("__call__"),ls=s(" special method."),cs=c(),T(ve.$$.fragment),hs=c(),T(ye.$$.fragment),jt=c(),te=n("h2"),Te=n("a"),pt=n("span"),T(Ye.$$.fragment),ps=c(),ut=n("span"),us=s("GPTBigCodeForSequenceClassification"),Dt=c(),G=n("div"),T(Xe.$$.fragment),ms=c(),mt=n("p"),fs=s("The GPTBigCode Model transformer with a sequence classification head on top (linear layer)."),gs=c(),Co=n("p"),wo=n("a"),_s=s("GPTBigCodeForSequenceClassification"),vs=s(` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1) do.`),ys=c(),A=n("p"),Ts=s(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),ft=n("code"),bs=s("pad_token_id"),ks=s(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),gt=n("code"),Cs=s("pad_token_id"),ws=s(` 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"),Ps=s("inputs_embeds"),Ms=s(" are passed instead of "),vt=n("code"),$s=s("input_ids"),Gs=s(`, it does the same (take the last value in
each row of the batch).`),Bs=c(),Ke=n("p"),Es=s("This model inherits from "),Po=n("a"),zs=s("PreTrainedModel"),xs=s(`. 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.)`),Is=c(),eo=n("p"),Fs=s("This model is also a PyTorch "),oo=n("a"),qs=s("torch.nn.Module"),As=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ss=c(),W=n("div"),T(to.$$.fragment),Ns=c(),ne=n("p"),Os=s("The "),Mo=n("a"),Ws=s("GPTBigCodeForSequenceClassification"),Js=s(" forward method, overrides the "),yt=n("code"),Ls=s("__call__"),Us=s(" special method."),js=c(),T(be.$$.fragment),Zt=c(),ae=n("h2"),ke=n("a"),Tt=n("span"),T(no.$$.fragment),Ds=c(),bt=n("span"),Zs=s("GPTBigCodeForTokenClassification"),Rt=c(),I=n("div"),T(ao.$$.fragment),Rs=c(),kt=n("p"),Vs=s(`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.`),Hs=c(),so=n("p"),Qs=s("This model inherits from "),$o=n("a"),Ys=s("PreTrainedModel"),Xs=s(`. 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(),ro=n("p"),er=s("This model is also a PyTorch "),io=n("a"),or=s("torch.nn.Module"),tr=s(` 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),ar=c(),se=n("p"),sr=s("The "),Go=n("a"),rr=s("GPTBigCodeForTokenClassification"),ir=s(" forward method, overrides the "),Ct=n("code"),dr=s("__call__"),lr=s(" special method."),cr=c(),T(Ce.$$.fragment),this.h()},l(o){const u=qi('[data-svelte="svelte-1phssyn"]',document.head);p=a(u,"META",{name:!0,content:!0}),u.forEach(t),y=h(o),g=a(o,"H1",{class:!0});var co=i(g);_=a(co,"A",{id:!0,class:!0,href:!0});var wt=i(_);v=a(wt,"SPAN",{});var Pt=i(v);b(d.$$.fragment,Pt),Pt.forEach(t),wt.forEach(t),m=h(co),B=a(co,"SPAN",{});var Mt=i(B);mn=r(Mt,"GPTBigCode"),Mt.forEach(t),co.forEach(t),Bt=h(o),Z=a(o,"H2",{class:!0});var ho=i(Z);de=a(ho,"A",{id:!0,class:!0,href:!0});var $t=i(de);No=a($t,"SPAN",{});var Gt=i(No);b(Ge.$$.fragment,Gt),Gt.forEach(t),$t.forEach(t),fn=h(ho),Oo=a(ho,"SPAN",{});var _r=i(Oo);gn=r(_r,"Overview"),_r.forEach(t),ho.forEach(t),Et=h(o),le=a(o,"P",{});var Ht=i(le);_n=r(Ht,"The GPTBigCode model was proposed in "),Be=a(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),zt=h(o),po=a(o,"P",{});var yr=i(po);Tn=r(yr,"The abstract from the paper is the following:uery"),yr.forEach(t),xt=h(o),uo=a(o,"P",{});var Tr=i(uo);mo=a(Tr,"EM",{});var hr=i(mo);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=a(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=a(o,"P",{});var Qt=i(ce);Cn=r(Qt,"The model is a an optimized "),ze=a(Qt,"A",{href:!0,rel:!0});var kr=i(ze);wn=r(kr,"GPT2 model"),kr.forEach(t),Pn=r(Qt," with support for Multi-Query Attention."),Qt.forEach(t),Ft=h(o),R=a(o,"H2",{class:!0});var Yt=i(R);he=a(Yt,"A",{id:!0,class:!0,href:!0});var Cr=i(he);Wo=a(Cr,"SPAN",{});var wr=i(Wo);b(xe.$$.fragment,wr),wr.forEach(t),Cr.forEach(t),Mn=h(Yt),Jo=a(Yt,"SPAN",{});var Pr=i(Jo);$n=r(Pr,"Technical details"),Pr.forEach(t),Yt.forEach(t),qt=h(o),fo=a(o,"P",{});var Mr=i(fo);Gn=r(Mr,"The main differences compared to GPT2."),Mr.forEach(t),At=h(o),M=a(o,"UL",{});var $=i(M);Lo=a($,"LI",{});var $r=i(Lo);Bn=r($r,"Added support for Multi-Query Attention."),$r.forEach(t),En=h($),V=a($,"LI",{});var Bo=i(V);zn=r(Bo,"Use "),Uo=a(Bo,"CODE",{});var Gr=i(Uo);xn=r(Gr,"gelu_pytorch_tanh"),Gr.forEach(t),In=r(Bo," instead of classic "),jo=a(Bo,"CODE",{});var Br=i(jo);Fn=r(Br,"gelu"),Br.forEach(t),qn=r(Bo,"."),Bo.forEach(t),An=h($),Do=a($,"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=a($,"LI",{});var zr=i(Zo);On=r(zr,"Use Linear layers instead of Conv1D (good speedup but makes the checkpoints incompatible)."),zr.forEach(t),Wn=h($),S=a($,"LI",{});var re=i(S);Jn=r(re,"Merge "),Ro=a(re,"CODE",{});var xr=i(Ro);Ln=r(xr,"_attn"),xr.forEach(t),Un=r(re," and "),Vo=a(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=a(re,"CODE",{});var Fr=i(Ho);Zn=r(Fr,"reorder_and_upcast_attn"),Fr.forEach(t),Rn=r(re,"->"),Qo=a(re,"CODE",{});var qr=i(Qo);Vn=r(qr,"attention_softmax_in_fp32"),qr.forEach(t),re.forEach(t),Hn=h($),Yo=a($,"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=a($,"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=a($,"LI",{});var Nr=i(Ko);ea=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),oa=h($),et=a($,"LI",{});var Or=i(et);ta=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),na=h($),Ie=a($,"LI",{});var Xt=i(Ie);aa=r(Xt,"Use the memory layout (self.num_heads, 3, self.head_dim) instead of "),ot=a(Xt,"CODE",{});var Wr=i(ot);sa=r(Wr,"(3, self.num_heads, self.head_dim)"),Wr.forEach(t),ra=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=a(o,"P",{});var pr=i(Fe);ia=r(pr,"You can read more about the optimizations in the "),qe=a(pr,"A",{href:!0,rel:!0});var Jr=i(qe);da=r(Jr,"original pull request"),Jr.forEach(t),pr.forEach(t),Nt=h(o),H=a(o,"H2",{class:!0});var Kt=i(H);pe=a(Kt,"A",{id:!0,class:!0,href:!0});var Lr=i(pe);tt=a(Lr,"SPAN",{});var Ur=i(tt);b(Ae.$$.fragment,Ur),Ur.forEach(t),Lr.forEach(t),la=h(Kt),nt=a(Kt,"SPAN",{});var jr=i(nt);ca=r(jr,"GPTBigCodeConfig"),jr.forEach(t),Kt.forEach(t),Ot=h(o),q=a(o,"DIV",{class:!0});var we=i(q);b(Se.$$.fragment,we),ha=h(we),Q=a(we,"P",{});var Eo=i(Q);pa=r(Eo,"This is the configuration class to store the configuration of a "),go=a(Eo,"A",{href:!0});var Dr=i(go);ua=r(Dr,"GPTBigCodeModel"),Dr.forEach(t),ma=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=a(Eo,"A",{href:!0,rel:!0});var Zr=i(Ne);fa=r(Zr,"gpt_bigcode"),Zr.forEach(t),ga=r(Eo," architecture."),Eo.forEach(t),_a=h(we),Y=a(we,"P",{});var zo=i(Y);va=r(zo,"Configuration objects inherit from "),_o=a(zo,"A",{href:!0});var Rr=i(_o);ya=r(Rr,"PretrainedConfig"),Rr.forEach(t),Ta=r(zo,` and can be used to control the model outputs. Read the
documentation from `),vo=a(zo,"A",{href:!0});var Vr=i(vo);ba=r(Vr,"PretrainedConfig"),Vr.forEach(t),ka=r(zo," for more information."),zo.forEach(t),Ca=h(we),b(ue.$$.fragment,we),we.forEach(t),Wt=h(o),X=a(o,"H2",{class:!0});var en=i(X);me=a(en,"A",{id:!0,class:!0,href:!0});var Hr=i(me);at=a(Hr,"SPAN",{});var Qr=i(at);b(Oe.$$.fragment,Qr),Qr.forEach(t),Hr.forEach(t),wa=h(en),st=a(en,"SPAN",{});var Yr=i(st);Pa=r(Yr,"GPTBigCodeModel"),Yr.forEach(t),en.forEach(t),Jt=h(o),z=a(o,"DIV",{class:!0});var L=i(z);b(We.$$.fragment,L),Ma=h(L),rt=a(L,"P",{});var Xr=i(rt);$a=r(Xr,"The bare GPT_BIGCODE Model transformer outputting raw hidden-states without any specific head on top."),Xr.forEach(t),Ga=h(L),Je=a(L,"P",{});var on=i(Je);Ba=r(on,"This model inherits from "),yo=a(on,"A",{href:!0});var Kr=i(yo);Ea=r(Kr,"PreTrainedModel"),Kr.forEach(t),za=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),xa=h(L),Le=a(L,"P",{});var tn=i(Le);Ia=r(tn,"This model is also a PyTorch "),Ue=a(tn,"A",{href:!0,rel:!0});var ei=i(Ue);Fa=r(ei,"torch.nn.Module"),ei.forEach(t),qa=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),Aa=h(L),N=a(L,"DIV",{class:!0});var Pe=i(N);b(je.$$.fragment,Pe),Sa=h(Pe),K=a(Pe,"P",{});var xo=i(K);Na=r(xo,"The "),To=a(xo,"A",{href:!0});var oi=i(To);Oa=r(oi,"GPTBigCodeModel"),oi.forEach(t),Wa=r(xo," forward method, overrides the "),it=a(xo,"CODE",{});var ti=i(it);Ja=r(ti,"__call__"),ti.forEach(t),La=r(xo," special method."),xo.forEach(t),Ua=h(Pe),b(fe.$$.fragment,Pe),ja=h(Pe),b(ge.$$.fragment,Pe),Pe.forEach(t),L.forEach(t),Lt=h(o),ee=a(o,"H2",{class:!0});var nn=i(ee);_e=a(nn,"A",{id:!0,class:!0,href:!0});var ni=i(_e);dt=a(ni,"SPAN",{});var ai=i(dt);b(De.$$.fragment,ai),ai.forEach(t),ni.forEach(t),Da=h(nn),lt=a(nn,"SPAN",{});var si=i(lt);Za=r(si,"GPTBigCodeForCausalLM"),si.forEach(t),nn.forEach(t),Ut=h(o),x=a(o,"DIV",{class:!0});var U=i(x);b(Ze.$$.fragment,U),Ra=h(U),ct=a(U,"P",{});var ri=i(ct);Va=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),Ha=h(U),Re=a(U,"P",{});var an=i(Re);Qa=r(an,"This model inherits from "),bo=a(an,"A",{href:!0});var ii=i(bo);Ya=r(ii,"PreTrainedModel"),ii.forEach(t),Xa=r(an,`. 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.)`),an.forEach(t),Ka=h(U),Ve=a(U,"P",{});var sn=i(Ve);es=r(sn,"This model is also a PyTorch "),He=a(sn,"A",{href:!0,rel:!0});var di=i(He);os=r(di,"torch.nn.Module"),di.forEach(t),ts=r(sn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),sn.forEach(t),ns=h(U),O=a(U,"DIV",{class:!0});var Me=i(O);b(Qe.$$.fragment,Me),as=h(Me),oe=a(Me,"P",{});var Io=i(oe);ss=r(Io,"The "),ko=a(Io,"A",{href:!0});var li=i(ko);rs=r(li,"GPTBigCodeForCausalLM"),li.forEach(t),is=r(Io," forward method, overrides the "),ht=a(Io,"CODE",{});var ci=i(ht);ds=r(ci,"__call__"),ci.forEach(t),ls=r(Io," special method."),Io.forEach(t),cs=h(Me),b(ve.$$.fragment,Me),hs=h(Me),b(ye.$$.fragment,Me),Me.forEach(t),U.forEach(t),jt=h(o),te=a(o,"H2",{class:!0});var rn=i(te);Te=a(rn,"A",{id:!0,class:!0,href:!0});var hi=i(Te);pt=a(hi,"SPAN",{});var pi=i(pt);b(Ye.$$.fragment,pi),pi.forEach(t),hi.forEach(t),ps=h(rn),ut=a(rn,"SPAN",{});var ui=i(ut);us=r(ui,"GPTBigCodeForSequenceClassification"),ui.forEach(t),rn.forEach(t),Dt=h(o),G=a(o,"DIV",{class:!0});var F=i(G);b(Xe.$$.fragment,F),ms=h(F),mt=a(F,"P",{});var mi=i(mt);fs=r(mi,"The GPTBigCode Model transformer with a sequence classification head on top (linear layer)."),mi.forEach(t),gs=h(F),Co=a(F,"P",{});var ur=i(Co);wo=a(ur,"A",{href:!0});var fi=i(wo);_s=r(fi,"GPTBigCodeForSequenceClassification"),fi.forEach(t),vs=r(ur,` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1) do.`),ur.forEach(t),ys=h(F),A=a(F,"P",{});var j=i(A);Ts=r(j,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),ft=a(j,"CODE",{});var gi=i(ft);bs=r(gi,"pad_token_id"),gi.forEach(t),ks=r(j,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),gt=a(j,"CODE",{});var _i=i(gt);Cs=r(_i,"pad_token_id"),_i.forEach(t),ws=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=a(j,"CODE",{});var vi=i(_t);Ps=r(vi,"inputs_embeds"),vi.forEach(t),Ms=r(j," are passed instead of "),vt=a(j,"CODE",{});var yi=i(vt);$s=r(yi,"input_ids"),yi.forEach(t),Gs=r(j,`, it does the same (take the last value in
each row of the batch).`),j.forEach(t),Bs=h(F),Ke=a(F,"P",{});var dn=i(Ke);Es=r(dn,"This model inherits from "),Po=a(dn,"A",{href:!0});var Ti=i(Po);zs=r(Ti,"PreTrainedModel"),Ti.forEach(t),xs=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),Is=h(F),eo=a(F,"P",{});var ln=i(eo);Fs=r(ln,"This model is also a PyTorch "),oo=a(ln,"A",{href:!0,rel:!0});var bi=i(oo);qs=r(bi,"torch.nn.Module"),bi.forEach(t),As=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),Ss=h(F),W=a(F,"DIV",{class:!0});var Fo=i(W);b(to.$$.fragment,Fo),Ns=h(Fo),ne=a(Fo,"P",{});var qo=i(ne);Os=r(qo,"The "),Mo=a(qo,"A",{href:!0});var ki=i(Mo);Ws=r(ki,"GPTBigCodeForSequenceClassification"),ki.forEach(t),Js=r(qo," forward method, overrides the "),yt=a(qo,"CODE",{});var Ci=i(yt);Ls=r(Ci,"__call__"),Ci.forEach(t),Us=r(qo," special method."),qo.forEach(t),js=h(Fo),b(be.$$.fragment,Fo),Fo.forEach(t),F.forEach(t),Zt=h(o),ae=a(o,"H2",{class:!0});var cn=i(ae);ke=a(cn,"A",{id:!0,class:!0,href:!0});var wi=i(ke);Tt=a(wi,"SPAN",{});var Pi=i(Tt);b(no.$$.fragment,Pi),Pi.forEach(t),wi.forEach(t),Ds=h(cn),bt=a(cn,"SPAN",{});var Mi=i(bt);Zs=r(Mi,"GPTBigCodeForTokenClassification"),Mi.forEach(t),cn.forEach(t),Rt=h(o),I=a(o,"DIV",{class:!0});var D=i(I);b(ao.$$.fragment,D),Rs=h(D),kt=a(D,"P",{});var $i=i(kt);Vs=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),Hs=h(D),so=a(D,"P",{});var hn=i(so);Qs=r(hn,"This model inherits from "),$o=a(hn,"A",{href:!0});var Gi=i($o);Ys=r(Gi,"PreTrainedModel"),Gi.forEach(t),Xs=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),Ks=h(D),ro=a(D,"P",{});var pn=i(ro);er=r(pn,"This model is also a PyTorch "),io=a(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=a(D,"DIV",{class:!0});var Ao=i(J);b(lo.$$.fragment,Ao),ar=h(Ao),se=a(Ao,"P",{});var So=i(se);sr=r(So,"The "),Go=a(So,"A",{href:!0});var Ei=i(Go);rr=r(Ei,"GPTBigCodeForTokenClassification"),Ei.forEach(t),ir=r(So," forward method, overrides the "),Ct=a(So,"CODE",{});var zi=i(Ct);dr=r(zi,"__call__"),zi.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(ze,"href","https://huggingface.co/docs/transformers/model_doc/gpt2"),l(ze,"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/main/en/model_doc/gpt_bigcode#transformers.GPTBigCodeModel"),l(Ne,"href","https://huggingface.co/gpt_bigcode"),l(Ne,"rel","nofollow"),l(_o,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(vo,"href","/docs/transformers/main/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(me,"id","transformers.GPTBigCodeModel"),l(me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(me,"href","#transformers.GPTBigCodeModel"),l(X,"class","relative group"),l(yo,"href","/docs/transformers/main/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/main/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(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(_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/main/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/main/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(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(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/main/en/model_doc/gpt_bigcode#transformers.GPTBigCodeForSequenceClassification"),l(Po,"href","/docs/transformers/main/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/main/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(ae,"class","relative group"),l($o,"href","/docs/transformers/main/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/main/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),f(o,y,u),f(o,g,u),e(g,_),e(_,v),k(d,v,null),e(g,m),e(g,B),e(B,mn),f(o,Bt,u),f(o,Z,u),e(Z,de),e(de,No),k(Ge,No,null),e(Z,fn),e(Z,Oo),e(Oo,gn),f(o,Et,u),f(o,le,u),e(le,_n),e(le,Be),e(Be,vn),e(le,yn),f(o,zt,u),f(o,po,u),e(po,Tn),f(o,xt,u),f(o,uo,u),e(uo,mo),e(mo,bn),e(mo,Ee),e(Ee,kn),f(o,It,u),f(o,ce,u),e(ce,Cn),e(ce,ze),e(ze,wn),e(ce,Pn),f(o,Ft,u),f(o,R,u),e(R,he),e(he,Wo),k(xe,Wo,null),e(R,Mn),e(R,Jo),e(Jo,$n),f(o,qt,u),f(o,fo,u),e(fo,Gn),f(o,At,u),f(o,M,u),e(M,Lo),e(Lo,Bn),e(M,En),e(M,V),e(V,zn),e(V,Uo),e(Uo,xn),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,ea),e(M,oa),e(M,et),e(et,ta),e(M,na),e(M,Ie),e(Ie,aa),e(Ie,ot),e(ot,sa),e(Ie,ra),f(o,St,u),f(o,Fe,u),e(Fe,ia),e(Fe,qe),e(qe,da),f(o,Nt,u),f(o,H,u),e(H,pe),e(pe,tt),k(Ae,tt,null),e(H,la),e(H,nt),e(nt,ca),f(o,Ot,u),f(o,q,u),k(Se,q,null),e(q,ha),e(q,Q),e(Q,pa),e(Q,go),e(go,ua),e(Q,ma),e(Q,Ne),e(Ne,fa),e(Q,ga),e(q,_a),e(q,Y),e(Y,va),e(Y,_o),e(_o,ya),e(Y,Ta),e(Y,vo),e(vo,ba),e(Y,ka),e(q,Ca),k(ue,q,null),f(o,Wt,u),f(o,X,u),e(X,me),e(me,at),k(Oe,at,null),e(X,wa),e(X,st),e(st,Pa),f(o,Jt,u),f(o,z,u),k(We,z,null),e(z,Ma),e(z,rt),e(rt,$a),e(z,Ga),e(z,Je),e(Je,Ba),e(Je,yo),e(yo,Ea),e(Je,za),e(z,xa),e(z,Le),e(Le,Ia),e(Le,Ue),e(Ue,Fa),e(Le,qa),e(z,Aa),e(z,N),k(je,N,null),e(N,Sa),e(N,K),e(K,Na),e(K,To),e(To,Oa),e(K,Wa),e(K,it),e(it,Ja),e(K,La),e(N,Ua),k(fe,N,null),e(N,ja),k(ge,N,null),f(o,Lt,u),f(o,ee,u),e(ee,_e),e(_e,dt),k(De,dt,null),e(ee,Da),e(ee,lt),e(lt,Za),f(o,Ut,u),f(o,x,u),k(Ze,x,null),e(x,Ra),e(x,ct),e(ct,Va),e(x,Ha),e(x,Re),e(Re,Qa),e(Re,bo),e(bo,Ya),e(Re,Xa),e(x,Ka),e(x,Ve),e(Ve,es),e(Ve,He),e(He,os),e(Ve,ts),e(x,ns),e(x,O),k(Qe,O,null),e(O,as),e(O,oe),e(oe,ss),e(oe,ko),e(ko,rs),e(oe,is),e(oe,ht),e(ht,ds),e(oe,ls),e(O,cs),k(ve,O,null),e(O,hs),k(ye,O,null),f(o,jt,u),f(o,te,u),e(te,Te),e(Te,pt),k(Ye,pt,null),e(te,ps),e(te,ut),e(ut,us),f(o,Dt,u),f(o,G,u),k(Xe,G,null),e(G,ms),e(G,mt),e(mt,fs),e(G,gs),e(G,Co),e(Co,wo),e(wo,_s),e(Co,vs),e(G,ys),e(G,A),e(A,Ts),e(A,ft),e(ft,bs),e(A,ks),e(A,gt),e(gt,Cs),e(A,ws),e(A,_t),e(_t,Ps),e(A,Ms),e(A,vt),e(vt,$s),e(A,Gs),e(G,Bs),e(G,Ke),e(Ke,Es),e(Ke,Po),e(Po,zs),e(Ke,xs),e(G,Is),e(G,eo),e(eo,Fs),e(eo,oo),e(oo,qs),e(eo,As),e(G,Ss),e(G,W),k(to,W,null),e(W,Ns),e(W,ne),e(ne,Os),e(ne,Mo),e(Mo,Ws),e(ne,Js),e(ne,yt),e(yt,Ls),e(ne,Us),e(W,js),k(be,W,null),f(o,Zt,u),f(o,ae,u),e(ae,ke),e(ke,Tt),k(no,Tt,null),e(ae,Ds),e(ae,bt),e(bt,Zs),f(o,Rt,u),f(o,I,u),k(ao,I,null),e(I,Rs),e(I,kt),e(kt,Vs),e(I,Hs),e(I,so),e(so,Qs),e(so,$o),e($o,Ys),e(so,Xs),e(I,Ks),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,ar),e(J,se),e(se,sr),e(se,Go),e(Go,rr),e(se,ir),e(se,Ct),e(Ct,dr),e(se,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}),fe.$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(xe.$$.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(fe.$$.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(ao.$$.fragment,o),C(lo.$$.fragment,o),C(Ce.$$.fragment,o),Vt=!0)},o(o){w(d.$$.fragment,o),w(Ge.$$.fragment,o),w(xe.$$.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(fe.$$.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(ao.$$.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(zt),o&&t(po),o&&t(xt),o&&t(uo),o&&t(It),o&&t(ce),o&&t(Ft),o&&t(R),P(xe),o&&t(qt),o&&t(fo),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(z),P(We),P(je),P(fe),P(ge),o&&t(Lt),o&&t(ee),P(De),o&&t(Ut),o&&t(x),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(ae),P(no),o&&t(Rt),o&&t(I),P(ao),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 xi{constructor(p){super();Ii(this,p,Zi,ji,Fi,{})}}export{Ki as default,Di as metadata};
