import{S as Fr,i as zr,s as Wr,e as a,k as f,w as y,t as l,M as Er,c as r,d as o,m as g,a as i,x as w,h as d,b as m,G as e,g as M,y as T,q as v,o as k,B as J,v as Ir,L as Re}from"../../chunks/vendor-hf-doc-builder.js";import{T as oo}from"../../chunks/Tip-hf-doc-builder.js";import{D as F}from"../../chunks/Docstring-hf-doc-builder.js";import{C as qe}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as le}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Be}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function xr($){let s,b,h,p,_;return p=new qe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1yYUNvbmZpZyUyQyUyME1yYU1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyME1yYSUyMHV3LW1hZGlzb24lMkZtcmEtYmFzZS01MTItNCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBNcmFDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwdXctbWFkaXNvbiUyRm1yYS1iYXNlLTUxMi00JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBNcmFNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MraConfig, MraModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Mra uw-madison/mra-base-512-4 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = MraConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the uw-madison/mra-base-512-4 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MraModel(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(){s=a("p"),b=l("Example:"),h=f(),y(p.$$.fragment)},l(n){s=r(n,"P",{});var c=i(s);b=d(c,"Example:"),c.forEach(o),h=g(n),w(p.$$.fragment,n)},m(n,c){M(n,s,c),e(s,b),M(n,h,c),T(p,n,c),_=!0},p:Re,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){k(p.$$.fragment,n),_=!1},d(n){n&&o(s),n&&o(h),J(p,n)}}}function Zr($){let s,b,h,p,_;return{c(){s=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),p=l("Module"),_=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){s=r(n,"P",{});var c=i(s);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(c,"CODE",{});var j=i(h);p=d(j,"Module"),j.forEach(o),_=d(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){M(n,s,c),e(s,b),e(s,h),e(h,p),e(s,_)},d(n){n&&o(s)}}}function Nr($){let s,b,h,p,_;return p=new qe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNcmFNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydXctbWFkaXNvbiUyRm1yYS1iYXNlLTUxMi00JTIyKSUwQW1vZGVsJTIwJTNEJTIwTXJhTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnV3LW1hZGlzb24lMkZtcmEtYmFzZS01MTItNCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MraModel
<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;uw-madison/mra-base-512-4&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MraModel.from_pretrained(<span class="hljs-string">&quot;uw-madison/mra-base-512-4&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(){s=a("p"),b=l("Example:"),h=f(),y(p.$$.fragment)},l(n){s=r(n,"P",{});var c=i(s);b=d(c,"Example:"),c.forEach(o),h=g(n),w(p.$$.fragment,n)},m(n,c){M(n,s,c),e(s,b),M(n,h,c),T(p,n,c),_=!0},p:Re,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){k(p.$$.fragment,n),_=!1},d(n){n&&o(s),n&&o(h),J(p,n)}}}function Gr($){let s,b,h,p,_;return{c(){s=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),p=l("Module"),_=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){s=r(n,"P",{});var c=i(s);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(c,"CODE",{});var j=i(h);p=d(j,"Module"),j.forEach(o),_=d(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){M(n,s,c),e(s,b),e(s,h),e(h,p),e(s,_)},d(n){n&&o(s)}}}function Br($){let s,b,h,p,_;return p=new qe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNcmFGb3JNYXNrZWRMTSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydXctbWFkaXNvbiUyRm1yYS1iYXNlLTUxMi00JTIyKSUwQW1vZGVsJTIwJTNEJTIwTXJhRm9yTWFza2VkTE0uZnJvbV9wcmV0cmFpbmVkKCUyMnV3LW1hZGlzb24lMkZtcmEtYmFzZS01MTItNCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjAlNUJNQVNLJTVELiUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjByZXRyaWV2ZSUyMGluZGV4JTIwb2YlMjAlNUJNQVNLJTVEJTBBbWFza190b2tlbl9pbmRleCUyMCUzRCUyMChpbnB1dHMuaW5wdXRfaWRzJTIwJTNEJTNEJTIwdG9rZW5pemVyLm1hc2tfdG9rZW5faWQpJTVCMCU1RC5ub256ZXJvKGFzX3R1cGxlJTNEVHJ1ZSklNUIwJTVEJTBBJTBBcHJlZGljdGVkX3Rva2VuX2lkJTIwJTNEJTIwbG9naXRzJTVCMCUyQyUyMG1hc2tfdG9rZW5faW5kZXglNUQuYXJnbWF4KGF4aXMlM0QtMSklMEElMEFsYWJlbHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjBQYXJpcy4lMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RCUwQSUyMyUyMG1hc2slMjBsYWJlbHMlMjBvZiUyMG5vbi0lNUJNQVNLJTVEJTIwdG9rZW5zJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2gud2hlcmUoaW5wdXRzLmlucHV0X2lkcyUyMCUzRCUzRCUyMHRva2VuaXplci5tYXNrX3Rva2VuX2lkJTJDJTIwbGFiZWxzJTJDJTIwLTEwMCklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MraForMaskedLM
<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;uw-madison/mra-base-512-4&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MraForMaskedLM.from_pretrained(<span class="hljs-string">&quot;uw-madison/mra-base-512-4&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is [MASK].&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><span class="hljs-comment"># retrieve index of [MASK]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>].nonzero(as_tuple=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_id = logits[<span class="hljs-number">0</span>, mask_token_index].argmax(axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask labels of non-[MASK] tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -<span class="hljs-number">100</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)`}}),{c(){s=a("p"),b=l("Example:"),h=f(),y(p.$$.fragment)},l(n){s=r(n,"P",{});var c=i(s);b=d(c,"Example:"),c.forEach(o),h=g(n),w(p.$$.fragment,n)},m(n,c){M(n,s,c),e(s,b),M(n,h,c),T(p,n,c),_=!0},p:Re,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){k(p.$$.fragment,n),_=!1},d(n){n&&o(s),n&&o(h),J(p,n)}}}function Rr($){let s,b,h,p,_;return{c(){s=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),p=l("Module"),_=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){s=r(n,"P",{});var c=i(s);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(c,"CODE",{});var j=i(h);p=d(j,"Module"),j.forEach(o),_=d(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){M(n,s,c),e(s,b),e(s,h),e(h,p),e(s,_)},d(n){n&&o(s)}}}function qr($){let s,b,h,p,_;return p=new qe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME1yYUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ1dy1tYWRpc29uJTJGbXJhLWJhc2UtNTEyLTQlMjIpJTBBbW9kZWwlMjAlM0QlMjBNcmFGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ1dy1tYWRpc29uJTJGbXJhLWJhc2UtNTEyLTQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwbG9naXRzLmFyZ21heCgpLml0ZW0oKSUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyME1yYUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMnV3LW1hZGlzb24lMkZtcmEtYmFzZS01MTItNCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, MraForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;uw-madison/mra-base-512-4&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MraForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;uw-madison/mra-base-512-4&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 = MraForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;uw-madison/mra-base-512-4&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(){s=a("p"),b=l("Example of single-label classification:"),h=f(),y(p.$$.fragment)},l(n){s=r(n,"P",{});var c=i(s);b=d(c,"Example of single-label classification:"),c.forEach(o),h=g(n),w(p.$$.fragment,n)},m(n,c){M(n,s,c),e(s,b),M(n,h,c),T(p,n,c),_=!0},p:Re,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){k(p.$$.fragment,n),_=!1},d(n){n&&o(s),n&&o(h),J(p,n)}}}function Ar($){let s,b,h,p,_;return p=new qe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME1yYUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ1dy1tYWRpc29uJTJGbXJhLWJhc2UtNTEyLTQlMjIpJTBBbW9kZWwlMjAlM0QlMjBNcmFGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ1dy1tYWRpc29uJTJGbXJhLWJhc2UtNTEyLTQlMjIlMkMlMjBwcm9ibGVtX3R5cGUlM0QlMjJtdWx0aV9sYWJlbF9jbGFzc2lmaWNhdGlvbiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJhbmdlKDAlMkMlMjBsb2dpdHMuc2hhcGUlNUItMSU1RCklNUJ0b3JjaC5zaWdtb2lkKGxvZ2l0cykuc3F1ZWV6ZShkaW0lM0QwKSUyMCUzRSUyMDAuNSU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyME1yYUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnV3LW1hZGlzb24lMkZtcmEtYmFzZS01MTItNCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, MraForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;uw-madison/mra-base-512-4&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MraForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;uw-madison/mra-base-512-4&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 = MraForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;uw-madison/mra-base-512-4&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(){s=a("p"),b=l("Example of multi-label classification:"),h=f(),y(p.$$.fragment)},l(n){s=r(n,"P",{});var c=i(s);b=d(c,"Example of multi-label classification:"),c.forEach(o),h=g(n),w(p.$$.fragment,n)},m(n,c){M(n,s,c),e(s,b),M(n,h,c),T(p,n,c),_=!0},p:Re,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){k(p.$$.fragment,n),_=!1},d(n){n&&o(s),n&&o(h),J(p,n)}}}function Vr($){let s,b,h,p,_;return{c(){s=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),p=l("Module"),_=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){s=r(n,"P",{});var c=i(s);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(c,"CODE",{});var j=i(h);p=d(j,"Module"),j.forEach(o),_=d(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){M(n,s,c),e(s,b),e(s,h),e(h,p),e(s,_)},d(n){n&&o(s)}}}function Sr($){let s,b,h,p,_;return p=new qe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNcmFGb3JNdWx0aXBsZUNob2ljZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydXctbWFkaXNvbiUyRm1yYS1iYXNlLTUxMi00JTIyKSUwQW1vZGVsJTIwJTNEJTIwTXJhRm9yTXVsdGlwbGVDaG9pY2UuZnJvbV9wcmV0cmFpbmVkKCUyMnV3LW1hZGlzb24lMkZtcmEtYmFzZS01MTItNCUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJJbiUyMEl0YWx5JTJDJTIwcGl6emElMjBzZXJ2ZWQlMjBpbiUyMGZvcm1hbCUyMHNldHRpbmdzJTJDJTIwc3VjaCUyMGFzJTIwYXQlMjBhJTIwcmVzdGF1cmFudCUyQyUyMGlzJTIwcHJlc2VudGVkJTIwdW5zbGljZWQuJTIyJTBBY2hvaWNlMCUyMCUzRCUyMCUyMkl0JTIwaXMlMjBlYXRlbiUyMHdpdGglMjBhJTIwZm9yayUyMGFuZCUyMGElMjBrbmlmZS4lMjIlMEFjaG9pY2UxJTIwJTNEJTIwJTIySXQlMjBpcyUyMGVhdGVuJTIwd2hpbGUlMjBoZWxkJTIwaW4lMjB0aGUlMjBoYW5kLiUyMiUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvcigwKS51bnNxdWVlemUoMCklMjAlMjAlMjMlMjBjaG9pY2UwJTIwaXMlMjBjb3JyZWN0JTIwKGFjY29yZGluZyUyMHRvJTIwV2lraXBlZGlhJTIwJTNCKSklMkMlMjBiYXRjaCUyMHNpemUlMjAxJTBBJTBBZW5jb2RpbmclMjAlM0QlMjB0b2tlbml6ZXIoJTVCcHJvbXB0JTJDJTIwcHJvbXB0JTVEJTJDJTIwJTVCY2hvaWNlMCUyQyUyMGNob2ljZTElNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqJTdCayUzQSUyMHYudW5zcXVlZXplKDApJTIwZm9yJTIwayUyQyUyMHYlMjBpbiUyMGVuY29kaW5nLml0ZW1zKCklN0QlMkMlMjBsYWJlbHMlM0RsYWJlbHMpJTIwJTIwJTIzJTIwYmF0Y2glMjBzaXplJTIwaXMlMjAxJTBBJTBBJTIzJTIwdGhlJTIwbGluZWFyJTIwY2xhc3NpZmllciUyMHN0aWxsJTIwbmVlZHMlMjB0byUyMGJlJTIwdHJhaW5lZCUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MraForMultipleChoice
<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;uw-madison/mra-base-512-4&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MraForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;uw-madison/mra-base-512-4&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(<span class="hljs-number">0</span>).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># choice0 is correct (according to Wikipedia ;)), batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**{k: v.unsqueeze(<span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}, labels=labels)  <span class="hljs-comment"># batch size is 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the linear classifier still needs to be trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){s=a("p"),b=l("Example:"),h=f(),y(p.$$.fragment)},l(n){s=r(n,"P",{});var c=i(s);b=d(c,"Example:"),c.forEach(o),h=g(n),w(p.$$.fragment,n)},m(n,c){M(n,s,c),e(s,b),M(n,h,c),T(p,n,c),_=!0},p:Re,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){k(p.$$.fragment,n),_=!1},d(n){n&&o(s),n&&o(h),J(p,n)}}}function Xr($){let s,b,h,p,_;return{c(){s=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),p=l("Module"),_=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){s=r(n,"P",{});var c=i(s);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(c,"CODE",{});var j=i(h);p=d(j,"Module"),j.forEach(o),_=d(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){M(n,s,c),e(s,b),e(s,h),e(h,p),e(s,_)},d(n){n&&o(s)}}}function Qr($){let s,b,h,p,_;return p=new qe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNcmFGb3JUb2tlbkNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ1dy1tYWRpc29uJTJGbXJhLWJhc2UtNTEyLTQlMjIpJTBBbW9kZWwlMjAlM0QlMjBNcmFGb3JUb2tlbkNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ1dy1tYWRpc29uJTJGbXJhLWJhc2UtNTEyLTQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUwQSUyMCUyMCUyMCUyMCUyMkh1Z2dpbmdGYWNlJTIwaXMlMjBhJTIwY29tcGFueSUyMGJhc2VkJTIwaW4lMjBQYXJpcyUyMGFuZCUyME5ldyUyMFlvcmslMjIlMkMlMjBhZGRfc3BlY2lhbF90b2tlbnMlM0RGYWxzZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMEEpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSklMEElMEElMjMlMjBOb3RlJTIwdGhhdCUyMHRva2VucyUyMGFyZSUyMGNsYXNzaWZpZWQlMjByYXRoZXIlMjB0aGVuJTIwaW5wdXQlMjB3b3JkcyUyMHdoaWNoJTIwbWVhbnMlMjB0aGF0JTBBJTIzJTIwdGhlcmUlMjBtaWdodCUyMGJlJTIwbW9yZSUyMHByZWRpY3RlZCUyMHRva2VuJTIwY2xhc3NlcyUyMHRoYW4lMjB3b3Jkcy4lMEElMjMlMjBNdWx0aXBsZSUyMHRva2VuJTIwY2xhc3NlcyUyMG1pZ2h0JTIwYWNjb3VudCUyMGZvciUyMHRoZSUyMHNhbWUlMjB3b3JkJTBBcHJlZGljdGVkX3Rva2Vuc19jbGFzc2VzJTIwJTNEJTIwJTVCbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCdC5pdGVtKCklNUQlMjBmb3IlMjB0JTIwaW4lMjBwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTVCMCU1RCU1RCUwQSUwQWxhYmVscyUyMCUzRCUyMHByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlMEFsb3NzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMpLmxvc3M=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MraForTokenClassification
<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;uw-madison/mra-base-512-4&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MraForTokenClassification.from_pretrained(<span class="hljs-string">&quot;uw-madison/mra-base-512-4&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(){s=a("p"),b=l("Example:"),h=f(),y(p.$$.fragment)},l(n){s=r(n,"P",{});var c=i(s);b=d(c,"Example:"),c.forEach(o),h=g(n),w(p.$$.fragment,n)},m(n,c){M(n,s,c),e(s,b),M(n,h,c),T(p,n,c),_=!0},p:Re,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){k(p.$$.fragment,n),_=!1},d(n){n&&o(s),n&&o(h),J(p,n)}}}function Yr($){let s,b,h,p,_;return{c(){s=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),p=l("Module"),_=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){s=r(n,"P",{});var c=i(s);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(c,"CODE",{});var j=i(h);p=d(j,"Module"),j.forEach(o),_=d(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){M(n,s,c),e(s,b),e(s,h),e(h,p),e(s,_)},d(n){n&&o(s)}}}function Hr($){let s,b,h,p,_;return p=new qe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNcmFGb3JRdWVzdGlvbkFuc3dlcmluZyUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydXctbWFkaXNvbiUyRm1yYS1iYXNlLTUxMi00JTIyKSUwQW1vZGVsJTIwJTNEJTIwTXJhRm9yUXVlc3Rpb25BbnN3ZXJpbmcuZnJvbV9wcmV0cmFpbmVkKCUyMnV3LW1hZGlzb24lMkZtcmEtYmFzZS01MTItNCUyMiklMEElMEFxdWVzdGlvbiUyQyUyMHRleHQlMjAlM0QlMjAlMjJXaG8lMjB3YXMlMjBKaW0lMjBIZW5zb24lM0YlMjIlMkMlMjAlMjJKaW0lMjBIZW5zb24lMjB3YXMlMjBhJTIwbmljZSUyMHB1cHBldCUyMiUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihxdWVzdGlvbiUyQyUyMHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNEJTIwb3V0cHV0cy5zdGFydF9sb2dpdHMuYXJnbWF4KCklMEFhbnN3ZXJfZW5kX2luZGV4JTIwJTNEJTIwb3V0cHV0cy5lbmRfbG9naXRzLmFyZ21heCgpJTBBJTBBcHJlZGljdF9hbnN3ZXJfdG9rZW5zJTIwJTNEJTIwaW5wdXRzLmlucHV0X2lkcyU1QjAlMkMlMjBhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0ElMjBhbnN3ZXJfZW5kX2luZGV4JTIwJTJCJTIwMSU1RCUwQSUwQSUyMyUyMHRhcmdldCUyMGlzJTIwJTIybmljZSUyMHB1cHBldCUyMiUwQXRhcmdldF9zdGFydF9pbmRleCUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxNCU1RCklMEF0YXJnZXRfZW5kX2luZGV4JTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QjE1JTVEKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMHN0YXJ0X3Bvc2l0aW9ucyUzRHRhcmdldF9zdGFydF9pbmRleCUyQyUyMGVuZF9wb3NpdGlvbnMlM0R0YXJnZXRfZW5kX2luZGV4KSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3M=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MraForQuestionAnswering
<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;uw-madison/mra-base-512-4&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MraForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;uw-madison/mra-base-512-4&quot;</span>)

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){s=a("p"),b=l("Example:"),h=f(),y(p.$$.fragment)},l(n){s=r(n,"P",{});var c=i(s);b=d(c,"Example:"),c.forEach(o),h=g(n),w(p.$$.fragment,n)},m(n,c){M(n,s,c),e(s,b),M(n,h,c),T(p,n,c),_=!0},p:Re,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){k(p.$$.fragment,n),_=!1},d(n){n&&o(s),n&&o(h),J(p,n)}}}function Lr($){let s,b,h,p,_,n,c,j,_n,Bo,X,de,no,Ae,Mn,so,bn,Ro,ce,yn,Ve,wn,Tn,qo,Ct,vn,Ao,Ft,Se,kn,Xe,Jn,$n,Vo,V,jn,Qe,Un,Cn,Ye,Fn,zn,So,Q,pe,ao,He,Wn,ro,En,Xo,C,Le,In,Y,xn,zt,Zn,Nn,Pe,Gn,Bn,Rn,H,qn,Wt,An,Vn,Et,Sn,Xn,Qn,he,Qo,L,me,io,Oe,Yn,lo,Hn,Yo,Z,De,Ln,Ke,Pn,et,On,Dn,Kn,z,tt,es,P,ts,It,os,ns,co,ss,as,rs,ue,is,fe,Ho,O,ge,po,ot,ls,ho,ds,Lo,N,nt,cs,D,ps,mo,hs,ms,st,us,fs,gs,W,at,_s,K,Ms,xt,bs,ys,uo,ws,Ts,vs,_e,ks,Me,Po,ee,be,fo,rt,Js,go,$s,Oo,G,it,js,lt,Us,dt,Cs,Fs,zs,U,ct,Ws,te,Es,Zt,Is,xs,_o,Zs,Ns,Gs,ye,Bs,we,Rs,Te,Do,oe,ve,Mo,pt,qs,bo,As,Ko,B,ht,Vs,mt,Ss,ut,Xs,Qs,Ys,E,ft,Hs,ne,Ls,Nt,Ps,Os,yo,Ds,Ks,ea,ke,ta,Je,en,se,$e,wo,gt,oa,To,na,tn,R,_t,sa,Mt,aa,bt,ra,ia,la,I,yt,da,ae,ca,Gt,pa,ha,vo,ma,ua,fa,je,ga,Ue,on,re,Ce,ko,wt,_a,Jo,Ma,nn,q,Tt,ba,A,ya,$o,wa,Ta,jo,va,ka,vt,Ja,$a,ja,x,kt,Ua,ie,Ca,Bt,Fa,za,Uo,Wa,Ea,Ia,Fe,xa,ze,sn;return n=new le({}),Ae=new le({}),He=new le({}),Le=new F({props:{name:"class transformers.MraConfig",anchor:"transformers.MraConfig",parameters:[{name:"vocab_size",val:" = 50265"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 1"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"block_per_row",val:" = 4"},{name:"approx_mode",val:" = 'full'"},{name:"initial_prior_first_n_blocks",val:" = 0"},{name:"initial_prior_diagonal_n_blocks",val:" = 0"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MraConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50265) &#x2014;
Vocabulary size of the Mra model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraModel">MraModel</a>.`,name:"vocab_size"},{anchor:"transformers.MraConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimension of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.MraConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.MraConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.MraConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.MraConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.MraConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.MraConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.MraConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.MraConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraModel">MraModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.MraConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.MraConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.MraConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>.`,name:"position_embedding_type"},{anchor:"transformers.MraConfig.block_per_row",description:`<strong>block_per_row</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Used to set the budget for the high resolution scale.`,name:"block_per_row"},{anchor:"transformers.MraConfig.approx_mode",description:`<strong>approx_mode</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;full&quot;</code>) &#x2014;
Controls whether both low and high resolution approximations are used. Set to <code>&quot;full&quot;</code> for both low and
high resolution and <code>&quot;sparse&quot;</code> for only low resolution.`,name:"approx_mode"},{anchor:"transformers.MraConfig.initial_prior_first_n_blocks",description:`<strong>initial_prior_first_n_blocks</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The initial number of blocks for which high resolution is used.`,name:"initial_prior_first_n_blocks"},{anchor:"transformers.MraConfig.initial_prior_diagonal_n_blocks",description:`<strong>initial_prior_diagonal_n_blocks</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The number of diagonal blocks for which high resolution is used.`,name:"initial_prior_diagonal_n_blocks"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/mra/configuration_mra.py#L28"}}),he=new Be({props:{anchor:"transformers.MraConfig.example",$$slots:{default:[xr]},$$scope:{ctx:$}}}),Oe=new le({}),De=new F({props:{name:"class transformers.MraModel",anchor:"transformers.MraModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MraModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraConfig">MraConfig</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.33.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.33.0/src/transformers/models/mra/modeling_mra.py#L941"}}),tt=new F({props:{name:"forward",anchor:"transformers.MraModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MraModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.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.MraModel.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.MraModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.MraModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.MraModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.MraModel.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MraModel.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.MraModel.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.33.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.33.0/src/transformers/models/mra/modeling_mra.py#L966",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithCrossAttentions</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.33.0/en/model_doc/mra#transformers.MraConfig"
>MraConfig</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>
</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.33.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ue=new oo({props:{$$slots:{default:[Zr]},$$scope:{ctx:$}}}),fe=new Be({props:{anchor:"transformers.MraModel.forward.example",$$slots:{default:[Nr]},$$scope:{ctx:$}}}),ot=new le({}),nt=new F({props:{name:"class transformers.MraForMaskedLM",anchor:"transformers.MraForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MraForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraConfig">MraConfig</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.33.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.33.0/src/transformers/models/mra/modeling_mra.py#L1050"}}),at=new F({props:{name:"forward",anchor:"transformers.MraForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MraForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.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.MraForMaskedLM.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.MraForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.MraForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.MraForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.MraForMaskedLM.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MraForMaskedLM.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.MraForMaskedLM.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MraForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/mra/modeling_mra.py#L1068",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</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.33.0/en/model_doc/mra#transformers.MraConfig"
>MraConfig</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 Masked language modeling (MLM) loss.</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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_e=new oo({props:{$$slots:{default:[Gr]},$$scope:{ctx:$}}}),Me=new Be({props:{anchor:"transformers.MraForMaskedLM.forward.example",$$slots:{default:[Br]},$$scope:{ctx:$}}}),rt=new le({}),it=new F({props:{name:"class transformers.MraForSequenceClassification",anchor:"transformers.MraForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MraForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraConfig">MraConfig</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.33.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.33.0/src/transformers/models/mra/modeling_mra.py#L1152"}}),ct=new F({props:{name:"forward",anchor:"transformers.MraForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MraForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.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.MraForSequenceClassification.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.MraForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.MraForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.MraForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.MraForSequenceClassification.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MraForSequenceClassification.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.MraForSequenceClassification.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MraForSequenceClassification.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.33.0/src/transformers/models/mra/modeling_mra.py#L1162",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</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.33.0/en/model_doc/mra#transformers.MraConfig"
>MraConfig</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>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.33.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ye=new oo({props:{$$slots:{default:[Rr]},$$scope:{ctx:$}}}),we=new Be({props:{anchor:"transformers.MraForSequenceClassification.forward.example",$$slots:{default:[qr]},$$scope:{ctx:$}}}),Te=new Be({props:{anchor:"transformers.MraForSequenceClassification.forward.example-2",$$slots:{default:[Ar]},$$scope:{ctx:$}}}),pt=new le({}),ht=new F({props:{name:"class transformers.MraForMultipleChoice",anchor:"transformers.MraForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MraForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraConfig">MraConfig</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.33.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.33.0/src/transformers/models/mra/modeling_mra.py#L1241"}}),ft=new F({props:{name:"forward",anchor:"transformers.MraForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MraForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.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.MraForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, 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.MraForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.MraForMultipleChoice.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.MraForMultipleChoice.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.MraForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, 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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MraForMultipleChoice.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.MraForMultipleChoice.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MraForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/mra/modeling_mra.py#L1252",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</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.33.0/en/model_doc/mra#transformers.MraConfig"
>MraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <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, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>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.33.0/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ke=new oo({props:{$$slots:{default:[Vr]},$$scope:{ctx:$}}}),Je=new Be({props:{anchor:"transformers.MraForMultipleChoice.forward.example",$$slots:{default:[Sr]},$$scope:{ctx:$}}}),gt=new le({}),_t=new F({props:{name:"class transformers.MraForTokenClassification",anchor:"transformers.MraForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MraForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraConfig">MraConfig</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.33.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.33.0/src/transformers/models/mra/modeling_mra.py#L1330"}}),yt=new F({props:{name:"forward",anchor:"transformers.MraForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MraForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.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.MraForTokenClassification.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.MraForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.MraForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.MraForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.MraForTokenClassification.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MraForTokenClassification.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.MraForTokenClassification.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MraForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/mra/modeling_mra.py#L1342",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/mra#transformers.MraConfig"
>MraConfig</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.33.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),je=new oo({props:{$$slots:{default:[Xr]},$$scope:{ctx:$}}}),Ue=new Be({props:{anchor:"transformers.MraForTokenClassification.forward.example",$$slots:{default:[Qr]},$$scope:{ctx:$}}}),wt=new le({}),Tt=new F({props:{name:"class transformers.MraForQuestionAnswering",anchor:"transformers.MraForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MraForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraConfig">MraConfig</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.33.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.33.0/src/transformers/models/mra/modeling_mra.py#L1413"}}),kt=new F({props:{name:"forward",anchor:"transformers.MraForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"end_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MraForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.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.MraForQuestionAnswering.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.MraForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.MraForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.MraForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.MraForQuestionAnswering.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MraForQuestionAnswering.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.MraForQuestionAnswering.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MraForQuestionAnswering.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.MraForQuestionAnswering.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.33.0/src/transformers/models/mra/modeling_mra.py#L1426",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraConfig"
>MraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fe=new oo({props:{$$slots:{default:[Yr]},$$scope:{ctx:$}}}),ze=new Be({props:{anchor:"transformers.MraForQuestionAnswering.forward.example",$$slots:{default:[Hr]},$$scope:{ctx:$}}}),{c(){s=a("meta"),b=f(),h=a("h1"),p=a("a"),_=a("span"),y(n.$$.fragment),c=f(),j=a("span"),_n=l("MRA"),Bo=f(),X=a("h2"),de=a("a"),no=a("span"),y(Ae.$$.fragment),Mn=f(),so=a("span"),bn=l("Overview"),Ro=f(),ce=a("p"),yn=l("The MRA model was proposed in "),Ve=a("a"),wn=l("Multi Resolution Analysis (MRA) for Approximate Self-Attention"),Tn=l(" by Zhanpeng Zeng, Sourav Pal, Jeffery Kline, Glenn M Fung, and Vikas Singh."),qo=f(),Ct=a("p"),vn=l("The abstract from the paper is the following:"),Ao=f(),Ft=a("p"),Se=a("em"),kn=l("Transformers have emerged as a preferred model for many tasks in natural langugage processing and vision. Recent efforts on training and deploying Transformers more efficiently have identified many strategies to approximate the self-attention matrix, a key module in a Transformer architecture. Effective ideas include various prespecified sparsity patterns, low-rank basis expansions and combinations thereof. In this paper, we revisit classical Multiresolution Analysis (MRA) concepts such as Wavelets, whose potential value in this setting remains underexplored thus far. We show that simple approximations based on empirical feedback and design choices informed by modern hardware and implementation challenges, eventually yield a MRA-based approach for self-attention with an excellent performance profile across most criteria of interest. We undertake an extensive set of experiments and demonstrate that this multi-resolution scheme outperforms most efficient self-attention proposals and is favorable for both short and long sequences. Code is available at "),Xe=a("a"),Jn=l("https://github.com/mlpen/mra-attention"),$n=l("."),Vo=f(),V=a("p"),jn=l("This model was contributed by "),Qe=a("a"),Un=l("novice03"),Cn=l(`.
The original code can be found `),Ye=a("a"),Fn=l("here"),zn=l("."),So=f(),Q=a("h2"),pe=a("a"),ao=a("span"),y(He.$$.fragment),Wn=f(),ro=a("span"),En=l("MraConfig"),Xo=f(),C=a("div"),y(Le.$$.fragment),In=f(),Y=a("p"),xn=l("This is the configuration class to store the configuration of a "),zt=a("a"),Zn=l("MraModel"),Nn=l(`. It is used to instantiate an MRA
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Mra
`),Pe=a("a"),Gn=l("uw-madison/mra-base-512-4"),Bn=l(" architecture."),Rn=f(),H=a("p"),qn=l("Configuration objects inherit from "),Wt=a("a"),An=l("PretrainedConfig"),Vn=l(` and can be used to control the model outputs. Read the
documentation from `),Et=a("a"),Sn=l("PretrainedConfig"),Xn=l(" for more information."),Qn=f(),y(he.$$.fragment),Qo=f(),L=a("h2"),me=a("a"),io=a("span"),y(Oe.$$.fragment),Yn=f(),lo=a("span"),Hn=l("MraModel"),Yo=f(),Z=a("div"),y(De.$$.fragment),Ln=f(),Ke=a("p"),Pn=l(`The bare MRA Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),et=a("a"),On=l("torch.nn.Module"),Dn=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Kn=f(),z=a("div"),y(tt.$$.fragment),es=f(),P=a("p"),ts=l("The "),It=a("a"),os=l("MraModel"),ns=l(" forward method, overrides the "),co=a("code"),ss=l("__call__"),as=l(" special method."),rs=f(),y(ue.$$.fragment),is=f(),y(fe.$$.fragment),Ho=f(),O=a("h2"),ge=a("a"),po=a("span"),y(ot.$$.fragment),ls=f(),ho=a("span"),ds=l("MraForMaskedLM"),Lo=f(),N=a("div"),y(nt.$$.fragment),cs=f(),D=a("p"),ps=l("MRA Model with a "),mo=a("code"),hs=l("language modeling"),ms=l(` head on top.
This model is a PyTorch `),st=a("a"),us=l("torch.nn.Module"),fs=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),gs=f(),W=a("div"),y(at.$$.fragment),_s=f(),K=a("p"),Ms=l("The "),xt=a("a"),bs=l("MraForMaskedLM"),ys=l(" forward method, overrides the "),uo=a("code"),ws=l("__call__"),Ts=l(" special method."),vs=f(),y(_e.$$.fragment),ks=f(),y(Me.$$.fragment),Po=f(),ee=a("h2"),be=a("a"),fo=a("span"),y(rt.$$.fragment),Js=f(),go=a("span"),$s=l("MraForSequenceClassification"),Oo=f(),G=a("div"),y(it.$$.fragment),js=f(),lt=a("p"),Us=l(`MRA Model transformer with a sequence classification/regression head on top (a linear layer on top of
the pooled output) e.g. for GLUE tasks.
This model is a PyTorch `),dt=a("a"),Cs=l("torch.nn.Module"),Fs=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),zs=f(),U=a("div"),y(ct.$$.fragment),Ws=f(),te=a("p"),Es=l("The "),Zt=a("a"),Is=l("MraForSequenceClassification"),xs=l(" forward method, overrides the "),_o=a("code"),Zs=l("__call__"),Ns=l(" special method."),Gs=f(),y(ye.$$.fragment),Bs=f(),y(we.$$.fragment),Rs=f(),y(Te.$$.fragment),Do=f(),oe=a("h2"),ve=a("a"),Mo=a("span"),y(pt.$$.fragment),qs=f(),bo=a("span"),As=l("MraForMultipleChoice"),Ko=f(),B=a("div"),y(ht.$$.fragment),Vs=f(),mt=a("p"),Ss=l(`MRA Model with a multiple choice classification head on top (a linear layer on top of
the pooled output and a softmax) e.g. for RocStories/SWAG tasks.
This model is a PyTorch `),ut=a("a"),Xs=l("torch.nn.Module"),Qs=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ys=f(),E=a("div"),y(ft.$$.fragment),Hs=f(),ne=a("p"),Ls=l("The "),Nt=a("a"),Ps=l("MraForMultipleChoice"),Os=l(" forward method, overrides the "),yo=a("code"),Ds=l("__call__"),Ks=l(" special method."),ea=f(),y(ke.$$.fragment),ta=f(),y(Je.$$.fragment),en=f(),se=a("h2"),$e=a("a"),wo=a("span"),y(gt.$$.fragment),oa=f(),To=a("span"),na=l("MraForTokenClassification"),tn=f(),R=a("div"),y(_t.$$.fragment),sa=f(),Mt=a("p"),aa=l(`MRA 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.
This model is a PyTorch `),bt=a("a"),ra=l("torch.nn.Module"),ia=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),la=f(),I=a("div"),y(yt.$$.fragment),da=f(),ae=a("p"),ca=l("The "),Gt=a("a"),pa=l("MraForTokenClassification"),ha=l(" forward method, overrides the "),vo=a("code"),ma=l("__call__"),ua=l(" special method."),fa=f(),y(je.$$.fragment),ga=f(),y(Ue.$$.fragment),on=f(),re=a("h2"),Ce=a("a"),ko=a("span"),y(wt.$$.fragment),_a=f(),Jo=a("span"),Ma=l("MraForQuestionAnswering"),nn=f(),q=a("div"),y(Tt.$$.fragment),ba=f(),A=a("p"),ya=l(`MRA Model 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 `),$o=a("code"),wa=l("span start logits"),Ta=l(" and "),jo=a("code"),va=l("span end logits"),ka=l(`).
This model is a PyTorch `),vt=a("a"),Ja=l("torch.nn.Module"),$a=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ja=f(),x=a("div"),y(kt.$$.fragment),Ua=f(),ie=a("p"),Ca=l("The "),Bt=a("a"),Fa=l("MraForQuestionAnswering"),za=l(" forward method, overrides the "),Uo=a("code"),Wa=l("__call__"),Ea=l(" special method."),Ia=f(),y(Fe.$$.fragment),xa=f(),y(ze.$$.fragment),this.h()},l(t){const u=Er('[data-svelte="svelte-1phssyn"]',document.head);s=r(u,"META",{name:!0,content:!0}),u.forEach(o),b=g(t),h=r(t,"H1",{class:!0});var Jt=i(h);p=r(Jt,"A",{id:!0,class:!0,href:!0});var Co=i(p);_=r(Co,"SPAN",{});var Fo=i(_);w(n.$$.fragment,Fo),Fo.forEach(o),Co.forEach(o),c=g(Jt),j=r(Jt,"SPAN",{});var zo=i(j);_n=d(zo,"MRA"),zo.forEach(o),Jt.forEach(o),Bo=g(t),X=r(t,"H2",{class:!0});var $t=i(X);de=r($t,"A",{id:!0,class:!0,href:!0});var Wo=i(de);no=r(Wo,"SPAN",{});var Eo=i(no);w(Ae.$$.fragment,Eo),Eo.forEach(o),Wo.forEach(o),Mn=g($t),so=r($t,"SPAN",{});var Io=i(so);bn=d(Io,"Overview"),Io.forEach(o),$t.forEach(o),Ro=g(t),ce=r(t,"P",{});var jt=i(ce);yn=d(jt,"The MRA model was proposed in "),Ve=r(jt,"A",{href:!0,rel:!0});var xo=i(Ve);wn=d(xo,"Multi Resolution Analysis (MRA) for Approximate Self-Attention"),xo.forEach(o),Tn=d(jt," by Zhanpeng Zeng, Sourav Pal, Jeffery Kline, Glenn M Fung, and Vikas Singh."),jt.forEach(o),qo=g(t),Ct=r(t,"P",{});var Zo=i(Ct);vn=d(Zo,"The abstract from the paper is the following:"),Zo.forEach(o),Ao=g(t),Ft=r(t,"P",{});var No=i(Ft);Se=r(No,"EM",{});var Ut=i(Se);kn=d(Ut,"Transformers have emerged as a preferred model for many tasks in natural langugage processing and vision. Recent efforts on training and deploying Transformers more efficiently have identified many strategies to approximate the self-attention matrix, a key module in a Transformer architecture. Effective ideas include various prespecified sparsity patterns, low-rank basis expansions and combinations thereof. In this paper, we revisit classical Multiresolution Analysis (MRA) concepts such as Wavelets, whose potential value in this setting remains underexplored thus far. We show that simple approximations based on empirical feedback and design choices informed by modern hardware and implementation challenges, eventually yield a MRA-based approach for self-attention with an excellent performance profile across most criteria of interest. We undertake an extensive set of experiments and demonstrate that this multi-resolution scheme outperforms most efficient self-attention proposals and is favorable for both short and long sequences. Code is available at "),Xe=r(Ut,"A",{href:!0,rel:!0});var Go=i(Xe);Jn=d(Go,"https://github.com/mlpen/mra-attention"),Go.forEach(o),$n=d(Ut,"."),Ut.forEach(o),No.forEach(o),Vo=g(t),V=r(t,"P",{});var Rt=i(V);jn=d(Rt,"This model was contributed by "),Qe=r(Rt,"A",{href:!0,rel:!0});var Za=i(Qe);Un=d(Za,"novice03"),Za.forEach(o),Cn=d(Rt,`.
The original code can be found `),Ye=r(Rt,"A",{href:!0,rel:!0});var Na=i(Ye);Fn=d(Na,"here"),Na.forEach(o),zn=d(Rt,"."),Rt.forEach(o),So=g(t),Q=r(t,"H2",{class:!0});var an=i(Q);pe=r(an,"A",{id:!0,class:!0,href:!0});var Ga=i(pe);ao=r(Ga,"SPAN",{});var Ba=i(ao);w(He.$$.fragment,Ba),Ba.forEach(o),Ga.forEach(o),Wn=g(an),ro=r(an,"SPAN",{});var Ra=i(ro);En=d(Ra,"MraConfig"),Ra.forEach(o),an.forEach(o),Xo=g(t),C=r(t,"DIV",{class:!0});var We=i(C);w(Le.$$.fragment,We),In=g(We),Y=r(We,"P",{});var qt=i(Y);xn=d(qt,"This is the configuration class to store the configuration of a "),zt=r(qt,"A",{href:!0});var qa=i(zt);Zn=d(qa,"MraModel"),qa.forEach(o),Nn=d(qt,`. It is used to instantiate an MRA
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Mra
`),Pe=r(qt,"A",{href:!0,rel:!0});var Aa=i(Pe);Gn=d(Aa,"uw-madison/mra-base-512-4"),Aa.forEach(o),Bn=d(qt," architecture."),qt.forEach(o),Rn=g(We),H=r(We,"P",{});var At=i(H);qn=d(At,"Configuration objects inherit from "),Wt=r(At,"A",{href:!0});var Va=i(Wt);An=d(Va,"PretrainedConfig"),Va.forEach(o),Vn=d(At,` and can be used to control the model outputs. Read the
documentation from `),Et=r(At,"A",{href:!0});var Sa=i(Et);Sn=d(Sa,"PretrainedConfig"),Sa.forEach(o),Xn=d(At," for more information."),At.forEach(o),Qn=g(We),w(he.$$.fragment,We),We.forEach(o),Qo=g(t),L=r(t,"H2",{class:!0});var rn=i(L);me=r(rn,"A",{id:!0,class:!0,href:!0});var Xa=i(me);io=r(Xa,"SPAN",{});var Qa=i(io);w(Oe.$$.fragment,Qa),Qa.forEach(o),Xa.forEach(o),Yn=g(rn),lo=r(rn,"SPAN",{});var Ya=i(lo);Hn=d(Ya,"MraModel"),Ya.forEach(o),rn.forEach(o),Yo=g(t),Z=r(t,"DIV",{class:!0});var Vt=i(Z);w(De.$$.fragment,Vt),Ln=g(Vt),Ke=r(Vt,"P",{});var ln=i(Ke);Pn=d(ln,`The bare MRA Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),et=r(ln,"A",{href:!0,rel:!0});var Ha=i(et);On=d(Ha,"torch.nn.Module"),Ha.forEach(o),Dn=d(ln,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ln.forEach(o),Kn=g(Vt),z=r(Vt,"DIV",{class:!0});var Ee=i(z);w(tt.$$.fragment,Ee),es=g(Ee),P=r(Ee,"P",{});var St=i(P);ts=d(St,"The "),It=r(St,"A",{href:!0});var La=i(It);os=d(La,"MraModel"),La.forEach(o),ns=d(St," forward method, overrides the "),co=r(St,"CODE",{});var Pa=i(co);ss=d(Pa,"__call__"),Pa.forEach(o),as=d(St," special method."),St.forEach(o),rs=g(Ee),w(ue.$$.fragment,Ee),is=g(Ee),w(fe.$$.fragment,Ee),Ee.forEach(o),Vt.forEach(o),Ho=g(t),O=r(t,"H2",{class:!0});var dn=i(O);ge=r(dn,"A",{id:!0,class:!0,href:!0});var Oa=i(ge);po=r(Oa,"SPAN",{});var Da=i(po);w(ot.$$.fragment,Da),Da.forEach(o),Oa.forEach(o),ls=g(dn),ho=r(dn,"SPAN",{});var Ka=i(ho);ds=d(Ka,"MraForMaskedLM"),Ka.forEach(o),dn.forEach(o),Lo=g(t),N=r(t,"DIV",{class:!0});var Xt=i(N);w(nt.$$.fragment,Xt),cs=g(Xt),D=r(Xt,"P",{});var Qt=i(D);ps=d(Qt,"MRA Model with a "),mo=r(Qt,"CODE",{});var er=i(mo);hs=d(er,"language modeling"),er.forEach(o),ms=d(Qt,` head on top.
This model is a PyTorch `),st=r(Qt,"A",{href:!0,rel:!0});var tr=i(st);us=d(tr,"torch.nn.Module"),tr.forEach(o),fs=d(Qt,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Qt.forEach(o),gs=g(Xt),W=r(Xt,"DIV",{class:!0});var Ie=i(W);w(at.$$.fragment,Ie),_s=g(Ie),K=r(Ie,"P",{});var Yt=i(K);Ms=d(Yt,"The "),xt=r(Yt,"A",{href:!0});var or=i(xt);bs=d(or,"MraForMaskedLM"),or.forEach(o),ys=d(Yt," forward method, overrides the "),uo=r(Yt,"CODE",{});var nr=i(uo);ws=d(nr,"__call__"),nr.forEach(o),Ts=d(Yt," special method."),Yt.forEach(o),vs=g(Ie),w(_e.$$.fragment,Ie),ks=g(Ie),w(Me.$$.fragment,Ie),Ie.forEach(o),Xt.forEach(o),Po=g(t),ee=r(t,"H2",{class:!0});var cn=i(ee);be=r(cn,"A",{id:!0,class:!0,href:!0});var sr=i(be);fo=r(sr,"SPAN",{});var ar=i(fo);w(rt.$$.fragment,ar),ar.forEach(o),sr.forEach(o),Js=g(cn),go=r(cn,"SPAN",{});var rr=i(go);$s=d(rr,"MraForSequenceClassification"),rr.forEach(o),cn.forEach(o),Oo=g(t),G=r(t,"DIV",{class:!0});var Ht=i(G);w(it.$$.fragment,Ht),js=g(Ht),lt=r(Ht,"P",{});var pn=i(lt);Us=d(pn,`MRA Model transformer with a sequence classification/regression head on top (a linear layer on top of
the pooled output) e.g. for GLUE tasks.
This model is a PyTorch `),dt=r(pn,"A",{href:!0,rel:!0});var ir=i(dt);Cs=d(ir,"torch.nn.Module"),ir.forEach(o),Fs=d(pn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),pn.forEach(o),zs=g(Ht),U=r(Ht,"DIV",{class:!0});var S=i(U);w(ct.$$.fragment,S),Ws=g(S),te=r(S,"P",{});var Lt=i(te);Es=d(Lt,"The "),Zt=r(Lt,"A",{href:!0});var lr=i(Zt);Is=d(lr,"MraForSequenceClassification"),lr.forEach(o),xs=d(Lt," forward method, overrides the "),_o=r(Lt,"CODE",{});var dr=i(_o);Zs=d(dr,"__call__"),dr.forEach(o),Ns=d(Lt," special method."),Lt.forEach(o),Gs=g(S),w(ye.$$.fragment,S),Bs=g(S),w(we.$$.fragment,S),Rs=g(S),w(Te.$$.fragment,S),S.forEach(o),Ht.forEach(o),Do=g(t),oe=r(t,"H2",{class:!0});var hn=i(oe);ve=r(hn,"A",{id:!0,class:!0,href:!0});var cr=i(ve);Mo=r(cr,"SPAN",{});var pr=i(Mo);w(pt.$$.fragment,pr),pr.forEach(o),cr.forEach(o),qs=g(hn),bo=r(hn,"SPAN",{});var hr=i(bo);As=d(hr,"MraForMultipleChoice"),hr.forEach(o),hn.forEach(o),Ko=g(t),B=r(t,"DIV",{class:!0});var Pt=i(B);w(ht.$$.fragment,Pt),Vs=g(Pt),mt=r(Pt,"P",{});var mn=i(mt);Ss=d(mn,`MRA Model with a multiple choice classification head on top (a linear layer on top of
the pooled output and a softmax) e.g. for RocStories/SWAG tasks.
This model is a PyTorch `),ut=r(mn,"A",{href:!0,rel:!0});var mr=i(ut);Xs=d(mr,"torch.nn.Module"),mr.forEach(o),Qs=d(mn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),mn.forEach(o),Ys=g(Pt),E=r(Pt,"DIV",{class:!0});var xe=i(E);w(ft.$$.fragment,xe),Hs=g(xe),ne=r(xe,"P",{});var Ot=i(ne);Ls=d(Ot,"The "),Nt=r(Ot,"A",{href:!0});var ur=i(Nt);Ps=d(ur,"MraForMultipleChoice"),ur.forEach(o),Os=d(Ot," forward method, overrides the "),yo=r(Ot,"CODE",{});var fr=i(yo);Ds=d(fr,"__call__"),fr.forEach(o),Ks=d(Ot," special method."),Ot.forEach(o),ea=g(xe),w(ke.$$.fragment,xe),ta=g(xe),w(Je.$$.fragment,xe),xe.forEach(o),Pt.forEach(o),en=g(t),se=r(t,"H2",{class:!0});var un=i(se);$e=r(un,"A",{id:!0,class:!0,href:!0});var gr=i($e);wo=r(gr,"SPAN",{});var _r=i(wo);w(gt.$$.fragment,_r),_r.forEach(o),gr.forEach(o),oa=g(un),To=r(un,"SPAN",{});var Mr=i(To);na=d(Mr,"MraForTokenClassification"),Mr.forEach(o),un.forEach(o),tn=g(t),R=r(t,"DIV",{class:!0});var Dt=i(R);w(_t.$$.fragment,Dt),sa=g(Dt),Mt=r(Dt,"P",{});var fn=i(Mt);aa=d(fn,`MRA 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.
This model is a PyTorch `),bt=r(fn,"A",{href:!0,rel:!0});var br=i(bt);ra=d(br,"torch.nn.Module"),br.forEach(o),ia=d(fn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),fn.forEach(o),la=g(Dt),I=r(Dt,"DIV",{class:!0});var Ze=i(I);w(yt.$$.fragment,Ze),da=g(Ze),ae=r(Ze,"P",{});var Kt=i(ae);ca=d(Kt,"The "),Gt=r(Kt,"A",{href:!0});var yr=i(Gt);pa=d(yr,"MraForTokenClassification"),yr.forEach(o),ha=d(Kt," forward method, overrides the "),vo=r(Kt,"CODE",{});var wr=i(vo);ma=d(wr,"__call__"),wr.forEach(o),ua=d(Kt," special method."),Kt.forEach(o),fa=g(Ze),w(je.$$.fragment,Ze),ga=g(Ze),w(Ue.$$.fragment,Ze),Ze.forEach(o),Dt.forEach(o),on=g(t),re=r(t,"H2",{class:!0});var gn=i(re);Ce=r(gn,"A",{id:!0,class:!0,href:!0});var Tr=i(Ce);ko=r(Tr,"SPAN",{});var vr=i(ko);w(wt.$$.fragment,vr),vr.forEach(o),Tr.forEach(o),_a=g(gn),Jo=r(gn,"SPAN",{});var kr=i(Jo);Ma=d(kr,"MraForQuestionAnswering"),kr.forEach(o),gn.forEach(o),nn=g(t),q=r(t,"DIV",{class:!0});var eo=i(q);w(Tt.$$.fragment,eo),ba=g(eo),A=r(eo,"P",{});var Ne=i(A);ya=d(Ne,`MRA Model 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 `),$o=r(Ne,"CODE",{});var Jr=i($o);wa=d(Jr,"span start logits"),Jr.forEach(o),Ta=d(Ne," and "),jo=r(Ne,"CODE",{});var $r=i(jo);va=d($r,"span end logits"),$r.forEach(o),ka=d(Ne,`).
This model is a PyTorch `),vt=r(Ne,"A",{href:!0,rel:!0});var jr=i(vt);Ja=d(jr,"torch.nn.Module"),jr.forEach(o),$a=d(Ne,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ne.forEach(o),ja=g(eo),x=r(eo,"DIV",{class:!0});var Ge=i(x);w(kt.$$.fragment,Ge),Ua=g(Ge),ie=r(Ge,"P",{});var to=i(ie);Ca=d(to,"The "),Bt=r(to,"A",{href:!0});var Ur=i(Bt);Fa=d(Ur,"MraForQuestionAnswering"),Ur.forEach(o),za=d(to," forward method, overrides the "),Uo=r(to,"CODE",{});var Cr=i(Uo);Wa=d(Cr,"__call__"),Cr.forEach(o),Ea=d(to," special method."),to.forEach(o),Ia=g(Ge),w(Fe.$$.fragment,Ge),xa=g(Ge),w(ze.$$.fragment,Ge),Ge.forEach(o),eo.forEach(o),this.h()},h(){m(s,"name","hf:doc:metadata"),m(s,"content",JSON.stringify(Pr)),m(p,"id","mra"),m(p,"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"),m(p,"href","#mra"),m(h,"class","relative group"),m(de,"id","overview"),m(de,"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"),m(de,"href","#overview"),m(X,"class","relative group"),m(Ve,"href","https://arxiv.org/abs/2207.10284"),m(Ve,"rel","nofollow"),m(Xe,"href","https://github.com/mlpen/mra-attention"),m(Xe,"rel","nofollow"),m(Qe,"href","https://huggingface.co/novice03"),m(Qe,"rel","nofollow"),m(Ye,"href","https://github.com/mlpen/mra-attention"),m(Ye,"rel","nofollow"),m(pe,"id","transformers.MraConfig"),m(pe,"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"),m(pe,"href","#transformers.MraConfig"),m(Q,"class","relative group"),m(zt,"href","/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraModel"),m(Pe,"href","https://huggingface.co/uw-madison/mra-base-512-4"),m(Pe,"rel","nofollow"),m(Wt,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),m(Et,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),m(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(me,"id","transformers.MraModel"),m(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"),m(me,"href","#transformers.MraModel"),m(L,"class","relative group"),m(et,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(et,"rel","nofollow"),m(It,"href","/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraModel"),m(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ge,"id","transformers.MraForMaskedLM"),m(ge,"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"),m(ge,"href","#transformers.MraForMaskedLM"),m(O,"class","relative group"),m(st,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(st,"rel","nofollow"),m(xt,"href","/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraForMaskedLM"),m(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(be,"id","transformers.MraForSequenceClassification"),m(be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(be,"href","#transformers.MraForSequenceClassification"),m(ee,"class","relative group"),m(dt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(dt,"rel","nofollow"),m(Zt,"href","/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraForSequenceClassification"),m(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(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ve,"id","transformers.MraForMultipleChoice"),m(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(ve,"href","#transformers.MraForMultipleChoice"),m(oe,"class","relative group"),m(ut,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(ut,"rel","nofollow"),m(Nt,"href","/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraForMultipleChoice"),m(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m($e,"id","transformers.MraForTokenClassification"),m($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"),m($e,"href","#transformers.MraForTokenClassification"),m(se,"class","relative group"),m(bt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(bt,"rel","nofollow"),m(Gt,"href","/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraForTokenClassification"),m(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ce,"id","transformers.MraForQuestionAnswering"),m(Ce,"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"),m(Ce,"href","#transformers.MraForQuestionAnswering"),m(re,"class","relative group"),m(vt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(vt,"rel","nofollow"),m(Bt,"href","/docs/transformers/v4.33.0/en/model_doc/mra#transformers.MraForQuestionAnswering"),m(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(q,"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,u){e(document.head,s),M(t,b,u),M(t,h,u),e(h,p),e(p,_),T(n,_,null),e(h,c),e(h,j),e(j,_n),M(t,Bo,u),M(t,X,u),e(X,de),e(de,no),T(Ae,no,null),e(X,Mn),e(X,so),e(so,bn),M(t,Ro,u),M(t,ce,u),e(ce,yn),e(ce,Ve),e(Ve,wn),e(ce,Tn),M(t,qo,u),M(t,Ct,u),e(Ct,vn),M(t,Ao,u),M(t,Ft,u),e(Ft,Se),e(Se,kn),e(Se,Xe),e(Xe,Jn),e(Se,$n),M(t,Vo,u),M(t,V,u),e(V,jn),e(V,Qe),e(Qe,Un),e(V,Cn),e(V,Ye),e(Ye,Fn),e(V,zn),M(t,So,u),M(t,Q,u),e(Q,pe),e(pe,ao),T(He,ao,null),e(Q,Wn),e(Q,ro),e(ro,En),M(t,Xo,u),M(t,C,u),T(Le,C,null),e(C,In),e(C,Y),e(Y,xn),e(Y,zt),e(zt,Zn),e(Y,Nn),e(Y,Pe),e(Pe,Gn),e(Y,Bn),e(C,Rn),e(C,H),e(H,qn),e(H,Wt),e(Wt,An),e(H,Vn),e(H,Et),e(Et,Sn),e(H,Xn),e(C,Qn),T(he,C,null),M(t,Qo,u),M(t,L,u),e(L,me),e(me,io),T(Oe,io,null),e(L,Yn),e(L,lo),e(lo,Hn),M(t,Yo,u),M(t,Z,u),T(De,Z,null),e(Z,Ln),e(Z,Ke),e(Ke,Pn),e(Ke,et),e(et,On),e(Ke,Dn),e(Z,Kn),e(Z,z),T(tt,z,null),e(z,es),e(z,P),e(P,ts),e(P,It),e(It,os),e(P,ns),e(P,co),e(co,ss),e(P,as),e(z,rs),T(ue,z,null),e(z,is),T(fe,z,null),M(t,Ho,u),M(t,O,u),e(O,ge),e(ge,po),T(ot,po,null),e(O,ls),e(O,ho),e(ho,ds),M(t,Lo,u),M(t,N,u),T(nt,N,null),e(N,cs),e(N,D),e(D,ps),e(D,mo),e(mo,hs),e(D,ms),e(D,st),e(st,us),e(D,fs),e(N,gs),e(N,W),T(at,W,null),e(W,_s),e(W,K),e(K,Ms),e(K,xt),e(xt,bs),e(K,ys),e(K,uo),e(uo,ws),e(K,Ts),e(W,vs),T(_e,W,null),e(W,ks),T(Me,W,null),M(t,Po,u),M(t,ee,u),e(ee,be),e(be,fo),T(rt,fo,null),e(ee,Js),e(ee,go),e(go,$s),M(t,Oo,u),M(t,G,u),T(it,G,null),e(G,js),e(G,lt),e(lt,Us),e(lt,dt),e(dt,Cs),e(lt,Fs),e(G,zs),e(G,U),T(ct,U,null),e(U,Ws),e(U,te),e(te,Es),e(te,Zt),e(Zt,Is),e(te,xs),e(te,_o),e(_o,Zs),e(te,Ns),e(U,Gs),T(ye,U,null),e(U,Bs),T(we,U,null),e(U,Rs),T(Te,U,null),M(t,Do,u),M(t,oe,u),e(oe,ve),e(ve,Mo),T(pt,Mo,null),e(oe,qs),e(oe,bo),e(bo,As),M(t,Ko,u),M(t,B,u),T(ht,B,null),e(B,Vs),e(B,mt),e(mt,Ss),e(mt,ut),e(ut,Xs),e(mt,Qs),e(B,Ys),e(B,E),T(ft,E,null),e(E,Hs),e(E,ne),e(ne,Ls),e(ne,Nt),e(Nt,Ps),e(ne,Os),e(ne,yo),e(yo,Ds),e(ne,Ks),e(E,ea),T(ke,E,null),e(E,ta),T(Je,E,null),M(t,en,u),M(t,se,u),e(se,$e),e($e,wo),T(gt,wo,null),e(se,oa),e(se,To),e(To,na),M(t,tn,u),M(t,R,u),T(_t,R,null),e(R,sa),e(R,Mt),e(Mt,aa),e(Mt,bt),e(bt,ra),e(Mt,ia),e(R,la),e(R,I),T(yt,I,null),e(I,da),e(I,ae),e(ae,ca),e(ae,Gt),e(Gt,pa),e(ae,ha),e(ae,vo),e(vo,ma),e(ae,ua),e(I,fa),T(je,I,null),e(I,ga),T(Ue,I,null),M(t,on,u),M(t,re,u),e(re,Ce),e(Ce,ko),T(wt,ko,null),e(re,_a),e(re,Jo),e(Jo,Ma),M(t,nn,u),M(t,q,u),T(Tt,q,null),e(q,ba),e(q,A),e(A,ya),e(A,$o),e($o,wa),e(A,Ta),e(A,jo),e(jo,va),e(A,ka),e(A,vt),e(vt,Ja),e(A,$a),e(q,ja),e(q,x),T(kt,x,null),e(x,Ua),e(x,ie),e(ie,Ca),e(ie,Bt),e(Bt,Fa),e(ie,za),e(ie,Uo),e(Uo,Wa),e(ie,Ea),e(x,Ia),T(Fe,x,null),e(x,xa),T(ze,x,null),sn=!0},p(t,[u]){const Jt={};u&2&&(Jt.$$scope={dirty:u,ctx:t}),he.$set(Jt);const Co={};u&2&&(Co.$$scope={dirty:u,ctx:t}),ue.$set(Co);const Fo={};u&2&&(Fo.$$scope={dirty:u,ctx:t}),fe.$set(Fo);const zo={};u&2&&(zo.$$scope={dirty:u,ctx:t}),_e.$set(zo);const $t={};u&2&&($t.$$scope={dirty:u,ctx:t}),Me.$set($t);const Wo={};u&2&&(Wo.$$scope={dirty:u,ctx:t}),ye.$set(Wo);const Eo={};u&2&&(Eo.$$scope={dirty:u,ctx:t}),we.$set(Eo);const Io={};u&2&&(Io.$$scope={dirty:u,ctx:t}),Te.$set(Io);const jt={};u&2&&(jt.$$scope={dirty:u,ctx:t}),ke.$set(jt);const xo={};u&2&&(xo.$$scope={dirty:u,ctx:t}),Je.$set(xo);const Zo={};u&2&&(Zo.$$scope={dirty:u,ctx:t}),je.$set(Zo);const No={};u&2&&(No.$$scope={dirty:u,ctx:t}),Ue.$set(No);const Ut={};u&2&&(Ut.$$scope={dirty:u,ctx:t}),Fe.$set(Ut);const Go={};u&2&&(Go.$$scope={dirty:u,ctx:t}),ze.$set(Go)},i(t){sn||(v(n.$$.fragment,t),v(Ae.$$.fragment,t),v(He.$$.fragment,t),v(Le.$$.fragment,t),v(he.$$.fragment,t),v(Oe.$$.fragment,t),v(De.$$.fragment,t),v(tt.$$.fragment,t),v(ue.$$.fragment,t),v(fe.$$.fragment,t),v(ot.$$.fragment,t),v(nt.$$.fragment,t),v(at.$$.fragment,t),v(_e.$$.fragment,t),v(Me.$$.fragment,t),v(rt.$$.fragment,t),v(it.$$.fragment,t),v(ct.$$.fragment,t),v(ye.$$.fragment,t),v(we.$$.fragment,t),v(Te.$$.fragment,t),v(pt.$$.fragment,t),v(ht.$$.fragment,t),v(ft.$$.fragment,t),v(ke.$$.fragment,t),v(Je.$$.fragment,t),v(gt.$$.fragment,t),v(_t.$$.fragment,t),v(yt.$$.fragment,t),v(je.$$.fragment,t),v(Ue.$$.fragment,t),v(wt.$$.fragment,t),v(Tt.$$.fragment,t),v(kt.$$.fragment,t),v(Fe.$$.fragment,t),v(ze.$$.fragment,t),sn=!0)},o(t){k(n.$$.fragment,t),k(Ae.$$.fragment,t),k(He.$$.fragment,t),k(Le.$$.fragment,t),k(he.$$.fragment,t),k(Oe.$$.fragment,t),k(De.$$.fragment,t),k(tt.$$.fragment,t),k(ue.$$.fragment,t),k(fe.$$.fragment,t),k(ot.$$.fragment,t),k(nt.$$.fragment,t),k(at.$$.fragment,t),k(_e.$$.fragment,t),k(Me.$$.fragment,t),k(rt.$$.fragment,t),k(it.$$.fragment,t),k(ct.$$.fragment,t),k(ye.$$.fragment,t),k(we.$$.fragment,t),k(Te.$$.fragment,t),k(pt.$$.fragment,t),k(ht.$$.fragment,t),k(ft.$$.fragment,t),k(ke.$$.fragment,t),k(Je.$$.fragment,t),k(gt.$$.fragment,t),k(_t.$$.fragment,t),k(yt.$$.fragment,t),k(je.$$.fragment,t),k(Ue.$$.fragment,t),k(wt.$$.fragment,t),k(Tt.$$.fragment,t),k(kt.$$.fragment,t),k(Fe.$$.fragment,t),k(ze.$$.fragment,t),sn=!1},d(t){o(s),t&&o(b),t&&o(h),J(n),t&&o(Bo),t&&o(X),J(Ae),t&&o(Ro),t&&o(ce),t&&o(qo),t&&o(Ct),t&&o(Ao),t&&o(Ft),t&&o(Vo),t&&o(V),t&&o(So),t&&o(Q),J(He),t&&o(Xo),t&&o(C),J(Le),J(he),t&&o(Qo),t&&o(L),J(Oe),t&&o(Yo),t&&o(Z),J(De),J(tt),J(ue),J(fe),t&&o(Ho),t&&o(O),J(ot),t&&o(Lo),t&&o(N),J(nt),J(at),J(_e),J(Me),t&&o(Po),t&&o(ee),J(rt),t&&o(Oo),t&&o(G),J(it),J(ct),J(ye),J(we),J(Te),t&&o(Do),t&&o(oe),J(pt),t&&o(Ko),t&&o(B),J(ht),J(ft),J(ke),J(Je),t&&o(en),t&&o(se),J(gt),t&&o(tn),t&&o(R),J(_t),J(yt),J(je),J(Ue),t&&o(on),t&&o(re),J(wt),t&&o(nn),t&&o(q),J(Tt),J(kt),J(Fe),J(ze)}}}const Pr={local:"mra",sections:[{local:"overview",title:"Overview"},{local:"transformers.MraConfig",title:"MraConfig"},{local:"transformers.MraModel",title:"MraModel"},{local:"transformers.MraForMaskedLM",title:"MraForMaskedLM"},{local:"transformers.MraForSequenceClassification",title:"MraForSequenceClassification"},{local:"transformers.MraForMultipleChoice",title:"MraForMultipleChoice"},{local:"transformers.MraForTokenClassification",title:"MraForTokenClassification"},{local:"transformers.MraForQuestionAnswering",title:"MraForQuestionAnswering"}],title:"MRA"};function Or($){return Ir(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class si extends Fr{constructor(s){super();zr(this,s,Or,Lr,Wr,{})}}export{si as default,Pr as metadata};
