import{S as ri,i as li,s as ii,e as n,k as h,w as M,t as r,M as di,c as s,d as o,m,a,x as v,h as l,b as c,G as e,g as _,y as T,q as w,o as k,B as $,v as ci,L as so}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ko}from"../../chunks/Tip-hf-doc-builder.js";import{D as A}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ao}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as We}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as no}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function pi(C){let d,y,f,u,b;return u=new ao({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1wdENvbmZpZyUyQyUyME1wdE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyME1wdCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwTXB0Q29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyME1wdE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MptConfig, MptModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Mpt configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = MptConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MptModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){d=n("p"),y=r("Example:"),f=h(),M(u.$$.fragment)},l(i){d=s(i,"P",{});var p=a(d);y=l(p,"Example:"),p.forEach(o),f=m(i),v(u.$$.fragment,i)},m(i,p){_(i,d,p),e(d,y),_(i,f,p),T(u,i,p),b=!0},p:so,i(i){b||(w(u.$$.fragment,i),b=!0)},o(i){k(u.$$.fragment,i),b=!1},d(i){i&&o(d),i&&o(f),$(u,i)}}}function hi(C){let d,y,f,u,b;return{c(){d=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),u=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=s(i,"P",{});var p=a(d);y=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(p,"CODE",{});var j=a(f);u=l(j,"Module"),j.forEach(o),b=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(i,p){_(i,d,p),e(d,y),e(d,f),e(f,u),e(d,b)},d(i){i&&o(d)}}}function mi(C){let d,y,f,u,b;return u=new ao({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNcHRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybW9zYWljbWwlMkZtcHQtN2IlMjIpJTBBbW9kZWwlMjAlM0QlMjBNcHRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybW9zYWljbWwlMkZtcHQtN2IlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MptModel
<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;mosaicml/mpt-7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MptModel.from_pretrained(<span class="hljs-string">&quot;mosaicml/mpt-7b&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=n("p"),y=r("Example:"),f=h(),M(u.$$.fragment)},l(i){d=s(i,"P",{});var p=a(d);y=l(p,"Example:"),p.forEach(o),f=m(i),v(u.$$.fragment,i)},m(i,p){_(i,d,p),e(d,y),_(i,f,p),T(u,i,p),b=!0},p:so,i(i){b||(w(u.$$.fragment,i),b=!0)},o(i){k(u.$$.fragment,i),b=!1},d(i){i&&o(d),i&&o(f),$(u,i)}}}function ui(C){let d,y,f,u,b;return{c(){d=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),u=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=s(i,"P",{});var p=a(d);y=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(p,"CODE",{});var j=a(f);u=l(j,"Module"),j.forEach(o),b=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(i,p){_(i,d,p),e(d,y),e(d,f),e(f,u),e(d,b)},d(i){i&&o(d)}}}function fi(C){let d,y,f,u,b;return u=new ao({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME1wdEZvckNhdXNhbExNJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybW9zYWljbWwlMkZtcHQtN2IlMjIpJTBBbW9kZWwlMjAlM0QlMjBNcHRGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIybW9zYWljbWwlMkZtcHQtN2IlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCklMEFsb3NzJTIwJTNEJTIwb3V0cHV0cy5sb3NzJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MptForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;mosaicml/mpt-7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MptForCausalLM.from_pretrained(<span class="hljs-string">&quot;mosaicml/mpt-7b&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=n("p"),y=r("Example:"),f=h(),M(u.$$.fragment)},l(i){d=s(i,"P",{});var p=a(d);y=l(p,"Example:"),p.forEach(o),f=m(i),v(u.$$.fragment,i)},m(i,p){_(i,d,p),e(d,y),_(i,f,p),T(u,i,p),b=!0},p:so,i(i){b||(w(u.$$.fragment,i),b=!0)},o(i){k(u.$$.fragment,i),b=!1},d(i){i&&o(d),i&&o(f),$(u,i)}}}function gi(C){let d,y,f,u,b;return{c(){d=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),u=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=s(i,"P",{});var p=a(d);y=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(p,"CODE",{});var j=a(f);u=l(j,"Module"),j.forEach(o),b=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(i,p){_(i,d,p),e(d,y),e(d,f),e(f,u),e(d,b)},d(i){i&&o(d)}}}function _i(C){let d,y,f,u,b;return u=new ao({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME1wdEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJtb3NhaWNtbCUyRm1wdC03YiUyMiklMEFtb2RlbCUyMCUzRCUyME1wdEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1vc2FpY21sJTJGbXB0LTdiJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF9jbGFzc19pZCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoKS5pdGVtKCklMEElMEElMjMlMjBUbyUyMHRyYWluJTIwYSUyMG1vZGVsJTIwb24lMjAlNjBudW1fbGFiZWxzJTYwJTIwY2xhc3NlcyUyQyUyMHlvdSUyMGNhbiUyMHBhc3MlMjAlNjBudW1fbGFiZWxzJTNEbnVtX2xhYmVscyU2MCUyMHRvJTIwJTYwLmZyb21fcHJldHJhaW5lZCguLi4pJTYwJTBBbnVtX2xhYmVscyUyMCUzRCUyMGxlbihtb2RlbC5jb25maWcuaWQybGFiZWwpJTBBbW9kZWwlMjAlM0QlMjBNcHRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJtb3NhaWNtbCUyRm1wdC03YiUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MptForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;mosaicml/mpt-7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MptForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;mosaicml/mpt-7b&quot;</span>)

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MptForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;mosaicml/mpt-7b&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=n("p"),y=r("Example of single-label classification:"),f=h(),M(u.$$.fragment)},l(i){d=s(i,"P",{});var p=a(d);y=l(p,"Example of single-label classification:"),p.forEach(o),f=m(i),v(u.$$.fragment,i)},m(i,p){_(i,d,p),e(d,y),_(i,f,p),T(u,i,p),b=!0},p:so,i(i){b||(w(u.$$.fragment,i),b=!0)},o(i){k(u.$$.fragment,i),b=!1},d(i){i&&o(d),i&&o(f),$(u,i)}}}function bi(C){let d,y,f,u,b;return u=new ao({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME1wdEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJtb3NhaWNtbCUyRm1wdC03YiUyMiklMEFtb2RlbCUyMCUzRCUyME1wdEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1vc2FpY21sJTJGbXB0LTdiJTIyJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkcyUyMCUzRCUyMHRvcmNoLmFyYW5nZSgwJTJDJTIwbG9naXRzLnNoYXBlJTVCLTElNUQpJTVCdG9yY2guc2lnbW9pZChsb2dpdHMpLnNxdWVlemUoZGltJTNEMCklMjAlM0UlMjAwLjUlNUQlMEElMEElMjMlMjBUbyUyMHRyYWluJTIwYSUyMG1vZGVsJTIwb24lMjAlNjBudW1fbGFiZWxzJTYwJTIwY2xhc3NlcyUyQyUyMHlvdSUyMGNhbiUyMHBhc3MlMjAlNjBudW1fbGFiZWxzJTNEbnVtX2xhYmVscyU2MCUyMHRvJTIwJTYwLmZyb21fcHJldHJhaW5lZCguLi4pJTYwJTBBbnVtX2xhYmVscyUyMCUzRCUyMGxlbihtb2RlbC5jb25maWcuaWQybGFiZWwpJTBBbW9kZWwlMjAlM0QlMjBNcHRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJtb3NhaWNtbCUyRm1wdC03YiUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MptForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;mosaicml/mpt-7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MptForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;mosaicml/mpt-7b&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MptForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;mosaicml/mpt-7b&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=n("p"),y=r("Example of multi-label classification:"),f=h(),M(u.$$.fragment)},l(i){d=s(i,"P",{});var p=a(d);y=l(p,"Example of multi-label classification:"),p.forEach(o),f=m(i),v(u.$$.fragment,i)},m(i,p){_(i,d,p),e(d,y),_(i,f,p),T(u,i,p),b=!0},p:so,i(i){b||(w(u.$$.fragment,i),b=!0)},o(i){k(u.$$.fragment,i),b=!1},d(i){i&&o(d),i&&o(f),$(u,i)}}}function yi(C){let d,y,f,u,b;return{c(){d=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),u=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=s(i,"P",{});var p=a(d);y=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(p,"CODE",{});var j=a(f);u=l(j,"Module"),j.forEach(o),b=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(i,p){_(i,d,p),e(d,y),e(d,f),e(f,u),e(d,b)},d(i){i&&o(d)}}}function Mi(C){let d,y,f,u,b;return u=new ao({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNcHRGb3JUb2tlbkNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJtb3NhaWNtbCUyRm1wdC03YiUyMiklMEFtb2RlbCUyMCUzRCUyME1wdEZvclRva2VuQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1vc2FpY21sJTJGbXB0LTdiJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlMjJIdWdnaW5nRmFjZSUyMGlzJTIwYSUyMGNvbXBhbnklMjBiYXNlZCUyMGluJTIwUGFyaXMlMjBhbmQlMjBOZXclMjBZb3JrJTIyJTJDJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNERmFsc2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTBBKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpJTBBJTBBJTIzJTIwTm90ZSUyMHRoYXQlMjB0b2tlbnMlMjBhcmUlMjBjbGFzc2lmaWVkJTIwcmF0aGVyJTIwdGhlbiUyMGlucHV0JTIwd29yZHMlMjB3aGljaCUyMG1lYW5zJTIwdGhhdCUwQSUyMyUyMHRoZXJlJTIwbWlnaHQlMjBiZSUyMG1vcmUlMjBwcmVkaWN0ZWQlMjB0b2tlbiUyMGNsYXNzZXMlMjB0aGFuJTIwd29yZHMuJTBBJTIzJTIwTXVsdGlwbGUlMjB0b2tlbiUyMGNsYXNzZXMlMjBtaWdodCUyMGFjY291bnQlMjBmb3IlMjB0aGUlMjBzYW1lJTIwd29yZCUwQXByZWRpY3RlZF90b2tlbnNfY2xhc3NlcyUyMCUzRCUyMCU1Qm1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnQuaXRlbSgpJTVEJTIwZm9yJTIwdCUyMGluJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyU1QjAlNUQlNUQlMEElMEFsYWJlbHMlMjAlM0QlMjBwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTBBbG9zcyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKS5sb3Nz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MptForTokenClassification
<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;mosaicml/mpt-7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MptForTokenClassification.from_pretrained(<span class="hljs-string">&quot;mosaicml/mpt-7b&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`}}),{c(){d=n("p"),y=r("Example:"),f=h(),M(u.$$.fragment)},l(i){d=s(i,"P",{});var p=a(d);y=l(p,"Example:"),p.forEach(o),f=m(i),v(u.$$.fragment,i)},m(i,p){_(i,d,p),e(d,y),_(i,f,p),T(u,i,p),b=!0},p:so,i(i){b||(w(u.$$.fragment,i),b=!0)},o(i){k(u.$$.fragment,i),b=!1},d(i){i&&o(d),i&&o(f),$(u,i)}}}function vi(C){let d,y,f,u,b;return{c(){d=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),u=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=s(i,"P",{});var p=a(d);y=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(p,"CODE",{});var j=a(f);u=l(j,"Module"),j.forEach(o),b=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(i,p){_(i,d,p),e(d,y),e(d,f),e(f,u),e(d,b)},d(i){i&&o(d)}}}function Ti(C){let d,y,f,u,b,i,p,j,Bn,en,H,he,ro,Pe,An,lo,Zn,tn,me,Gn,qe,Rn,Xn,on,Ct,Sn,nn,Z,io,Vn,Ln,co,Qn,Yn,po,Hn,sn,ue,On,Be,ho,Dn,Kn,an,Ae,es,Ze,ts,rn,jt,os,ln,G,mo,Et,ns,Ge,ss,as,uo,O,rs,fo,ls,is,go,ds,cs,ps,_o,Jt,Re,hs,ms,dn,D,fe,bo,Xe,us,yo,fs,cn,I,Se,gs,K,_s,zt,bs,ys,Ve,Ms,vs,Ts,ee,ws,Ft,ks,$s,Ut,Cs,js,Es,ge,pn,te,_e,Mo,Le,Js,vo,zs,hn,J,Qe,Fs,To,Us,Ns,Ye,xs,Nt,Is,Ws,Ps,He,qs,Oe,Bs,As,Zs,P,De,Gs,oe,Rs,xt,Xs,Ss,wo,Vs,Ls,Qs,be,Ys,ye,mn,ne,Me,ko,Ke,Hs,$o,Os,un,z,et,Ds,Co,Ks,ea,tt,ta,It,oa,na,sa,ot,aa,nt,ra,la,ia,q,st,da,se,ca,Wt,pa,ha,jo,ma,ua,fa,ve,ga,Te,fn,ae,we,Eo,at,_a,Jo,ba,gn,E,rt,ya,zo,Ma,va,Pt,qt,Ta,wa,ka,W,$a,Fo,Ca,ja,Uo,Ea,Ja,No,za,Fa,xo,Ua,Na,xa,lt,Ia,Bt,Wa,Pa,qa,it,Ba,dt,Aa,Za,Ga,N,ct,Ra,re,Xa,At,Sa,Va,Io,La,Qa,Ya,ke,Ha,$e,Oa,Ce,_n,le,je,Wo,pt,Da,Po,Ka,bn,F,ht,er,qo,tr,or,mt,nr,Zt,sr,ar,rr,ut,lr,ft,ir,dr,cr,B,gt,pr,ie,hr,Gt,mr,ur,Bo,fr,gr,_r,Ee,br,Je,yn,de,ze,Ao,_t,yr,Zo,Mr,Mn,U,bt,vr,ce,Tr,Go,wr,kr,Ro,$r,Cr,jr,yt,Er,Rt,Jr,zr,Fr,Mt,Ur,vt,Nr,xr,Ir,R,Tt,Wr,pe,Pr,Xt,qr,Br,Xo,Ar,Zr,Gr,Fe,vn;return i=new We({}),Pe=new We({}),Xe=new We({}),Se=new A({props:{name:"class transformers.MptConfig",anchor:"transformers.MptConfig",parameters:[{name:"d_model",val:": int = 2048"},{name:"n_heads",val:": int = 16"},{name:"n_layers",val:": int = 24"},{name:"expansion_ratio",val:": int = 4"},{name:"max_seq_len",val:": int = 2048"},{name:"vocab_size",val:": int = 50368"},{name:"resid_pdrop",val:": float = 0.0"},{name:"layer_norm_epsilon",val:": float = 1e-05"},{name:"emb_pdrop",val:": float = 0.0"},{name:"learned_pos_emb",val:": bool = True"},{name:"attn_config",val:": MptAttentionConfig = None"},{name:"init_device",val:": str = 'cpu'"},{name:"logit_scale",val:": typing.Union[float, str, NoneType] = None"},{name:"no_bias",val:": bool = True"},{name:"verbose",val:": int = 0"},{name:"embedding_fraction",val:": float = 1.0"},{name:"norm_type",val:": str = 'low_precision_layernorm'"},{name:"use_cache",val:": bool = False"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MptConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimensionality of the embeddings and hidden states.`,name:"d_model"},{anchor:"transformers.MptConfig.n_heads",description:`<strong>n_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"n_heads"},{anchor:"transformers.MptConfig.n_layers",description:`<strong>n_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"n_layers"},{anchor:"transformers.MptConfig.expansion_ratio",description:`<strong>expansion_ratio</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The ratio of the up/down scale in the MLP.`,name:"expansion_ratio"},{anchor:"transformers.MptConfig.max_seq_len",description:`<strong>max_seq_len</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
The maximum sequence length of the model.`,name:"max_seq_len"},{anchor:"transformers.MptConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50368) &#x2014;
Vocabulary size of the Mpt model. Defines the maximum number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptModel">MptModel</a>. Check <a href="https://huggingface.co/bigscience/mpt/discussions/120#633d28389addb8530b406c2a" rel="nofollow">this
discussion</a> on how the
<code>vocab_size</code> has been defined.`,name:"vocab_size"},{anchor:"transformers.MptConfig.resid_pdrop",description:`<strong>resid_pdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability applied to the attention output before combining with residual.`,name:"resid_pdrop"},{anchor:"transformers.MptConfig.layer_norm_epsilon",description:`<strong>layer_norm_epsilon</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon to use in the layer normalization layers.`,name:"layer_norm_epsilon"},{anchor:"transformers.MptConfig.emb_pdrop",description:`<strong>emb_pdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for the embedding layer.`,name:"emb_pdrop"},{anchor:"transformers.MptConfig.learned_pos_emb",description:`<strong>learned_pos_emb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use learned positional embeddings.`,name:"learned_pos_emb"},{anchor:"transformers.MptConfig.attn_config",description:`<strong>attn_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A dictionary used to configure the model&#x2019;s attention module.`,name:"attn_config"},{anchor:"transformers.MptConfig.init_device",description:`<strong>init_device</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The device to use for parameter initialization. Defined for backward compatibility`,name:"init_device"},{anchor:"transformers.MptConfig.logit_scale",description:`<strong>logit_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
If not None, scale the logits by this value.`,name:"logit_scale"},{anchor:"transformers.MptConfig.no_bias",description:`<strong>no_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use bias in all linear layers.`,name:"no_bias"},{anchor:"transformers.MptConfig.verbose",description:`<strong>verbose</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The verbosity level to use for logging. Used in the previous versions of MPT models for logging. This
argument is deprecated.`,name:"verbose"},{anchor:"transformers.MptConfig.embedding_fraction",description:`<strong>embedding_fraction</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The fraction to scale the gradients of the embedding layer by.`,name:"embedding_fraction"},{anchor:"transformers.MptConfig.norm_type",description:`<strong>norm_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;low_precision_layernorm&quot;</code>) &#x2014;
Type of layer norm to use. All MPT models uses the same layer norm implementation. Defined for backward
compatibility.`,name:"norm_type"},{anchor:"transformers.MptConfig.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).`,name:"use_cache"},{anchor:"transformers.MptConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mpt/configuration_mpt.py#L121"}}),ge=new no({props:{anchor:"transformers.MptConfig.example",$$slots:{default:[pi]},$$scope:{ctx:C}}}),Le=new We({}),Qe=new A({props:{name:"class transformers.MptModel",anchor:"transformers.MptModel",parameters:[{name:"config",val:": MptConfig"}],parametersDescription:[{anchor:"transformers.MptModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptConfig">MptConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mpt/modeling_mpt.py#L390"}}),De=new A({props:{name:"forward",anchor:"transformers.MptModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[torch.Tensor, torch.Tensor], ...], NoneType] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",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.MptModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else <code>past_key_values[0][0].shape[2]</code>
(<code>sequence_length</code> of input past key value states). Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MptModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.</p>
<p>Each element of <code>past_key_values</code> is a tuple (past_key, past_value):</p>
<ul>
<li>past_key: [batch_size * num_heads, head_dim, kv_length]</li>
<li>past_value: [batch_size * num_heads, kv_length, head_dim]</li>
</ul>`,name:"past_key_values"},{anchor:"transformers.MptModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MptModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.MptModel.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.MptModel.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.MptModel.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.MptModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mpt/modeling_mpt.py#L450",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptConfig"
>MptConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),be=new Ko({props:{$$slots:{default:[hi]},$$scope:{ctx:C}}}),ye=new no({props:{anchor:"transformers.MptModel.forward.example",$$slots:{default:[mi]},$$scope:{ctx:C}}}),Ke=new We({}),et=new A({props:{name:"class transformers.MptForCausalLM",anchor:"transformers.MptForCausalLM",parameters:[{name:"config",val:": MptConfig"}],parametersDescription:[{anchor:"transformers.MptForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptConfig">MptConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mpt/modeling_mpt.py#L582"}}),st=new A({props:{name:"forward",anchor:"transformers.MptForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[torch.Tensor, torch.Tensor], ...], NoneType] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MptForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else <code>past_key_values[0][0].shape[2]</code>
(<code>sequence_length</code> of input past key value states). Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MptForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.</p>
<p>Each element of <code>past_key_values</code> is a tuple (past_key, past_value):</p>
<ul>
<li>past_key: [batch_size * num_heads, head_dim, kv_length]</li>
<li>past_value: [batch_size * num_heads, kv_length, head_dim]</li>
</ul>`,name:"past_key_values"},{anchor:"transformers.MptForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MptForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.MptForCausalLM.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.MptForCausalLM.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.MptForCausalLM.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.MptForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MptForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for language modeling. Note that the labels <strong>are shifted</strong> inside the model, i.e. you can set
<code>labels = input_ids</code> Indices are selected in <code>[-100, 0, ..., config.vocab_size]</code> All labels set to <code>-100</code>
are ignored (masked), the loss is only computed for labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mpt/modeling_mpt.py#L627",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptConfig"
>MptConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ve=new Ko({props:{$$slots:{default:[ui]},$$scope:{ctx:C}}}),Te=new no({props:{anchor:"transformers.MptForCausalLM.forward.example",$$slots:{default:[fi]},$$scope:{ctx:C}}}),at=new We({}),rt=new A({props:{name:"class transformers.MptForSequenceClassification",anchor:"transformers.MptForSequenceClassification",parameters:[{name:"config",val:": MptConfig"}],parametersDescription:[{anchor:"transformers.MptForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptConfig">MptConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mpt/modeling_mpt.py#L732"}}),ct=new A({props:{name:"forward",anchor:"transformers.MptForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[torch.Tensor, torch.Tensor], ...], NoneType] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MptForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else <code>past_key_values[0][0].shape[2]</code>
(<code>sequence_length</code> of input past key value states). Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MptForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.</p>
<p>Each element of <code>past_key_values</code> is a tuple (past_key, past_value):</p>
<ul>
<li>past_key: [batch_size * num_heads, head_dim, kv_length]</li>
<li>past_value: [batch_size * num_heads, kv_length, head_dim]</li>
</ul>`,name:"past_key_values"},{anchor:"transformers.MptForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MptForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.MptForSequenceClassification.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.MptForSequenceClassification.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.MptForSequenceClassification.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.MptForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MptForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mpt/modeling_mpt.py#L742",returnDescription:`
<p>A <code>transformers.modeling_outputs.SequenceClassifierOutputWithPast</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptConfig"
>MptConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_outputs.SequenceClassifierOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ke=new Ko({props:{$$slots:{default:[gi]},$$scope:{ctx:C}}}),$e=new no({props:{anchor:"transformers.MptForSequenceClassification.forward.example",$$slots:{default:[_i]},$$scope:{ctx:C}}}),Ce=new no({props:{anchor:"transformers.MptForSequenceClassification.forward.example-2",$$slots:{default:[bi]},$$scope:{ctx:C}}}),pt=new We({}),ht=new A({props:{name:"class transformers.MptForTokenClassification",anchor:"transformers.MptForTokenClassification",parameters:[{name:"config",val:": MptConfig"}],parametersDescription:[{anchor:"transformers.MptForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptConfig">MptConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mpt/modeling_mpt.py#L845"}}),gt=new A({props:{name:"forward",anchor:"transformers.MptForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[torch.Tensor, torch.Tensor], ...], NoneType] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"**deprecated_arguments",val:""}],parametersDescription:[{anchor:"transformers.MptForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else <code>past_key_values[0][0].shape[2]</code>
(<code>sequence_length</code> of input past key value states). Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MptForTokenClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.</p>
<p>Each element of <code>past_key_values</code> is a tuple (past_key, past_value):</p>
<ul>
<li>past_key: [batch_size * num_heads, head_dim, kv_length]</li>
<li>past_value: [batch_size * num_heads, kv_length, head_dim]</li>
</ul>`,name:"past_key_values"},{anchor:"transformers.MptForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MptForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.MptForTokenClassification.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.MptForTokenClassification.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.MptForTokenClassification.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.MptForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MptForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mpt/modeling_mpt.py#L863",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptConfig"
>MptConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ee=new Ko({props:{$$slots:{default:[yi]},$$scope:{ctx:C}}}),Je=new no({props:{anchor:"transformers.MptForTokenClassification.forward.example",$$slots:{default:[Mi]},$$scope:{ctx:C}}}),_t=new We({}),bt=new A({props:{name:"class transformers.MptForQuestionAnswering",anchor:"transformers.MptForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MptForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptConfig">MptConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mpt/modeling_mpt.py#L934"}}),Tt=new A({props:{name:"forward",anchor:"transformers.MptForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MptForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else <code>past_key_values[0][0].shape[2]</code>
(<code>sequence_length</code> of input past key value states). Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MptForQuestionAnswering.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.</p>
<p>Each element of <code>past_key_values</code> is a tuple (past_key, past_value):</p>
<ul>
<li>past_key: [batch_size * num_heads, head_dim, kv_length]</li>
<li>past_value: [batch_size * num_heads, kv_length, head_dim]</li>
</ul>`,name:"past_key_values"},{anchor:"transformers.MptForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MptForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.MptForQuestionAnswering.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.MptForQuestionAnswering.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.MptForQuestionAnswering.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.MptForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MptForQuestionAnswering.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.MptForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/mpt/modeling_mpt.py#L943"}}),Fe=new Ko({props:{$$slots:{default:[vi]},$$scope:{ctx:C}}}),{c(){d=n("meta"),y=h(),f=n("h1"),u=n("a"),b=n("span"),M(i.$$.fragment),p=h(),j=n("span"),Bn=r("MPT"),en=h(),H=n("h2"),he=n("a"),ro=n("span"),M(Pe.$$.fragment),An=h(),lo=n("span"),Zn=r("Overview"),tn=h(),me=n("p"),Gn=r("The MPT model was proposed by the "),qe=n("a"),Rn=r("MosaicML"),Xn=r(" team and released with multiple sizes and finetuned variants. The MPT models is a series of open source and commercially usable LLMs pre-trained on 1T tokens."),on=h(),Ct=n("p"),Sn=r("MPT models are GPT-style decoder-only transformers with several improvements: performance-optimized layer implementations, architecture changes that provide greater training stability, and the elimination of context length limits by replacing positional embeddings with ALiBi."),nn=h(),Z=n("ul"),io=n("li"),Vn=r("MPT base: MPT base pre-trained models on next token prediction"),Ln=h(),co=n("li"),Qn=r("MPT instruct: MPT base models fine-tuned on instruction based tasks"),Yn=h(),po=n("li"),Hn=r("MPT storywriter: MPT base models fine-tuned for 2500 steps on 65k-token excerpts of fiction books contained in the books3 corpus, this enables the model to handle very long sequences"),sn=h(),ue=n("p"),On=r("The original code is available at the  "),Be=n("a"),ho=n("code"),Dn=r("llm-foundry"),Kn=r(" repository."),an=h(),Ae=n("p"),es=r("Read more about it "),Ze=n("a"),ts=r("in the release blogpost"),rn=h(),jt=n("p"),os=r("Tips:"),ln=h(),G=n("ul"),mo=n("li"),Et=n("p"),ns=r("Learn more about some techniques behind training of the model "),Ge=n("a"),ss=r("in this section of llm-foundry repository"),as=h(),uo=n("li"),O=n("p"),rs=r("If you want to use the advanced version of the model (triton kernels, direct flash attention integration), you can still use the original model implementation by adding "),fo=n("code"),ls=r("trust_remote_code=True"),is=r(" when calling "),go=n("code"),ds=r("from_pretrained"),cs=r("."),ps=h(),_o=n("li"),Jt=n("p"),Re=n("a"),hs=r("Fine-tuning Notebook"),ms=r(" on how to fine-tune MPT-7B on a free Google Colab instance to turn the model into a Chatbot."),dn=h(),D=n("h2"),fe=n("a"),bo=n("span"),M(Xe.$$.fragment),us=h(),yo=n("span"),fs=r("MptConfig"),cn=h(),I=n("div"),M(Se.$$.fragment),gs=h(),K=n("p"),_s=r("This is the configuration class to store the configuration of a "),zt=n("a"),bs=r("MptModel"),ys=r(`. It is used to instantiate a Mpt model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to the Mpt-7b architecture
`),Ve=n("a"),Ms=r("mosaicml/mpt-7b"),vs=r("."),Ts=h(),ee=n("p"),ws=r("Configuration objects inherit from "),Ft=n("a"),ks=r("PretrainedConfig"),$s=r(` and can be used to control the model outputs. Read the
documentation from `),Ut=n("a"),Cs=r("PretrainedConfig"),js=r(" for more information."),Es=h(),M(ge.$$.fragment),pn=h(),te=n("h2"),_e=n("a"),Mo=n("span"),M(Le.$$.fragment),Js=h(),vo=n("span"),zs=r("MptModel"),hn=h(),J=n("div"),M(Qe.$$.fragment),Fs=h(),To=n("p"),Us=r("The bare Mpt Model transformer outputting raw hidden-states without any specific head on top."),Ns=h(),Ye=n("p"),xs=r("This model inherits from "),Nt=n("a"),Is=r("PreTrainedModel"),Ws=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),Ps=h(),He=n("p"),qs=r("This model is also a PyTorch "),Oe=n("a"),Bs=r("torch.nn.Module"),As=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Zs=h(),P=n("div"),M(De.$$.fragment),Gs=h(),oe=n("p"),Rs=r("The "),xt=n("a"),Xs=r("MptModel"),Ss=r(" forward method, overrides the "),wo=n("code"),Vs=r("__call__"),Ls=r(" special method."),Qs=h(),M(be.$$.fragment),Ys=h(),M(ye.$$.fragment),mn=h(),ne=n("h2"),Me=n("a"),ko=n("span"),M(Ke.$$.fragment),Hs=h(),$o=n("span"),Os=r("MptForCausalLM"),un=h(),z=n("div"),M(et.$$.fragment),Ds=h(),Co=n("p"),Ks=r(`The MPT Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),ea=h(),tt=n("p"),ta=r("This model inherits from "),It=n("a"),oa=r("PreTrainedModel"),na=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),sa=h(),ot=n("p"),aa=r("This model is also a PyTorch "),nt=n("a"),ra=r("torch.nn.Module"),la=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ia=h(),q=n("div"),M(st.$$.fragment),da=h(),se=n("p"),ca=r("The "),Wt=n("a"),pa=r("MptForCausalLM"),ha=r(" forward method, overrides the "),jo=n("code"),ma=r("__call__"),ua=r(" special method."),fa=h(),M(ve.$$.fragment),ga=h(),M(Te.$$.fragment),fn=h(),ae=n("h2"),we=n("a"),Eo=n("span"),M(at.$$.fragment),_a=h(),Jo=n("span"),ba=r("MptForSequenceClassification"),gn=h(),E=n("div"),M(rt.$$.fragment),ya=h(),zo=n("p"),Ma=r("The MPT Model transformer with a sequence classification head on top (linear layer)."),va=h(),Pt=n("p"),qt=n("a"),Ta=r("MptForSequenceClassification"),wa=r(` uses the last token in order to do the classification, as other causal models
(e.g. GPT-1) do.`),ka=h(),W=n("p"),$a=r(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Fo=n("code"),Ca=r("pad_token_id"),ja=r(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Uo=n("code"),Ea=r("pad_token_id"),Ja=r(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),No=n("code"),za=r("inputs_embeds"),Fa=r(" are passed instead of "),xo=n("code"),Ua=r("input_ids"),Na=r(`, it does the same (take the last value in
each row of the batch).`),xa=h(),lt=n("p"),Ia=r("This model inherits from "),Bt=n("a"),Wa=r("PreTrainedModel"),Pa=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),qa=h(),it=n("p"),Ba=r("This model is also a PyTorch "),dt=n("a"),Aa=r("torch.nn.Module"),Za=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ga=h(),N=n("div"),M(ct.$$.fragment),Ra=h(),re=n("p"),Xa=r("The "),At=n("a"),Sa=r("MptForSequenceClassification"),Va=r(" forward method, overrides the "),Io=n("code"),La=r("__call__"),Qa=r(" special method."),Ya=h(),M(ke.$$.fragment),Ha=h(),M($e.$$.fragment),Oa=h(),M(Ce.$$.fragment),_n=h(),le=n("h2"),je=n("a"),Wo=n("span"),M(pt.$$.fragment),Da=h(),Po=n("span"),Ka=r("MptForTokenClassification"),bn=h(),F=n("div"),M(ht.$$.fragment),er=h(),qo=n("p"),tr=r(`MPT Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),or=h(),mt=n("p"),nr=r("This model inherits from "),Zt=n("a"),sr=r("PreTrainedModel"),ar=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),rr=h(),ut=n("p"),lr=r("This model is also a PyTorch "),ft=n("a"),ir=r("torch.nn.Module"),dr=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),cr=h(),B=n("div"),M(gt.$$.fragment),pr=h(),ie=n("p"),hr=r("The "),Gt=n("a"),mr=r("MptForTokenClassification"),ur=r(" forward method, overrides the "),Bo=n("code"),fr=r("__call__"),gr=r(" special method."),_r=h(),M(Ee.$$.fragment),br=h(),M(Je.$$.fragment),yn=h(),de=n("h2"),ze=n("a"),Ao=n("span"),M(_t.$$.fragment),yr=h(),Zo=n("span"),Mr=r("MptForQuestionAnswering"),Mn=h(),U=n("div"),M(bt.$$.fragment),vr=h(),ce=n("p"),Tr=r(`The MPT Model transformer with a span classification head on top for extractive question-answering tasks like SQuAD
(a linear layers on top of the hidden-states output to compute `),Go=n("code"),wr=r("span start logits"),kr=r(" and "),Ro=n("code"),$r=r("span end logits"),Cr=r(")."),jr=h(),yt=n("p"),Er=r("This model inherits from "),Rt=n("a"),Jr=r("PreTrainedModel"),zr=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),Fr=h(),Mt=n("p"),Ur=r("This model is also a PyTorch "),vt=n("a"),Nr=r("torch.nn.Module"),xr=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ir=h(),R=n("div"),M(Tt.$$.fragment),Wr=h(),pe=n("p"),Pr=r("The "),Xt=n("a"),qr=r("MptForQuestionAnswering"),Br=r(" forward method, overrides the "),Xo=n("code"),Ar=r("__call__"),Zr=r(" special method."),Gr=h(),M(Fe.$$.fragment),this.h()},l(t){const g=di('[data-svelte="svelte-1phssyn"]',document.head);d=s(g,"META",{name:!0,content:!0}),g.forEach(o),y=m(t),f=s(t,"H1",{class:!0});var wt=a(f);u=s(wt,"A",{id:!0,class:!0,href:!0});var So=a(u);b=s(So,"SPAN",{});var Vo=a(b);v(i.$$.fragment,Vo),Vo.forEach(o),So.forEach(o),p=m(wt),j=s(wt,"SPAN",{});var Lo=a(j);Bn=l(Lo,"MPT"),Lo.forEach(o),wt.forEach(o),en=m(t),H=s(t,"H2",{class:!0});var kt=a(H);he=s(kt,"A",{id:!0,class:!0,href:!0});var Qo=a(he);ro=s(Qo,"SPAN",{});var Yo=a(ro);v(Pe.$$.fragment,Yo),Yo.forEach(o),Qo.forEach(o),An=m(kt),lo=s(kt,"SPAN",{});var Ho=a(lo);Zn=l(Ho,"Overview"),Ho.forEach(o),kt.forEach(o),tn=m(t),me=s(t,"P",{});var $t=a(me);Gn=l($t,"The MPT model was proposed by the "),qe=s($t,"A",{href:!0,rel:!0});var Oo=a(qe);Rn=l(Oo,"MosaicML"),Oo.forEach(o),Xn=l($t," team and released with multiple sizes and finetuned variants. The MPT models is a series of open source and commercially usable LLMs pre-trained on 1T tokens."),$t.forEach(o),on=m(t),Ct=s(t,"P",{});var Do=a(Ct);Sn=l(Do,"MPT models are GPT-style decoder-only transformers with several improvements: performance-optimized layer implementations, architecture changes that provide greater training stability, and the elimination of context length limits by replacing positional embeddings with ALiBi."),Do.forEach(o),nn=m(t),Z=s(t,"UL",{});var St=a(Z);io=s(St,"LI",{});var Lr=a(io);Vn=l(Lr,"MPT base: MPT base pre-trained models on next token prediction"),Lr.forEach(o),Ln=m(St),co=s(St,"LI",{});var Qr=a(co);Qn=l(Qr,"MPT instruct: MPT base models fine-tuned on instruction based tasks"),Qr.forEach(o),Yn=m(St),po=s(St,"LI",{});var Yr=a(po);Hn=l(Yr,"MPT storywriter: MPT base models fine-tuned for 2500 steps on 65k-token excerpts of fiction books contained in the books3 corpus, this enables the model to handle very long sequences"),Yr.forEach(o),St.forEach(o),sn=m(t),ue=s(t,"P",{});var Tn=a(ue);On=l(Tn,"The original code is available at the  "),Be=s(Tn,"A",{href:!0,rel:!0});var Hr=a(Be);ho=s(Hr,"CODE",{});var Or=a(ho);Dn=l(Or,"llm-foundry"),Or.forEach(o),Hr.forEach(o),Kn=l(Tn," repository."),Tn.forEach(o),an=m(t),Ae=s(t,"P",{});var Rr=a(Ae);es=l(Rr,"Read more about it "),Ze=s(Rr,"A",{href:!0,rel:!0});var Dr=a(Ze);ts=l(Dr,"in the release blogpost"),Dr.forEach(o),Rr.forEach(o),rn=m(t),jt=s(t,"P",{});var Kr=a(jt);os=l(Kr,"Tips:"),Kr.forEach(o),ln=m(t),G=s(t,"UL",{});var Vt=a(G);mo=s(Vt,"LI",{});var el=a(mo);Et=s(el,"P",{});var Xr=a(Et);ns=l(Xr,"Learn more about some techniques behind training of the model "),Ge=s(Xr,"A",{href:!0,rel:!0});var tl=a(Ge);ss=l(tl,"in this section of llm-foundry repository"),tl.forEach(o),Xr.forEach(o),el.forEach(o),as=m(Vt),uo=s(Vt,"LI",{});var ol=a(uo);O=s(ol,"P",{});var Lt=a(O);rs=l(Lt,"If you want to use the advanced version of the model (triton kernels, direct flash attention integration), you can still use the original model implementation by adding "),fo=s(Lt,"CODE",{});var nl=a(fo);ls=l(nl,"trust_remote_code=True"),nl.forEach(o),is=l(Lt," when calling "),go=s(Lt,"CODE",{});var sl=a(go);ds=l(sl,"from_pretrained"),sl.forEach(o),cs=l(Lt,"."),Lt.forEach(o),ol.forEach(o),ps=m(Vt),_o=s(Vt,"LI",{});var al=a(_o);Jt=s(al,"P",{});var Sr=a(Jt);Re=s(Sr,"A",{href:!0,rel:!0});var rl=a(Re);hs=l(rl,"Fine-tuning Notebook"),rl.forEach(o),ms=l(Sr," on how to fine-tune MPT-7B on a free Google Colab instance to turn the model into a Chatbot."),Sr.forEach(o),al.forEach(o),Vt.forEach(o),dn=m(t),D=s(t,"H2",{class:!0});var wn=a(D);fe=s(wn,"A",{id:!0,class:!0,href:!0});var ll=a(fe);bo=s(ll,"SPAN",{});var il=a(bo);v(Xe.$$.fragment,il),il.forEach(o),ll.forEach(o),us=m(wn),yo=s(wn,"SPAN",{});var dl=a(yo);fs=l(dl,"MptConfig"),dl.forEach(o),wn.forEach(o),cn=m(t),I=s(t,"DIV",{class:!0});var Ue=a(I);v(Se.$$.fragment,Ue),gs=m(Ue),K=s(Ue,"P",{});var Qt=a(K);_s=l(Qt,"This is the configuration class to store the configuration of a "),zt=s(Qt,"A",{href:!0});var cl=a(zt);bs=l(cl,"MptModel"),cl.forEach(o),ys=l(Qt,`. It is used to instantiate a Mpt model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to the Mpt-7b architecture
`),Ve=s(Qt,"A",{href:!0,rel:!0});var pl=a(Ve);Ms=l(pl,"mosaicml/mpt-7b"),pl.forEach(o),vs=l(Qt,"."),Qt.forEach(o),Ts=m(Ue),ee=s(Ue,"P",{});var Yt=a(ee);ws=l(Yt,"Configuration objects inherit from "),Ft=s(Yt,"A",{href:!0});var hl=a(Ft);ks=l(hl,"PretrainedConfig"),hl.forEach(o),$s=l(Yt,` and can be used to control the model outputs. Read the
documentation from `),Ut=s(Yt,"A",{href:!0});var ml=a(Ut);Cs=l(ml,"PretrainedConfig"),ml.forEach(o),js=l(Yt," for more information."),Yt.forEach(o),Es=m(Ue),v(ge.$$.fragment,Ue),Ue.forEach(o),pn=m(t),te=s(t,"H2",{class:!0});var kn=a(te);_e=s(kn,"A",{id:!0,class:!0,href:!0});var ul=a(_e);Mo=s(ul,"SPAN",{});var fl=a(Mo);v(Le.$$.fragment,fl),fl.forEach(o),ul.forEach(o),Js=m(kn),vo=s(kn,"SPAN",{});var gl=a(vo);zs=l(gl,"MptModel"),gl.forEach(o),kn.forEach(o),hn=m(t),J=s(t,"DIV",{class:!0});var X=a(J);v(Qe.$$.fragment,X),Fs=m(X),To=s(X,"P",{});var _l=a(To);Us=l(_l,"The bare Mpt Model transformer outputting raw hidden-states without any specific head on top."),_l.forEach(o),Ns=m(X),Ye=s(X,"P",{});var $n=a(Ye);xs=l($n,"This model inherits from "),Nt=s($n,"A",{href:!0});var bl=a(Nt);Is=l(bl,"PreTrainedModel"),bl.forEach(o),Ws=l($n,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),$n.forEach(o),Ps=m(X),He=s(X,"P",{});var Cn=a(He);qs=l(Cn,"This model is also a PyTorch "),Oe=s(Cn,"A",{href:!0,rel:!0});var yl=a(Oe);Bs=l(yl,"torch.nn.Module"),yl.forEach(o),As=l(Cn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Cn.forEach(o),Zs=m(X),P=s(X,"DIV",{class:!0});var Ne=a(P);v(De.$$.fragment,Ne),Gs=m(Ne),oe=s(Ne,"P",{});var Ht=a(oe);Rs=l(Ht,"The "),xt=s(Ht,"A",{href:!0});var Ml=a(xt);Xs=l(Ml,"MptModel"),Ml.forEach(o),Ss=l(Ht," forward method, overrides the "),wo=s(Ht,"CODE",{});var vl=a(wo);Vs=l(vl,"__call__"),vl.forEach(o),Ls=l(Ht," special method."),Ht.forEach(o),Qs=m(Ne),v(be.$$.fragment,Ne),Ys=m(Ne),v(ye.$$.fragment,Ne),Ne.forEach(o),X.forEach(o),mn=m(t),ne=s(t,"H2",{class:!0});var jn=a(ne);Me=s(jn,"A",{id:!0,class:!0,href:!0});var Tl=a(Me);ko=s(Tl,"SPAN",{});var wl=a(ko);v(Ke.$$.fragment,wl),wl.forEach(o),Tl.forEach(o),Hs=m(jn),$o=s(jn,"SPAN",{});var kl=a($o);Os=l(kl,"MptForCausalLM"),kl.forEach(o),jn.forEach(o),un=m(t),z=s(t,"DIV",{class:!0});var S=a(z);v(et.$$.fragment,S),Ds=m(S),Co=s(S,"P",{});var $l=a(Co);Ks=l($l,`The MPT Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),$l.forEach(o),ea=m(S),tt=s(S,"P",{});var En=a(tt);ta=l(En,"This model inherits from "),It=s(En,"A",{href:!0});var Cl=a(It);oa=l(Cl,"PreTrainedModel"),Cl.forEach(o),na=l(En,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),En.forEach(o),sa=m(S),ot=s(S,"P",{});var Jn=a(ot);aa=l(Jn,"This model is also a PyTorch "),nt=s(Jn,"A",{href:!0,rel:!0});var jl=a(nt);ra=l(jl,"torch.nn.Module"),jl.forEach(o),la=l(Jn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Jn.forEach(o),ia=m(S),q=s(S,"DIV",{class:!0});var xe=a(q);v(st.$$.fragment,xe),da=m(xe),se=s(xe,"P",{});var Ot=a(se);ca=l(Ot,"The "),Wt=s(Ot,"A",{href:!0});var El=a(Wt);pa=l(El,"MptForCausalLM"),El.forEach(o),ha=l(Ot," forward method, overrides the "),jo=s(Ot,"CODE",{});var Jl=a(jo);ma=l(Jl,"__call__"),Jl.forEach(o),ua=l(Ot," special method."),Ot.forEach(o),fa=m(xe),v(ve.$$.fragment,xe),ga=m(xe),v(Te.$$.fragment,xe),xe.forEach(o),S.forEach(o),fn=m(t),ae=s(t,"H2",{class:!0});var zn=a(ae);we=s(zn,"A",{id:!0,class:!0,href:!0});var zl=a(we);Eo=s(zl,"SPAN",{});var Fl=a(Eo);v(at.$$.fragment,Fl),Fl.forEach(o),zl.forEach(o),_a=m(zn),Jo=s(zn,"SPAN",{});var Ul=a(Jo);ba=l(Ul,"MptForSequenceClassification"),Ul.forEach(o),zn.forEach(o),gn=m(t),E=s(t,"DIV",{class:!0});var x=a(E);v(rt.$$.fragment,x),ya=m(x),zo=s(x,"P",{});var Nl=a(zo);Ma=l(Nl,"The MPT Model transformer with a sequence classification head on top (linear layer)."),Nl.forEach(o),va=m(x),Pt=s(x,"P",{});var Vr=a(Pt);qt=s(Vr,"A",{href:!0});var xl=a(qt);Ta=l(xl,"MptForSequenceClassification"),xl.forEach(o),wa=l(Vr,` uses the last token in order to do the classification, as other causal models
(e.g. GPT-1) do.`),Vr.forEach(o),ka=m(x),W=s(x,"P",{});var V=a(W);$a=l(V,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Fo=s(V,"CODE",{});var Il=a(Fo);Ca=l(Il,"pad_token_id"),Il.forEach(o),ja=l(V,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Uo=s(V,"CODE",{});var Wl=a(Uo);Ea=l(Wl,"pad_token_id"),Wl.forEach(o),Ja=l(V,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),No=s(V,"CODE",{});var Pl=a(No);za=l(Pl,"inputs_embeds"),Pl.forEach(o),Fa=l(V," are passed instead of "),xo=s(V,"CODE",{});var ql=a(xo);Ua=l(ql,"input_ids"),ql.forEach(o),Na=l(V,`, it does the same (take the last value in
each row of the batch).`),V.forEach(o),xa=m(x),lt=s(x,"P",{});var Fn=a(lt);Ia=l(Fn,"This model inherits from "),Bt=s(Fn,"A",{href:!0});var Bl=a(Bt);Wa=l(Bl,"PreTrainedModel"),Bl.forEach(o),Pa=l(Fn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),Fn.forEach(o),qa=m(x),it=s(x,"P",{});var Un=a(it);Ba=l(Un,"This model is also a PyTorch "),dt=s(Un,"A",{href:!0,rel:!0});var Al=a(dt);Aa=l(Al,"torch.nn.Module"),Al.forEach(o),Za=l(Un,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Un.forEach(o),Ga=m(x),N=s(x,"DIV",{class:!0});var L=a(N);v(ct.$$.fragment,L),Ra=m(L),re=s(L,"P",{});var Dt=a(re);Xa=l(Dt,"The "),At=s(Dt,"A",{href:!0});var Zl=a(At);Sa=l(Zl,"MptForSequenceClassification"),Zl.forEach(o),Va=l(Dt," forward method, overrides the "),Io=s(Dt,"CODE",{});var Gl=a(Io);La=l(Gl,"__call__"),Gl.forEach(o),Qa=l(Dt," special method."),Dt.forEach(o),Ya=m(L),v(ke.$$.fragment,L),Ha=m(L),v($e.$$.fragment,L),Oa=m(L),v(Ce.$$.fragment,L),L.forEach(o),x.forEach(o),_n=m(t),le=s(t,"H2",{class:!0});var Nn=a(le);je=s(Nn,"A",{id:!0,class:!0,href:!0});var Rl=a(je);Wo=s(Rl,"SPAN",{});var Xl=a(Wo);v(pt.$$.fragment,Xl),Xl.forEach(o),Rl.forEach(o),Da=m(Nn),Po=s(Nn,"SPAN",{});var Sl=a(Po);Ka=l(Sl,"MptForTokenClassification"),Sl.forEach(o),Nn.forEach(o),bn=m(t),F=s(t,"DIV",{class:!0});var Q=a(F);v(ht.$$.fragment,Q),er=m(Q),qo=s(Q,"P",{});var Vl=a(qo);tr=l(Vl,`MPT Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),Vl.forEach(o),or=m(Q),mt=s(Q,"P",{});var xn=a(mt);nr=l(xn,"This model inherits from "),Zt=s(xn,"A",{href:!0});var Ll=a(Zt);sr=l(Ll,"PreTrainedModel"),Ll.forEach(o),ar=l(xn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),xn.forEach(o),rr=m(Q),ut=s(Q,"P",{});var In=a(ut);lr=l(In,"This model is also a PyTorch "),ft=s(In,"A",{href:!0,rel:!0});var Ql=a(ft);ir=l(Ql,"torch.nn.Module"),Ql.forEach(o),dr=l(In,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),In.forEach(o),cr=m(Q),B=s(Q,"DIV",{class:!0});var Ie=a(B);v(gt.$$.fragment,Ie),pr=m(Ie),ie=s(Ie,"P",{});var Kt=a(ie);hr=l(Kt,"The "),Gt=s(Kt,"A",{href:!0});var Yl=a(Gt);mr=l(Yl,"MptForTokenClassification"),Yl.forEach(o),ur=l(Kt," forward method, overrides the "),Bo=s(Kt,"CODE",{});var Hl=a(Bo);fr=l(Hl,"__call__"),Hl.forEach(o),gr=l(Kt," special method."),Kt.forEach(o),_r=m(Ie),v(Ee.$$.fragment,Ie),br=m(Ie),v(Je.$$.fragment,Ie),Ie.forEach(o),Q.forEach(o),yn=m(t),de=s(t,"H2",{class:!0});var Wn=a(de);ze=s(Wn,"A",{id:!0,class:!0,href:!0});var Ol=a(ze);Ao=s(Ol,"SPAN",{});var Dl=a(Ao);v(_t.$$.fragment,Dl),Dl.forEach(o),Ol.forEach(o),yr=m(Wn),Zo=s(Wn,"SPAN",{});var Kl=a(Zo);Mr=l(Kl,"MptForQuestionAnswering"),Kl.forEach(o),Wn.forEach(o),Mn=m(t),U=s(t,"DIV",{class:!0});var Y=a(U);v(bt.$$.fragment,Y),vr=m(Y),ce=s(Y,"P",{});var eo=a(ce);Tr=l(eo,`The MPT Model transformer with a span classification head on top for extractive question-answering tasks like SQuAD
(a linear layers on top of the hidden-states output to compute `),Go=s(eo,"CODE",{});var ei=a(Go);wr=l(ei,"span start logits"),ei.forEach(o),kr=l(eo," and "),Ro=s(eo,"CODE",{});var ti=a(Ro);$r=l(ti,"span end logits"),ti.forEach(o),Cr=l(eo,")."),eo.forEach(o),jr=m(Y),yt=s(Y,"P",{});var Pn=a(yt);Er=l(Pn,"This model inherits from "),Rt=s(Pn,"A",{href:!0});var oi=a(Rt);Jr=l(oi,"PreTrainedModel"),oi.forEach(o),zr=l(Pn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),Pn.forEach(o),Fr=m(Y),Mt=s(Y,"P",{});var qn=a(Mt);Ur=l(qn,"This model is also a PyTorch "),vt=s(qn,"A",{href:!0,rel:!0});var ni=a(vt);Nr=l(ni,"torch.nn.Module"),ni.forEach(o),xr=l(qn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),qn.forEach(o),Ir=m(Y),R=s(Y,"DIV",{class:!0});var to=a(R);v(Tt.$$.fragment,to),Wr=m(to),pe=s(to,"P",{});var oo=a(pe);Pr=l(oo,"The "),Xt=s(oo,"A",{href:!0});var si=a(Xt);qr=l(si,"MptForQuestionAnswering"),si.forEach(o),Br=l(oo," forward method, overrides the "),Xo=s(oo,"CODE",{});var ai=a(Xo);Ar=l(ai,"__call__"),ai.forEach(o),Zr=l(oo," special method."),oo.forEach(o),Gr=m(to),v(Fe.$$.fragment,to),to.forEach(o),Y.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(wi)),c(u,"id","mpt"),c(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(u,"href","#mpt"),c(f,"class","relative group"),c(he,"id","overview"),c(he,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(he,"href","#overview"),c(H,"class","relative group"),c(qe,"href","https://www.mosaicml.com/"),c(qe,"rel","nofollow"),c(Be,"href","https://github.com/mosaicml/llm-foundry/tree/main"),c(Be,"rel","nofollow"),c(Ze,"href","https://www.mosaicml.com/blog/mpt-7b"),c(Ze,"rel","nofollow"),c(Ge,"href","https://github.com/mosaicml/llm-foundry/blob/main/TUTORIAL.md#faqs"),c(Ge,"rel","nofollow"),c(Re,"href","https://colab.research.google.com/drive/1HCpQkLL7UXW8xJUJJ29X7QAeNJKO0frZ?usp=sharing"),c(Re,"rel","nofollow"),c(fe,"id","transformers.MptConfig"),c(fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(fe,"href","#transformers.MptConfig"),c(D,"class","relative group"),c(zt,"href","/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptModel"),c(Ve,"href","https://huggingface.co/mosaicml/mpt-7b"),c(Ve,"rel","nofollow"),c(Ft,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Ut,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(_e,"id","transformers.MptModel"),c(_e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(_e,"href","#transformers.MptModel"),c(te,"class","relative group"),c(Nt,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),c(Oe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Oe,"rel","nofollow"),c(xt,"href","/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptModel"),c(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Me,"id","transformers.MptForCausalLM"),c(Me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Me,"href","#transformers.MptForCausalLM"),c(ne,"class","relative group"),c(It,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),c(nt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(nt,"rel","nofollow"),c(Wt,"href","/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptForCausalLM"),c(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(we,"id","transformers.MptForSequenceClassification"),c(we,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(we,"href","#transformers.MptForSequenceClassification"),c(ae,"class","relative group"),c(qt,"href","/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptForSequenceClassification"),c(Bt,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),c(dt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(dt,"rel","nofollow"),c(At,"href","/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptForSequenceClassification"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(je,"id","transformers.MptForTokenClassification"),c(je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(je,"href","#transformers.MptForTokenClassification"),c(le,"class","relative group"),c(Zt,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),c(ft,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ft,"rel","nofollow"),c(Gt,"href","/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptForTokenClassification"),c(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ze,"id","transformers.MptForQuestionAnswering"),c(ze,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ze,"href","#transformers.MptForQuestionAnswering"),c(de,"class","relative group"),c(Rt,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),c(vt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(vt,"rel","nofollow"),c(Xt,"href","/docs/transformers/v4.32.0/en/model_doc/mpt#transformers.MptForQuestionAnswering"),c(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,g){e(document.head,d),_(t,y,g),_(t,f,g),e(f,u),e(u,b),T(i,b,null),e(f,p),e(f,j),e(j,Bn),_(t,en,g),_(t,H,g),e(H,he),e(he,ro),T(Pe,ro,null),e(H,An),e(H,lo),e(lo,Zn),_(t,tn,g),_(t,me,g),e(me,Gn),e(me,qe),e(qe,Rn),e(me,Xn),_(t,on,g),_(t,Ct,g),e(Ct,Sn),_(t,nn,g),_(t,Z,g),e(Z,io),e(io,Vn),e(Z,Ln),e(Z,co),e(co,Qn),e(Z,Yn),e(Z,po),e(po,Hn),_(t,sn,g),_(t,ue,g),e(ue,On),e(ue,Be),e(Be,ho),e(ho,Dn),e(ue,Kn),_(t,an,g),_(t,Ae,g),e(Ae,es),e(Ae,Ze),e(Ze,ts),_(t,rn,g),_(t,jt,g),e(jt,os),_(t,ln,g),_(t,G,g),e(G,mo),e(mo,Et),e(Et,ns),e(Et,Ge),e(Ge,ss),e(G,as),e(G,uo),e(uo,O),e(O,rs),e(O,fo),e(fo,ls),e(O,is),e(O,go),e(go,ds),e(O,cs),e(G,ps),e(G,_o),e(_o,Jt),e(Jt,Re),e(Re,hs),e(Jt,ms),_(t,dn,g),_(t,D,g),e(D,fe),e(fe,bo),T(Xe,bo,null),e(D,us),e(D,yo),e(yo,fs),_(t,cn,g),_(t,I,g),T(Se,I,null),e(I,gs),e(I,K),e(K,_s),e(K,zt),e(zt,bs),e(K,ys),e(K,Ve),e(Ve,Ms),e(K,vs),e(I,Ts),e(I,ee),e(ee,ws),e(ee,Ft),e(Ft,ks),e(ee,$s),e(ee,Ut),e(Ut,Cs),e(ee,js),e(I,Es),T(ge,I,null),_(t,pn,g),_(t,te,g),e(te,_e),e(_e,Mo),T(Le,Mo,null),e(te,Js),e(te,vo),e(vo,zs),_(t,hn,g),_(t,J,g),T(Qe,J,null),e(J,Fs),e(J,To),e(To,Us),e(J,Ns),e(J,Ye),e(Ye,xs),e(Ye,Nt),e(Nt,Is),e(Ye,Ws),e(J,Ps),e(J,He),e(He,qs),e(He,Oe),e(Oe,Bs),e(He,As),e(J,Zs),e(J,P),T(De,P,null),e(P,Gs),e(P,oe),e(oe,Rs),e(oe,xt),e(xt,Xs),e(oe,Ss),e(oe,wo),e(wo,Vs),e(oe,Ls),e(P,Qs),T(be,P,null),e(P,Ys),T(ye,P,null),_(t,mn,g),_(t,ne,g),e(ne,Me),e(Me,ko),T(Ke,ko,null),e(ne,Hs),e(ne,$o),e($o,Os),_(t,un,g),_(t,z,g),T(et,z,null),e(z,Ds),e(z,Co),e(Co,Ks),e(z,ea),e(z,tt),e(tt,ta),e(tt,It),e(It,oa),e(tt,na),e(z,sa),e(z,ot),e(ot,aa),e(ot,nt),e(nt,ra),e(ot,la),e(z,ia),e(z,q),T(st,q,null),e(q,da),e(q,se),e(se,ca),e(se,Wt),e(Wt,pa),e(se,ha),e(se,jo),e(jo,ma),e(se,ua),e(q,fa),T(ve,q,null),e(q,ga),T(Te,q,null),_(t,fn,g),_(t,ae,g),e(ae,we),e(we,Eo),T(at,Eo,null),e(ae,_a),e(ae,Jo),e(Jo,ba),_(t,gn,g),_(t,E,g),T(rt,E,null),e(E,ya),e(E,zo),e(zo,Ma),e(E,va),e(E,Pt),e(Pt,qt),e(qt,Ta),e(Pt,wa),e(E,ka),e(E,W),e(W,$a),e(W,Fo),e(Fo,Ca),e(W,ja),e(W,Uo),e(Uo,Ea),e(W,Ja),e(W,No),e(No,za),e(W,Fa),e(W,xo),e(xo,Ua),e(W,Na),e(E,xa),e(E,lt),e(lt,Ia),e(lt,Bt),e(Bt,Wa),e(lt,Pa),e(E,qa),e(E,it),e(it,Ba),e(it,dt),e(dt,Aa),e(it,Za),e(E,Ga),e(E,N),T(ct,N,null),e(N,Ra),e(N,re),e(re,Xa),e(re,At),e(At,Sa),e(re,Va),e(re,Io),e(Io,La),e(re,Qa),e(N,Ya),T(ke,N,null),e(N,Ha),T($e,N,null),e(N,Oa),T(Ce,N,null),_(t,_n,g),_(t,le,g),e(le,je),e(je,Wo),T(pt,Wo,null),e(le,Da),e(le,Po),e(Po,Ka),_(t,bn,g),_(t,F,g),T(ht,F,null),e(F,er),e(F,qo),e(qo,tr),e(F,or),e(F,mt),e(mt,nr),e(mt,Zt),e(Zt,sr),e(mt,ar),e(F,rr),e(F,ut),e(ut,lr),e(ut,ft),e(ft,ir),e(ut,dr),e(F,cr),e(F,B),T(gt,B,null),e(B,pr),e(B,ie),e(ie,hr),e(ie,Gt),e(Gt,mr),e(ie,ur),e(ie,Bo),e(Bo,fr),e(ie,gr),e(B,_r),T(Ee,B,null),e(B,br),T(Je,B,null),_(t,yn,g),_(t,de,g),e(de,ze),e(ze,Ao),T(_t,Ao,null),e(de,yr),e(de,Zo),e(Zo,Mr),_(t,Mn,g),_(t,U,g),T(bt,U,null),e(U,vr),e(U,ce),e(ce,Tr),e(ce,Go),e(Go,wr),e(ce,kr),e(ce,Ro),e(Ro,$r),e(ce,Cr),e(U,jr),e(U,yt),e(yt,Er),e(yt,Rt),e(Rt,Jr),e(yt,zr),e(U,Fr),e(U,Mt),e(Mt,Ur),e(Mt,vt),e(vt,Nr),e(Mt,xr),e(U,Ir),e(U,R),T(Tt,R,null),e(R,Wr),e(R,pe),e(pe,Pr),e(pe,Xt),e(Xt,qr),e(pe,Br),e(pe,Xo),e(Xo,Ar),e(pe,Zr),e(R,Gr),T(Fe,R,null),vn=!0},p(t,[g]){const wt={};g&2&&(wt.$$scope={dirty:g,ctx:t}),ge.$set(wt);const So={};g&2&&(So.$$scope={dirty:g,ctx:t}),be.$set(So);const Vo={};g&2&&(Vo.$$scope={dirty:g,ctx:t}),ye.$set(Vo);const Lo={};g&2&&(Lo.$$scope={dirty:g,ctx:t}),ve.$set(Lo);const kt={};g&2&&(kt.$$scope={dirty:g,ctx:t}),Te.$set(kt);const Qo={};g&2&&(Qo.$$scope={dirty:g,ctx:t}),ke.$set(Qo);const Yo={};g&2&&(Yo.$$scope={dirty:g,ctx:t}),$e.$set(Yo);const Ho={};g&2&&(Ho.$$scope={dirty:g,ctx:t}),Ce.$set(Ho);const $t={};g&2&&($t.$$scope={dirty:g,ctx:t}),Ee.$set($t);const Oo={};g&2&&(Oo.$$scope={dirty:g,ctx:t}),Je.$set(Oo);const Do={};g&2&&(Do.$$scope={dirty:g,ctx:t}),Fe.$set(Do)},i(t){vn||(w(i.$$.fragment,t),w(Pe.$$.fragment,t),w(Xe.$$.fragment,t),w(Se.$$.fragment,t),w(ge.$$.fragment,t),w(Le.$$.fragment,t),w(Qe.$$.fragment,t),w(De.$$.fragment,t),w(be.$$.fragment,t),w(ye.$$.fragment,t),w(Ke.$$.fragment,t),w(et.$$.fragment,t),w(st.$$.fragment,t),w(ve.$$.fragment,t),w(Te.$$.fragment,t),w(at.$$.fragment,t),w(rt.$$.fragment,t),w(ct.$$.fragment,t),w(ke.$$.fragment,t),w($e.$$.fragment,t),w(Ce.$$.fragment,t),w(pt.$$.fragment,t),w(ht.$$.fragment,t),w(gt.$$.fragment,t),w(Ee.$$.fragment,t),w(Je.$$.fragment,t),w(_t.$$.fragment,t),w(bt.$$.fragment,t),w(Tt.$$.fragment,t),w(Fe.$$.fragment,t),vn=!0)},o(t){k(i.$$.fragment,t),k(Pe.$$.fragment,t),k(Xe.$$.fragment,t),k(Se.$$.fragment,t),k(ge.$$.fragment,t),k(Le.$$.fragment,t),k(Qe.$$.fragment,t),k(De.$$.fragment,t),k(be.$$.fragment,t),k(ye.$$.fragment,t),k(Ke.$$.fragment,t),k(et.$$.fragment,t),k(st.$$.fragment,t),k(ve.$$.fragment,t),k(Te.$$.fragment,t),k(at.$$.fragment,t),k(rt.$$.fragment,t),k(ct.$$.fragment,t),k(ke.$$.fragment,t),k($e.$$.fragment,t),k(Ce.$$.fragment,t),k(pt.$$.fragment,t),k(ht.$$.fragment,t),k(gt.$$.fragment,t),k(Ee.$$.fragment,t),k(Je.$$.fragment,t),k(_t.$$.fragment,t),k(bt.$$.fragment,t),k(Tt.$$.fragment,t),k(Fe.$$.fragment,t),vn=!1},d(t){o(d),t&&o(y),t&&o(f),$(i),t&&o(en),t&&o(H),$(Pe),t&&o(tn),t&&o(me),t&&o(on),t&&o(Ct),t&&o(nn),t&&o(Z),t&&o(sn),t&&o(ue),t&&o(an),t&&o(Ae),t&&o(rn),t&&o(jt),t&&o(ln),t&&o(G),t&&o(dn),t&&o(D),$(Xe),t&&o(cn),t&&o(I),$(Se),$(ge),t&&o(pn),t&&o(te),$(Le),t&&o(hn),t&&o(J),$(Qe),$(De),$(be),$(ye),t&&o(mn),t&&o(ne),$(Ke),t&&o(un),t&&o(z),$(et),$(st),$(ve),$(Te),t&&o(fn),t&&o(ae),$(at),t&&o(gn),t&&o(E),$(rt),$(ct),$(ke),$($e),$(Ce),t&&o(_n),t&&o(le),$(pt),t&&o(bn),t&&o(F),$(ht),$(gt),$(Ee),$(Je),t&&o(yn),t&&o(de),$(_t),t&&o(Mn),t&&o(U),$(bt),$(Tt),$(Fe)}}}const wi={local:"mpt",sections:[{local:"overview",title:"Overview"},{local:"transformers.MptConfig",title:"MptConfig"},{local:"transformers.MptModel",title:"MptModel"},{local:"transformers.MptForCausalLM",title:"MptForCausalLM"},{local:"transformers.MptForSequenceClassification",title:"MptForSequenceClassification"},{local:"transformers.MptForTokenClassification",title:"MptForTokenClassification"},{local:"transformers.MptForQuestionAnswering",title:"MptForQuestionAnswering"}],title:"MPT"};function ki(C){return ci(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Fi extends ri{constructor(d){super();li(this,d,ki,Ti,ii,{})}}export{Fi as default,wi as metadata};
