import{s as Xo,o as qo,n as Q}from"../chunks/scheduler.18a86fab.js";import{S as Qo,i as So,g as d,s as a,r as u,A as Eo,h as c,f as n,c as r,j as Z,u as f,x as h,k as x,y as m,a as s,v as g,d as _,t as b,w as y}from"../chunks/index.98837b22.js";import{T as $t}from"../chunks/Tip.77304350.js";import{D as q}from"../chunks/Docstring.6758ea23.js";import{C as ie}from"../chunks/CodeBlock.8d0c2e8a.js";import{E as kt}from"../chunks/ExampleCodeBlock.0c42463f.js";import{H as $}from"../chunks/Heading.7e7e0c5b.js";import{E as Yo}from"../chunks/index.499f366c.js";function Ao(v){let o,T;return o=new ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME5lbW90cm9uTW9kZWwlMkMlMjBOZW1vdHJvbkNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBOZW1vdHJvbiUyMG5lbW90cm9uLTE1YiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBOZW1vdHJvbkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMG5lbW90cm9uLTE1YiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwTmVtb3Ryb25Nb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> NemotronModel, NemotronConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Nemotron nemotron-15b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = NemotronConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the nemotron-15b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NemotronModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){u(o.$$.fragment)},l(l){f(o.$$.fragment,l)},m(l,p){g(o,l,p),T=!0},p:Q,i(l){T||(_(o.$$.fragment,l),T=!0)},o(l){b(o.$$.fragment,l),T=!1},d(l){y(o,l)}}}function Po(v){let o,T=`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(){o=d("p"),o.innerHTML=T},l(l){o=c(l,"P",{"data-svelte-h":!0}),h(o)!=="svelte-fincs2"&&(o.innerHTML=T)},m(l,p){s(l,o,p)},p:Q,d(l){l&&n(o)}}}function Do(v){let o,T=`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(){o=d("p"),o.innerHTML=T},l(l){o=c(l,"P",{"data-svelte-h":!0}),h(o)!=="svelte-fincs2"&&(o.innerHTML=T)},m(l,p){s(l,o,p)},p:Q,d(l){l&&n(o)}}}function Oo(v){let o,T="Example:",l,p,M;return p=new ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBOZW1vdHJvbkZvckNhdXNhbExNJTBBJTBBbW9kZWwlMjAlM0QlMjBOZW1vdHJvbkZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZuZW1vdHJvbi0zLThiLWJhc2UtNGstaGYlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybnZpZGlhJTJGbmVtb3Ryb24tMy04Yi1iYXNlLTRrLWhmJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkhleSUyQyUyMGFyZSUyMHlvdSUyMGNvbnNjaW91cyUzRiUyMENhbiUyMHlvdSUyMHRhbGslMjB0byUyMG1lJTNGJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHByb21wdCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBJTIzJTIwR2VuZXJhdGUlMEFnZW5lcmF0ZV9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dHMuaW5wdXRfaWRzJTJDJTIwbWF4X2xlbmd0aCUzRDMwKSUwQXRva2VuaXplci5iYXRjaF9kZWNvZGUoZ2VuZXJhdGVfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUlMkMlMjBjbGVhbl91cF90b2tlbml6YXRpb25fc3BhY2VzJTNERmFsc2UpJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NemotronForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = NemotronForCausalLM.from_pretrained(<span class="hljs-string">&quot;nvidia/nemotron-3-8b-base-4k-hf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;nvidia/nemotron-3-8b-base-4k-hf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;Hey, are you conscious? Can you talk to me?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generate_ids = model.generate(inputs.input_ids, max_length=<span class="hljs-number">30</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;Hey, are you conscious? Can you talk to me?\\nI&#x27;m not conscious, but I can talk to you.&quot;</span>`,wrap:!1}}),{c(){o=d("p"),o.textContent=T,l=a(),u(p.$$.fragment)},l(i){o=c(i,"P",{"data-svelte-h":!0}),h(o)!=="svelte-11lpom8"&&(o.textContent=T),l=r(i),f(p.$$.fragment,i)},m(i,w){s(i,o,w),s(i,l,w),g(p,i,w),M=!0},p:Q,i(i){M||(_(p.$$.fragment,i),M=!0)},o(i){b(p.$$.fragment,i),M=!1},d(i){i&&(n(o),n(l)),y(p,i)}}}function Ko(v){let o,T=`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(){o=d("p"),o.innerHTML=T},l(l){o=c(l,"P",{"data-svelte-h":!0}),h(o)!=="svelte-fincs2"&&(o.innerHTML=T)},m(l,p){s(l,o,p)},p:Q,d(l){l&&n(o)}}}function es(v){let o,T="Example of single-label classification:",l,p,M;return p=new ie({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME5lbW90cm9uRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRm5lbW90cm9uLTMtOGItYmFzZS00ay1oZiUyMiklMEFtb2RlbCUyMCUzRCUyME5lbW90cm9uRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybnZpZGlhJTJGbmVtb3Ryb24tMy04Yi1iYXNlLTRrLWhmJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF9jbGFzc19pZCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoKS5pdGVtKCklMEFtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfY2xhc3NfaWQlNUQlMEElMEElMjMlMjBUbyUyMHRyYWluJTIwYSUyMG1vZGVsJTIwb24lMjAlNjBudW1fbGFiZWxzJTYwJTIwY2xhc3NlcyUyQyUyMHlvdSUyMGNhbiUyMHBhc3MlMjAlNjBudW1fbGFiZWxzJTNEbnVtX2xhYmVscyU2MCUyMHRvJTIwJTYwLmZyb21fcHJldHJhaW5lZCguLi4pJTYwJTBBbnVtX2xhYmVscyUyMCUzRCUyMGxlbihtb2RlbC5jb25maWcuaWQybGFiZWwpJTBBbW9kZWwlMjAlM0QlMjBOZW1vdHJvbkZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRm5lbW90cm9uLTMtOGItYmFzZS00ay1oZiUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcyUwQXJvdW5kKGxvc3MuaXRlbSgpJTJDJTIwMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NemotronForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;nvidia/nemotron-3-8b-base-4k-hf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NemotronForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;nvidia/nemotron-3-8b-base-4k-hf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NemotronForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;nvidia/nemotron-3-8b-base-4k-hf&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
...`,wrap:!1}}),{c(){o=d("p"),o.textContent=T,l=a(),u(p.$$.fragment)},l(i){o=c(i,"P",{"data-svelte-h":!0}),h(o)!=="svelte-ykxpe4"&&(o.textContent=T),l=r(i),f(p.$$.fragment,i)},m(i,w){s(i,o,w),s(i,l,w),g(p,i,w),M=!0},p:Q,i(i){M||(_(p.$$.fragment,i),M=!0)},o(i){b(p.$$.fragment,i),M=!1},d(i){i&&(n(o),n(l)),y(p,i)}}}function ts(v){let o,T="Example of multi-label classification:",l,p,M;return p=new ie({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME5lbW90cm9uRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRm5lbW90cm9uLTMtOGItYmFzZS00ay1oZiUyMiklMEFtb2RlbCUyMCUzRCUyME5lbW90cm9uRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybnZpZGlhJTJGbmVtb3Ryb24tMy04Yi1iYXNlLTRrLWhmJTIyJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkcyUyMCUzRCUyMHRvcmNoLmFyYW5nZSgwJTJDJTIwbG9naXRzLnNoYXBlJTVCLTElNUQpJTVCdG9yY2guc2lnbW9pZChsb2dpdHMpLnNxdWVlemUoZGltJTNEMCklMjAlM0UlMjAwLjUlNUQlMEElMEElMjMlMjBUbyUyMHRyYWluJTIwYSUyMG1vZGVsJTIwb24lMjAlNjBudW1fbGFiZWxzJTYwJTIwY2xhc3NlcyUyQyUyMHlvdSUyMGNhbiUyMHBhc3MlMjAlNjBudW1fbGFiZWxzJTNEbnVtX2xhYmVscyU2MCUyMHRvJTIwJTYwLmZyb21fcHJldHJhaW5lZCguLi4pJTYwJTBBbnVtX2xhYmVscyUyMCUzRCUyMGxlbihtb2RlbC5jb25maWcuaWQybGFiZWwpJTBBbW9kZWwlMjAlM0QlMjBOZW1vdHJvbkZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMm52aWRpYSUyRm5lbW90cm9uLTMtOGItYmFzZS00ay1oZiUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NemotronForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;nvidia/nemotron-3-8b-base-4k-hf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NemotronForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;nvidia/nemotron-3-8b-base-4k-hf&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NemotronForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;nvidia/nemotron-3-8b-base-4k-hf&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`,wrap:!1}}),{c(){o=d("p"),o.textContent=T,l=a(),u(p.$$.fragment)},l(i){o=c(i,"P",{"data-svelte-h":!0}),h(o)!=="svelte-1l8e32d"&&(o.textContent=T),l=r(i),f(p.$$.fragment,i)},m(i,w){s(i,o,w),s(i,l,w),g(p,i,w),M=!0},p:Q,i(i){M||(_(p.$$.fragment,i),M=!0)},o(i){b(p.$$.fragment,i),M=!1},d(i){i&&(n(o),n(l)),y(p,i)}}}function ns(v){let o,T=`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(){o=d("p"),o.innerHTML=T},l(l){o=c(l,"P",{"data-svelte-h":!0}),h(o)!=="svelte-fincs2"&&(o.innerHTML=T)},m(l,p){s(l,o,p)},p:Q,d(l){l&&n(o)}}}function os(v){let o,T="Example:",l,p,M;return p=new ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBOZW1vdHJvbkZvclF1ZXN0aW9uQW5zd2VyaW5nJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZuZW1vdHJvbi0zLThiLWJhc2UtNGstaGYlMjIpJTBBbW9kZWwlMjAlM0QlMjBOZW1vdHJvbkZvclF1ZXN0aW9uQW5zd2VyaW5nLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZuZW1vdHJvbi0zLThiLWJhc2UtNGstaGYlMjIpJTBBJTBBcXVlc3Rpb24lMkMlMjB0ZXh0JTIwJTNEJTIwJTIyV2hvJTIwd2FzJTIwSmltJTIwSGVuc29uJTNGJTIyJTJDJTIwJTIySmltJTIwSGVuc29uJTIwd2FzJTIwYSUyMG5pY2UlMjBwdXBwZXQlMjIlMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocXVlc3Rpb24lMkMlMjB0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWFuc3dlcl9zdGFydF9pbmRleCUyMCUzRCUyMG91dHB1dHMuc3RhcnRfbG9naXRzLmFyZ21heCgpJTBBYW5zd2VyX2VuZF9pbmRleCUyMCUzRCUyMG91dHB1dHMuZW5kX2xvZ2l0cy5hcmdtYXgoKSUwQSUwQXByZWRpY3RfYW5zd2VyX3Rva2VucyUyMCUzRCUyMGlucHV0cy5pbnB1dF9pZHMlNUIwJTJDJTIwYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNBJTIwYW5zd2VyX2VuZF9pbmRleCUyMCUyQiUyMDElNUQlMEF0b2tlbml6ZXIuZGVjb2RlKHByZWRpY3RfYW5zd2VyX3Rva2VucyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSUwQSUwQSUyMyUyMHRhcmdldCUyMGlzJTIwJTIybmljZSUyMHB1cHBldCUyMiUwQXRhcmdldF9zdGFydF9pbmRleCUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxNCU1RCklMEF0YXJnZXRfZW5kX2luZGV4JTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QjE1JTVEKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMHN0YXJ0X3Bvc2l0aW9ucyUzRHRhcmdldF9zdGFydF9pbmRleCUyQyUyMGVuZF9wb3NpdGlvbnMlM0R0YXJnZXRfZW5kX2luZGV4KSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMEFyb3VuZChsb3NzLml0ZW0oKSUyQyUyMDIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NemotronForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;nvidia/nemotron-3-8b-base-4k-hf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NemotronForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;nvidia/nemotron-3-8b-base-4k-hf&quot;</span>)

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predict_answer_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)
...

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
...`,wrap:!1}}),{c(){o=d("p"),o.textContent=T,l=a(),u(p.$$.fragment)},l(i){o=c(i,"P",{"data-svelte-h":!0}),h(o)!=="svelte-11lpom8"&&(o.textContent=T),l=r(i),f(p.$$.fragment,i)},m(i,w){s(i,o,w),s(i,l,w),g(p,i,w),M=!0},p:Q,i(i){M||(_(p.$$.fragment,i),M=!0)},o(i){b(p.$$.fragment,i),M=!1},d(i){i&&(n(o),n(l)),y(p,i)}}}function ss(v){let o,T=`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(){o=d("p"),o.innerHTML=T},l(l){o=c(l,"P",{"data-svelte-h":!0}),h(o)!=="svelte-fincs2"&&(o.innerHTML=T)},m(l,p){s(l,o,p)},p:Q,d(l){l&&n(o)}}}function as(v){let o,T="Example:",l,p,M;return p=new ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBOZW1vdHJvbkZvclRva2VuQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRm5lbW90cm9uLTMtOGItYmFzZS00ay1oZiUyMiklMEFtb2RlbCUyMCUzRCUyME5lbW90cm9uRm9yVG9rZW5DbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybnZpZGlhJTJGbmVtb3Ryb24tMy04Yi1iYXNlLTRrLWhmJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlMjJIdWdnaW5nRmFjZSUyMGlzJTIwYSUyMGNvbXBhbnklMjBiYXNlZCUyMGluJTIwUGFyaXMlMjBhbmQlMjBOZXclMjBZb3JrJTIyJTJDJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNERmFsc2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTBBKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpJTBBJTBBJTIzJTIwTm90ZSUyMHRoYXQlMjB0b2tlbnMlMjBhcmUlMjBjbGFzc2lmaWVkJTIwcmF0aGVyJTIwdGhlbiUyMGlucHV0JTIwd29yZHMlMjB3aGljaCUyMG1lYW5zJTIwdGhhdCUwQSUyMyUyMHRoZXJlJTIwbWlnaHQlMjBiZSUyMG1vcmUlMjBwcmVkaWN0ZWQlMjB0b2tlbiUyMGNsYXNzZXMlMjB0aGFuJTIwd29yZHMuJTBBJTIzJTIwTXVsdGlwbGUlMjB0b2tlbiUyMGNsYXNzZXMlMjBtaWdodCUyMGFjY291bnQlMjBmb3IlMjB0aGUlMjBzYW1lJTIwd29yZCUwQXByZWRpY3RlZF90b2tlbnNfY2xhc3NlcyUyMCUzRCUyMCU1Qm1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnQuaXRlbSgpJTVEJTIwZm9yJTIwdCUyMGluJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyU1QjAlNUQlNUQlMEFwcmVkaWN0ZWRfdG9rZW5zX2NsYXNzZXMlMEElMEFsYWJlbHMlMjAlM0QlMjBwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTBBbG9zcyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKS5sb3NzJTBBcm91bmQobG9zcy5pdGVtKCklMkMlMjAyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NemotronForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;nvidia/nemotron-3-8b-base-4k-hf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NemotronForTokenClassification.from_pretrained(<span class="hljs-string">&quot;nvidia/nemotron-3-8b-base-4k-hf&quot;</span>)

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
...`,wrap:!1}}),{c(){o=d("p"),o.textContent=T,l=a(),u(p.$$.fragment)},l(i){o=c(i,"P",{"data-svelte-h":!0}),h(o)!=="svelte-11lpom8"&&(o.textContent=T),l=r(i),f(p.$$.fragment,i)},m(i,w){s(i,o,w),s(i,l,w),g(p,i,w),M=!0},p:Q,i(i){M||(_(p.$$.fragment,i),M=!0)},o(i){b(p.$$.fragment,i),M=!1},d(i){i&&(n(o),n(l)),y(p,i)}}}function rs(v){let o,T,l,p,M,i,w,no='<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/> <img alt="FlashAttention" src="https://img.shields.io/badge/%E2%9A%A1%EF%B8%8E%20FlashAttention-eae0c8?style=flat"/> <img alt="SDPA" src="https://img.shields.io/badge/SDPA-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/>',Jt,le,Nt,de,oo='The use of this model is governed by the <a href="https://developer.nvidia.com/downloads/nv-ai-foundation-models-license" rel="nofollow">NVIDIA AI Foundation Models Community License Agreement</a>.',Ut,ce,jt,me,so='Nemotron-4 is a family of enterprise ready generative text models compatible with <a href="https://www.nvidia.com/en-us/ai-data-science/generative-ai/nemo-framework/" rel="nofollow">NVIDIA NeMo Framework</a>.',xt,pe,ao='NVIDIA NeMo is an end-to-end, cloud-native platform to build, customize, and deploy generative AI models anywhere. It includes training and inferencing frameworks, guardrailing toolkits, data curation tools, and pretrained models, offering enterprises an easy, cost-effective, and fast way to adopt generative AI. To get access to NeMo Framework, please sign up at <a href="https://developer.nvidia.com/nemo-framework/join" rel="nofollow">this link</a>.',zt,he,Ft,ue,ro='<a href="https://developer.nvidia.com/blog/nvidia-ai-foundation-models-build-custom-enterprise-chatbots-and-co-pilots-with-production-ready-llms/" rel="nofollow">Announcement Blog</a>',Wt,fe,It,ge,io="<strong>Architecture Type:</strong> Transformer",Zt,_e,lo="<strong>Network Architecture:</strong> Transformer Decoder (auto-regressive language model).",Bt,be,Gt,ye,Rt,Te,co='Minitron is a family of small language models (SLMs) obtained by pruning NVIDIA’s <a href="https://arxiv.org/abs/2402.16819" rel="nofollow">Nemotron-4 15B</a> model. We prune model embedding size, attention heads, and MLP intermediate dimension, following which, we perform continued training with distillation to arrive at the final models.',Lt,Me,mo='Deriving the Minitron 8B and 4B models from the base 15B model using our approach requires up to <strong>40x fewer training tokens</strong> per model compared to training from scratch; this results in <strong>compute cost savings of 1.8x</strong> for training the full model family (15B, 8B, and 4B). Minitron models exhibit up to a 16% improvement in MMLU scores compared to training from scratch, perform comparably to other community models such as Mistral 7B, Gemma 7B and Llama-3 8B, and outperform state-of-the-art compression techniques from the literature. Please refer to our <a href="https://arxiv.org/abs/2407.14679" rel="nofollow">arXiv paper</a> for more details.',Ht,we,po="Minitron models are for research and development only.",Vt,ve,Xt,ke,ho="The following code provides an example of how to load the Minitron-4B model and use it to perform text generation.",qt,Ce,Qt,$e,St,Je,uo='Minitron is released under the <a href="https://developer.download.nvidia.com/licenses/nvidia-open-model-license-agreement-june-2024.pdf" rel="nofollow">NVIDIA Open Model License Agreement</a>.',Et,Ne,Yt,Ue,fo='<em>5-shot performance.</em> Language Understanding evaluated using <a href="https://arxiv.org/abs/2009.03300" rel="nofollow">Massive Multitask Language Understanding</a>:',At,je,go='<thead><tr><th align="left">Average</th></tr></thead> <tbody><tr><td align="left">58.6</td></tr></tbody>',Pt,xe,_o='<em>Zero-shot performance.</em> Evaluated using select datasets from the <a href="https://github.com/EleutherAI/lm-evaluation-harness" rel="nofollow">LM Evaluation Harness</a> with additions:',Dt,ze,bo='<thead><tr><th align="left">HellaSwag</th> <th align="left">Winogrande</th> <th align="left">GSM8K</th> <th align="left">ARC-C</th> <th align="left">XLSum</th></tr></thead> <tbody><tr><td align="left">75.0</td> <td align="left">74.0</td> <td align="left">24.1</td> <td align="left">50.9</td> <td align="left">29.5</td></tr></tbody>',Ot,Fe,yo='<em>Code generation performance</em>. Evaluated using <a href="https://github.com/openai/human-eval" rel="nofollow">HumanEval</a>:',Kt,We,To='<thead><tr><th align="left">p@1, 0-Shot</th></tr></thead> <tbody><tr><td align="left">23.3</td></tr></tbody>',en,Ie,Mo='Please refer to our <a href="https://arxiv.org/abs/2407.14679" rel="nofollow">paper</a> for the full set of results.',tn,Ze,nn,Be,wo="If you find our work helpful, please consider citing our paper:",on,Ge,sn,Re,an,L,Le,Tn,st,vo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronModel">NemotronModel</a>. It is used to instantiate an Nemotron
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 Nemotron-8B.
e.g. <a href="https://huggingface.co/nvidia/nemotron-3-8b-base-4k-hf" rel="nofollow">nvidia/nemotron-3-8b-base-4k-hf</a>.
Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Mn,P,rn,He,ln,J,Ve,wn,at,ko="The bare Nemotron Model outputting raw hidden-states without any specific head on top.",vn,rt,Co=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,kn,it,$o=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Cn,S,Xe,$n,lt,Jo='The <a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronModel">NemotronModel</a> forward method, overrides the <code>__call__</code> special method.',Jn,D,dn,qe,cn,E,Qe,Nn,B,Se,Un,dt,No='The <a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronForCausalLM">NemotronForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',jn,O,xn,K,mn,Ee,pn,k,Ye,zn,ct,Uo="The Nemotron Model transformer with a sequence classification head on top (linear layer).",Fn,mt,jo=`<a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronForSequenceClassification">NemotronForSequenceClassification</a> uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`,Wn,pt,xo=`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).`,In,ht,zo=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Zn,ut,Fo=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Bn,j,Ae,Gn,ft,Wo='The <a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronForSequenceClassification">NemotronForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',Rn,ee,Ln,te,Hn,ne,hn,Pe,un,N,De,Vn,gt,Io=`The Nemotron 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>).`,Xn,_t,Zo=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,qn,bt,Bo=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Qn,G,Oe,Sn,yt,Go='The <a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronForQuestionAnswering">NemotronForQuestionAnswering</a> forward method, overrides the <code>__call__</code> special method.',En,oe,Yn,se,fn,Ke,gn,U,et,An,Tt,Ro=`The Nemotron transformer with a token classification head on top (a linear layer on top of the hidden-states
output) e.g. for Named-Entity-Recognition (NER) tasks.`,Pn,Mt,Lo=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Dn,wt,Ho=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,On,R,tt,Kn,vt,Vo='The <a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronForTokenClassification">NemotronForTokenClassification</a> forward method, overrides the <code>__call__</code> special method.',eo,ae,to,re,_n,nt,bn,Ct,yn;return M=new $({props:{title:"Nemotron",local:"nemotron",headingTag:"h1"}}),le=new $({props:{title:"License",local:"license",headingTag:"h3"}}),ce=new $({props:{title:"Description",local:"description",headingTag:"h3"}}),he=new $({props:{title:"References",local:"references",headingTag:"h3"}}),fe=new $({props:{title:"Model Architecture",local:"model-architecture",headingTag:"h3"}}),be=new $({props:{title:"Minitron",local:"minitron",headingTag:"h2"}}),ye=new $({props:{title:"Minitron 4B Base",local:"minitron-4b-base",headingTag:"h3"}}),ve=new $({props:{title:"HuggingFace Quickstart",local:"huggingface-quickstart",headingTag:"h3"}}),Ce=new ie({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTBBJTBBJTIzJTIwTG9hZCUyMHRoZSUyMHRva2VuaXplciUyMGFuZCUyMG1vZGVsJTBBbW9kZWxfcGF0aCUyMCUzRCUyMCdudmlkaWElMkZNaW5pdHJvbi00Qi1CYXNlJyUwQXRva2VuaXplciUyMCUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX3BhdGgpJTBBJTBBZGV2aWNlJTIwJTNEJTIwJ2N1ZGEnJTBBZHR5cGUlMjAlMjAlM0QlMjB0b3JjaC5iZmxvYXQxNiUwQW1vZGVsJTIwJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKG1vZGVsX3BhdGglMkMlMjB0b3JjaF9kdHlwZSUzRGR0eXBlJTJDJTIwZGV2aWNlX21hcCUzRGRldmljZSklMEElMEElMjMlMjBQcmVwYXJlJTIwdGhlJTIwaW5wdXQlMjB0ZXh0JTBBcHJvbXB0JTIwJTNEJTIwJ0NvbXBsZXRlJTIwdGhlJTIwcGFyYWdyYXBoJTNBJTIwb3VyJTIwc29sYXIlMjBzeXN0ZW0lMjBpcyclMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIuZW5jb2RlKHByb21wdCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJ3B0JykudG8obW9kZWwuZGV2aWNlKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTIwdGhlJTIwb3V0cHV0JTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyUyQyUyMG1heF9sZW5ndGglM0QyMCklMEElMEElMjMlMjBEZWNvZGUlMjBhbmQlMjBwcmludCUyMHRoZSUyMG91dHB1dCUwQW91dHB1dF90ZXh0JTIwJTNEJTIwdG9rZW5pemVyLmRlY29kZShvdXRwdXRzJTVCMCU1RCklMEFwcmludChvdXRwdXRfdGV4dCk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM

<span class="hljs-comment"># Load the tokenizer and model</span>
model_path = <span class="hljs-string">&#x27;nvidia/Minitron-4B-Base&#x27;</span>
tokenizer  = AutoTokenizer.from_pretrained(model_path)

device = <span class="hljs-string">&#x27;cuda&#x27;</span>
dtype  = torch.bfloat16
model  = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=dtype, device_map=device)

<span class="hljs-comment"># Prepare the input text</span>
prompt = <span class="hljs-string">&#x27;Complete the paragraph: our solar system is&#x27;</span>
inputs = tokenizer.encode(prompt, return_tensors=<span class="hljs-string">&#x27;pt&#x27;</span>).to(model.device)

<span class="hljs-comment"># Generate the output</span>
outputs = model.generate(inputs, max_length=<span class="hljs-number">20</span>)

<span class="hljs-comment"># Decode and print the output</span>
output_text = tokenizer.decode(outputs[<span class="hljs-number">0</span>])
<span class="hljs-built_in">print</span>(output_text)`,wrap:!1}}),$e=new $({props:{title:"License",local:"license",headingTag:"h3"}}),Ne=new $({props:{title:"Evaluation Results",local:"evaluation-results",headingTag:"h3"}}),Ze=new $({props:{title:"Citation",local:"citation",headingTag:"h3"}}),Ge=new ie({props:{code:"JTQwYXJ0aWNsZSU3Qm1pbml0cm9uMjAyNCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMHRpdGxlJTNEJTdCQ29tcGFjdCUyMExhbmd1YWdlJTIwTW9kZWxzJTIwdmlhJTIwUHJ1bmluZyUyMGFuZCUyMEtub3dsZWRnZSUyMERpc3RpbGxhdGlvbiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMGF1dGhvciUzRCU3QlNhdXJhdiUyME11cmFsaWRoYXJhbiUyMGFuZCUyMFNoYXJhdGglMjBUdXJ1dmVrZXJlJTIwU3JlZW5pdmFzJTIwYW5kJTIwUmF2aXJhaiUyMEpvc2hpJTIwYW5kJTIwTWFyY2luJTIwQ2hvY2hvd3NraSUyMGFuZCUyME1vc3RvZmElMjBQYXR3YXJ5JTIwYW5kJTIwTW9oYW1tYWQlMjBTaG9leWJpJTIwYW5kJTIwQnJ5YW4lMjBDYXRhbnphcm8lMjBhbmQlMjBKYW4lMjBLYXV0eiUyMGFuZCUyMFBhdmxvJTIwTW9sY2hhbm92JTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwam91cm5hbCUzRCU3QmFyWGl2JTIwcHJlcHJpbnQlMjBhclhpdiUzQTI0MDcuMTQ2NzklN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjB5ZWFyJTNEJTdCMjAyNCU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMHVybCUzRCU3Qmh0dHBzJTNBJTJGJTJGYXJ4aXYub3JnJTJGYWJzJTJGMjQwNy4xNDY3OSU3RCUyQyUwQSU3RA==",highlighted:`<span class="hljs-comment">@article{minitron2024,</span>
      title={Compact Language Models via Pruning <span class="hljs-keyword">and</span> Knowledge Distillation},
      author={Saurav Muralidharan <span class="hljs-keyword">and</span> Sharath Turuvekere Sreenivas <span class="hljs-keyword">and</span> Raviraj Joshi <span class="hljs-keyword">and</span> Marcin Chochowski <span class="hljs-keyword">and</span> Mostofa Patwary <span class="hljs-keyword">and</span> Mohammad Shoeybi <span class="hljs-keyword">and</span> Bryan Catanzaro <span class="hljs-keyword">and</span> Jan Kautz <span class="hljs-keyword">and</span> Pavlo Molchanov},
      journal={arXiv preprint arXiv:<span class="hljs-number">2407</span>.<span class="hljs-number">14679</span>},
      year={<span class="hljs-number">2024</span>},
      url={https:<span class="hljs-comment">//arxiv.org/abs/2407.14679},</span>
}`,wrap:!1}}),Re=new $({props:{title:"NemotronConfig",local:"transformers.NemotronConfig",headingTag:"h2"}}),Le=new q({props:{name:"class transformers.NemotronConfig",anchor:"transformers.NemotronConfig",parameters:[{name:"vocab_size",val:" = 256000"},{name:"hidden_size",val:" = 6144"},{name:"intermediate_size",val:" = 24576"},{name:"num_hidden_layers",val:" = 32"},{name:"num_attention_heads",val:" = 48"},{name:"head_dim",val:" = None"},{name:"num_key_value_heads",val:" = None"},{name:"hidden_act",val:" = 'relu2'"},{name:"max_position_embeddings",val:" = 4096"},{name:"initializer_range",val:" = 0.0134"},{name:"norm_eps",val:" = 1e-05"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = None"},{name:"bos_token_id",val:" = 2"},{name:"eos_token_id",val:" = 3"},{name:"tie_word_embeddings",val:" = False"},{name:"rope_theta",val:" = 10000.0"},{name:"partial_rotary_factor",val:" = 0.5"},{name:"attention_bias",val:" = False"},{name:"attention_dropout",val:" = 0.0"},{name:"mlp_bias",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.NemotronConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256000) &#x2014;
Vocabulary size of the Nemotron model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronModel">NemotronModel</a>`,name:"vocab_size"},{anchor:"transformers.NemotronConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 6144) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.NemotronConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 24576) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.NemotronConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of hidden layers in the Transformer decoder.`,name:"num_hidden_layers"},{anchor:"transformers.NemotronConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 48) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"num_attention_heads"},{anchor:"transformers.NemotronConfig.head_dim",description:`<strong>head_dim</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Projection weights dimension in multi-head attention. Set to hidden_size // num_attention_heads if None`,name:"head_dim"},{anchor:"transformers.NemotronConfig.num_key_value_heads",description:`<strong>num_key_value_heads</strong> (<code>int</code>, <em>optional</em>) &#x2014;
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
<code>num_key_value_heads=num_attention_heads</code>, the model will use Multi Head Attention (MHA), if
<code>num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed by meanpooling all the original heads within that group. For more details checkout [this paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to </code>num_attention_heads\`.`,name:"num_key_value_heads"},{anchor:"transformers.NemotronConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;relu2&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the decoder.`,name:"hidden_act"},{anchor:"transformers.NemotronConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
The maximum sequence length that this model might ever be used with.`,name:"max_position_embeddings"},{anchor:"transformers.NemotronConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0134) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.NemotronConfig.norm_eps",description:`<strong>norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the normalization layers.`,name:"norm_eps"},{anchor:"transformers.NemotronConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.NemotronConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.NemotronConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Beginning of stream token id.`,name:"bos_token_id"},{anchor:"transformers.NemotronConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
End of stream token id.`,name:"eos_token_id"},{anchor:"transformers.NemotronConfig.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie weight embeddings`,name:"tie_word_embeddings"},{anchor:"transformers.NemotronConfig.rope_theta",description:`<strong>rope_theta</strong> (<code>float</code>, <em>optional</em>, defaults to 10000.0) &#x2014;
The base period of the RoPE embeddings.`,name:"rope_theta"},{anchor:"transformers.NemotronConfig.partial_rotary_factor",description:"<strong>partial_rotary_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014; Percentage of the query and keys which will have rotary embedding.",name:"partial_rotary_factor"},{anchor:"transformers.NemotronConfig.attention_bias",description:`<strong>attention_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a bias in the query, key, value and output projection layers during self-attention.`,name:"attention_bias"},{anchor:"transformers.NemotronConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.NemotronConfig.mlp_bias",description:`<strong>mlp_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a bias in up_proj and down_proj layers in the MLP layers.`,name:"mlp_bias"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/configuration_nemotron.py#L26"}}),P=new kt({props:{anchor:"transformers.NemotronConfig.example",$$slots:{default:[Ao]},$$scope:{ctx:v}}}),He=new $({props:{title:"NemotronModel",local:"transformers.NemotronModel",headingTag:"h2"}}),Ve=new q({props:{name:"class transformers.NemotronModel",anchor:"transformers.NemotronModel",parameters:[{name:"config",val:": NemotronConfig"}],parametersDescription:[{anchor:"transformers.NemotronModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronConfig">NemotronConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/modeling_nemotron.py#L599"}}),Xe=new q({props:{name:"forward",anchor:"transformers.NemotronModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Union[transformers.cache_utils.Cache, typing.List[torch.FloatTensor], NoneType] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.NemotronModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NemotronModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.NemotronModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.NemotronModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Union[~cache_utils.Cache, List[torch.FloatTensor], NoneType]</code>) &#x2014;
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/main/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&#x2019;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.NemotronModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NemotronModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.NemotronModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.NemotronModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.NemotronModel.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/modeling_nemotron.py#L630",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/en/model_doc/nemotron#transformers.NemotronConfig"
>NemotronConfig</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>Cache</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — It is a <a
  href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache"
>Cache</a> instance. For more details, see our <a
  href="https://huggingface.co/docs/transformers/en/kv_cache"
  rel="nofollow"
>kv cache guide</a>.</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/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),D=new $t({props:{$$slots:{default:[Po]},$$scope:{ctx:v}}}),qe=new $({props:{title:"NemotronForCausalLM",local:"transformers.NemotronForCausalLM",headingTag:"h2"}}),Qe=new q({props:{name:"class transformers.NemotronForCausalLM",anchor:"transformers.NemotronForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/modeling_nemotron.py#L869"}}),Se=new q({props:{name:"forward",anchor:"transformers.NemotronForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Union[transformers.cache_utils.Cache, typing.List[torch.FloatTensor], NoneType] = 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:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"logits_to_keep",val:": typing.Union[int, torch.Tensor] = 0"},{name:"**loss_kwargs",val:""}],parametersDescription:[{anchor:"transformers.NemotronForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NemotronForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.NemotronForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.NemotronForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Union[~cache_utils.Cache, List[torch.FloatTensor], NoneType]</code>) &#x2014;
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/main/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&#x2019;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.NemotronForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NemotronForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (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 in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"},{anchor:"transformers.NemotronForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.NemotronForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.NemotronForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.NemotronForCausalLM.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
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.NemotronForCausalLM.forward.logits_to_keep",description:`<strong>logits_to_keep</strong> (<code>Union[int, torch.Tensor]</code>, defaults to <code>0</code>) &#x2014;
If an <code>int</code>, compute logits for the last <code>logits_to_keep</code> tokens. If <code>0</code>, calculate logits for all
<code>input_ids</code> (special case). Only last token logits are needed for generation, and calculating them only for that
token can save memory, which becomes pretty significant for long sequences or large vocabulary size.
If a <code>torch.Tensor</code>, must be 1D corresponding to the indices to keep in the sequence length dimension.
This is useful when using packed tensor format (single dimension for batch and sequence length).`,name:"logits_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/modeling_nemotron.py#L899",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/en/model_doc/nemotron#transformers.NemotronConfig"
>NemotronConfig</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>Cache</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — It is a <a
  href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache"
>Cache</a> instance. For more details, see our <a
  href="https://huggingface.co/docs/transformers/en/kv_cache"
  rel="nofollow"
>kv cache guide</a>.</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/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),O=new $t({props:{$$slots:{default:[Do]},$$scope:{ctx:v}}}),K=new kt({props:{anchor:"transformers.NemotronForCausalLM.forward.example",$$slots:{default:[Oo]},$$scope:{ctx:v}}}),Ee=new $({props:{title:"NemotronForSequenceClassification",local:"transformers.NemotronForSequenceClassification",headingTag:"h2"}}),Ye=new q({props:{name:"class transformers.NemotronForSequenceClassification",anchor:"transformers.NemotronForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NemotronForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronForSequenceClassification">NemotronForSequenceClassification</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/modeling_nemotron.py#L974"}}),Ae=new q({props:{name:"forward",anchor:"transformers.NemotronForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[transformers.cache_utils.Cache] = 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"}],parametersDescription:[{anchor:"transformers.NemotronForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NemotronForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.NemotronForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.NemotronForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>~cache_utils.Cache</code>, <em>optional</em>) &#x2014;
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/main/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&#x2019;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.NemotronForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NemotronForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"},{anchor:"transformers.NemotronForSequenceClassification.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.NemotronForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.NemotronForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/modeling_nemotron.py#L1005",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/main/en/model_doc/nemotron#transformers.NemotronConfig"
>NemotronConfig</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>Cache</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — It is a <a
  href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache"
>Cache</a> instance. For more details, see our <a
  href="https://huggingface.co/docs/transformers/en/kv_cache"
  rel="nofollow"
>kv cache guide</a>.</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>
`}}),ee=new $t({props:{$$slots:{default:[Ko]},$$scope:{ctx:v}}}),te=new kt({props:{anchor:"transformers.NemotronForSequenceClassification.forward.example",$$slots:{default:[es]},$$scope:{ctx:v}}}),ne=new kt({props:{anchor:"transformers.NemotronForSequenceClassification.forward.example-2",$$slots:{default:[ts]},$$scope:{ctx:v}}}),Pe=new $({props:{title:"NemotronForQuestionAnswering",local:"transformers.NemotronForQuestionAnswering",headingTag:"h2"}}),De=new q({props:{name:"class transformers.NemotronForQuestionAnswering",anchor:"transformers.NemotronForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NemotronForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronForQuestionAnswering">NemotronForQuestionAnswering</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/modeling_nemotron.py#L1075"}}),Oe=new q({props:{name:"forward",anchor:"transformers.NemotronForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[transformers.cache_utils.Cache] = 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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.NemotronForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NemotronForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.NemotronForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.NemotronForQuestionAnswering.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>~cache_utils.Cache</code>, <em>optional</em>) &#x2014;
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/main/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&#x2019;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.NemotronForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NemotronForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.NemotronForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"},{anchor:"transformers.NemotronForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.NemotronForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/modeling_nemotron.py#L1095",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/en/model_doc/nemotron#transformers.NemotronConfig"
>NemotronConfig</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/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),oe=new $t({props:{$$slots:{default:[ns]},$$scope:{ctx:v}}}),se=new kt({props:{anchor:"transformers.NemotronForQuestionAnswering.forward.example",$$slots:{default:[os]},$$scope:{ctx:v}}}),Ke=new $({props:{title:"NemotronForTokenClassification",local:"transformers.NemotronForTokenClassification",headingTag:"h2"}}),et=new q({props:{name:"class transformers.NemotronForTokenClassification",anchor:"transformers.NemotronForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NemotronForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronForTokenClassification">NemotronForTokenClassification</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/modeling_nemotron.py#L1140"}}),tt=new q({props:{name:"forward",anchor:"transformers.NemotronForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[transformers.cache_utils.Cache] = 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"}],parametersDescription:[{anchor:"transformers.NemotronForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NemotronForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.NemotronForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.NemotronForTokenClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>~cache_utils.Cache</code>, <em>optional</em>) &#x2014;
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/main/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&#x2019;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.NemotronForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NemotronForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"},{anchor:"transformers.NemotronForTokenClassification.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.NemotronForTokenClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.NemotronForTokenClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/modeling_nemotron.py#L1165",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/en/model_doc/nemotron#transformers.NemotronConfig"
>NemotronConfig</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/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ae=new $t({props:{$$slots:{default:[ss]},$$scope:{ctx:v}}}),re=new kt({props:{anchor:"transformers.NemotronForTokenClassification.forward.example",$$slots:{default:[as]},$$scope:{ctx:v}}}),nt=new Yo({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/nemotron.md"}}),{c(){o=d("meta"),T=a(),l=d("p"),p=a(),u(M.$$.fragment),i=a(),w=d("div"),w.innerHTML=no,Jt=a(),u(le.$$.fragment),Nt=a(),de=d("p"),de.innerHTML=oo,Ut=a(),u(ce.$$.fragment),jt=a(),me=d("p"),me.innerHTML=so,xt=a(),pe=d("p"),pe.innerHTML=ao,zt=a(),u(he.$$.fragment),Ft=a(),ue=d("p"),ue.innerHTML=ro,Wt=a(),u(fe.$$.fragment),It=a(),ge=d("p"),ge.innerHTML=io,Zt=a(),_e=d("p"),_e.innerHTML=lo,Bt=a(),u(be.$$.fragment),Gt=a(),u(ye.$$.fragment),Rt=a(),Te=d("p"),Te.innerHTML=co,Lt=a(),Me=d("p"),Me.innerHTML=mo,Ht=a(),we=d("p"),we.textContent=po,Vt=a(),u(ve.$$.fragment),Xt=a(),ke=d("p"),ke.textContent=ho,qt=a(),u(Ce.$$.fragment),Qt=a(),u($e.$$.fragment),St=a(),Je=d("p"),Je.innerHTML=uo,Et=a(),u(Ne.$$.fragment),Yt=a(),Ue=d("p"),Ue.innerHTML=fo,At=a(),je=d("table"),je.innerHTML=go,Pt=a(),xe=d("p"),xe.innerHTML=_o,Dt=a(),ze=d("table"),ze.innerHTML=bo,Ot=a(),Fe=d("p"),Fe.innerHTML=yo,Kt=a(),We=d("table"),We.innerHTML=To,en=a(),Ie=d("p"),Ie.innerHTML=Mo,tn=a(),u(Ze.$$.fragment),nn=a(),Be=d("p"),Be.textContent=wo,on=a(),u(Ge.$$.fragment),sn=a(),u(Re.$$.fragment),an=a(),L=d("div"),u(Le.$$.fragment),Tn=a(),st=d("p"),st.innerHTML=vo,Mn=a(),u(P.$$.fragment),rn=a(),u(He.$$.fragment),ln=a(),J=d("div"),u(Ve.$$.fragment),wn=a(),at=d("p"),at.textContent=ko,vn=a(),rt=d("p"),rt.innerHTML=Co,kn=a(),it=d("p"),it.innerHTML=$o,Cn=a(),S=d("div"),u(Xe.$$.fragment),$n=a(),lt=d("p"),lt.innerHTML=Jo,Jn=a(),u(D.$$.fragment),dn=a(),u(qe.$$.fragment),cn=a(),E=d("div"),u(Qe.$$.fragment),Nn=a(),B=d("div"),u(Se.$$.fragment),Un=a(),dt=d("p"),dt.innerHTML=No,jn=a(),u(O.$$.fragment),xn=a(),u(K.$$.fragment),mn=a(),u(Ee.$$.fragment),pn=a(),k=d("div"),u(Ye.$$.fragment),zn=a(),ct=d("p"),ct.textContent=Uo,Fn=a(),mt=d("p"),mt.innerHTML=jo,Wn=a(),pt=d("p"),pt.innerHTML=xo,In=a(),ht=d("p"),ht.innerHTML=zo,Zn=a(),ut=d("p"),ut.innerHTML=Fo,Bn=a(),j=d("div"),u(Ae.$$.fragment),Gn=a(),ft=d("p"),ft.innerHTML=Wo,Rn=a(),u(ee.$$.fragment),Ln=a(),u(te.$$.fragment),Hn=a(),u(ne.$$.fragment),hn=a(),u(Pe.$$.fragment),un=a(),N=d("div"),u(De.$$.fragment),Vn=a(),gt=d("p"),gt.innerHTML=Io,Xn=a(),_t=d("p"),_t.innerHTML=Zo,qn=a(),bt=d("p"),bt.innerHTML=Bo,Qn=a(),G=d("div"),u(Oe.$$.fragment),Sn=a(),yt=d("p"),yt.innerHTML=Go,En=a(),u(oe.$$.fragment),Yn=a(),u(se.$$.fragment),fn=a(),u(Ke.$$.fragment),gn=a(),U=d("div"),u(et.$$.fragment),An=a(),Tt=d("p"),Tt.textContent=Ro,Pn=a(),Mt=d("p"),Mt.innerHTML=Lo,Dn=a(),wt=d("p"),wt.innerHTML=Ho,On=a(),R=d("div"),u(tt.$$.fragment),Kn=a(),vt=d("p"),vt.innerHTML=Vo,eo=a(),u(ae.$$.fragment),to=a(),u(re.$$.fragment),_n=a(),u(nt.$$.fragment),bn=a(),Ct=d("p"),this.h()},l(e){const t=Eo("svelte-u9bgzb",document.head);o=c(t,"META",{name:!0,content:!0}),t.forEach(n),T=r(e),l=c(e,"P",{}),Z(l).forEach(n),p=r(e),f(M.$$.fragment,e),i=r(e),w=c(e,"DIV",{class:!0,"data-svelte-h":!0}),h(w)!=="svelte-b95w5j"&&(w.innerHTML=no),Jt=r(e),f(le.$$.fragment,e),Nt=r(e),de=c(e,"P",{"data-svelte-h":!0}),h(de)!=="svelte-5ltir7"&&(de.innerHTML=oo),Ut=r(e),f(ce.$$.fragment,e),jt=r(e),me=c(e,"P",{"data-svelte-h":!0}),h(me)!=="svelte-18vqkxz"&&(me.innerHTML=so),xt=r(e),pe=c(e,"P",{"data-svelte-h":!0}),h(pe)!=="svelte-1inbdxl"&&(pe.innerHTML=ao),zt=r(e),f(he.$$.fragment,e),Ft=r(e),ue=c(e,"P",{"data-svelte-h":!0}),h(ue)!=="svelte-eh2pqk"&&(ue.innerHTML=ro),Wt=r(e),f(fe.$$.fragment,e),It=r(e),ge=c(e,"P",{"data-svelte-h":!0}),h(ge)!=="svelte-1afrym1"&&(ge.innerHTML=io),Zt=r(e),_e=c(e,"P",{"data-svelte-h":!0}),h(_e)!=="svelte-8mone6"&&(_e.innerHTML=lo),Bt=r(e),f(be.$$.fragment,e),Gt=r(e),f(ye.$$.fragment,e),Rt=r(e),Te=c(e,"P",{"data-svelte-h":!0}),h(Te)!=="svelte-6qg38c"&&(Te.innerHTML=co),Lt=r(e),Me=c(e,"P",{"data-svelte-h":!0}),h(Me)!=="svelte-nugv14"&&(Me.innerHTML=mo),Ht=r(e),we=c(e,"P",{"data-svelte-h":!0}),h(we)!=="svelte-1890ku0"&&(we.textContent=po),Vt=r(e),f(ve.$$.fragment,e),Xt=r(e),ke=c(e,"P",{"data-svelte-h":!0}),h(ke)!=="svelte-1ltrinh"&&(ke.textContent=ho),qt=r(e),f(Ce.$$.fragment,e),Qt=r(e),f($e.$$.fragment,e),St=r(e),Je=c(e,"P",{"data-svelte-h":!0}),h(Je)!=="svelte-1smp3z2"&&(Je.innerHTML=uo),Et=r(e),f(Ne.$$.fragment,e),Yt=r(e),Ue=c(e,"P",{"data-svelte-h":!0}),h(Ue)!=="svelte-1jomx29"&&(Ue.innerHTML=fo),At=r(e),je=c(e,"TABLE",{"data-svelte-h":!0}),h(je)!=="svelte-rg1rpw"&&(je.innerHTML=go),Pt=r(e),xe=c(e,"P",{"data-svelte-h":!0}),h(xe)!=="svelte-tkg6bs"&&(xe.innerHTML=_o),Dt=r(e),ze=c(e,"TABLE",{"data-svelte-h":!0}),h(ze)!=="svelte-kgjah5"&&(ze.innerHTML=bo),Ot=r(e),Fe=c(e,"P",{"data-svelte-h":!0}),h(Fe)!=="svelte-oe9pwo"&&(Fe.innerHTML=yo),Kt=r(e),We=c(e,"TABLE",{"data-svelte-h":!0}),h(We)!=="svelte-xb08ow"&&(We.innerHTML=To),en=r(e),Ie=c(e,"P",{"data-svelte-h":!0}),h(Ie)!=="svelte-lze01h"&&(Ie.innerHTML=Mo),tn=r(e),f(Ze.$$.fragment,e),nn=r(e),Be=c(e,"P",{"data-svelte-h":!0}),h(Be)!=="svelte-1viguyj"&&(Be.textContent=wo),on=r(e),f(Ge.$$.fragment,e),sn=r(e),f(Re.$$.fragment,e),an=r(e),L=c(e,"DIV",{class:!0});var Y=Z(L);f(Le.$$.fragment,Y),Tn=r(Y),st=c(Y,"P",{"data-svelte-h":!0}),h(st)!=="svelte-3yf1ba"&&(st.innerHTML=vo),Mn=r(Y),f(P.$$.fragment,Y),Y.forEach(n),rn=r(e),f(He.$$.fragment,e),ln=r(e),J=c(e,"DIV",{class:!0});var z=Z(J);f(Ve.$$.fragment,z),wn=r(z),at=c(z,"P",{"data-svelte-h":!0}),h(at)!=="svelte-hf9zau"&&(at.textContent=ko),vn=r(z),rt=c(z,"P",{"data-svelte-h":!0}),h(rt)!=="svelte-6pahdo"&&(rt.innerHTML=Co),kn=r(z),it=c(z,"P",{"data-svelte-h":!0}),h(it)!=="svelte-hswkmf"&&(it.innerHTML=$o),Cn=r(z),S=c(z,"DIV",{class:!0});var A=Z(S);f(Xe.$$.fragment,A),$n=r(A),lt=c(A,"P",{"data-svelte-h":!0}),h(lt)!=="svelte-b4c7fd"&&(lt.innerHTML=Jo),Jn=r(A),f(D.$$.fragment,A),A.forEach(n),z.forEach(n),dn=r(e),f(qe.$$.fragment,e),cn=r(e),E=c(e,"DIV",{class:!0});var ot=Z(E);f(Qe.$$.fragment,ot),Nn=r(ot),B=c(ot,"DIV",{class:!0});var H=Z(B);f(Se.$$.fragment,H),Un=r(H),dt=c(H,"P",{"data-svelte-h":!0}),h(dt)!=="svelte-1txhibh"&&(dt.innerHTML=No),jn=r(H),f(O.$$.fragment,H),xn=r(H),f(K.$$.fragment,H),H.forEach(n),ot.forEach(n),mn=r(e),f(Ee.$$.fragment,e),pn=r(e),k=c(e,"DIV",{class:!0});var C=Z(k);f(Ye.$$.fragment,C),zn=r(C),ct=c(C,"P",{"data-svelte-h":!0}),h(ct)!=="svelte-7mvho4"&&(ct.textContent=Uo),Fn=r(C),mt=c(C,"P",{"data-svelte-h":!0}),h(mt)!=="svelte-1beijmg"&&(mt.innerHTML=jo),Wn=r(C),pt=c(C,"P",{"data-svelte-h":!0}),h(pt)!=="svelte-10ugs3m"&&(pt.innerHTML=xo),In=r(C),ht=c(C,"P",{"data-svelte-h":!0}),h(ht)!=="svelte-6pahdo"&&(ht.innerHTML=zo),Zn=r(C),ut=c(C,"P",{"data-svelte-h":!0}),h(ut)!=="svelte-hswkmf"&&(ut.innerHTML=Fo),Bn=r(C),j=c(C,"DIV",{class:!0});var F=Z(j);f(Ae.$$.fragment,F),Gn=r(F),ft=c(F,"P",{"data-svelte-h":!0}),h(ft)!=="svelte-zg30gx"&&(ft.innerHTML=Wo),Rn=r(F),f(ee.$$.fragment,F),Ln=r(F),f(te.$$.fragment,F),Hn=r(F),f(ne.$$.fragment,F),F.forEach(n),C.forEach(n),hn=r(e),f(Pe.$$.fragment,e),un=r(e),N=c(e,"DIV",{class:!0});var W=Z(N);f(De.$$.fragment,W),Vn=r(W),gt=c(W,"P",{"data-svelte-h":!0}),h(gt)!=="svelte-1aw0dqj"&&(gt.innerHTML=Io),Xn=r(W),_t=c(W,"P",{"data-svelte-h":!0}),h(_t)!=="svelte-6pahdo"&&(_t.innerHTML=Zo),qn=r(W),bt=c(W,"P",{"data-svelte-h":!0}),h(bt)!=="svelte-hswkmf"&&(bt.innerHTML=Bo),Qn=r(W),G=c(W,"DIV",{class:!0});var V=Z(G);f(Oe.$$.fragment,V),Sn=r(V),yt=c(V,"P",{"data-svelte-h":!0}),h(yt)!=="svelte-13bjunr"&&(yt.innerHTML=Go),En=r(V),f(oe.$$.fragment,V),Yn=r(V),f(se.$$.fragment,V),V.forEach(n),W.forEach(n),fn=r(e),f(Ke.$$.fragment,e),gn=r(e),U=c(e,"DIV",{class:!0});var I=Z(U);f(et.$$.fragment,I),An=r(I),Tt=c(I,"P",{"data-svelte-h":!0}),h(Tt)!=="svelte-p22s1a"&&(Tt.textContent=Ro),Pn=r(I),Mt=c(I,"P",{"data-svelte-h":!0}),h(Mt)!=="svelte-6pahdo"&&(Mt.innerHTML=Lo),Dn=r(I),wt=c(I,"P",{"data-svelte-h":!0}),h(wt)!=="svelte-hswkmf"&&(wt.innerHTML=Ho),On=r(I),R=c(I,"DIV",{class:!0});var X=Z(R);f(tt.$$.fragment,X),Kn=r(X),vt=c(X,"P",{"data-svelte-h":!0}),h(vt)!=="svelte-u14nut"&&(vt.innerHTML=Vo),eo=r(X),f(ae.$$.fragment,X),to=r(X),f(re.$$.fragment,X),X.forEach(n),I.forEach(n),_n=r(e),f(nt.$$.fragment,e),bn=r(e),Ct=c(e,"P",{}),Z(Ct).forEach(n),this.h()},h(){x(o,"name","hf:doc:metadata"),x(o,"content",is),x(w,"class","flex flex-wrap space-x-1"),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(S,"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(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(E,"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(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(N,"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(U,"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){m(document.head,o),s(e,T,t),s(e,l,t),s(e,p,t),g(M,e,t),s(e,i,t),s(e,w,t),s(e,Jt,t),g(le,e,t),s(e,Nt,t),s(e,de,t),s(e,Ut,t),g(ce,e,t),s(e,jt,t),s(e,me,t),s(e,xt,t),s(e,pe,t),s(e,zt,t),g(he,e,t),s(e,Ft,t),s(e,ue,t),s(e,Wt,t),g(fe,e,t),s(e,It,t),s(e,ge,t),s(e,Zt,t),s(e,_e,t),s(e,Bt,t),g(be,e,t),s(e,Gt,t),g(ye,e,t),s(e,Rt,t),s(e,Te,t),s(e,Lt,t),s(e,Me,t),s(e,Ht,t),s(e,we,t),s(e,Vt,t),g(ve,e,t),s(e,Xt,t),s(e,ke,t),s(e,qt,t),g(Ce,e,t),s(e,Qt,t),g($e,e,t),s(e,St,t),s(e,Je,t),s(e,Et,t),g(Ne,e,t),s(e,Yt,t),s(e,Ue,t),s(e,At,t),s(e,je,t),s(e,Pt,t),s(e,xe,t),s(e,Dt,t),s(e,ze,t),s(e,Ot,t),s(e,Fe,t),s(e,Kt,t),s(e,We,t),s(e,en,t),s(e,Ie,t),s(e,tn,t),g(Ze,e,t),s(e,nn,t),s(e,Be,t),s(e,on,t),g(Ge,e,t),s(e,sn,t),g(Re,e,t),s(e,an,t),s(e,L,t),g(Le,L,null),m(L,Tn),m(L,st),m(L,Mn),g(P,L,null),s(e,rn,t),g(He,e,t),s(e,ln,t),s(e,J,t),g(Ve,J,null),m(J,wn),m(J,at),m(J,vn),m(J,rt),m(J,kn),m(J,it),m(J,Cn),m(J,S),g(Xe,S,null),m(S,$n),m(S,lt),m(S,Jn),g(D,S,null),s(e,dn,t),g(qe,e,t),s(e,cn,t),s(e,E,t),g(Qe,E,null),m(E,Nn),m(E,B),g(Se,B,null),m(B,Un),m(B,dt),m(B,jn),g(O,B,null),m(B,xn),g(K,B,null),s(e,mn,t),g(Ee,e,t),s(e,pn,t),s(e,k,t),g(Ye,k,null),m(k,zn),m(k,ct),m(k,Fn),m(k,mt),m(k,Wn),m(k,pt),m(k,In),m(k,ht),m(k,Zn),m(k,ut),m(k,Bn),m(k,j),g(Ae,j,null),m(j,Gn),m(j,ft),m(j,Rn),g(ee,j,null),m(j,Ln),g(te,j,null),m(j,Hn),g(ne,j,null),s(e,hn,t),g(Pe,e,t),s(e,un,t),s(e,N,t),g(De,N,null),m(N,Vn),m(N,gt),m(N,Xn),m(N,_t),m(N,qn),m(N,bt),m(N,Qn),m(N,G),g(Oe,G,null),m(G,Sn),m(G,yt),m(G,En),g(oe,G,null),m(G,Yn),g(se,G,null),s(e,fn,t),g(Ke,e,t),s(e,gn,t),s(e,U,t),g(et,U,null),m(U,An),m(U,Tt),m(U,Pn),m(U,Mt),m(U,Dn),m(U,wt),m(U,On),m(U,R),g(tt,R,null),m(R,Kn),m(R,vt),m(R,eo),g(ae,R,null),m(R,to),g(re,R,null),s(e,_n,t),g(nt,e,t),s(e,bn,t),s(e,Ct,t),yn=!0},p(e,[t]){const Y={};t&2&&(Y.$$scope={dirty:t,ctx:e}),P.$set(Y);const z={};t&2&&(z.$$scope={dirty:t,ctx:e}),D.$set(z);const A={};t&2&&(A.$$scope={dirty:t,ctx:e}),O.$set(A);const ot={};t&2&&(ot.$$scope={dirty:t,ctx:e}),K.$set(ot);const H={};t&2&&(H.$$scope={dirty:t,ctx:e}),ee.$set(H);const C={};t&2&&(C.$$scope={dirty:t,ctx:e}),te.$set(C);const F={};t&2&&(F.$$scope={dirty:t,ctx:e}),ne.$set(F);const W={};t&2&&(W.$$scope={dirty:t,ctx:e}),oe.$set(W);const V={};t&2&&(V.$$scope={dirty:t,ctx:e}),se.$set(V);const I={};t&2&&(I.$$scope={dirty:t,ctx:e}),ae.$set(I);const X={};t&2&&(X.$$scope={dirty:t,ctx:e}),re.$set(X)},i(e){yn||(_(M.$$.fragment,e),_(le.$$.fragment,e),_(ce.$$.fragment,e),_(he.$$.fragment,e),_(fe.$$.fragment,e),_(be.$$.fragment,e),_(ye.$$.fragment,e),_(ve.$$.fragment,e),_(Ce.$$.fragment,e),_($e.$$.fragment,e),_(Ne.$$.fragment,e),_(Ze.$$.fragment,e),_(Ge.$$.fragment,e),_(Re.$$.fragment,e),_(Le.$$.fragment,e),_(P.$$.fragment,e),_(He.$$.fragment,e),_(Ve.$$.fragment,e),_(Xe.$$.fragment,e),_(D.$$.fragment,e),_(qe.$$.fragment,e),_(Qe.$$.fragment,e),_(Se.$$.fragment,e),_(O.$$.fragment,e),_(K.$$.fragment,e),_(Ee.$$.fragment,e),_(Ye.$$.fragment,e),_(Ae.$$.fragment,e),_(ee.$$.fragment,e),_(te.$$.fragment,e),_(ne.$$.fragment,e),_(Pe.$$.fragment,e),_(De.$$.fragment,e),_(Oe.$$.fragment,e),_(oe.$$.fragment,e),_(se.$$.fragment,e),_(Ke.$$.fragment,e),_(et.$$.fragment,e),_(tt.$$.fragment,e),_(ae.$$.fragment,e),_(re.$$.fragment,e),_(nt.$$.fragment,e),yn=!0)},o(e){b(M.$$.fragment,e),b(le.$$.fragment,e),b(ce.$$.fragment,e),b(he.$$.fragment,e),b(fe.$$.fragment,e),b(be.$$.fragment,e),b(ye.$$.fragment,e),b(ve.$$.fragment,e),b(Ce.$$.fragment,e),b($e.$$.fragment,e),b(Ne.$$.fragment,e),b(Ze.$$.fragment,e),b(Ge.$$.fragment,e),b(Re.$$.fragment,e),b(Le.$$.fragment,e),b(P.$$.fragment,e),b(He.$$.fragment,e),b(Ve.$$.fragment,e),b(Xe.$$.fragment,e),b(D.$$.fragment,e),b(qe.$$.fragment,e),b(Qe.$$.fragment,e),b(Se.$$.fragment,e),b(O.$$.fragment,e),b(K.$$.fragment,e),b(Ee.$$.fragment,e),b(Ye.$$.fragment,e),b(Ae.$$.fragment,e),b(ee.$$.fragment,e),b(te.$$.fragment,e),b(ne.$$.fragment,e),b(Pe.$$.fragment,e),b(De.$$.fragment,e),b(Oe.$$.fragment,e),b(oe.$$.fragment,e),b(se.$$.fragment,e),b(Ke.$$.fragment,e),b(et.$$.fragment,e),b(tt.$$.fragment,e),b(ae.$$.fragment,e),b(re.$$.fragment,e),b(nt.$$.fragment,e),yn=!1},d(e){e&&(n(T),n(l),n(p),n(i),n(w),n(Jt),n(Nt),n(de),n(Ut),n(jt),n(me),n(xt),n(pe),n(zt),n(Ft),n(ue),n(Wt),n(It),n(ge),n(Zt),n(_e),n(Bt),n(Gt),n(Rt),n(Te),n(Lt),n(Me),n(Ht),n(we),n(Vt),n(Xt),n(ke),n(qt),n(Qt),n(St),n(Je),n(Et),n(Yt),n(Ue),n(At),n(je),n(Pt),n(xe),n(Dt),n(ze),n(Ot),n(Fe),n(Kt),n(We),n(en),n(Ie),n(tn),n(nn),n(Be),n(on),n(sn),n(an),n(L),n(rn),n(ln),n(J),n(dn),n(cn),n(E),n(mn),n(pn),n(k),n(hn),n(un),n(N),n(fn),n(gn),n(U),n(_n),n(bn),n(Ct)),n(o),y(M,e),y(le,e),y(ce,e),y(he,e),y(fe,e),y(be,e),y(ye,e),y(ve,e),y(Ce,e),y($e,e),y(Ne,e),y(Ze,e),y(Ge,e),y(Re,e),y(Le),y(P),y(He,e),y(Ve),y(Xe),y(D),y(qe,e),y(Qe),y(Se),y(O),y(K),y(Ee,e),y(Ye),y(Ae),y(ee),y(te),y(ne),y(Pe,e),y(De),y(Oe),y(oe),y(se),y(Ke,e),y(et),y(tt),y(ae),y(re),y(nt,e)}}}const is='{"title":"Nemotron","local":"nemotron","sections":[{"title":"License","local":"license","sections":[],"depth":3},{"title":"Description","local":"description","sections":[],"depth":3},{"title":"References","local":"references","sections":[],"depth":3},{"title":"Model Architecture","local":"model-architecture","sections":[],"depth":3},{"title":"Minitron","local":"minitron","sections":[{"title":"Minitron 4B Base","local":"minitron-4b-base","sections":[],"depth":3},{"title":"HuggingFace Quickstart","local":"huggingface-quickstart","sections":[],"depth":3},{"title":"License","local":"license","sections":[],"depth":3},{"title":"Evaluation Results","local":"evaluation-results","sections":[],"depth":3},{"title":"Citation","local":"citation","sections":[],"depth":3}],"depth":2},{"title":"NemotronConfig","local":"transformers.NemotronConfig","sections":[],"depth":2},{"title":"NemotronModel","local":"transformers.NemotronModel","sections":[],"depth":2},{"title":"NemotronForCausalLM","local":"transformers.NemotronForCausalLM","sections":[],"depth":2},{"title":"NemotronForSequenceClassification","local":"transformers.NemotronForSequenceClassification","sections":[],"depth":2},{"title":"NemotronForQuestionAnswering","local":"transformers.NemotronForQuestionAnswering","sections":[],"depth":2},{"title":"NemotronForTokenClassification","local":"transformers.NemotronForTokenClassification","sections":[],"depth":2}],"depth":1}';function ls(v){return qo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _s extends Qo{constructor(o){super(),So(this,o,ls,rs,Xo,{})}}export{_s as component};
