import{S as pp,i as hp,s as up,e as s,k as h,w as b,t as l,M as mp,c as a,d as t,m as u,a as r,x as v,h as i,b as c,G as e,g as T,y as w,q as M,o as k,B as G,v as fp,L as xe}from"../../chunks/vendor-hf-doc-builder.js";import{T as _t}from"../../chunks/Tip-hf-doc-builder.js";import{D as U}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ie}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as O}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Fe}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function gp(N){let d,y,f,m,_;return m=new ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdQVE5lb0NvbmZpZyUyQyUyMEdQVE5lb01vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEdQVE5lbyUyMEVsZXV0aGVyQUklMkZncHQtbmVvLTEuM0IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwR1BUTmVvQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMEVsZXV0aGVyQUklMkZncHQtbmVvLTEuM0IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEdQVE5lb01vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",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"),y=l("Example:"),f=h(),b(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);y=i(p,"Example:"),p.forEach(t),f=u(n),v(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,y),T(n,f,p),w(m,n,p),_=!0},p:xe,i(n){_||(M(m.$$.fragment,n),_=!0)},o(n){k(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),G(m,n)}}}function _p(N){let d,y,f,m,_;return{c(){d=s("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=l("Module"),_=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=a(n,"P",{});var p=r(d);y=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var $=r(f);m=i($,"Module"),$.forEach(t),_=i(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,y),e(d,f),e(f,m),e(d,_)},d(n){n&&t(d)}}}function Tp(N){let d,y,f,m,_;return m=new ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBHUFROZW9Nb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyRWxldXRoZXJBSSUyRmdwdC1uZW8tMS4zQiUyMiklMEFtb2RlbCUyMCUzRCUyMEdQVE5lb01vZGVsLmZyb21fcHJldHJhaW5lZCglMjJFbGV1dGhlckFJJTJGZ3B0LW5lby0xLjNCJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",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"),y=l("Example:"),f=h(),b(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);y=i(p,"Example:"),p.forEach(t),f=u(n),v(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,y),T(n,f,p),w(m,n,p),_=!0},p:xe,i(n){_||(M(m.$$.fragment,n),_=!0)},o(n){k(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),G(m,n)}}}function yp(N){let d,y,f,m,_;return{c(){d=s("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=l("Module"),_=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=a(n,"P",{});var p=r(d);y=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var $=r(f);m=i($,"Module"),$.forEach(t),_=i(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,y),e(d,f),e(f,m),e(d,_)},d(n){n&&t(d)}}}function bp(N){let d,y,f,m,_;return m=new ie({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEdQVE5lb0ZvckNhdXNhbExNJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyRWxldXRoZXJBSSUyRmdwdC1uZW8tMS4zQiUyMiklMEFtb2RlbCUyMCUzRCUyMEdQVE5lb0ZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJFbGV1dGhlckFJJTJGZ3B0LW5lby0xLjNCJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RpbnB1dHMlNUIlMjJpbnB1dF9pZHMlMjIlNUQpJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcyUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",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"),y=l("Example:"),f=h(),b(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);y=i(p,"Example:"),p.forEach(t),f=u(n),v(m.$$.fragment,n)},m(n,p){T(n,d,p),e(d,y),T(n,f,p),w(m,n,p),_=!0},p:xe,i(n){_||(M(m.$$.fragment,n),_=!0)},o(n){k(m.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),G(m,n)}}}function vp(N){let d,y,f,m,_;return{c(){d=s("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=l("Module"),_=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=a(n,"P",{});var p=r(d);y=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var $=r(f);m=i($,"Module"),$.forEach(t),_=i(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,y),e(d,f),e(f,m),e(d,_)},d(n){n&&t(d)}}}function wp(N){let d,y,f,m,_,n,p,$;return{c(){d=s("p"),y=l(`This example uses a random model as the real ones are all very big. To get proper results, you should use
EleutherAI/gpt-neo-1.3B instead of EleutherAI/gpt-neo-1.3B. If you get out-of-memory when loading that checkpoint, you can try
adding `),f=s("code"),m=l('device_map="auto"'),_=l(" in the "),n=s("code"),p=l("from_pretrained"),$=l(" call.")},l(de){d=a(de,"P",{});var A=r(d);y=i(A,`This example uses a random model as the real ones are all very big. To get proper results, you should use
EleutherAI/gpt-neo-1.3B instead of EleutherAI/gpt-neo-1.3B. If you get out-of-memory when loading that checkpoint, you can try
adding `),f=a(A,"CODE",{});var R=r(f);m=i(R,'device_map="auto"'),R.forEach(t),_=i(A," in the "),n=a(A,"CODE",{});var D=r(n);p=i(D,"from_pretrained"),D.forEach(t),$=i(A," call."),A.forEach(t)},m(de,A){T(de,d,A),e(d,y),e(d,f),e(f,m),e(d,_),e(d,n),e(n,p),e(d,$)},d(de){de&&t(d)}}}function Mp(N){let d,y,f,m,_;return m=new ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBHUFROZW9Gb3JRdWVzdGlvbkFuc3dlcmluZyUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyRWxldXRoZXJBSSUyRmdwdC1uZW8tMS4zQiUyMiklMEFtb2RlbCUyMCUzRCUyMEdQVE5lb0ZvclF1ZXN0aW9uQW5zd2VyaW5nLmZyb21fcHJldHJhaW5lZCglMjJFbGV1dGhlckFJJTJGZ3B0LW5lby0xLjNCJTIyKSUwQSUwQXF1ZXN0aW9uJTJDJTIwdGV4dCUyMCUzRCUyMCUyMldobyUyMHdhcyUyMEppbSUyMEhlbnNvbiUzRiUyMiUyQyUyMCUyMkppbSUyMEhlbnNvbiUyMHdhcyUyMGElMjBuaWNlJTIwcHVwcGV0JTIyJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHF1ZXN0aW9uJTJDJTIwdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0QlMjBvdXRwdXRzLnN0YXJ0X2xvZ2l0cy5hcmdtYXgoKSUwQWFuc3dlcl9lbmRfaW5kZXglMjAlM0QlMjBvdXRwdXRzLmVuZF9sb2dpdHMuYXJnbWF4KCklMEElMEFwcmVkaWN0X2Fuc3dlcl90b2tlbnMlMjAlM0QlMjBpbnB1dHMuaW5wdXRfaWRzJTVCMCUyQyUyMGFuc3dlcl9zdGFydF9pbmRleCUyMCUzQSUyMGFuc3dlcl9lbmRfaW5kZXglMjAlMkIlMjAxJTVEJTBBJTBBJTIzJTIwdGFyZ2V0JTIwaXMlMjAlMjJuaWNlJTIwcHVwcGV0JTIyJTBBdGFyZ2V0X3N0YXJ0X2luZGV4JTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QjE0JTVEKSUwQXRhcmdldF9lbmRfaW5kZXglMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCMTUlNUQpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwc3RhcnRfcG9zaXRpb25zJTNEdGFyZ2V0X3N0YXJ0X2luZGV4JTJDJTIwZW5kX3Bvc2l0aW9ucyUzRHRhcmdldF9lbmRfaW5kZXgpJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GPTNeoForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

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

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

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

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

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

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

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

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

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

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

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

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