import{S as Nl,i as Gl,s as Sl,e as s,k as h,w as M,t as i,M as Vl,c as a,d as o,m,a as r,x as w,h as l,b as c,G as e,g as b,y as T,q as k,o as v,B as I,v as Xl,L as St}from"../../chunks/vendor-hf-doc-builder.js";import{T as vo}from"../../chunks/Tip-hf-doc-builder.js";import{D as q}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Vt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as D}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Gt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Al(B){let d,y,f,u,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=i("Module"),_=i(`
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){d=a(n,"P",{});var p=r(d);y=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var J=r(f);u=l(J,"Module"),J.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){b(n,d,p),e(d,y),e(d,f),e(f,u),e(d,_)},d(n){n&&o(d)}}}function Ql(B){let d,y,f,u,_;return u=new Vt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBJQmVydE1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJrc3N0ZXZlbiUyRmliZXJ0LXJvYmVydGEtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMElCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmtzc3RldmVuJTJGaWJlcnQtcm9iZXJ0YS1iYXNlJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, IBertModel
<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;kssteven/ibert-roberta-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = IBertModel.from_pretrained(<span class="hljs-string">&quot;kssteven/ibert-roberta-base&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=s("p"),y=i("Example:"),f=h(),M(u.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);y=l(p,"Example:"),p.forEach(o),f=m(n),w(u.$$.fragment,n)},m(n,p){b(n,d,p),e(d,y),b(n,f,p),T(u,n,p),_=!0},p:St,i(n){_||(k(u.$$.fragment,n),_=!0)},o(n){v(u.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(u,n)}}}function Pl(B){let d,y,f,u,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=i("Module"),_=i(`
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){d=a(n,"P",{});var p=r(d);y=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var J=r(f);u=l(J,"Module"),J.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){b(n,d,p),e(d,y),e(d,f),e(f,u),e(d,_)},d(n){n&&o(d)}}}function Ll(B){let d,y,f,u,_;return u=new Vt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBJQmVydEZvck1hc2tlZExNJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJrc3N0ZXZlbiUyRmliZXJ0LXJvYmVydGEtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMElCZXJ0Rm9yTWFza2VkTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmtzc3RldmVuJTJGaWJlcnQtcm9iZXJ0YS1iYXNlJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJUaGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlMjBpcyUyMCUzQ21hc2slM0UuJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMHJldHJpZXZlJTIwaW5kZXglMjBvZiUyMCUzQ21hc2slM0UlMEFtYXNrX3Rva2VuX2luZGV4JTIwJTNEJTIwKGlucHV0cy5pbnB1dF9pZHMlMjAlM0QlM0QlMjB0b2tlbml6ZXIubWFza190b2tlbl9pZCklNUIwJTVELm5vbnplcm8oYXNfdHVwbGUlM0RUcnVlKSU1QjAlNUQlMEElMEFwcmVkaWN0ZWRfdG9rZW5faWQlMjAlM0QlMjBsb2dpdHMlNUIwJTJDJTIwbWFza190b2tlbl9pbmRleCU1RC5hcmdtYXgoYXhpcyUzRC0xKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRva2VuaXplciglMjJUaGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlMjBpcyUyMFBhcmlzLiUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTBBJTIzJTIwbWFzayUyMGxhYmVscyUyMG9mJTIwbm9uLSUzQ21hc2slM0UlMjB0b2tlbnMlMEFsYWJlbHMlMjAlM0QlMjB0b3JjaC53aGVyZShpbnB1dHMuaW5wdXRfaWRzJTIwJTNEJTNEJTIwdG9rZW5pemVyLm1hc2tfdG9rZW5faWQlMkMlMjBsYWJlbHMlMkMlMjAtMTAwKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, IBertForMaskedLM
<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;kssteven/ibert-roberta-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = IBertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;kssteven/ibert-roberta-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is &lt;mask&gt;.&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 &lt;mask&gt;</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-&lt;mask&gt; 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(){d=s("p"),y=i("Example:"),f=h(),M(u.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);y=l(p,"Example:"),p.forEach(o),f=m(n),w(u.$$.fragment,n)},m(n,p){b(n,d,p),e(d,y),b(n,f,p),T(u,n,p),_=!0},p:St,i(n){_||(k(u.$$.fragment,n),_=!0)},o(n){v(u.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(u,n)}}}function Yl(B){let d,y,f,u,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=i("Module"),_=i(`
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){d=a(n,"P",{});var p=r(d);y=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var J=r(f);u=l(J,"Module"),J.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){b(n,d,p),e(d,y),e(d,f),e(f,u),e(d,_)},d(n){n&&o(d)}}}function Hl(B){let d,y,f,u,_;return u=new Vt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMElCZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmtzc3RldmVuJTJGaWJlcnQtcm9iZXJ0YS1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwSUJlcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJrc3N0ZXZlbiUyRmliZXJ0LXJvYmVydGEtYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWQlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KCkuaXRlbSgpJTBBJTBBJTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwSUJlcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJrc3N0ZXZlbiUyRmliZXJ0LXJvYmVydGEtYmFzZSUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, IBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;kssteven/ibert-roberta-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = IBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;kssteven/ibert-roberta-base&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 = IBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;kssteven/ibert-roberta-base&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=s("p"),y=i("Example of single-label classification:"),f=h(),M(u.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);y=l(p,"Example of single-label classification:"),p.forEach(o),f=m(n),w(u.$$.fragment,n)},m(n,p){b(n,d,p),e(d,y),b(n,f,p),T(u,n,p),_=!0},p:St,i(n){_||(k(u.$$.fragment,n),_=!0)},o(n){v(u.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(u,n)}}}function Ol(B){let d,y,f,u,_;return u=new Vt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMElCZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmtzc3RldmVuJTJGaWJlcnQtcm9iZXJ0YS1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwSUJlcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJrc3N0ZXZlbiUyRmliZXJ0LXJvYmVydGEtYmFzZSUyMiUyQyUyMHByb2JsZW1fdHlwZSUzRCUyMm11bHRpX2xhYmVsX2NsYXNzaWZpY2F0aW9uJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF9jbGFzc19pZHMlMjAlM0QlMjB0b3JjaC5hcmFuZ2UoMCUyQyUyMGxvZ2l0cy5zaGFwZSU1Qi0xJTVEKSU1QnRvcmNoLnNpZ21vaWQobG9naXRzKS5zcXVlZXplKGRpbSUzRDApJTIwJTNFJTIwMC41JTVEJTBBJTBBJTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwSUJlcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJrc3N0ZXZlbiUyRmliZXJ0LXJvYmVydGEtYmFzZSUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, IBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;kssteven/ibert-roberta-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = IBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;kssteven/ibert-roberta-base&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 = IBertForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kssteven/ibert-roberta-base&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=s("p"),y=i("Example of multi-label classification:"),f=h(),M(u.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);y=l(p,"Example of multi-label classification:"),p.forEach(o),f=m(n),w(u.$$.fragment,n)},m(n,p){b(n,d,p),e(d,y),b(n,f,p),T(u,n,p),_=!0},p:St,i(n){_||(k(u.$$.fragment,n),_=!0)},o(n){v(u.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(u,n)}}}function Dl(B){let d,y,f,u,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=i("Module"),_=i(`
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){d=a(n,"P",{});var p=r(d);y=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var J=r(f);u=l(J,"Module"),J.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){b(n,d,p),e(d,y),e(d,f),e(f,u),e(d,_)},d(n){n&&o(d)}}}function Kl(B){let d,y,f,u,_;return u=new Vt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBJQmVydEZvck11bHRpcGxlQ2hvaWNlJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJrc3N0ZXZlbiUyRmliZXJ0LXJvYmVydGEtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMElCZXJ0Rm9yTXVsdGlwbGVDaG9pY2UuZnJvbV9wcmV0cmFpbmVkKCUyMmtzc3RldmVuJTJGaWJlcnQtcm9iZXJ0YS1iYXNlJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkluJTIwSXRhbHklMkMlMjBwaXp6YSUyMHNlcnZlZCUyMGluJTIwZm9ybWFsJTIwc2V0dGluZ3MlMkMlMjBzdWNoJTIwYXMlMjBhdCUyMGElMjByZXN0YXVyYW50JTJDJTIwaXMlMjBwcmVzZW50ZWQlMjB1bnNsaWNlZC4lMjIlMEFjaG9pY2UwJTIwJTNEJTIwJTIySXQlMjBpcyUyMGVhdGVuJTIwd2l0aCUyMGElMjBmb3JrJTIwYW5kJTIwYSUyMGtuaWZlLiUyMiUwQWNob2ljZTElMjAlM0QlMjAlMjJJdCUyMGlzJTIwZWF0ZW4lMjB3aGlsZSUyMGhlbGQlMjBpbiUyMHRoZSUyMGhhbmQuJTIyJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2gudGVuc29yKDApLnVuc3F1ZWV6ZSgwKSUyMCUyMCUyMyUyMGNob2ljZTAlMjBpcyUyMGNvcnJlY3QlMjAoYWNjb3JkaW5nJTIwdG8lMjBXaWtpcGVkaWElMjAlM0IpKSUyQyUyMGJhdGNoJTIwc2l6ZSUyMDElMEElMEFlbmNvZGluZyUyMCUzRCUyMHRva2VuaXplciglNUJwcm9tcHQlMkMlMjBwcm9tcHQlNUQlMkMlMjAlNUJjaG9pY2UwJTJDJTIwY2hvaWNlMSU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMkMlMjBwYWRkaW5nJTNEVHJ1ZSklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKiolN0JrJTNBJTIwdi51bnNxdWVlemUoMCklMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwZW5jb2RpbmcuaXRlbXMoKSU3RCUyQyUyMGxhYmVscyUzRGxhYmVscyklMjAlMjAlMjMlMjBiYXRjaCUyMHNpemUlMjBpcyUyMDElMEElMEElMjMlMjB0aGUlMjBsaW5lYXIlMjBjbGFzc2lmaWVyJTIwc3RpbGwlMjBuZWVkcyUyMHRvJTIwYmUlMjB0cmFpbmVkJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcyUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, IBertForMultipleChoice
<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;kssteven/ibert-roberta-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = IBertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;kssteven/ibert-roberta-base&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(){d=s("p"),y=i("Example:"),f=h(),M(u.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);y=l(p,"Example:"),p.forEach(o),f=m(n),w(u.$$.fragment,n)},m(n,p){b(n,d,p),e(d,y),b(n,f,p),T(u,n,p),_=!0},p:St,i(n){_||(k(u.$$.fragment,n),_=!0)},o(n){v(u.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(u,n)}}}function ed(B){let d,y,f,u,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=i("Module"),_=i(`
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){d=a(n,"P",{});var p=r(d);y=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var J=r(f);u=l(J,"Module"),J.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){b(n,d,p),e(d,y),e(d,f),e(f,u),e(d,_)},d(n){n&&o(d)}}}function td(B){let d,y,f,u,_;return u=new Vt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBJQmVydEZvclRva2VuQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmtzc3RldmVuJTJGaWJlcnQtcm9iZXJ0YS1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwSUJlcnRGb3JUb2tlbkNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJrc3N0ZXZlbiUyRmliZXJ0LXJvYmVydGEtYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTBBJTIwJTIwJTIwJTIwJTIySHVnZ2luZ0ZhY2UlMjBpcyUyMGElMjBjb21wYW55JTIwYmFzZWQlMjBpbiUyMFBhcmlzJTIwYW5kJTIwTmV3JTIwWW9yayUyMiUyQyUyMGFkZF9zcGVjaWFsX3Rva2VucyUzREZhbHNlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUwQSklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKSUwQSUwQSUyMyUyME5vdGUlMjB0aGF0JTIwdG9rZW5zJTIwYXJlJTIwY2xhc3NpZmllZCUyMHJhdGhlciUyMHRoZW4lMjBpbnB1dCUyMHdvcmRzJTIwd2hpY2glMjBtZWFucyUyMHRoYXQlMEElMjMlMjB0aGVyZSUyMG1pZ2h0JTIwYmUlMjBtb3JlJTIwcHJlZGljdGVkJTIwdG9rZW4lMjBjbGFzc2VzJTIwdGhhbiUyMHdvcmRzLiUwQSUyMyUyME11bHRpcGxlJTIwdG9rZW4lMjBjbGFzc2VzJTIwbWlnaHQlMjBhY2NvdW50JTIwZm9yJTIwdGhlJTIwc2FtZSUyMHdvcmQlMEFwcmVkaWN0ZWRfdG9rZW5zX2NsYXNzZXMlMjAlM0QlMjAlNUJtb2RlbC5jb25maWcuaWQybGFiZWwlNUJ0Lml0ZW0oKSU1RCUyMGZvciUyMHQlMjBpbiUyMHByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlNUIwJTVEJTVEJTBBJTBBbGFiZWxzJTIwJTNEJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, IBertForTokenClassification
<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;kssteven/ibert-roberta-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = IBertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;kssteven/ibert-roberta-base&quot;</span>)

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=s("p"),y=i("Example:"),f=h(),M(u.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);y=l(p,"Example:"),p.forEach(o),f=m(n),w(u.$$.fragment,n)},m(n,p){b(n,d,p),e(d,y),b(n,f,p),T(u,n,p),_=!0},p:St,i(n){_||(k(u.$$.fragment,n),_=!0)},o(n){v(u.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(u,n)}}}function od(B){let d,y,f,u,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=i("Module"),_=i(`
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){d=a(n,"P",{});var p=r(d);y=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var J=r(f);u=l(J,"Module"),J.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){b(n,d,p),e(d,y),e(d,f),e(f,u),e(d,_)},d(n){n&&o(d)}}}function nd(B){let d,y,f,u,_;return u=new Vt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBJQmVydEZvclF1ZXN0aW9uQW5zd2VyaW5nJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJrc3N0ZXZlbiUyRmliZXJ0LXJvYmVydGEtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMElCZXJ0Rm9yUXVlc3Rpb25BbnN3ZXJpbmcuZnJvbV9wcmV0cmFpbmVkKCUyMmtzc3RldmVuJTJGaWJlcnQtcm9iZXJ0YS1iYXNlJTIyKSUwQSUwQXF1ZXN0aW9uJTJDJTIwdGV4dCUyMCUzRCUyMCUyMldobyUyMHdhcyUyMEppbSUyMEhlbnNvbiUzRiUyMiUyQyUyMCUyMkppbSUyMEhlbnNvbiUyMHdhcyUyMGElMjBuaWNlJTIwcHVwcGV0JTIyJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHF1ZXN0aW9uJTJDJTIwdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0QlMjBvdXRwdXRzLnN0YXJ0X2xvZ2l0cy5hcmdtYXgoKSUwQWFuc3dlcl9lbmRfaW5kZXglMjAlM0QlMjBvdXRwdXRzLmVuZF9sb2dpdHMuYXJnbWF4KCklMEElMEFwcmVkaWN0X2Fuc3dlcl90b2tlbnMlMjAlM0QlMjBpbnB1dHMuaW5wdXRfaWRzJTVCMCUyQyUyMGFuc3dlcl9zdGFydF9pbmRleCUyMCUzQSUyMGFuc3dlcl9lbmRfaW5kZXglMjAlMkIlMjAxJTVEJTBBJTBBJTIzJTIwdGFyZ2V0JTIwaXMlMjAlMjJuaWNlJTIwcHVwcGV0JTIyJTBBdGFyZ2V0X3N0YXJ0X2luZGV4JTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QjE0JTVEKSUwQXRhcmdldF9lbmRfaW5kZXglMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCMTUlNUQpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwc3RhcnRfcG9zaXRpb25zJTNEdGFyZ2V0X3N0YXJ0X2luZGV4JTJDJTIwZW5kX3Bvc2l0aW9ucyUzRHRhcmdldF9lbmRfaW5kZXgpJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, IBertForQuestionAnswering
<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;kssteven/ibert-roberta-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = IBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;kssteven/ibert-roberta-base&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(){d=s("p"),y=i("Example:"),f=h(),M(u.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);y=l(p,"Example:"),p.forEach(o),f=m(n),w(u.$$.fragment,n)},m(n,p){b(n,d,p),e(d,y),b(n,f,p),T(u,n,p),_=!0},p:St,i(n){_||(k(u.$$.fragment,n),_=!0)},o(n){v(u.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(u,n)}}}function sd(B){let d,y,f,u,_,n,p,J,ds,yn,K,_e,Io,Ae,cs,Bo,ps,Mn,be,hs,Qe,ms,us,wn,Xt,fs,Tn,At,Jo,gs,kn,X,_s,Pe,bs,ys,Le,Ms,ws,vn,ee,ye,$o,Ye,Ts,jo,ks,In,C,Uo,Qt,vs,Is,Eo,Pt,Bs,Js,zo,Lt,$s,js,Fo,Yt,Us,Es,Co,Ht,zs,Bn,te,Me,Zo,He,Fs,qo,Cs,Jn,V,Oe,Zs,oe,qs,Ot,Ws,xs,De,Rs,Ns,Gs,ne,Ss,Dt,Vs,Xs,Kt,As,Qs,$n,se,we,Wo,Ke,Ps,xo,Ls,jn,$,et,Ys,Ro,Hs,Os,tt,Ds,eo,Ks,ea,ta,ot,oa,nt,na,sa,aa,st,ra,at,ia,la,da,W,rt,ca,ae,pa,to,ha,ma,No,ua,fa,ga,Te,_a,ke,Un,re,ve,Go,it,ba,So,ya,En,j,lt,Ma,dt,wa,Vo,Ta,ka,va,ct,Ia,oo,Ba,Ja,$a,pt,ja,ht,Ua,Ea,za,x,mt,Fa,ie,Ca,no,Za,qa,Xo,Wa,xa,Ra,Ie,Na,Be,zn,le,Je,Ao,ut,Ga,Qo,Sa,Fn,U,ft,Va,Po,Xa,Aa,gt,Qa,so,Pa,La,Ya,_t,Ha,bt,Oa,Da,Ka,Z,yt,er,de,tr,ao,or,nr,Lo,sr,ar,rr,$e,ir,je,lr,Ue,Cn,ce,Ee,Yo,Mt,dr,Ho,cr,Zn,E,wt,pr,Oo,hr,mr,Tt,ur,ro,fr,gr,_r,kt,br,vt,yr,Mr,wr,R,It,Tr,pe,kr,io,vr,Ir,Do,Br,Jr,$r,ze,jr,Fe,qn,he,Ce,Ko,Bt,Ur,en,Er,Wn,z,Jt,zr,tn,Fr,Cr,$t,Zr,lo,qr,Wr,xr,jt,Rr,Ut,Nr,Gr,Sr,N,Et,Vr,me,Xr,co,Ar,Qr,on,Pr,Lr,Yr,Ze,Hr,qe,xn,ue,We,nn,zt,Or,sn,Dr,Rn,F,Ft,Kr,fe,ei,an,ti,oi,rn,ni,si,ai,Ct,ri,po,ii,li,di,Zt,ci,qt,pi,hi,mi,G,Wt,ui,ge,fi,ho,gi,_i,ln,bi,yi,Mi,xe,wi,Re,Nn;return n=new D({}),Ae=new D({}),Ye=new D({}),He=new D({}),Oe=new q({props:{name:"class transformers.IBertConfig",anchor:"transformers.IBertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{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:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"quant_mode",val:" = False"},{name:"force_dequant",val:" = 'none'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.IBertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the I-BERT model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/ibert#transformers.IBertModel">IBertModel</a>`,name:"vocab_size"},{anchor:"transformers.IBertConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.IBertConfig.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.IBertConfig.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.IBertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.IBertConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</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;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.IBertConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.IBertConfig.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.IBertConfig.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.IBertConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/ibert#transformers.IBertModel">IBertModel</a>`,name:"type_vocab_size"},{anchor:"transformers.IBertConfig.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.IBertConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.IBertConfig.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>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.IBertConfig.quant_mode",description:`<strong>quant_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to quantize the model or not.`,name:"quant_mode"},{anchor:"transformers.IBertConfig.force_dequant",description:`<strong>force_dequant</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;none&quot;</code>) &#x2014;
Force dequantize specific nonlinear layer. Dequatized layers are then executed with full precision.
<code>&quot;none&quot;</code>, <code>&quot;gelu&quot;</code>, <code>&quot;softmax&quot;</code>, <code>&quot;layernorm&quot;</code> and <code>&quot;nonlinear&quot;</code> are supported. As deafult, it is set as
<code>&quot;none&quot;</code>, which does not dequantize any layers. Please specify <code>&quot;gelu&quot;</code>, <code>&quot;softmax&quot;</code>, or <code>&quot;layernorm&quot;</code> to
dequantize GELU, Softmax, or LayerNorm, respectively. <code>&quot;nonlinear&quot;</code> will dequantize all nonlinear layers,
i.e., GELU, Softmax, and LayerNorm.`,name:"force_dequant"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ibert/configuration_ibert.py#L37"}}),Ke=new D({}),et=new q({props:{name:"class transformers.IBertModel",anchor:"transformers.IBertModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.IBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/ibert#transformers.IBertConfig">IBertConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ibert/modeling_ibert.py#L735"}}),rt=new q({props:{name:"forward",anchor:"transformers.IBertModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.IBertModel.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.IBertModel.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.IBertModel.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.IBertModel.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.IBertModel.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.IBertModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.IBertModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.IBertModel.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.IBertModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ibert/modeling_ibert.py#L772",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/ibert#transformers.IBertConfig"
>IBertConfig</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>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</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>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Te=new vo({props:{$$slots:{default:[Al]},$$scope:{ctx:B}}}),ke=new Gt({props:{anchor:"transformers.IBertModel.forward.example",$$slots:{default:[Ql]},$$scope:{ctx:B}}}),it=new D({}),lt=new q({props:{name:"class transformers.IBertForMaskedLM",anchor:"transformers.IBertForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.IBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/ibert#transformers.IBertConfig">IBertConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ibert/modeling_ibert.py#L857"}}),mt=new q({props:{name:"forward",anchor:"transformers.IBertForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.IBertForMaskedLM.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.IBertForMaskedLM.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.IBertForMaskedLM.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.IBertForMaskedLM.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.IBertForMaskedLM.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.IBertForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.IBertForMaskedLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.IBertForMaskedLM.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.IBertForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.IBertForMaskedLM.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"},{anchor:"transformers.IBertForMaskedLM.forward.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>) &#x2014;
Used to hide legacy arguments that have been deprecated.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ibert/modeling_ibert.py#L875",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/en/model_doc/ibert#transformers.IBertConfig"
>IBertConfig</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/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ie=new vo({props:{$$slots:{default:[Pl]},$$scope:{ctx:B}}}),Be=new Gt({props:{anchor:"transformers.IBertForMaskedLM.forward.example",$$slots:{default:[Ll]},$$scope:{ctx:B}}}),ut=new D({}),ft=new q({props:{name:"class transformers.IBertForSequenceClassification",anchor:"transformers.IBertForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.IBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/ibert#transformers.IBertConfig">IBertConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ibert/modeling_ibert.py#L970"}}),yt=new q({props:{name:"forward",anchor:"transformers.IBertForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.IBertForSequenceClassification.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.IBertForSequenceClassification.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.IBertForSequenceClassification.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.IBertForSequenceClassification.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.IBertForSequenceClassification.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.IBertForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.IBertForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.IBertForSequenceClassification.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.IBertForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.IBertForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ibert/modeling_ibert.py#L981",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/en/model_doc/ibert#transformers.IBertConfig"
>IBertConfig</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/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$e=new vo({props:{$$slots:{default:[Yl]},$$scope:{ctx:B}}}),je=new Gt({props:{anchor:"transformers.IBertForSequenceClassification.forward.example",$$slots:{default:[Hl]},$$scope:{ctx:B}}}),Ue=new Gt({props:{anchor:"transformers.IBertForSequenceClassification.forward.example-2",$$slots:{default:[Ol]},$$scope:{ctx:B}}}),Mt=new D({}),wt=new q({props:{name:"class transformers.IBertForMultipleChoice",anchor:"transformers.IBertForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.IBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/ibert#transformers.IBertConfig">IBertConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ibert/modeling_ibert.py#L1063"}}),It=new q({props:{name:"forward",anchor:"transformers.IBertForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.IBertForMultipleChoice.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.IBertForMultipleChoice.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.IBertForMultipleChoice.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.IBertForMultipleChoice.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.IBertForMultipleChoice.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.IBertForMultipleChoice.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 <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.IBertForMultipleChoice.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.IBertForMultipleChoice.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.IBertForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.IBertForMultipleChoice.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/main/src/transformers/models/ibert/modeling_ibert.py#L1074",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/en/model_doc/ibert#transformers.IBertConfig"
>IBertConfig</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/main/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ze=new vo({props:{$$slots:{default:[Dl]},$$scope:{ctx:B}}}),Fe=new Gt({props:{anchor:"transformers.IBertForMultipleChoice.forward.example",$$slots:{default:[Kl]},$$scope:{ctx:B}}}),Bt=new D({}),Jt=new q({props:{name:"class transformers.IBertForTokenClassification",anchor:"transformers.IBertForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.IBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/ibert#transformers.IBertConfig">IBertConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ibert/modeling_ibert.py#L1153"}}),Et=new q({props:{name:"forward",anchor:"transformers.IBertForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.IBertForTokenClassification.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.IBertForTokenClassification.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.IBertForTokenClassification.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.IBertForTokenClassification.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.IBertForTokenClassification.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.IBertForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.IBertForTokenClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.IBertForTokenClassification.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.IBertForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.IBertForTokenClassification.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/main/src/transformers/models/ibert/modeling_ibert.py#L1165",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/ibert#transformers.IBertConfig"
>IBertConfig</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/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ze=new vo({props:{$$slots:{default:[ed]},$$scope:{ctx:B}}}),qe=new Gt({props:{anchor:"transformers.IBertForTokenClassification.forward.example",$$slots:{default:[td]},$$scope:{ctx:B}}}),zt=new D({}),Ft=new q({props:{name:"class transformers.IBertForQuestionAnswering",anchor:"transformers.IBertForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.IBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/ibert#transformers.IBertConfig">IBertConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ibert/modeling_ibert.py#L1250"}}),Wt=new q({props:{name:"forward",anchor:"transformers.IBertForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.IBertForQuestionAnswering.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.IBertForQuestionAnswering.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.IBertForQuestionAnswering.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.IBertForQuestionAnswering.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.IBertForQuestionAnswering.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.IBertForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.IBertForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.IBertForQuestionAnswering.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.IBertForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.IBertForQuestionAnswering.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.IBertForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ibert/modeling_ibert.py#L1261",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/ibert#transformers.IBertConfig"
>IBertConfig</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/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xe=new vo({props:{$$slots:{default:[od]},$$scope:{ctx:B}}}),Re=new Gt({props:{anchor:"transformers.IBertForQuestionAnswering.forward.example",$$slots:{default:[nd]},$$scope:{ctx:B}}}),{c(){d=s("meta"),y=h(),f=s("h1"),u=s("a"),_=s("span"),M(n.$$.fragment),p=h(),J=s("span"),ds=i("I-BERT"),yn=h(),K=s("h2"),_e=s("a"),Io=s("span"),M(Ae.$$.fragment),cs=h(),Bo=s("span"),ps=i("Overview"),Mn=h(),be=s("p"),hs=i("The I-BERT model was proposed in "),Qe=s("a"),ms=i("I-BERT: Integer-only BERT Quantization"),us=i(` by
Sehoon Kim, Amir Gholami, Zhewei Yao, Michael W. Mahoney and Kurt Keutzer. It\u2019s a quantized version of RoBERTa running
inference up to four times faster.`),wn=h(),Xt=s("p"),fs=i("The abstract from the paper is the following:"),Tn=h(),At=s("p"),Jo=s("em"),gs=i(`Transformer based models, like BERT and RoBERTa, have achieved state-of-the-art results in many Natural Language
Processing tasks. However, their memory footprint, inference latency, and power consumption are prohibitive for
efficient inference at the edge, and even at the data center. While quantization can be a viable solution for this,
previous work on quantizing Transformer based models use floating-point arithmetic during inference, which cannot
efficiently utilize integer-only logical units such as the recent Turing Tensor Cores, or traditional integer-only ARM
processors. In this work, we propose I-BERT, a novel quantization scheme for Transformer based models that quantizes
the entire inference with integer-only arithmetic. Based on lightweight integer-only approximation methods for
nonlinear operations, e.g., GELU, Softmax, and Layer Normalization, I-BERT performs an end-to-end integer-only BERT
inference without any floating point calculation. We evaluate our approach on GLUE downstream tasks using
RoBERTa-Base/Large. We show that for both cases, I-BERT achieves similar (and slightly higher) accuracy as compared to
the full-precision baseline. Furthermore, our preliminary implementation of I-BERT shows a speedup of 2.4 - 4.0x for
INT8 inference on a T4 GPU system as compared to FP32 inference. The framework has been developed in PyTorch and has
been open-sourced.`),kn=h(),X=s("p"),_s=i("This model was contributed by "),Pe=s("a"),bs=i("kssteven"),ys=i(". The original code can be found "),Le=s("a"),Ms=i("here"),ws=i("."),vn=h(),ee=s("h2"),ye=s("a"),$o=s("span"),M(Ye.$$.fragment),Ts=h(),jo=s("span"),ks=i("Documentation resources"),In=h(),C=s("ul"),Uo=s("li"),Qt=s("a"),vs=i("Text classification task guide"),Is=h(),Eo=s("li"),Pt=s("a"),Bs=i("Token classification task guide"),Js=h(),zo=s("li"),Lt=s("a"),$s=i("Question answering task guide"),js=h(),Fo=s("li"),Yt=s("a"),Us=i("Masked language modeling task guide"),Es=h(),Co=s("li"),Ht=s("a"),zs=i("Multiple choice task guide"),Bn=h(),te=s("h2"),Me=s("a"),Zo=s("span"),M(He.$$.fragment),Fs=h(),qo=s("span"),Cs=i("IBertConfig"),Jn=h(),V=s("div"),M(Oe.$$.fragment),Zs=h(),oe=s("p"),qs=i("This is the configuration class to store the configuration of a "),Ot=s("a"),Ws=i("IBertModel"),xs=i(`. It is used to instantiate a I-BERT
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 IBERT
`),De=s("a"),Rs=i("kssteven/ibert-roberta-base"),Ns=i(" architecture."),Gs=h(),ne=s("p"),Ss=i("Configuration objects inherit from "),Dt=s("a"),Vs=i("PretrainedConfig"),Xs=i(` and can be used to control the model outputs. Read the
documentation from `),Kt=s("a"),As=i("PretrainedConfig"),Qs=i(" for more information."),$n=h(),se=s("h2"),we=s("a"),Wo=s("span"),M(Ke.$$.fragment),Ps=h(),xo=s("span"),Ls=i("IBertModel"),jn=h(),$=s("div"),M(et.$$.fragment),Ys=h(),Ro=s("p"),Hs=i("The bare I-BERT Model transformer outputting raw hidden-states without any specific head on top."),Os=h(),tt=s("p"),Ds=i("This model inherits from "),eo=s("a"),Ks=i("PreTrainedModel"),ea=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ta=h(),ot=s("p"),oa=i("This model is also a PyTorch "),nt=s("a"),na=i("torch.nn.Module"),sa=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),aa=h(),st=s("p"),ra=i(`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),at=s("a"),ia=i(`Attention is
all you need`),la=i(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),da=h(),W=s("div"),M(rt.$$.fragment),ca=h(),ae=s("p"),pa=i("The "),to=s("a"),ha=i("IBertModel"),ma=i(" forward method, overrides the "),No=s("code"),ua=i("__call__"),fa=i(" special method."),ga=h(),M(Te.$$.fragment),_a=h(),M(ke.$$.fragment),Un=h(),re=s("h2"),ve=s("a"),Go=s("span"),M(it.$$.fragment),ba=h(),So=s("span"),ya=i("IBertForMaskedLM"),En=h(),j=s("div"),M(lt.$$.fragment),Ma=h(),dt=s("p"),wa=i("I-BERT Model with a "),Vo=s("code"),Ta=i("language modeling"),ka=i(" head on top."),va=h(),ct=s("p"),Ia=i("This model inherits from "),oo=s("a"),Ba=i("PreTrainedModel"),Ja=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),$a=h(),pt=s("p"),ja=i("This model is also a PyTorch "),ht=s("a"),Ua=i("torch.nn.Module"),Ea=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),za=h(),x=s("div"),M(mt.$$.fragment),Fa=h(),ie=s("p"),Ca=i("The "),no=s("a"),Za=i("IBertForMaskedLM"),qa=i(" forward method, overrides the "),Xo=s("code"),Wa=i("__call__"),xa=i(" special method."),Ra=h(),M(Ie.$$.fragment),Na=h(),M(Be.$$.fragment),zn=h(),le=s("h2"),Je=s("a"),Ao=s("span"),M(ut.$$.fragment),Ga=h(),Qo=s("span"),Sa=i("IBertForSequenceClassification"),Fn=h(),U=s("div"),M(ft.$$.fragment),Va=h(),Po=s("p"),Xa=i(`I-BERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),Aa=h(),gt=s("p"),Qa=i("This model inherits from "),so=s("a"),Pa=i("PreTrainedModel"),La=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ya=h(),_t=s("p"),Ha=i("This model is also a PyTorch "),bt=s("a"),Oa=i("torch.nn.Module"),Da=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ka=h(),Z=s("div"),M(yt.$$.fragment),er=h(),de=s("p"),tr=i("The "),ao=s("a"),or=i("IBertForSequenceClassification"),nr=i(" forward method, overrides the "),Lo=s("code"),sr=i("__call__"),ar=i(" special method."),rr=h(),M($e.$$.fragment),ir=h(),M(je.$$.fragment),lr=h(),M(Ue.$$.fragment),Cn=h(),ce=s("h2"),Ee=s("a"),Yo=s("span"),M(Mt.$$.fragment),dr=h(),Ho=s("span"),cr=i("IBertForMultipleChoice"),Zn=h(),E=s("div"),M(wt.$$.fragment),pr=h(),Oo=s("p"),hr=i(`I-BERT 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.`),mr=h(),Tt=s("p"),ur=i("This model inherits from "),ro=s("a"),fr=i("PreTrainedModel"),gr=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),_r=h(),kt=s("p"),br=i("This model is also a PyTorch "),vt=s("a"),yr=i("torch.nn.Module"),Mr=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),wr=h(),R=s("div"),M(It.$$.fragment),Tr=h(),pe=s("p"),kr=i("The "),io=s("a"),vr=i("IBertForMultipleChoice"),Ir=i(" forward method, overrides the "),Do=s("code"),Br=i("__call__"),Jr=i(" special method."),$r=h(),M(ze.$$.fragment),jr=h(),M(Fe.$$.fragment),qn=h(),he=s("h2"),Ce=s("a"),Ko=s("span"),M(Bt.$$.fragment),Ur=h(),en=s("span"),Er=i("IBertForTokenClassification"),Wn=h(),z=s("div"),M(Jt.$$.fragment),zr=h(),tn=s("p"),Fr=i(`I-BERT 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.`),Cr=h(),$t=s("p"),Zr=i("This model inherits from "),lo=s("a"),qr=i("PreTrainedModel"),Wr=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),xr=h(),jt=s("p"),Rr=i("This model is also a PyTorch "),Ut=s("a"),Nr=i("torch.nn.Module"),Gr=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sr=h(),N=s("div"),M(Et.$$.fragment),Vr=h(),me=s("p"),Xr=i("The "),co=s("a"),Ar=i("IBertForTokenClassification"),Qr=i(" forward method, overrides the "),on=s("code"),Pr=i("__call__"),Lr=i(" special method."),Yr=h(),M(Ze.$$.fragment),Hr=h(),M(qe.$$.fragment),xn=h(),ue=s("h2"),We=s("a"),nn=s("span"),M(zt.$$.fragment),Or=h(),sn=s("span"),Dr=i("IBertForQuestionAnswering"),Rn=h(),F=s("div"),M(Ft.$$.fragment),Kr=h(),fe=s("p"),ei=i(`I-BERT 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 `),an=s("code"),ti=i("span start logits"),oi=i(" and "),rn=s("code"),ni=i("span end logits"),si=i(")."),ai=h(),Ct=s("p"),ri=i("This model inherits from "),po=s("a"),ii=i("PreTrainedModel"),li=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),di=h(),Zt=s("p"),ci=i("This model is also a PyTorch "),qt=s("a"),pi=i("torch.nn.Module"),hi=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),mi=h(),G=s("div"),M(Wt.$$.fragment),ui=h(),ge=s("p"),fi=i("The "),ho=s("a"),gi=i("IBertForQuestionAnswering"),_i=i(" forward method, overrides the "),ln=s("code"),bi=i("__call__"),yi=i(" special method."),Mi=h(),M(xe.$$.fragment),wi=h(),M(Re.$$.fragment),this.h()},l(t){const g=Vl('[data-svelte="svelte-1phssyn"]',document.head);d=a(g,"META",{name:!0,content:!0}),g.forEach(o),y=m(t),f=a(t,"H1",{class:!0});var xt=r(f);u=a(xt,"A",{id:!0,class:!0,href:!0});var dn=r(u);_=a(dn,"SPAN",{});var cn=r(_);w(n.$$.fragment,cn),cn.forEach(o),dn.forEach(o),p=m(xt),J=a(xt,"SPAN",{});var pn=r(J);ds=l(pn,"I-BERT"),pn.forEach(o),xt.forEach(o),yn=m(t),K=a(t,"H2",{class:!0});var Rt=r(K);_e=a(Rt,"A",{id:!0,class:!0,href:!0});var hn=r(_e);Io=a(hn,"SPAN",{});var mn=r(Io);w(Ae.$$.fragment,mn),mn.forEach(o),hn.forEach(o),cs=m(Rt),Bo=a(Rt,"SPAN",{});var un=r(Bo);ps=l(un,"Overview"),un.forEach(o),Rt.forEach(o),Mn=m(t),be=a(t,"P",{});var Nt=r(be);hs=l(Nt,"The I-BERT model was proposed in "),Qe=a(Nt,"A",{href:!0,rel:!0});var fn=r(Qe);ms=l(fn,"I-BERT: Integer-only BERT Quantization"),fn.forEach(o),us=l(Nt,` by
Sehoon Kim, Amir Gholami, Zhewei Yao, Michael W. Mahoney and Kurt Keutzer. It\u2019s a quantized version of RoBERTa running
inference up to four times faster.`),Nt.forEach(o),wn=m(t),Xt=a(t,"P",{});var gn=r(Xt);fs=l(gn,"The abstract from the paper is the following:"),gn.forEach(o),Tn=m(t),At=a(t,"P",{});var _n=r(At);Jo=a(_n,"EM",{});var bn=r(Jo);gs=l(bn,`Transformer based models, like BERT and RoBERTa, have achieved state-of-the-art results in many Natural Language
Processing tasks. However, their memory footprint, inference latency, and power consumption are prohibitive for
efficient inference at the edge, and even at the data center. While quantization can be a viable solution for this,
previous work on quantizing Transformer based models use floating-point arithmetic during inference, which cannot
efficiently utilize integer-only logical units such as the recent Turing Tensor Cores, or traditional integer-only ARM
processors. In this work, we propose I-BERT, a novel quantization scheme for Transformer based models that quantizes
the entire inference with integer-only arithmetic. Based on lightweight integer-only approximation methods for
nonlinear operations, e.g., GELU, Softmax, and Layer Normalization, I-BERT performs an end-to-end integer-only BERT
inference without any floating point calculation. We evaluate our approach on GLUE downstream tasks using
RoBERTa-Base/Large. We show that for both cases, I-BERT achieves similar (and slightly higher) accuracy as compared to
the full-precision baseline. Furthermore, our preliminary implementation of I-BERT shows a speedup of 2.4 - 4.0x for
INT8 inference on a T4 GPU system as compared to FP32 inference. The framework has been developed in PyTorch and has
been open-sourced.`),bn.forEach(o),_n.forEach(o),kn=m(t),X=a(t,"P",{});var mo=r(X);_s=l(mo,"This model was contributed by "),Pe=a(mo,"A",{href:!0,rel:!0});var Ti=r(Pe);bs=l(Ti,"kssteven"),Ti.forEach(o),ys=l(mo,". The original code can be found "),Le=a(mo,"A",{href:!0,rel:!0});var ki=r(Le);Ms=l(ki,"here"),ki.forEach(o),ws=l(mo,"."),mo.forEach(o),vn=m(t),ee=a(t,"H2",{class:!0});var Gn=r(ee);ye=a(Gn,"A",{id:!0,class:!0,href:!0});var vi=r(ye);$o=a(vi,"SPAN",{});var Ii=r($o);w(Ye.$$.fragment,Ii),Ii.forEach(o),vi.forEach(o),Ts=m(Gn),jo=a(Gn,"SPAN",{});var Bi=r(jo);ks=l(Bi,"Documentation resources"),Bi.forEach(o),Gn.forEach(o),In=m(t),C=a(t,"UL",{});var A=r(C);Uo=a(A,"LI",{});var Ji=r(Uo);Qt=a(Ji,"A",{href:!0});var $i=r(Qt);vs=l($i,"Text classification task guide"),$i.forEach(o),Ji.forEach(o),Is=m(A),Eo=a(A,"LI",{});var ji=r(Eo);Pt=a(ji,"A",{href:!0});var Ui=r(Pt);Bs=l(Ui,"Token classification task guide"),Ui.forEach(o),ji.forEach(o),Js=m(A),zo=a(A,"LI",{});var Ei=r(zo);Lt=a(Ei,"A",{href:!0});var zi=r(Lt);$s=l(zi,"Question answering task guide"),zi.forEach(o),Ei.forEach(o),js=m(A),Fo=a(A,"LI",{});var Fi=r(Fo);Yt=a(Fi,"A",{href:!0});var Ci=r(Yt);Us=l(Ci,"Masked language modeling task guide"),Ci.forEach(o),Fi.forEach(o),Es=m(A),Co=a(A,"LI",{});var Zi=r(Co);Ht=a(Zi,"A",{href:!0});var qi=r(Ht);zs=l(qi,"Multiple choice task guide"),qi.forEach(o),Zi.forEach(o),A.forEach(o),Bn=m(t),te=a(t,"H2",{class:!0});var Sn=r(te);Me=a(Sn,"A",{id:!0,class:!0,href:!0});var Wi=r(Me);Zo=a(Wi,"SPAN",{});var xi=r(Zo);w(He.$$.fragment,xi),xi.forEach(o),Wi.forEach(o),Fs=m(Sn),qo=a(Sn,"SPAN",{});var Ri=r(qo);Cs=l(Ri,"IBertConfig"),Ri.forEach(o),Sn.forEach(o),Jn=m(t),V=a(t,"DIV",{class:!0});var uo=r(V);w(Oe.$$.fragment,uo),Zs=m(uo),oe=a(uo,"P",{});var fo=r(oe);qs=l(fo,"This is the configuration class to store the configuration of a "),Ot=a(fo,"A",{href:!0});var Ni=r(Ot);Ws=l(Ni,"IBertModel"),Ni.forEach(o),xs=l(fo,`. It is used to instantiate a I-BERT
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 IBERT
`),De=a(fo,"A",{href:!0,rel:!0});var Gi=r(De);Rs=l(Gi,"kssteven/ibert-roberta-base"),Gi.forEach(o),Ns=l(fo," architecture."),fo.forEach(o),Gs=m(uo),ne=a(uo,"P",{});var go=r(ne);Ss=l(go,"Configuration objects inherit from "),Dt=a(go,"A",{href:!0});var Si=r(Dt);Vs=l(Si,"PretrainedConfig"),Si.forEach(o),Xs=l(go,` and can be used to control the model outputs. Read the
documentation from `),Kt=a(go,"A",{href:!0});var Vi=r(Kt);As=l(Vi,"PretrainedConfig"),Vi.forEach(o),Qs=l(go," for more information."),go.forEach(o),uo.forEach(o),$n=m(t),se=a(t,"H2",{class:!0});var Vn=r(se);we=a(Vn,"A",{id:!0,class:!0,href:!0});var Xi=r(we);Wo=a(Xi,"SPAN",{});var Ai=r(Wo);w(Ke.$$.fragment,Ai),Ai.forEach(o),Xi.forEach(o),Ps=m(Vn),xo=a(Vn,"SPAN",{});var Qi=r(xo);Ls=l(Qi,"IBertModel"),Qi.forEach(o),Vn.forEach(o),jn=m(t),$=a(t,"DIV",{class:!0});var S=r($);w(et.$$.fragment,S),Ys=m(S),Ro=a(S,"P",{});var Pi=r(Ro);Hs=l(Pi,"The bare I-BERT Model transformer outputting raw hidden-states without any specific head on top."),Pi.forEach(o),Os=m(S),tt=a(S,"P",{});var Xn=r(tt);Ds=l(Xn,"This model inherits from "),eo=a(Xn,"A",{href:!0});var Li=r(eo);Ks=l(Li,"PreTrainedModel"),Li.forEach(o),ea=l(Xn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Xn.forEach(o),ta=m(S),ot=a(S,"P",{});var An=r(ot);oa=l(An,"This model is also a PyTorch "),nt=a(An,"A",{href:!0,rel:!0});var Yi=r(nt);na=l(Yi,"torch.nn.Module"),Yi.forEach(o),sa=l(An,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),An.forEach(o),aa=m(S),st=a(S,"P",{});var Qn=r(st);ra=l(Qn,`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),at=a(Qn,"A",{href:!0,rel:!0});var Hi=r(at);ia=l(Hi,`Attention is
all you need`),Hi.forEach(o),la=l(Qn,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Qn.forEach(o),da=m(S),W=a(S,"DIV",{class:!0});var Ne=r(W);w(rt.$$.fragment,Ne),ca=m(Ne),ae=a(Ne,"P",{});var _o=r(ae);pa=l(_o,"The "),to=a(_o,"A",{href:!0});var Oi=r(to);ha=l(Oi,"IBertModel"),Oi.forEach(o),ma=l(_o," forward method, overrides the "),No=a(_o,"CODE",{});var Di=r(No);ua=l(Di,"__call__"),Di.forEach(o),fa=l(_o," special method."),_o.forEach(o),ga=m(Ne),w(Te.$$.fragment,Ne),_a=m(Ne),w(ke.$$.fragment,Ne),Ne.forEach(o),S.forEach(o),Un=m(t),re=a(t,"H2",{class:!0});var Pn=r(re);ve=a(Pn,"A",{id:!0,class:!0,href:!0});var Ki=r(ve);Go=a(Ki,"SPAN",{});var el=r(Go);w(it.$$.fragment,el),el.forEach(o),Ki.forEach(o),ba=m(Pn),So=a(Pn,"SPAN",{});var tl=r(So);ya=l(tl,"IBertForMaskedLM"),tl.forEach(o),Pn.forEach(o),En=m(t),j=a(t,"DIV",{class:!0});var Q=r(j);w(lt.$$.fragment,Q),Ma=m(Q),dt=a(Q,"P",{});var Ln=r(dt);wa=l(Ln,"I-BERT Model with a "),Vo=a(Ln,"CODE",{});var ol=r(Vo);Ta=l(ol,"language modeling"),ol.forEach(o),ka=l(Ln," head on top."),Ln.forEach(o),va=m(Q),ct=a(Q,"P",{});var Yn=r(ct);Ia=l(Yn,"This model inherits from "),oo=a(Yn,"A",{href:!0});var nl=r(oo);Ba=l(nl,"PreTrainedModel"),nl.forEach(o),Ja=l(Yn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Yn.forEach(o),$a=m(Q),pt=a(Q,"P",{});var Hn=r(pt);ja=l(Hn,"This model is also a PyTorch "),ht=a(Hn,"A",{href:!0,rel:!0});var sl=r(ht);Ua=l(sl,"torch.nn.Module"),sl.forEach(o),Ea=l(Hn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Hn.forEach(o),za=m(Q),x=a(Q,"DIV",{class:!0});var Ge=r(x);w(mt.$$.fragment,Ge),Fa=m(Ge),ie=a(Ge,"P",{});var bo=r(ie);Ca=l(bo,"The "),no=a(bo,"A",{href:!0});var al=r(no);Za=l(al,"IBertForMaskedLM"),al.forEach(o),qa=l(bo," forward method, overrides the "),Xo=a(bo,"CODE",{});var rl=r(Xo);Wa=l(rl,"__call__"),rl.forEach(o),xa=l(bo," special method."),bo.forEach(o),Ra=m(Ge),w(Ie.$$.fragment,Ge),Na=m(Ge),w(Be.$$.fragment,Ge),Ge.forEach(o),Q.forEach(o),zn=m(t),le=a(t,"H2",{class:!0});var On=r(le);Je=a(On,"A",{id:!0,class:!0,href:!0});var il=r(Je);Ao=a(il,"SPAN",{});var ll=r(Ao);w(ut.$$.fragment,ll),ll.forEach(o),il.forEach(o),Ga=m(On),Qo=a(On,"SPAN",{});var dl=r(Qo);Sa=l(dl,"IBertForSequenceClassification"),dl.forEach(o),On.forEach(o),Fn=m(t),U=a(t,"DIV",{class:!0});var P=r(U);w(ft.$$.fragment,P),Va=m(P),Po=a(P,"P",{});var cl=r(Po);Xa=l(cl,`I-BERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),cl.forEach(o),Aa=m(P),gt=a(P,"P",{});var Dn=r(gt);Qa=l(Dn,"This model inherits from "),so=a(Dn,"A",{href:!0});var pl=r(so);Pa=l(pl,"PreTrainedModel"),pl.forEach(o),La=l(Dn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Dn.forEach(o),Ya=m(P),_t=a(P,"P",{});var Kn=r(_t);Ha=l(Kn,"This model is also a PyTorch "),bt=a(Kn,"A",{href:!0,rel:!0});var hl=r(bt);Oa=l(hl,"torch.nn.Module"),hl.forEach(o),Da=l(Kn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Kn.forEach(o),Ka=m(P),Z=a(P,"DIV",{class:!0});var L=r(Z);w(yt.$$.fragment,L),er=m(L),de=a(L,"P",{});var yo=r(de);tr=l(yo,"The "),ao=a(yo,"A",{href:!0});var ml=r(ao);or=l(ml,"IBertForSequenceClassification"),ml.forEach(o),nr=l(yo," forward method, overrides the "),Lo=a(yo,"CODE",{});var ul=r(Lo);sr=l(ul,"__call__"),ul.forEach(o),ar=l(yo," special method."),yo.forEach(o),rr=m(L),w($e.$$.fragment,L),ir=m(L),w(je.$$.fragment,L),lr=m(L),w(Ue.$$.fragment,L),L.forEach(o),P.forEach(o),Cn=m(t),ce=a(t,"H2",{class:!0});var es=r(ce);Ee=a(es,"A",{id:!0,class:!0,href:!0});var fl=r(Ee);Yo=a(fl,"SPAN",{});var gl=r(Yo);w(Mt.$$.fragment,gl),gl.forEach(o),fl.forEach(o),dr=m(es),Ho=a(es,"SPAN",{});var _l=r(Ho);cr=l(_l,"IBertForMultipleChoice"),_l.forEach(o),es.forEach(o),Zn=m(t),E=a(t,"DIV",{class:!0});var Y=r(E);w(wt.$$.fragment,Y),pr=m(Y),Oo=a(Y,"P",{});var bl=r(Oo);hr=l(bl,`I-BERT 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.`),bl.forEach(o),mr=m(Y),Tt=a(Y,"P",{});var ts=r(Tt);ur=l(ts,"This model inherits from "),ro=a(ts,"A",{href:!0});var yl=r(ro);fr=l(yl,"PreTrainedModel"),yl.forEach(o),gr=l(ts,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ts.forEach(o),_r=m(Y),kt=a(Y,"P",{});var os=r(kt);br=l(os,"This model is also a PyTorch "),vt=a(os,"A",{href:!0,rel:!0});var Ml=r(vt);yr=l(Ml,"torch.nn.Module"),Ml.forEach(o),Mr=l(os,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),os.forEach(o),wr=m(Y),R=a(Y,"DIV",{class:!0});var Se=r(R);w(It.$$.fragment,Se),Tr=m(Se),pe=a(Se,"P",{});var Mo=r(pe);kr=l(Mo,"The "),io=a(Mo,"A",{href:!0});var wl=r(io);vr=l(wl,"IBertForMultipleChoice"),wl.forEach(o),Ir=l(Mo," forward method, overrides the "),Do=a(Mo,"CODE",{});var Tl=r(Do);Br=l(Tl,"__call__"),Tl.forEach(o),Jr=l(Mo," special method."),Mo.forEach(o),$r=m(Se),w(ze.$$.fragment,Se),jr=m(Se),w(Fe.$$.fragment,Se),Se.forEach(o),Y.forEach(o),qn=m(t),he=a(t,"H2",{class:!0});var ns=r(he);Ce=a(ns,"A",{id:!0,class:!0,href:!0});var kl=r(Ce);Ko=a(kl,"SPAN",{});var vl=r(Ko);w(Bt.$$.fragment,vl),vl.forEach(o),kl.forEach(o),Ur=m(ns),en=a(ns,"SPAN",{});var Il=r(en);Er=l(Il,"IBertForTokenClassification"),Il.forEach(o),ns.forEach(o),Wn=m(t),z=a(t,"DIV",{class:!0});var H=r(z);w(Jt.$$.fragment,H),zr=m(H),tn=a(H,"P",{});var Bl=r(tn);Fr=l(Bl,`I-BERT 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.`),Bl.forEach(o),Cr=m(H),$t=a(H,"P",{});var ss=r($t);Zr=l(ss,"This model inherits from "),lo=a(ss,"A",{href:!0});var Jl=r(lo);qr=l(Jl,"PreTrainedModel"),Jl.forEach(o),Wr=l(ss,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ss.forEach(o),xr=m(H),jt=a(H,"P",{});var as=r(jt);Rr=l(as,"This model is also a PyTorch "),Ut=a(as,"A",{href:!0,rel:!0});var $l=r(Ut);Nr=l($l,"torch.nn.Module"),$l.forEach(o),Gr=l(as,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),as.forEach(o),Sr=m(H),N=a(H,"DIV",{class:!0});var Ve=r(N);w(Et.$$.fragment,Ve),Vr=m(Ve),me=a(Ve,"P",{});var wo=r(me);Xr=l(wo,"The "),co=a(wo,"A",{href:!0});var jl=r(co);Ar=l(jl,"IBertForTokenClassification"),jl.forEach(o),Qr=l(wo," forward method, overrides the "),on=a(wo,"CODE",{});var Ul=r(on);Pr=l(Ul,"__call__"),Ul.forEach(o),Lr=l(wo," special method."),wo.forEach(o),Yr=m(Ve),w(Ze.$$.fragment,Ve),Hr=m(Ve),w(qe.$$.fragment,Ve),Ve.forEach(o),H.forEach(o),xn=m(t),ue=a(t,"H2",{class:!0});var rs=r(ue);We=a(rs,"A",{id:!0,class:!0,href:!0});var El=r(We);nn=a(El,"SPAN",{});var zl=r(nn);w(zt.$$.fragment,zl),zl.forEach(o),El.forEach(o),Or=m(rs),sn=a(rs,"SPAN",{});var Fl=r(sn);Dr=l(Fl,"IBertForQuestionAnswering"),Fl.forEach(o),rs.forEach(o),Rn=m(t),F=a(t,"DIV",{class:!0});var O=r(F);w(Ft.$$.fragment,O),Kr=m(O),fe=a(O,"P",{});var To=r(fe);ei=l(To,`I-BERT 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 `),an=a(To,"CODE",{});var Cl=r(an);ti=l(Cl,"span start logits"),Cl.forEach(o),oi=l(To," and "),rn=a(To,"CODE",{});var Zl=r(rn);ni=l(Zl,"span end logits"),Zl.forEach(o),si=l(To,")."),To.forEach(o),ai=m(O),Ct=a(O,"P",{});var is=r(Ct);ri=l(is,"This model inherits from "),po=a(is,"A",{href:!0});var ql=r(po);ii=l(ql,"PreTrainedModel"),ql.forEach(o),li=l(is,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),is.forEach(o),di=m(O),Zt=a(O,"P",{});var ls=r(Zt);ci=l(ls,"This model is also a PyTorch "),qt=a(ls,"A",{href:!0,rel:!0});var Wl=r(qt);pi=l(Wl,"torch.nn.Module"),Wl.forEach(o),hi=l(ls,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ls.forEach(o),mi=m(O),G=a(O,"DIV",{class:!0});var Xe=r(G);w(Wt.$$.fragment,Xe),ui=m(Xe),ge=a(Xe,"P",{});var ko=r(ge);fi=l(ko,"The "),ho=a(ko,"A",{href:!0});var xl=r(ho);gi=l(xl,"IBertForQuestionAnswering"),xl.forEach(o),_i=l(ko," forward method, overrides the "),ln=a(ko,"CODE",{});var Rl=r(ln);bi=l(Rl,"__call__"),Rl.forEach(o),yi=l(ko," special method."),ko.forEach(o),Mi=m(Xe),w(xe.$$.fragment,Xe),wi=m(Xe),w(Re.$$.fragment,Xe),Xe.forEach(o),O.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(ad)),c(u,"id","ibert"),c(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(u,"href","#ibert"),c(f,"class","relative group"),c(_e,"id","overview"),c(_e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(_e,"href","#overview"),c(K,"class","relative group"),c(Qe,"href","https://arxiv.org/abs/2101.01321"),c(Qe,"rel","nofollow"),c(Pe,"href","https://huggingface.co/kssteven"),c(Pe,"rel","nofollow"),c(Le,"href","https://github.com/kssteven418/I-BERT"),c(Le,"rel","nofollow"),c(ye,"id","documentation-resources"),c(ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ye,"href","#documentation-resources"),c(ee,"class","relative group"),c(Qt,"href","../tasks/sequence_classification"),c(Pt,"href","../tasks/token_classification"),c(Lt,"href","../tasks/question_answering"),c(Yt,"href","../tasks/masked_language_modeling"),c(Ht,"href","../tasks/masked_language_modeling"),c(Me,"id","transformers.IBertConfig"),c(Me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Me,"href","#transformers.IBertConfig"),c(te,"class","relative group"),c(Ot,"href","/docs/transformers/main/en/model_doc/ibert#transformers.IBertModel"),c(De,"href","https://huggingface.co/kssteven/ibert-roberta-base"),c(De,"rel","nofollow"),c(Dt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(Kt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(we,"id","transformers.IBertModel"),c(we,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(we,"href","#transformers.IBertModel"),c(se,"class","relative group"),c(eo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(nt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(nt,"rel","nofollow"),c(at,"href","https://arxiv.org/abs/1706.03762"),c(at,"rel","nofollow"),c(to,"href","/docs/transformers/main/en/model_doc/ibert#transformers.IBertModel"),c(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ve,"id","transformers.IBertForMaskedLM"),c(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"),c(ve,"href","#transformers.IBertForMaskedLM"),c(re,"class","relative group"),c(oo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(ht,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ht,"rel","nofollow"),c(no,"href","/docs/transformers/main/en/model_doc/ibert#transformers.IBertForMaskedLM"),c(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Je,"id","transformers.IBertForSequenceClassification"),c(Je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Je,"href","#transformers.IBertForSequenceClassification"),c(le,"class","relative group"),c(so,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(bt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(bt,"rel","nofollow"),c(ao,"href","/docs/transformers/main/en/model_doc/ibert#transformers.IBertForSequenceClassification"),c(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ee,"id","transformers.IBertForMultipleChoice"),c(Ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ee,"href","#transformers.IBertForMultipleChoice"),c(ce,"class","relative group"),c(ro,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(vt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(vt,"rel","nofollow"),c(io,"href","/docs/transformers/main/en/model_doc/ibert#transformers.IBertForMultipleChoice"),c(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ce,"id","transformers.IBertForTokenClassification"),c(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"),c(Ce,"href","#transformers.IBertForTokenClassification"),c(he,"class","relative group"),c(lo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(Ut,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ut,"rel","nofollow"),c(co,"href","/docs/transformers/main/en/model_doc/ibert#transformers.IBertForTokenClassification"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(We,"id","transformers.IBertForQuestionAnswering"),c(We,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(We,"href","#transformers.IBertForQuestionAnswering"),c(ue,"class","relative group"),c(po,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(qt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(qt,"rel","nofollow"),c(ho,"href","/docs/transformers/main/en/model_doc/ibert#transformers.IBertForQuestionAnswering"),c(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,g){e(document.head,d),b(t,y,g),b(t,f,g),e(f,u),e(u,_),T(n,_,null),e(f,p),e(f,J),e(J,ds),b(t,yn,g),b(t,K,g),e(K,_e),e(_e,Io),T(Ae,Io,null),e(K,cs),e(K,Bo),e(Bo,ps),b(t,Mn,g),b(t,be,g),e(be,hs),e(be,Qe),e(Qe,ms),e(be,us),b(t,wn,g),b(t,Xt,g),e(Xt,fs),b(t,Tn,g),b(t,At,g),e(At,Jo),e(Jo,gs),b(t,kn,g),b(t,X,g),e(X,_s),e(X,Pe),e(Pe,bs),e(X,ys),e(X,Le),e(Le,Ms),e(X,ws),b(t,vn,g),b(t,ee,g),e(ee,ye),e(ye,$o),T(Ye,$o,null),e(ee,Ts),e(ee,jo),e(jo,ks),b(t,In,g),b(t,C,g),e(C,Uo),e(Uo,Qt),e(Qt,vs),e(C,Is),e(C,Eo),e(Eo,Pt),e(Pt,Bs),e(C,Js),e(C,zo),e(zo,Lt),e(Lt,$s),e(C,js),e(C,Fo),e(Fo,Yt),e(Yt,Us),e(C,Es),e(C,Co),e(Co,Ht),e(Ht,zs),b(t,Bn,g),b(t,te,g),e(te,Me),e(Me,Zo),T(He,Zo,null),e(te,Fs),e(te,qo),e(qo,Cs),b(t,Jn,g),b(t,V,g),T(Oe,V,null),e(V,Zs),e(V,oe),e(oe,qs),e(oe,Ot),e(Ot,Ws),e(oe,xs),e(oe,De),e(De,Rs),e(oe,Ns),e(V,Gs),e(V,ne),e(ne,Ss),e(ne,Dt),e(Dt,Vs),e(ne,Xs),e(ne,Kt),e(Kt,As),e(ne,Qs),b(t,$n,g),b(t,se,g),e(se,we),e(we,Wo),T(Ke,Wo,null),e(se,Ps),e(se,xo),e(xo,Ls),b(t,jn,g),b(t,$,g),T(et,$,null),e($,Ys),e($,Ro),e(Ro,Hs),e($,Os),e($,tt),e(tt,Ds),e(tt,eo),e(eo,Ks),e(tt,ea),e($,ta),e($,ot),e(ot,oa),e(ot,nt),e(nt,na),e(ot,sa),e($,aa),e($,st),e(st,ra),e(st,at),e(at,ia),e(st,la),e($,da),e($,W),T(rt,W,null),e(W,ca),e(W,ae),e(ae,pa),e(ae,to),e(to,ha),e(ae,ma),e(ae,No),e(No,ua),e(ae,fa),e(W,ga),T(Te,W,null),e(W,_a),T(ke,W,null),b(t,Un,g),b(t,re,g),e(re,ve),e(ve,Go),T(it,Go,null),e(re,ba),e(re,So),e(So,ya),b(t,En,g),b(t,j,g),T(lt,j,null),e(j,Ma),e(j,dt),e(dt,wa),e(dt,Vo),e(Vo,Ta),e(dt,ka),e(j,va),e(j,ct),e(ct,Ia),e(ct,oo),e(oo,Ba),e(ct,Ja),e(j,$a),e(j,pt),e(pt,ja),e(pt,ht),e(ht,Ua),e(pt,Ea),e(j,za),e(j,x),T(mt,x,null),e(x,Fa),e(x,ie),e(ie,Ca),e(ie,no),e(no,Za),e(ie,qa),e(ie,Xo),e(Xo,Wa),e(ie,xa),e(x,Ra),T(Ie,x,null),e(x,Na),T(Be,x,null),b(t,zn,g),b(t,le,g),e(le,Je),e(Je,Ao),T(ut,Ao,null),e(le,Ga),e(le,Qo),e(Qo,Sa),b(t,Fn,g),b(t,U,g),T(ft,U,null),e(U,Va),e(U,Po),e(Po,Xa),e(U,Aa),e(U,gt),e(gt,Qa),e(gt,so),e(so,Pa),e(gt,La),e(U,Ya),e(U,_t),e(_t,Ha),e(_t,bt),e(bt,Oa),e(_t,Da),e(U,Ka),e(U,Z),T(yt,Z,null),e(Z,er),e(Z,de),e(de,tr),e(de,ao),e(ao,or),e(de,nr),e(de,Lo),e(Lo,sr),e(de,ar),e(Z,rr),T($e,Z,null),e(Z,ir),T(je,Z,null),e(Z,lr),T(Ue,Z,null),b(t,Cn,g),b(t,ce,g),e(ce,Ee),e(Ee,Yo),T(Mt,Yo,null),e(ce,dr),e(ce,Ho),e(Ho,cr),b(t,Zn,g),b(t,E,g),T(wt,E,null),e(E,pr),e(E,Oo),e(Oo,hr),e(E,mr),e(E,Tt),e(Tt,ur),e(Tt,ro),e(ro,fr),e(Tt,gr),e(E,_r),e(E,kt),e(kt,br),e(kt,vt),e(vt,yr),e(kt,Mr),e(E,wr),e(E,R),T(It,R,null),e(R,Tr),e(R,pe),e(pe,kr),e(pe,io),e(io,vr),e(pe,Ir),e(pe,Do),e(Do,Br),e(pe,Jr),e(R,$r),T(ze,R,null),e(R,jr),T(Fe,R,null),b(t,qn,g),b(t,he,g),e(he,Ce),e(Ce,Ko),T(Bt,Ko,null),e(he,Ur),e(he,en),e(en,Er),b(t,Wn,g),b(t,z,g),T(Jt,z,null),e(z,zr),e(z,tn),e(tn,Fr),e(z,Cr),e(z,$t),e($t,Zr),e($t,lo),e(lo,qr),e($t,Wr),e(z,xr),e(z,jt),e(jt,Rr),e(jt,Ut),e(Ut,Nr),e(jt,Gr),e(z,Sr),e(z,N),T(Et,N,null),e(N,Vr),e(N,me),e(me,Xr),e(me,co),e(co,Ar),e(me,Qr),e(me,on),e(on,Pr),e(me,Lr),e(N,Yr),T(Ze,N,null),e(N,Hr),T(qe,N,null),b(t,xn,g),b(t,ue,g),e(ue,We),e(We,nn),T(zt,nn,null),e(ue,Or),e(ue,sn),e(sn,Dr),b(t,Rn,g),b(t,F,g),T(Ft,F,null),e(F,Kr),e(F,fe),e(fe,ei),e(fe,an),e(an,ti),e(fe,oi),e(fe,rn),e(rn,ni),e(fe,si),e(F,ai),e(F,Ct),e(Ct,ri),e(Ct,po),e(po,ii),e(Ct,li),e(F,di),e(F,Zt),e(Zt,ci),e(Zt,qt),e(qt,pi),e(Zt,hi),e(F,mi),e(F,G),T(Wt,G,null),e(G,ui),e(G,ge),e(ge,fi),e(ge,ho),e(ho,gi),e(ge,_i),e(ge,ln),e(ln,bi),e(ge,yi),e(G,Mi),T(xe,G,null),e(G,wi),T(Re,G,null),Nn=!0},p(t,[g]){const xt={};g&2&&(xt.$$scope={dirty:g,ctx:t}),Te.$set(xt);const dn={};g&2&&(dn.$$scope={dirty:g,ctx:t}),ke.$set(dn);const cn={};g&2&&(cn.$$scope={dirty:g,ctx:t}),Ie.$set(cn);const pn={};g&2&&(pn.$$scope={dirty:g,ctx:t}),Be.$set(pn);const Rt={};g&2&&(Rt.$$scope={dirty:g,ctx:t}),$e.$set(Rt);const hn={};g&2&&(hn.$$scope={dirty:g,ctx:t}),je.$set(hn);const mn={};g&2&&(mn.$$scope={dirty:g,ctx:t}),Ue.$set(mn);const un={};g&2&&(un.$$scope={dirty:g,ctx:t}),ze.$set(un);const Nt={};g&2&&(Nt.$$scope={dirty:g,ctx:t}),Fe.$set(Nt);const fn={};g&2&&(fn.$$scope={dirty:g,ctx:t}),Ze.$set(fn);const gn={};g&2&&(gn.$$scope={dirty:g,ctx:t}),qe.$set(gn);const _n={};g&2&&(_n.$$scope={dirty:g,ctx:t}),xe.$set(_n);const bn={};g&2&&(bn.$$scope={dirty:g,ctx:t}),Re.$set(bn)},i(t){Nn||(k(n.$$.fragment,t),k(Ae.$$.fragment,t),k(Ye.$$.fragment,t),k(He.$$.fragment,t),k(Oe.$$.fragment,t),k(Ke.$$.fragment,t),k(et.$$.fragment,t),k(rt.$$.fragment,t),k(Te.$$.fragment,t),k(ke.$$.fragment,t),k(it.$$.fragment,t),k(lt.$$.fragment,t),k(mt.$$.fragment,t),k(Ie.$$.fragment,t),k(Be.$$.fragment,t),k(ut.$$.fragment,t),k(ft.$$.fragment,t),k(yt.$$.fragment,t),k($e.$$.fragment,t),k(je.$$.fragment,t),k(Ue.$$.fragment,t),k(Mt.$$.fragment,t),k(wt.$$.fragment,t),k(It.$$.fragment,t),k(ze.$$.fragment,t),k(Fe.$$.fragment,t),k(Bt.$$.fragment,t),k(Jt.$$.fragment,t),k(Et.$$.fragment,t),k(Ze.$$.fragment,t),k(qe.$$.fragment,t),k(zt.$$.fragment,t),k(Ft.$$.fragment,t),k(Wt.$$.fragment,t),k(xe.$$.fragment,t),k(Re.$$.fragment,t),Nn=!0)},o(t){v(n.$$.fragment,t),v(Ae.$$.fragment,t),v(Ye.$$.fragment,t),v(He.$$.fragment,t),v(Oe.$$.fragment,t),v(Ke.$$.fragment,t),v(et.$$.fragment,t),v(rt.$$.fragment,t),v(Te.$$.fragment,t),v(ke.$$.fragment,t),v(it.$$.fragment,t),v(lt.$$.fragment,t),v(mt.$$.fragment,t),v(Ie.$$.fragment,t),v(Be.$$.fragment,t),v(ut.$$.fragment,t),v(ft.$$.fragment,t),v(yt.$$.fragment,t),v($e.$$.fragment,t),v(je.$$.fragment,t),v(Ue.$$.fragment,t),v(Mt.$$.fragment,t),v(wt.$$.fragment,t),v(It.$$.fragment,t),v(ze.$$.fragment,t),v(Fe.$$.fragment,t),v(Bt.$$.fragment,t),v(Jt.$$.fragment,t),v(Et.$$.fragment,t),v(Ze.$$.fragment,t),v(qe.$$.fragment,t),v(zt.$$.fragment,t),v(Ft.$$.fragment,t),v(Wt.$$.fragment,t),v(xe.$$.fragment,t),v(Re.$$.fragment,t),Nn=!1},d(t){o(d),t&&o(y),t&&o(f),I(n),t&&o(yn),t&&o(K),I(Ae),t&&o(Mn),t&&o(be),t&&o(wn),t&&o(Xt),t&&o(Tn),t&&o(At),t&&o(kn),t&&o(X),t&&o(vn),t&&o(ee),I(Ye),t&&o(In),t&&o(C),t&&o(Bn),t&&o(te),I(He),t&&o(Jn),t&&o(V),I(Oe),t&&o($n),t&&o(se),I(Ke),t&&o(jn),t&&o($),I(et),I(rt),I(Te),I(ke),t&&o(Un),t&&o(re),I(it),t&&o(En),t&&o(j),I(lt),I(mt),I(Ie),I(Be),t&&o(zn),t&&o(le),I(ut),t&&o(Fn),t&&o(U),I(ft),I(yt),I($e),I(je),I(Ue),t&&o(Cn),t&&o(ce),I(Mt),t&&o(Zn),t&&o(E),I(wt),I(It),I(ze),I(Fe),t&&o(qn),t&&o(he),I(Bt),t&&o(Wn),t&&o(z),I(Jt),I(Et),I(Ze),I(qe),t&&o(xn),t&&o(ue),I(zt),t&&o(Rn),t&&o(F),I(Ft),I(Wt),I(xe),I(Re)}}}const ad={local:"ibert",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.IBertConfig",title:"IBertConfig"},{local:"transformers.IBertModel",title:"IBertModel"},{local:"transformers.IBertForMaskedLM",title:"IBertForMaskedLM"},{local:"transformers.IBertForSequenceClassification",title:"IBertForSequenceClassification"},{local:"transformers.IBertForMultipleChoice",title:"IBertForMultipleChoice"},{local:"transformers.IBertForTokenClassification",title:"IBertForTokenClassification"},{local:"transformers.IBertForQuestionAnswering",title:"IBertForQuestionAnswering"}],title:"I-BERT"};function rd(B){return Xl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class md extends Nl{constructor(d){super();Gl(this,d,rd,sd,Sl,{})}}export{md as default,ad as metadata};
