import{s as Bn,o as Wn,n as oe}from"../chunks/scheduler.25b97de1.js";import{S as Hn,i as Zn,g as i,s,r as p,A as Pn,h as l,f as o,c as a,j as I,u as h,x as m,k as U,y as d,a as n,v as u,d as f,t as g,w as _}from"../chunks/index.d9030fc9.js";import{T as vt}from"../chunks/Tip.baa67368.js";import{D as H}from"../chunks/Docstring.ffac8efa.js";import{C as kt}from"../chunks/CodeBlock.e6cd0d95.js";import{E as Vo}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as w,E as qn}from"../chunks/EditOnGithub.91d95064.js";function Gn(k){let r,T;return r=new kt({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(){p(r.$$.fragment)},l(c){h(r.$$.fragment,c)},m(c,y){u(r,c,y),T=!0},p:oe,i(c){T||(f(r.$$.fragment,c),T=!0)},o(c){g(r.$$.fragment,c),T=!1},d(c){_(r,c)}}}function Sn(k){let r,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(){r=i("p"),r.innerHTML=T},l(c){r=l(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-fincs2"&&(r.innerHTML=T)},m(c,y){n(c,r,y)},p:oe,d(c){c&&o(r)}}}function An(k){let r,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(){r=i("p"),r.innerHTML=T},l(c){r=l(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-fincs2"&&(r.innerHTML=T)},m(c,y){n(c,r,y)},p:oe,d(c){c&&o(r)}}}function Rn(k){let r,T="Example:",c,y,M;return y=new kt({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(){r=i("p"),r.textContent=T,c=s(),p(y.$$.fragment)},l(b){r=l(b,"P",{"data-svelte-h":!0}),m(r)!=="svelte-11lpom8"&&(r.textContent=T),c=a(b),h(y.$$.fragment,b)},m(b,C){n(b,r,C),n(b,c,C),u(y,b,C),M=!0},p:oe,i(b){M||(f(y.$$.fragment,b),M=!0)},o(b){g(y.$$.fragment,b),M=!1},d(b){b&&(o(r),o(c)),_(y,b)}}}function Qn(k){let r,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(){r=i("p"),r.innerHTML=T},l(c){r=l(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-fincs2"&&(r.innerHTML=T)},m(c,y){n(c,r,y)},p:oe,d(c){c&&o(r)}}}function Xn(k){let r,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(){r=i("p"),r.innerHTML=T},l(c){r=l(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-fincs2"&&(r.innerHTML=T)},m(c,y){n(c,r,y)},p:oe,d(c){c&&o(r)}}}function En(k){let r,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(){r=i("p"),r.innerHTML=T},l(c){r=l(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-fincs2"&&(r.innerHTML=T)},m(c,y){n(c,r,y)},p:oe,d(c){c&&o(r)}}}function Vn(k){let r,T="Example:",c,y,M;return y=new kt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBOZW1vdHJvbkZvclRva2VuQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRm5lbW90cm9uLTMtOGItYmFzZS00ay1oZiUyMiklMEFtb2RlbCUyMCUzRCUyME5lbW90cm9uRm9yVG9rZW5DbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybnZpZGlhJTJGbmVtb3Ryb24tMy04Yi1iYXNlLTRrLWhmJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlMjJIdWdnaW5nRmFjZSUyMGlzJTIwYSUyMGNvbXBhbnklMjBiYXNlZCUyMGluJTIwUGFyaXMlMjBhbmQlMjBOZXclMjBZb3JrJTIyJTJDJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNERmFsc2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTBBKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpJTBBJTBBJTIzJTIwTm90ZSUyMHRoYXQlMjB0b2tlbnMlMjBhcmUlMjBjbGFzc2lmaWVkJTIwcmF0aGVyJTIwdGhlbiUyMGlucHV0JTIwd29yZHMlMjB3aGljaCUyMG1lYW5zJTIwdGhhdCUwQSUyMyUyMHRoZXJlJTIwbWlnaHQlMjBiZSUyMG1vcmUlMjBwcmVkaWN0ZWQlMjB0b2tlbiUyMGNsYXNzZXMlMjB0aGFuJTIwd29yZHMuJTBBJTIzJTIwTXVsdGlwbGUlMjB0b2tlbiUyMGNsYXNzZXMlMjBtaWdodCUyMGFjY291bnQlMjBmb3IlMjB0aGUlMjBzYW1lJTIwd29yZCUwQXByZWRpY3RlZF90b2tlbnNfY2xhc3NlcyUyMCUzRCUyMCU1Qm1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnQuaXRlbSgpJTVEJTIwZm9yJTIwdCUyMGluJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyU1QjAlNUQlNUQlMEElMEFsYWJlbHMlMjAlM0QlMjBwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTBBbG9zcyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKS5sb3Nz",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>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`,wrap:!1}}),{c(){r=i("p"),r.textContent=T,c=s(),p(y.$$.fragment)},l(b){r=l(b,"P",{"data-svelte-h":!0}),m(r)!=="svelte-11lpom8"&&(r.textContent=T),c=a(b),h(y.$$.fragment,b)},m(b,C){n(b,r,C),n(b,c,C),u(y,b,C),M=!0},p:oe,i(b){M||(f(y.$$.fragment,b),M=!0)},o(b){g(y.$$.fragment,b),M=!1},d(b){b&&(o(r),o(c)),_(y,b)}}}function On(k){let r,T,c,y,M,b,C,wt,ne,Mt,se,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>.',$t,ae,Ct,re,Yo='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>.',Nt,ie,Do='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,le,xt,de,Ko='<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>',Jt,ce,Ft,me,en="<strong>Architecture Type:</strong> Transformer",It,pe,tn="<strong>Network Architecture:</strong> Transformer Decoder (auto-regressive language model).",Ut,he,jt,ue,Lt,fe,on='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.',Bt,ge,nn='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.',Wt,_e,sn="Minitron models are for research and development only.",Ht,be,Zt,ye,an="The following code provides an example of how to load the Minitron-4B model and use it to perform text generation.",Pt,Te,qt,ve,Gt,ke,rn='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>.',St,we,At,Me,ln='<em>5-shot performance.</em> Language Understanding evaluated using <a href="https://arxiv.org/abs/2009.03300" rel="nofollow">Massive Multitask Language Understanding</a>:',Rt,$e,dn='<thead><tr><th align="left">Average</th></tr></thead> <tbody><tr><td align="left">58.6</td></tr></tbody>',Qt,Ce,cn='<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:',Xt,Ne,mn='<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>',Et,ze,pn='<em>Code generation performance</em>. Evaluated using <a href="https://github.com/openai/human-eval" rel="nofollow">HumanEval</a>:',Vt,xe,hn='<thead><tr><th align="left">p@1, 0-Shot</th></tr></thead> <tbody><tr><td align="left">23.3</td></tr></tbody>',Ot,Je,un='Please refer to our <a href="https://arxiv.org/abs/2407.14679" rel="nofollow">paper</a> for the full set of results.',Yt,Fe,Dt,Ie,fn="If you find our work helpful, please consider citing our paper:",Kt,Ue,eo,je,to,B,Le,go,Ke,gn=`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.`,_o,X,oo,Be,no,N,We,bo,et,_n=`The bare Nemotron Model outputting raw hidden-states without any specific head on top.
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.)`,yo,tt,bn=`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.`,To,ot,yn="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>NemotronDecoderLayer</code>",vo,Z,He,ko,nt,Tn='The <a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronModel">NemotronModel</a> forward method, overrides the <code>__call__</code> special method.',wo,E,so,Ze,ao,S,Pe,Mo,j,qe,$o,st,vn='The <a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronForCausalLM">NemotronForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',Co,V,No,O,ro,Ge,io,v,Se,zo,at,kn="The Nemotron Model transformer with a sequence classification head on top (linear layer).",xo,rt,wn=`<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.`,Jo,it,Mn=`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).`,Fo,lt,$n=`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.)`,Io,dt,Cn=`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.`,Uo,P,Ae,jo,ct,Nn='The <a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronForSequenceClassification">NemotronForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',Lo,Y,lo,Re,co,z,Qe,Bo,mt,zn=`The Nemotron Model transformer with a span classification head on top for extractive question-answering tasks like
SQuAD (a linear layer on top of the hidden-states output to compute <code>span start logits</code> and <code>span end logits</code>).`,Wo,pt,xn=`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.)`,Ho,ht,Jn=`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.`,Zo,q,Xe,Po,ut,Fn='The <a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronForQuestionAnswering">NemotronForQuestionAnswering</a> forward method, overrides the <code>__call__</code> special method.',qo,D,mo,Ee,po,x,Ve,Go,ft,In=`The Nemotron Model 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.`,So,gt,Un=`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.)`,Ao,_t,jn=`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.`,Ro,L,Oe,Qo,bt,Ln='The <a href="/docs/transformers/main/en/model_doc/nemotron#transformers.NemotronForTokenClassification">NemotronForTokenClassification</a> forward method, overrides the <code>__call__</code> special method.',Xo,K,Eo,ee,ho,Ye,uo,Tt,fo;return M=new w({props:{title:"Nemotron",local:"nemotron",headingTag:"h1"}}),C=new w({props:{title:"Nemotron",local:"nemotron",headingTag:"h2"}}),ne=new w({props:{title:"License",local:"license",headingTag:"h3"}}),ae=new w({props:{title:"Description",local:"description",headingTag:"h3"}}),le=new w({props:{title:"References",local:"references",headingTag:"h3"}}),ce=new w({props:{title:"Model Architecture",local:"model-architecture",headingTag:"h3"}}),he=new w({props:{title:"Minitron",local:"minitron",headingTag:"h2"}}),ue=new w({props:{title:"Minitron 4B Base",local:"minitron-4b-base",headingTag:"h3"}}),be=new w({props:{title:"HuggingFace Quickstart",local:"huggingface-quickstart",headingTag:"h3"}}),Te=new kt({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}}),ve=new w({props:{title:"License",local:"license",headingTag:"h3"}}),we=new w({props:{title:"Evaluation Results",local:"evaluation-results",headingTag:"h3"}}),Fe=new w({props:{title:"Citation",local:"citation",headingTag:"h3"}}),Ue=new kt({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}}),je=new w({props:{title:"NemotronConfig",local:"transformers.NemotronConfig",headingTag:"h2"}}),Le=new H({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"}}),X=new Vo({props:{anchor:"transformers.NemotronConfig.example",$$slots:{default:[Gn]},$$scope:{ctx:k}}}),Be=new w({props:{title:"NemotronModel",local:"transformers.NemotronModel",headingTag:"h2"}}),We=new H({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"},{anchor:"transformers.NemotronModel.config",description:"<strong>config</strong> &#x2014; NemotronConfig",name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/modeling_nemotron.py#L722"}}),He=new H({props:{name:"forward",anchor:"transformers.NemotronModel.forward",parameters:[{name:"input_ids",val:": 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:"return_dict",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>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</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></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>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"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>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</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.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.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.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#L756"}}),E=new vt({props:{$$slots:{default:[Sn]},$$scope:{ctx:k}}}),Ze=new w({props:{title:"NemotronForCausalLM",local:"transformers.NemotronForCausalLM",headingTag:"h2"}}),Pe=new H({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#L996"}}),qe=new H({props:{name:"forward",anchor:"transformers.NemotronForCausalLM.forward",parameters:[{name:"input_ids",val:": 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:"return_dict",val:": typing.Optional[bool] = None"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"num_logits_to_keep",val:": int = 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>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</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></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>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"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>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</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.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.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.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.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.Args",description:`<strong>Args</strong> &#x2014;
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
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>.</p>
<p>num_logits_to_keep (<code>int</code>, <em>optional</em>):
Calculate logits for the last <code>num_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.`,name:"Args"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/modeling_nemotron.py#L1026",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>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),V=new vt({props:{$$slots:{default:[An]},$$scope:{ctx:k}}}),O=new Vo({props:{anchor:"transformers.NemotronForCausalLM.forward.example",$$slots:{default:[Rn]},$$scope:{ctx:k}}}),Ge=new w({props:{title:"NemotronForSequenceClassification",local:"transformers.NemotronForSequenceClassification",headingTag:"h2"}}),Se=new H({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.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#L1116"}}),Ae=new H({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.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:"return_dict",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>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</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></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>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"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</code> or <code>tuple(tuple(torch.FloatTensor))</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.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"},{anchor:"transformers.NemotronForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NemotronForSequenceClassification.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.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/modeling_nemotron.py#L1148"}}),Y=new vt({props:{$$slots:{default:[Qn]},$$scope:{ctx:k}}}),Re=new w({props:{title:"NemotronForQuestionAnswering",local:"transformers.NemotronForQuestionAnswering",headingTag:"h2"}}),Qe=new H({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.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#L1221"}}),Xe=new H({props:{name:"forward",anchor:"transformers.NemotronForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"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:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{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>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</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></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>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"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</code> or <code>tuple(tuple(torch.FloatTensor))</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.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.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"},{anchor:"transformers.NemotronForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NemotronForQuestionAnswering.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.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/modeling_nemotron.py#L1247"}}),D=new vt({props:{$$slots:{default:[Xn]},$$scope:{ctx:k}}}),Ee=new w({props:{title:"NemotronForTokenClassification",local:"transformers.NemotronForTokenClassification",headingTag:"h2"}}),Ve=new H({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.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#L1309"}}),Oe=new H({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[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.NemotronForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</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></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>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"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</code> or <code>tuple(tuple(torch.FloatTensor))</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.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"},{anchor:"transformers.NemotronForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NemotronForTokenClassification.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.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nemotron/modeling_nemotron.py#L1340",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>
`}}),K=new vt({props:{$$slots:{default:[En]},$$scope:{ctx:k}}}),ee=new Vo({props:{anchor:"transformers.NemotronForTokenClassification.forward.example",$$slots:{default:[Vn]},$$scope:{ctx:k}}}),Ye=new qn({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/nemotron.md"}}),{c(){r=i("meta"),T=s(),c=i("p"),y=s(),p(M.$$.fragment),b=s(),p(C.$$.fragment),wt=s(),p(ne.$$.fragment),Mt=s(),se=i("p"),se.innerHTML=Oo,$t=s(),p(ae.$$.fragment),Ct=s(),re=i("p"),re.innerHTML=Yo,Nt=s(),ie=i("p"),ie.innerHTML=Do,zt=s(),p(le.$$.fragment),xt=s(),de=i("p"),de.innerHTML=Ko,Jt=s(),p(ce.$$.fragment),Ft=s(),me=i("p"),me.innerHTML=en,It=s(),pe=i("p"),pe.innerHTML=tn,Ut=s(),p(he.$$.fragment),jt=s(),p(ue.$$.fragment),Lt=s(),fe=i("p"),fe.innerHTML=on,Bt=s(),ge=i("p"),ge.innerHTML=nn,Wt=s(),_e=i("p"),_e.textContent=sn,Ht=s(),p(be.$$.fragment),Zt=s(),ye=i("p"),ye.textContent=an,Pt=s(),p(Te.$$.fragment),qt=s(),p(ve.$$.fragment),Gt=s(),ke=i("p"),ke.innerHTML=rn,St=s(),p(we.$$.fragment),At=s(),Me=i("p"),Me.innerHTML=ln,Rt=s(),$e=i("table"),$e.innerHTML=dn,Qt=s(),Ce=i("p"),Ce.innerHTML=cn,Xt=s(),Ne=i("table"),Ne.innerHTML=mn,Et=s(),ze=i("p"),ze.innerHTML=pn,Vt=s(),xe=i("table"),xe.innerHTML=hn,Ot=s(),Je=i("p"),Je.innerHTML=un,Yt=s(),p(Fe.$$.fragment),Dt=s(),Ie=i("p"),Ie.textContent=fn,Kt=s(),p(Ue.$$.fragment),eo=s(),p(je.$$.fragment),to=s(),B=i("div"),p(Le.$$.fragment),go=s(),Ke=i("p"),Ke.innerHTML=gn,_o=s(),p(X.$$.fragment),oo=s(),p(Be.$$.fragment),no=s(),N=i("div"),p(We.$$.fragment),bo=s(),et=i("p"),et.innerHTML=_n,yo=s(),tt=i("p"),tt.innerHTML=bn,To=s(),ot=i("p"),ot.innerHTML=yn,vo=s(),Z=i("div"),p(He.$$.fragment),ko=s(),nt=i("p"),nt.innerHTML=Tn,wo=s(),p(E.$$.fragment),so=s(),p(Ze.$$.fragment),ao=s(),S=i("div"),p(Pe.$$.fragment),Mo=s(),j=i("div"),p(qe.$$.fragment),$o=s(),st=i("p"),st.innerHTML=vn,Co=s(),p(V.$$.fragment),No=s(),p(O.$$.fragment),ro=s(),p(Ge.$$.fragment),io=s(),v=i("div"),p(Se.$$.fragment),zo=s(),at=i("p"),at.textContent=kn,xo=s(),rt=i("p"),rt.innerHTML=wn,Jo=s(),it=i("p"),it.innerHTML=Mn,Fo=s(),lt=i("p"),lt.innerHTML=$n,Io=s(),dt=i("p"),dt.innerHTML=Cn,Uo=s(),P=i("div"),p(Ae.$$.fragment),jo=s(),ct=i("p"),ct.innerHTML=Nn,Lo=s(),p(Y.$$.fragment),lo=s(),p(Re.$$.fragment),co=s(),z=i("div"),p(Qe.$$.fragment),Bo=s(),mt=i("p"),mt.innerHTML=zn,Wo=s(),pt=i("p"),pt.innerHTML=xn,Ho=s(),ht=i("p"),ht.innerHTML=Jn,Zo=s(),q=i("div"),p(Xe.$$.fragment),Po=s(),ut=i("p"),ut.innerHTML=Fn,qo=s(),p(D.$$.fragment),mo=s(),p(Ee.$$.fragment),po=s(),x=i("div"),p(Ve.$$.fragment),Go=s(),ft=i("p"),ft.textContent=In,So=s(),gt=i("p"),gt.innerHTML=Un,Ao=s(),_t=i("p"),_t.innerHTML=jn,Ro=s(),L=i("div"),p(Oe.$$.fragment),Qo=s(),bt=i("p"),bt.innerHTML=Ln,Xo=s(),p(K.$$.fragment),Eo=s(),p(ee.$$.fragment),ho=s(),p(Ye.$$.fragment),uo=s(),Tt=i("p"),this.h()},l(e){const t=Pn("svelte-u9bgzb",document.head);r=l(t,"META",{name:!0,content:!0}),t.forEach(o),T=a(e),c=l(e,"P",{}),I(c).forEach(o),y=a(e),h(M.$$.fragment,e),b=a(e),h(C.$$.fragment,e),wt=a(e),h(ne.$$.fragment,e),Mt=a(e),se=l(e,"P",{"data-svelte-h":!0}),m(se)!=="svelte-5ltir7"&&(se.innerHTML=Oo),$t=a(e),h(ae.$$.fragment,e),Ct=a(e),re=l(e,"P",{"data-svelte-h":!0}),m(re)!=="svelte-18vqkxz"&&(re.innerHTML=Yo),Nt=a(e),ie=l(e,"P",{"data-svelte-h":!0}),m(ie)!=="svelte-1inbdxl"&&(ie.innerHTML=Do),zt=a(e),h(le.$$.fragment,e),xt=a(e),de=l(e,"P",{"data-svelte-h":!0}),m(de)!=="svelte-eh2pqk"&&(de.innerHTML=Ko),Jt=a(e),h(ce.$$.fragment,e),Ft=a(e),me=l(e,"P",{"data-svelte-h":!0}),m(me)!=="svelte-1afrym1"&&(me.innerHTML=en),It=a(e),pe=l(e,"P",{"data-svelte-h":!0}),m(pe)!=="svelte-8mone6"&&(pe.innerHTML=tn),Ut=a(e),h(he.$$.fragment,e),jt=a(e),h(ue.$$.fragment,e),Lt=a(e),fe=l(e,"P",{"data-svelte-h":!0}),m(fe)!=="svelte-6qg38c"&&(fe.innerHTML=on),Bt=a(e),ge=l(e,"P",{"data-svelte-h":!0}),m(ge)!=="svelte-nugv14"&&(ge.innerHTML=nn),Wt=a(e),_e=l(e,"P",{"data-svelte-h":!0}),m(_e)!=="svelte-1890ku0"&&(_e.textContent=sn),Ht=a(e),h(be.$$.fragment,e),Zt=a(e),ye=l(e,"P",{"data-svelte-h":!0}),m(ye)!=="svelte-1ltrinh"&&(ye.textContent=an),Pt=a(e),h(Te.$$.fragment,e),qt=a(e),h(ve.$$.fragment,e),Gt=a(e),ke=l(e,"P",{"data-svelte-h":!0}),m(ke)!=="svelte-1smp3z2"&&(ke.innerHTML=rn),St=a(e),h(we.$$.fragment,e),At=a(e),Me=l(e,"P",{"data-svelte-h":!0}),m(Me)!=="svelte-1jomx29"&&(Me.innerHTML=ln),Rt=a(e),$e=l(e,"TABLE",{"data-svelte-h":!0}),m($e)!=="svelte-rg1rpw"&&($e.innerHTML=dn),Qt=a(e),Ce=l(e,"P",{"data-svelte-h":!0}),m(Ce)!=="svelte-tkg6bs"&&(Ce.innerHTML=cn),Xt=a(e),Ne=l(e,"TABLE",{"data-svelte-h":!0}),m(Ne)!=="svelte-kgjah5"&&(Ne.innerHTML=mn),Et=a(e),ze=l(e,"P",{"data-svelte-h":!0}),m(ze)!=="svelte-oe9pwo"&&(ze.innerHTML=pn),Vt=a(e),xe=l(e,"TABLE",{"data-svelte-h":!0}),m(xe)!=="svelte-xb08ow"&&(xe.innerHTML=hn),Ot=a(e),Je=l(e,"P",{"data-svelte-h":!0}),m(Je)!=="svelte-lze01h"&&(Je.innerHTML=un),Yt=a(e),h(Fe.$$.fragment,e),Dt=a(e),Ie=l(e,"P",{"data-svelte-h":!0}),m(Ie)!=="svelte-1viguyj"&&(Ie.textContent=fn),Kt=a(e),h(Ue.$$.fragment,e),eo=a(e),h(je.$$.fragment,e),to=a(e),B=l(e,"DIV",{class:!0});var A=I(B);h(Le.$$.fragment,A),go=a(A),Ke=l(A,"P",{"data-svelte-h":!0}),m(Ke)!=="svelte-3yf1ba"&&(Ke.innerHTML=gn),_o=a(A),h(X.$$.fragment,A),A.forEach(o),oo=a(e),h(Be.$$.fragment,e),no=a(e),N=l(e,"DIV",{class:!0});var J=I(N);h(We.$$.fragment,J),bo=a(J),et=l(J,"P",{"data-svelte-h":!0}),m(et)!=="svelte-1knmubw"&&(et.innerHTML=_n),yo=a(J),tt=l(J,"P",{"data-svelte-h":!0}),m(tt)!=="svelte-hswkmf"&&(tt.innerHTML=bn),To=a(J),ot=l(J,"P",{"data-svelte-h":!0}),m(ot)!=="svelte-996czx"&&(ot.innerHTML=yn),vo=a(J),Z=l(J,"DIV",{class:!0});var R=I(Z);h(He.$$.fragment,R),ko=a(R),nt=l(R,"P",{"data-svelte-h":!0}),m(nt)!=="svelte-b4c7fd"&&(nt.innerHTML=Tn),wo=a(R),h(E.$$.fragment,R),R.forEach(o),J.forEach(o),so=a(e),h(Ze.$$.fragment,e),ao=a(e),S=l(e,"DIV",{class:!0});var De=I(S);h(Pe.$$.fragment,De),Mo=a(De),j=l(De,"DIV",{class:!0});var W=I(j);h(qe.$$.fragment,W),$o=a(W),st=l(W,"P",{"data-svelte-h":!0}),m(st)!=="svelte-1txhibh"&&(st.innerHTML=vn),Co=a(W),h(V.$$.fragment,W),No=a(W),h(O.$$.fragment,W),W.forEach(o),De.forEach(o),ro=a(e),h(Ge.$$.fragment,e),io=a(e),v=l(e,"DIV",{class:!0});var $=I(v);h(Se.$$.fragment,$),zo=a($),at=l($,"P",{"data-svelte-h":!0}),m(at)!=="svelte-7mvho4"&&(at.textContent=kn),xo=a($),rt=l($,"P",{"data-svelte-h":!0}),m(rt)!=="svelte-1beijmg"&&(rt.innerHTML=wn),Jo=a($),it=l($,"P",{"data-svelte-h":!0}),m(it)!=="svelte-10ugs3m"&&(it.innerHTML=Mn),Fo=a($),lt=l($,"P",{"data-svelte-h":!0}),m(lt)!=="svelte-6pahdo"&&(lt.innerHTML=$n),Io=a($),dt=l($,"P",{"data-svelte-h":!0}),m(dt)!=="svelte-hswkmf"&&(dt.innerHTML=Cn),Uo=a($),P=l($,"DIV",{class:!0});var Q=I(P);h(Ae.$$.fragment,Q),jo=a(Q),ct=l(Q,"P",{"data-svelte-h":!0}),m(ct)!=="svelte-zg30gx"&&(ct.innerHTML=Nn),Lo=a(Q),h(Y.$$.fragment,Q),Q.forEach(o),$.forEach(o),lo=a(e),h(Re.$$.fragment,e),co=a(e),z=l(e,"DIV",{class:!0});var F=I(z);h(Qe.$$.fragment,F),Bo=a(F),mt=l(F,"P",{"data-svelte-h":!0}),m(mt)!=="svelte-1xev29k"&&(mt.innerHTML=zn),Wo=a(F),pt=l(F,"P",{"data-svelte-h":!0}),m(pt)!=="svelte-6pahdo"&&(pt.innerHTML=xn),Ho=a(F),ht=l(F,"P",{"data-svelte-h":!0}),m(ht)!=="svelte-hswkmf"&&(ht.innerHTML=Jn),Zo=a(F),q=l(F,"DIV",{class:!0});var yt=I(q);h(Xe.$$.fragment,yt),Po=a(yt),ut=l(yt,"P",{"data-svelte-h":!0}),m(ut)!=="svelte-13bjunr"&&(ut.innerHTML=Fn),qo=a(yt),h(D.$$.fragment,yt),yt.forEach(o),F.forEach(o),mo=a(e),h(Ee.$$.fragment,e),po=a(e),x=l(e,"DIV",{class:!0});var G=I(x);h(Ve.$$.fragment,G),Go=a(G),ft=l(G,"P",{"data-svelte-h":!0}),m(ft)!=="svelte-1vrynnl"&&(ft.textContent=In),So=a(G),gt=l(G,"P",{"data-svelte-h":!0}),m(gt)!=="svelte-6pahdo"&&(gt.innerHTML=Un),Ao=a(G),_t=l(G,"P",{"data-svelte-h":!0}),m(_t)!=="svelte-hswkmf"&&(_t.innerHTML=jn),Ro=a(G),L=l(G,"DIV",{class:!0});var te=I(L);h(Oe.$$.fragment,te),Qo=a(te),bt=l(te,"P",{"data-svelte-h":!0}),m(bt)!=="svelte-u14nut"&&(bt.innerHTML=Ln),Xo=a(te),h(K.$$.fragment,te),Eo=a(te),h(ee.$$.fragment,te),te.forEach(o),G.forEach(o),ho=a(e),h(Ye.$$.fragment,e),uo=a(e),Tt=l(e,"P",{}),I(Tt).forEach(o),this.h()},h(){U(r,"name","hf:doc:metadata"),U(r,"content",Yn),U(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(x,"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){d(document.head,r),n(e,T,t),n(e,c,t),n(e,y,t),u(M,e,t),n(e,b,t),u(C,e,t),n(e,wt,t),u(ne,e,t),n(e,Mt,t),n(e,se,t),n(e,$t,t),u(ae,e,t),n(e,Ct,t),n(e,re,t),n(e,Nt,t),n(e,ie,t),n(e,zt,t),u(le,e,t),n(e,xt,t),n(e,de,t),n(e,Jt,t),u(ce,e,t),n(e,Ft,t),n(e,me,t),n(e,It,t),n(e,pe,t),n(e,Ut,t),u(he,e,t),n(e,jt,t),u(ue,e,t),n(e,Lt,t),n(e,fe,t),n(e,Bt,t),n(e,ge,t),n(e,Wt,t),n(e,_e,t),n(e,Ht,t),u(be,e,t),n(e,Zt,t),n(e,ye,t),n(e,Pt,t),u(Te,e,t),n(e,qt,t),u(ve,e,t),n(e,Gt,t),n(e,ke,t),n(e,St,t),u(we,e,t),n(e,At,t),n(e,Me,t),n(e,Rt,t),n(e,$e,t),n(e,Qt,t),n(e,Ce,t),n(e,Xt,t),n(e,Ne,t),n(e,Et,t),n(e,ze,t),n(e,Vt,t),n(e,xe,t),n(e,Ot,t),n(e,Je,t),n(e,Yt,t),u(Fe,e,t),n(e,Dt,t),n(e,Ie,t),n(e,Kt,t),u(Ue,e,t),n(e,eo,t),u(je,e,t),n(e,to,t),n(e,B,t),u(Le,B,null),d(B,go),d(B,Ke),d(B,_o),u(X,B,null),n(e,oo,t),u(Be,e,t),n(e,no,t),n(e,N,t),u(We,N,null),d(N,bo),d(N,et),d(N,yo),d(N,tt),d(N,To),d(N,ot),d(N,vo),d(N,Z),u(He,Z,null),d(Z,ko),d(Z,nt),d(Z,wo),u(E,Z,null),n(e,so,t),u(Ze,e,t),n(e,ao,t),n(e,S,t),u(Pe,S,null),d(S,Mo),d(S,j),u(qe,j,null),d(j,$o),d(j,st),d(j,Co),u(V,j,null),d(j,No),u(O,j,null),n(e,ro,t),u(Ge,e,t),n(e,io,t),n(e,v,t),u(Se,v,null),d(v,zo),d(v,at),d(v,xo),d(v,rt),d(v,Jo),d(v,it),d(v,Fo),d(v,lt),d(v,Io),d(v,dt),d(v,Uo),d(v,P),u(Ae,P,null),d(P,jo),d(P,ct),d(P,Lo),u(Y,P,null),n(e,lo,t),u(Re,e,t),n(e,co,t),n(e,z,t),u(Qe,z,null),d(z,Bo),d(z,mt),d(z,Wo),d(z,pt),d(z,Ho),d(z,ht),d(z,Zo),d(z,q),u(Xe,q,null),d(q,Po),d(q,ut),d(q,qo),u(D,q,null),n(e,mo,t),u(Ee,e,t),n(e,po,t),n(e,x,t),u(Ve,x,null),d(x,Go),d(x,ft),d(x,So),d(x,gt),d(x,Ao),d(x,_t),d(x,Ro),d(x,L),u(Oe,L,null),d(L,Qo),d(L,bt),d(L,Xo),u(K,L,null),d(L,Eo),u(ee,L,null),n(e,ho,t),u(Ye,e,t),n(e,uo,t),n(e,Tt,t),fo=!0},p(e,[t]){const A={};t&2&&(A.$$scope={dirty:t,ctx:e}),X.$set(A);const J={};t&2&&(J.$$scope={dirty:t,ctx:e}),E.$set(J);const R={};t&2&&(R.$$scope={dirty:t,ctx:e}),V.$set(R);const De={};t&2&&(De.$$scope={dirty:t,ctx:e}),O.$set(De);const W={};t&2&&(W.$$scope={dirty:t,ctx:e}),Y.$set(W);const $={};t&2&&($.$$scope={dirty:t,ctx:e}),D.$set($);const Q={};t&2&&(Q.$$scope={dirty:t,ctx:e}),K.$set(Q);const F={};t&2&&(F.$$scope={dirty:t,ctx:e}),ee.$set(F)},i(e){fo||(f(M.$$.fragment,e),f(C.$$.fragment,e),f(ne.$$.fragment,e),f(ae.$$.fragment,e),f(le.$$.fragment,e),f(ce.$$.fragment,e),f(he.$$.fragment,e),f(ue.$$.fragment,e),f(be.$$.fragment,e),f(Te.$$.fragment,e),f(ve.$$.fragment,e),f(we.$$.fragment,e),f(Fe.$$.fragment,e),f(Ue.$$.fragment,e),f(je.$$.fragment,e),f(Le.$$.fragment,e),f(X.$$.fragment,e),f(Be.$$.fragment,e),f(We.$$.fragment,e),f(He.$$.fragment,e),f(E.$$.fragment,e),f(Ze.$$.fragment,e),f(Pe.$$.fragment,e),f(qe.$$.fragment,e),f(V.$$.fragment,e),f(O.$$.fragment,e),f(Ge.$$.fragment,e),f(Se.$$.fragment,e),f(Ae.$$.fragment,e),f(Y.$$.fragment,e),f(Re.$$.fragment,e),f(Qe.$$.fragment,e),f(Xe.$$.fragment,e),f(D.$$.fragment,e),f(Ee.$$.fragment,e),f(Ve.$$.fragment,e),f(Oe.$$.fragment,e),f(K.$$.fragment,e),f(ee.$$.fragment,e),f(Ye.$$.fragment,e),fo=!0)},o(e){g(M.$$.fragment,e),g(C.$$.fragment,e),g(ne.$$.fragment,e),g(ae.$$.fragment,e),g(le.$$.fragment,e),g(ce.$$.fragment,e),g(he.$$.fragment,e),g(ue.$$.fragment,e),g(be.$$.fragment,e),g(Te.$$.fragment,e),g(ve.$$.fragment,e),g(we.$$.fragment,e),g(Fe.$$.fragment,e),g(Ue.$$.fragment,e),g(je.$$.fragment,e),g(Le.$$.fragment,e),g(X.$$.fragment,e),g(Be.$$.fragment,e),g(We.$$.fragment,e),g(He.$$.fragment,e),g(E.$$.fragment,e),g(Ze.$$.fragment,e),g(Pe.$$.fragment,e),g(qe.$$.fragment,e),g(V.$$.fragment,e),g(O.$$.fragment,e),g(Ge.$$.fragment,e),g(Se.$$.fragment,e),g(Ae.$$.fragment,e),g(Y.$$.fragment,e),g(Re.$$.fragment,e),g(Qe.$$.fragment,e),g(Xe.$$.fragment,e),g(D.$$.fragment,e),g(Ee.$$.fragment,e),g(Ve.$$.fragment,e),g(Oe.$$.fragment,e),g(K.$$.fragment,e),g(ee.$$.fragment,e),g(Ye.$$.fragment,e),fo=!1},d(e){e&&(o(T),o(c),o(y),o(b),o(wt),o(Mt),o(se),o($t),o(Ct),o(re),o(Nt),o(ie),o(zt),o(xt),o(de),o(Jt),o(Ft),o(me),o(It),o(pe),o(Ut),o(jt),o(Lt),o(fe),o(Bt),o(ge),o(Wt),o(_e),o(Ht),o(Zt),o(ye),o(Pt),o(qt),o(Gt),o(ke),o(St),o(At),o(Me),o(Rt),o($e),o(Qt),o(Ce),o(Xt),o(Ne),o(Et),o(ze),o(Vt),o(xe),o(Ot),o(Je),o(Yt),o(Dt),o(Ie),o(Kt),o(eo),o(to),o(B),o(oo),o(no),o(N),o(so),o(ao),o(S),o(ro),o(io),o(v),o(lo),o(co),o(z),o(mo),o(po),o(x),o(ho),o(uo),o(Tt)),o(r),_(M,e),_(C,e),_(ne,e),_(ae,e),_(le,e),_(ce,e),_(he,e),_(ue,e),_(be,e),_(Te,e),_(ve,e),_(we,e),_(Fe,e),_(Ue,e),_(je,e),_(Le),_(X),_(Be,e),_(We),_(He),_(E),_(Ze,e),_(Pe),_(qe),_(V),_(O),_(Ge,e),_(Se),_(Ae),_(Y),_(Re,e),_(Qe),_(Xe),_(D),_(Ee,e),_(Ve),_(Oe),_(K),_(ee),_(Ye,e)}}}const Yn='{"title":"Nemotron","local":"nemotron","sections":[{"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}],"depth":2},{"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 Dn(k){return Wn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class rs extends Hn{constructor(r){super(),Zn(this,r,Dn,On,Bn,{})}}export{rs as component};
