import{S as pp,i as hp,s as up,e as s,k as h,w as b,t as i,M as mp,c as a,d as t,m as u,a as r,x as k,h as l,b as c,G as e,g as T,y,q as w,o as $,B as P,v as fp,L as Ce}from"../../chunks/vendor-hf-doc-builder.js";import{T as _t}from"../../chunks/Tip-hf-doc-builder.js";import{D as j}from"../../chunks/Docstring-hf-doc-builder.js";import{C as le}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as X}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Me}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function gp(N){let d,v,f,m,_;return m=new le({props:{code:`from transformers import GPTNeoConfig, GPTNeoModel

# Initializing a GPTNeo EleutherAI/gpt-neo-1.3B style configuration
configuration = GPTNeoConfig()

# Initializing a model (with random weights) from the EleutherAI/gpt-neo-1.3B style configuration
model = GPTNeoModel(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> GPTNeoConfig, GPTNeoModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a GPTNeo EleutherAI/gpt-neo-1.3B style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = GPTNeoConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the EleutherAI/gpt-neo-1.3B style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoModel(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(){d=s("p"),v=i("Example:"),f=h(),b(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);v=l(p,"Example:"),p.forEach(t),f=u(n),k(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),y(m,n,p),_=!0},p:Ce,i(n){_||(w(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),P(m,n)}}}function _p(N){let d,v,f,m,_;return{c(){d=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=i("Module"),_=i(`
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){d=a(n,"P",{});var p=r(d);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var x=r(f);m=l(x,"Module"),x.forEach(t),_=l(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(t)},m(n,p){T(n,d,p),e(d,v),e(d,f),e(f,m),e(d,_)},d(n){n&&t(d)}}}function Tp(N){let d,v,f,m,_;return m=new le({props:{code:`from transformers import AutoTokenizer, GPTNeoModel
import torch

tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neo-1.3B")
model = GPTNeoModel.from_pretrained("EleutherAI/gpt-neo-1.3B")

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, GPTNeoModel
<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-neo-1.3B&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoModel.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&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(){d=s("p"),v=i("Example:"),f=h(),b(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);v=l(p,"Example:"),p.forEach(t),f=u(n),k(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),y(m,n,p),_=!0},p:Ce,i(n){_||(w(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),P(m,n)}}}function vp(N){let d,v,f,m,_;return{c(){d=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=i("Module"),_=i(`
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){d=a(n,"P",{});var p=r(d);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var x=r(f);m=l(x,"Module"),x.forEach(t),_=l(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(t)},m(n,p){T(n,d,p),e(d,v),e(d,f),e(f,m),e(d,_)},d(n){n&&t(d)}}}function bp(N){let d,v,f,m,_;return m=new le({props:{code:`import torch
from transformers import AutoTokenizer, GPTNeoForCausalLM

tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neo-1.3B")
model = GPTNeoForCausalLM.from_pretrained("EleutherAI/gpt-neo-1.3B")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs, labels=inputs["input_ids"])
loss = outputs.loss
logits = outputs.logits`,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, GPTNeoForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoForCausalLM.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=s("p"),v=i("Example:"),f=h(),b(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);v=l(p,"Example:"),p.forEach(t),f=u(n),k(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),y(m,n,p),_=!0},p:Ce,i(n){_||(w(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),P(m,n)}}}function kp(N){let d,v,f,m,_;return{c(){d=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=i("Module"),_=i(`
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){d=a(n,"P",{});var p=r(d);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var x=r(f);m=l(x,"Module"),x.forEach(t),_=l(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(t)},m(n,p){T(n,d,p),e(d,v),e(d,f),e(f,m),e(d,_)},d(n){n&&t(d)}}}function yp(N){let d,v,f,m,_,n,p,x;return{c(){d=s("p"),v=i(`This example uses a random model as the real ones are all very big. To get proper results, you should use
EleutherAI/gpt-neo-1.3B instead of EleutherAI/gpt-neo-1.3B. If you get out-of-memory when loading that checkpoint, you can try
adding `),f=s("code"),m=i('device_map="auto"'),_=i(" in the "),n=s("code"),p=i("from_pretrained"),x=i(" call.")},l(de){d=a(de,"P",{});var D=r(d);v=l(D,`This example uses a random model as the real ones are all very big. To get proper results, you should use
EleutherAI/gpt-neo-1.3B instead of EleutherAI/gpt-neo-1.3B. If you get out-of-memory when loading that checkpoint, you can try
adding `),f=a(D,"CODE",{});var H=r(f);m=l(H,'device_map="auto"'),H.forEach(t),_=l(D," in the "),n=a(D,"CODE",{});var K=r(n);p=l(K,"from_pretrained"),K.forEach(t),x=l(D," call."),D.forEach(t)},m(de,D){T(de,d,D),e(d,v),e(d,f),e(f,m),e(d,_),e(d,n),e(n,p),e(d,x)},d(de){de&&t(d)}}}function wp(N){let d,v,f,m,_;return m=new le({props:{code:`from transformers import AutoTokenizer, GPTNeoForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neo-1.3B")
model = GPTNeoForQuestionAnswering.from_pretrained("EleutherAI/gpt-neo-1.3B")

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, GPTNeoForQuestionAnswering
<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-neo-1.3B&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&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(){d=s("p"),v=i("Example:"),f=h(),b(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);v=l(p,"Example:"),p.forEach(t),f=u(n),k(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),y(m,n,p),_=!0},p:Ce,i(n){_||(w(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),P(m,n)}}}function $p(N){let d,v,f,m,_;return{c(){d=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=i("Module"),_=i(`
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){d=a(n,"P",{});var p=r(d);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var x=r(f);m=l(x,"Module"),x.forEach(t),_=l(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(t)},m(n,p){T(n,d,p),e(d,v),e(d,f),e(f,m),e(d,_)},d(n){n&&t(d)}}}function Pp(N){let d,v,f,m,_;return m=new le({props:{code:`import torch
from transformers import AutoTokenizer, GPTNeoForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neo-1.3B")
model = GPTNeoForSequenceClassification.from_pretrained("EleutherAI/gpt-neo-1.3B")

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 = GPTNeoForSequenceClassification.from_pretrained("EleutherAI/gpt-neo-1.3B", 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, GPTNeoForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&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 = GPTNeoForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&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(){d=s("p"),v=i("Example of single-label classification:"),f=h(),b(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);v=l(p,"Example of single-label classification:"),p.forEach(t),f=u(n),k(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),y(m,n,p),_=!0},p:Ce,i(n){_||(w(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),P(m,n)}}}function Np(N){let d,v,f,m,_;return m=new le({props:{code:`import torch
from transformers import AutoTokenizer, GPTNeoForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neo-1.3B")
model = GPTNeoForSequenceClassification.from_pretrained("EleutherAI/gpt-neo-1.3B", 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 = GPTNeoForSequenceClassification.from_pretrained(
    "EleutherAI/gpt-neo-1.3B", 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, GPTNeoForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&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 = GPTNeoForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&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(){d=s("p"),v=i("Example of multi-label classification:"),f=h(),b(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);v=l(p,"Example of multi-label classification:"),p.forEach(t),f=u(n),k(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),y(m,n,p),_=!0},p:Ce,i(n){_||(w(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),P(m,n)}}}function xp(N){let d,v,f,m,_;return{c(){d=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=i("Module"),_=i(`
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){d=a(n,"P",{});var p=r(d);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var x=r(f);m=l(x,"Module"),x.forEach(t),_=l(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(t)},m(n,p){T(n,d,p),e(d,v),e(d,f),e(f,m),e(d,_)},d(n){n&&t(d)}}}function Fp(N){let d,v,f,m,_;return m=new le({props:{code:`from transformers import AutoTokenizer, GPTNeoForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neo-125m")
model = GPTNeoForTokenClassification.from_pretrained("EleutherAI/gpt-neo-125m")

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, GPTNeoForTokenClassification
<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-neo-125m&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoForTokenClassification.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-125m&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(){d=s("p"),v=i("Example:"),f=h(),b(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);v=l(p,"Example:"),p.forEach(t),f=u(n),k(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),y(m,n,p),_=!0},p:Ce,i(n){_||(w(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),P(m,n)}}}function Gp(N){let d,v,f,m,_;return{c(){d=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=i("Module"),_=i(`
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){d=a(n,"P",{});var p=r(d);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var x=r(f);m=l(x,"Module"),x.forEach(t),_=l(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(t)},m(n,p){T(n,d,p),e(d,v),e(d,f),e(f,m),e(d,_)},d(n){n&&t(d)}}}function Ep(N){let d,v,f,m,_;return m=new le({props:{code:`from transformers import AutoTokenizer, FlaxGPTNeoModel

tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neo-1.3B")
model = FlaxGPTNeoModel.from_pretrained("EleutherAI/gpt-neo-1.3B")

inputs = tokenizer("Hello, my dog is cute", return_tensors="jax")
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, FlaxGPTNeoModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxGPTNeoModel.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&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;jax&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(){d=s("p"),v=i("Example:"),f=h(),b(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);v=l(p,"Example:"),p.forEach(t),f=u(n),k(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),y(m,n,p),_=!0},p:Ce,i(n){_||(w(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),P(m,n)}}}function Mp(N){let d,v,f,m,_;return{c(){d=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=i("Module"),_=i(`
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){d=a(n,"P",{});var p=r(d);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var x=r(f);m=l(x,"Module"),x.forEach(t),_=l(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(t)},m(n,p){T(n,d,p),e(d,v),e(d,f),e(f,m),e(d,_)},d(n){n&&t(d)}}}function Cp(N){let d,v,f,m,_;return m=new le({props:{code:`from transformers import AutoTokenizer, FlaxGPTNeoForCausalLM

tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neo-1.3B")
model = FlaxGPTNeoForCausalLM.from_pretrained("EleutherAI/gpt-neo-1.3B")

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

# retrieve logts for next token
next_token_logits = outputs.logits[:, -1]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxGPTNeoForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxGPTNeoForCausalLM.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&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;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve logts for next token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_token_logits = outputs.logits[:, -<span class="hljs-number">1</span>]`}}),{c(){d=s("p"),v=i("Example:"),f=h(),b(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);v=l(p,"Example:"),p.forEach(t),f=u(n),k(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),y(m,n,p),_=!0},p:Ce,i(n){_||(w(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),P(m,n)}}}function zp(N){let d,v,f,m,_,n,p,x,de,D,H,K,an,Tt,ga,rn,_a,bs,ee,Ta,vt,va,ba,bt,ka,ya,ks,Go,wa,ys,ze,$a,kt,Pa,Na,ws,ce,qe,ln,yt,xa,dn,Fa,$s,je,Ga,cn,Ea,Ma,Ps,wt,Ns,pe,Ae,pn,$t,Ca,hn,za,xs,Ie,un,Eo,qa,ja,mn,Mo,Aa,Fs,he,Le,fn,Pt,Ia,gn,La,Gs,B,Nt,Oa,ue,Sa,Co,Da,Ba,xt,Wa,Ha,Qa,me,Ua,zo,Va,Ja,qo,Ra,Xa,Ka,Oe,Es,fe,Se,_n,Ft,Ya,Tn,Za,Ms,M,Gt,er,vn,tr,or,Et,nr,jo,sr,ar,rr,Mt,ir,Ct,lr,dr,cr,Q,zt,pr,ge,hr,Ao,ur,mr,bn,fr,gr,_r,De,Tr,Be,Cs,_e,We,kn,qt,vr,yn,br,zs,C,jt,kr,wn,yr,wr,At,$r,Io,Pr,Nr,xr,It,Fr,Lt,Gr,Er,Mr,U,Ot,Cr,Te,zr,Lo,qr,jr,$n,Ar,Ir,Lr,He,Or,Qe,qs,ve,Ue,Pn,St,Sr,Nn,Dr,js,z,Dt,Br,be,Wr,xn,Hr,Qr,Fn,Ur,Vr,Jr,Bt,Rr,Oo,Xr,Kr,Yr,Wt,Zr,Ht,ei,ti,oi,A,Qt,ni,ke,si,So,ai,ri,Gn,ii,li,di,Ve,ci,Je,pi,Re,As,ye,Xe,En,Ut,hi,Mn,ui,Is,F,Vt,mi,Cn,fi,gi,Do,Bo,_i,Ti,vi,W,bi,zn,ki,yi,qn,wi,$i,jn,Pi,Ni,An,xi,Fi,Gi,Jt,Ei,Wo,Mi,Ci,zi,Rt,qi,Xt,ji,Ai,Ii,I,Kt,Li,we,Oi,Ho,Si,Di,In,Bi,Wi,Hi,Ke,Qi,Ye,Ui,Ze,Ls,$e,et,Ln,Yt,Vi,On,Ji,Os,q,Zt,Ri,Sn,Xi,Ki,eo,Yi,Qo,Zi,el,tl,to,ol,oo,nl,sl,al,V,no,rl,Pe,il,Uo,ll,dl,Dn,cl,pl,hl,tt,ul,ot,Ss,Ne,nt,Bn,so,ml,Wn,fl,Ds,G,ao,gl,Hn,_l,Tl,ro,vl,Vo,bl,kl,yl,io,wl,lo,$l,Pl,Nl,Qn,xl,Fl,Y,Un,co,Gl,El,Vn,po,Ml,Cl,Jn,ho,zl,ql,Rn,uo,jl,Al,J,mo,Il,xe,Ll,Xn,Ol,Sl,Kn,Dl,Bl,Wl,st,Hl,at,Bs,Fe,rt,Yn,fo,Ql,Zn,Ul,Ws,E,go,Vl,es,Jl,Rl,_o,Xl,Jo,Kl,Yl,Zl,To,ed,vo,td,od,nd,ts,sd,ad,Z,os,bo,rd,id,ns,ko,ld,dd,ss,yo,cd,pd,as,wo,hd,ud,R,$o,md,Ge,fd,rs,gd,_d,is,Td,vd,bd,it,kd,lt,Hs;return n=new X({}),Tt=new X({}),yt=new X({}),wt=new le({props:{code:`from transformers import GPTNeoForCausalLM, GPT2Tokenizer

model = GPTNeoForCausalLM.from_pretrained("EleutherAI/gpt-neo-1.3B")
tokenizer = GPT2Tokenizer.from_pretrained("EleutherAI/gpt-neo-1.3B")

prompt = (
    "In a shocking finding, scientists discovered a herd of unicorns living in a remote, "
    "previously unexplored valley, in the Andes Mountains. Even more surprising to the "
    "researchers was the fact that the unicorns spoke perfect English."
)

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> GPTNeoForCausalLM, GPT2Tokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoForCausalLM.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = GPT2Tokenizer.from_pretrained(<span class="hljs-string">&quot;EleutherAI/gpt-neo-1.3B&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = (
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;In a shocking finding, scientists discovered a herd of unicorns living in a remote, &quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;previously unexplored valley, in the Andes Mountains. Even more surprising to the &quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;researchers was the fact that the unicorns spoke perfect English.&quot;</span>
<span class="hljs-meta">... </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>]`}}),$t=new X({}),Pt=new X({}),Nt=new j({props:{name:"class transformers.GPTNeoConfig",anchor:"transformers.GPTNeoConfig",parameters:[{name:"vocab_size",val:" = 50257"},{name:"max_position_embeddings",val:" = 2048"},{name:"hidden_size",val:" = 2048"},{name:"num_layers",val:" = 24"},{name:"attention_types",val:" = [[['global', 'local'], 12]]"},{name:"num_heads",val:" = 16"},{name:"intermediate_size",val:" = None"},{name:"window_size",val:" = 256"},{name:"activation_function",val:" = 'gelu_new'"},{name:"resid_dropout",val:" = 0.0"},{name:"embed_dropout",val:" = 0.0"},{name:"attention_dropout",val:" = 0.0"},{name:"classifier_dropout",val:" = 0.1"},{name:"layer_norm_epsilon",val:" = 1e-05"},{name:"initializer_range",val:" = 0.02"},{name:"use_cache",val:" = True"},{name:"bos_token_id",val:" = 50256"},{name:"eos_token_id",val:" = 50256"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50257) &#x2014;
Vocabulary size of the GPT Neo 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_neo#transformers.GPTNeoModel">GPTNeoModel</a>. Vocabulary size of the model. Defines the different
tokens that can be represented by the <em>inputs_ids</em> passed to the forward method of <a href="/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoModel">GPTNeoModel</a>.`,name:"vocab_size"},{anchor:"transformers.GPTNeoConfig.attention_types",description:`<strong>attention_types</strong> (<code>List</code>, <em>optional</em>, defaults to <code>[[[&quot;global&quot;, &quot;local&quot;], 12]]</code>) &#x2014;
The type of attention for each layer in a <code>List</code> of the following format <code>[[[&quot;attention_type&quot;], num_layerss]]</code> e.g. for a 24 layer model <code>[[[&quot;global&quot;], 24]]</code> or <code>[[[&quot;global&quot;, &quot;local&quot;], 12]]</code> Choose the
value of <code>attention_type</code> from <code>[&quot;global&quot;, &quot;local&quot;]</code>`,name:"attention_types"},{anchor:"transformers.GPTNeoConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.GPTNeoConfig.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_layers"},{anchor:"transformers.GPTNeoConfig.num_heads",description:`<strong>num_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_heads"},{anchor:"transformers.GPTNeoConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 8192) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.GPTNeoConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu_new&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:"activation_function"},{anchor:"transformers.GPTNeoConfig.embed_dropout",description:`<strong>embed_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"embed_dropout"},{anchor:"transformers.GPTNeoConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.GPTNeoConfig.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_neo#transformers.GPTNeoForTokenClassification">GPTNeoForTokenClassification</a>.</p>
<p>The dropout ratio for the hidden layer.`,name:"classifier_dropout"},{anchor:"transformers.GPTNeoConfig.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.GPTNeoConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoModel">GPTNeoModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.GPTNeoConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.GPTNeoConfig.layer_norm_epsilon",description:`<strong>layer_norm_epsilon</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_epsilon"},{anchor:"transformers.GPTNeoConfig.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"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neo/configuration_gpt_neo.py#L34"}}),Oe=new Me({props:{anchor:"transformers.GPTNeoConfig.example",$$slots:{default:[gp]},$$scope:{ctx:N}}}),Ft=new X({}),Gt=new j({props:{name:"class transformers.GPTNeoModel",anchor:"transformers.GPTNeoModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoConfig">GPTNeoConfig</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_neo/modeling_gpt_neo.py#L476"}}),zt=new j({props:{name:"forward",anchor:"transformers.GPTNeoModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"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.GPTNeoModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else
<code>past_key_values[0][0].shape[-2]</code> (<code>sequence_length</code> of input past key value states). Indices of input
sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.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.GPTNeoModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.num_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"past_key_values"},{anchor:"transformers.GPTNeoModel.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.GPTNeoModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.GPTNeoModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTNeoModel.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.GPTNeoModel.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 <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.GPTNeoModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.GPTNeoModel.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.GPTNeoModel.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.GPTNeoModel.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"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neo/modeling_gpt_neo.py#L497",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoConfig"
>GPTNeoConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),De=new _t({props:{$$slots:{default:[_p]},$$scope:{ctx:N}}}),Be=new Me({props:{anchor:"transformers.GPTNeoModel.forward.example",$$slots:{default:[Tp]},$$scope:{ctx:N}}}),qt=new X({}),jt=new j({props:{name:"class transformers.GPTNeoForCausalLM",anchor:"transformers.GPTNeoForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoConfig">GPTNeoConfig</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_neo/modeling_gpt_neo.py#L664"}}),Ot=new j({props:{name:"forward",anchor:"transformers.GPTNeoForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GPTNeoForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else
<code>past_key_values[0][0].shape[-2]</code> (<code>sequence_length</code> of input past key value states). Indices of input
sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.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.GPTNeoForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.num_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"past_key_values"},{anchor:"transformers.GPTNeoForCausalLM.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.GPTNeoForCausalLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.GPTNeoForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTNeoForCausalLM.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.GPTNeoForCausalLM.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 <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.GPTNeoForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.GPTNeoForCausalLM.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.GPTNeoForCausalLM.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.GPTNeoForCausalLM.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.GPTNeoForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for language modeling. Note that the labels <strong>are shifted</strong> inside the model, i.e. you can set
<code>labels = input_ids</code> Indices are selected in <code>[-100, 0, ..., config.vocab_size]</code> All labels set to <code>-100</code>
are ignored (masked), the loss is only computed for labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neo/modeling_gpt_neo.py#L714",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoConfig"
>GPTNeoConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),He=new _t({props:{$$slots:{default:[vp]},$$scope:{ctx:N}}}),Qe=new Me({props:{anchor:"transformers.GPTNeoForCausalLM.forward.example",$$slots:{default:[bp]},$$scope:{ctx:N}}}),St=new X({}),Dt=new j({props:{name:"class transformers.GPTNeoForQuestionAnswering",anchor:"transformers.GPTNeoForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoConfig">GPTNeoConfig</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_neo/modeling_gpt_neo.py#L1025"}}),Qt=new j({props:{name:"forward",anchor:"transformers.GPTNeoForQuestionAnswering.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.GPTNeoForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else
<code>past_key_values[0][0].shape[-2]</code> (<code>sequence_length</code> of input past key value states). Indices of input
sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.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.GPTNeoForQuestionAnswering.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.num_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"past_key_values"},{anchor:"transformers.GPTNeoForQuestionAnswering.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.GPTNeoForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.GPTNeoForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTNeoForQuestionAnswering.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.GPTNeoForQuestionAnswering.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 <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.GPTNeoForQuestionAnswering.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.GPTNeoForQuestionAnswering.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.GPTNeoForQuestionAnswering.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.GPTNeoForQuestionAnswering.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.GPTNeoForQuestionAnswering.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.GPTNeoForQuestionAnswering.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_neo/modeling_gpt_neo.py#L1037",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_neo#transformers.GPTNeoConfig"
>GPTNeoConfig</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>
`}}),Ve=new _t({props:{$$slots:{default:[kp]},$$scope:{ctx:N}}}),Je=new _t({props:{warning:!0,$$slots:{default:[yp]},$$scope:{ctx:N}}}),Re=new Me({props:{anchor:"transformers.GPTNeoForQuestionAnswering.forward.example",$$slots:{default:[wp]},$$scope:{ctx:N}}}),Ut=new X({}),Vt=new j({props:{name:"class transformers.GPTNeoForSequenceClassification",anchor:"transformers.GPTNeoForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoConfig">GPTNeoConfig</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_neo/modeling_gpt_neo.py#L820"}}),Kt=new j({props:{name:"forward",anchor:"transformers.GPTNeoForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GPTNeoForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else
<code>past_key_values[0][0].shape[-2]</code> (<code>sequence_length</code> of input past key value states). Indices of input
sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.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.GPTNeoForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.num_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"past_key_values"},{anchor:"transformers.GPTNeoForSequenceClassification.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.GPTNeoForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.GPTNeoForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTNeoForSequenceClassification.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.GPTNeoForSequenceClassification.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 <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.GPTNeoForSequenceClassification.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.GPTNeoForSequenceClassification.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.GPTNeoForSequenceClassification.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.GPTNeoForSequenceClassification.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.GPTNeoForSequenceClassification.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_neo/modeling_gpt_neo.py#L832",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_neo#transformers.GPTNeoConfig"
>GPTNeoConfig</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>
`}}),Ke=new _t({props:{$$slots:{default:[$p]},$$scope:{ctx:N}}}),Ye=new Me({props:{anchor:"transformers.GPTNeoForSequenceClassification.forward.example",$$slots:{default:[Pp]},$$scope:{ctx:N}}}),Ze=new Me({props:{anchor:"transformers.GPTNeoForSequenceClassification.forward.example-2",$$slots:{default:[Np]},$$scope:{ctx:N}}}),Yt=new X({}),Zt=new j({props:{name:"class transformers.GPTNeoForTokenClassification",anchor:"transformers.GPTNeoForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoConfig">GPTNeoConfig</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_neo/modeling_gpt_neo.py#L940"}}),no=new j({props:{name:"forward",anchor:"transformers.GPTNeoForTokenClassification.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.GPTNeoForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else
<code>past_key_values[0][0].shape[-2]</code> (<code>sequence_length</code> of input past key value states). Indices of input
sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.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.GPTNeoForTokenClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.num_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"past_key_values"},{anchor:"transformers.GPTNeoForTokenClassification.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.GPTNeoForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.GPTNeoForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTNeoForTokenClassification.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.GPTNeoForTokenClassification.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 <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.GPTNeoForTokenClassification.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.GPTNeoForTokenClassification.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.GPTNeoForTokenClassification.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.GPTNeoForTokenClassification.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.GPTNeoForTokenClassification.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_neo/modeling_gpt_neo.py#L952",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_neo#transformers.GPTNeoConfig"
>GPTNeoConfig</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>
`}}),tt=new _t({props:{$$slots:{default:[xp]},$$scope:{ctx:N}}}),ot=new Me({props:{anchor:"transformers.GPTNeoForTokenClassification.forward.example",$$slots:{default:[Fp]},$$scope:{ctx:N}}}),so=new X({}),ao=new j({props:{name:"class transformers.FlaxGPTNeoModel",anchor:"transformers.FlaxGPTNeoModel",parameters:[{name:"config",val:": GPTNeoConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxGPTNeoModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoConfig">GPTNeoConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxGPTNeoModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neo/modeling_flax_gpt_neo.py#L591"}}),mo=new j({props:{name:"__call__",anchor:"transformers.FlaxGPTNeoModel.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"position_ids",val:" = None"},{name:"params",val:": dict = None"},{name:"past_key_values",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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.FlaxGPTNeoModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code>. 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.FlaxGPTNeoModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxGPTNeoModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxGPTNeoModel.__call__.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxGPTNeoModel.__call__.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.FlaxGPTNeoModel.__call__.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.FlaxGPTNeoModel.__call__.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"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neo/modeling_flax_gpt_neo.py#L401",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</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_neo#transformers.GPTNeoConfig"
>GPTNeoConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</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>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),st=new _t({props:{$$slots:{default:[Gp]},$$scope:{ctx:N}}}),at=new Me({props:{anchor:"transformers.FlaxGPTNeoModel.__call__.example",$$slots:{default:[Ep]},$$scope:{ctx:N}}}),fo=new X({}),go=new j({props:{name:"class transformers.FlaxGPTNeoForCausalLM",anchor:"transformers.FlaxGPTNeoForCausalLM",parameters:[{name:"config",val:": GPTNeoConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxGPTNeoForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoConfig">GPTNeoConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxGPTNeoForCausalLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neo/modeling_flax_gpt_neo.py#L654"}}),$o=new j({props:{name:"__call__",anchor:"transformers.FlaxGPTNeoForCausalLM.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"position_ids",val:" = None"},{name:"params",val:": dict = None"},{name:"past_key_values",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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.FlaxGPTNeoForCausalLM.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code>. 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.FlaxGPTNeoForCausalLM.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxGPTNeoForCausalLM.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxGPTNeoForCausalLM.__call__.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxGPTNeoForCausalLM.__call__.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.FlaxGPTNeoForCausalLM.__call__.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.FlaxGPTNeoForCausalLM.__call__.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"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neo/modeling_flax_gpt_neo.py#L401",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</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_neo#transformers.GPTNeoConfig"
>GPTNeoConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),it=new _t({props:{$$slots:{default:[Mp]},$$scope:{ctx:N}}}),lt=new Me({props:{anchor:"transformers.FlaxGPTNeoForCausalLM.__call__.example",$$slots:{default:[Cp]},$$scope:{ctx:N}}}),{c(){d=s("meta"),v=h(),f=s("h1"),m=s("a"),_=s("span"),b(n.$$.fragment),p=h(),x=s("span"),de=i("GPT Neo"),D=h(),H=s("h2"),K=s("a"),an=s("span"),b(Tt.$$.fragment),ga=h(),rn=s("span"),_a=i("Overview"),bs=h(),ee=s("p"),Ta=i("The GPTNeo model was released in the "),vt=s("a"),va=i("EleutherAI/gpt-neo"),ba=i(` repository by Sid
Black, Stella Biderman, Leo Gao, Phil Wang and Connor Leahy. It is a GPT2 like causal language model trained on the
`),bt=s("a"),ka=i("Pile"),ya=i(" dataset."),ks=h(),Go=s("p"),wa=i(`The architecture is similar to GPT2 except that GPT Neo uses local attention in every other layer with a window size of
256 tokens.`),ys=h(),ze=s("p"),$a=i("This model was contributed by "),kt=s("a"),Pa=i("valhalla"),Na=i("."),ws=h(),ce=s("h3"),qe=s("a"),ln=s("span"),b(yt.$$.fragment),xa=h(),dn=s("span"),Fa=i("Generation"),$s=h(),je=s("p"),Ga=i("The "),cn=s("code"),Ea=i("generate()"),Ma=i(" method can be used to generate text using GPT Neo model."),Ps=h(),b(wt.$$.fragment),Ns=h(),pe=s("h2"),Ae=s("a"),pn=s("span"),b($t.$$.fragment),Ca=h(),hn=s("span"),za=i("Documentation resources"),xs=h(),Ie=s("ul"),un=s("li"),Eo=s("a"),qa=i("Text classification task guide"),ja=h(),mn=s("li"),Mo=s("a"),Aa=i("Causal language modeling task guide"),Fs=h(),he=s("h2"),Le=s("a"),fn=s("span"),b(Pt.$$.fragment),Ia=h(),gn=s("span"),La=i("GPTNeoConfig"),Gs=h(),B=s("div"),b(Nt.$$.fragment),Oa=h(),ue=s("p"),Sa=i("This is the configuration class to store the configuration of a "),Co=s("a"),Da=i("GPTNeoModel"),Ba=i(`. It is used to instantiate a GPT
Neo 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 GPTNeo
`),xt=s("a"),Wa=i("EleutherAI/gpt-neo-1.3B"),Ha=i(" architecture."),Qa=h(),me=s("p"),Ua=i("Configuration objects inherit from "),zo=s("a"),Va=i("PretrainedConfig"),Ja=i(` and can be used to control the model outputs. Read the
documentation from `),qo=s("a"),Ra=i("PretrainedConfig"),Xa=i(" for more information."),Ka=h(),b(Oe.$$.fragment),Es=h(),fe=s("h2"),Se=s("a"),_n=s("span"),b(Ft.$$.fragment),Ya=h(),Tn=s("span"),Za=i("GPTNeoModel"),Ms=h(),M=s("div"),b(Gt.$$.fragment),er=h(),vn=s("p"),tr=i("The bare GPT Neo Model transformer outputting raw hidden-states without any specific head on top."),or=h(),Et=s("p"),nr=i("This model inherits from "),jo=s("a"),sr=i("PreTrainedModel"),ar=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),rr=h(),Mt=s("p"),ir=i("This model is also a PyTorch "),Ct=s("a"),lr=i("torch.nn.Module"),dr=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),cr=h(),Q=s("div"),b(zt.$$.fragment),pr=h(),ge=s("p"),hr=i("The "),Ao=s("a"),ur=i("GPTNeoModel"),mr=i(" forward method, overrides the "),bn=s("code"),fr=i("__call__"),gr=i(" special method."),_r=h(),b(De.$$.fragment),Tr=h(),b(Be.$$.fragment),Cs=h(),_e=s("h2"),We=s("a"),kn=s("span"),b(qt.$$.fragment),vr=h(),yn=s("span"),br=i("GPTNeoForCausalLM"),zs=h(),C=s("div"),b(jt.$$.fragment),kr=h(),wn=s("p"),yr=i(`The GPT Neo Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),wr=h(),At=s("p"),$r=i("This model inherits from "),Io=s("a"),Pr=i("PreTrainedModel"),Nr=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),xr=h(),It=s("p"),Fr=i("This model is also a PyTorch "),Lt=s("a"),Gr=i("torch.nn.Module"),Er=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Mr=h(),U=s("div"),b(Ot.$$.fragment),Cr=h(),Te=s("p"),zr=i("The "),Lo=s("a"),qr=i("GPTNeoForCausalLM"),jr=i(" forward method, overrides the "),$n=s("code"),Ar=i("__call__"),Ir=i(" special method."),Lr=h(),b(He.$$.fragment),Or=h(),b(Qe.$$.fragment),qs=h(),ve=s("h2"),Ue=s("a"),Pn=s("span"),b(St.$$.fragment),Sr=h(),Nn=s("span"),Dr=i("GPTNeoForQuestionAnswering"),js=h(),z=s("div"),b(Dt.$$.fragment),Br=h(),be=s("p"),Wr=i(`The GPT-Neo 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 `),xn=s("code"),Hr=i("span start logits"),Qr=i(" and "),Fn=s("code"),Ur=i("span end logits"),Vr=i(")."),Jr=h(),Bt=s("p"),Rr=i("This model inherits from "),Oo=s("a"),Xr=i("PreTrainedModel"),Kr=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Yr=h(),Wt=s("p"),Zr=i("This model is also a PyTorch "),Ht=s("a"),ei=i("torch.nn.Module"),ti=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),oi=h(),A=s("div"),b(Qt.$$.fragment),ni=h(),ke=s("p"),si=i("The "),So=s("a"),ai=i("GPTNeoForQuestionAnswering"),ri=i(" forward method, overrides the "),Gn=s("code"),ii=i("__call__"),li=i(" special method."),di=h(),b(Ve.$$.fragment),ci=h(),b(Je.$$.fragment),pi=h(),b(Re.$$.fragment),As=h(),ye=s("h2"),Xe=s("a"),En=s("span"),b(Ut.$$.fragment),hi=h(),Mn=s("span"),ui=i("GPTNeoForSequenceClassification"),Is=h(),F=s("div"),b(Vt.$$.fragment),mi=h(),Cn=s("p"),fi=i("The GPTNeo Model transformer with a sequence classification head on top (linear layer)."),gi=h(),Do=s("p"),Bo=s("a"),_i=i("GPTNeoForSequenceClassification"),Ti=i(` uses the last token in order to do the classification, as other causal models
(e.g. GPT-1) do.`),vi=h(),W=s("p"),bi=i(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),zn=s("code"),ki=i("pad_token_id"),yi=i(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),qn=s("code"),wi=i("pad_token_id"),$i=i(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),jn=s("code"),Pi=i("inputs_embeds"),Ni=i(" are passed instead of "),An=s("code"),xi=i("input_ids"),Fi=i(`, it does the same (take the last value in
each row of the batch).`),Gi=h(),Jt=s("p"),Ei=i("This model inherits from "),Wo=s("a"),Mi=i("PreTrainedModel"),Ci=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),zi=h(),Rt=s("p"),qi=i("This model is also a PyTorch "),Xt=s("a"),ji=i("torch.nn.Module"),Ai=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ii=h(),I=s("div"),b(Kt.$$.fragment),Li=h(),we=s("p"),Oi=i("The "),Ho=s("a"),Si=i("GPTNeoForSequenceClassification"),Di=i(" forward method, overrides the "),In=s("code"),Bi=i("__call__"),Wi=i(" special method."),Hi=h(),b(Ke.$$.fragment),Qi=h(),b(Ye.$$.fragment),Ui=h(),b(Ze.$$.fragment),Ls=h(),$e=s("h2"),et=s("a"),Ln=s("span"),b(Yt.$$.fragment),Vi=h(),On=s("span"),Ji=i("GPTNeoForTokenClassification"),Os=h(),q=s("div"),b(Zt.$$.fragment),Ri=h(),Sn=s("p"),Xi=i(`GPT Neo model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),Ki=h(),eo=s("p"),Yi=i("This model inherits from "),Qo=s("a"),Zi=i("PreTrainedModel"),el=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),tl=h(),to=s("p"),ol=i("This model is also a PyTorch "),oo=s("a"),nl=i("torch.nn.Module"),sl=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),al=h(),V=s("div"),b(no.$$.fragment),rl=h(),Pe=s("p"),il=i("The "),Uo=s("a"),ll=i("GPTNeoForTokenClassification"),dl=i(" forward method, overrides the "),Dn=s("code"),cl=i("__call__"),pl=i(" special method."),hl=h(),b(tt.$$.fragment),ul=h(),b(ot.$$.fragment),Ss=h(),Ne=s("h2"),nt=s("a"),Bn=s("span"),b(so.$$.fragment),ml=h(),Wn=s("span"),fl=i("FlaxGPTNeoModel"),Ds=h(),G=s("div"),b(ao.$$.fragment),gl=h(),Hn=s("p"),_l=i("The bare GPTNeo Model transformer outputting raw hidden-states without any specific head on top."),Tl=h(),ro=s("p"),vl=i("This model inherits from "),Vo=s("a"),bl=i("FlaxPreTrainedModel"),kl=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),yl=h(),io=s("p"),wl=i(`This model is also a Flax Linen
`),lo=s("a"),$l=i("flax.nn.Module"),Pl=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Nl=h(),Qn=s("p"),xl=i("Finally, this model supports inherent JAX features such as:"),Fl=h(),Y=s("ul"),Un=s("li"),co=s("a"),Gl=i("Just-In-Time (JIT) compilation"),El=h(),Vn=s("li"),po=s("a"),Ml=i("Automatic Differentiation"),Cl=h(),Jn=s("li"),ho=s("a"),zl=i("Vectorization"),ql=h(),Rn=s("li"),uo=s("a"),jl=i("Parallelization"),Al=h(),J=s("div"),b(mo.$$.fragment),Il=h(),xe=s("p"),Ll=i("The "),Xn=s("code"),Ol=i("FlaxGPTNeoPreTrainedModel"),Sl=i(" forward method, overrides the "),Kn=s("code"),Dl=i("__call__"),Bl=i(" special method."),Wl=h(),b(st.$$.fragment),Hl=h(),b(at.$$.fragment),Bs=h(),Fe=s("h2"),rt=s("a"),Yn=s("span"),b(fo.$$.fragment),Ql=h(),Zn=s("span"),Ul=i("FlaxGPTNeoForCausalLM"),Ws=h(),E=s("div"),b(go.$$.fragment),Vl=h(),es=s("p"),Jl=i(`The GPTNeo Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Rl=h(),_o=s("p"),Xl=i("This model inherits from "),Jo=s("a"),Kl=i("FlaxPreTrainedModel"),Yl=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Zl=h(),To=s("p"),ed=i(`This model is also a Flax Linen
`),vo=s("a"),td=i("flax.nn.Module"),od=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),nd=h(),ts=s("p"),sd=i("Finally, this model supports inherent JAX features such as:"),ad=h(),Z=s("ul"),os=s("li"),bo=s("a"),rd=i("Just-In-Time (JIT) compilation"),id=h(),ns=s("li"),ko=s("a"),ld=i("Automatic Differentiation"),dd=h(),ss=s("li"),yo=s("a"),cd=i("Vectorization"),pd=h(),as=s("li"),wo=s("a"),hd=i("Parallelization"),ud=h(),R=s("div"),b($o.$$.fragment),md=h(),Ge=s("p"),fd=i("The "),rs=s("code"),gd=i("FlaxGPTNeoPreTrainedModel"),_d=i(" forward method, overrides the "),is=s("code"),Td=i("__call__"),vd=i(" special method."),bd=h(),b(it.$$.fragment),kd=h(),b(lt.$$.fragment),this.h()},l(o){const g=mp('[data-svelte="svelte-1phssyn"]',document.head);d=a(g,"META",{name:!0,content:!0}),g.forEach(t),v=u(o),f=a(o,"H1",{class:!0});var Po=r(f);m=a(Po,"A",{id:!0,class:!0,href:!0});var ls=r(m);_=a(ls,"SPAN",{});var ds=r(_);k(n.$$.fragment,ds),ds.forEach(t),ls.forEach(t),p=u(Po),x=a(Po,"SPAN",{});var cs=r(x);de=l(cs,"GPT Neo"),cs.forEach(t),Po.forEach(t),D=u(o),H=a(o,"H2",{class:!0});var No=r(H);K=a(No,"A",{id:!0,class:!0,href:!0});var ps=r(K);an=a(ps,"SPAN",{});var hs=r(an);k(Tt.$$.fragment,hs),hs.forEach(t),ps.forEach(t),ga=u(No),rn=a(No,"SPAN",{});var us=r(rn);_a=l(us,"Overview"),us.forEach(t),No.forEach(t),bs=u(o),ee=a(o,"P",{});var Ee=r(ee);Ta=l(Ee,"The GPTNeo model was released in the "),vt=a(Ee,"A",{href:!0,rel:!0});var ms=r(vt);va=l(ms,"EleutherAI/gpt-neo"),ms.forEach(t),ba=l(Ee,` repository by Sid
Black, Stella Biderman, Leo Gao, Phil Wang and Connor Leahy. It is a GPT2 like causal language model trained on the
`),bt=a(Ee,"A",{href:!0,rel:!0});var fs=r(bt);ka=l(fs,"Pile"),fs.forEach(t),ya=l(Ee," dataset."),Ee.forEach(t),ks=u(o),Go=a(o,"P",{});var gs=r(Go);wa=l(gs,`The architecture is similar to GPT2 except that GPT Neo uses local attention in every other layer with a window size of
256 tokens.`),gs.forEach(t),ys=u(o),ze=a(o,"P",{});var xo=r(ze);$a=l(xo,"This model was contributed by "),kt=a(xo,"A",{href:!0,rel:!0});var _s=r(kt);Pa=l(_s,"valhalla"),_s.forEach(t),Na=l(xo,"."),xo.forEach(t),ws=u(o),ce=a(o,"H3",{class:!0});var Fo=r(ce);qe=a(Fo,"A",{id:!0,class:!0,href:!0});var Ts=r(qe);ln=a(Ts,"SPAN",{});var vs=r(ln);k(yt.$$.fragment,vs),vs.forEach(t),Ts.forEach(t),xa=u(Fo),dn=a(Fo,"SPAN",{});var wd=r(dn);Fa=l(wd,"Generation"),wd.forEach(t),Fo.forEach(t),$s=u(o),je=a(o,"P",{});var Qs=r(je);Ga=l(Qs,"The "),cn=a(Qs,"CODE",{});var $d=r(cn);Ea=l($d,"generate()"),$d.forEach(t),Ma=l(Qs," method can be used to generate text using GPT Neo model."),Qs.forEach(t),Ps=u(o),k(wt.$$.fragment,o),Ns=u(o),pe=a(o,"H2",{class:!0});var Us=r(pe);Ae=a(Us,"A",{id:!0,class:!0,href:!0});var Pd=r(Ae);pn=a(Pd,"SPAN",{});var Nd=r(pn);k($t.$$.fragment,Nd),Nd.forEach(t),Pd.forEach(t),Ca=u(Us),hn=a(Us,"SPAN",{});var xd=r(hn);za=l(xd,"Documentation resources"),xd.forEach(t),Us.forEach(t),xs=u(o),Ie=a(o,"UL",{});var Vs=r(Ie);un=a(Vs,"LI",{});var Fd=r(un);Eo=a(Fd,"A",{href:!0});var Gd=r(Eo);qa=l(Gd,"Text classification task guide"),Gd.forEach(t),Fd.forEach(t),ja=u(Vs),mn=a(Vs,"LI",{});var Ed=r(mn);Mo=a(Ed,"A",{href:!0});var Md=r(Mo);Aa=l(Md,"Causal language modeling task guide"),Md.forEach(t),Ed.forEach(t),Vs.forEach(t),Fs=u(o),he=a(o,"H2",{class:!0});var Js=r(he);Le=a(Js,"A",{id:!0,class:!0,href:!0});var Cd=r(Le);fn=a(Cd,"SPAN",{});var zd=r(fn);k(Pt.$$.fragment,zd),zd.forEach(t),Cd.forEach(t),Ia=u(Js),gn=a(Js,"SPAN",{});var qd=r(gn);La=l(qd,"GPTNeoConfig"),qd.forEach(t),Js.forEach(t),Gs=u(o),B=a(o,"DIV",{class:!0});var dt=r(B);k(Nt.$$.fragment,dt),Oa=u(dt),ue=a(dt,"P",{});var Ro=r(ue);Sa=l(Ro,"This is the configuration class to store the configuration of a "),Co=a(Ro,"A",{href:!0});var jd=r(Co);Da=l(jd,"GPTNeoModel"),jd.forEach(t),Ba=l(Ro,`. It is used to instantiate a GPT
Neo 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 GPTNeo
`),xt=a(Ro,"A",{href:!0,rel:!0});var Ad=r(xt);Wa=l(Ad,"EleutherAI/gpt-neo-1.3B"),Ad.forEach(t),Ha=l(Ro," architecture."),Ro.forEach(t),Qa=u(dt),me=a(dt,"P",{});var Xo=r(me);Ua=l(Xo,"Configuration objects inherit from "),zo=a(Xo,"A",{href:!0});var Id=r(zo);Va=l(Id,"PretrainedConfig"),Id.forEach(t),Ja=l(Xo,` and can be used to control the model outputs. Read the
documentation from `),qo=a(Xo,"A",{href:!0});var Ld=r(qo);Ra=l(Ld,"PretrainedConfig"),Ld.forEach(t),Xa=l(Xo," for more information."),Xo.forEach(t),Ka=u(dt),k(Oe.$$.fragment,dt),dt.forEach(t),Es=u(o),fe=a(o,"H2",{class:!0});var Rs=r(fe);Se=a(Rs,"A",{id:!0,class:!0,href:!0});var Od=r(Se);_n=a(Od,"SPAN",{});var Sd=r(_n);k(Ft.$$.fragment,Sd),Sd.forEach(t),Od.forEach(t),Ya=u(Rs),Tn=a(Rs,"SPAN",{});var Dd=r(Tn);Za=l(Dd,"GPTNeoModel"),Dd.forEach(t),Rs.forEach(t),Ms=u(o),M=a(o,"DIV",{class:!0});var te=r(M);k(Gt.$$.fragment,te),er=u(te),vn=a(te,"P",{});var Bd=r(vn);tr=l(Bd,"The bare GPT Neo Model transformer outputting raw hidden-states without any specific head on top."),Bd.forEach(t),or=u(te),Et=a(te,"P",{});var Xs=r(Et);nr=l(Xs,"This model inherits from "),jo=a(Xs,"A",{href:!0});var Wd=r(jo);sr=l(Wd,"PreTrainedModel"),Wd.forEach(t),ar=l(Xs,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Xs.forEach(t),rr=u(te),Mt=a(te,"P",{});var Ks=r(Mt);ir=l(Ks,"This model is also a PyTorch "),Ct=a(Ks,"A",{href:!0,rel:!0});var Hd=r(Ct);lr=l(Hd,"torch.nn.Module"),Hd.forEach(t),dr=l(Ks,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ks.forEach(t),cr=u(te),Q=a(te,"DIV",{class:!0});var ct=r(Q);k(zt.$$.fragment,ct),pr=u(ct),ge=a(ct,"P",{});var Ko=r(ge);hr=l(Ko,"The "),Ao=a(Ko,"A",{href:!0});var Qd=r(Ao);ur=l(Qd,"GPTNeoModel"),Qd.forEach(t),mr=l(Ko," forward method, overrides the "),bn=a(Ko,"CODE",{});var Ud=r(bn);fr=l(Ud,"__call__"),Ud.forEach(t),gr=l(Ko," special method."),Ko.forEach(t),_r=u(ct),k(De.$$.fragment,ct),Tr=u(ct),k(Be.$$.fragment,ct),ct.forEach(t),te.forEach(t),Cs=u(o),_e=a(o,"H2",{class:!0});var Ys=r(_e);We=a(Ys,"A",{id:!0,class:!0,href:!0});var Vd=r(We);kn=a(Vd,"SPAN",{});var Jd=r(kn);k(qt.$$.fragment,Jd),Jd.forEach(t),Vd.forEach(t),vr=u(Ys),yn=a(Ys,"SPAN",{});var Rd=r(yn);br=l(Rd,"GPTNeoForCausalLM"),Rd.forEach(t),Ys.forEach(t),zs=u(o),C=a(o,"DIV",{class:!0});var oe=r(C);k(jt.$$.fragment,oe),kr=u(oe),wn=a(oe,"P",{});var Xd=r(wn);yr=l(Xd,`The GPT Neo Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Xd.forEach(t),wr=u(oe),At=a(oe,"P",{});var Zs=r(At);$r=l(Zs,"This model inherits from "),Io=a(Zs,"A",{href:!0});var Kd=r(Io);Pr=l(Kd,"PreTrainedModel"),Kd.forEach(t),Nr=l(Zs,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Zs.forEach(t),xr=u(oe),It=a(oe,"P",{});var ea=r(It);Fr=l(ea,"This model is also a PyTorch "),Lt=a(ea,"A",{href:!0,rel:!0});var Yd=r(Lt);Gr=l(Yd,"torch.nn.Module"),Yd.forEach(t),Er=l(ea,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ea.forEach(t),Mr=u(oe),U=a(oe,"DIV",{class:!0});var pt=r(U);k(Ot.$$.fragment,pt),Cr=u(pt),Te=a(pt,"P",{});var Yo=r(Te);zr=l(Yo,"The "),Lo=a(Yo,"A",{href:!0});var Zd=r(Lo);qr=l(Zd,"GPTNeoForCausalLM"),Zd.forEach(t),jr=l(Yo," forward method, overrides the "),$n=a(Yo,"CODE",{});var ec=r($n);Ar=l(ec,"__call__"),ec.forEach(t),Ir=l(Yo," special method."),Yo.forEach(t),Lr=u(pt),k(He.$$.fragment,pt),Or=u(pt),k(Qe.$$.fragment,pt),pt.forEach(t),oe.forEach(t),qs=u(o),ve=a(o,"H2",{class:!0});var ta=r(ve);Ue=a(ta,"A",{id:!0,class:!0,href:!0});var tc=r(Ue);Pn=a(tc,"SPAN",{});var oc=r(Pn);k(St.$$.fragment,oc),oc.forEach(t),tc.forEach(t),Sr=u(ta),Nn=a(ta,"SPAN",{});var nc=r(Nn);Dr=l(nc,"GPTNeoForQuestionAnswering"),nc.forEach(t),ta.forEach(t),js=u(o),z=a(o,"DIV",{class:!0});var ne=r(z);k(Dt.$$.fragment,ne),Br=u(ne),be=a(ne,"P",{});var Zo=r(be);Wr=l(Zo,`The GPT-Neo 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 `),xn=a(Zo,"CODE",{});var sc=r(xn);Hr=l(sc,"span start logits"),sc.forEach(t),Qr=l(Zo," and "),Fn=a(Zo,"CODE",{});var ac=r(Fn);Ur=l(ac,"span end logits"),ac.forEach(t),Vr=l(Zo,")."),Zo.forEach(t),Jr=u(ne),Bt=a(ne,"P",{});var oa=r(Bt);Rr=l(oa,"This model inherits from "),Oo=a(oa,"A",{href:!0});var rc=r(Oo);Xr=l(rc,"PreTrainedModel"),rc.forEach(t),Kr=l(oa,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),oa.forEach(t),Yr=u(ne),Wt=a(ne,"P",{});var na=r(Wt);Zr=l(na,"This model is also a PyTorch "),Ht=a(na,"A",{href:!0,rel:!0});var ic=r(Ht);ei=l(ic,"torch.nn.Module"),ic.forEach(t),ti=l(na,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),na.forEach(t),oi=u(ne),A=a(ne,"DIV",{class:!0});var se=r(A);k(Qt.$$.fragment,se),ni=u(se),ke=a(se,"P",{});var en=r(ke);si=l(en,"The "),So=a(en,"A",{href:!0});var lc=r(So);ai=l(lc,"GPTNeoForQuestionAnswering"),lc.forEach(t),ri=l(en," forward method, overrides the "),Gn=a(en,"CODE",{});var dc=r(Gn);ii=l(dc,"__call__"),dc.forEach(t),li=l(en," special method."),en.forEach(t),di=u(se),k(Ve.$$.fragment,se),ci=u(se),k(Je.$$.fragment,se),pi=u(se),k(Re.$$.fragment,se),se.forEach(t),ne.forEach(t),As=u(o),ye=a(o,"H2",{class:!0});var sa=r(ye);Xe=a(sa,"A",{id:!0,class:!0,href:!0});var cc=r(Xe);En=a(cc,"SPAN",{});var pc=r(En);k(Ut.$$.fragment,pc),pc.forEach(t),cc.forEach(t),hi=u(sa),Mn=a(sa,"SPAN",{});var hc=r(Mn);ui=l(hc,"GPTNeoForSequenceClassification"),hc.forEach(t),sa.forEach(t),Is=u(o),F=a(o,"DIV",{class:!0});var L=r(F);k(Vt.$$.fragment,L),mi=u(L),Cn=a(L,"P",{});var uc=r(Cn);fi=l(uc,"The GPTNeo Model transformer with a sequence classification head on top (linear layer)."),uc.forEach(t),gi=u(L),Do=a(L,"P",{});var yd=r(Do);Bo=a(yd,"A",{href:!0});var mc=r(Bo);_i=l(mc,"GPTNeoForSequenceClassification"),mc.forEach(t),Ti=l(yd,` uses the last token in order to do the classification, as other causal models
(e.g. GPT-1) do.`),yd.forEach(t),vi=u(L),W=a(L,"P",{});var ae=r(W);bi=l(ae,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),zn=a(ae,"CODE",{});var fc=r(zn);ki=l(fc,"pad_token_id"),fc.forEach(t),yi=l(ae,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),qn=a(ae,"CODE",{});var gc=r(qn);wi=l(gc,"pad_token_id"),gc.forEach(t),$i=l(ae,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),jn=a(ae,"CODE",{});var _c=r(jn);Pi=l(_c,"inputs_embeds"),_c.forEach(t),Ni=l(ae," are passed instead of "),An=a(ae,"CODE",{});var Tc=r(An);xi=l(Tc,"input_ids"),Tc.forEach(t),Fi=l(ae,`, it does the same (take the last value in
each row of the batch).`),ae.forEach(t),Gi=u(L),Jt=a(L,"P",{});var aa=r(Jt);Ei=l(aa,"This model inherits from "),Wo=a(aa,"A",{href:!0});var vc=r(Wo);Mi=l(vc,"PreTrainedModel"),vc.forEach(t),Ci=l(aa,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),aa.forEach(t),zi=u(L),Rt=a(L,"P",{});var ra=r(Rt);qi=l(ra,"This model is also a PyTorch "),Xt=a(ra,"A",{href:!0,rel:!0});var bc=r(Xt);ji=l(bc,"torch.nn.Module"),bc.forEach(t),Ai=l(ra,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ra.forEach(t),Ii=u(L),I=a(L,"DIV",{class:!0});var re=r(I);k(Kt.$$.fragment,re),Li=u(re),we=a(re,"P",{});var tn=r(we);Oi=l(tn,"The "),Ho=a(tn,"A",{href:!0});var kc=r(Ho);Si=l(kc,"GPTNeoForSequenceClassification"),kc.forEach(t),Di=l(tn," forward method, overrides the "),In=a(tn,"CODE",{});var yc=r(In);Bi=l(yc,"__call__"),yc.forEach(t),Wi=l(tn," special method."),tn.forEach(t),Hi=u(re),k(Ke.$$.fragment,re),Qi=u(re),k(Ye.$$.fragment,re),Ui=u(re),k(Ze.$$.fragment,re),re.forEach(t),L.forEach(t),Ls=u(o),$e=a(o,"H2",{class:!0});var ia=r($e);et=a(ia,"A",{id:!0,class:!0,href:!0});var wc=r(et);Ln=a(wc,"SPAN",{});var $c=r(Ln);k(Yt.$$.fragment,$c),$c.forEach(t),wc.forEach(t),Vi=u(ia),On=a(ia,"SPAN",{});var Pc=r(On);Ji=l(Pc,"GPTNeoForTokenClassification"),Pc.forEach(t),ia.forEach(t),Os=u(o),q=a(o,"DIV",{class:!0});var ie=r(q);k(Zt.$$.fragment,ie),Ri=u(ie),Sn=a(ie,"P",{});var Nc=r(Sn);Xi=l(Nc,`GPT Neo model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),Nc.forEach(t),Ki=u(ie),eo=a(ie,"P",{});var la=r(eo);Yi=l(la,"This model inherits from "),Qo=a(la,"A",{href:!0});var xc=r(Qo);Zi=l(xc,"PreTrainedModel"),xc.forEach(t),el=l(la,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),la.forEach(t),tl=u(ie),to=a(ie,"P",{});var da=r(to);ol=l(da,"This model is also a PyTorch "),oo=a(da,"A",{href:!0,rel:!0});var Fc=r(oo);nl=l(Fc,"torch.nn.Module"),Fc.forEach(t),sl=l(da,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),da.forEach(t),al=u(ie),V=a(ie,"DIV",{class:!0});var ht=r(V);k(no.$$.fragment,ht),rl=u(ht),Pe=a(ht,"P",{});var on=r(Pe);il=l(on,"The "),Uo=a(on,"A",{href:!0});var Gc=r(Uo);ll=l(Gc,"GPTNeoForTokenClassification"),Gc.forEach(t),dl=l(on," forward method, overrides the "),Dn=a(on,"CODE",{});var Ec=r(Dn);cl=l(Ec,"__call__"),Ec.forEach(t),pl=l(on," special method."),on.forEach(t),hl=u(ht),k(tt.$$.fragment,ht),ul=u(ht),k(ot.$$.fragment,ht),ht.forEach(t),ie.forEach(t),Ss=u(o),Ne=a(o,"H2",{class:!0});var ca=r(Ne);nt=a(ca,"A",{id:!0,class:!0,href:!0});var Mc=r(nt);Bn=a(Mc,"SPAN",{});var Cc=r(Bn);k(so.$$.fragment,Cc),Cc.forEach(t),Mc.forEach(t),ml=u(ca),Wn=a(ca,"SPAN",{});var zc=r(Wn);fl=l(zc,"FlaxGPTNeoModel"),zc.forEach(t),ca.forEach(t),Ds=u(o),G=a(o,"DIV",{class:!0});var O=r(G);k(ao.$$.fragment,O),gl=u(O),Hn=a(O,"P",{});var qc=r(Hn);_l=l(qc,"The bare GPTNeo Model transformer outputting raw hidden-states without any specific head on top."),qc.forEach(t),Tl=u(O),ro=a(O,"P",{});var pa=r(ro);vl=l(pa,"This model inherits from "),Vo=a(pa,"A",{href:!0});var jc=r(Vo);bl=l(jc,"FlaxPreTrainedModel"),jc.forEach(t),kl=l(pa,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),pa.forEach(t),yl=u(O),io=a(O,"P",{});var ha=r(io);wl=l(ha,`This model is also a Flax Linen
`),lo=a(ha,"A",{href:!0,rel:!0});var Ac=r(lo);$l=l(Ac,"flax.nn.Module"),Ac.forEach(t),Pl=l(ha,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),ha.forEach(t),Nl=u(O),Qn=a(O,"P",{});var Ic=r(Qn);xl=l(Ic,"Finally, this model supports inherent JAX features such as:"),Ic.forEach(t),Fl=u(O),Y=a(O,"UL",{});var ut=r(Y);Un=a(ut,"LI",{});var Lc=r(Un);co=a(Lc,"A",{href:!0,rel:!0});var Oc=r(co);Gl=l(Oc,"Just-In-Time (JIT) compilation"),Oc.forEach(t),Lc.forEach(t),El=u(ut),Vn=a(ut,"LI",{});var Sc=r(Vn);po=a(Sc,"A",{href:!0,rel:!0});var Dc=r(po);Ml=l(Dc,"Automatic Differentiation"),Dc.forEach(t),Sc.forEach(t),Cl=u(ut),Jn=a(ut,"LI",{});var Bc=r(Jn);ho=a(Bc,"A",{href:!0,rel:!0});var Wc=r(ho);zl=l(Wc,"Vectorization"),Wc.forEach(t),Bc.forEach(t),ql=u(ut),Rn=a(ut,"LI",{});var Hc=r(Rn);uo=a(Hc,"A",{href:!0,rel:!0});var Qc=r(uo);jl=l(Qc,"Parallelization"),Qc.forEach(t),Hc.forEach(t),ut.forEach(t),Al=u(O),J=a(O,"DIV",{class:!0});var mt=r(J);k(mo.$$.fragment,mt),Il=u(mt),xe=a(mt,"P",{});var nn=r(xe);Ll=l(nn,"The "),Xn=a(nn,"CODE",{});var Uc=r(Xn);Ol=l(Uc,"FlaxGPTNeoPreTrainedModel"),Uc.forEach(t),Sl=l(nn," forward method, overrides the "),Kn=a(nn,"CODE",{});var Vc=r(Kn);Dl=l(Vc,"__call__"),Vc.forEach(t),Bl=l(nn," special method."),nn.forEach(t),Wl=u(mt),k(st.$$.fragment,mt),Hl=u(mt),k(at.$$.fragment,mt),mt.forEach(t),O.forEach(t),Bs=u(o),Fe=a(o,"H2",{class:!0});var ua=r(Fe);rt=a(ua,"A",{id:!0,class:!0,href:!0});var Jc=r(rt);Yn=a(Jc,"SPAN",{});var Rc=r(Yn);k(fo.$$.fragment,Rc),Rc.forEach(t),Jc.forEach(t),Ql=u(ua),Zn=a(ua,"SPAN",{});var Xc=r(Zn);Ul=l(Xc,"FlaxGPTNeoForCausalLM"),Xc.forEach(t),ua.forEach(t),Ws=u(o),E=a(o,"DIV",{class:!0});var S=r(E);k(go.$$.fragment,S),Vl=u(S),es=a(S,"P",{});var Kc=r(es);Jl=l(Kc,`The GPTNeo Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Kc.forEach(t),Rl=u(S),_o=a(S,"P",{});var ma=r(_o);Xl=l(ma,"This model inherits from "),Jo=a(ma,"A",{href:!0});var Yc=r(Jo);Kl=l(Yc,"FlaxPreTrainedModel"),Yc.forEach(t),Yl=l(ma,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ma.forEach(t),Zl=u(S),To=a(S,"P",{});var fa=r(To);ed=l(fa,`This model is also a Flax Linen
`),vo=a(fa,"A",{href:!0,rel:!0});var Zc=r(vo);td=l(Zc,"flax.nn.Module"),Zc.forEach(t),od=l(fa,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),fa.forEach(t),nd=u(S),ts=a(S,"P",{});var ep=r(ts);sd=l(ep,"Finally, this model supports inherent JAX features such as:"),ep.forEach(t),ad=u(S),Z=a(S,"UL",{});var ft=r(Z);os=a(ft,"LI",{});var tp=r(os);bo=a(tp,"A",{href:!0,rel:!0});var op=r(bo);rd=l(op,"Just-In-Time (JIT) compilation"),op.forEach(t),tp.forEach(t),id=u(ft),ns=a(ft,"LI",{});var np=r(ns);ko=a(np,"A",{href:!0,rel:!0});var sp=r(ko);ld=l(sp,"Automatic Differentiation"),sp.forEach(t),np.forEach(t),dd=u(ft),ss=a(ft,"LI",{});var ap=r(ss);yo=a(ap,"A",{href:!0,rel:!0});var rp=r(yo);cd=l(rp,"Vectorization"),rp.forEach(t),ap.forEach(t),pd=u(ft),as=a(ft,"LI",{});var ip=r(as);wo=a(ip,"A",{href:!0,rel:!0});var lp=r(wo);hd=l(lp,"Parallelization"),lp.forEach(t),ip.forEach(t),ft.forEach(t),ud=u(S),R=a(S,"DIV",{class:!0});var gt=r(R);k($o.$$.fragment,gt),md=u(gt),Ge=a(gt,"P",{});var sn=r(Ge);fd=l(sn,"The "),rs=a(sn,"CODE",{});var dp=r(rs);gd=l(dp,"FlaxGPTNeoPreTrainedModel"),dp.forEach(t),_d=l(sn," forward method, overrides the "),is=a(sn,"CODE",{});var cp=r(is);Td=l(cp,"__call__"),cp.forEach(t),vd=l(sn," special method."),sn.forEach(t),bd=u(gt),k(it.$$.fragment,gt),kd=u(gt),k(lt.$$.fragment,gt),gt.forEach(t),S.forEach(t),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(qp)),c(m,"id","gpt-neo"),c(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(m,"href","#gpt-neo"),c(f,"class","relative group"),c(K,"id","overview"),c(K,"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"),c(K,"href","#overview"),c(H,"class","relative group"),c(vt,"href","https://github.com/EleutherAI/gpt-neo"),c(vt,"rel","nofollow"),c(bt,"href","https://pile.eleuther.ai/"),c(bt,"rel","nofollow"),c(kt,"href","https://huggingface.co/valhalla"),c(kt,"rel","nofollow"),c(qe,"id","generation"),c(qe,"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"),c(qe,"href","#generation"),c(ce,"class","relative group"),c(Ae,"id","documentation-resources"),c(Ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ae,"href","#documentation-resources"),c(pe,"class","relative group"),c(Eo,"href","../tasks/sequence_classification"),c(Mo,"href","../tasks/language_modeling"),c(Le,"id","transformers.GPTNeoConfig"),c(Le,"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"),c(Le,"href","#transformers.GPTNeoConfig"),c(he,"class","relative group"),c(Co,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoModel"),c(xt,"href","https://huggingface.co/EleutherAI/gpt-neo-1.3B"),c(xt,"rel","nofollow"),c(zo,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(qo,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Se,"id","transformers.GPTNeoModel"),c(Se,"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"),c(Se,"href","#transformers.GPTNeoModel"),c(fe,"class","relative group"),c(jo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),c(Ct,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ct,"rel","nofollow"),c(Ao,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoModel"),c(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(We,"id","transformers.GPTNeoForCausalLM"),c(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"),c(We,"href","#transformers.GPTNeoForCausalLM"),c(_e,"class","relative group"),c(Io,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),c(Lt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Lt,"rel","nofollow"),c(Lo,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoForCausalLM"),c(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ue,"id","transformers.GPTNeoForQuestionAnswering"),c(Ue,"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"),c(Ue,"href","#transformers.GPTNeoForQuestionAnswering"),c(ve,"class","relative group"),c(Oo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),c(Ht,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ht,"rel","nofollow"),c(So,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoForQuestionAnswering"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Xe,"id","transformers.GPTNeoForSequenceClassification"),c(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"),c(Xe,"href","#transformers.GPTNeoForSequenceClassification"),c(ye,"class","relative group"),c(Bo,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoForSequenceClassification"),c(Wo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),c(Xt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Xt,"rel","nofollow"),c(Ho,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoForSequenceClassification"),c(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(et,"id","transformers.GPTNeoForTokenClassification"),c(et,"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"),c(et,"href","#transformers.GPTNeoForTokenClassification"),c($e,"class","relative group"),c(Qo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),c(oo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(oo,"rel","nofollow"),c(Uo,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neo#transformers.GPTNeoForTokenClassification"),c(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(nt,"id","transformers.FlaxGPTNeoModel"),c(nt,"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"),c(nt,"href","#transformers.FlaxGPTNeoModel"),c(Ne,"class","relative group"),c(Vo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(lo,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),c(lo,"rel","nofollow"),c(co,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(co,"rel","nofollow"),c(po,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(po,"rel","nofollow"),c(ho,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(ho,"rel","nofollow"),c(uo,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(uo,"rel","nofollow"),c(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(rt,"id","transformers.FlaxGPTNeoForCausalLM"),c(rt,"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"),c(rt,"href","#transformers.FlaxGPTNeoForCausalLM"),c(Fe,"class","relative group"),c(Jo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(vo,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),c(vo,"rel","nofollow"),c(bo,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(bo,"rel","nofollow"),c(ko,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(ko,"rel","nofollow"),c(yo,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(yo,"rel","nofollow"),c(wo,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(wo,"rel","nofollow"),c(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,g){e(document.head,d),T(o,v,g),T(o,f,g),e(f,m),e(m,_),y(n,_,null),e(f,p),e(f,x),e(x,de),T(o,D,g),T(o,H,g),e(H,K),e(K,an),y(Tt,an,null),e(H,ga),e(H,rn),e(rn,_a),T(o,bs,g),T(o,ee,g),e(ee,Ta),e(ee,vt),e(vt,va),e(ee,ba),e(ee,bt),e(bt,ka),e(ee,ya),T(o,ks,g),T(o,Go,g),e(Go,wa),T(o,ys,g),T(o,ze,g),e(ze,$a),e(ze,kt),e(kt,Pa),e(ze,Na),T(o,ws,g),T(o,ce,g),e(ce,qe),e(qe,ln),y(yt,ln,null),e(ce,xa),e(ce,dn),e(dn,Fa),T(o,$s,g),T(o,je,g),e(je,Ga),e(je,cn),e(cn,Ea),e(je,Ma),T(o,Ps,g),y(wt,o,g),T(o,Ns,g),T(o,pe,g),e(pe,Ae),e(Ae,pn),y($t,pn,null),e(pe,Ca),e(pe,hn),e(hn,za),T(o,xs,g),T(o,Ie,g),e(Ie,un),e(un,Eo),e(Eo,qa),e(Ie,ja),e(Ie,mn),e(mn,Mo),e(Mo,Aa),T(o,Fs,g),T(o,he,g),e(he,Le),e(Le,fn),y(Pt,fn,null),e(he,Ia),e(he,gn),e(gn,La),T(o,Gs,g),T(o,B,g),y(Nt,B,null),e(B,Oa),e(B,ue),e(ue,Sa),e(ue,Co),e(Co,Da),e(ue,Ba),e(ue,xt),e(xt,Wa),e(ue,Ha),e(B,Qa),e(B,me),e(me,Ua),e(me,zo),e(zo,Va),e(me,Ja),e(me,qo),e(qo,Ra),e(me,Xa),e(B,Ka),y(Oe,B,null),T(o,Es,g),T(o,fe,g),e(fe,Se),e(Se,_n),y(Ft,_n,null),e(fe,Ya),e(fe,Tn),e(Tn,Za),T(o,Ms,g),T(o,M,g),y(Gt,M,null),e(M,er),e(M,vn),e(vn,tr),e(M,or),e(M,Et),e(Et,nr),e(Et,jo),e(jo,sr),e(Et,ar),e(M,rr),e(M,Mt),e(Mt,ir),e(Mt,Ct),e(Ct,lr),e(Mt,dr),e(M,cr),e(M,Q),y(zt,Q,null),e(Q,pr),e(Q,ge),e(ge,hr),e(ge,Ao),e(Ao,ur),e(ge,mr),e(ge,bn),e(bn,fr),e(ge,gr),e(Q,_r),y(De,Q,null),e(Q,Tr),y(Be,Q,null),T(o,Cs,g),T(o,_e,g),e(_e,We),e(We,kn),y(qt,kn,null),e(_e,vr),e(_e,yn),e(yn,br),T(o,zs,g),T(o,C,g),y(jt,C,null),e(C,kr),e(C,wn),e(wn,yr),e(C,wr),e(C,At),e(At,$r),e(At,Io),e(Io,Pr),e(At,Nr),e(C,xr),e(C,It),e(It,Fr),e(It,Lt),e(Lt,Gr),e(It,Er),e(C,Mr),e(C,U),y(Ot,U,null),e(U,Cr),e(U,Te),e(Te,zr),e(Te,Lo),e(Lo,qr),e(Te,jr),e(Te,$n),e($n,Ar),e(Te,Ir),e(U,Lr),y(He,U,null),e(U,Or),y(Qe,U,null),T(o,qs,g),T(o,ve,g),e(ve,Ue),e(Ue,Pn),y(St,Pn,null),e(ve,Sr),e(ve,Nn),e(Nn,Dr),T(o,js,g),T(o,z,g),y(Dt,z,null),e(z,Br),e(z,be),e(be,Wr),e(be,xn),e(xn,Hr),e(be,Qr),e(be,Fn),e(Fn,Ur),e(be,Vr),e(z,Jr),e(z,Bt),e(Bt,Rr),e(Bt,Oo),e(Oo,Xr),e(Bt,Kr),e(z,Yr),e(z,Wt),e(Wt,Zr),e(Wt,Ht),e(Ht,ei),e(Wt,ti),e(z,oi),e(z,A),y(Qt,A,null),e(A,ni),e(A,ke),e(ke,si),e(ke,So),e(So,ai),e(ke,ri),e(ke,Gn),e(Gn,ii),e(ke,li),e(A,di),y(Ve,A,null),e(A,ci),y(Je,A,null),e(A,pi),y(Re,A,null),T(o,As,g),T(o,ye,g),e(ye,Xe),e(Xe,En),y(Ut,En,null),e(ye,hi),e(ye,Mn),e(Mn,ui),T(o,Is,g),T(o,F,g),y(Vt,F,null),e(F,mi),e(F,Cn),e(Cn,fi),e(F,gi),e(F,Do),e(Do,Bo),e(Bo,_i),e(Do,Ti),e(F,vi),e(F,W),e(W,bi),e(W,zn),e(zn,ki),e(W,yi),e(W,qn),e(qn,wi),e(W,$i),e(W,jn),e(jn,Pi),e(W,Ni),e(W,An),e(An,xi),e(W,Fi),e(F,Gi),e(F,Jt),e(Jt,Ei),e(Jt,Wo),e(Wo,Mi),e(Jt,Ci),e(F,zi),e(F,Rt),e(Rt,qi),e(Rt,Xt),e(Xt,ji),e(Rt,Ai),e(F,Ii),e(F,I),y(Kt,I,null),e(I,Li),e(I,we),e(we,Oi),e(we,Ho),e(Ho,Si),e(we,Di),e(we,In),e(In,Bi),e(we,Wi),e(I,Hi),y(Ke,I,null),e(I,Qi),y(Ye,I,null),e(I,Ui),y(Ze,I,null),T(o,Ls,g),T(o,$e,g),e($e,et),e(et,Ln),y(Yt,Ln,null),e($e,Vi),e($e,On),e(On,Ji),T(o,Os,g),T(o,q,g),y(Zt,q,null),e(q,Ri),e(q,Sn),e(Sn,Xi),e(q,Ki),e(q,eo),e(eo,Yi),e(eo,Qo),e(Qo,Zi),e(eo,el),e(q,tl),e(q,to),e(to,ol),e(to,oo),e(oo,nl),e(to,sl),e(q,al),e(q,V),y(no,V,null),e(V,rl),e(V,Pe),e(Pe,il),e(Pe,Uo),e(Uo,ll),e(Pe,dl),e(Pe,Dn),e(Dn,cl),e(Pe,pl),e(V,hl),y(tt,V,null),e(V,ul),y(ot,V,null),T(o,Ss,g),T(o,Ne,g),e(Ne,nt),e(nt,Bn),y(so,Bn,null),e(Ne,ml),e(Ne,Wn),e(Wn,fl),T(o,Ds,g),T(o,G,g),y(ao,G,null),e(G,gl),e(G,Hn),e(Hn,_l),e(G,Tl),e(G,ro),e(ro,vl),e(ro,Vo),e(Vo,bl),e(ro,kl),e(G,yl),e(G,io),e(io,wl),e(io,lo),e(lo,$l),e(io,Pl),e(G,Nl),e(G,Qn),e(Qn,xl),e(G,Fl),e(G,Y),e(Y,Un),e(Un,co),e(co,Gl),e(Y,El),e(Y,Vn),e(Vn,po),e(po,Ml),e(Y,Cl),e(Y,Jn),e(Jn,ho),e(ho,zl),e(Y,ql),e(Y,Rn),e(Rn,uo),e(uo,jl),e(G,Al),e(G,J),y(mo,J,null),e(J,Il),e(J,xe),e(xe,Ll),e(xe,Xn),e(Xn,Ol),e(xe,Sl),e(xe,Kn),e(Kn,Dl),e(xe,Bl),e(J,Wl),y(st,J,null),e(J,Hl),y(at,J,null),T(o,Bs,g),T(o,Fe,g),e(Fe,rt),e(rt,Yn),y(fo,Yn,null),e(Fe,Ql),e(Fe,Zn),e(Zn,Ul),T(o,Ws,g),T(o,E,g),y(go,E,null),e(E,Vl),e(E,es),e(es,Jl),e(E,Rl),e(E,_o),e(_o,Xl),e(_o,Jo),e(Jo,Kl),e(_o,Yl),e(E,Zl),e(E,To),e(To,ed),e(To,vo),e(vo,td),e(To,od),e(E,nd),e(E,ts),e(ts,sd),e(E,ad),e(E,Z),e(Z,os),e(os,bo),e(bo,rd),e(Z,id),e(Z,ns),e(ns,ko),e(ko,ld),e(Z,dd),e(Z,ss),e(ss,yo),e(yo,cd),e(Z,pd),e(Z,as),e(as,wo),e(wo,hd),e(E,ud),e(E,R),y($o,R,null),e(R,md),e(R,Ge),e(Ge,fd),e(Ge,rs),e(rs,gd),e(Ge,_d),e(Ge,is),e(is,Td),e(Ge,vd),e(R,bd),y(it,R,null),e(R,kd),y(lt,R,null),Hs=!0},p(o,[g]){const Po={};g&2&&(Po.$$scope={dirty:g,ctx:o}),Oe.$set(Po);const ls={};g&2&&(ls.$$scope={dirty:g,ctx:o}),De.$set(ls);const ds={};g&2&&(ds.$$scope={dirty:g,ctx:o}),Be.$set(ds);const cs={};g&2&&(cs.$$scope={dirty:g,ctx:o}),He.$set(cs);const No={};g&2&&(No.$$scope={dirty:g,ctx:o}),Qe.$set(No);const ps={};g&2&&(ps.$$scope={dirty:g,ctx:o}),Ve.$set(ps);const hs={};g&2&&(hs.$$scope={dirty:g,ctx:o}),Je.$set(hs);const us={};g&2&&(us.$$scope={dirty:g,ctx:o}),Re.$set(us);const Ee={};g&2&&(Ee.$$scope={dirty:g,ctx:o}),Ke.$set(Ee);const ms={};g&2&&(ms.$$scope={dirty:g,ctx:o}),Ye.$set(ms);const fs={};g&2&&(fs.$$scope={dirty:g,ctx:o}),Ze.$set(fs);const gs={};g&2&&(gs.$$scope={dirty:g,ctx:o}),tt.$set(gs);const xo={};g&2&&(xo.$$scope={dirty:g,ctx:o}),ot.$set(xo);const _s={};g&2&&(_s.$$scope={dirty:g,ctx:o}),st.$set(_s);const Fo={};g&2&&(Fo.$$scope={dirty:g,ctx:o}),at.$set(Fo);const Ts={};g&2&&(Ts.$$scope={dirty:g,ctx:o}),it.$set(Ts);const vs={};g&2&&(vs.$$scope={dirty:g,ctx:o}),lt.$set(vs)},i(o){Hs||(w(n.$$.fragment,o),w(Tt.$$.fragment,o),w(yt.$$.fragment,o),w(wt.$$.fragment,o),w($t.$$.fragment,o),w(Pt.$$.fragment,o),w(Nt.$$.fragment,o),w(Oe.$$.fragment,o),w(Ft.$$.fragment,o),w(Gt.$$.fragment,o),w(zt.$$.fragment,o),w(De.$$.fragment,o),w(Be.$$.fragment,o),w(qt.$$.fragment,o),w(jt.$$.fragment,o),w(Ot.$$.fragment,o),w(He.$$.fragment,o),w(Qe.$$.fragment,o),w(St.$$.fragment,o),w(Dt.$$.fragment,o),w(Qt.$$.fragment,o),w(Ve.$$.fragment,o),w(Je.$$.fragment,o),w(Re.$$.fragment,o),w(Ut.$$.fragment,o),w(Vt.$$.fragment,o),w(Kt.$$.fragment,o),w(Ke.$$.fragment,o),w(Ye.$$.fragment,o),w(Ze.$$.fragment,o),w(Yt.$$.fragment,o),w(Zt.$$.fragment,o),w(no.$$.fragment,o),w(tt.$$.fragment,o),w(ot.$$.fragment,o),w(so.$$.fragment,o),w(ao.$$.fragment,o),w(mo.$$.fragment,o),w(st.$$.fragment,o),w(at.$$.fragment,o),w(fo.$$.fragment,o),w(go.$$.fragment,o),w($o.$$.fragment,o),w(it.$$.fragment,o),w(lt.$$.fragment,o),Hs=!0)},o(o){$(n.$$.fragment,o),$(Tt.$$.fragment,o),$(yt.$$.fragment,o),$(wt.$$.fragment,o),$($t.$$.fragment,o),$(Pt.$$.fragment,o),$(Nt.$$.fragment,o),$(Oe.$$.fragment,o),$(Ft.$$.fragment,o),$(Gt.$$.fragment,o),$(zt.$$.fragment,o),$(De.$$.fragment,o),$(Be.$$.fragment,o),$(qt.$$.fragment,o),$(jt.$$.fragment,o),$(Ot.$$.fragment,o),$(He.$$.fragment,o),$(Qe.$$.fragment,o),$(St.$$.fragment,o),$(Dt.$$.fragment,o),$(Qt.$$.fragment,o),$(Ve.$$.fragment,o),$(Je.$$.fragment,o),$(Re.$$.fragment,o),$(Ut.$$.fragment,o),$(Vt.$$.fragment,o),$(Kt.$$.fragment,o),$(Ke.$$.fragment,o),$(Ye.$$.fragment,o),$(Ze.$$.fragment,o),$(Yt.$$.fragment,o),$(Zt.$$.fragment,o),$(no.$$.fragment,o),$(tt.$$.fragment,o),$(ot.$$.fragment,o),$(so.$$.fragment,o),$(ao.$$.fragment,o),$(mo.$$.fragment,o),$(st.$$.fragment,o),$(at.$$.fragment,o),$(fo.$$.fragment,o),$(go.$$.fragment,o),$($o.$$.fragment,o),$(it.$$.fragment,o),$(lt.$$.fragment,o),Hs=!1},d(o){t(d),o&&t(v),o&&t(f),P(n),o&&t(D),o&&t(H),P(Tt),o&&t(bs),o&&t(ee),o&&t(ks),o&&t(Go),o&&t(ys),o&&t(ze),o&&t(ws),o&&t(ce),P(yt),o&&t($s),o&&t(je),o&&t(Ps),P(wt,o),o&&t(Ns),o&&t(pe),P($t),o&&t(xs),o&&t(Ie),o&&t(Fs),o&&t(he),P(Pt),o&&t(Gs),o&&t(B),P(Nt),P(Oe),o&&t(Es),o&&t(fe),P(Ft),o&&t(Ms),o&&t(M),P(Gt),P(zt),P(De),P(Be),o&&t(Cs),o&&t(_e),P(qt),o&&t(zs),o&&t(C),P(jt),P(Ot),P(He),P(Qe),o&&t(qs),o&&t(ve),P(St),o&&t(js),o&&t(z),P(Dt),P(Qt),P(Ve),P(Je),P(Re),o&&t(As),o&&t(ye),P(Ut),o&&t(Is),o&&t(F),P(Vt),P(Kt),P(Ke),P(Ye),P(Ze),o&&t(Ls),o&&t($e),P(Yt),o&&t(Os),o&&t(q),P(Zt),P(no),P(tt),P(ot),o&&t(Ss),o&&t(Ne),P(so),o&&t(Ds),o&&t(G),P(ao),P(mo),P(st),P(at),o&&t(Bs),o&&t(Fe),P(fo),o&&t(Ws),o&&t(E),P(go),P($o),P(it),P(lt)}}}const qp={local:"gpt-neo",sections:[{local:"overview",sections:[{local:"generation",title:"Generation"}],title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.GPTNeoConfig",title:"GPTNeoConfig"},{local:"transformers.GPTNeoModel",title:"GPTNeoModel"},{local:"transformers.GPTNeoForCausalLM",title:"GPTNeoForCausalLM"},{local:"transformers.GPTNeoForQuestionAnswering",title:"GPTNeoForQuestionAnswering"},{local:"transformers.GPTNeoForSequenceClassification",title:"GPTNeoForSequenceClassification"},{local:"transformers.GPTNeoForTokenClassification",title:"GPTNeoForTokenClassification"},{local:"transformers.FlaxGPTNeoModel",title:"FlaxGPTNeoModel"},{local:"transformers.FlaxGPTNeoForCausalLM",title:"FlaxGPTNeoForCausalLM"}],title:"GPT Neo"};function jp(N){return fp(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Bp extends pp{constructor(d){super();hp(this,d,jp,zp,up,{})}}export{Bp as default,qp as metadata};
