import{S as Bi,i as Qi,s as Ui,e as a,k as m,w as v,t as l,M as Vi,c as r,d as o,m as f,a as i,x as k,h as d,b as g,G as e,g as T,y as w,q as $,o as y,B as P,v as Ji,L as Ke}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ye}from"../../chunks/Tip-hf-doc-builder.js";import{D as H}from"../../chunks/Docstring-hf-doc-builder.js";import{C as K}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as U}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Re}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Yi(N){let s,b;return s=new K({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(){v(s.$$.fragment)},l(c){k(s.$$.fragment,c)},m(c,h){w(s,c,h),b=!0},p:Ke,i(c){b||($(s.$$.fragment,c),b=!0)},o(c){y(s.$$.fragment,c),b=!1},d(c){P(s,c)}}}function Ri(N){let s,b,c,h,_;return h=new K({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="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPTNeoXTokenizerFast

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = GPTNeoXTokenizerFast.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot;Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">15496</span>, <span class="hljs-number">995</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot; Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">18435</span>, <span class="hljs-number">995</span>]`}}),{c(){s=a("p"),b=l("be encoded differently whether it is at the beginning of the sentence (without space) or not:"),c=m(),v(h.$$.fragment)},l(n){s=r(n,"P",{});var p=i(s);b=d(p,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),p.forEach(o),c=f(n),k(h.$$.fragment,n)},m(n,p){T(n,s,p),e(s,b),T(n,c,p),w(h,n,p),_=!0},p:Ke,i(n){_||($(h.$$.fragment,n),_=!0)},o(n){y(h.$$.fragment,n),_=!1},d(n){n&&o(s),n&&o(c),P(h,n)}}}function Ki(N){let s,b,c,h,_,n,p,G;return{c(){s=a("p"),b=l("When used with "),c=a("code"),h=l("is_split_into_words=True"),_=l(", this tokenizer needs to be instantiated with "),n=a("code"),p=l("add_prefix_space=True"),G=l(".")},l(F){s=r(F,"P",{});var X=i(s);b=d(X,"When used with "),c=r(X,"CODE",{});var C=i(c);h=d(C,"is_split_into_words=True"),C.forEach(o),_=d(X,", this tokenizer needs to be instantiated with "),n=r(X,"CODE",{});var z=i(n);p=d(z,"add_prefix_space=True"),z.forEach(o),G=d(X,"."),X.forEach(o)},m(F,X){T(F,s,X),e(s,b),e(s,c),e(c,h),e(s,_),e(s,n),e(n,p),e(s,G)},d(F){F&&o(s)}}}function Zi(N){let s,b,c,h,_;return{c(){s=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a("code"),h=l("Module"),_=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(n){s=r(n,"P",{});var p=i(s);b=d(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r(p,"CODE",{});var G=i(c);h=d(G,"Module"),G.forEach(o),_=d(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){T(n,s,p),e(s,b),e(s,c),e(c,h),e(s,_)},d(n){n&&o(s)}}}function el(N){let s,b,c,h,_,n,p,G;return{c(){s=a("p"),b=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=a("code"),h=l('device_map="auto"'),_=l(" in the "),n=a("code"),p=l("from_pretrained"),G=l(" call.")},l(F){s=r(F,"P",{});var X=i(s);b=d(X,`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=r(X,"CODE",{});var C=i(c);h=d(C,'device_map="auto"'),C.forEach(o),_=d(X," in the "),n=r(X,"CODE",{});var z=i(n);p=d(z,"from_pretrained"),z.forEach(o),G=d(X," call."),X.forEach(o)},m(F,X){T(F,s,X),e(s,b),e(s,c),e(c,h),e(s,_),e(s,n),e(n,p),e(s,G)},d(F){F&&o(s)}}}function tl(N){let s,b,c,h,_;return h=new K({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(){s=a("p"),b=l("Example:"),c=m(),v(h.$$.fragment)},l(n){s=r(n,"P",{});var p=i(s);b=d(p,"Example:"),p.forEach(o),c=f(n),k(h.$$.fragment,n)},m(n,p){T(n,s,p),e(s,b),T(n,c,p),w(h,n,p),_=!0},p:Ke,i(n){_||($(h.$$.fragment,n),_=!0)},o(n){y(h.$$.fragment,n),_=!1},d(n){n&&o(s),n&&o(c),P(h,n)}}}function ol(N){let s,b,c,h,_;return{c(){s=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a("code"),h=l("Module"),_=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(n){s=r(n,"P",{});var p=i(s);b=d(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r(p,"CODE",{});var G=i(c);h=d(G,"Module"),G.forEach(o),_=d(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){T(n,s,p),e(s,b),e(s,c),e(c,h),e(s,_)},d(n){n&&o(s)}}}function nl(N){let s,b,c,h,_;return h=new K({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(){s=a("p"),b=l("Example:"),c=m(),v(h.$$.fragment)},l(n){s=r(n,"P",{});var p=i(s);b=d(p,"Example:"),p.forEach(o),c=f(n),k(h.$$.fragment,n)},m(n,p){T(n,s,p),e(s,b),T(n,c,p),w(h,n,p),_=!0},p:Ke,i(n){_||($(h.$$.fragment,n),_=!0)},o(n){y(h.$$.fragment,n),_=!1},d(n){n&&o(s),n&&o(c),P(h,n)}}}function sl(N){let s,b,c,h,_;return{c(){s=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a("code"),h=l("Module"),_=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(n){s=r(n,"P",{});var p=i(s);b=d(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r(p,"CODE",{});var G=i(c);h=d(G,"Module"),G.forEach(o),_=d(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){T(n,s,p),e(s,b),e(s,c),e(c,h),e(s,_)},d(n){n&&o(s)}}}function al(N){let s,b,c,h,_,n,p,G;return{c(){s=a("p"),b=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=a("code"),h=l('device_map="auto"'),_=l(" in the "),n=a("code"),p=l("from_pretrained"),G=l(" call.")},l(F){s=r(F,"P",{});var X=i(s);b=d(X,`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=r(X,"CODE",{});var C=i(c);h=d(C,'device_map="auto"'),C.forEach(o),_=d(X," in the "),n=r(X,"CODE",{});var z=i(n);p=d(z,"from_pretrained"),z.forEach(o),G=d(X," call."),X.forEach(o)},m(F,X){T(F,s,X),e(s,b),e(s,c),e(c,h),e(s,_),e(s,n),e(n,p),e(s,G)},d(F){F&&o(s)}}}function rl(N){let s,b,c,h,_;return h=new K({props:{code:`from transformers import AutoTokenizer, GPTNeoXForQuestionAnswering
import torch

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

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

answer_start_index = outputs.start_logits.argmax()
answer_end_index = outputs.end_logits.argmax()

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]

# target is "nice puppet"
target_start_index = torch.tensor([14])
target_end_index = torch.tensor([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GPTNeoXForQuestionAnswering
<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 = GPTNeoXForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;trl-internal-testing/tiny-random-GPTNeoXForCausalLM&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = outputs.start_logits.argmax()
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = outputs.end_logits.argmax()

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){s=a("p"),b=l("Example:"),c=m(),v(h.$$.fragment)},l(n){s=r(n,"P",{});var p=i(s);b=d(p,"Example:"),p.forEach(o),c=f(n),k(h.$$.fragment,n)},m(n,p){T(n,s,p),e(s,b),T(n,c,p),w(h,n,p),_=!0},p:Ke,i(n){_||($(h.$$.fragment,n),_=!0)},o(n){y(h.$$.fragment,n),_=!1},d(n){n&&o(s),n&&o(c),P(h,n)}}}function il(N){let s,b,c,h,_;return{c(){s=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a("code"),h=l("Module"),_=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(n){s=r(n,"P",{});var p=i(s);b=d(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r(p,"CODE",{});var G=i(c);h=d(G,"Module"),G.forEach(o),_=d(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){T(n,s,p),e(s,b),e(s,c),e(c,h),e(s,_)},d(n){n&&o(s)}}}function ll(N){let s,b,c,h,_;return h=new K({props:{code:`import torch
from transformers import AutoTokenizer, GPTNeoXForSequenceClassification

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

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

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = GPTNeoXForSequenceClassification.from_pretrained("trl-internal-testing/tiny-random-GPTNeoXForCausalLM", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss`,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, GPTNeoXForSequenceClassification

<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 = GPTNeoXForSequenceClassification.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><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoXForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;trl-internal-testing/tiny-random-GPTNeoXForCausalLM&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){s=a("p"),b=l("Example of single-label classification:"),c=m(),v(h.$$.fragment)},l(n){s=r(n,"P",{});var p=i(s);b=d(p,"Example of single-label classification:"),p.forEach(o),c=f(n),k(h.$$.fragment,n)},m(n,p){T(n,s,p),e(s,b),T(n,c,p),w(h,n,p),_=!0},p:Ke,i(n){_||($(h.$$.fragment,n),_=!0)},o(n){y(h.$$.fragment,n),_=!1},d(n){n&&o(s),n&&o(c),P(h,n)}}}function dl(N){let s,b,c,h,_;return h=new K({props:{code:`import torch
from transformers import AutoTokenizer, GPTNeoXForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("trl-internal-testing/tiny-random-GPTNeoXForCausalLM")
model = GPTNeoXForSequenceClassification.from_pretrained("trl-internal-testing/tiny-random-GPTNeoXForCausalLM", problem_type="multi_label_classification")

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

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_ids = torch.arange(0, logits.shape[-1])[torch.sigmoid(logits).squeeze(dim=0) > 0.5]

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = GPTNeoXForSequenceClassification.from_pretrained(
    "trl-internal-testing/tiny-random-GPTNeoXForCausalLM", num_labels=num_labels, problem_type="multi_label_classification"
)

labels = torch.sum(
    torch.nn.functional.one_hot(predicted_class_ids[None, :].clone(), num_classes=num_labels), dim=1
).to(torch.float)
loss = model(**inputs, labels=labels).loss`,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, GPTNeoXForSequenceClassification

<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 = GPTNeoXForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;trl-internal-testing/tiny-random-GPTNeoXForCausalLM&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&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><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoXForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;trl-internal-testing/tiny-random-GPTNeoXForCausalLM&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){s=a("p"),b=l("Example of multi-label classification:"),c=m(),v(h.$$.fragment)},l(n){s=r(n,"P",{});var p=i(s);b=d(p,"Example of multi-label classification:"),p.forEach(o),c=f(n),k(h.$$.fragment,n)},m(n,p){T(n,s,p),e(s,b),T(n,c,p),w(h,n,p),_=!0},p:Ke,i(n){_||($(h.$$.fragment,n),_=!0)},o(n){y(h.$$.fragment,n),_=!1},d(n){n&&o(s),n&&o(c),P(h,n)}}}function cl(N){let s,b,c,h,_;return{c(){s=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a("code"),h=l("Module"),_=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(n){s=r(n,"P",{});var p=i(s);b=d(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r(p,"CODE",{});var G=i(c);h=d(G,"Module"),G.forEach(o),_=d(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){T(n,s,p),e(s,b),e(s,c),e(c,h),e(s,_)},d(n){n&&o(s)}}}function pl(N){let s,b,c,h,_;return h=new K({props:{code:`from transformers import AutoTokenizer, GPTNeoXForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("LarsJonasson/pythia-410m-deduped-sft-swedish")
model = GPTNeoXForTokenClassification.from_pretrained("LarsJonasson/pythia-410m-deduped-sft-swedish")

inputs = tokenizer(
    "HuggingFace is a company based in Paris and New York", add_special_tokens=False, return_tensors="pt"
)

with torch.no_grad():
    logits = model(**inputs).logits

predicted_token_class_ids = logits.argmax(-1)

# Note that tokens are classified rather then input words which means that
# there might be more predicted token classes than words.
# Multiple token classes might account for the same word
predicted_tokens_classes = [model.config.id2label[t.item()] for t in predicted_token_class_ids[0]]

labels = predicted_token_class_ids
loss = model(**inputs, labels=labels).loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GPTNeoXForTokenClassification
<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;LarsJonasson/pythia-410m-deduped-sft-swedish&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoXForTokenClassification.from_pretrained(<span class="hljs-string">&quot;LarsJonasson/pythia-410m-deduped-sft-swedish&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = logits.argmax(-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t.item()] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>]]

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.25</span>`}}),{c(){s=a("p"),b=l("Example:"),c=m(),v(h.$$.fragment)},l(n){s=r(n,"P",{});var p=i(s);b=d(p,"Example:"),p.forEach(o),c=f(n),k(h.$$.fragment,n)},m(n,p){T(n,s,p),e(s,b),T(n,c,p),w(h,n,p),_=!0},p:Ke,i(n){_||($(h.$$.fragment,n),_=!0)},o(n){y(h.$$.fragment,n),_=!1},d(n){n&&o(s),n&&o(c),P(h,n)}}}function hl(N){let s,b,c,h,_,n,p,G,F,X,C,z,mo,Ze,Rn,fo,Kn,cn,Te,Zn,et,es,ts,pn,be,os,tt,ns,ss,hn,It,as,un,ot,mn,Dt,rs,fn,Z,ve,go,nt,is,_o,ls,gn,ke,ds,To,cs,ps,_n,st,Tn,ee,we,bo,at,hs,vo,us,bn,Wt,ko,Ht,ms,vn,te,$e,wo,rt,fs,$o,gs,kn,L,it,_s,oe,Ts,Bt,bs,vs,lt,ks,ws,$s,ne,ys,Qt,Ps,Ns,Ut,Gs,Xs,Fs,ye,wn,se,Pe,yo,dt,xs,Po,Cs,$n,x,ct,zs,pt,qs,No,js,Es,Ms,Go,As,Ls,Ne,Os,ht,Ss,Xo,Is,Ds,Ws,Ge,Hs,ut,Bs,Vt,Qs,Us,yn,ae,Xe,Fo,mt,Vs,xo,Js,Pn,B,ft,Ys,gt,Rs,_t,Ks,Zs,ea,j,Tt,ta,re,oa,Jt,na,sa,Co,aa,ra,ia,Fe,la,xe,da,Ce,Nn,ie,ze,zo,bt,ca,qo,pa,Gn,Q,vt,ha,le,ua,jo,ma,fa,kt,ga,_a,Ta,I,wt,ba,de,va,Yt,ka,wa,Eo,$a,ya,Pa,qe,Na,je,Xn,ce,Ee,Mo,$t,Ga,Ao,Xa,Fn,O,yt,Fa,pe,xa,Lo,Ca,za,Oo,qa,ja,Ea,Pt,Ma,Nt,Aa,La,Oa,E,Gt,Sa,he,Ia,Rt,Da,Wa,So,Ha,Ba,Qa,Me,Ua,Ae,Va,Le,xn,ue,Oe,Io,Xt,Ja,Do,Ya,Cn,q,Ft,Ra,Wo,Ka,Za,Kt,Zt,er,tr,or,S,nr,Ho,sr,ar,Bo,rr,ir,Qo,lr,dr,Uo,cr,pr,hr,xt,ur,Ct,mr,fr,gr,M,zt,_r,me,Tr,eo,br,vr,Vo,kr,wr,$r,Se,yr,Ie,Pr,De,zn,fe,We,Jo,qt,Nr,Yo,Gr,qn,ge,jt,Xr,D,Et,Fr,_e,xr,to,Cr,zr,Ro,qr,jr,Er,He,Mr,Be,jn;return n=new U({}),Ze=new U({}),ot=new K({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()'}}),nt=new U({}),st=new K({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>]`}}),at=new U({}),rt=new U({}),it=new H({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:"classifier_dropout",val:" = 0.1"},{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/v4.29.0/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.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Argument used when doing token classification, used in the model <a href="/docs/transformers/v4.29.0/en/model_doc/gpt_neox#transformers.GPTNeoXForTokenClassification">GPTNeoXForTokenClassification</a>.</p>
<p>The dropout ratio for the hidden layer.`,name:"classifier_dropout"},{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/v4.29.0/src/transformers/models/gpt_neox/configuration_gpt_neox.py#L29"}}),ye=new Re({props:{anchor:"transformers.GPTNeoXConfig.example",$$slots:{default:[Yi]},$$scope:{ctx:N}}}),dt=new U({}),ct=new H({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/v4.29.0/src/transformers/models/gpt_neox/tokenization_gpt_neox_fast.py#L44"}}),Ne=new Re({props:{anchor:"transformers.GPTNeoXTokenizerFast.example",$$slots:{default:[Ri]},$$scope:{ctx:N}}}),Ge=new Ye({props:{$$slots:{default:[Ki]},$$scope:{ctx:N}}}),mt=new U({}),ft=new H({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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L420"}}),Tt=new H({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:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.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/v4.29.0/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/v4.29.0/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L440",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fe=new Ye({props:{$$slots:{default:[Zi]},$$scope:{ctx:N}}}),xe=new Ye({props:{warning:!0,$$slots:{default:[el]},$$scope:{ctx:N}}}),Ce=new Re({props:{anchor:"transformers.GPTNeoXModel.forward.example",$$slots:{default:[tl]},$$scope:{ctx:N}}}),bt=new U({}),vt=new H({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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L597"}}),wt=new H({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:"position_ids",val:": typing.Optional[torch.LongTensor] = 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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.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/v4.29.0/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/v4.29.0/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L615",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qe=new Ye({props:{$$slots:{default:[ol]},$$scope:{ctx:N}}}),je=new Re({props:{anchor:"transformers.GPTNeoXForCausalLM.forward.example",$$slots:{default:[nl]},$$scope:{ctx:N}}}),$t=new U({}),yt=new H({props:{name:"class transformers.GPTNeoXForQuestionAnswering",anchor:"transformers.GPTNeoXForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L968"}}),Gt=new H({props:{name:"forward",anchor:"transformers.GPTNeoXForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = 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.GPTNeoXForQuestionAnswering.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.GPTNeoXForQuestionAnswering.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.GPTNeoXForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTNeoXForQuestionAnswering.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.GPTNeoXForQuestionAnswering.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.GPTNeoXForQuestionAnswering.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.GPTNeoXForQuestionAnswering.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.GPTNeoXForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GPTNeoXForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.GPTNeoXForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L980",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/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 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Me=new Ye({props:{$$slots:{default:[sl]},$$scope:{ctx:N}}}),Ae=new Ye({props:{warning:!0,$$slots:{default:[al]},$$scope:{ctx:N}}}),Le=new Re({props:{anchor:"transformers.GPTNeoXForQuestionAnswering.forward.example",$$slots:{default:[rl]},$$scope:{ctx:N}}}),Xt=new U({}),Ft=new H({props:{name:"class transformers.GPTNeoXForSequenceClassification",anchor:"transformers.GPTNeoXForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L771"}}),zt=new H({props:{name:"forward",anchor:"transformers.GPTNeoXForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = 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.GPTNeoXForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.GPTNeoXForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>({0})</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.GPTNeoXForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTNeoXForSequenceClassification.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.GPTNeoXForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>({0}, 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.GPTNeoXForSequenceClassification.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.GPTNeoXForSequenceClassification.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.GPTNeoXForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GPTNeoXForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L783",returnDescription:`
<p>A <code>transformers.modeling_outputs.SequenceClassifierOutputWithPast</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/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 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (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><code>transformers.modeling_outputs.SequenceClassifierOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Se=new Ye({props:{$$slots:{default:[il]},$$scope:{ctx:N}}}),Ie=new Re({props:{anchor:"transformers.GPTNeoXForSequenceClassification.forward.example",$$slots:{default:[ll]},$$scope:{ctx:N}}}),De=new Re({props:{anchor:"transformers.GPTNeoXForSequenceClassification.forward.example-2",$$slots:{default:[dl]},$$scope:{ctx:N}}}),qt=new U({}),jt=new H({props:{name:"class transformers.GPTNeoXForTokenClassification",anchor:"transformers.GPTNeoXForTokenClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L884"}}),Et=new H({props:{name:"forward",anchor:"transformers.GPTNeoXForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GPTNeoXForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.GPTNeoXForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>({0})</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.GPTNeoXForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTNeoXForTokenClassification.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.GPTNeoXForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>({0}, 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.GPTNeoXForTokenClassification.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.GPTNeoXForTokenClassification.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.GPTNeoXForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GPTNeoXForTokenClassification.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 sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L896",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/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 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),He=new Ye({props:{$$slots:{default:[cl]},$$scope:{ctx:N}}}),Be=new Re({props:{anchor:"transformers.GPTNeoXForTokenClassification.forward.example",$$slots:{default:[pl]},$$scope:{ctx:N}}}),{c(){s=a("meta"),b=m(),c=a("h1"),h=a("a"),_=a("span"),v(n.$$.fragment),p=m(),G=a("span"),F=l("GPT-NeoX"),X=m(),C=a("h2"),z=a("a"),mo=a("span"),v(Ze.$$.fragment),Rn=m(),fo=a("span"),Kn=l("Overview"),cn=m(),Te=a("p"),Zn=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 `),et=a("a"),es=l("https://github.com/EleutherAI/gpt-neox"),ts=l("."),pn=m(),be=a("p"),os=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 `),tt=a("a"),ns=l("CoreWeave"),ss=l("."),hn=m(),It=a("p"),as=l("GPT-NeoX-20B was trained with fp16, thus it is recommended to initialize the model as follows:"),un=m(),v(ot.$$.fragment),mn=m(),Dt=a("p"),rs=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.`),fn=m(),Z=a("h3"),ve=a("a"),go=a("span"),v(nt.$$.fragment),is=m(),_o=a("span"),ls=l("Generation"),gn=m(),ke=a("p"),ds=l("The "),To=a("code"),cs=l("generate()"),ps=l(" method can be used to generate text using GPT Neo model."),_n=m(),v(st.$$.fragment),Tn=m(),ee=a("h2"),we=a("a"),bo=a("span"),v(at.$$.fragment),hs=m(),vo=a("span"),us=l("Documentation resources"),bn=m(),Wt=a("ul"),ko=a("li"),Ht=a("a"),ms=l("Causal language modeling task guide"),vn=m(),te=a("h2"),$e=a("a"),wo=a("span"),v(rt.$$.fragment),fs=m(),$o=a("span"),gs=l("GPTNeoXConfig"),kn=m(),L=a("div"),v(it.$$.fragment),_s=m(),oe=a("p"),Ts=l("This is the configuration class to store the configuration of a "),Bt=a("a"),bs=l("GPTNeoXModel"),vs=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
`),lt=a("a"),ks=l("EleutherAI/gpt-neox-20b"),ws=l(" architecture."),$s=m(),ne=a("p"),ys=l("Configuration objects inherit from "),Qt=a("a"),Ps=l("PretrainedConfig"),Ns=l(` and can be used to control the model outputs. Read the
documentation from `),Ut=a("a"),Gs=l("PretrainedConfig"),Xs=l(" for more information."),Fs=m(),v(ye.$$.fragment),wn=m(),se=a("h2"),Pe=a("a"),yo=a("span"),v(dt.$$.fragment),xs=m(),Po=a("span"),Cs=l("GPTNeoXTokenizerFast"),$n=m(),x=a("div"),v(ct.$$.fragment),zs=m(),pt=a("p"),qs=l("Construct a \u201Cfast\u201D GPT-NeoX-20B tokenizer (backed by HuggingFace\u2019s "),No=a("em"),js=l("tokenizers"),Es=l(` library). Based on byte-level
Byte-Pair-Encoding.`),Ms=m(),Go=a("p"),As=l("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Ls=m(),v(Ne.$$.fragment),Os=m(),ht=a("p"),Ss=l("You can get around that behavior by passing "),Xo=a("code"),Is=l("add_prefix_space=True"),Ds=l(` when instantiating this tokenizer, but since
the model was not pretrained this way, it might yield a decrease in performance.`),Ws=m(),v(Ge.$$.fragment),Hs=m(),ut=a("p"),Bs=l("This tokenizer inherits from "),Vt=a("a"),Qs=l("PreTrainedTokenizerFast"),Us=l(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),yn=m(),ae=a("h2"),Xe=a("a"),Fo=a("span"),v(mt.$$.fragment),Vs=m(),xo=a("span"),Js=l("GPTNeoXModel"),Pn=m(),B=a("div"),v(ft.$$.fragment),Ys=m(),gt=a("p"),Rs=l(`The bare GPTNeoX Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),_t=a("a"),Ks=l("torch.nn.Module"),Zs=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.`),ea=m(),j=a("div"),v(Tt.$$.fragment),ta=m(),re=a("p"),oa=l("The "),Jt=a("a"),na=l("GPTNeoXModel"),sa=l(" forward method, overrides the "),Co=a("code"),aa=l("__call__"),ra=l(" special method."),ia=m(),v(Fe.$$.fragment),la=m(),v(xe.$$.fragment),da=m(),v(Ce.$$.fragment),Nn=m(),ie=a("h2"),ze=a("a"),zo=a("span"),v(bt.$$.fragment),ca=m(),qo=a("span"),pa=l("GPTNeoXForCausalLM"),Gn=m(),Q=a("div"),v(vt.$$.fragment),ha=m(),le=a("p"),ua=l("GPTNeoX Model with a "),jo=a("code"),ma=l("language modeling"),fa=l(` head on top for CLM fine-tuning.
This model is a PyTorch `),kt=a("a"),ga=l("torch.nn.Module"),_a=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.`),Ta=m(),I=a("div"),v(wt.$$.fragment),ba=m(),de=a("p"),va=l("The "),Yt=a("a"),ka=l("GPTNeoXForCausalLM"),wa=l(" forward method, overrides the "),Eo=a("code"),$a=l("__call__"),ya=l(" special method."),Pa=m(),v(qe.$$.fragment),Na=m(),v(je.$$.fragment),Xn=m(),ce=a("h2"),Ee=a("a"),Mo=a("span"),v($t.$$.fragment),Ga=m(),Ao=a("span"),Xa=l("GPTNeoXForQuestionAnswering"),Fn=m(),O=a("div"),v(yt.$$.fragment),Fa=m(),pe=a("p"),xa=l(`The GPT-NeoX Model transformer with a span classification head on top for extractive question-answering tasks like
SQuAD (a linear layer on top of the hidden-states output to compute `),Lo=a("code"),Ca=l("span start logits"),za=l(" and "),Oo=a("code"),qa=l("span end logits"),ja=l(")."),Ea=m(),Pt=a("p"),Ma=l("This model is a PyTorch "),Nt=a("a"),Aa=l("torch.nn.Module"),La=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.`),Oa=m(),E=a("div"),v(Gt.$$.fragment),Sa=m(),he=a("p"),Ia=l("The "),Rt=a("a"),Da=l("GPTNeoXForQuestionAnswering"),Wa=l(" forward method, overrides the "),So=a("code"),Ha=l("__call__"),Ba=l(" special method."),Qa=m(),v(Me.$$.fragment),Ua=m(),v(Ae.$$.fragment),Va=m(),v(Le.$$.fragment),xn=m(),ue=a("h2"),Oe=a("a"),Io=a("span"),v(Xt.$$.fragment),Ja=m(),Do=a("span"),Ya=l("GPTNeoXForSequenceClassification"),Cn=m(),q=a("div"),v(Ft.$$.fragment),Ra=m(),Wo=a("p"),Ka=l("The GPTNeoX Model transformer with a sequence classification head on top (linear layer)."),Za=m(),Kt=a("p"),Zt=a("a"),er=l("GPTNeoXForSequenceClassification"),tr=l(` uses the last token in order to do the classification, as other causal models
(e.g. GPT-1) do.`),or=m(),S=a("p"),nr=l(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Ho=a("code"),sr=l("pad_token_id"),ar=l(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Bo=a("code"),rr=l("pad_token_id"),ir=l(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),Qo=a("code"),lr=l("inputs_embeds"),dr=l(" are passed instead of "),Uo=a("code"),cr=l("input_ids"),pr=l(`, it does the same (take the last value in
each row of the batch).`),hr=m(),xt=a("p"),ur=l("This model is a PyTorch "),Ct=a("a"),mr=l("torch.nn.Module"),fr=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.`),gr=m(),M=a("div"),v(zt.$$.fragment),_r=m(),me=a("p"),Tr=l("The "),eo=a("a"),br=l("GPTNeoXForSequenceClassification"),vr=l(" forward method, overrides the "),Vo=a("code"),kr=l("__call__"),wr=l(" special method."),$r=m(),v(Se.$$.fragment),yr=m(),v(Ie.$$.fragment),Pr=m(),v(De.$$.fragment),zn=m(),fe=a("h2"),We=a("a"),Jo=a("span"),v(qt.$$.fragment),Nr=m(),Yo=a("span"),Gr=l("GPTNeoXForTokenClassification"),qn=m(),ge=a("div"),v(jt.$$.fragment),Xr=m(),D=a("div"),v(Et.$$.fragment),Fr=m(),_e=a("p"),xr=l("The "),to=a("a"),Cr=l("GPTNeoXForTokenClassification"),zr=l(" forward method, overrides the "),Ro=a("code"),qr=l("__call__"),jr=l(" special method."),Er=m(),v(He.$$.fragment),Mr=m(),v(Be.$$.fragment),this.h()},l(t){const u=Vi('[data-svelte="svelte-1phssyn"]',document.head);s=r(u,"META",{name:!0,content:!0}),u.forEach(o),b=f(t),c=r(t,"H1",{class:!0});var Mt=i(c);h=r(Mt,"A",{id:!0,class:!0,href:!0});var Ko=i(h);_=r(Ko,"SPAN",{});var Zo=i(_);k(n.$$.fragment,Zo),Zo.forEach(o),Ko.forEach(o),p=f(Mt),G=r(Mt,"SPAN",{});var en=i(G);F=d(en,"GPT-NeoX"),en.forEach(o),Mt.forEach(o),X=f(t),C=r(t,"H2",{class:!0});var At=i(C);z=r(At,"A",{id:!0,class:!0,href:!0});var tn=i(z);mo=r(tn,"SPAN",{});var on=i(mo);k(Ze.$$.fragment,on),on.forEach(o),tn.forEach(o),Rn=f(At),fo=r(At,"SPAN",{});var nn=i(fo);Kn=d(nn,"Overview"),nn.forEach(o),At.forEach(o),cn=f(t),Te=r(t,"P",{});var Lt=i(Te);Zn=d(Lt,`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 `),et=r(Lt,"A",{href:!0,rel:!0});var sn=i(et);es=d(sn,"https://github.com/EleutherAI/gpt-neox"),sn.forEach(o),ts=d(Lt,"."),Lt.forEach(o),pn=f(t),be=r(t,"P",{});var Ot=i(be);os=d(Ot,`Development of the model was led by Sid Black, Stella Biderman and Eric Hallahan, and the model was trained with
generous the support of `),tt=r(Ot,"A",{href:!0,rel:!0});var an=i(tt);ns=d(an,"CoreWeave"),an.forEach(o),ss=d(Ot,"."),Ot.forEach(o),hn=f(t),It=r(t,"P",{});var rn=i(It);as=d(rn,"GPT-NeoX-20B was trained with fp16, thus it is recommended to initialize the model as follows:"),rn.forEach(o),un=f(t),k(ot.$$.fragment,t),mn=f(t),Dt=r(t,"P",{});var ln=i(Dt);rs=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),fn=f(t),Z=r(t,"H3",{class:!0});var St=i(Z);ve=r(St,"A",{id:!0,class:!0,href:!0});var dn=i(ve);go=r(dn,"SPAN",{});var Lr=i(go);k(nt.$$.fragment,Lr),Lr.forEach(o),dn.forEach(o),is=f(St),_o=r(St,"SPAN",{});var Or=i(_o);ls=d(Or,"Generation"),Or.forEach(o),St.forEach(o),gn=f(t),ke=r(t,"P",{});var En=i(ke);ds=d(En,"The "),To=r(En,"CODE",{});var Sr=i(To);cs=d(Sr,"generate()"),Sr.forEach(o),ps=d(En," method can be used to generate text using GPT Neo model."),En.forEach(o),_n=f(t),k(st.$$.fragment,t),Tn=f(t),ee=r(t,"H2",{class:!0});var Mn=i(ee);we=r(Mn,"A",{id:!0,class:!0,href:!0});var Ir=i(we);bo=r(Ir,"SPAN",{});var Dr=i(bo);k(at.$$.fragment,Dr),Dr.forEach(o),Ir.forEach(o),hs=f(Mn),vo=r(Mn,"SPAN",{});var Wr=i(vo);us=d(Wr,"Documentation resources"),Wr.forEach(o),Mn.forEach(o),bn=f(t),Wt=r(t,"UL",{});var Hr=i(Wt);ko=r(Hr,"LI",{});var Br=i(ko);Ht=r(Br,"A",{href:!0});var Qr=i(Ht);ms=d(Qr,"Causal language modeling task guide"),Qr.forEach(o),Br.forEach(o),Hr.forEach(o),vn=f(t),te=r(t,"H2",{class:!0});var An=i(te);$e=r(An,"A",{id:!0,class:!0,href:!0});var Ur=i($e);wo=r(Ur,"SPAN",{});var Vr=i(wo);k(rt.$$.fragment,Vr),Vr.forEach(o),Ur.forEach(o),fs=f(An),$o=r(An,"SPAN",{});var Jr=i($o);gs=d(Jr,"GPTNeoXConfig"),Jr.forEach(o),An.forEach(o),kn=f(t),L=r(t,"DIV",{class:!0});var Qe=i(L);k(it.$$.fragment,Qe),_s=f(Qe),oe=r(Qe,"P",{});var oo=i(oe);Ts=d(oo,"This is the configuration class to store the configuration of a "),Bt=r(oo,"A",{href:!0});var Yr=i(Bt);bs=d(Yr,"GPTNeoXModel"),Yr.forEach(o),vs=d(oo,`. 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
`),lt=r(oo,"A",{href:!0,rel:!0});var Rr=i(lt);ks=d(Rr,"EleutherAI/gpt-neox-20b"),Rr.forEach(o),ws=d(oo," architecture."),oo.forEach(o),$s=f(Qe),ne=r(Qe,"P",{});var no=i(ne);ys=d(no,"Configuration objects inherit from "),Qt=r(no,"A",{href:!0});var Kr=i(Qt);Ps=d(Kr,"PretrainedConfig"),Kr.forEach(o),Ns=d(no,` and can be used to control the model outputs. Read the
documentation from `),Ut=r(no,"A",{href:!0});var Zr=i(Ut);Gs=d(Zr,"PretrainedConfig"),Zr.forEach(o),Xs=d(no," for more information."),no.forEach(o),Fs=f(Qe),k(ye.$$.fragment,Qe),Qe.forEach(o),wn=f(t),se=r(t,"H2",{class:!0});var Ln=i(se);Pe=r(Ln,"A",{id:!0,class:!0,href:!0});var ei=i(Pe);yo=r(ei,"SPAN",{});var ti=i(yo);k(dt.$$.fragment,ti),ti.forEach(o),ei.forEach(o),xs=f(Ln),Po=r(Ln,"SPAN",{});var oi=i(Po);Cs=d(oi,"GPTNeoXTokenizerFast"),oi.forEach(o),Ln.forEach(o),$n=f(t),x=r(t,"DIV",{class:!0});var A=i(x);k(ct.$$.fragment,A),zs=f(A),pt=r(A,"P",{});var On=i(pt);qs=d(On,"Construct a \u201Cfast\u201D GPT-NeoX-20B tokenizer (backed by HuggingFace\u2019s "),No=r(On,"EM",{});var ni=i(No);js=d(ni,"tokenizers"),ni.forEach(o),Es=d(On,` library). Based on byte-level
Byte-Pair-Encoding.`),On.forEach(o),Ms=f(A),Go=r(A,"P",{});var si=i(Go);As=d(si,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),si.forEach(o),Ls=f(A),k(Ne.$$.fragment,A),Os=f(A),ht=r(A,"P",{});var Sn=i(ht);Ss=d(Sn,"You can get around that behavior by passing "),Xo=r(Sn,"CODE",{});var ai=i(Xo);Is=d(ai,"add_prefix_space=True"),ai.forEach(o),Ds=d(Sn,` when instantiating this tokenizer, but since
the model was not pretrained this way, it might yield a decrease in performance.`),Sn.forEach(o),Ws=f(A),k(Ge.$$.fragment,A),Hs=f(A),ut=r(A,"P",{});var In=i(ut);Bs=d(In,"This tokenizer inherits from "),Vt=r(In,"A",{href:!0});var ri=i(Vt);Qs=d(ri,"PreTrainedTokenizerFast"),ri.forEach(o),Us=d(In,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),In.forEach(o),A.forEach(o),yn=f(t),ae=r(t,"H2",{class:!0});var Dn=i(ae);Xe=r(Dn,"A",{id:!0,class:!0,href:!0});var ii=i(Xe);Fo=r(ii,"SPAN",{});var li=i(Fo);k(mt.$$.fragment,li),li.forEach(o),ii.forEach(o),Vs=f(Dn),xo=r(Dn,"SPAN",{});var di=i(xo);Js=d(di,"GPTNeoXModel"),di.forEach(o),Dn.forEach(o),Pn=f(t),B=r(t,"DIV",{class:!0});var so=i(B);k(ft.$$.fragment,so),Ys=f(so),gt=r(so,"P",{});var Wn=i(gt);Rs=d(Wn,`The bare GPTNeoX Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),_t=r(Wn,"A",{href:!0,rel:!0});var ci=i(_t);Ks=d(ci,"torch.nn.Module"),ci.forEach(o),Zs=d(Wn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Wn.forEach(o),ea=f(so),j=r(so,"DIV",{class:!0});var V=i(j);k(Tt.$$.fragment,V),ta=f(V),re=r(V,"P",{});var ao=i(re);oa=d(ao,"The "),Jt=r(ao,"A",{href:!0});var pi=i(Jt);na=d(pi,"GPTNeoXModel"),pi.forEach(o),sa=d(ao," forward method, overrides the "),Co=r(ao,"CODE",{});var hi=i(Co);aa=d(hi,"__call__"),hi.forEach(o),ra=d(ao," special method."),ao.forEach(o),ia=f(V),k(Fe.$$.fragment,V),la=f(V),k(xe.$$.fragment,V),da=f(V),k(Ce.$$.fragment,V),V.forEach(o),so.forEach(o),Nn=f(t),ie=r(t,"H2",{class:!0});var Hn=i(ie);ze=r(Hn,"A",{id:!0,class:!0,href:!0});var ui=i(ze);zo=r(ui,"SPAN",{});var mi=i(zo);k(bt.$$.fragment,mi),mi.forEach(o),ui.forEach(o),ca=f(Hn),qo=r(Hn,"SPAN",{});var fi=i(qo);pa=d(fi,"GPTNeoXForCausalLM"),fi.forEach(o),Hn.forEach(o),Gn=f(t),Q=r(t,"DIV",{class:!0});var ro=i(Q);k(vt.$$.fragment,ro),ha=f(ro),le=r(ro,"P",{});var io=i(le);ua=d(io,"GPTNeoX Model with a "),jo=r(io,"CODE",{});var gi=i(jo);ma=d(gi,"language modeling"),gi.forEach(o),fa=d(io,` head on top for CLM fine-tuning.
This model is a PyTorch `),kt=r(io,"A",{href:!0,rel:!0});var _i=i(kt);ga=d(_i,"torch.nn.Module"),_i.forEach(o),_a=d(io,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),io.forEach(o),Ta=f(ro),I=r(ro,"DIV",{class:!0});var Ue=i(I);k(wt.$$.fragment,Ue),ba=f(Ue),de=r(Ue,"P",{});var lo=i(de);va=d(lo,"The "),Yt=r(lo,"A",{href:!0});var Ti=i(Yt);ka=d(Ti,"GPTNeoXForCausalLM"),Ti.forEach(o),wa=d(lo," forward method, overrides the "),Eo=r(lo,"CODE",{});var bi=i(Eo);$a=d(bi,"__call__"),bi.forEach(o),ya=d(lo," special method."),lo.forEach(o),Pa=f(Ue),k(qe.$$.fragment,Ue),Na=f(Ue),k(je.$$.fragment,Ue),Ue.forEach(o),ro.forEach(o),Xn=f(t),ce=r(t,"H2",{class:!0});var Bn=i(ce);Ee=r(Bn,"A",{id:!0,class:!0,href:!0});var vi=i(Ee);Mo=r(vi,"SPAN",{});var ki=i(Mo);k($t.$$.fragment,ki),ki.forEach(o),vi.forEach(o),Ga=f(Bn),Ao=r(Bn,"SPAN",{});var wi=i(Ao);Xa=d(wi,"GPTNeoXForQuestionAnswering"),wi.forEach(o),Bn.forEach(o),Fn=f(t),O=r(t,"DIV",{class:!0});var Ve=i(O);k(yt.$$.fragment,Ve),Fa=f(Ve),pe=r(Ve,"P",{});var co=i(pe);xa=d(co,`The GPT-NeoX Model transformer with a span classification head on top for extractive question-answering tasks like
SQuAD (a linear layer on top of the hidden-states output to compute `),Lo=r(co,"CODE",{});var $i=i(Lo);Ca=d($i,"span start logits"),$i.forEach(o),za=d(co," and "),Oo=r(co,"CODE",{});var yi=i(Oo);qa=d(yi,"span end logits"),yi.forEach(o),ja=d(co,")."),co.forEach(o),Ea=f(Ve),Pt=r(Ve,"P",{});var Qn=i(Pt);Ma=d(Qn,"This model is a PyTorch "),Nt=r(Qn,"A",{href:!0,rel:!0});var Pi=i(Nt);Aa=d(Pi,"torch.nn.Module"),Pi.forEach(o),La=d(Qn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Qn.forEach(o),Oa=f(Ve),E=r(Ve,"DIV",{class:!0});var J=i(E);k(Gt.$$.fragment,J),Sa=f(J),he=r(J,"P",{});var po=i(he);Ia=d(po,"The "),Rt=r(po,"A",{href:!0});var Ni=i(Rt);Da=d(Ni,"GPTNeoXForQuestionAnswering"),Ni.forEach(o),Wa=d(po," forward method, overrides the "),So=r(po,"CODE",{});var Gi=i(So);Ha=d(Gi,"__call__"),Gi.forEach(o),Ba=d(po," special method."),po.forEach(o),Qa=f(J),k(Me.$$.fragment,J),Ua=f(J),k(Ae.$$.fragment,J),Va=f(J),k(Le.$$.fragment,J),J.forEach(o),Ve.forEach(o),xn=f(t),ue=r(t,"H2",{class:!0});var Un=i(ue);Oe=r(Un,"A",{id:!0,class:!0,href:!0});var Xi=i(Oe);Io=r(Xi,"SPAN",{});var Fi=i(Io);k(Xt.$$.fragment,Fi),Fi.forEach(o),Xi.forEach(o),Ja=f(Un),Do=r(Un,"SPAN",{});var xi=i(Do);Ya=d(xi,"GPTNeoXForSequenceClassification"),xi.forEach(o),Un.forEach(o),Cn=f(t),q=r(t,"DIV",{class:!0});var W=i(q);k(Ft.$$.fragment,W),Ra=f(W),Wo=r(W,"P",{});var Ci=i(Wo);Ka=d(Ci,"The GPTNeoX Model transformer with a sequence classification head on top (linear layer)."),Ci.forEach(o),Za=f(W),Kt=r(W,"P",{});var Ar=i(Kt);Zt=r(Ar,"A",{href:!0});var zi=i(Zt);er=d(zi,"GPTNeoXForSequenceClassification"),zi.forEach(o),tr=d(Ar,` uses the last token in order to do the classification, as other causal models
(e.g. GPT-1) do.`),Ar.forEach(o),or=f(W),S=r(W,"P",{});var Y=i(S);nr=d(Y,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Ho=r(Y,"CODE",{});var qi=i(Ho);sr=d(qi,"pad_token_id"),qi.forEach(o),ar=d(Y,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Bo=r(Y,"CODE",{});var ji=i(Bo);rr=d(ji,"pad_token_id"),ji.forEach(o),ir=d(Y,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),Qo=r(Y,"CODE",{});var Ei=i(Qo);lr=d(Ei,"inputs_embeds"),Ei.forEach(o),dr=d(Y," are passed instead of "),Uo=r(Y,"CODE",{});var Mi=i(Uo);cr=d(Mi,"input_ids"),Mi.forEach(o),pr=d(Y,`, it does the same (take the last value in
each row of the batch).`),Y.forEach(o),hr=f(W),xt=r(W,"P",{});var Vn=i(xt);ur=d(Vn,"This model is a PyTorch "),Ct=r(Vn,"A",{href:!0,rel:!0});var Ai=i(Ct);mr=d(Ai,"torch.nn.Module"),Ai.forEach(o),fr=d(Vn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Vn.forEach(o),gr=f(W),M=r(W,"DIV",{class:!0});var R=i(M);k(zt.$$.fragment,R),_r=f(R),me=r(R,"P",{});var ho=i(me);Tr=d(ho,"The "),eo=r(ho,"A",{href:!0});var Li=i(eo);br=d(Li,"GPTNeoXForSequenceClassification"),Li.forEach(o),vr=d(ho," forward method, overrides the "),Vo=r(ho,"CODE",{});var Oi=i(Vo);kr=d(Oi,"__call__"),Oi.forEach(o),wr=d(ho," special method."),ho.forEach(o),$r=f(R),k(Se.$$.fragment,R),yr=f(R),k(Ie.$$.fragment,R),Pr=f(R),k(De.$$.fragment,R),R.forEach(o),W.forEach(o),zn=f(t),fe=r(t,"H2",{class:!0});var Jn=i(fe);We=r(Jn,"A",{id:!0,class:!0,href:!0});var Si=i(We);Jo=r(Si,"SPAN",{});var Ii=i(Jo);k(qt.$$.fragment,Ii),Ii.forEach(o),Si.forEach(o),Nr=f(Jn),Yo=r(Jn,"SPAN",{});var Di=i(Yo);Gr=d(Di,"GPTNeoXForTokenClassification"),Di.forEach(o),Jn.forEach(o),qn=f(t),ge=r(t,"DIV",{class:!0});var Yn=i(ge);k(jt.$$.fragment,Yn),Xr=f(Yn),D=r(Yn,"DIV",{class:!0});var Je=i(D);k(Et.$$.fragment,Je),Fr=f(Je),_e=r(Je,"P",{});var uo=i(_e);xr=d(uo,"The "),to=r(uo,"A",{href:!0});var Wi=i(to);Cr=d(Wi,"GPTNeoXForTokenClassification"),Wi.forEach(o),zr=d(uo," forward method, overrides the "),Ro=r(uo,"CODE",{});var Hi=i(Ro);qr=d(Hi,"__call__"),Hi.forEach(o),jr=d(uo," special method."),uo.forEach(o),Er=f(Je),k(He.$$.fragment,Je),Mr=f(Je),k(Be.$$.fragment,Je),Je.forEach(o),Yn.forEach(o),this.h()},h(){g(s,"name","hf:doc:metadata"),g(s,"content",JSON.stringify(ul)),g(h,"id","gptneox"),g(h,"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"),g(h,"href","#gptneox"),g(c,"class","relative group"),g(z,"id","overview"),g(z,"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"),g(z,"href","#overview"),g(C,"class","relative group"),g(et,"href","https://github.com/EleutherAI/gpt-neox"),g(et,"rel","nofollow"),g(tt,"href","https://www.coreweave.com/"),g(tt,"rel","nofollow"),g(ve,"id","generation"),g(ve,"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"),g(ve,"href","#generation"),g(Z,"class","relative group"),g(we,"id","documentation-resources"),g(we,"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"),g(we,"href","#documentation-resources"),g(ee,"class","relative group"),g(Ht,"href","../tasks/language_modeling"),g($e,"id","transformers.GPTNeoXConfig"),g($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"),g($e,"href","#transformers.GPTNeoXConfig"),g(te,"class","relative group"),g(Bt,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neox#transformers.GPTNeoXModel"),g(lt,"href","https://huggingface.co/EleutherAI/gpt-neox-20b"),g(lt,"rel","nofollow"),g(Qt,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),g(Ut,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),g(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Pe,"id","transformers.GPTNeoXTokenizerFast"),g(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"),g(Pe,"href","#transformers.GPTNeoXTokenizerFast"),g(se,"class","relative group"),g(Vt,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),g(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Xe,"id","transformers.GPTNeoXModel"),g(Xe,"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"),g(Xe,"href","#transformers.GPTNeoXModel"),g(ae,"class","relative group"),g(_t,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(_t,"rel","nofollow"),g(Jt,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neox#transformers.GPTNeoXModel"),g(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ze,"id","transformers.GPTNeoXForCausalLM"),g(ze,"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"),g(ze,"href","#transformers.GPTNeoXForCausalLM"),g(ie,"class","relative group"),g(kt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(kt,"rel","nofollow"),g(Yt,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neox#transformers.GPTNeoXForCausalLM"),g(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ee,"id","transformers.GPTNeoXForQuestionAnswering"),g(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"),g(Ee,"href","#transformers.GPTNeoXForQuestionAnswering"),g(ce,"class","relative group"),g(Nt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(Nt,"rel","nofollow"),g(Rt,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neox#transformers.GPTNeoXForQuestionAnswering"),g(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Oe,"id","transformers.GPTNeoXForSequenceClassification"),g(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"),g(Oe,"href","#transformers.GPTNeoXForSequenceClassification"),g(ue,"class","relative group"),g(Zt,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neox#transformers.GPTNeoXForSequenceClassification"),g(Ct,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(Ct,"rel","nofollow"),g(eo,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neox#transformers.GPTNeoXForSequenceClassification"),g(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(We,"id","transformers.GPTNeoXForTokenClassification"),g(We,"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"),g(We,"href","#transformers.GPTNeoXForTokenClassification"),g(fe,"class","relative group"),g(to,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neox#transformers.GPTNeoXForTokenClassification"),g(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,u){e(document.head,s),T(t,b,u),T(t,c,u),e(c,h),e(h,_),w(n,_,null),e(c,p),e(c,G),e(G,F),T(t,X,u),T(t,C,u),e(C,z),e(z,mo),w(Ze,mo,null),e(C,Rn),e(C,fo),e(fo,Kn),T(t,cn,u),T(t,Te,u),e(Te,Zn),e(Te,et),e(et,es),e(Te,ts),T(t,pn,u),T(t,be,u),e(be,os),e(be,tt),e(tt,ns),e(be,ss),T(t,hn,u),T(t,It,u),e(It,as),T(t,un,u),w(ot,t,u),T(t,mn,u),T(t,Dt,u),e(Dt,rs),T(t,fn,u),T(t,Z,u),e(Z,ve),e(ve,go),w(nt,go,null),e(Z,is),e(Z,_o),e(_o,ls),T(t,gn,u),T(t,ke,u),e(ke,ds),e(ke,To),e(To,cs),e(ke,ps),T(t,_n,u),w(st,t,u),T(t,Tn,u),T(t,ee,u),e(ee,we),e(we,bo),w(at,bo,null),e(ee,hs),e(ee,vo),e(vo,us),T(t,bn,u),T(t,Wt,u),e(Wt,ko),e(ko,Ht),e(Ht,ms),T(t,vn,u),T(t,te,u),e(te,$e),e($e,wo),w(rt,wo,null),e(te,fs),e(te,$o),e($o,gs),T(t,kn,u),T(t,L,u),w(it,L,null),e(L,_s),e(L,oe),e(oe,Ts),e(oe,Bt),e(Bt,bs),e(oe,vs),e(oe,lt),e(lt,ks),e(oe,ws),e(L,$s),e(L,ne),e(ne,ys),e(ne,Qt),e(Qt,Ps),e(ne,Ns),e(ne,Ut),e(Ut,Gs),e(ne,Xs),e(L,Fs),w(ye,L,null),T(t,wn,u),T(t,se,u),e(se,Pe),e(Pe,yo),w(dt,yo,null),e(se,xs),e(se,Po),e(Po,Cs),T(t,$n,u),T(t,x,u),w(ct,x,null),e(x,zs),e(x,pt),e(pt,qs),e(pt,No),e(No,js),e(pt,Es),e(x,Ms),e(x,Go),e(Go,As),e(x,Ls),w(Ne,x,null),e(x,Os),e(x,ht),e(ht,Ss),e(ht,Xo),e(Xo,Is),e(ht,Ds),e(x,Ws),w(Ge,x,null),e(x,Hs),e(x,ut),e(ut,Bs),e(ut,Vt),e(Vt,Qs),e(ut,Us),T(t,yn,u),T(t,ae,u),e(ae,Xe),e(Xe,Fo),w(mt,Fo,null),e(ae,Vs),e(ae,xo),e(xo,Js),T(t,Pn,u),T(t,B,u),w(ft,B,null),e(B,Ys),e(B,gt),e(gt,Rs),e(gt,_t),e(_t,Ks),e(gt,Zs),e(B,ea),e(B,j),w(Tt,j,null),e(j,ta),e(j,re),e(re,oa),e(re,Jt),e(Jt,na),e(re,sa),e(re,Co),e(Co,aa),e(re,ra),e(j,ia),w(Fe,j,null),e(j,la),w(xe,j,null),e(j,da),w(Ce,j,null),T(t,Nn,u),T(t,ie,u),e(ie,ze),e(ze,zo),w(bt,zo,null),e(ie,ca),e(ie,qo),e(qo,pa),T(t,Gn,u),T(t,Q,u),w(vt,Q,null),e(Q,ha),e(Q,le),e(le,ua),e(le,jo),e(jo,ma),e(le,fa),e(le,kt),e(kt,ga),e(le,_a),e(Q,Ta),e(Q,I),w(wt,I,null),e(I,ba),e(I,de),e(de,va),e(de,Yt),e(Yt,ka),e(de,wa),e(de,Eo),e(Eo,$a),e(de,ya),e(I,Pa),w(qe,I,null),e(I,Na),w(je,I,null),T(t,Xn,u),T(t,ce,u),e(ce,Ee),e(Ee,Mo),w($t,Mo,null),e(ce,Ga),e(ce,Ao),e(Ao,Xa),T(t,Fn,u),T(t,O,u),w(yt,O,null),e(O,Fa),e(O,pe),e(pe,xa),e(pe,Lo),e(Lo,Ca),e(pe,za),e(pe,Oo),e(Oo,qa),e(pe,ja),e(O,Ea),e(O,Pt),e(Pt,Ma),e(Pt,Nt),e(Nt,Aa),e(Pt,La),e(O,Oa),e(O,E),w(Gt,E,null),e(E,Sa),e(E,he),e(he,Ia),e(he,Rt),e(Rt,Da),e(he,Wa),e(he,So),e(So,Ha),e(he,Ba),e(E,Qa),w(Me,E,null),e(E,Ua),w(Ae,E,null),e(E,Va),w(Le,E,null),T(t,xn,u),T(t,ue,u),e(ue,Oe),e(Oe,Io),w(Xt,Io,null),e(ue,Ja),e(ue,Do),e(Do,Ya),T(t,Cn,u),T(t,q,u),w(Ft,q,null),e(q,Ra),e(q,Wo),e(Wo,Ka),e(q,Za),e(q,Kt),e(Kt,Zt),e(Zt,er),e(Kt,tr),e(q,or),e(q,S),e(S,nr),e(S,Ho),e(Ho,sr),e(S,ar),e(S,Bo),e(Bo,rr),e(S,ir),e(S,Qo),e(Qo,lr),e(S,dr),e(S,Uo),e(Uo,cr),e(S,pr),e(q,hr),e(q,xt),e(xt,ur),e(xt,Ct),e(Ct,mr),e(xt,fr),e(q,gr),e(q,M),w(zt,M,null),e(M,_r),e(M,me),e(me,Tr),e(me,eo),e(eo,br),e(me,vr),e(me,Vo),e(Vo,kr),e(me,wr),e(M,$r),w(Se,M,null),e(M,yr),w(Ie,M,null),e(M,Pr),w(De,M,null),T(t,zn,u),T(t,fe,u),e(fe,We),e(We,Jo),w(qt,Jo,null),e(fe,Nr),e(fe,Yo),e(Yo,Gr),T(t,qn,u),T(t,ge,u),w(jt,ge,null),e(ge,Xr),e(ge,D),w(Et,D,null),e(D,Fr),e(D,_e),e(_e,xr),e(_e,to),e(to,Cr),e(_e,zr),e(_e,Ro),e(Ro,qr),e(_e,jr),e(D,Er),w(He,D,null),e(D,Mr),w(Be,D,null),jn=!0},p(t,[u]){const Mt={};u&2&&(Mt.$$scope={dirty:u,ctx:t}),ye.$set(Mt);const Ko={};u&2&&(Ko.$$scope={dirty:u,ctx:t}),Ne.$set(Ko);const Zo={};u&2&&(Zo.$$scope={dirty:u,ctx:t}),Ge.$set(Zo);const en={};u&2&&(en.$$scope={dirty:u,ctx:t}),Fe.$set(en);const At={};u&2&&(At.$$scope={dirty:u,ctx:t}),xe.$set(At);const tn={};u&2&&(tn.$$scope={dirty:u,ctx:t}),Ce.$set(tn);const on={};u&2&&(on.$$scope={dirty:u,ctx:t}),qe.$set(on);const nn={};u&2&&(nn.$$scope={dirty:u,ctx:t}),je.$set(nn);const Lt={};u&2&&(Lt.$$scope={dirty:u,ctx:t}),Me.$set(Lt);const sn={};u&2&&(sn.$$scope={dirty:u,ctx:t}),Ae.$set(sn);const Ot={};u&2&&(Ot.$$scope={dirty:u,ctx:t}),Le.$set(Ot);const an={};u&2&&(an.$$scope={dirty:u,ctx:t}),Se.$set(an);const rn={};u&2&&(rn.$$scope={dirty:u,ctx:t}),Ie.$set(rn);const ln={};u&2&&(ln.$$scope={dirty:u,ctx:t}),De.$set(ln);const St={};u&2&&(St.$$scope={dirty:u,ctx:t}),He.$set(St);const dn={};u&2&&(dn.$$scope={dirty:u,ctx:t}),Be.$set(dn)},i(t){jn||($(n.$$.fragment,t),$(Ze.$$.fragment,t),$(ot.$$.fragment,t),$(nt.$$.fragment,t),$(st.$$.fragment,t),$(at.$$.fragment,t),$(rt.$$.fragment,t),$(it.$$.fragment,t),$(ye.$$.fragment,t),$(dt.$$.fragment,t),$(ct.$$.fragment,t),$(Ne.$$.fragment,t),$(Ge.$$.fragment,t),$(mt.$$.fragment,t),$(ft.$$.fragment,t),$(Tt.$$.fragment,t),$(Fe.$$.fragment,t),$(xe.$$.fragment,t),$(Ce.$$.fragment,t),$(bt.$$.fragment,t),$(vt.$$.fragment,t),$(wt.$$.fragment,t),$(qe.$$.fragment,t),$(je.$$.fragment,t),$($t.$$.fragment,t),$(yt.$$.fragment,t),$(Gt.$$.fragment,t),$(Me.$$.fragment,t),$(Ae.$$.fragment,t),$(Le.$$.fragment,t),$(Xt.$$.fragment,t),$(Ft.$$.fragment,t),$(zt.$$.fragment,t),$(Se.$$.fragment,t),$(Ie.$$.fragment,t),$(De.$$.fragment,t),$(qt.$$.fragment,t),$(jt.$$.fragment,t),$(Et.$$.fragment,t),$(He.$$.fragment,t),$(Be.$$.fragment,t),jn=!0)},o(t){y(n.$$.fragment,t),y(Ze.$$.fragment,t),y(ot.$$.fragment,t),y(nt.$$.fragment,t),y(st.$$.fragment,t),y(at.$$.fragment,t),y(rt.$$.fragment,t),y(it.$$.fragment,t),y(ye.$$.fragment,t),y(dt.$$.fragment,t),y(ct.$$.fragment,t),y(Ne.$$.fragment,t),y(Ge.$$.fragment,t),y(mt.$$.fragment,t),y(ft.$$.fragment,t),y(Tt.$$.fragment,t),y(Fe.$$.fragment,t),y(xe.$$.fragment,t),y(Ce.$$.fragment,t),y(bt.$$.fragment,t),y(vt.$$.fragment,t),y(wt.$$.fragment,t),y(qe.$$.fragment,t),y(je.$$.fragment,t),y($t.$$.fragment,t),y(yt.$$.fragment,t),y(Gt.$$.fragment,t),y(Me.$$.fragment,t),y(Ae.$$.fragment,t),y(Le.$$.fragment,t),y(Xt.$$.fragment,t),y(Ft.$$.fragment,t),y(zt.$$.fragment,t),y(Se.$$.fragment,t),y(Ie.$$.fragment,t),y(De.$$.fragment,t),y(qt.$$.fragment,t),y(jt.$$.fragment,t),y(Et.$$.fragment,t),y(He.$$.fragment,t),y(Be.$$.fragment,t),jn=!1},d(t){o(s),t&&o(b),t&&o(c),P(n),t&&o(X),t&&o(C),P(Ze),t&&o(cn),t&&o(Te),t&&o(pn),t&&o(be),t&&o(hn),t&&o(It),t&&o(un),P(ot,t),t&&o(mn),t&&o(Dt),t&&o(fn),t&&o(Z),P(nt),t&&o(gn),t&&o(ke),t&&o(_n),P(st,t),t&&o(Tn),t&&o(ee),P(at),t&&o(bn),t&&o(Wt),t&&o(vn),t&&o(te),P(rt),t&&o(kn),t&&o(L),P(it),P(ye),t&&o(wn),t&&o(se),P(dt),t&&o($n),t&&o(x),P(ct),P(Ne),P(Ge),t&&o(yn),t&&o(ae),P(mt),t&&o(Pn),t&&o(B),P(ft),P(Tt),P(Fe),P(xe),P(Ce),t&&o(Nn),t&&o(ie),P(bt),t&&o(Gn),t&&o(Q),P(vt),P(wt),P(qe),P(je),t&&o(Xn),t&&o(ce),P($t),t&&o(Fn),t&&o(O),P(yt),P(Gt),P(Me),P(Ae),P(Le),t&&o(xn),t&&o(ue),P(Xt),t&&o(Cn),t&&o(q),P(Ft),P(zt),P(Se),P(Ie),P(De),t&&o(zn),t&&o(fe),P(qt),t&&o(qn),t&&o(ge),P(jt),P(Et),P(He),P(Be)}}}const ul={local:"gptneox",sections:[{local:"overview",sections:[{local:"generation",title:"Generation"}],title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.GPTNeoXConfig",title:"GPTNeoXConfig"},{local:"transformers.GPTNeoXTokenizerFast",title:"GPTNeoXTokenizerFast"},{local:"transformers.GPTNeoXModel",title:"GPTNeoXModel"},{local:"transformers.GPTNeoXForCausalLM",title:"GPTNeoXForCausalLM"},{local:"transformers.GPTNeoXForQuestionAnswering",title:"GPTNeoXForQuestionAnswering"},{local:"transformers.GPTNeoXForSequenceClassification",title:"GPTNeoXForSequenceClassification"},{local:"transformers.GPTNeoXForTokenClassification",title:"GPTNeoXForTokenClassification"}],title:"GPT-NeoX"};function ml(N){return Ji(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class kl extends Bi{constructor(s){super();Qi(this,s,ml,hl,Ui,{})}}export{kl as default,ul as metadata};
