Buckets:
| import{s as Ts,o as bs,n as j}from"../chunks/scheduler.25b97de1.js";import{S as ys,i as Ms,g as p,s as a,r as g,A as ws,h,f as o,c as r,j as N,u as m,x as y,k as X,l as ks,y as c,a as i,v as u,d as f,t as _,w as T}from"../chunks/index.d9030fc9.js";import{T as Te}from"../chunks/Tip.baa67368.js";import{D as U}from"../chunks/Docstring.ffac8efa.js";import{C as B}from"../chunks/CodeBlock.e6cd0d95.js";import{E as be}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as G,E as vs}from"../chunks/EditOnGithub.91d95064.js";function $s(k){let n,b;return n=new B({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdQVE5lb1hDb25maWclMkMlMjBHUFROZW9YTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwR1BUTmVvWCUyMGdwdC1uZW94LTIwYiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBHUFROZW9YQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGdwdC1uZW94LTIwYiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwR1BUTmVvWE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPTNeoXConfig, GPTNeoXModel | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Initializing a GPTNeoX gpt-neox-20b style configuration</span> | |
| <span class="hljs-meta">>>> </span>configuration = GPTNeoXConfig() | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Initializing a model (with random weights) from the gpt-neox-20b style configuration</span> | |
| <span class="hljs-meta">>>> </span>model = GPTNeoXModel(configuration) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Accessing the model configuration</span> | |
| <span class="hljs-meta">>>> </span>configuration = model.config`,wrap:!1}}),{c(){g(n.$$.fragment)},l(l){m(n.$$.fragment,l)},m(l,d){u(n,l,d),b=!0},p:j,i(l){b||(f(n.$$.fragment,l),b=!0)},o(l){_(n.$$.fragment,l),b=!1},d(l){T(n,l)}}}function Gs(k){let n,b="be encoded differently whether it is at the beginning of the sentence (without space) or not:",l,d,M;return d=new B({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdQVE5lb1hUb2tlbml6ZXJGYXN0JTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwR1BUTmVvWFRva2VuaXplckZhc3QuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haS1jb21tdW5pdHklMkZncHQyJTIyKSUwQXRva2VuaXplciglMjJIZWxsbyUyMHdvcmxkJTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RCUwQSUwQXRva2VuaXplciglMjIlMjBIZWxsbyUyMHdvcmxkJTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RA==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPTNeoXTokenizerFast | |
| <span class="hljs-meta">>>> </span>tokenizer = GPTNeoXTokenizerFast.from_pretrained(<span class="hljs-string">"openai-community/gpt2"</span>) | |
| <span class="hljs-meta">>>> </span>tokenizer(<span class="hljs-string">"Hello world"</span>)[<span class="hljs-string">"input_ids"</span>] | |
| [<span class="hljs-number">15496</span>, <span class="hljs-number">995</span>] | |
| <span class="hljs-meta">>>> </span>tokenizer(<span class="hljs-string">" Hello world"</span>)[<span class="hljs-string">"input_ids"</span>] | |
| [<span class="hljs-number">18435</span>, <span class="hljs-number">995</span>]`,wrap:!1}}),{c(){n=p("p"),n.textContent=b,l=a(),g(d.$$.fragment)},l(s){n=h(s,"P",{"data-svelte-h":!0}),y(n)!=="svelte-12atnao"&&(n.textContent=b),l=r(s),m(d.$$.fragment,s)},m(s,w){i(s,n,w),i(s,l,w),u(d,s,w),M=!0},p:j,i(s){M||(f(d.$$.fragment,s),M=!0)},o(s){_(d.$$.fragment,s),M=!1},d(s){s&&(o(n),o(l)),T(d,s)}}}function xs(k){let n,b="When used with <code>is_split_into_words=True</code>, this tokenizer needs to be instantiated with <code>add_prefix_space=True</code>.";return{c(){n=p("p"),n.innerHTML=b},l(l){n=h(l,"P",{"data-svelte-h":!0}),y(n)!=="svelte-9gg91e"&&(n.innerHTML=b)},m(l,d){i(l,n,d)},p:j,d(l){l&&o(n)}}}function Ns(k){let n,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){n=p("p"),n.innerHTML=b},l(l){n=h(l,"P",{"data-svelte-h":!0}),y(n)!=="svelte-fincs2"&&(n.innerHTML=b)},m(l,d){i(l,n,d)},p:j,d(l){l&&o(n)}}}function Xs(k){let n,b=`This example uses a random model as the real ones are all very big. To get proper results, you should use | |
| EleutherAI/gpt-neox-20b instead of trl-internal-testing/tiny-random-GPTNeoXForCausalLM. If you get out-of-memory when loading that checkpoint, you can try | |
| adding <code>device_map="auto"</code> in the <code>from_pretrained</code> call.`;return{c(){n=p("p"),n.innerHTML=b},l(l){n=h(l,"P",{"data-svelte-h":!0}),y(n)!=="svelte-1lgpfzy"&&(n.innerHTML=b)},m(l,d){i(l,n,d)},p:j,d(l){l&&o(n)}}}function js(k){let n,b="Example:",l,d,M;return d=new B({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBHUFROZW9YTW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnRybC1pbnRlcm5hbC10ZXN0aW5nJTJGdGlueS1yYW5kb20tR1BUTmVvWEZvckNhdXNhbExNJTIyKSUwQW1vZGVsJTIwJTNEJTIwR1BUTmVvWE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJ0cmwtaW50ZXJuYWwtdGVzdGluZyUyRnRpbnktcmFuZG9tLUdQVE5lb1hGb3JDYXVzYWxMTSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GPTNeoXModel | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">"trl-internal-testing/tiny-random-GPTNeoXForCausalLM"</span>) | |
| <span class="hljs-meta">>>> </span>model = GPTNeoXModel.from_pretrained(<span class="hljs-string">"trl-internal-testing/tiny-random-GPTNeoXForCausalLM"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = tokenizer(<span class="hljs-string">"Hello, my dog is cute"</span>, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span>outputs = model(**inputs) | |
| <span class="hljs-meta">>>> </span>last_hidden_states = outputs.last_hidden_state`,wrap:!1}}),{c(){n=p("p"),n.textContent=b,l=a(),g(d.$$.fragment)},l(s){n=h(s,"P",{"data-svelte-h":!0}),y(n)!=="svelte-11lpom8"&&(n.textContent=b),l=r(s),m(d.$$.fragment,s)},m(s,w){i(s,n,w),i(s,l,w),u(d,s,w),M=!0},p:j,i(s){M||(f(d.$$.fragment,s),M=!0)},o(s){_(d.$$.fragment,s),M=!1},d(s){s&&(o(n),o(l)),T(d,s)}}}function Cs(k){let n,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){n=p("p"),n.innerHTML=b},l(l){n=h(l,"P",{"data-svelte-h":!0}),y(n)!=="svelte-fincs2"&&(n.innerHTML=b)},m(l,d){i(l,n,d)},p:j,d(l){l&&o(n)}}}function Fs(k){let n,b="Example:",l,d,M;return d=new B({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBHUFROZW9YRm9yQ2F1c2FsTE0lMkMlMjBHUFROZW9YQ29uZmlnJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJFbGV1dGhlckFJJTJGZ3B0LW5lb3gtMjBiJTIyKSUwQWNvbmZpZyUyMCUzRCUyMEdQVE5lb1hDb25maWcuZnJvbV9wcmV0cmFpbmVkKCUyMkVsZXV0aGVyQUklMkZncHQtbmVveC0yMGIlMjIpJTBBY29uZmlnLmlzX2RlY29kZXIlMjAlM0QlMjBUcnVlJTBBbW9kZWwlMjAlM0QlMjBHUFROZW9YRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMkVsZXV0aGVyQUklMkZncHQtbmVveC0yMGIlMjIlMkMlMjBjb25maWclM0Rjb25maWcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFwcmVkaWN0aW9uX2xvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GPTNeoXForCausalLM, GPTNeoXConfig | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">"EleutherAI/gpt-neox-20b"</span>) | |
| <span class="hljs-meta">>>> </span>config = GPTNeoXConfig.from_pretrained(<span class="hljs-string">"EleutherAI/gpt-neox-20b"</span>) | |
| <span class="hljs-meta">>>> </span>config.is_decoder = <span class="hljs-literal">True</span> | |
| <span class="hljs-meta">>>> </span>model = GPTNeoXForCausalLM.from_pretrained(<span class="hljs-string">"EleutherAI/gpt-neox-20b"</span>, config=config) | |
| <span class="hljs-meta">>>> </span>inputs = tokenizer(<span class="hljs-string">"Hello, my dog is cute"</span>, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span>outputs = model(**inputs) | |
| <span class="hljs-meta">>>> </span>prediction_logits = outputs.logits`,wrap:!1}}),{c(){n=p("p"),n.textContent=b,l=a(),g(d.$$.fragment)},l(s){n=h(s,"P",{"data-svelte-h":!0}),y(n)!=="svelte-11lpom8"&&(n.textContent=b),l=r(s),m(d.$$.fragment,s)},m(s,w){i(s,n,w),i(s,l,w),u(d,s,w),M=!0},p:j,i(s){M||(f(d.$$.fragment,s),M=!0)},o(s){_(d.$$.fragment,s),M=!1},d(s){s&&(o(n),o(l)),T(d,s)}}}function Js(k){let n,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){n=p("p"),n.innerHTML=b},l(l){n=h(l,"P",{"data-svelte-h":!0}),y(n)!=="svelte-fincs2"&&(n.innerHTML=b)},m(l,d){i(l,n,d)},p:j,d(l){l&&o(n)}}}function Ps(k){let n,b=`This example uses a random model as the real ones are all very big. To get proper results, you should use | |
| EleutherAI/gpt-neox-20b instead of trl-internal-testing/tiny-random-GPTNeoXForCausalLM. If you get out-of-memory when loading that checkpoint, you can try | |
| adding <code>device_map="auto"</code> in the <code>from_pretrained</code> call.`;return{c(){n=p("p"),n.innerHTML=b},l(l){n=h(l,"P",{"data-svelte-h":!0}),y(n)!=="svelte-1lgpfzy"&&(n.innerHTML=b)},m(l,d){i(l,n,d)},p:j,d(l){l&&o(n)}}}function Us(k){let n,b="Example:",l,d,M;return d=new B({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBHUFROZW9YRm9yUXVlc3Rpb25BbnN3ZXJpbmclMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnRybC1pbnRlcm5hbC10ZXN0aW5nJTJGdGlueS1yYW5kb20tR1BUTmVvWEZvckNhdXNhbExNJTIyKSUwQW1vZGVsJTIwJTNEJTIwR1BUTmVvWEZvclF1ZXN0aW9uQW5zd2VyaW5nLmZyb21fcHJldHJhaW5lZCglMjJ0cmwtaW50ZXJuYWwtdGVzdGluZyUyRnRpbnktcmFuZG9tLUdQVE5lb1hGb3JDYXVzYWxMTSUyMiklMEElMEFxdWVzdGlvbiUyQyUyMHRleHQlMjAlM0QlMjAlMjJXaG8lMjB3YXMlMjBKaW0lMjBIZW5zb24lM0YlMjIlMkMlMjAlMjJKaW0lMjBIZW5zb24lMjB3YXMlMjBhJTIwbmljZSUyMHB1cHBldCUyMiUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihxdWVzdGlvbiUyQyUyMHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNEJTIwb3V0cHV0cy5zdGFydF9sb2dpdHMuYXJnbWF4KCklMEFhbnN3ZXJfZW5kX2luZGV4JTIwJTNEJTIwb3V0cHV0cy5lbmRfbG9naXRzLmFyZ21heCgpJTBBJTBBcHJlZGljdF9hbnN3ZXJfdG9rZW5zJTIwJTNEJTIwaW5wdXRzLmlucHV0X2lkcyU1QjAlMkMlMjBhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0ElMjBhbnN3ZXJfZW5kX2luZGV4JTIwJTJCJTIwMSU1RCUwQSUwQSUyMyUyMHRhcmdldCUyMGlzJTIwJTIybmljZSUyMHB1cHBldCUyMiUwQXRhcmdldF9zdGFydF9pbmRleCUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxNCU1RCklMEF0YXJnZXRfZW5kX2luZGV4JTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QjE1JTVEKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMHN0YXJ0X3Bvc2l0aW9ucyUzRHRhcmdldF9zdGFydF9pbmRleCUyQyUyMGVuZF9wb3NpdGlvbnMlM0R0YXJnZXRfZW5kX2luZGV4KSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3M=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GPTNeoXForQuestionAnswering | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">"trl-internal-testing/tiny-random-GPTNeoXForCausalLM"</span>) | |
| <span class="hljs-meta">>>> </span>model = GPTNeoXForQuestionAnswering.from_pretrained(<span class="hljs-string">"trl-internal-testing/tiny-random-GPTNeoXForCausalLM"</span>) | |
| <span class="hljs-meta">>>> </span>question, text = <span class="hljs-string">"Who was Jim Henson?"</span>, <span class="hljs-string">"Jim Henson was a nice puppet"</span> | |
| <span class="hljs-meta">>>> </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">with</span> torch.no_grad(): | |
| <span class="hljs-meta">... </span> outputs = model(**inputs) | |
| <span class="hljs-meta">>>> </span>answer_start_index = outputs.start_logits.argmax() | |
| <span class="hljs-meta">>>> </span>answer_end_index = outputs.end_logits.argmax() | |
| <span class="hljs-meta">>>> </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">>>> </span><span class="hljs-comment"># target is "nice puppet"</span> | |
| <span class="hljs-meta">>>> </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>]) | |
| <span class="hljs-meta">>>> </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>]) | |
| <span class="hljs-meta">>>> </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index) | |
| <span class="hljs-meta">>>> </span>loss = outputs.loss`,wrap:!1}}),{c(){n=p("p"),n.textContent=b,l=a(),g(d.$$.fragment)},l(s){n=h(s,"P",{"data-svelte-h":!0}),y(n)!=="svelte-11lpom8"&&(n.textContent=b),l=r(s),m(d.$$.fragment,s)},m(s,w){i(s,n,w),i(s,l,w),u(d,s,w),M=!0},p:j,i(s){M||(f(d.$$.fragment,s),M=!0)},o(s){_(d.$$.fragment,s),M=!1},d(s){s&&(o(n),o(l)),T(d,s)}}}function zs(k){let n,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){n=p("p"),n.innerHTML=b},l(l){n=h(l,"P",{"data-svelte-h":!0}),y(n)!=="svelte-fincs2"&&(n.innerHTML=b)},m(l,d){i(l,n,d)},p:j,d(l){l&&o(n)}}}function Ws(k){let n,b="Example of single-label classification:",l,d,M;return d=new B({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEdQVE5lb1hGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydHJsLWludGVybmFsLXRlc3RpbmclMkZ0aW55LXJhbmRvbS1HUFROZW9YRm9yQ2F1c2FsTE0lMjIpJTBBbW9kZWwlMjAlM0QlMjBHUFROZW9YRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydHJsLWludGVybmFsLXRlc3RpbmclMkZ0aW55LXJhbmRvbS1HUFROZW9YRm9yQ2F1c2FsTE0lMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwbG9naXRzLmFyZ21heCgpLml0ZW0oKSUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMEdQVE5lb1hGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ0cmwtaW50ZXJuYWwtdGVzdGluZyUyRnRpbnktcmFuZG9tLUdQVE5lb1hGb3JDYXVzYWxMTSUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GPTNeoXForSequenceClassification | |
| <span class="hljs-meta">>>> </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">"trl-internal-testing/tiny-random-GPTNeoXForCausalLM"</span>) | |
| <span class="hljs-meta">>>> </span>model = GPTNeoXForSequenceClassification.from_pretrained(<span class="hljs-string">"trl-internal-testing/tiny-random-GPTNeoXForCausalLM"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = tokenizer(<span class="hljs-string">"Hello, my dog is cute"</span>, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">with</span> torch.no_grad(): | |
| <span class="hljs-meta">... </span> logits = model(**inputs).logits | |
| <span class="hljs-meta">>>> </span>predicted_class_id = logits.argmax().item() | |
| <span class="hljs-meta">>>> </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">>>> </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label) | |
| <span class="hljs-meta">>>> </span>model = GPTNeoXForSequenceClassification.from_pretrained(<span class="hljs-string">"trl-internal-testing/tiny-random-GPTNeoXForCausalLM"</span>, num_labels=num_labels) | |
| <span class="hljs-meta">>>> </span>labels = torch.tensor([<span class="hljs-number">1</span>]) | |
| <span class="hljs-meta">>>> </span>loss = model(**inputs, labels=labels).loss`,wrap:!1}}),{c(){n=p("p"),n.textContent=b,l=a(),g(d.$$.fragment)},l(s){n=h(s,"P",{"data-svelte-h":!0}),y(n)!=="svelte-ykxpe4"&&(n.textContent=b),l=r(s),m(d.$$.fragment,s)},m(s,w){i(s,n,w),i(s,l,w),u(d,s,w),M=!0},p:j,i(s){M||(f(d.$$.fragment,s),M=!0)},o(s){_(d.$$.fragment,s),M=!1},d(s){s&&(o(n),o(l)),T(d,s)}}}function Zs(k){let n,b="Example of multi-label classification:",l,d,M;return d=new B({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEdQVE5lb1hGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydHJsLWludGVybmFsLXRlc3RpbmclMkZ0aW55LXJhbmRvbS1HUFROZW9YRm9yQ2F1c2FsTE0lMjIpJTBBbW9kZWwlMjAlM0QlMjBHUFROZW9YRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydHJsLWludGVybmFsLXRlc3RpbmclMkZ0aW55LXJhbmRvbS1HUFROZW9YRm9yQ2F1c2FsTE0lMjIlMkMlMjBwcm9ibGVtX3R5cGUlM0QlMjJtdWx0aV9sYWJlbF9jbGFzc2lmaWNhdGlvbiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJhbmdlKDAlMkMlMjBsb2dpdHMuc2hhcGUlNUItMSU1RCklNUJ0b3JjaC5zaWdtb2lkKGxvZ2l0cykuc3F1ZWV6ZShkaW0lM0QwKSUyMCUzRSUyMDAuNSU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMEdQVE5lb1hGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJ0cmwtaW50ZXJuYWwtdGVzdGluZyUyRnRpbnktcmFuZG9tLUdQVE5lb1hGb3JDYXVzYWxMTSUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GPTNeoXForSequenceClassification | |
| <span class="hljs-meta">>>> </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">"trl-internal-testing/tiny-random-GPTNeoXForCausalLM"</span>) | |
| <span class="hljs-meta">>>> </span>model = GPTNeoXForSequenceClassification.from_pretrained(<span class="hljs-string">"trl-internal-testing/tiny-random-GPTNeoXForCausalLM"</span>, problem_type=<span class="hljs-string">"multi_label_classification"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = tokenizer(<span class="hljs-string">"Hello, my dog is cute"</span>, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">with</span> torch.no_grad(): | |
| <span class="hljs-meta">... </span> logits = model(**inputs).logits | |
| <span class="hljs-meta">>>> </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>) > <span class="hljs-number">0.5</span>] | |
| <span class="hljs-meta">>>> </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">>>> </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label) | |
| <span class="hljs-meta">>>> </span>model = GPTNeoXForSequenceClassification.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"trl-internal-testing/tiny-random-GPTNeoXForCausalLM"</span>, num_labels=num_labels, problem_type=<span class="hljs-string">"multi_label_classification"</span> | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </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">>>> </span>loss = model(**inputs, labels=labels).loss`,wrap:!1}}),{c(){n=p("p"),n.textContent=b,l=a(),g(d.$$.fragment)},l(s){n=h(s,"P",{"data-svelte-h":!0}),y(n)!=="svelte-1l8e32d"&&(n.textContent=b),l=r(s),m(d.$$.fragment,s)},m(s,w){i(s,n,w),i(s,l,w),u(d,s,w),M=!0},p:j,i(s){M||(f(d.$$.fragment,s),M=!0)},o(s){_(d.$$.fragment,s),M=!1},d(s){s&&(o(n),o(l)),T(d,s)}}}function Is(k){let n,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){n=p("p"),n.innerHTML=b},l(l){n=h(l,"P",{"data-svelte-h":!0}),y(n)!=="svelte-fincs2"&&(n.innerHTML=b)},m(l,d){i(l,n,d)},p:j,d(l){l&&o(n)}}}function qs(k){let n,b="Example:",l,d,M;return d=new B({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBHUFROZW9YRm9yVG9rZW5DbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyTGFyc0pvbmFzc29uJTJGcHl0aGlhLTQxMG0tZGVkdXBlZC1zZnQtc3dlZGlzaCUyMiklMEFtb2RlbCUyMCUzRCUyMEdQVE5lb1hGb3JUb2tlbkNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJMYXJzSm9uYXNzb24lMkZweXRoaWEtNDEwbS1kZWR1cGVkLXNmdC1zd2VkaXNoJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlMjJIdWdnaW5nRmFjZSUyMGlzJTIwYSUyMGNvbXBhbnklMjBiYXNlZCUyMGluJTIwUGFyaXMlMjBhbmQlMjBOZXclMjBZb3JrJTIyJTJDJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNERmFsc2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTBBKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpJTBBJTBBJTIzJTIwTm90ZSUyMHRoYXQlMjB0b2tlbnMlMjBhcmUlMjBjbGFzc2lmaWVkJTIwcmF0aGVyJTIwdGhlbiUyMGlucHV0JTIwd29yZHMlMjB3aGljaCUyMG1lYW5zJTIwdGhhdCUwQSUyMyUyMHRoZXJlJTIwbWlnaHQlMjBiZSUyMG1vcmUlMjBwcmVkaWN0ZWQlMjB0b2tlbiUyMGNsYXNzZXMlMjB0aGFuJTIwd29yZHMuJTBBJTIzJTIwTXVsdGlwbGUlMjB0b2tlbiUyMGNsYXNzZXMlMjBtaWdodCUyMGFjY291bnQlMjBmb3IlMjB0aGUlMjBzYW1lJTIwd29yZCUwQXByZWRpY3RlZF90b2tlbnNfY2xhc3NlcyUyMCUzRCUyMCU1Qm1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnQuaXRlbSgpJTVEJTIwZm9yJTIwdCUyMGluJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyU1QjAlNUQlNUQlMEElMEFsYWJlbHMlMjAlM0QlMjBwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTBBbG9zcyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKS5sb3NzJTBBcm91bmQobG9zcy5pdGVtKCklMkMlMjAyKQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GPTNeoXForTokenClassification | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">"LarsJonasson/pythia-410m-deduped-sft-swedish"</span>) | |
| <span class="hljs-meta">>>> </span>model = GPTNeoXForTokenClassification.from_pretrained(<span class="hljs-string">"LarsJonasson/pythia-410m-deduped-sft-swedish"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = tokenizer( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"HuggingFace is a company based in Paris and New York"</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">"pt"</span> | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">with</span> torch.no_grad(): | |
| <span class="hljs-meta">... </span> logits = model(**inputs).logits | |
| <span class="hljs-meta">>>> </span>predicted_token_class_ids = logits.argmax(-<span class="hljs-number">1</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span> | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># there might be more predicted token classes than words.</span> | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Multiple token classes might account for the same word</span> | |
| <span class="hljs-meta">>>> </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">>>> </span>labels = predicted_token_class_ids | |
| <span class="hljs-meta">>>> </span>loss = model(**inputs, labels=labels).loss | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>) | |
| <span class="hljs-number">0.25</span>`,wrap:!1}}),{c(){n=p("p"),n.textContent=b,l=a(),g(d.$$.fragment)},l(s){n=h(s,"P",{"data-svelte-h":!0}),y(n)!=="svelte-11lpom8"&&(n.textContent=b),l=r(s),m(d.$$.fragment,s)},m(s,w){i(s,n,w),i(s,l,w),u(d,s,w),M=!0},p:j,i(s){M||(f(d.$$.fragment,s),M=!0)},o(s){_(d.$$.fragment,s),M=!1},d(s){s&&(o(n),o(l)),T(d,s)}}}function Bs(k){let n,b,l,d,M,s,w,Ht,ye,Co=`We introduce GPT-NeoX-20B, a 20 billion parameter autoregressive language model trained on the Pile, whose weights will | |
| be made freely and openly available to the public through a permissive license. It is, to the best of our knowledge, | |
| the largest dense autoregressive model that has publicly available weights at the time of submission. In this work, | |
| we describe GPT-NeoX-20B’s architecture and training and evaluate its performance on a range of language-understanding, | |
| mathematics, and knowledge-based tasks. We find that GPT-NeoX-20B is a particularly powerful few-shot reasoner and | |
| gains far more in performance when evaluated five-shot than similarly sized GPT-3 and FairSeq models. We open-source | |
| the training and evaluation code, as well as the model weights, at <a href="https://github.com/EleutherAI/gpt-neox" rel="nofollow">https://github.com/EleutherAI/gpt-neox</a>.`,Rt,Me,Fo=`Development of the model was led by Sid Black, Stella Biderman and Eric Hallahan, and the model was trained with | |
| generous the support of <a href="https://www.coreweave.com/" rel="nofollow">CoreWeave</a>.`,Et,we,Jo="GPT-NeoX-20B was trained with fp16, thus it is recommended to initialize the model as follows:",Qt,ke,St,ve,Po=`GPT-NeoX-20B also has a different tokenizer from the one used in GPT-J-6B and GPT-Neo. The new tokenizer allocates | |
| additional tokens to whitespace characters, making the model more suitable for certain tasks like code generation.`,At,$e,Yt,Ge,Uo="The <code>generate()</code> method can be used to generate text using GPT Neo model.",Ot,xe,Dt,Ne,Kt,Xe,zo="Flash Attention 2 is an faster, optimized version of the model.",en,je,tn,Ce,Wo='First, check whether your hardware is compatible with Flash Attention 2. The latest list of compatible hardware can be found in the <a href="https://github.com/Dao-AILab/flash-attention#installation-and-features" rel="nofollow">official documentation</a>. If your hardware is not compatible with Flash Attention 2, you can still benefit from attention kernel optimisations through Better Transformer support covered <a href="https://huggingface.co/docs/transformers/main/en/model_doc/bark#using-better-transformer" rel="nofollow">above</a>.',nn,Fe,Zo='Next, <a href="https://github.com/Dao-AILab/flash-attention#installation-and-features" rel="nofollow">install</a> the latest version of Flash Attention 2:',on,Je,sn,Pe,an,Ue,Io='To load a model using Flash Attention 2, we can pass the argument <code>attn_implementation="flash_attention_2"</code> to <a href="https://huggingface.co/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained" rel="nofollow"><code>.from_pretrained</code></a>. We’ll also load the model in half-precision (e.g. <code>torch.float16</code>), since it results in almost no degradation to audio quality but significantly lower memory usage and faster inference:',rn,ze,ln,We,dn,Ze,qo="Below is an expected speedup diagram that compares pure inference time between the native implementation in transformers using <code>stockmark/gpt-neox-japanese-1.4b</code> checkpoint and the Flash Attention 2 version of the model using a sequence length of 2048.",cn,K,Bo='<img src="https://huggingface.co/datasets/ybelkada/documentation-images/resolve/main/gpt-neox-1.8b-speedup.jpg"/>',pn,Ie,hn,qe,Vo=`PyTorch includes a native scaled dot-product attention (SDPA) operator as part of <code>torch.nn.functional</code>. This function | |
| encompasses several implementations that can be applied depending on the inputs and the hardware in use. See the | |
| <a href="https://pytorch.org/docs/stable/generated/torch.nn.functional.scaled_dot_product_attention.html" rel="nofollow">official documentation</a> | |
| or the <a href="https://huggingface.co/docs/transformers/main/en/perf_infer_gpu_one#pytorch-scaled-dot-product-attention" rel="nofollow">GPU Inference</a> | |
| page for more information.`,gn,Be,Lo=`SDPA is used by default for <code>torch>=2.1.1</code> when an implementation is available, but you may also set | |
| <code>attn_implementation="sdpa"</code> in <code>from_pretrained()</code> to explicitly request SDPA to be used.`,mn,Ve,un,Le,Ho="For the best speedups, we recommend loading the model in half-precision (e.g. <code>torch.float16</code> or <code>torch.bfloat16</code>).",fn,He,Ro=`On a local benchmark (rtx3080ti-16GB, PyTorch 2.2.1, OS Ubuntu 22.04) using <code>float16</code> with | |
| <a href="https://huggingface.co/EleutherAI/pythia-410m-deduped" rel="nofollow">pythia-410m-deduped</a>, we saw the | |
| following speedups during training and inference.`,_n,Re,Tn,Ee,Eo='<thead><tr><th align="right">Batch size</th> <th align="right">Seq len</th> <th align="right">Time per batch (Eager - s)</th> <th align="right">Time per batch (SDPA - s)</th> <th align="right">Speedup (%)</th> <th align="right">Eager peak mem (MB)</th> <th align="right">SDPA peak mem (MB)</th> <th align="right">Mem saving (%)</th></tr></thead> <tbody><tr><td align="right">1</td> <td align="right">128</td> <td align="right">0.024</td> <td align="right">0.019</td> <td align="right">28.945</td> <td align="right">1789.95</td> <td align="right">1789.95</td> <td align="right">0</td></tr> <tr><td align="right">1</td> <td align="right">256</td> <td align="right">0.039</td> <td align="right">0.031</td> <td align="right">23.18</td> <td align="right">1845.83</td> <td align="right">1844.84</td> <td align="right">0.053</td></tr> <tr><td align="right">1</td> <td align="right">512</td> <td align="right">0.08</td> <td align="right">0.055</td> <td align="right">45.524</td> <td align="right">2278.38</td> <td align="right">1953.76</td> <td align="right">16.615</td></tr> <tr><td align="right">1</td> <td align="right">1024</td> <td align="right">0.19</td> <td align="right">0.102</td> <td align="right">86.777</td> <td align="right">4772.36</td> <td align="right">2408.35</td> <td align="right">98.159</td></tr> <tr><td align="right">1</td> <td align="right">2048</td> <td align="right">0.565</td> <td align="right">0.204</td> <td align="right">177.098</td> <td align="right">13484.1</td> <td align="right">3882.01</td> <td align="right">247.348</td></tr> <tr><td align="right">2</td> <td align="right">128</td> <td align="right">0.037</td> <td align="right">0.032</td> <td align="right">15.121</td> <td align="right">1843.86</td> <td align="right">1844.78</td> <td align="right">-0.05</td></tr> <tr><td align="right">2</td> <td align="right">256</td> <td align="right">0.067</td> <td align="right">0.055</td> <td align="right">21.706</td> <td align="right">1999.72</td> <td align="right">1951.67</td> <td align="right">2.462</td></tr> <tr><td align="right">2</td> <td align="right">512</td> <td align="right">0.144</td> <td align="right">0.096</td> <td align="right">50.046</td> <td align="right">3613.16</td> <td align="right">2406.77</td> <td align="right">50.125</td></tr> <tr><td align="right">2</td> <td align="right">1024</td> <td align="right">0.366</td> <td align="right">0.193</td> <td align="right">89.666</td> <td align="right">8707.55</td> <td align="right">3878.86</td> <td align="right">124.487</td></tr> <tr><td align="right">2</td> <td align="right">2048</td> <td align="right">OOM</td> <td align="right">0.379</td> <td align="right">/</td> <td align="right">OOM</td> <td align="right">6825.13</td> <td align="right">SDPA does not OOM</td></tr> <tr><td align="right">4</td> <td align="right">128</td> <td align="right">0.06</td> <td align="right">0.054</td> <td align="right">11.539</td> <td align="right">1947.6</td> <td align="right">1952.06</td> <td align="right">-0.228</td></tr> <tr><td align="right">4</td> <td align="right">256</td> <td align="right">0.119</td> <td align="right">0.093</td> <td align="right">28.072</td> <td align="right">3008.39</td> <td align="right">2405.99</td> <td align="right">25.038</td></tr> <tr><td align="right">4</td> <td align="right">512</td> <td align="right">0.275</td> <td align="right">0.187</td> <td align="right">47.145</td> <td align="right">6290.58</td> <td align="right">3877.29</td> <td align="right">62.242</td></tr> <tr><td align="right">4</td> <td align="right">1024</td> <td align="right">OOM</td> <td align="right">0.36</td> <td align="right">/</td> <td align="right">OOM</td> <td align="right">6821.98</td> <td align="right">SDPA does not OOM</td></tr> <tr><td align="right">4</td> <td align="right">2048</td> <td align="right">OOM</td> <td align="right">0.731</td> <td align="right">/</td> <td align="right">OOM</td> <td align="right">12705.1</td> <td align="right">SDPA does not OOM</td></tr></tbody>',bn,Qe,yn,Se,Qo='<thead><tr><th align="right">Batch size</th> <th align="right">Seq len</th> <th align="right">Per token latency Eager (ms)</th> <th align="right">Per token latency SDPA (ms)</th> <th align="right">Speedup (%)</th> <th align="right">Mem Eager (MB)</th> <th align="right">Mem SDPA (MB)</th> <th align="right">Mem saved (%)</th></tr></thead> <tbody><tr><td align="right">1</td> <td align="right">128</td> <td align="right">6.569</td> <td align="right">5.858</td> <td align="right">12.14</td> <td align="right">974.831</td> <td align="right">974.826</td> <td align="right">0</td></tr> <tr><td align="right">1</td> <td align="right">256</td> <td align="right">7.009</td> <td align="right">5.863</td> <td align="right">19.542</td> <td align="right">1029.01</td> <td align="right">1028.08</td> <td align="right">0.09</td></tr> <tr><td align="right">1</td> <td align="right">512</td> <td align="right">7.157</td> <td align="right">5.965</td> <td align="right">19.983</td> <td align="right">1137.54</td> <td align="right">1137.52</td> <td align="right">0.001</td></tr> <tr><td align="right">1</td> <td align="right">1024</td> <td align="right">7.523</td> <td align="right">6.506</td> <td align="right">15.637</td> <td align="right">1329.3</td> <td align="right">1329.26</td> <td align="right">0.003</td></tr> <tr><td align="right">1</td> <td align="right">2048</td> <td align="right">9.271</td> <td align="right">9.205</td> <td align="right">0.713</td> <td align="right">1752.47</td> <td align="right">1734.51</td> <td align="right">1.036</td></tr> <tr><td align="right">2</td> <td align="right">128</td> <td align="right">7.239</td> <td align="right">5.959</td> <td align="right">21.493</td> <td align="right">1044.8</td> <td align="right">1028.37</td> <td align="right">1.597</td></tr> <tr><td align="right">2</td> <td align="right">256</td> <td align="right">7.228</td> <td align="right">6.036</td> <td align="right">19.757</td> <td align="right">1167.32</td> <td align="right">1137.73</td> <td align="right">2.601</td></tr> <tr><td align="right">2</td> <td align="right">512</td> <td align="right">7.538</td> <td align="right">6.693</td> <td align="right">12.628</td> <td align="right">1352.93</td> <td align="right">1329.55</td> <td align="right">1.758</td></tr> <tr><td align="right">2</td> <td align="right">1024</td> <td align="right">8.916</td> <td align="right">8.632</td> <td align="right">3.291</td> <td align="right">1752.56</td> <td align="right">1734.62</td> <td align="right">1.034</td></tr> <tr><td align="right">2</td> <td align="right">2048</td> <td align="right">12.628</td> <td align="right">12.606</td> <td align="right">0.181</td> <td align="right">2558.72</td> <td align="right">2545.8</td> <td align="right">0.508</td></tr> <tr><td align="right">4</td> <td align="right">128</td> <td align="right">7.278</td> <td align="right">6.046</td> <td align="right">20.373</td> <td align="right">1168.41</td> <td align="right">1137.79</td> <td align="right">2.691</td></tr> <tr><td align="right">4</td> <td align="right">256</td> <td align="right">7.614</td> <td align="right">6.588</td> <td align="right">15.574</td> <td align="right">1353.1</td> <td align="right">1329.79</td> <td align="right">1.753</td></tr> <tr><td align="right">4</td> <td align="right">512</td> <td align="right">8.798</td> <td align="right">8.144</td> <td align="right">8.028</td> <td align="right">1752.76</td> <td align="right">1734.85</td> <td align="right">1.032</td></tr> <tr><td align="right">4</td> <td align="right">1024</td> <td align="right">11.765</td> <td align="right">11.303</td> <td align="right">4.09</td> <td align="right">2558.96</td> <td align="right">2546.04</td> <td align="right">0.508</td></tr> <tr><td align="right">4</td> <td align="right">2048</td> <td align="right">19.568</td> <td align="right">17.735</td> <td align="right">10.33</td> <td align="right">4175.5</td> <td align="right">4165.26</td> <td align="right">0.246</td></tr></tbody>',Mn,Ae,wn,Ye,So='<li><a href="../tasks/language_modeling">Causal language modeling task guide</a></li>',kn,Oe,vn,z,De,qn,wt,Ao=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXModel">GPTNeoXModel</a>. It is used to instantiate an | |
| GPTNeoX model according to the specified arguments, defining the model architecture. Instantiating a configuration | |
| with the defaults will yield a similar configuration to that of the GPTNeoX | |
| <a href="https://huggingface.co/EleutherAI/gpt-neox-20b" rel="nofollow">EleutherAI/gpt-neox-20b</a> architecture.`,Bn,kt,Yo=`Configuration objects inherit from <a href="/docs/transformers/pr_35939/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the | |
| documentation from <a href="/docs/transformers/pr_35939/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Vn,ee,$n,Ke,Gn,v,et,Ln,vt,Oo=`Construct a “fast” GPT-NeoX-20B tokenizer (backed by HuggingFace’s <em>tokenizers</em> library). Based on byte-level | |
| Byte-Pair-Encoding.`,Hn,$t,Do="This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will",Rn,te,En,Gt,Ko=`You can get around that behavior by passing <code>add_prefix_space=True</code> when instantiating this tokenizer, but since | |
| the model was not pretrained this way, it might yield a decrease in performance.`,Qn,ne,Sn,xt,es=`This tokenizer inherits from <a href="/docs/transformers/pr_35939/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a> which contains most of the main methods. Users should | |
| refer to this superclass for more information regarding those methods.`,An,oe,tt,Yn,Nt,ts=`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding | |
| special tokens using the tokenizer <code>prepare_for_model</code> method.`,On,se,nt,Dn,Xt,ns="Updates the underlying post processor with the current <code>bos_token</code> and <code>eos_token</code>.",xn,ot,Nn,H,st,Kn,jt,os=`The bare GPTNeoX Model transformer outputting raw hidden-states without any specific head on top. | |
| This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> sub-class. Use | |
| it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and | |
| behavior.`,eo,F,at,to,Ct,ss='The <a href="/docs/transformers/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXModel">GPTNeoXModel</a> forward method, overrides the <code>__call__</code> special method.',no,ae,oo,re,so,ie,Xn,rt,jn,R,it,ao,Ft,as=`GPTNeoX Model with a <code>language modeling</code> head on top for CLM fine-tuning. | |
| This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> sub-class. Use | |
| it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and | |
| behavior.`,ro,V,lt,io,Jt,rs='The <a href="/docs/transformers/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXForCausalLM">GPTNeoXForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',lo,le,co,de,Cn,dt,Fn,W,ct,po,Pt,is=`The GPT-NeoX Model transformer with a span classification head on top for extractive question-answering tasks like | |
| SQuAD (a linear layer on top of the hidden-states output to compute <code>span start logits</code> and <code>span end logits</code>).`,ho,Ut,ls=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> sub-class. Use | |
| it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and | |
| behavior.`,go,J,pt,mo,zt,ds='The <a href="/docs/transformers/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXForQuestionAnswering">GPTNeoXForQuestionAnswering</a> forward method, overrides the <code>__call__</code> special method.',uo,ce,fo,pe,_o,he,Jn,ht,Pn,x,gt,To,Wt,cs="The GPTNeoX Model transformer with a sequence classification head on top (linear layer).",bo,Zt,ps=`<a href="/docs/transformers/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXForSequenceClassification">GPTNeoXForSequenceClassification</a> uses the last token in order to do the classification, as other causal models | |
| (e.g. GPT-1) do.`,yo,It,hs=`Since it does classification on the last token, it requires to know the position of the last token. If a | |
| <code>pad_token_id</code> is defined in the configuration, it finds the last token that is not a padding token in each row. If | |
| no <code>pad_token_id</code> is defined, it simply takes the last value in each row of the batch. Since it cannot guess the | |
| padding tokens when <code>inputs_embeds</code> are passed instead of <code>input_ids</code>, it does the same (take the last value in | |
| each row of the batch).`,Mo,qt,gs=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> sub-class. Use | |
| it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and | |
| behavior.`,wo,P,mt,ko,Bt,ms='The <a href="/docs/transformers/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXForSequenceClassification">GPTNeoXForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',vo,ge,$o,me,Go,ue,Un,ut,zn,Y,ft,xo,L,_t,No,Vt,us='The <a href="/docs/transformers/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXForTokenClassification">GPTNeoXForTokenClassification</a> forward method, overrides the <code>__call__</code> special method.',Xo,fe,jo,_e,Wn,Tt,Zn,Lt,In;return M=new G({props:{title:"GPT-NeoX",local:"gpt-neox",headingTag:"h1"}}),w=new G({props:{title:"Overview",local:"overview",headingTag:"h2"}}),ke=new B({props:{code:"bW9kZWwlMjAlM0QlMjBHUFROZW9YRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMkVsZXV0aGVyQUklMkZncHQtbmVveC0yMGIlMjIpLmhhbGYoKS5jdWRhKCk=",highlighted:'model = GPTNeoXForCausalLM.from_pretrained(<span class="hljs-string">"EleutherAI/gpt-neox-20b"</span>).half().cuda()',wrap:!1}}),$e=new G({props:{title:"Usage example",local:"usage-example",headingTag:"h2"}}),xe=new B({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdQVE5lb1hGb3JDYXVzYWxMTSUyQyUyMEdQVE5lb1hUb2tlbml6ZXJGYXN0JTBBJTBBbW9kZWwlMjAlM0QlMjBHUFROZW9YRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMkVsZXV0aGVyQUklMkZncHQtbmVveC0yMGIlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwR1BUTmVvWFRva2VuaXplckZhc3QuZnJvbV9wcmV0cmFpbmVkKCUyMkVsZXV0aGVyQUklMkZncHQtbmVveC0yMGIlMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyR1BUTmVvWDIwQiUyMGlzJTIwYSUyMDIwQi1wYXJhbWV0ZXIlMjBhdXRvcmVncmVzc2l2ZSUyMFRyYW5zZm9ybWVyJTIwbW9kZWwlMjBkZXZlbG9wZWQlMjBieSUyMEVsZXV0aGVyQUkuJTIyJTBBJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKHByb21wdCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLmlucHV0X2lkcyUwQSUwQWdlbl90b2tlbnMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSglMEElMjAlMjAlMjAlMjBpbnB1dF9pZHMlMkMlMEElMjAlMjAlMjAlMjBkb19zYW1wbGUlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwdGVtcGVyYXR1cmUlM0QwLjklMkMlMEElMjAlMjAlMjAlMjBtYXhfbGVuZ3RoJTNEMTAwJTJDJTBBKSUwQWdlbl90ZXh0JTIwJTNEJTIwdG9rZW5pemVyLmJhdGNoX2RlY29kZShnZW5fdG9rZW5zKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPTNeoXForCausalLM, GPTNeoXTokenizerFast | |
| <span class="hljs-meta">>>> </span>model = GPTNeoXForCausalLM.from_pretrained(<span class="hljs-string">"EleutherAI/gpt-neox-20b"</span>) | |
| <span class="hljs-meta">>>> </span>tokenizer = GPTNeoXTokenizerFast.from_pretrained(<span class="hljs-string">"EleutherAI/gpt-neox-20b"</span>) | |
| <span class="hljs-meta">>>> </span>prompt = <span class="hljs-string">"GPTNeoX20B is a 20B-parameter autoregressive Transformer model developed by EleutherAI."</span> | |
| <span class="hljs-meta">>>> </span>input_ids = tokenizer(prompt, return_tensors=<span class="hljs-string">"pt"</span>).input_ids | |
| <span class="hljs-meta">>>> </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">>>> </span>gen_text = tokenizer.batch_decode(gen_tokens)[<span class="hljs-number">0</span>]`,wrap:!1}}),Ne=new G({props:{title:"Using Flash Attention 2",local:"using-flash-attention-2",headingTag:"h2"}}),je=new G({props:{title:"Installation",local:"installation",headingTag:"h3"}}),Je=new B({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1VJTIwZmxhc2gtYXR0biUyMC0tbm8tYnVpbGQtaXNvbGF0aW9u",highlighted:"pip install -U flash-attn --no-build-isolation",wrap:!1}}),Pe=new G({props:{title:"Usage",local:"usage",headingTag:"h3"}}),ze=new B({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdQVE5lb1hGb3JDYXVzYWxMTSUyQyUyMEdQVE5lb1hUb2tlbml6ZXJGYXN0JTBB",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPTNeoXForCausalLM, GPTNeoXTokenizerFast | |
| model = GPTNeoXForCausalLM.from_pretrained(<span class="hljs-string">"EleutherAI/gpt-neox-20b"</span>, torch_dtype=torch.float16, attn_implementation=<span class="hljs-string">"flash_attention_2"</span>).to(device) | |
| ...`,wrap:!1}}),We=new G({props:{title:"Expected speedups",local:"expected-speedups",headingTag:"h3"}}),Ie=new G({props:{title:"Using Scaled Dot Product Attention (SDPA)",local:"using-scaled-dot-product-attention-sdpa",headingTag:"h2"}}),Ve=new B({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdQVE5lb1hGb3JDYXVzYWxMTSUwQW1vZGVsJTIwJTNEJTIwR1BUTmVvWEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJFbGV1dGhlckFJJTJGZ3B0LW5lb3gtMjBiJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwYXR0bl9pbXBsZW1lbnRhdGlvbiUzRCUyMnNkcGElMjIpJTBBLi4u",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPTNeoXForCausalLM | |
| model = GPTNeoXForCausalLM.from_pretrained(<span class="hljs-string">"EleutherAI/gpt-neox-20b"</span>, torch_dtype=torch.float16, attn_implementation=<span class="hljs-string">"sdpa"</span>) | |
| ...`,wrap:!1}}),Re=new G({props:{title:"Training",local:"training",headingTag:"h3"}}),Qe=new G({props:{title:"Inference",local:"inference",headingTag:"h3"}}),Ae=new G({props:{title:"Resources",local:"resources",headingTag:"h2"}}),Oe=new G({props:{title:"GPTNeoXConfig",local:"transformers.GPTNeoXConfig",headingTag:"h2"}}),De=new U({props:{name:"class transformers.GPTNeoXConfig",anchor:"transformers.GPTNeoXConfig",parameters:[{name:"vocab_size",val:" = 50432"},{name:"hidden_size",val:" = 6144"},{name:"num_hidden_layers",val:" = 44"},{name:"num_attention_heads",val:" = 64"},{name:"intermediate_size",val:" = 24576"},{name:"hidden_act",val:" = 'gelu'"},{name:"rotary_pct",val:" = 0.25"},{name:"rotary_emb_base",val:" = 10000"},{name:"attention_dropout",val:" = 0.0"},{name:"hidden_dropout",val:" = 0.0"},{name:"classifier_dropout",val:" = 0.1"},{name:"max_position_embeddings",val:" = 2048"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"use_cache",val:" = True"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"tie_word_embeddings",val:" = False"},{name:"use_parallel_residual",val:" = True"},{name:"rope_scaling",val:" = None"},{name:"attention_bias",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50432) — | |
| Vocabulary size of the GPTNeoX model. Defines the number of different tokens that can be represented by the | |
| <code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXModel">GPTNeoXModel</a>.`,name:"vocab_size"},{anchor:"transformers.GPTNeoXConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 6144) — | |
| Dimension of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.GPTNeoXConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 44) — | |
| Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.GPTNeoXConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 64) — | |
| Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.GPTNeoXConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 24576) — | |
| Dimension of the “intermediate” (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.GPTNeoXConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>"gelu"</code>) — | |
| The non-linear activation function (function or string) in the encoder and pooler. If string, <code>"gelu"</code>, | |
| <code>"relu"</code>, <code>"selu"</code> and <code>"gelu_new"</code> are supported.`,name:"hidden_act"},{anchor:"transformers.GPTNeoXConfig.rotary_pct",description:`<strong>rotary_pct</strong> (<code>float</code>, <em>optional</em>, defaults to 0.25) — | |
| percentage of hidden dimensions to allocate to rotary embeddings`,name:"rotary_pct"},{anchor:"transformers.GPTNeoXConfig.rotary_emb_base",description:`<strong>rotary_emb_base</strong> (<code>int</code>, <em>optional</em>, defaults to 10000) — | |
| base for computing rotary embeddings frequency`,name:"rotary_emb_base"},{anchor:"transformers.GPTNeoXConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| The dropout ratio probability of the attention score.`,name:"attention_dropout"},{anchor:"transformers.GPTNeoXConfig.hidden_dropout",description:`<strong>hidden_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| The dropout ratio of (1) the word embeddings, (2) the post-attention hidden states, and (3) the post-mlp | |
| hidden states.`,name:"hidden_dropout"},{anchor:"transformers.GPTNeoXConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) — | |
| Argument used when doing token classification, used in the model <a href="/docs/transformers/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXForTokenClassification">GPTNeoXForTokenClassification</a>.</p> | |
| <p>The dropout ratio for the hidden layer.`,name:"classifier_dropout"},{anchor:"transformers.GPTNeoXConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) — | |
| The maximum sequence length that this model might ever be used with. Typically set this to something large | |
| just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.GPTNeoXConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) — | |
| The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.GPTNeoXConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) — | |
| The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.GPTNeoXConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not the model should return the last key/values attentions (not used by all models). Only | |
| relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.GPTNeoXConfig.use_parallel_residual",description:`<strong>use_parallel_residual</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to use a “parallel” formulation in each Transformer layer, which can provide a slight training | |
| speedup at large scales (e.g. 20B).`,name:"use_parallel_residual"},{anchor:"transformers.GPTNeoXConfig.rope_scaling",description:`<strong>rope_scaling</strong> (<code>Dict</code>, <em>optional</em>) — | |
| Dictionary containing the scaling configuration for the RoPE embeddings. NOTE: if you apply new rope type | |
| and you expect the model to work on longer <code>max_position_embeddings</code>, we recommend you to update this value | |
| accordingly. | |
| Expected contents: | |
| <code>rope_type</code> (<code>str</code>): | |
| The sub-variant of RoPE to use. Can be one of [‘default’, ‘linear’, ‘dynamic’, ‘yarn’, ‘longrope’, | |
| ‘llama3’], with ‘default’ being the original RoPE implementation. | |
| <code>factor</code> (<code>float</code>, <em>optional</em>): | |
| Used with all rope types except ‘default’. The scaling factor to apply to the RoPE embeddings. In | |
| most scaling types, a <code>factor</code> of x will enable the model to handle sequences of length x <em> | |
| original maximum pre-trained length. | |
| <code>original_max_position_embeddings</code> (<code>int</code>, </em>optional<em>): | |
| Used with ‘dynamic’, ‘longrope’ and ‘llama3’. The original max position embeddings used during | |
| pretraining. | |
| <code>attention_factor</code> (<code>float</code>, </em>optional<em>): | |
| Used with ‘yarn’ and ‘longrope’. The scaling factor to be applied on the attention | |
| computation. If unspecified, it defaults to value recommended by the implementation, using the | |
| <code>factor</code> field to infer the suggested value. | |
| <code>beta_fast</code> (<code>float</code>, </em>optional<em>): | |
| Only used with ‘yarn’. Parameter to set the boundary for extrapolation (only) in the linear | |
| ramp function. If unspecified, it defaults to 32. | |
| <code>beta_slow</code> (<code>float</code>, </em>optional<em>): | |
| Only used with ‘yarn’. Parameter to set the boundary for interpolation (only) in the linear | |
| ramp function. If unspecified, it defaults to 1. | |
| <code>short_factor</code> (<code>List[float]</code>, </em>optional<em>): | |
| Only used with ‘longrope’. The scaling factor to be applied to short contexts (< | |
| <code>original_max_position_embeddings</code>). Must be a list of numbers with the same length as the hidden | |
| size divided by the number of attention heads divided by 2 | |
| <code>long_factor</code> (<code>List[float]</code>, </em>optional<em>): | |
| Only used with ‘longrope’. The scaling factor to be applied to long contexts (< | |
| <code>original_max_position_embeddings</code>). Must be a list of numbers with the same length as the hidden | |
| size divided by the number of attention heads divided by 2 | |
| <code>low_freq_factor</code> (<code>float</code>, </em>optional<em>): | |
| Only used with ‘llama3’. Scaling factor applied to low frequency components of the RoPE | |
| <code>high_freq_factor</code> (<code>float</code>, </em>optional*): | |
| Only used with ‘llama3’. Scaling factor applied to high frequency components of the RoPE`,name:"rope_scaling"},{anchor:"transformers.GPTNeoXConfig.attention_bias",description:`<strong>attention_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to use a bias in the query, key, value and output projection layers during self-attention.`,name:"attention_bias"},{anchor:"transformers.GPTNeoXConfig.Example",description:"<strong>Example</strong> —",name:"Example"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/models/gpt_neox/configuration_gpt_neox.py#L25"}}),ee=new be({props:{anchor:"transformers.GPTNeoXConfig.example",$$slots:{default:[$s]},$$scope:{ctx:k}}}),Ke=new G({props:{title:"GPTNeoXTokenizerFast",local:"transformers.GPTNeoXTokenizerFast",headingTag:"h2"}}),et=new U({props:{name:"class transformers.GPTNeoXTokenizerFast",anchor:"transformers.GPTNeoXTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"merges_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"unk_token",val:" = '<|endoftext|>'"},{name:"bos_token",val:" = '<|endoftext|>'"},{name:"eos_token",val:" = '<|endoftext|>'"},{name:"pad_token",val:" = None"},{name:"add_bos_token",val:" = False"},{name:"add_eos_token",val:" = False"},{name:"add_prefix_space",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) — | |
| Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.GPTNeoXTokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) — | |
| Path to the merges file.`,name:"merges_file"},{anchor:"transformers.GPTNeoXTokenizerFast.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"replace"</code>) — | |
| Paradigm to follow when decoding bytes to UTF-8. See | |
| <a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.GPTNeoXTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code><|endoftext|></code>) — | |
| The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this | |
| token instead.`,name:"unk_token"},{anchor:"transformers.GPTNeoXTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code><|endoftext|></code>) — | |
| The beginning of sequence token.`,name:"bos_token"},{anchor:"transformers.GPTNeoXTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code><|endoftext|></code>) — | |
| The end of sequence token.`,name:"eos_token"},{anchor:"transformers.GPTNeoXTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>) — | |
| Token for padding a sequence.`,name:"pad_token"},{anchor:"transformers.GPTNeoXTokenizerFast.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to add an initial space to the input. This allows to treat the leading word just as any | |
| other word. (GPTNeoX tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"},{anchor:"transformers.GPTNeoXTokenizerFast.add_bos_token",description:`<strong>add_bos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to add a <code>bos_token</code> at the start of sequences.`,name:"add_bos_token"},{anchor:"transformers.GPTNeoXTokenizerFast.add_eos_token",description:`<strong>add_eos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to add an <code>eos_token</code> at the end of sequences.`,name:"add_eos_token"},{anchor:"transformers.GPTNeoXTokenizerFast.trim_offsets",description:`<strong>trim_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not the post-processing step should trim offsets to avoid including whitespaces.`,name:"trim_offsets"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/models/gpt_neox/tokenization_gpt_neox_fast.py#L30"}}),te=new be({props:{anchor:"transformers.GPTNeoXTokenizerFast.example",$$slots:{default:[Gs]},$$scope:{ctx:k}}}),ne=new Te({props:{$$slots:{default:[xs]},$$scope:{ctx:k}}}),tt=new U({props:{name:"get_special_tokens_mask",anchor:"transformers.GPTNeoXTokenizerFast.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.GPTNeoXTokenizerFast.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) — | |
| List of IDs.`,name:"token_ids_0"},{anchor:"transformers.GPTNeoXTokenizerFast.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) — | |
| Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.GPTNeoXTokenizerFast.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/models/gpt_neox/tokenization_gpt_neox_fast.py#L170",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[int]</code></p> | |
| `}}),nt=new U({props:{name:"update_post_processor",anchor:"transformers.GPTNeoXTokenizerFast.update_post_processor",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/models/gpt_neox/tokenization_gpt_neox_fast.py#L143"}}),ot=new G({props:{title:"GPTNeoXModel",local:"transformers.GPTNeoXModel",headingTag:"h2"}}),st=new U({props:{name:"class transformers.GPTNeoXModel",anchor:"transformers.GPTNeoXModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXConfig">~GPTNeoXConfig</a>) — 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/pr_35939/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/vr_35939/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L717"}}),at=new U({props:{name:"forward",anchor:"transformers.GPTNeoXModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Union[transformers.cache_utils.Cache, typing.Tuple[typing.Tuple[torch.FloatTensor]], NoneType] = 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"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.GPTNeoXModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) — | |
| Indices of input sequence tokens in the vocabulary.</p> | |
| <p>Indices can be obtained using <a href="/docs/transformers/pr_35939/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_35939/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and | |
| <a href="/docs/transformers/pr_35939/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p> | |
| <p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.GPTNeoXModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p> | |
| <ul> | |
| <li>1 for tokens that are <strong>not masked</strong>,</li> | |
| <li>0 for tokens that are <strong>masked</strong>.</li> | |
| </ul> | |
| <p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.GPTNeoXModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p> | |
| <p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTNeoXModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) — | |
| Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p> | |
| <ul> | |
| <li>1 indicates the head is <strong>not masked</strong>,</li> | |
| <li>0 indicates the head is <strong>masked</strong>.</li> | |
| </ul>`,name:"head_mask"},{anchor:"transformers.GPTNeoXModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) — | |
| Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This | |
| is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the | |
| model’s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.GPTNeoXModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) — | |
| Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention | |
| blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code> | |
| returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p> | |
| <p>Two formats are allowed:</p> | |
| <ul> | |
| <li>a <a href="/docs/transformers/pr_35939/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our | |
| <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li> | |
| <li>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>). This is also known as the legacy | |
| cache format.</li> | |
| </ul> | |
| <p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the | |
| legacy cache format will be returned.</p> | |
| <p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don’t | |
| have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code> | |
| of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.GPTNeoXModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned | |
| tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.GPTNeoXModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for | |
| more detail.`,name:"output_hidden_states"},{anchor:"transformers.GPTNeoXModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_35939/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GPTNeoXModel.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) — | |
| Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>, | |
| this tensor is not affected by padding. It is used to update the cache in the correct position and to infer | |
| the complete sequence length.`,name:"cache_position"},{anchor:"transformers.GPTNeoXModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) — | |
| If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see | |
| <code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L745",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_35939/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast" | |
| >transformers.modeling_outputs.BaseModelOutputWithPast</a> or a tuple of | |
| <code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various | |
| elements depending on the configuration (<a | |
| href="/docs/transformers/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXConfig" | |
| >GPTNeoXConfig</a>) and inputs.</p> | |
| <ul> | |
| <li> | |
| <p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_35939/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast" | |
| >transformers.modeling_outputs.BaseModelOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),ae=new Te({props:{$$slots:{default:[Ns]},$$scope:{ctx:k}}}),re=new Te({props:{warning:!0,$$slots:{default:[Xs]},$$scope:{ctx:k}}}),ie=new be({props:{anchor:"transformers.GPTNeoXModel.forward.example",$$slots:{default:[js]},$$scope:{ctx:k}}}),rt=new G({props:{title:"GPTNeoXForCausalLM",local:"transformers.GPTNeoXForCausalLM",headingTag:"h2"}}),it=new U({props:{name:"class transformers.GPTNeoXForCausalLM",anchor:"transformers.GPTNeoXForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXConfig">~GPTNeoXConfig</a>) — 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/pr_35939/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/vr_35939/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L1017"}}),lt=new U({props:{name:"forward",anchor:"transformers.GPTNeoXForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Union[transformers.cache_utils.Cache, typing.Tuple[typing.Tuple[torch.FloatTensor]], NoneType] = 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"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.GPTNeoXForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) — | |
| Indices of input sequence tokens in the vocabulary.</p> | |
| <p>Indices can be obtained using <a href="/docs/transformers/pr_35939/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_35939/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and | |
| <a href="/docs/transformers/pr_35939/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p> | |
| <p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.GPTNeoXForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p> | |
| <ul> | |
| <li>1 for tokens that are <strong>not masked</strong>,</li> | |
| <li>0 for tokens that are <strong>masked</strong>.</li> | |
| </ul> | |
| <p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.GPTNeoXForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p> | |
| <p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTNeoXForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) — | |
| Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p> | |
| <ul> | |
| <li>1 indicates the head is <strong>not masked</strong>,</li> | |
| <li>0 indicates the head is <strong>masked</strong>.</li> | |
| </ul>`,name:"head_mask"},{anchor:"transformers.GPTNeoXForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) — | |
| Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This | |
| is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the | |
| model’s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.GPTNeoXForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) — | |
| Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention | |
| blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code> | |
| returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p> | |
| <p>Two formats are allowed:</p> | |
| <ul> | |
| <li>a <a href="/docs/transformers/pr_35939/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our | |
| <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li> | |
| <li>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>). This is also known as the legacy | |
| cache format.</li> | |
| </ul> | |
| <p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the | |
| legacy cache format will be returned.</p> | |
| <p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don’t | |
| have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code> | |
| of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.GPTNeoXForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned | |
| tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.GPTNeoXForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for | |
| more detail.`,name:"output_hidden_states"},{anchor:"transformers.GPTNeoXForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_35939/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GPTNeoXForCausalLM.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) — | |
| Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>, | |
| this tensor is not affected by padding. It is used to update the cache in the correct position and to infer | |
| the complete sequence length.`,name:"cache_position"},{anchor:"transformers.GPTNeoXForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| Labels for computing the left-to-right language modeling loss (next word prediction). Indices should be in | |
| <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are | |
| ignored (masked), the loss is only computed for the tokens with labels n <code>[0, ..., config.vocab_size]</code>.`,name:"labels"},{anchor:"transformers.GPTNeoXForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) — | |
| If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see | |
| <code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L1038",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_35939/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast" | |
| >transformers.modeling_outputs.CausalLMOutputWithPast</a> or a tuple of | |
| <code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various | |
| elements depending on the configuration (<a | |
| href="/docs/transformers/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXConfig" | |
| >GPTNeoXConfig</a>) and inputs.</p> | |
| <ul> | |
| <li> | |
| <p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — 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>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p> | |
| </li> | |
| <li> | |
| <p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_35939/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast" | |
| >transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),le=new Te({props:{$$slots:{default:[Cs]},$$scope:{ctx:k}}}),de=new be({props:{anchor:"transformers.GPTNeoXForCausalLM.forward.example",$$slots:{default:[Fs]},$$scope:{ctx:k}}}),dt=new G({props:{title:"GPTNeoXForQuestionAnswering",local:"transformers.GPTNeoXForQuestionAnswering",headingTag:"h2"}}),ct=new U({props:{name:"class transformers.GPTNeoXForQuestionAnswering",anchor:"transformers.GPTNeoXForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXConfig">~GPTNeoXConfig</a>) — 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/pr_35939/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/vr_35939/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L1338"}}),pt=new U({props:{name:"forward",anchor:"transformers.GPTNeoXForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GPTNeoXForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) — | |
| Indices of input sequence tokens in the vocabulary.</p> | |
| <p>Indices can be obtained using <a href="/docs/transformers/pr_35939/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_35939/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and | |
| <a href="/docs/transformers/pr_35939/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.GPTNeoXForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p> | |
| <ul> | |
| <li>1 for tokens that are <strong>not masked</strong>,</li> | |
| <li>0 for tokens that are <strong>masked</strong>.</li> | |
| </ul> | |
| <p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.GPTNeoXForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p> | |
| <p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTNeoXForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) — | |
| Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p> | |
| <ul> | |
| <li>1 indicates the head is <strong>not masked</strong>,</li> | |
| <li>0 indicates the head is <strong>masked</strong>.</li> | |
| </ul>`,name:"head_mask"},{anchor:"transformers.GPTNeoXForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) — | |
| Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This | |
| is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the | |
| model’s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.GPTNeoXForQuestionAnswering.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) — | |
| Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention | |
| blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code> | |
| returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p> | |
| <p>Two formats are allowed:</p> | |
| <ul> | |
| <li>a <a href="/docs/transformers/pr_35939/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our | |
| <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li> | |
| <li>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>). This is also known as the legacy | |
| cache format.</li> | |
| </ul> | |
| <p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the | |
| legacy cache format will be returned.</p> | |
| <p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don’t | |
| have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code> | |
| of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.GPTNeoXForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned | |
| tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.GPTNeoXForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for | |
| more detail.`,name:"output_hidden_states"},{anchor:"transformers.GPTNeoXForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_35939/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GPTNeoXForQuestionAnswering.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) — | |
| Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>, | |
| this tensor is not affected by padding. It is used to update the cache in the correct position and to infer | |
| the complete sequence length.`,name:"cache_position"},{anchor:"transformers.GPTNeoXForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) — | |
| Labels for position (index) of the start of the labelled span for computing the token classification loss. | |
| Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence | |
| are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.GPTNeoXForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) — | |
| 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/vr_35939/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L1355",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_35939/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/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXConfig" | |
| >GPTNeoXConfig</a>) and inputs.</p> | |
| <ul> | |
| <li> | |
| <p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — 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>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_35939/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput" | |
| >transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),ce=new Te({props:{$$slots:{default:[Js]},$$scope:{ctx:k}}}),pe=new Te({props:{warning:!0,$$slots:{default:[Ps]},$$scope:{ctx:k}}}),he=new be({props:{anchor:"transformers.GPTNeoXForQuestionAnswering.forward.example",$$slots:{default:[Us]},$$scope:{ctx:k}}}),ht=new G({props:{title:"GPTNeoXForSequenceClassification",local:"transformers.GPTNeoXForSequenceClassification",headingTag:"h2"}}),gt=new U({props:{name:"class transformers.GPTNeoXForSequenceClassification",anchor:"transformers.GPTNeoXForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXConfig">~GPTNeoXConfig</a>) — 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/pr_35939/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/vr_35939/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L1133"}}),mt=new U({props:{name:"forward",anchor:"transformers.GPTNeoXForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Union[transformers.cache_utils.Cache, typing.Tuple[typing.Tuple[torch.FloatTensor]], NoneType] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GPTNeoXForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>) — | |
| Indices of input sequence tokens in the vocabulary.</p> | |
| <p>Indices can be obtained using <a href="/docs/transformers/pr_35939/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_35939/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and | |
| <a href="/docs/transformers/pr_35939/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.GPTNeoXForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>({0})</code>, <em>optional</em>) — | |
| Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p> | |
| <ul> | |
| <li>1 for tokens that are <strong>not masked</strong>,</li> | |
| <li>0 for tokens that are <strong>masked</strong>.</li> | |
| </ul> | |
| <p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.GPTNeoXForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>, <em>optional</em>) — | |
| Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p> | |
| <p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTNeoXForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) — | |
| Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p> | |
| <ul> | |
| <li>1 indicates the head is <strong>not masked</strong>,</li> | |
| <li>0 indicates the head is <strong>masked</strong>.</li> | |
| </ul>`,name:"head_mask"},{anchor:"transformers.GPTNeoXForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) — | |
| Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This | |
| is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the | |
| model’s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.GPTNeoXForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) — | |
| Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention | |
| blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code> | |
| returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p> | |
| <p>Two formats are allowed:</p> | |
| <ul> | |
| <li>a <a href="/docs/transformers/pr_35939/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our | |
| <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li> | |
| <li>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>). This is also known as the legacy | |
| cache format.</li> | |
| </ul> | |
| <p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the | |
| legacy cache format will be returned.</p> | |
| <p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don’t | |
| have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code> | |
| of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.GPTNeoXForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned | |
| tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.GPTNeoXForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for | |
| more detail.`,name:"output_hidden_states"},{anchor:"transformers.GPTNeoXForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_35939/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GPTNeoXForSequenceClassification.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) — | |
| Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>, | |
| this tensor is not affected by padding. It is used to update the cache in the correct position and to infer | |
| the complete sequence length.`,name:"cache_position"},{anchor:"transformers.GPTNeoXForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) — | |
| 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 > 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L1158",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <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/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXConfig" | |
| >GPTNeoXConfig</a>) and inputs.</p> | |
| <ul> | |
| <li> | |
| <p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — 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>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>transformers.modeling_outputs.SequenceClassifierOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),ge=new Te({props:{$$slots:{default:[zs]},$$scope:{ctx:k}}}),me=new be({props:{anchor:"transformers.GPTNeoXForSequenceClassification.forward.example",$$slots:{default:[Ws]},$$scope:{ctx:k}}}),ue=new be({props:{anchor:"transformers.GPTNeoXForSequenceClassification.forward.example-2",$$slots:{default:[Zs]},$$scope:{ctx:k}}}),ut=new G({props:{title:"GPTNeoXForTokenClassification",local:"transformers.GPTNeoXForTokenClassification",headingTag:"h2"}}),ft=new U({props:{name:"class transformers.GPTNeoXForTokenClassification",anchor:"transformers.GPTNeoXForTokenClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L1261"}}),_t=new U({props:{name:"forward",anchor:"transformers.GPTNeoXForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Union[transformers.cache_utils.Cache, typing.Tuple[typing.Tuple[torch.Tensor]], NoneType] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GPTNeoXForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>) — | |
| Indices of input sequence tokens in the vocabulary.</p> | |
| <p>Indices can be obtained using <a href="/docs/transformers/pr_35939/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_35939/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and | |
| <a href="/docs/transformers/pr_35939/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.GPTNeoXForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>({0})</code>, <em>optional</em>) — | |
| Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p> | |
| <ul> | |
| <li>1 for tokens that are <strong>not masked</strong>,</li> | |
| <li>0 for tokens that are <strong>masked</strong>.</li> | |
| </ul> | |
| <p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.GPTNeoXForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>, <em>optional</em>) — | |
| Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p> | |
| <p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GPTNeoXForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) — | |
| Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p> | |
| <ul> | |
| <li>1 indicates the head is <strong>not masked</strong>,</li> | |
| <li>0 indicates the head is <strong>masked</strong>.</li> | |
| </ul>`,name:"head_mask"},{anchor:"transformers.GPTNeoXForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) — | |
| Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This | |
| is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the | |
| model’s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.GPTNeoXForTokenClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) — | |
| Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention | |
| blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code> | |
| returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p> | |
| <p>Two formats are allowed:</p> | |
| <ul> | |
| <li>a <a href="/docs/transformers/pr_35939/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our | |
| <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li> | |
| <li>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>). This is also known as the legacy | |
| cache format.</li> | |
| </ul> | |
| <p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the | |
| legacy cache format will be returned.</p> | |
| <p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don’t | |
| have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code> | |
| of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.GPTNeoXForTokenClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned | |
| tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.GPTNeoXForTokenClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for | |
| more detail.`,name:"output_hidden_states"},{anchor:"transformers.GPTNeoXForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_35939/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GPTNeoXForTokenClassification.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) — | |
| Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>, | |
| this tensor is not affected by padding. It is used to update the cache in the correct position and to infer | |
| the complete sequence length.`,name:"cache_position"},{anchor:"transformers.GPTNeoXForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| 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 > 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_35939/src/transformers/models/gpt_neox/modeling_gpt_neox.py#L1273",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_35939/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/pr_35939/en/model_doc/gpt_neox#transformers.GPTNeoXConfig" | |
| >GPTNeoXConfig</a>) and inputs.</p> | |
| <ul> | |
| <li> | |
| <p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification loss.</p> | |
| </li> | |
| <li> | |
| <p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_35939/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput" | |
| >transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),fe=new Te({props:{$$slots:{default:[Is]},$$scope:{ctx:k}}}),_e=new be({props:{anchor:"transformers.GPTNeoXForTokenClassification.forward.example",$$slots:{default:[qs]},$$scope:{ctx:k}}}),Tt=new vs({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/gpt_neox.md"}}),{c(){n=p("meta"),b=a(),l=p("p"),d=a(),g(M.$$.fragment),s=a(),g(w.$$.fragment),Ht=a(),ye=p("p"),ye.innerHTML=Co,Rt=a(),Me=p("p"),Me.innerHTML=Fo,Et=a(),we=p("p"),we.textContent=Jo,Qt=a(),g(ke.$$.fragment),St=a(),ve=p("p"),ve.textContent=Po,At=a(),g($e.$$.fragment),Yt=a(),Ge=p("p"),Ge.innerHTML=Uo,Ot=a(),g(xe.$$.fragment),Dt=a(),g(Ne.$$.fragment),Kt=a(),Xe=p("p"),Xe.textContent=zo,en=a(),g(je.$$.fragment),tn=a(),Ce=p("p"),Ce.innerHTML=Wo,nn=a(),Fe=p("p"),Fe.innerHTML=Zo,on=a(),g(Je.$$.fragment),sn=a(),g(Pe.$$.fragment),an=a(),Ue=p("p"),Ue.innerHTML=Io,rn=a(),g(ze.$$.fragment),ln=a(),g(We.$$.fragment),dn=a(),Ze=p("p"),Ze.innerHTML=qo,cn=a(),K=p("div"),K.innerHTML=Bo,pn=a(),g(Ie.$$.fragment),hn=a(),qe=p("p"),qe.innerHTML=Vo,gn=a(),Be=p("p"),Be.innerHTML=Lo,mn=a(),g(Ve.$$.fragment),un=a(),Le=p("p"),Le.innerHTML=Ho,fn=a(),He=p("p"),He.innerHTML=Ro,_n=a(),g(Re.$$.fragment),Tn=a(),Ee=p("table"),Ee.innerHTML=Eo,bn=a(),g(Qe.$$.fragment),yn=a(),Se=p("table"),Se.innerHTML=Qo,Mn=a(),g(Ae.$$.fragment),wn=a(),Ye=p("ul"),Ye.innerHTML=So,kn=a(),g(Oe.$$.fragment),vn=a(),z=p("div"),g(De.$$.fragment),qn=a(),wt=p("p"),wt.innerHTML=Ao,Bn=a(),kt=p("p"),kt.innerHTML=Yo,Vn=a(),g(ee.$$.fragment),$n=a(),g(Ke.$$.fragment),Gn=a(),v=p("div"),g(et.$$.fragment),Ln=a(),vt=p("p"),vt.innerHTML=Oo,Hn=a(),$t=p("p"),$t.textContent=Do,Rn=a(),g(te.$$.fragment),En=a(),Gt=p("p"),Gt.innerHTML=Ko,Qn=a(),g(ne.$$.fragment),Sn=a(),xt=p("p"),xt.innerHTML=es,An=a(),oe=p("div"),g(tt.$$.fragment),Yn=a(),Nt=p("p"),Nt.innerHTML=ts,On=a(),se=p("div"),g(nt.$$.fragment),Dn=a(),Xt=p("p"),Xt.innerHTML=ns,xn=a(),g(ot.$$.fragment),Nn=a(),H=p("div"),g(st.$$.fragment),Kn=a(),jt=p("p"),jt.innerHTML=os,eo=a(),F=p("div"),g(at.$$.fragment),to=a(),Ct=p("p"),Ct.innerHTML=ss,no=a(),g(ae.$$.fragment),oo=a(),g(re.$$.fragment),so=a(),g(ie.$$.fragment),Xn=a(),g(rt.$$.fragment),jn=a(),R=p("div"),g(it.$$.fragment),ao=a(),Ft=p("p"),Ft.innerHTML=as,ro=a(),V=p("div"),g(lt.$$.fragment),io=a(),Jt=p("p"),Jt.innerHTML=rs,lo=a(),g(le.$$.fragment),co=a(),g(de.$$.fragment),Cn=a(),g(dt.$$.fragment),Fn=a(),W=p("div"),g(ct.$$.fragment),po=a(),Pt=p("p"),Pt.innerHTML=is,ho=a(),Ut=p("p"),Ut.innerHTML=ls,go=a(),J=p("div"),g(pt.$$.fragment),mo=a(),zt=p("p"),zt.innerHTML=ds,uo=a(),g(ce.$$.fragment),fo=a(),g(pe.$$.fragment),_o=a(),g(he.$$.fragment),Jn=a(),g(ht.$$.fragment),Pn=a(),x=p("div"),g(gt.$$.fragment),To=a(),Wt=p("p"),Wt.textContent=cs,bo=a(),Zt=p("p"),Zt.innerHTML=ps,yo=a(),It=p("p"),It.innerHTML=hs,Mo=a(),qt=p("p"),qt.innerHTML=gs,wo=a(),P=p("div"),g(mt.$$.fragment),ko=a(),Bt=p("p"),Bt.innerHTML=ms,vo=a(),g(ge.$$.fragment),$o=a(),g(me.$$.fragment),Go=a(),g(ue.$$.fragment),Un=a(),g(ut.$$.fragment),zn=a(),Y=p("div"),g(ft.$$.fragment),xo=a(),L=p("div"),g(_t.$$.fragment),No=a(),Vt=p("p"),Vt.innerHTML=us,Xo=a(),g(fe.$$.fragment),jo=a(),g(_e.$$.fragment),Wn=a(),g(Tt.$$.fragment),Zn=a(),Lt=p("p"),this.h()},l(e){const t=ws("svelte-u9bgzb",document.head);n=h(t,"META",{name:!0,content:!0}),t.forEach(o),b=r(e),l=h(e,"P",{}),N(l).forEach(o),d=r(e),m(M.$$.fragment,e),s=r(e),m(w.$$.fragment,e),Ht=r(e),ye=h(e,"P",{"data-svelte-h":!0}),y(ye)!=="svelte-utq0jy"&&(ye.innerHTML=Co),Rt=r(e),Me=h(e,"P",{"data-svelte-h":!0}),y(Me)!=="svelte-ar2m2l"&&(Me.innerHTML=Fo),Et=r(e),we=h(e,"P",{"data-svelte-h":!0}),y(we)!=="svelte-1fkanz5"&&(we.textContent=Jo),Qt=r(e),m(ke.$$.fragment,e),St=r(e),ve=h(e,"P",{"data-svelte-h":!0}),y(ve)!=="svelte-cswlyd"&&(ve.textContent=Po),At=r(e),m($e.$$.fragment,e),Yt=r(e),Ge=h(e,"P",{"data-svelte-h":!0}),y(Ge)!=="svelte-mhi95y"&&(Ge.innerHTML=Uo),Ot=r(e),m(xe.$$.fragment,e),Dt=r(e),m(Ne.$$.fragment,e),Kt=r(e),Xe=h(e,"P",{"data-svelte-h":!0}),y(Xe)!=="svelte-1r79v6g"&&(Xe.textContent=zo),en=r(e),m(je.$$.fragment,e),tn=r(e),Ce=h(e,"P",{"data-svelte-h":!0}),y(Ce)!=="svelte-ib5l43"&&(Ce.innerHTML=Wo),nn=r(e),Fe=h(e,"P",{"data-svelte-h":!0}),y(Fe)!=="svelte-1pp3dkd"&&(Fe.innerHTML=Zo),on=r(e),m(Je.$$.fragment,e),sn=r(e),m(Pe.$$.fragment,e),an=r(e),Ue=h(e,"P",{"data-svelte-h":!0}),y(Ue)!=="svelte-10jrnsm"&&(Ue.innerHTML=Io),rn=r(e),m(ze.$$.fragment,e),ln=r(e),m(We.$$.fragment,e),dn=r(e),Ze=h(e,"P",{"data-svelte-h":!0}),y(Ze)!=="svelte-1mm1lh6"&&(Ze.innerHTML=qo),cn=r(e),K=h(e,"DIV",{style:!0,"data-svelte-h":!0}),y(K)!=="svelte-1gyvfup"&&(K.innerHTML=Bo),pn=r(e),m(Ie.$$.fragment,e),hn=r(e),qe=h(e,"P",{"data-svelte-h":!0}),y(qe)!=="svelte-1cid2pe"&&(qe.innerHTML=Vo),gn=r(e),Be=h(e,"P",{"data-svelte-h":!0}),y(Be)!=="svelte-1x11lxg"&&(Be.innerHTML=Lo),mn=r(e),m(Ve.$$.fragment,e),un=r(e),Le=h(e,"P",{"data-svelte-h":!0}),y(Le)!=="svelte-djb2w0"&&(Le.innerHTML=Ho),fn=r(e),He=h(e,"P",{"data-svelte-h":!0}),y(He)!=="svelte-txr44"&&(He.innerHTML=Ro),_n=r(e),m(Re.$$.fragment,e),Tn=r(e),Ee=h(e,"TABLE",{"data-svelte-h":!0}),y(Ee)!=="svelte-f189pv"&&(Ee.innerHTML=Eo),bn=r(e),m(Qe.$$.fragment,e),yn=r(e),Se=h(e,"TABLE",{"data-svelte-h":!0}),y(Se)!=="svelte-tj67gt"&&(Se.innerHTML=Qo),Mn=r(e),m(Ae.$$.fragment,e),wn=r(e),Ye=h(e,"UL",{"data-svelte-h":!0}),y(Ye)!=="svelte-162aebv"&&(Ye.innerHTML=So),kn=r(e),m(Oe.$$.fragment,e),vn=r(e),z=h(e,"DIV",{class:!0});var E=N(z);m(De.$$.fragment,E),qn=r(E),wt=h(E,"P",{"data-svelte-h":!0}),y(wt)!=="svelte-1d0k4p8"&&(wt.innerHTML=Ao),Bn=r(E),kt=h(E,"P",{"data-svelte-h":!0}),y(kt)!=="svelte-2wj4fb"&&(kt.innerHTML=Yo),Vn=r(E),m(ee.$$.fragment,E),E.forEach(o),$n=r(e),m(Ke.$$.fragment,e),Gn=r(e),v=h(e,"DIV",{class:!0});var $=N(v);m(et.$$.fragment,$),Ln=r($),vt=h($,"P",{"data-svelte-h":!0}),y(vt)!=="svelte-1w4843d"&&(vt.innerHTML=Oo),Hn=r($),$t=h($,"P",{"data-svelte-h":!0}),y($t)!=="svelte-1s077p3"&&($t.textContent=Do),Rn=r($),m(te.$$.fragment,$),En=r($),Gt=h($,"P",{"data-svelte-h":!0}),y(Gt)!=="svelte-1afeqmz"&&(Gt.innerHTML=Ko),Qn=r($),m(ne.$$.fragment,$),Sn=r($),xt=h($,"P",{"data-svelte-h":!0}),y(xt)!=="svelte-1qh3sb5"&&(xt.innerHTML=es),An=r($),oe=h($,"DIV",{class:!0});var bt=N(oe);m(tt.$$.fragment,bt),Yn=r(bt),Nt=h(bt,"P",{"data-svelte-h":!0}),y(Nt)!=="svelte-1f4f5kp"&&(Nt.innerHTML=ts),bt.forEach(o),On=r($),se=h($,"DIV",{class:!0});var yt=N(se);m(nt.$$.fragment,yt),Dn=r(yt),Xt=h(yt,"P",{"data-svelte-h":!0}),y(Xt)!=="svelte-nfci2w"&&(Xt.innerHTML=ns),yt.forEach(o),$.forEach(o),xn=r(e),m(ot.$$.fragment,e),Nn=r(e),H=h(e,"DIV",{class:!0});var O=N(H);m(st.$$.fragment,O),Kn=r(O),jt=h(O,"P",{"data-svelte-h":!0}),y(jt)!=="svelte-qega57"&&(jt.innerHTML=os),eo=r(O),F=h(O,"DIV",{class:!0});var Z=N(F);m(at.$$.fragment,Z),to=r(Z),Ct=h(Z,"P",{"data-svelte-h":!0}),y(Ct)!=="svelte-abirrm"&&(Ct.innerHTML=ss),no=r(Z),m(ae.$$.fragment,Z),oo=r(Z),m(re.$$.fragment,Z),so=r(Z),m(ie.$$.fragment,Z),Z.forEach(o),O.forEach(o),Xn=r(e),m(rt.$$.fragment,e),jn=r(e),R=h(e,"DIV",{class:!0});var D=N(R);m(it.$$.fragment,D),ao=r(D),Ft=h(D,"P",{"data-svelte-h":!0}),y(Ft)!=="svelte-5dl4wd"&&(Ft.innerHTML=as),ro=r(D),V=h(D,"DIV",{class:!0});var Q=N(V);m(lt.$$.fragment,Q),io=r(Q),Jt=h(Q,"P",{"data-svelte-h":!0}),y(Jt)!=="svelte-1agpja2"&&(Jt.innerHTML=rs),lo=r(Q),m(le.$$.fragment,Q),co=r(Q),m(de.$$.fragment,Q),Q.forEach(o),D.forEach(o),Cn=r(e),m(dt.$$.fragment,e),Fn=r(e),W=h(e,"DIV",{class:!0});var S=N(W);m(ct.$$.fragment,S),po=r(S),Pt=h(S,"P",{"data-svelte-h":!0}),y(Pt)!=="svelte-1ednh70"&&(Pt.innerHTML=is),ho=r(S),Ut=h(S,"P",{"data-svelte-h":!0}),y(Ut)!=="svelte-68lg8f"&&(Ut.innerHTML=ls),go=r(S),J=h(S,"DIV",{class:!0});var I=N(J);m(pt.$$.fragment,I),mo=r(I),zt=h(I,"P",{"data-svelte-h":!0}),y(zt)!=="svelte-1p40hf2"&&(zt.innerHTML=ds),uo=r(I),m(ce.$$.fragment,I),fo=r(I),m(pe.$$.fragment,I),_o=r(I),m(he.$$.fragment,I),I.forEach(o),S.forEach(o),Jn=r(e),m(ht.$$.fragment,e),Pn=r(e),x=h(e,"DIV",{class:!0});var C=N(x);m(gt.$$.fragment,C),To=r(C),Wt=h(C,"P",{"data-svelte-h":!0}),y(Wt)!=="svelte-16cei4n"&&(Wt.textContent=cs),bo=r(C),Zt=h(C,"P",{"data-svelte-h":!0}),y(Zt)!=="svelte-7tvrek"&&(Zt.innerHTML=ps),yo=r(C),It=h(C,"P",{"data-svelte-h":!0}),y(It)!=="svelte-10ugs3m"&&(It.innerHTML=hs),Mo=r(C),qt=h(C,"P",{"data-svelte-h":!0}),y(qt)!=="svelte-68lg8f"&&(qt.innerHTML=gs),wo=r(C),P=h(C,"DIV",{class:!0});var q=N(P);m(mt.$$.fragment,q),ko=r(q),Bt=h(q,"P",{"data-svelte-h":!0}),y(Bt)!=="svelte-1ff2gr4"&&(Bt.innerHTML=ms),vo=r(q),m(ge.$$.fragment,q),$o=r(q),m(me.$$.fragment,q),Go=r(q),m(ue.$$.fragment,q),q.forEach(o),C.forEach(o),Un=r(e),m(ut.$$.fragment,e),zn=r(e),Y=h(e,"DIV",{class:!0});var Mt=N(Y);m(ft.$$.fragment,Mt),xo=r(Mt),L=h(Mt,"DIV",{class:!0});var A=N(L);m(_t.$$.fragment,A),No=r(A),Vt=h(A,"P",{"data-svelte-h":!0}),y(Vt)!=="svelte-1ehv3oi"&&(Vt.innerHTML=us),Xo=r(A),m(fe.$$.fragment,A),jo=r(A),m(_e.$$.fragment,A),A.forEach(o),Mt.forEach(o),Wn=r(e),m(Tt.$$.fragment,e),Zn=r(e),Lt=h(e,"P",{}),N(Lt).forEach(o),this.h()},h(){X(n,"name","hf:doc:metadata"),X(n,"content",Vs),ks(K,"text-align","center"),X(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),X(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),X(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),X(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),X(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),X(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),X(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),X(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),X(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),X(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),X(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),X(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),X(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),X(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){c(document.head,n),i(e,b,t),i(e,l,t),i(e,d,t),u(M,e,t),i(e,s,t),u(w,e,t),i(e,Ht,t),i(e,ye,t),i(e,Rt,t),i(e,Me,t),i(e,Et,t),i(e,we,t),i(e,Qt,t),u(ke,e,t),i(e,St,t),i(e,ve,t),i(e,At,t),u($e,e,t),i(e,Yt,t),i(e,Ge,t),i(e,Ot,t),u(xe,e,t),i(e,Dt,t),u(Ne,e,t),i(e,Kt,t),i(e,Xe,t),i(e,en,t),u(je,e,t),i(e,tn,t),i(e,Ce,t),i(e,nn,t),i(e,Fe,t),i(e,on,t),u(Je,e,t),i(e,sn,t),u(Pe,e,t),i(e,an,t),i(e,Ue,t),i(e,rn,t),u(ze,e,t),i(e,ln,t),u(We,e,t),i(e,dn,t),i(e,Ze,t),i(e,cn,t),i(e,K,t),i(e,pn,t),u(Ie,e,t),i(e,hn,t),i(e,qe,t),i(e,gn,t),i(e,Be,t),i(e,mn,t),u(Ve,e,t),i(e,un,t),i(e,Le,t),i(e,fn,t),i(e,He,t),i(e,_n,t),u(Re,e,t),i(e,Tn,t),i(e,Ee,t),i(e,bn,t),u(Qe,e,t),i(e,yn,t),i(e,Se,t),i(e,Mn,t),u(Ae,e,t),i(e,wn,t),i(e,Ye,t),i(e,kn,t),u(Oe,e,t),i(e,vn,t),i(e,z,t),u(De,z,null),c(z,qn),c(z,wt),c(z,Bn),c(z,kt),c(z,Vn),u(ee,z,null),i(e,$n,t),u(Ke,e,t),i(e,Gn,t),i(e,v,t),u(et,v,null),c(v,Ln),c(v,vt),c(v,Hn),c(v,$t),c(v,Rn),u(te,v,null),c(v,En),c(v,Gt),c(v,Qn),u(ne,v,null),c(v,Sn),c(v,xt),c(v,An),c(v,oe),u(tt,oe,null),c(oe,Yn),c(oe,Nt),c(v,On),c(v,se),u(nt,se,null),c(se,Dn),c(se,Xt),i(e,xn,t),u(ot,e,t),i(e,Nn,t),i(e,H,t),u(st,H,null),c(H,Kn),c(H,jt),c(H,eo),c(H,F),u(at,F,null),c(F,to),c(F,Ct),c(F,no),u(ae,F,null),c(F,oo),u(re,F,null),c(F,so),u(ie,F,null),i(e,Xn,t),u(rt,e,t),i(e,jn,t),i(e,R,t),u(it,R,null),c(R,ao),c(R,Ft),c(R,ro),c(R,V),u(lt,V,null),c(V,io),c(V,Jt),c(V,lo),u(le,V,null),c(V,co),u(de,V,null),i(e,Cn,t),u(dt,e,t),i(e,Fn,t),i(e,W,t),u(ct,W,null),c(W,po),c(W,Pt),c(W,ho),c(W,Ut),c(W,go),c(W,J),u(pt,J,null),c(J,mo),c(J,zt),c(J,uo),u(ce,J,null),c(J,fo),u(pe,J,null),c(J,_o),u(he,J,null),i(e,Jn,t),u(ht,e,t),i(e,Pn,t),i(e,x,t),u(gt,x,null),c(x,To),c(x,Wt),c(x,bo),c(x,Zt),c(x,yo),c(x,It),c(x,Mo),c(x,qt),c(x,wo),c(x,P),u(mt,P,null),c(P,ko),c(P,Bt),c(P,vo),u(ge,P,null),c(P,$o),u(me,P,null),c(P,Go),u(ue,P,null),i(e,Un,t),u(ut,e,t),i(e,zn,t),i(e,Y,t),u(ft,Y,null),c(Y,xo),c(Y,L),u(_t,L,null),c(L,No),c(L,Vt),c(L,Xo),u(fe,L,null),c(L,jo),u(_e,L,null),i(e,Wn,t),u(Tt,e,t),i(e,Zn,t),i(e,Lt,t),In=!0},p(e,[t]){const E={};t&2&&(E.$$scope={dirty:t,ctx:e}),ee.$set(E);const $={};t&2&&($.$$scope={dirty:t,ctx:e}),te.$set($);const bt={};t&2&&(bt.$$scope={dirty:t,ctx:e}),ne.$set(bt);const yt={};t&2&&(yt.$$scope={dirty:t,ctx:e}),ae.$set(yt);const O={};t&2&&(O.$$scope={dirty:t,ctx:e}),re.$set(O);const Z={};t&2&&(Z.$$scope={dirty:t,ctx:e}),ie.$set(Z);const D={};t&2&&(D.$$scope={dirty:t,ctx:e}),le.$set(D);const Q={};t&2&&(Q.$$scope={dirty:t,ctx:e}),de.$set(Q);const S={};t&2&&(S.$$scope={dirty:t,ctx:e}),ce.$set(S);const I={};t&2&&(I.$$scope={dirty:t,ctx:e}),pe.$set(I);const C={};t&2&&(C.$$scope={dirty:t,ctx:e}),he.$set(C);const q={};t&2&&(q.$$scope={dirty:t,ctx:e}),ge.$set(q);const Mt={};t&2&&(Mt.$$scope={dirty:t,ctx:e}),me.$set(Mt);const A={};t&2&&(A.$$scope={dirty:t,ctx:e}),ue.$set(A);const fs={};t&2&&(fs.$$scope={dirty:t,ctx:e}),fe.$set(fs);const _s={};t&2&&(_s.$$scope={dirty:t,ctx:e}),_e.$set(_s)},i(e){In||(f(M.$$.fragment,e),f(w.$$.fragment,e),f(ke.$$.fragment,e),f($e.$$.fragment,e),f(xe.$$.fragment,e),f(Ne.$$.fragment,e),f(je.$$.fragment,e),f(Je.$$.fragment,e),f(Pe.$$.fragment,e),f(ze.$$.fragment,e),f(We.$$.fragment,e),f(Ie.$$.fragment,e),f(Ve.$$.fragment,e),f(Re.$$.fragment,e),f(Qe.$$.fragment,e),f(Ae.$$.fragment,e),f(Oe.$$.fragment,e),f(De.$$.fragment,e),f(ee.$$.fragment,e),f(Ke.$$.fragment,e),f(et.$$.fragment,e),f(te.$$.fragment,e),f(ne.$$.fragment,e),f(tt.$$.fragment,e),f(nt.$$.fragment,e),f(ot.$$.fragment,e),f(st.$$.fragment,e),f(at.$$.fragment,e),f(ae.$$.fragment,e),f(re.$$.fragment,e),f(ie.$$.fragment,e),f(rt.$$.fragment,e),f(it.$$.fragment,e),f(lt.$$.fragment,e),f(le.$$.fragment,e),f(de.$$.fragment,e),f(dt.$$.fragment,e),f(ct.$$.fragment,e),f(pt.$$.fragment,e),f(ce.$$.fragment,e),f(pe.$$.fragment,e),f(he.$$.fragment,e),f(ht.$$.fragment,e),f(gt.$$.fragment,e),f(mt.$$.fragment,e),f(ge.$$.fragment,e),f(me.$$.fragment,e),f(ue.$$.fragment,e),f(ut.$$.fragment,e),f(ft.$$.fragment,e),f(_t.$$.fragment,e),f(fe.$$.fragment,e),f(_e.$$.fragment,e),f(Tt.$$.fragment,e),In=!0)},o(e){_(M.$$.fragment,e),_(w.$$.fragment,e),_(ke.$$.fragment,e),_($e.$$.fragment,e),_(xe.$$.fragment,e),_(Ne.$$.fragment,e),_(je.$$.fragment,e),_(Je.$$.fragment,e),_(Pe.$$.fragment,e),_(ze.$$.fragment,e),_(We.$$.fragment,e),_(Ie.$$.fragment,e),_(Ve.$$.fragment,e),_(Re.$$.fragment,e),_(Qe.$$.fragment,e),_(Ae.$$.fragment,e),_(Oe.$$.fragment,e),_(De.$$.fragment,e),_(ee.$$.fragment,e),_(Ke.$$.fragment,e),_(et.$$.fragment,e),_(te.$$.fragment,e),_(ne.$$.fragment,e),_(tt.$$.fragment,e),_(nt.$$.fragment,e),_(ot.$$.fragment,e),_(st.$$.fragment,e),_(at.$$.fragment,e),_(ae.$$.fragment,e),_(re.$$.fragment,e),_(ie.$$.fragment,e),_(rt.$$.fragment,e),_(it.$$.fragment,e),_(lt.$$.fragment,e),_(le.$$.fragment,e),_(de.$$.fragment,e),_(dt.$$.fragment,e),_(ct.$$.fragment,e),_(pt.$$.fragment,e),_(ce.$$.fragment,e),_(pe.$$.fragment,e),_(he.$$.fragment,e),_(ht.$$.fragment,e),_(gt.$$.fragment,e),_(mt.$$.fragment,e),_(ge.$$.fragment,e),_(me.$$.fragment,e),_(ue.$$.fragment,e),_(ut.$$.fragment,e),_(ft.$$.fragment,e),_(_t.$$.fragment,e),_(fe.$$.fragment,e),_(_e.$$.fragment,e),_(Tt.$$.fragment,e),In=!1},d(e){e&&(o(b),o(l),o(d),o(s),o(Ht),o(ye),o(Rt),o(Me),o(Et),o(we),o(Qt),o(St),o(ve),o(At),o(Yt),o(Ge),o(Ot),o(Dt),o(Kt),o(Xe),o(en),o(tn),o(Ce),o(nn),o(Fe),o(on),o(sn),o(an),o(Ue),o(rn),o(ln),o(dn),o(Ze),o(cn),o(K),o(pn),o(hn),o(qe),o(gn),o(Be),o(mn),o(un),o(Le),o(fn),o(He),o(_n),o(Tn),o(Ee),o(bn),o(yn),o(Se),o(Mn),o(wn),o(Ye),o(kn),o(vn),o(z),o($n),o(Gn),o(v),o(xn),o(Nn),o(H),o(Xn),o(jn),o(R),o(Cn),o(Fn),o(W),o(Jn),o(Pn),o(x),o(Un),o(zn),o(Y),o(Wn),o(Zn),o(Lt)),o(n),T(M,e),T(w,e),T(ke,e),T($e,e),T(xe,e),T(Ne,e),T(je,e),T(Je,e),T(Pe,e),T(ze,e),T(We,e),T(Ie,e),T(Ve,e),T(Re,e),T(Qe,e),T(Ae,e),T(Oe,e),T(De),T(ee),T(Ke,e),T(et),T(te),T(ne),T(tt),T(nt),T(ot,e),T(st),T(at),T(ae),T(re),T(ie),T(rt,e),T(it),T(lt),T(le),T(de),T(dt,e),T(ct),T(pt),T(ce),T(pe),T(he),T(ht,e),T(gt),T(mt),T(ge),T(me),T(ue),T(ut,e),T(ft),T(_t),T(fe),T(_e),T(Tt,e)}}}const Vs='{"title":"GPT-NeoX","local":"gpt-neox","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage example","local":"usage-example","sections":[],"depth":2},{"title":"Using Flash Attention 2","local":"using-flash-attention-2","sections":[{"title":"Installation","local":"installation","sections":[],"depth":3},{"title":"Usage","local":"usage","sections":[],"depth":3},{"title":"Expected speedups","local":"expected-speedups","sections":[],"depth":3}],"depth":2},{"title":"Using Scaled Dot Product Attention (SDPA)","local":"using-scaled-dot-product-attention-sdpa","sections":[{"title":"Training","local":"training","sections":[],"depth":3},{"title":"Inference","local":"inference","sections":[],"depth":3}],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"GPTNeoXConfig","local":"transformers.GPTNeoXConfig","sections":[],"depth":2},{"title":"GPTNeoXTokenizerFast","local":"transformers.GPTNeoXTokenizerFast","sections":[],"depth":2},{"title":"GPTNeoXModel","local":"transformers.GPTNeoXModel","sections":[],"depth":2},{"title":"GPTNeoXForCausalLM","local":"transformers.GPTNeoXForCausalLM","sections":[],"depth":2},{"title":"GPTNeoXForQuestionAnswering","local":"transformers.GPTNeoXForQuestionAnswering","sections":[],"depth":2},{"title":"GPTNeoXForSequenceClassification","local":"transformers.GPTNeoXForSequenceClassification","sections":[],"depth":2},{"title":"GPTNeoXForTokenClassification","local":"transformers.GPTNeoXForTokenClassification","sections":[],"depth":2}],"depth":1}';function Ls(k){return bs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Os extends ys{constructor(n){super(),Ms(this,n,Ls,Bs,Ts,{})}}export{Os as component}; | |
Xet Storage Details
- Size:
- 143 kB
- Xet hash:
- 96f29a80e3d95bc8ae44597571f76861f3f62f4447edfdea3d2b5eb2c47a5620
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.