import{S as gs,i as _s,s as Ts,e as n,k as u,w as b,t as l,M as vs,c as s,d as o,m as f,a as r,x as k,h as d,b as h,G as t,g as _,y as w,q as y,o as $,B as P,v as bs,L as ao}from"../../chunks/vendor-hf-doc-builder.js";import{T as no}from"../../chunks/Tip-hf-doc-builder.js";import{D as tt}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ot}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ie}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as so}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function ks(X){let i,T;return i=new ot({props:{code:`from transformers import GPTNeoXConfig, GPTNeoXModel

# Initializing a GPTNeoX gpt-neox-20b style configuration
configuration = GPTNeoXConfig()

# Initializing a model (with random weights) from the gpt-neox-20b style configuration
model = GPTNeoXModel(configuration)
# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPTNeoXConfig, GPTNeoXModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a GPTNeoX gpt-neox-20b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = GPTNeoXConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the gpt-neox-20b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoXModel(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(){b(i.$$.fragment)},l(c){k(i.$$.fragment,c)},m(c,m){w(i,c,m),T=!0},p:ao,i(c){T||(y(i.$$.fragment,c),T=!0)},o(c){$(i.$$.fragment,c),T=!1},d(c){P(i,c)}}}function ws(X){let i,T,c,m,v;return m=new ot({props:{code:`from transformers import GPTNeoXTokenizerFast
tokenizer = GPTNeoXTokenizerFast.from_pretrained("gpt2")
tokenizer("Hello world")['input_ids']
tokenizer(" Hello world")['input_ids']`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python"><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPTNeoXTokenizerFast</span>
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">tokenizer = GPTNeoXTokenizerFast.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)</span>
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">tokenizer(<span class="hljs-string">&quot;Hello world&quot;</span>)[<span class="hljs-string">&#x27;input_ids&#x27;</span>]</span>
[15496, 995]
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">tokenizer(<span class="hljs-string">&quot; Hello world&quot;</span>)[<span class="hljs-string">&#x27;input_ids&#x27;</span>]</span>
[18435, 995]`}}),{c(){i=n("p"),T=l("be encoded differently whether it is at the beginning of the sentence (without space) or not:"),c=u(),b(m.$$.fragment)},l(a){i=s(a,"P",{});var g=r(i);T=d(g,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),g.forEach(o),c=f(a),k(m.$$.fragment,a)},m(a,g){_(a,i,g),t(i,T),_(a,c,g),w(m,a,g),v=!0},p:ao,i(a){v||(y(m.$$.fragment,a),v=!0)},o(a){$(m.$$.fragment,a),v=!1},d(a){a&&o(i),a&&o(c),P(m,a)}}}function ys(X){let i,T,c,m,v,a,g,G;return{c(){i=n("p"),T=l("When used with "),c=n("code"),m=l("is_split_into_words=True"),v=l(", this tokenizer needs to be instantiated with "),a=n("code"),g=l("add_prefix_space=True"),G=l(".")},l(z){i=s(z,"P",{});var N=r(i);T=d(N,"When used with "),c=s(N,"CODE",{});var M=r(c);m=d(M,"is_split_into_words=True"),M.forEach(o),v=d(N,", this tokenizer needs to be instantiated with "),a=s(N,"CODE",{});var E=r(a);g=d(E,"add_prefix_space=True"),E.forEach(o),G=d(N,"."),N.forEach(o)},m(z,N){_(z,i,N),t(i,T),t(i,c),t(c,m),t(i,v),t(i,a),t(a,g),t(i,G)},d(z){z&&o(i)}}}function $s(X){let i,T,c,m,v;return{c(){i=n("p"),T=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=n("code"),m=l("Module"),v=l(`
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(a){i=s(a,"P",{});var g=r(i);T=d(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=s(g,"CODE",{});var G=r(c);m=d(G,"Module"),G.forEach(o),v=d(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(a,g){_(a,i,g),t(i,T),t(i,c),t(c,m),t(i,v)},d(a){a&&o(i)}}}function Ps(X){let i,T,c,m,v,a,g,G;return{c(){i=n("p"),T=l(`This example uses a random model as the real ones are all very big. To get proper results, you should use
EleutherAI/gpt-neox-20b instead of trl-internal-testing/tiny-random-GPTNeoXForCausalLM. If you get out-of-memory when loading that checkpoint, you can try
adding `),c=n("code"),m=l('device_map="auto"'),v=l(" in the "),a=n("code"),g=l("from_pretrained"),G=l(" call.")},l(z){i=s(z,"P",{});var N=r(i);T=d(N,`This example uses a random model as the real ones are all very big. To get proper results, you should use
EleutherAI/gpt-neox-20b instead of trl-internal-testing/tiny-random-GPTNeoXForCausalLM. If you get out-of-memory when loading that checkpoint, you can try
adding `),c=s(N,"CODE",{});var M=r(c);m=d(M,'device_map="auto"'),M.forEach(o),v=d(N," in the "),a=s(N,"CODE",{});var E=r(a);g=d(E,"from_pretrained"),E.forEach(o),G=d(N," call."),N.forEach(o)},m(z,N){_(z,i,N),t(i,T),t(i,c),t(c,m),t(i,v),t(i,a),t(a,g),t(i,G)},d(z){z&&o(i)}}}function Ns(X){let i,T,c,m,v;return m=new ot({props:{code:`from transformers import AutoTokenizer, GPTNeoXModel
import torch

tokenizer = AutoTokenizer.from_pretrained("trl-internal-testing/tiny-random-GPTNeoXForCausalLM")
model = GPTNeoXModel.from_pretrained("trl-internal-testing/tiny-random-GPTNeoXForCausalLM")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GPTNeoXModel
<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;trl-internal-testing/tiny-random-GPTNeoXForCausalLM&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoXModel.from_pretrained(<span class="hljs-string">&quot;trl-internal-testing/tiny-random-GPTNeoXForCausalLM&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(){i=n("p"),T=l("Example:"),c=u(),b(m.$$.fragment)},l(a){i=s(a,"P",{});var g=r(i);T=d(g,"Example:"),g.forEach(o),c=f(a),k(m.$$.fragment,a)},m(a,g){_(a,i,g),t(i,T),_(a,c,g),w(m,a,g),v=!0},p:ao,i(a){v||(y(m.$$.fragment,a),v=!0)},o(a){$(m.$$.fragment,a),v=!1},d(a){a&&o(i),a&&o(c),P(m,a)}}}function Gs(X){let i,T,c,m,v;return{c(){i=n("p"),T=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=n("code"),m=l("Module"),v=l(`
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(a){i=s(a,"P",{});var g=r(i);T=d(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=s(g,"CODE",{});var G=r(c);m=d(G,"Module"),G.forEach(o),v=d(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(a,g){_(a,i,g),t(i,T),t(i,c),t(c,m),t(i,v)},d(a){a&&o(i)}}}function xs(X){let i,T,c,m,v;return m=new ot({props:{code:`from transformers import AutoTokenizer, GPTNeoXForCausalLM, GPTNeoXConfig
import torch

tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neox-20b")
config = GPTNeoXConfig.from_pretrained("EleutherAI/gpt-neox-20b")
config.is_decoder = True
model = GPTNeoXForCausalLM.from_pretrained("EleutherAI/gpt-neox-20b", config=config)

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

prediction_logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GPTNeoXForCausalLM, GPTNeoXConfig
<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;EleutherAI/gpt-neox-20b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config = GPTNeoXConfig.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neox-20b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config.is_decoder = <span class="hljs-literal">True</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoXForCausalLM.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neox-20b&quot;</span>, config=config)

<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>prediction_logits = outputs.logits`}}),{c(){i=n("p"),T=l("Example:"),c=u(),b(m.$$.fragment)},l(a){i=s(a,"P",{});var g=r(i);T=d(g,"Example:"),g.forEach(o),c=f(a),k(m.$$.fragment,a)},m(a,g){_(a,i,g),t(i,T),_(a,c,g),w(m,a,g),v=!0},p:ao,i(a){v||(y(m.$$.fragment,a),v=!0)},o(a){$(m.$$.fragment,a),v=!1},d(a){a&&o(i),a&&o(c),P(m,a)}}}function Xs(X){let i,T,c,m,v,a,g,G,z,N,M,E,nt,ue,ro,st,io,xt,Y,lo,fe,co,po,Xt,K,ho,ge,mo,uo,zt,Oe,fo,Mt,_e,Et,De,go,Ct,O,Q,at,Te,_o,rt,To,Ft,Z,vo,it,bo,ko,qt,ve,jt,D,ee,lt,be,wo,dt,yo,At,q,ke,$o,B,Po,Be,No,Go,we,xo,Xo,zo,S,Mo,Se,Eo,Co,We,Fo,qo,jo,te,Lt,W,oe,ct,ye,Ao,pt,Lo,It,x,$e,Io,Pe,Oo,ht,Do,Bo,So,mt,Wo,Ho,ne,Uo,Ne,Vo,ut,Jo,Ro,Yo,se,Ko,Ge,Qo,He,Zo,en,Ot,H,ae,ft,xe,tn,gt,on,Dt,A,Xe,nn,ze,sn,Me,an,rn,ln,C,Ee,dn,U,cn,Ue,pn,hn,_t,mn,un,fn,re,gn,ie,_n,le,Bt,V,de,Tt,Ce,Tn,vt,vn,St,L,Fe,bn,J,kn,bt,wn,yn,qe,$n,Pn,Nn,j,je,Gn,R,xn,Ve,Xn,zn,kt,Mn,En,Cn,ce,Fn,pe,Wt;return a=new Ie({}),ue=new Ie({}),_e=new ot({props:{code:'model = GPTNeoXForCausalLM.from_pretrained("EleutherAI/gpt-neox-20b").half().cuda()',highlighted:'model = GPTNeoXForCausalLM.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neox-20b&quot;</span>).half().cuda()'}}),Te=new Ie({}),ve=new ot({props:{code:`from transformers import GPTNeoXForCausalLM, GPTNeoXTokenizerFast

model = GPTNeoXForCausalLM.from_pretrained("EleutherAI/gpt-neox-20b")
tokenizer = GPTNeoXTokenizerFast.from_pretrained("EleutherAI/gpt-neox-20b")

prompt = "GPTNeoX20B is a 20B-parameter autoregressive Transformer model developed by EleutherAI."

input_ids = tokenizer(prompt, return_tensors="pt").input_ids

gen_tokens = model.generate(
    input_ids,
    do_sample=True,
    temperature=0.9,
    max_length=100,
)
gen_text = tokenizer.batch_decode(gen_tokens)[0]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPTNeoXForCausalLM, GPTNeoXTokenizerFast

<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoXForCausalLM.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neox-20b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = GPTNeoXTokenizerFast.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neox-20b&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;GPTNeoX20B is a 20B-parameter autoregressive Transformer model developed by EleutherAI.&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span>gen_tokens = model.generate(
<span class="hljs-meta">... </span>    input_ids,
<span class="hljs-meta">... </span>    do_sample=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    temperature=<span class="hljs-number">0.9</span>,
<span class="hljs-meta">... </span>    max_length=<span class="hljs-number">100</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>gen_text = tokenizer.batch_decode(gen_tokens)[<span class="hljs-number">0</span>]`}}),be=new Ie({}),ke=new tt({props:{name:"class transformers.GPTNeoXConfig",anchor:"transformers.GPTNeoXConfig",parameters:[{name:"vocab_size",val:" = 50432"},{name:"hidden_size",val:" = 6144"},{name:"num_hidden_layers",val:" = 44"},{name:"num_attention_heads",val:" = 64"},{name:"intermediate_size",val:" = 24576"},{name:"hidden_act",val:" = 'gelu'"},{name:"rotary_pct",val:" = 0.25"},{name:"rotary_emb_base",val:" = 10000"},{name:"max_position_embeddings",val:" = 2048"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"use_cache",val:" = True"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"tie_word_embeddings",val:" = False"},{name:"use_parallel_residual",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50432) &#x2014;
Vocabulary size of the GPTNeoX 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_neox#transformers.GPTNeoXModel">GPTNeoXModel</a>.`,name:"vocab_size"},{anchor:"transformers.GPTNeoXConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 6144) &#x2014;
Dimension of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.GPTNeoXConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 44) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.GPTNeoXConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.GPTNeoXConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 24576) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.GPTNeoXConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.GPTNeoXConfig.rotary_pct",description:`<strong>rotary_pct</strong> (<code>float</code>, <em>optional</em>, defaults to 0.25) &#x2014;
percentage of hidden dimensions to allocate to rotary embeddings`,name:"rotary_pct"},{anchor:"transformers.GPTNeoXConfig.rotary_emb_base",description:`<strong>rotary_emb_base</strong> (<code>int</code>, <em>optional</em>, defaults to 10000) &#x2014;
base for computing rotary embeddings frequency`,name:"rotary_emb_base"},{anchor:"transformers.GPTNeoXConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.GPTNeoXConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.GPTNeoXConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.GPTNeoXConfig.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). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.GPTNeoXConfig.use_parallel_residual",description:`<strong>use_parallel_residual</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use a &#x201C;parallel&#x201D; formulation in each Transformer layer, which can provide a slight training
speedup at large scales (e.g. 20B).
Example &#x2014;`,name:"use_parallel_residual"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_neox/configuration_gpt_neox.py#L29"}}),te=new so({props:{anchor:"transformers.GPTNeoXConfig.example",$$slots:{default:[ks]},$$scope:{ctx:X}}}),ye=new Ie({}),$e=new tt({props:{name:"class transformers.GPTNeoXTokenizerFast",anchor:"transformers.GPTNeoXTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"merges_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"unk_token",val:" = '<|endoftext|>'"},{name:"bos_token",val:" = '<|endoftext|>'"},{name:"eos_token",val:" = '<|endoftext|>'"},{name:"add_prefix_space",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.GPTNeoXTokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.GPTNeoXTokenizerFast.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;replace&quot;</code>) &#x2014;
Paradigm to follow when decoding bytes to UTF-8. See
<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.GPTNeoXTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.GPTNeoXTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The beginning of sequence token.`,name:"bos_token"},{anchor:"transformers.GPTNeoXTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.GPTNeoXTokenizerFast.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an initial space to the input. This allows to treat the leading word just as any
other word. (GPTNeoX tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"},{anchor:"transformers.GPTNeoXTokenizerFast.trim_offsets",description:`<strong>trim_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the post-processing step should trim offsets to avoid including whitespaces.`,name:"trim_offsets"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_neox/tokenization_gpt_neox_fast.py#L44"}}),ne=new so({props:{anchor:"transformers.GPTNeoXTokenizerFast.example",$$slots:{default:[ws]},$$scope:{ctx:X}}}),se=new no({props:{$$slots:{default:[ys]},$$scope:{ctx:X}}}),xe=new Ie({}),Xe=new tt({props:{name:"class transformers.GPTNeoXModel",anchor:"transformers.GPTNeoXModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/gpt_neox#transformers.GPTNeoXConfig">~GPTNeoXConfig</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_neox/modeling_gpt_neox.py#L416"}}),Ee=new tt({props:{name:"forward",anchor:"transformers.GPTNeoXModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GPTNeoXModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <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.GPTNeoXModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.GPTNeoXModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.GPTNeoXModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTNeoXModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.GPTNeoXModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.GPTNeoXModel.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.GPTNeoXModel.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.GPTNeoXModel.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.GPTNeoXModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.GPTNeoXModel.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L436",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/gpt_neox#transformers.GPTNeoXConfig"
>GPTNeoXConfig</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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),re=new no({props:{$$slots:{default:[$s]},$$scope:{ctx:X}}}),ie=new no({props:{warning:!0,$$slots:{default:[Ps]},$$scope:{ctx:X}}}),le=new so({props:{anchor:"transformers.GPTNeoXModel.forward.example",$$slots:{default:[Ns]},$$scope:{ctx:X}}}),Ce=new Ie({}),Fe=new tt({props:{name:"class transformers.GPTNeoXForCausalLM",anchor:"transformers.GPTNeoXForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/gpt_neox#transformers.GPTNeoXConfig">~GPTNeoXConfig</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_neox/modeling_gpt_neox.py#L579"}}),je=new tt({props:{name:"forward",anchor:"transformers.GPTNeoXForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GPTNeoXForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <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.GPTNeoXForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.GPTNeoXForCausalLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.GPTNeoXForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTNeoXForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.GPTNeoXForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.GPTNeoXForCausalLM.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.GPTNeoXForCausalLM.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.GPTNeoXForCausalLM.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.GPTNeoXForCausalLM.forward.past_key_values",description:`<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>) &#x2014;
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 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>. The two additional tensors are
only required when the model is used as a decoder in a Sequence to Sequence model.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.GPTNeoXForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the left-to-right language modeling loss (next word prediction). Indices should be in
<code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are
ignored (masked), the loss is only computed for the tokens with labels n <code>[0, ..., config.vocab_size]</code>.`,name:"labels"},{anchor:"transformers.GPTNeoXForCausalLM.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L598",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/gpt_neox#transformers.GPTNeoXConfig"
>GPTNeoXConfig</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>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>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ce=new no({props:{$$slots:{default:[Gs]},$$scope:{ctx:X}}}),pe=new so({props:{anchor:"transformers.GPTNeoXForCausalLM.forward.example",$$slots:{default:[xs]},$$scope:{ctx:X}}}),{c(){i=n("meta"),T=u(),c=n("h1"),m=n("a"),v=n("span"),b(a.$$.fragment),g=u(),G=n("span"),z=l("GPT-NeoX"),N=u(),M=n("h2"),E=n("a"),nt=n("span"),b(ue.$$.fragment),ro=u(),st=n("span"),io=l("Overview"),xt=u(),Y=n("p"),lo=l(`We introduce GPT-NeoX-20B, a 20 billion parameter autoregressive language model trained on the Pile, whose weights will
be made freely and openly available to the public through a permissive license. It is, to the best of our knowledge,
the largest dense autoregressive model that has publicly available weights at the time of submission. In this work,
we describe GPT-NeoX-20B\u2019s architecture and training and evaluate its performance on a range of language-understanding,
mathematics, and knowledge-based tasks. We find that GPT-NeoX-20B is a particularly powerful few-shot reasoner and
gains far more in performance when evaluated five-shot than similarly sized GPT-3 and FairSeq models. We open-source
the training and evaluation code, as well as the model weights, at `),fe=n("a"),co=l("https://github.com/EleutherAI/gpt-neox"),po=l("."),Xt=u(),K=n("p"),ho=l(`Development of the model was led by Sid Black, Stella Biderman and Eric Hallahan, and the model was trained with
generous the support of `),ge=n("a"),mo=l("CoreWeave"),uo=l("."),zt=u(),Oe=n("p"),fo=l("GPT-NeoX-20B was trained with fp16, thus it is recommended to initialize the model as follows:"),Mt=u(),b(_e.$$.fragment),Et=u(),De=n("p"),go=l(`GPT-NeoX-20B also has a different tokenizer from the one used in GPT-J-6B and GPT-Neo. The new tokenizer allocates
additional tokens to whitespace characters, making the model more suitable for certain tasks like code generation.`),Ct=u(),O=n("h3"),Q=n("a"),at=n("span"),b(Te.$$.fragment),_o=u(),rt=n("span"),To=l("Generation"),Ft=u(),Z=n("p"),vo=l("The "),it=n("code"),bo=l("generate()"),ko=l(" method can be used to generate text using GPT Neo model."),qt=u(),b(ve.$$.fragment),jt=u(),D=n("h2"),ee=n("a"),lt=n("span"),b(be.$$.fragment),wo=u(),dt=n("span"),yo=l("GPTNeoXConfig"),At=u(),q=n("div"),b(ke.$$.fragment),$o=u(),B=n("p"),Po=l("This is the configuration class to store the configuration of a "),Be=n("a"),No=l("GPTNeoXModel"),Go=l(`. It is used to instantiate an
GPTNeoX 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 GPTNeoX
`),we=n("a"),xo=l("EleutherAI/gpt-neox-20b"),Xo=l(" architecture."),zo=u(),S=n("p"),Mo=l("Configuration objects inherit from "),Se=n("a"),Eo=l("PretrainedConfig"),Co=l(` and can be used to control the model outputs. Read the
documentation from `),We=n("a"),Fo=l("PretrainedConfig"),qo=l(" for more information."),jo=u(),b(te.$$.fragment),Lt=u(),W=n("h2"),oe=n("a"),ct=n("span"),b(ye.$$.fragment),Ao=u(),pt=n("span"),Lo=l("GPTNeoXTokenizerFast"),It=u(),x=n("div"),b($e.$$.fragment),Io=u(),Pe=n("p"),Oo=l("Construct a \u201Cfast\u201D GPT-NeoX-20B tokenizer (backed by HuggingFace\u2019s "),ht=n("em"),Do=l("tokenizers"),Bo=l(` library). Based on byte-level
Byte-Pair-Encoding.`),So=u(),mt=n("p"),Wo=l("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Ho=u(),b(ne.$$.fragment),Uo=u(),Ne=n("p"),Vo=l("You can get around that behavior by passing "),ut=n("code"),Jo=l("add_prefix_space=True"),Ro=l(` when instantiating this tokenizer, but since
the model was not pretrained this way, it might yield a decrease in performance.`),Yo=u(),b(se.$$.fragment),Ko=u(),Ge=n("p"),Qo=l("This tokenizer inherits from "),He=n("a"),Zo=l("PreTrainedTokenizerFast"),en=l(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Ot=u(),H=n("h2"),ae=n("a"),ft=n("span"),b(xe.$$.fragment),tn=u(),gt=n("span"),on=l("GPTNeoXModel"),Dt=u(),A=n("div"),b(Xe.$$.fragment),nn=u(),ze=n("p"),sn=l(`The bare GPTNeoX Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Me=n("a"),an=l("torch.nn.Module"),rn=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ln=u(),C=n("div"),b(Ee.$$.fragment),dn=u(),U=n("p"),cn=l("The "),Ue=n("a"),pn=l("GPTNeoXModel"),hn=l(" forward method, overrides the "),_t=n("code"),mn=l("__call__"),un=l(" special method."),fn=u(),b(re.$$.fragment),gn=u(),b(ie.$$.fragment),_n=u(),b(le.$$.fragment),Bt=u(),V=n("h2"),de=n("a"),Tt=n("span"),b(Ce.$$.fragment),Tn=u(),vt=n("span"),vn=l("GPTNeoXForCausalLM"),St=u(),L=n("div"),b(Fe.$$.fragment),bn=u(),J=n("p"),kn=l("GPTNeoX Model with a "),bt=n("code"),wn=l("language modeling"),yn=l(` head on top for CLM fine-tuning.
This model is a PyTorch `),qe=n("a"),$n=l("torch.nn.Module"),Pn=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Nn=u(),j=n("div"),b(je.$$.fragment),Gn=u(),R=n("p"),xn=l("The "),Ve=n("a"),Xn=l("GPTNeoXForCausalLM"),zn=l(" forward method, overrides the "),kt=n("code"),Mn=l("__call__"),En=l(" special method."),Cn=u(),b(ce.$$.fragment),Fn=u(),b(pe.$$.fragment),this.h()},l(e){const p=vs('[data-svelte="svelte-1phssyn"]',document.head);i=s(p,"META",{name:!0,content:!0}),p.forEach(o),T=f(e),c=s(e,"H1",{class:!0});var Ae=r(c);m=s(Ae,"A",{id:!0,class:!0,href:!0});var wt=r(m);v=s(wt,"SPAN",{});var yt=r(v);k(a.$$.fragment,yt),yt.forEach(o),wt.forEach(o),g=f(Ae),G=s(Ae,"SPAN",{});var $t=r(G);z=d($t,"GPT-NeoX"),$t.forEach(o),Ae.forEach(o),N=f(e),M=s(e,"H2",{class:!0});var Le=r(M);E=s(Le,"A",{id:!0,class:!0,href:!0});var Pt=r(E);nt=s(Pt,"SPAN",{});var Nt=r(nt);k(ue.$$.fragment,Nt),Nt.forEach(o),Pt.forEach(o),ro=f(Le),st=s(Le,"SPAN",{});var Gt=r(st);io=d(Gt,"Overview"),Gt.forEach(o),Le.forEach(o),xt=f(e),Y=s(e,"P",{});var Ht=r(Y);lo=d(Ht,`We introduce GPT-NeoX-20B, a 20 billion parameter autoregressive language model trained on the Pile, whose weights will
be made freely and openly available to the public through a permissive license. It is, to the best of our knowledge,
the largest dense autoregressive model that has publicly available weights at the time of submission. In this work,
we describe GPT-NeoX-20B\u2019s architecture and training and evaluate its performance on a range of language-understanding,
mathematics, and knowledge-based tasks. We find that GPT-NeoX-20B is a particularly powerful few-shot reasoner and
gains far more in performance when evaluated five-shot than similarly sized GPT-3 and FairSeq models. We open-source
the training and evaluation code, as well as the model weights, at `),fe=s(Ht,"A",{href:!0,rel:!0});var qn=r(fe);co=d(qn,"https://github.com/EleutherAI/gpt-neox"),qn.forEach(o),po=d(Ht,"."),Ht.forEach(o),Xt=f(e),K=s(e,"P",{});var Ut=r(K);ho=d(Ut,`Development of the model was led by Sid Black, Stella Biderman and Eric Hallahan, and the model was trained with
generous the support of `),ge=s(Ut,"A",{href:!0,rel:!0});var jn=r(ge);mo=d(jn,"CoreWeave"),jn.forEach(o),uo=d(Ut,"."),Ut.forEach(o),zt=f(e),Oe=s(e,"P",{});var An=r(Oe);fo=d(An,"GPT-NeoX-20B was trained with fp16, thus it is recommended to initialize the model as follows:"),An.forEach(o),Mt=f(e),k(_e.$$.fragment,e),Et=f(e),De=s(e,"P",{});var Ln=r(De);go=d(Ln,`GPT-NeoX-20B also has a different tokenizer from the one used in GPT-J-6B and GPT-Neo. The new tokenizer allocates
additional tokens to whitespace characters, making the model more suitable for certain tasks like code generation.`),Ln.forEach(o),Ct=f(e),O=s(e,"H3",{class:!0});var Vt=r(O);Q=s(Vt,"A",{id:!0,class:!0,href:!0});var In=r(Q);at=s(In,"SPAN",{});var On=r(at);k(Te.$$.fragment,On),On.forEach(o),In.forEach(o),_o=f(Vt),rt=s(Vt,"SPAN",{});var Dn=r(rt);To=d(Dn,"Generation"),Dn.forEach(o),Vt.forEach(o),Ft=f(e),Z=s(e,"P",{});var Jt=r(Z);vo=d(Jt,"The "),it=s(Jt,"CODE",{});var Bn=r(it);bo=d(Bn,"generate()"),Bn.forEach(o),ko=d(Jt," method can be used to generate text using GPT Neo model."),Jt.forEach(o),qt=f(e),k(ve.$$.fragment,e),jt=f(e),D=s(e,"H2",{class:!0});var Rt=r(D);ee=s(Rt,"A",{id:!0,class:!0,href:!0});var Sn=r(ee);lt=s(Sn,"SPAN",{});var Wn=r(lt);k(be.$$.fragment,Wn),Wn.forEach(o),Sn.forEach(o),wo=f(Rt),dt=s(Rt,"SPAN",{});var Hn=r(dt);yo=d(Hn,"GPTNeoXConfig"),Hn.forEach(o),Rt.forEach(o),At=f(e),q=s(e,"DIV",{class:!0});var he=r(q);k(ke.$$.fragment,he),$o=f(he),B=s(he,"P",{});var Je=r(B);Po=d(Je,"This is the configuration class to store the configuration of a "),Be=s(Je,"A",{href:!0});var Un=r(Be);No=d(Un,"GPTNeoXModel"),Un.forEach(o),Go=d(Je,`. It is used to instantiate an
GPTNeoX 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 GPTNeoX
`),we=s(Je,"A",{href:!0,rel:!0});var Vn=r(we);xo=d(Vn,"EleutherAI/gpt-neox-20b"),Vn.forEach(o),Xo=d(Je," architecture."),Je.forEach(o),zo=f(he),S=s(he,"P",{});var Re=r(S);Mo=d(Re,"Configuration objects inherit from "),Se=s(Re,"A",{href:!0});var Jn=r(Se);Eo=d(Jn,"PretrainedConfig"),Jn.forEach(o),Co=d(Re,` and can be used to control the model outputs. Read the
documentation from `),We=s(Re,"A",{href:!0});var Rn=r(We);Fo=d(Rn,"PretrainedConfig"),Rn.forEach(o),qo=d(Re," for more information."),Re.forEach(o),jo=f(he),k(te.$$.fragment,he),he.forEach(o),Lt=f(e),W=s(e,"H2",{class:!0});var Yt=r(W);oe=s(Yt,"A",{id:!0,class:!0,href:!0});var Yn=r(oe);ct=s(Yn,"SPAN",{});var Kn=r(ct);k(ye.$$.fragment,Kn),Kn.forEach(o),Yn.forEach(o),Ao=f(Yt),pt=s(Yt,"SPAN",{});var Qn=r(pt);Lo=d(Qn,"GPTNeoXTokenizerFast"),Qn.forEach(o),Yt.forEach(o),It=f(e),x=s(e,"DIV",{class:!0});var F=r(x);k($e.$$.fragment,F),Io=f(F),Pe=s(F,"P",{});var Kt=r(Pe);Oo=d(Kt,"Construct a \u201Cfast\u201D GPT-NeoX-20B tokenizer (backed by HuggingFace\u2019s "),ht=s(Kt,"EM",{});var Zn=r(ht);Do=d(Zn,"tokenizers"),Zn.forEach(o),Bo=d(Kt,` library). Based on byte-level
Byte-Pair-Encoding.`),Kt.forEach(o),So=f(F),mt=s(F,"P",{});var es=r(mt);Wo=d(es,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),es.forEach(o),Ho=f(F),k(ne.$$.fragment,F),Uo=f(F),Ne=s(F,"P",{});var Qt=r(Ne);Vo=d(Qt,"You can get around that behavior by passing "),ut=s(Qt,"CODE",{});var ts=r(ut);Jo=d(ts,"add_prefix_space=True"),ts.forEach(o),Ro=d(Qt,` when instantiating this tokenizer, but since
the model was not pretrained this way, it might yield a decrease in performance.`),Qt.forEach(o),Yo=f(F),k(se.$$.fragment,F),Ko=f(F),Ge=s(F,"P",{});var Zt=r(Ge);Qo=d(Zt,"This tokenizer inherits from "),He=s(Zt,"A",{href:!0});var os=r(He);Zo=d(os,"PreTrainedTokenizerFast"),os.forEach(o),en=d(Zt,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Zt.forEach(o),F.forEach(o),Ot=f(e),H=s(e,"H2",{class:!0});var eo=r(H);ae=s(eo,"A",{id:!0,class:!0,href:!0});var ns=r(ae);ft=s(ns,"SPAN",{});var ss=r(ft);k(xe.$$.fragment,ss),ss.forEach(o),ns.forEach(o),tn=f(eo),gt=s(eo,"SPAN",{});var as=r(gt);on=d(as,"GPTNeoXModel"),as.forEach(o),eo.forEach(o),Dt=f(e),A=s(e,"DIV",{class:!0});var Ye=r(A);k(Xe.$$.fragment,Ye),nn=f(Ye),ze=s(Ye,"P",{});var to=r(ze);sn=d(to,`The bare GPTNeoX Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Me=s(to,"A",{href:!0,rel:!0});var rs=r(Me);an=d(rs,"torch.nn.Module"),rs.forEach(o),rn=d(to,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),to.forEach(o),ln=f(Ye),C=s(Ye,"DIV",{class:!0});var I=r(C);k(Ee.$$.fragment,I),dn=f(I),U=s(I,"P",{});var Ke=r(U);cn=d(Ke,"The "),Ue=s(Ke,"A",{href:!0});var is=r(Ue);pn=d(is,"GPTNeoXModel"),is.forEach(o),hn=d(Ke," forward method, overrides the "),_t=s(Ke,"CODE",{});var ls=r(_t);mn=d(ls,"__call__"),ls.forEach(o),un=d(Ke," special method."),Ke.forEach(o),fn=f(I),k(re.$$.fragment,I),gn=f(I),k(ie.$$.fragment,I),_n=f(I),k(le.$$.fragment,I),I.forEach(o),Ye.forEach(o),Bt=f(e),V=s(e,"H2",{class:!0});var oo=r(V);de=s(oo,"A",{id:!0,class:!0,href:!0});var ds=r(de);Tt=s(ds,"SPAN",{});var cs=r(Tt);k(Ce.$$.fragment,cs),cs.forEach(o),ds.forEach(o),Tn=f(oo),vt=s(oo,"SPAN",{});var ps=r(vt);vn=d(ps,"GPTNeoXForCausalLM"),ps.forEach(o),oo.forEach(o),St=f(e),L=s(e,"DIV",{class:!0});var Qe=r(L);k(Fe.$$.fragment,Qe),bn=f(Qe),J=s(Qe,"P",{});var Ze=r(J);kn=d(Ze,"GPTNeoX Model with a "),bt=s(Ze,"CODE",{});var hs=r(bt);wn=d(hs,"language modeling"),hs.forEach(o),yn=d(Ze,` head on top for CLM fine-tuning.
This model is a PyTorch `),qe=s(Ze,"A",{href:!0,rel:!0});var ms=r(qe);$n=d(ms,"torch.nn.Module"),ms.forEach(o),Pn=d(Ze,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ze.forEach(o),Nn=f(Qe),j=s(Qe,"DIV",{class:!0});var me=r(j);k(je.$$.fragment,me),Gn=f(me),R=s(me,"P",{});var et=r(R);xn=d(et,"The "),Ve=s(et,"A",{href:!0});var us=r(Ve);Xn=d(us,"GPTNeoXForCausalLM"),us.forEach(o),zn=d(et," forward method, overrides the "),kt=s(et,"CODE",{});var fs=r(kt);Mn=d(fs,"__call__"),fs.forEach(o),En=d(et," special method."),et.forEach(o),Cn=f(me),k(ce.$$.fragment,me),Fn=f(me),k(pe.$$.fragment,me),me.forEach(o),Qe.forEach(o),this.h()},h(){h(i,"name","hf:doc:metadata"),h(i,"content",JSON.stringify(zs)),h(m,"id","gptneox"),h(m,"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"),h(m,"href","#gptneox"),h(c,"class","relative group"),h(E,"id","overview"),h(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"),h(E,"href","#overview"),h(M,"class","relative group"),h(fe,"href","https://github.com/EleutherAI/gpt-neox"),h(fe,"rel","nofollow"),h(ge,"href","https://www.coreweave.com/"),h(ge,"rel","nofollow"),h(Q,"id","generation"),h(Q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Q,"href","#generation"),h(O,"class","relative group"),h(ee,"id","transformers.GPTNeoXConfig"),h(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ee,"href","#transformers.GPTNeoXConfig"),h(D,"class","relative group"),h(Be,"href","/docs/transformers/main/en/model_doc/gpt_neox#transformers.GPTNeoXModel"),h(we,"href","https://huggingface.co/EleutherAI/gpt-neox-20b"),h(we,"rel","nofollow"),h(Se,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),h(We,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),h(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(oe,"id","transformers.GPTNeoXTokenizerFast"),h(oe,"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"),h(oe,"href","#transformers.GPTNeoXTokenizerFast"),h(W,"class","relative group"),h(He,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),h(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ae,"id","transformers.GPTNeoXModel"),h(ae,"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"),h(ae,"href","#transformers.GPTNeoXModel"),h(H,"class","relative group"),h(Me,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Me,"rel","nofollow"),h(Ue,"href","/docs/transformers/main/en/model_doc/gpt_neox#transformers.GPTNeoXModel"),h(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(de,"id","transformers.GPTNeoXForCausalLM"),h(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"),h(de,"href","#transformers.GPTNeoXForCausalLM"),h(V,"class","relative group"),h(qe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(qe,"rel","nofollow"),h(Ve,"href","/docs/transformers/main/en/model_doc/gpt_neox#transformers.GPTNeoXForCausalLM"),h(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,p){t(document.head,i),_(e,T,p),_(e,c,p),t(c,m),t(m,v),w(a,v,null),t(c,g),t(c,G),t(G,z),_(e,N,p),_(e,M,p),t(M,E),t(E,nt),w(ue,nt,null),t(M,ro),t(M,st),t(st,io),_(e,xt,p),_(e,Y,p),t(Y,lo),t(Y,fe),t(fe,co),t(Y,po),_(e,Xt,p),_(e,K,p),t(K,ho),t(K,ge),t(ge,mo),t(K,uo),_(e,zt,p),_(e,Oe,p),t(Oe,fo),_(e,Mt,p),w(_e,e,p),_(e,Et,p),_(e,De,p),t(De,go),_(e,Ct,p),_(e,O,p),t(O,Q),t(Q,at),w(Te,at,null),t(O,_o),t(O,rt),t(rt,To),_(e,Ft,p),_(e,Z,p),t(Z,vo),t(Z,it),t(it,bo),t(Z,ko),_(e,qt,p),w(ve,e,p),_(e,jt,p),_(e,D,p),t(D,ee),t(ee,lt),w(be,lt,null),t(D,wo),t(D,dt),t(dt,yo),_(e,At,p),_(e,q,p),w(ke,q,null),t(q,$o),t(q,B),t(B,Po),t(B,Be),t(Be,No),t(B,Go),t(B,we),t(we,xo),t(B,Xo),t(q,zo),t(q,S),t(S,Mo),t(S,Se),t(Se,Eo),t(S,Co),t(S,We),t(We,Fo),t(S,qo),t(q,jo),w(te,q,null),_(e,Lt,p),_(e,W,p),t(W,oe),t(oe,ct),w(ye,ct,null),t(W,Ao),t(W,pt),t(pt,Lo),_(e,It,p),_(e,x,p),w($e,x,null),t(x,Io),t(x,Pe),t(Pe,Oo),t(Pe,ht),t(ht,Do),t(Pe,Bo),t(x,So),t(x,mt),t(mt,Wo),t(x,Ho),w(ne,x,null),t(x,Uo),t(x,Ne),t(Ne,Vo),t(Ne,ut),t(ut,Jo),t(Ne,Ro),t(x,Yo),w(se,x,null),t(x,Ko),t(x,Ge),t(Ge,Qo),t(Ge,He),t(He,Zo),t(Ge,en),_(e,Ot,p),_(e,H,p),t(H,ae),t(ae,ft),w(xe,ft,null),t(H,tn),t(H,gt),t(gt,on),_(e,Dt,p),_(e,A,p),w(Xe,A,null),t(A,nn),t(A,ze),t(ze,sn),t(ze,Me),t(Me,an),t(ze,rn),t(A,ln),t(A,C),w(Ee,C,null),t(C,dn),t(C,U),t(U,cn),t(U,Ue),t(Ue,pn),t(U,hn),t(U,_t),t(_t,mn),t(U,un),t(C,fn),w(re,C,null),t(C,gn),w(ie,C,null),t(C,_n),w(le,C,null),_(e,Bt,p),_(e,V,p),t(V,de),t(de,Tt),w(Ce,Tt,null),t(V,Tn),t(V,vt),t(vt,vn),_(e,St,p),_(e,L,p),w(Fe,L,null),t(L,bn),t(L,J),t(J,kn),t(J,bt),t(bt,wn),t(J,yn),t(J,qe),t(qe,$n),t(J,Pn),t(L,Nn),t(L,j),w(je,j,null),t(j,Gn),t(j,R),t(R,xn),t(R,Ve),t(Ve,Xn),t(R,zn),t(R,kt),t(kt,Mn),t(R,En),t(j,Cn),w(ce,j,null),t(j,Fn),w(pe,j,null),Wt=!0},p(e,[p]){const Ae={};p&2&&(Ae.$$scope={dirty:p,ctx:e}),te.$set(Ae);const wt={};p&2&&(wt.$$scope={dirty:p,ctx:e}),ne.$set(wt);const yt={};p&2&&(yt.$$scope={dirty:p,ctx:e}),se.$set(yt);const $t={};p&2&&($t.$$scope={dirty:p,ctx:e}),re.$set($t);const Le={};p&2&&(Le.$$scope={dirty:p,ctx:e}),ie.$set(Le);const Pt={};p&2&&(Pt.$$scope={dirty:p,ctx:e}),le.$set(Pt);const Nt={};p&2&&(Nt.$$scope={dirty:p,ctx:e}),ce.$set(Nt);const Gt={};p&2&&(Gt.$$scope={dirty:p,ctx:e}),pe.$set(Gt)},i(e){Wt||(y(a.$$.fragment,e),y(ue.$$.fragment,e),y(_e.$$.fragment,e),y(Te.$$.fragment,e),y(ve.$$.fragment,e),y(be.$$.fragment,e),y(ke.$$.fragment,e),y(te.$$.fragment,e),y(ye.$$.fragment,e),y($e.$$.fragment,e),y(ne.$$.fragment,e),y(se.$$.fragment,e),y(xe.$$.fragment,e),y(Xe.$$.fragment,e),y(Ee.$$.fragment,e),y(re.$$.fragment,e),y(ie.$$.fragment,e),y(le.$$.fragment,e),y(Ce.$$.fragment,e),y(Fe.$$.fragment,e),y(je.$$.fragment,e),y(ce.$$.fragment,e),y(pe.$$.fragment,e),Wt=!0)},o(e){$(a.$$.fragment,e),$(ue.$$.fragment,e),$(_e.$$.fragment,e),$(Te.$$.fragment,e),$(ve.$$.fragment,e),$(be.$$.fragment,e),$(ke.$$.fragment,e),$(te.$$.fragment,e),$(ye.$$.fragment,e),$($e.$$.fragment,e),$(ne.$$.fragment,e),$(se.$$.fragment,e),$(xe.$$.fragment,e),$(Xe.$$.fragment,e),$(Ee.$$.fragment,e),$(re.$$.fragment,e),$(ie.$$.fragment,e),$(le.$$.fragment,e),$(Ce.$$.fragment,e),$(Fe.$$.fragment,e),$(je.$$.fragment,e),$(ce.$$.fragment,e),$(pe.$$.fragment,e),Wt=!1},d(e){o(i),e&&o(T),e&&o(c),P(a),e&&o(N),e&&o(M),P(ue),e&&o(xt),e&&o(Y),e&&o(Xt),e&&o(K),e&&o(zt),e&&o(Oe),e&&o(Mt),P(_e,e),e&&o(Et),e&&o(De),e&&o(Ct),e&&o(O),P(Te),e&&o(Ft),e&&o(Z),e&&o(qt),P(ve,e),e&&o(jt),e&&o(D),P(be),e&&o(At),e&&o(q),P(ke),P(te),e&&o(Lt),e&&o(W),P(ye),e&&o(It),e&&o(x),P($e),P(ne),P(se),e&&o(Ot),e&&o(H),P(xe),e&&o(Dt),e&&o(A),P(Xe),P(Ee),P(re),P(ie),P(le),e&&o(Bt),e&&o(V),P(Ce),e&&o(St),e&&o(L),P(Fe),P(je),P(ce),P(pe)}}}const zs={local:"gptneox",sections:[{local:"overview",sections:[{local:"generation",title:"Generation"}],title:"Overview"},{local:"transformers.GPTNeoXConfig",title:"GPTNeoXConfig"},{local:"transformers.GPTNeoXTokenizerFast",title:"GPTNeoXTokenizerFast"},{local:"transformers.GPTNeoXModel",title:"GPTNeoXModel"},{local:"transformers.GPTNeoXForCausalLM",title:"GPTNeoXForCausalLM"}],title:"GPT-NeoX"};function Ms(X){return bs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ls extends gs{constructor(i){super();_s(this,i,Ms,Xs,Ts,{})}}export{Ls as default,zs as metadata};
