import{S as $l,i as Nl,s as xl,e as s,k as h,w as b,t as i,M as Gl,c as a,d as t,m as u,a as r,x as y,h as l,b as c,G as e,g as T,y as k,q as P,o as w,B as $,v as Ml,L as Ot}from"../../chunks/vendor-hf-doc-builder.js";import{T as ln}from"../../chunks/Tip-hf-doc-builder.js";import{D as U}from"../../chunks/Docstring-hf-doc-builder.js";import{C as We}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ue}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as St}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Fl(N){let d,v,f,m,_;return m=new We({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),y(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),k(m,n,p),_=!0},p:Ot,i(n){_||(P(m.$$.fragment,n),_=!0)},o(n){w(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),$(m,n)}}}function El(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 Cl(N){let d,v,f,m,_;return m=new We({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),y(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),k(m,n,p),_=!0},p:Ot,i(n){_||(P(m.$$.fragment,n),_=!0)},o(n){w(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),$(m,n)}}}function zl(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 ql(N){let d,v,f,m,_;return m=new We({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),y(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),k(m,n,p),_=!0},p:Ot,i(n){_||(P(m.$$.fragment,n),_=!0)},o(n){w(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),$(m,n)}}}function jl(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 Al(N){let d,v,f,m,_;return m=new We({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),y(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),k(m,n,p),_=!0},p:Ot,i(n){_||(P(m.$$.fragment,n),_=!0)},o(n){w(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),$(m,n)}}}function Il(N){let d,v,f,m,_;return m=new We({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),y(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),k(m,n,p),_=!0},p:Ot,i(n){_||(P(m.$$.fragment,n),_=!0)},o(n){w(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),$(m,n)}}}function Ll(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 Sl(N){let d,v,f,m,_;return m=new We({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),y(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),k(m,n,p),_=!0},p:Ot,i(n){_||(P(m.$$.fragment,n),_=!0)},o(n){w(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),$(m,n)}}}function Ol(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 Dl(N){let d,v,f,m,_;return m=new We({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),y(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,v),T(n,f,p),k(m,n,p),_=!0},p:Ot,i(n){_||(P(m.$$.fragment,n),_=!0)},o(n){w(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),$(m,n)}}}function Bl(N){let d,v,f,m,_,n,p,x,Rn,dn,Q,me,lo,He,Xn,co,Kn,cn,V,Qn,Ue,Yn,Zn,Ve,es,ts,pn,Dt,os,hn,fe,ns,Je,ss,as,un,Y,ge,po,Re,rs,ho,is,mn,_e,ls,uo,ds,cs,fn,Xe,gn,Z,Te,mo,Ke,ps,fo,hs,_n,I,Qe,us,ee,ms,Bt,fs,gs,Ye,_s,Ts,vs,te,bs,Wt,ys,ks,Ht,Ps,ws,$s,ve,Tn,oe,be,go,Ze,Ns,_o,xs,vn,E,et,Gs,To,Ms,Fs,tt,Es,Ut,Cs,zs,qs,ot,js,nt,As,Is,Ls,S,st,Ss,ne,Os,Vt,Ds,Bs,vo,Ws,Hs,Us,ye,Vs,ke,bn,se,Pe,bo,at,Js,yo,Rs,yn,C,rt,Xs,ko,Ks,Qs,it,Ys,Jt,Zs,ea,ta,lt,oa,dt,na,sa,aa,O,ct,ra,ae,ia,Rt,la,da,Po,ca,pa,ha,we,ua,$e,kn,re,Ne,wo,pt,ma,$o,fa,Pn,G,ht,ga,No,_a,Ta,Xt,Kt,va,ba,ya,L,ka,xo,Pa,wa,Go,$a,Na,Mo,xa,Ga,Fo,Ma,Fa,Ea,ut,Ca,Qt,za,qa,ja,mt,Aa,ft,Ia,La,Sa,z,gt,Oa,ie,Da,Yt,Ba,Wa,Eo,Ha,Ua,Va,xe,Ja,Ge,Ra,Me,wn,le,Fe,Co,_t,Xa,zo,Ka,$n,M,Tt,Qa,qo,Ya,Za,vt,er,Zt,tr,or,nr,bt,sr,yt,ar,rr,ir,jo,lr,dr,W,Ao,kt,cr,pr,Io,Pt,hr,ur,Lo,wt,mr,fr,So,$t,gr,_r,D,Nt,Tr,de,vr,Oo,br,yr,Do,kr,Pr,wr,Ee,$r,Ce,Nn,ce,ze,Bo,xt,Nr,Wo,xr,xn,F,Gt,Gr,Ho,Mr,Fr,Mt,Er,eo,Cr,zr,qr,Ft,jr,Et,Ar,Ir,Lr,Uo,Sr,Or,H,Vo,Ct,Dr,Br,Jo,zt,Wr,Hr,Ro,qt,Ur,Vr,Xo,jt,Jr,Rr,B,At,Xr,pe,Kr,Ko,Qr,Yr,Qo,Zr,ei,ti,qe,oi,je,Gn;return n=new ue({}),He=new ue({}),Re=new ue({}),Xe=new We({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>]`}}),Ke=new ue({}),Qe=new U({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:"layer_norm_epsilon",val:" = 1e-05"},{name:"initializer_range",val:" = 0.02"},{name:"summary_type",val:" = 'cls_index'"},{name:"summary_use_proj",val:" = True"},{name:"summary_activation",val:" = None"},{name:"summary_proj_to_labels",val:" = True"},{name:"summary_first_dropout",val:" = 0.1"},{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/main/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/main/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.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/main/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/main/src/transformers/models/gpt_neo/configuration_gpt_neo.py#L34"}}),ve=new St({props:{anchor:"transformers.GPTNeoConfig.example",$$slots:{default:[Fl]},$$scope:{ctx:N}}}),Ze=new ue({}),et=new U({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_neo/modeling_gpt_neo.py#L475"}}),st=new U({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_neo/modeling_gpt_neo.py#L496",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/gpt_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/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ye=new ln({props:{$$slots:{default:[El]},$$scope:{ctx:N}}}),ke=new St({props:{anchor:"transformers.GPTNeoModel.forward.example",$$slots:{default:[Cl]},$$scope:{ctx:N}}}),at=new ue({}),rt=new U({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_neo/modeling_gpt_neo.py#L662"}}),ct=new U({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/gpt_neo/modeling_gpt_neo.py#L712",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/gpt_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/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),we=new ln({props:{$$slots:{default:[zl]},$$scope:{ctx:N}}}),$e=new St({props:{anchor:"transformers.GPTNeoForCausalLM.forward.example",$$slots:{default:[ql]},$$scope:{ctx:N}}}),pt=new ue({}),ht=new U({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_neo/modeling_gpt_neo.py#L814"}}),gt=new U({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/gpt_neo/modeling_gpt_neo.py#L826",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/main/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>
`}}),xe=new ln({props:{$$slots:{default:[jl]},$$scope:{ctx:N}}}),Ge=new St({props:{anchor:"transformers.GPTNeoForSequenceClassification.forward.example",$$slots:{default:[Al]},$$scope:{ctx:N}}}),Me=new St({props:{anchor:"transformers.GPTNeoForSequenceClassification.forward.example-2",$$slots:{default:[Il]},$$scope:{ctx:N}}}),_t=new ue({}),Tt=new U({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/main/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/main/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/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_neo/modeling_flax_gpt_neo.py#L591"}}),Nt=new U({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_neo/modeling_flax_gpt_neo.py#L401",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ee=new ln({props:{$$slots:{default:[Ll]},$$scope:{ctx:N}}}),Ce=new St({props:{anchor:"transformers.FlaxGPTNeoModel.__call__.example",$$slots:{default:[Sl]},$$scope:{ctx:N}}}),xt=new ue({}),Gt=new U({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/main/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/main/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/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_neo/modeling_flax_gpt_neo.py#L654"}}),At=new U({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt_neo/modeling_flax_gpt_neo.py#L401",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qe=new ln({props:{$$slots:{default:[Ol]},$$scope:{ctx:N}}}),je=new St({props:{anchor:"transformers.FlaxGPTNeoForCausalLM.__call__.example",$$slots:{default:[Dl]},$$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"),Rn=i("GPT Neo"),dn=h(),Q=s("h2"),me=s("a"),lo=s("span"),b(He.$$.fragment),Xn=h(),co=s("span"),Kn=i("Overview"),cn=h(),V=s("p"),Qn=i("The GPTNeo model was released in the "),Ue=s("a"),Yn=i("EleutherAI/gpt-neo"),Zn=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
`),Ve=s("a"),es=i("Pile"),ts=i(" dataset."),pn=h(),Dt=s("p"),os=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.`),hn=h(),fe=s("p"),ns=i("This model was contributed by "),Je=s("a"),ss=i("valhalla"),as=i("."),un=h(),Y=s("h3"),ge=s("a"),po=s("span"),b(Re.$$.fragment),rs=h(),ho=s("span"),is=i("Generation"),mn=h(),_e=s("p"),ls=i("The "),uo=s("code"),ds=i("generate()"),cs=i(" method can be used to generate text using GPT Neo model."),fn=h(),b(Xe.$$.fragment),gn=h(),Z=s("h2"),Te=s("a"),mo=s("span"),b(Ke.$$.fragment),ps=h(),fo=s("span"),hs=i("GPTNeoConfig"),_n=h(),I=s("div"),b(Qe.$$.fragment),us=h(),ee=s("p"),ms=i("This is the configuration class to store the configuration of a "),Bt=s("a"),fs=i("GPTNeoModel"),gs=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
`),Ye=s("a"),_s=i("EleutherAI/gpt-neo-1.3B"),Ts=i(" architecture."),vs=h(),te=s("p"),bs=i("Configuration objects inherit from "),Wt=s("a"),ys=i("PretrainedConfig"),ks=i(` and can be used to control the model outputs. Read the
documentation from `),Ht=s("a"),Ps=i("PretrainedConfig"),ws=i(" for more information."),$s=h(),b(ve.$$.fragment),Tn=h(),oe=s("h2"),be=s("a"),go=s("span"),b(Ze.$$.fragment),Ns=h(),_o=s("span"),xs=i("GPTNeoModel"),vn=h(),E=s("div"),b(et.$$.fragment),Gs=h(),To=s("p"),Ms=i("The bare GPT Neo Model transformer outputting raw hidden-states without any specific head on top."),Fs=h(),tt=s("p"),Es=i("This model inherits from "),Ut=s("a"),Cs=i("PreTrainedModel"),zs=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.)`),qs=h(),ot=s("p"),js=i("This model is also a PyTorch "),nt=s("a"),As=i("torch.nn.Module"),Is=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ls=h(),S=s("div"),b(st.$$.fragment),Ss=h(),ne=s("p"),Os=i("The "),Vt=s("a"),Ds=i("GPTNeoModel"),Bs=i(" forward method, overrides the "),vo=s("code"),Ws=i("__call__"),Hs=i(" special method."),Us=h(),b(ye.$$.fragment),Vs=h(),b(ke.$$.fragment),bn=h(),se=s("h2"),Pe=s("a"),bo=s("span"),b(at.$$.fragment),Js=h(),yo=s("span"),Rs=i("GPTNeoForCausalLM"),yn=h(),C=s("div"),b(rt.$$.fragment),Xs=h(),ko=s("p"),Ks=i(`The GPT Neo Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Qs=h(),it=s("p"),Ys=i("This model inherits from "),Jt=s("a"),Zs=i("PreTrainedModel"),ea=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.)`),ta=h(),lt=s("p"),oa=i("This model is also a PyTorch "),dt=s("a"),na=i("torch.nn.Module"),sa=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),aa=h(),O=s("div"),b(ct.$$.fragment),ra=h(),ae=s("p"),ia=i("The "),Rt=s("a"),la=i("GPTNeoForCausalLM"),da=i(" forward method, overrides the "),Po=s("code"),ca=i("__call__"),pa=i(" special method."),ha=h(),b(we.$$.fragment),ua=h(),b($e.$$.fragment),kn=h(),re=s("h2"),Ne=s("a"),wo=s("span"),b(pt.$$.fragment),ma=h(),$o=s("span"),fa=i("GPTNeoForSequenceClassification"),Pn=h(),G=s("div"),b(ht.$$.fragment),ga=h(),No=s("p"),_a=i("The GPTNeo Model transformer with a sequence classification head on top (linear layer)."),Ta=h(),Xt=s("p"),Kt=s("a"),va=i("GPTNeoForSequenceClassification"),ba=i(` uses the last token in order to do the classification, as other causal models
(e.g. GPT-1) do.`),ya=h(),L=s("p"),ka=i(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),xo=s("code"),Pa=i("pad_token_id"),wa=i(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Go=s("code"),$a=i("pad_token_id"),Na=i(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),Mo=s("code"),xa=i("inputs_embeds"),Ga=i(" are passed instead of "),Fo=s("code"),Ma=i("input_ids"),Fa=i(`, it does the same (take the last value in
each row of the batch).`),Ea=h(),ut=s("p"),Ca=i("This model inherits from "),Qt=s("a"),za=i("PreTrainedModel"),qa=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.)`),ja=h(),mt=s("p"),Aa=i("This model is also a PyTorch "),ft=s("a"),Ia=i("torch.nn.Module"),La=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sa=h(),z=s("div"),b(gt.$$.fragment),Oa=h(),ie=s("p"),Da=i("The "),Yt=s("a"),Ba=i("GPTNeoForSequenceClassification"),Wa=i(" forward method, overrides the "),Eo=s("code"),Ha=i("__call__"),Ua=i(" special method."),Va=h(),b(xe.$$.fragment),Ja=h(),b(Ge.$$.fragment),Ra=h(),b(Me.$$.fragment),wn=h(),le=s("h2"),Fe=s("a"),Co=s("span"),b(_t.$$.fragment),Xa=h(),zo=s("span"),Ka=i("FlaxGPTNeoModel"),$n=h(),M=s("div"),b(Tt.$$.fragment),Qa=h(),qo=s("p"),Ya=i("The bare GPTNeo Model transformer outputting raw hidden-states without any specific head on top."),Za=h(),vt=s("p"),er=i("This model inherits from "),Zt=s("a"),tr=i("FlaxPreTrainedModel"),or=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.)`),nr=h(),bt=s("p"),sr=i(`This model is also a Flax Linen
`),yt=s("a"),ar=i("flax.nn.Module"),rr=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),ir=h(),jo=s("p"),lr=i("Finally, this model supports inherent JAX features such as:"),dr=h(),W=s("ul"),Ao=s("li"),kt=s("a"),cr=i("Just-In-Time (JIT) compilation"),pr=h(),Io=s("li"),Pt=s("a"),hr=i("Automatic Differentiation"),ur=h(),Lo=s("li"),wt=s("a"),mr=i("Vectorization"),fr=h(),So=s("li"),$t=s("a"),gr=i("Parallelization"),_r=h(),D=s("div"),b(Nt.$$.fragment),Tr=h(),de=s("p"),vr=i("The "),Oo=s("code"),br=i("FlaxGPTNeoPreTrainedModel"),yr=i(" forward method, overrides the "),Do=s("code"),kr=i("__call__"),Pr=i(" special method."),wr=h(),b(Ee.$$.fragment),$r=h(),b(Ce.$$.fragment),Nn=h(),ce=s("h2"),ze=s("a"),Bo=s("span"),b(xt.$$.fragment),Nr=h(),Wo=s("span"),xr=i("FlaxGPTNeoForCausalLM"),xn=h(),F=s("div"),b(Gt.$$.fragment),Gr=h(),Ho=s("p"),Mr=i(`The GPTNeo Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Fr=h(),Mt=s("p"),Er=i("This model inherits from "),eo=s("a"),Cr=i("FlaxPreTrainedModel"),zr=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.)`),qr=h(),Ft=s("p"),jr=i(`This model is also a Flax Linen
`),Et=s("a"),Ar=i("flax.nn.Module"),Ir=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Lr=h(),Uo=s("p"),Sr=i("Finally, this model supports inherent JAX features such as:"),Or=h(),H=s("ul"),Vo=s("li"),Ct=s("a"),Dr=i("Just-In-Time (JIT) compilation"),Br=h(),Jo=s("li"),zt=s("a"),Wr=i("Automatic Differentiation"),Hr=h(),Ro=s("li"),qt=s("a"),Ur=i("Vectorization"),Vr=h(),Xo=s("li"),jt=s("a"),Jr=i("Parallelization"),Rr=h(),B=s("div"),b(At.$$.fragment),Xr=h(),pe=s("p"),Kr=i("The "),Ko=s("code"),Qr=i("FlaxGPTNeoPreTrainedModel"),Yr=i(" forward method, overrides the "),Qo=s("code"),Zr=i("__call__"),ei=i(" special method."),ti=h(),b(qe.$$.fragment),oi=h(),b(je.$$.fragment),this.h()},l(o){const g=Gl('[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 It=r(f);m=a(It,"A",{id:!0,class:!0,href:!0});var Yo=r(m);_=a(Yo,"SPAN",{});var Zo=r(_);y(n.$$.fragment,Zo),Zo.forEach(t),Yo.forEach(t),p=u(It),x=a(It,"SPAN",{});var en=r(x);Rn=l(en,"GPT Neo"),en.forEach(t),It.forEach(t),dn=u(o),Q=a(o,"H2",{class:!0});var Lt=r(Q);me=a(Lt,"A",{id:!0,class:!0,href:!0});var tn=r(me);lo=a(tn,"SPAN",{});var on=r(lo);y(He.$$.fragment,on),on.forEach(t),tn.forEach(t),Xn=u(Lt),co=a(Lt,"SPAN",{});var nn=r(co);Kn=l(nn,"Overview"),nn.forEach(t),Lt.forEach(t),cn=u(o),V=a(o,"P",{});var he=r(V);Qn=l(he,"The GPTNeo model was released in the "),Ue=a(he,"A",{href:!0,rel:!0});var sn=r(Ue);Yn=l(sn,"EleutherAI/gpt-neo"),sn.forEach(t),Zn=l(he,` repository by Sid
Black, Stella Biderman, Leo Gao, Phil Wang and Connor Leahy. It is a GPT2 like causal language model trained on the
`),Ve=a(he,"A",{href:!0,rel:!0});var an=r(Ve);es=l(an,"Pile"),an.forEach(t),ts=l(he," dataset."),he.forEach(t),pn=u(o),Dt=a(o,"P",{});var rn=r(Dt);os=l(rn,`The architecture is similar to GPT2 except that GPT Neo uses local attention in every other layer with a window size of
256 tokens.`),rn.forEach(t),hn=u(o),fe=a(o,"P",{});var Mn=r(fe);ns=l(Mn,"This model was contributed by "),Je=a(Mn,"A",{href:!0,rel:!0});var si=r(Je);ss=l(si,"valhalla"),si.forEach(t),as=l(Mn,"."),Mn.forEach(t),un=u(o),Y=a(o,"H3",{class:!0});var Fn=r(Y);ge=a(Fn,"A",{id:!0,class:!0,href:!0});var ai=r(ge);po=a(ai,"SPAN",{});var ri=r(po);y(Re.$$.fragment,ri),ri.forEach(t),ai.forEach(t),rs=u(Fn),ho=a(Fn,"SPAN",{});var ii=r(ho);is=l(ii,"Generation"),ii.forEach(t),Fn.forEach(t),mn=u(o),_e=a(o,"P",{});var En=r(_e);ls=l(En,"The "),uo=a(En,"CODE",{});var li=r(uo);ds=l(li,"generate()"),li.forEach(t),cs=l(En," method can be used to generate text using GPT Neo model."),En.forEach(t),fn=u(o),y(Xe.$$.fragment,o),gn=u(o),Z=a(o,"H2",{class:!0});var Cn=r(Z);Te=a(Cn,"A",{id:!0,class:!0,href:!0});var di=r(Te);mo=a(di,"SPAN",{});var ci=r(mo);y(Ke.$$.fragment,ci),ci.forEach(t),di.forEach(t),ps=u(Cn),fo=a(Cn,"SPAN",{});var pi=r(fo);hs=l(pi,"GPTNeoConfig"),pi.forEach(t),Cn.forEach(t),_n=u(o),I=a(o,"DIV",{class:!0});var Ae=r(I);y(Qe.$$.fragment,Ae),us=u(Ae),ee=a(Ae,"P",{});var to=r(ee);ms=l(to,"This is the configuration class to store the configuration of a "),Bt=a(to,"A",{href:!0});var hi=r(Bt);fs=l(hi,"GPTNeoModel"),hi.forEach(t),gs=l(to,`. 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
`),Ye=a(to,"A",{href:!0,rel:!0});var ui=r(Ye);_s=l(ui,"EleutherAI/gpt-neo-1.3B"),ui.forEach(t),Ts=l(to," architecture."),to.forEach(t),vs=u(Ae),te=a(Ae,"P",{});var oo=r(te);bs=l(oo,"Configuration objects inherit from "),Wt=a(oo,"A",{href:!0});var mi=r(Wt);ys=l(mi,"PretrainedConfig"),mi.forEach(t),ks=l(oo,` and can be used to control the model outputs. Read the
documentation from `),Ht=a(oo,"A",{href:!0});var fi=r(Ht);Ps=l(fi,"PretrainedConfig"),fi.forEach(t),ws=l(oo," for more information."),oo.forEach(t),$s=u(Ae),y(ve.$$.fragment,Ae),Ae.forEach(t),Tn=u(o),oe=a(o,"H2",{class:!0});var zn=r(oe);be=a(zn,"A",{id:!0,class:!0,href:!0});var gi=r(be);go=a(gi,"SPAN",{});var _i=r(go);y(Ze.$$.fragment,_i),_i.forEach(t),gi.forEach(t),Ns=u(zn),_o=a(zn,"SPAN",{});var Ti=r(_o);xs=l(Ti,"GPTNeoModel"),Ti.forEach(t),zn.forEach(t),vn=u(o),E=a(o,"DIV",{class:!0});var J=r(E);y(et.$$.fragment,J),Gs=u(J),To=a(J,"P",{});var vi=r(To);Ms=l(vi,"The bare GPT Neo Model transformer outputting raw hidden-states without any specific head on top."),vi.forEach(t),Fs=u(J),tt=a(J,"P",{});var qn=r(tt);Es=l(qn,"This model inherits from "),Ut=a(qn,"A",{href:!0});var bi=r(Ut);Cs=l(bi,"PreTrainedModel"),bi.forEach(t),zs=l(qn,`. 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.)`),qn.forEach(t),qs=u(J),ot=a(J,"P",{});var jn=r(ot);js=l(jn,"This model is also a PyTorch "),nt=a(jn,"A",{href:!0,rel:!0});var yi=r(nt);As=l(yi,"torch.nn.Module"),yi.forEach(t),Is=l(jn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),jn.forEach(t),Ls=u(J),S=a(J,"DIV",{class:!0});var Ie=r(S);y(st.$$.fragment,Ie),Ss=u(Ie),ne=a(Ie,"P",{});var no=r(ne);Os=l(no,"The "),Vt=a(no,"A",{href:!0});var ki=r(Vt);Ds=l(ki,"GPTNeoModel"),ki.forEach(t),Bs=l(no," forward method, overrides the "),vo=a(no,"CODE",{});var Pi=r(vo);Ws=l(Pi,"__call__"),Pi.forEach(t),Hs=l(no," special method."),no.forEach(t),Us=u(Ie),y(ye.$$.fragment,Ie),Vs=u(Ie),y(ke.$$.fragment,Ie),Ie.forEach(t),J.forEach(t),bn=u(o),se=a(o,"H2",{class:!0});var An=r(se);Pe=a(An,"A",{id:!0,class:!0,href:!0});var wi=r(Pe);bo=a(wi,"SPAN",{});var $i=r(bo);y(at.$$.fragment,$i),$i.forEach(t),wi.forEach(t),Js=u(An),yo=a(An,"SPAN",{});var Ni=r(yo);Rs=l(Ni,"GPTNeoForCausalLM"),Ni.forEach(t),An.forEach(t),yn=u(o),C=a(o,"DIV",{class:!0});var R=r(C);y(rt.$$.fragment,R),Xs=u(R),ko=a(R,"P",{});var xi=r(ko);Ks=l(xi,`The GPT Neo Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),xi.forEach(t),Qs=u(R),it=a(R,"P",{});var In=r(it);Ys=l(In,"This model inherits from "),Jt=a(In,"A",{href:!0});var Gi=r(Jt);Zs=l(Gi,"PreTrainedModel"),Gi.forEach(t),ea=l(In,`. 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.)`),In.forEach(t),ta=u(R),lt=a(R,"P",{});var Ln=r(lt);oa=l(Ln,"This model is also a PyTorch "),dt=a(Ln,"A",{href:!0,rel:!0});var Mi=r(dt);na=l(Mi,"torch.nn.Module"),Mi.forEach(t),sa=l(Ln,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ln.forEach(t),aa=u(R),O=a(R,"DIV",{class:!0});var Le=r(O);y(ct.$$.fragment,Le),ra=u(Le),ae=a(Le,"P",{});var so=r(ae);ia=l(so,"The "),Rt=a(so,"A",{href:!0});var Fi=r(Rt);la=l(Fi,"GPTNeoForCausalLM"),Fi.forEach(t),da=l(so," forward method, overrides the "),Po=a(so,"CODE",{});var Ei=r(Po);ca=l(Ei,"__call__"),Ei.forEach(t),pa=l(so," special method."),so.forEach(t),ha=u(Le),y(we.$$.fragment,Le),ua=u(Le),y($e.$$.fragment,Le),Le.forEach(t),R.forEach(t),kn=u(o),re=a(o,"H2",{class:!0});var Sn=r(re);Ne=a(Sn,"A",{id:!0,class:!0,href:!0});var Ci=r(Ne);wo=a(Ci,"SPAN",{});var zi=r(wo);y(pt.$$.fragment,zi),zi.forEach(t),Ci.forEach(t),ma=u(Sn),$o=a(Sn,"SPAN",{});var qi=r($o);fa=l(qi,"GPTNeoForSequenceClassification"),qi.forEach(t),Sn.forEach(t),Pn=u(o),G=a(o,"DIV",{class:!0});var q=r(G);y(ht.$$.fragment,q),ga=u(q),No=a(q,"P",{});var ji=r(No);_a=l(ji,"The GPTNeo Model transformer with a sequence classification head on top (linear layer)."),ji.forEach(t),Ta=u(q),Xt=a(q,"P",{});var ni=r(Xt);Kt=a(ni,"A",{href:!0});var Ai=r(Kt);va=l(Ai,"GPTNeoForSequenceClassification"),Ai.forEach(t),ba=l(ni,` uses the last token in order to do the classification, as other causal models
(e.g. GPT-1) do.`),ni.forEach(t),ya=u(q),L=a(q,"P",{});var X=r(L);ka=l(X,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),xo=a(X,"CODE",{});var Ii=r(xo);Pa=l(Ii,"pad_token_id"),Ii.forEach(t),wa=l(X,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Go=a(X,"CODE",{});var Li=r(Go);$a=l(Li,"pad_token_id"),Li.forEach(t),Na=l(X,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),Mo=a(X,"CODE",{});var Si=r(Mo);xa=l(Si,"inputs_embeds"),Si.forEach(t),Ga=l(X," are passed instead of "),Fo=a(X,"CODE",{});var Oi=r(Fo);Ma=l(Oi,"input_ids"),Oi.forEach(t),Fa=l(X,`, it does the same (take the last value in
each row of the batch).`),X.forEach(t),Ea=u(q),ut=a(q,"P",{});var On=r(ut);Ca=l(On,"This model inherits from "),Qt=a(On,"A",{href:!0});var Di=r(Qt);za=l(Di,"PreTrainedModel"),Di.forEach(t),qa=l(On,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),On.forEach(t),ja=u(q),mt=a(q,"P",{});var Dn=r(mt);Aa=l(Dn,"This model is also a PyTorch "),ft=a(Dn,"A",{href:!0,rel:!0});var Bi=r(ft);Ia=l(Bi,"torch.nn.Module"),Bi.forEach(t),La=l(Dn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Dn.forEach(t),Sa=u(q),z=a(q,"DIV",{class:!0});var K=r(z);y(gt.$$.fragment,K),Oa=u(K),ie=a(K,"P",{});var ao=r(ie);Da=l(ao,"The "),Yt=a(ao,"A",{href:!0});var Wi=r(Yt);Ba=l(Wi,"GPTNeoForSequenceClassification"),Wi.forEach(t),Wa=l(ao," forward method, overrides the "),Eo=a(ao,"CODE",{});var Hi=r(Eo);Ha=l(Hi,"__call__"),Hi.forEach(t),Ua=l(ao," special method."),ao.forEach(t),Va=u(K),y(xe.$$.fragment,K),Ja=u(K),y(Ge.$$.fragment,K),Ra=u(K),y(Me.$$.fragment,K),K.forEach(t),q.forEach(t),wn=u(o),le=a(o,"H2",{class:!0});var Bn=r(le);Fe=a(Bn,"A",{id:!0,class:!0,href:!0});var Ui=r(Fe);Co=a(Ui,"SPAN",{});var Vi=r(Co);y(_t.$$.fragment,Vi),Vi.forEach(t),Ui.forEach(t),Xa=u(Bn),zo=a(Bn,"SPAN",{});var Ji=r(zo);Ka=l(Ji,"FlaxGPTNeoModel"),Ji.forEach(t),Bn.forEach(t),$n=u(o),M=a(o,"DIV",{class:!0});var j=r(M);y(Tt.$$.fragment,j),Qa=u(j),qo=a(j,"P",{});var Ri=r(qo);Ya=l(Ri,"The bare GPTNeo Model transformer outputting raw hidden-states without any specific head on top."),Ri.forEach(t),Za=u(j),vt=a(j,"P",{});var Wn=r(vt);er=l(Wn,"This model inherits from "),Zt=a(Wn,"A",{href:!0});var Xi=r(Zt);tr=l(Xi,"FlaxPreTrainedModel"),Xi.forEach(t),or=l(Wn,`. 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.)`),Wn.forEach(t),nr=u(j),bt=a(j,"P",{});var Hn=r(bt);sr=l(Hn,`This model is also a Flax Linen
`),yt=a(Hn,"A",{href:!0,rel:!0});var Ki=r(yt);ar=l(Ki,"flax.nn.Module"),Ki.forEach(t),rr=l(Hn,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Hn.forEach(t),ir=u(j),jo=a(j,"P",{});var Qi=r(jo);lr=l(Qi,"Finally, this model supports inherent JAX features such as:"),Qi.forEach(t),dr=u(j),W=a(j,"UL",{});var Se=r(W);Ao=a(Se,"LI",{});var Yi=r(Ao);kt=a(Yi,"A",{href:!0,rel:!0});var Zi=r(kt);cr=l(Zi,"Just-In-Time (JIT) compilation"),Zi.forEach(t),Yi.forEach(t),pr=u(Se),Io=a(Se,"LI",{});var el=r(Io);Pt=a(el,"A",{href:!0,rel:!0});var tl=r(Pt);hr=l(tl,"Automatic Differentiation"),tl.forEach(t),el.forEach(t),ur=u(Se),Lo=a(Se,"LI",{});var ol=r(Lo);wt=a(ol,"A",{href:!0,rel:!0});var nl=r(wt);mr=l(nl,"Vectorization"),nl.forEach(t),ol.forEach(t),fr=u(Se),So=a(Se,"LI",{});var sl=r(So);$t=a(sl,"A",{href:!0,rel:!0});var al=r($t);gr=l(al,"Parallelization"),al.forEach(t),sl.forEach(t),Se.forEach(t),_r=u(j),D=a(j,"DIV",{class:!0});var Oe=r(D);y(Nt.$$.fragment,Oe),Tr=u(Oe),de=a(Oe,"P",{});var ro=r(de);vr=l(ro,"The "),Oo=a(ro,"CODE",{});var rl=r(Oo);br=l(rl,"FlaxGPTNeoPreTrainedModel"),rl.forEach(t),yr=l(ro," forward method, overrides the "),Do=a(ro,"CODE",{});var il=r(Do);kr=l(il,"__call__"),il.forEach(t),Pr=l(ro," special method."),ro.forEach(t),wr=u(Oe),y(Ee.$$.fragment,Oe),$r=u(Oe),y(Ce.$$.fragment,Oe),Oe.forEach(t),j.forEach(t),Nn=u(o),ce=a(o,"H2",{class:!0});var Un=r(ce);ze=a(Un,"A",{id:!0,class:!0,href:!0});var ll=r(ze);Bo=a(ll,"SPAN",{});var dl=r(Bo);y(xt.$$.fragment,dl),dl.forEach(t),ll.forEach(t),Nr=u(Un),Wo=a(Un,"SPAN",{});var cl=r(Wo);xr=l(cl,"FlaxGPTNeoForCausalLM"),cl.forEach(t),Un.forEach(t),xn=u(o),F=a(o,"DIV",{class:!0});var A=r(F);y(Gt.$$.fragment,A),Gr=u(A),Ho=a(A,"P",{});var pl=r(Ho);Mr=l(pl,`The GPTNeo Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),pl.forEach(t),Fr=u(A),Mt=a(A,"P",{});var Vn=r(Mt);Er=l(Vn,"This model inherits from "),eo=a(Vn,"A",{href:!0});var hl=r(eo);Cr=l(hl,"FlaxPreTrainedModel"),hl.forEach(t),zr=l(Vn,`. 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.)`),Vn.forEach(t),qr=u(A),Ft=a(A,"P",{});var Jn=r(Ft);jr=l(Jn,`This model is also a Flax Linen
`),Et=a(Jn,"A",{href:!0,rel:!0});var ul=r(Et);Ar=l(ul,"flax.nn.Module"),ul.forEach(t),Ir=l(Jn,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Jn.forEach(t),Lr=u(A),Uo=a(A,"P",{});var ml=r(Uo);Sr=l(ml,"Finally, this model supports inherent JAX features such as:"),ml.forEach(t),Or=u(A),H=a(A,"UL",{});var De=r(H);Vo=a(De,"LI",{});var fl=r(Vo);Ct=a(fl,"A",{href:!0,rel:!0});var gl=r(Ct);Dr=l(gl,"Just-In-Time (JIT) compilation"),gl.forEach(t),fl.forEach(t),Br=u(De),Jo=a(De,"LI",{});var _l=r(Jo);zt=a(_l,"A",{href:!0,rel:!0});var Tl=r(zt);Wr=l(Tl,"Automatic Differentiation"),Tl.forEach(t),_l.forEach(t),Hr=u(De),Ro=a(De,"LI",{});var vl=r(Ro);qt=a(vl,"A",{href:!0,rel:!0});var bl=r(qt);Ur=l(bl,"Vectorization"),bl.forEach(t),vl.forEach(t),Vr=u(De),Xo=a(De,"LI",{});var yl=r(Xo);jt=a(yl,"A",{href:!0,rel:!0});var kl=r(jt);Jr=l(kl,"Parallelization"),kl.forEach(t),yl.forEach(t),De.forEach(t),Rr=u(A),B=a(A,"DIV",{class:!0});var Be=r(B);y(At.$$.fragment,Be),Xr=u(Be),pe=a(Be,"P",{});var io=r(pe);Kr=l(io,"The "),Ko=a(io,"CODE",{});var Pl=r(Ko);Qr=l(Pl,"FlaxGPTNeoPreTrainedModel"),Pl.forEach(t),Yr=l(io," forward method, overrides the "),Qo=a(io,"CODE",{});var wl=r(Qo);Zr=l(wl,"__call__"),wl.forEach(t),ei=l(io," special method."),io.forEach(t),ti=u(Be),y(qe.$$.fragment,Be),oi=u(Be),y(je.$$.fragment,Be),Be.forEach(t),A.forEach(t),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(Wl)),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(me,"id","overview"),c(me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(me,"href","#overview"),c(Q,"class","relative group"),c(Ue,"href","https://github.com/EleutherAI/gpt-neo"),c(Ue,"rel","nofollow"),c(Ve,"href","https://pile.eleuther.ai/"),c(Ve,"rel","nofollow"),c(Je,"href","https://huggingface.co/valhalla"),c(Je,"rel","nofollow"),c(ge,"id","generation"),c(ge,"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(ge,"href","#generation"),c(Y,"class","relative group"),c(Te,"id","transformers.GPTNeoConfig"),c(Te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Te,"href","#transformers.GPTNeoConfig"),c(Z,"class","relative group"),c(Bt,"href","/docs/transformers/main/en/model_doc/gpt_neo#transformers.GPTNeoModel"),c(Ye,"href","https://huggingface.co/EleutherAI/gpt-neo-1.3B"),c(Ye,"rel","nofollow"),c(Wt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(Ht,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),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(be,"id","transformers.GPTNeoModel"),c(be,"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(be,"href","#transformers.GPTNeoModel"),c(oe,"class","relative group"),c(Ut,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(nt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(nt,"rel","nofollow"),c(Vt,"href","/docs/transformers/main/en/model_doc/gpt_neo#transformers.GPTNeoModel"),c(S,"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"),c(Pe,"id","transformers.GPTNeoForCausalLM"),c(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Pe,"href","#transformers.GPTNeoForCausalLM"),c(se,"class","relative group"),c(Jt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(dt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(dt,"rel","nofollow"),c(Rt,"href","/docs/transformers/main/en/model_doc/gpt_neo#transformers.GPTNeoForCausalLM"),c(O,"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(Ne,"id","transformers.GPTNeoForSequenceClassification"),c(Ne,"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(Ne,"href","#transformers.GPTNeoForSequenceClassification"),c(re,"class","relative group"),c(Kt,"href","/docs/transformers/main/en/model_doc/gpt_neo#transformers.GPTNeoForSequenceClassification"),c(Qt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(ft,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ft,"rel","nofollow"),c(Yt,"href","/docs/transformers/main/en/model_doc/gpt_neo#transformers.GPTNeoForSequenceClassification"),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(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(Fe,"id","transformers.FlaxGPTNeoModel"),c(Fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Fe,"href","#transformers.FlaxGPTNeoModel"),c(le,"class","relative group"),c(Zt,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(yt,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),c(yt,"rel","nofollow"),c(kt,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(kt,"rel","nofollow"),c(Pt,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(Pt,"rel","nofollow"),c(wt,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(wt,"rel","nofollow"),c($t,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c($t,"rel","nofollow"),c(D,"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(ze,"id","transformers.FlaxGPTNeoForCausalLM"),c(ze,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ze,"href","#transformers.FlaxGPTNeoForCausalLM"),c(ce,"class","relative group"),c(eo,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(Et,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),c(Et,"rel","nofollow"),c(Ct,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(Ct,"rel","nofollow"),c(zt,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(zt,"rel","nofollow"),c(qt,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(qt,"rel","nofollow"),c(jt,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(jt,"rel","nofollow"),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(F,"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,_),k(n,_,null),e(f,p),e(f,x),e(x,Rn),T(o,dn,g),T(o,Q,g),e(Q,me),e(me,lo),k(He,lo,null),e(Q,Xn),e(Q,co),e(co,Kn),T(o,cn,g),T(o,V,g),e(V,Qn),e(V,Ue),e(Ue,Yn),e(V,Zn),e(V,Ve),e(Ve,es),e(V,ts),T(o,pn,g),T(o,Dt,g),e(Dt,os),T(o,hn,g),T(o,fe,g),e(fe,ns),e(fe,Je),e(Je,ss),e(fe,as),T(o,un,g),T(o,Y,g),e(Y,ge),e(ge,po),k(Re,po,null),e(Y,rs),e(Y,ho),e(ho,is),T(o,mn,g),T(o,_e,g),e(_e,ls),e(_e,uo),e(uo,ds),e(_e,cs),T(o,fn,g),k(Xe,o,g),T(o,gn,g),T(o,Z,g),e(Z,Te),e(Te,mo),k(Ke,mo,null),e(Z,ps),e(Z,fo),e(fo,hs),T(o,_n,g),T(o,I,g),k(Qe,I,null),e(I,us),e(I,ee),e(ee,ms),e(ee,Bt),e(Bt,fs),e(ee,gs),e(ee,Ye),e(Ye,_s),e(ee,Ts),e(I,vs),e(I,te),e(te,bs),e(te,Wt),e(Wt,ys),e(te,ks),e(te,Ht),e(Ht,Ps),e(te,ws),e(I,$s),k(ve,I,null),T(o,Tn,g),T(o,oe,g),e(oe,be),e(be,go),k(Ze,go,null),e(oe,Ns),e(oe,_o),e(_o,xs),T(o,vn,g),T(o,E,g),k(et,E,null),e(E,Gs),e(E,To),e(To,Ms),e(E,Fs),e(E,tt),e(tt,Es),e(tt,Ut),e(Ut,Cs),e(tt,zs),e(E,qs),e(E,ot),e(ot,js),e(ot,nt),e(nt,As),e(ot,Is),e(E,Ls),e(E,S),k(st,S,null),e(S,Ss),e(S,ne),e(ne,Os),e(ne,Vt),e(Vt,Ds),e(ne,Bs),e(ne,vo),e(vo,Ws),e(ne,Hs),e(S,Us),k(ye,S,null),e(S,Vs),k(ke,S,null),T(o,bn,g),T(o,se,g),e(se,Pe),e(Pe,bo),k(at,bo,null),e(se,Js),e(se,yo),e(yo,Rs),T(o,yn,g),T(o,C,g),k(rt,C,null),e(C,Xs),e(C,ko),e(ko,Ks),e(C,Qs),e(C,it),e(it,Ys),e(it,Jt),e(Jt,Zs),e(it,ea),e(C,ta),e(C,lt),e(lt,oa),e(lt,dt),e(dt,na),e(lt,sa),e(C,aa),e(C,O),k(ct,O,null),e(O,ra),e(O,ae),e(ae,ia),e(ae,Rt),e(Rt,la),e(ae,da),e(ae,Po),e(Po,ca),e(ae,pa),e(O,ha),k(we,O,null),e(O,ua),k($e,O,null),T(o,kn,g),T(o,re,g),e(re,Ne),e(Ne,wo),k(pt,wo,null),e(re,ma),e(re,$o),e($o,fa),T(o,Pn,g),T(o,G,g),k(ht,G,null),e(G,ga),e(G,No),e(No,_a),e(G,Ta),e(G,Xt),e(Xt,Kt),e(Kt,va),e(Xt,ba),e(G,ya),e(G,L),e(L,ka),e(L,xo),e(xo,Pa),e(L,wa),e(L,Go),e(Go,$a),e(L,Na),e(L,Mo),e(Mo,xa),e(L,Ga),e(L,Fo),e(Fo,Ma),e(L,Fa),e(G,Ea),e(G,ut),e(ut,Ca),e(ut,Qt),e(Qt,za),e(ut,qa),e(G,ja),e(G,mt),e(mt,Aa),e(mt,ft),e(ft,Ia),e(mt,La),e(G,Sa),e(G,z),k(gt,z,null),e(z,Oa),e(z,ie),e(ie,Da),e(ie,Yt),e(Yt,Ba),e(ie,Wa),e(ie,Eo),e(Eo,Ha),e(ie,Ua),e(z,Va),k(xe,z,null),e(z,Ja),k(Ge,z,null),e(z,Ra),k(Me,z,null),T(o,wn,g),T(o,le,g),e(le,Fe),e(Fe,Co),k(_t,Co,null),e(le,Xa),e(le,zo),e(zo,Ka),T(o,$n,g),T(o,M,g),k(Tt,M,null),e(M,Qa),e(M,qo),e(qo,Ya),e(M,Za),e(M,vt),e(vt,er),e(vt,Zt),e(Zt,tr),e(vt,or),e(M,nr),e(M,bt),e(bt,sr),e(bt,yt),e(yt,ar),e(bt,rr),e(M,ir),e(M,jo),e(jo,lr),e(M,dr),e(M,W),e(W,Ao),e(Ao,kt),e(kt,cr),e(W,pr),e(W,Io),e(Io,Pt),e(Pt,hr),e(W,ur),e(W,Lo),e(Lo,wt),e(wt,mr),e(W,fr),e(W,So),e(So,$t),e($t,gr),e(M,_r),e(M,D),k(Nt,D,null),e(D,Tr),e(D,de),e(de,vr),e(de,Oo),e(Oo,br),e(de,yr),e(de,Do),e(Do,kr),e(de,Pr),e(D,wr),k(Ee,D,null),e(D,$r),k(Ce,D,null),T(o,Nn,g),T(o,ce,g),e(ce,ze),e(ze,Bo),k(xt,Bo,null),e(ce,Nr),e(ce,Wo),e(Wo,xr),T(o,xn,g),T(o,F,g),k(Gt,F,null),e(F,Gr),e(F,Ho),e(Ho,Mr),e(F,Fr),e(F,Mt),e(Mt,Er),e(Mt,eo),e(eo,Cr),e(Mt,zr),e(F,qr),e(F,Ft),e(Ft,jr),e(Ft,Et),e(Et,Ar),e(Ft,Ir),e(F,Lr),e(F,Uo),e(Uo,Sr),e(F,Or),e(F,H),e(H,Vo),e(Vo,Ct),e(Ct,Dr),e(H,Br),e(H,Jo),e(Jo,zt),e(zt,Wr),e(H,Hr),e(H,Ro),e(Ro,qt),e(qt,Ur),e(H,Vr),e(H,Xo),e(Xo,jt),e(jt,Jr),e(F,Rr),e(F,B),k(At,B,null),e(B,Xr),e(B,pe),e(pe,Kr),e(pe,Ko),e(Ko,Qr),e(pe,Yr),e(pe,Qo),e(Qo,Zr),e(pe,ei),e(B,ti),k(qe,B,null),e(B,oi),k(je,B,null),Gn=!0},p(o,[g]){const It={};g&2&&(It.$$scope={dirty:g,ctx:o}),ve.$set(It);const Yo={};g&2&&(Yo.$$scope={dirty:g,ctx:o}),ye.$set(Yo);const Zo={};g&2&&(Zo.$$scope={dirty:g,ctx:o}),ke.$set(Zo);const en={};g&2&&(en.$$scope={dirty:g,ctx:o}),we.$set(en);const Lt={};g&2&&(Lt.$$scope={dirty:g,ctx:o}),$e.$set(Lt);const tn={};g&2&&(tn.$$scope={dirty:g,ctx:o}),xe.$set(tn);const on={};g&2&&(on.$$scope={dirty:g,ctx:o}),Ge.$set(on);const nn={};g&2&&(nn.$$scope={dirty:g,ctx:o}),Me.$set(nn);const he={};g&2&&(he.$$scope={dirty:g,ctx:o}),Ee.$set(he);const sn={};g&2&&(sn.$$scope={dirty:g,ctx:o}),Ce.$set(sn);const an={};g&2&&(an.$$scope={dirty:g,ctx:o}),qe.$set(an);const rn={};g&2&&(rn.$$scope={dirty:g,ctx:o}),je.$set(rn)},i(o){Gn||(P(n.$$.fragment,o),P(He.$$.fragment,o),P(Re.$$.fragment,o),P(Xe.$$.fragment,o),P(Ke.$$.fragment,o),P(Qe.$$.fragment,o),P(ve.$$.fragment,o),P(Ze.$$.fragment,o),P(et.$$.fragment,o),P(st.$$.fragment,o),P(ye.$$.fragment,o),P(ke.$$.fragment,o),P(at.$$.fragment,o),P(rt.$$.fragment,o),P(ct.$$.fragment,o),P(we.$$.fragment,o),P($e.$$.fragment,o),P(pt.$$.fragment,o),P(ht.$$.fragment,o),P(gt.$$.fragment,o),P(xe.$$.fragment,o),P(Ge.$$.fragment,o),P(Me.$$.fragment,o),P(_t.$$.fragment,o),P(Tt.$$.fragment,o),P(Nt.$$.fragment,o),P(Ee.$$.fragment,o),P(Ce.$$.fragment,o),P(xt.$$.fragment,o),P(Gt.$$.fragment,o),P(At.$$.fragment,o),P(qe.$$.fragment,o),P(je.$$.fragment,o),Gn=!0)},o(o){w(n.$$.fragment,o),w(He.$$.fragment,o),w(Re.$$.fragment,o),w(Xe.$$.fragment,o),w(Ke.$$.fragment,o),w(Qe.$$.fragment,o),w(ve.$$.fragment,o),w(Ze.$$.fragment,o),w(et.$$.fragment,o),w(st.$$.fragment,o),w(ye.$$.fragment,o),w(ke.$$.fragment,o),w(at.$$.fragment,o),w(rt.$$.fragment,o),w(ct.$$.fragment,o),w(we.$$.fragment,o),w($e.$$.fragment,o),w(pt.$$.fragment,o),w(ht.$$.fragment,o),w(gt.$$.fragment,o),w(xe.$$.fragment,o),w(Ge.$$.fragment,o),w(Me.$$.fragment,o),w(_t.$$.fragment,o),w(Tt.$$.fragment,o),w(Nt.$$.fragment,o),w(Ee.$$.fragment,o),w(Ce.$$.fragment,o),w(xt.$$.fragment,o),w(Gt.$$.fragment,o),w(At.$$.fragment,o),w(qe.$$.fragment,o),w(je.$$.fragment,o),Gn=!1},d(o){t(d),o&&t(v),o&&t(f),$(n),o&&t(dn),o&&t(Q),$(He),o&&t(cn),o&&t(V),o&&t(pn),o&&t(Dt),o&&t(hn),o&&t(fe),o&&t(un),o&&t(Y),$(Re),o&&t(mn),o&&t(_e),o&&t(fn),$(Xe,o),o&&t(gn),o&&t(Z),$(Ke),o&&t(_n),o&&t(I),$(Qe),$(ve),o&&t(Tn),o&&t(oe),$(Ze),o&&t(vn),o&&t(E),$(et),$(st),$(ye),$(ke),o&&t(bn),o&&t(se),$(at),o&&t(yn),o&&t(C),$(rt),$(ct),$(we),$($e),o&&t(kn),o&&t(re),$(pt),o&&t(Pn),o&&t(G),$(ht),$(gt),$(xe),$(Ge),$(Me),o&&t(wn),o&&t(le),$(_t),o&&t($n),o&&t(M),$(Tt),$(Nt),$(Ee),$(Ce),o&&t(Nn),o&&t(ce),$(xt),o&&t(xn),o&&t(F),$(Gt),$(At),$(qe),$(je)}}}const Wl={local:"gpt-neo",sections:[{local:"overview",sections:[{local:"generation",title:"Generation"}],title:"Overview"},{local:"transformers.GPTNeoConfig",title:"GPTNeoConfig"},{local:"transformers.GPTNeoModel",title:"GPTNeoModel"},{local:"transformers.GPTNeoForCausalLM",title:"GPTNeoForCausalLM"},{local:"transformers.GPTNeoForSequenceClassification",title:"GPTNeoForSequenceClassification"},{local:"transformers.FlaxGPTNeoModel",title:"FlaxGPTNeoModel"},{local:"transformers.FlaxGPTNeoForCausalLM",title:"FlaxGPTNeoForCausalLM"}],title:"GPT Neo"};function Hl(N){return Ml(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ql extends $l{constructor(d){super();Nl(this,d,Hl,Bl,xl,{})}}export{Ql as default,Wl as metadata};
