import{S as Ki,i as Yi,s as Zi,e as s,k as m,w as v,t as i,M as Xi,c as r,d as o,m as u,a,x as w,h as l,b as h,G as e,g as b,y as T,q as y,o as $,B as I,v as el,L as Lt}from"../../chunks/vendor-hf-doc-builder.js";import{T as uo}from"../../chunks/Tip-hf-doc-builder.js";import{D as P}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ot}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as me}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as At}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function tl(B){let d,k,f,p,_;return{c(){d=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),p=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=r(n,"P",{});var c=a(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var q=a(f);p=l(q,"Module"),q.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,k),e(d,f),e(f,p),e(d,_)},d(n){n&&o(d)}}}function ol(B){let d,k,f,p,_;return p=new Ot({props:{code:`from transformers import AutoTokenizer, IBertModel
import torch

tokenizer = AutoTokenizer.from_pretrained("kssteven/ibert-roberta-base")
model = IBertModel.from_pretrained("kssteven/ibert-roberta-base")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,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"),k=i("Example:"),f=m(),v(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Example:"),c.forEach(o),f=u(n),w(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,f,c),T(p,n,c),_=!0},p:Lt,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(p,n)}}}function nl(B){let d,k,f,p,_;return{c(){d=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),p=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=r(n,"P",{});var c=a(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var q=a(f);p=l(q,"Module"),q.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,k),e(d,f),e(f,p),e(d,_)},d(n){n&&o(d)}}}function sl(B){let d,k,f,p,_;return p=new Ot({props:{code:`from transformers import AutoTokenizer, IBertForMaskedLM
import torch

tokenizer = AutoTokenizer.from_pretrained("kssteven/ibert-roberta-base")
model = IBertForMaskedLM.from_pretrained("kssteven/ibert-roberta-base")

inputs = tokenizer("The capital of France is <mask>.", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

# retrieve index of <mask>
mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[0].nonzero(as_tuple=True)[0]

predicted_token_id = logits[0, mask_token_index].argmax(axis=-1)

labels = tokenizer("The capital of France is Paris.", return_tensors="pt")["input_ids"]
# mask labels of non-<mask> tokens
labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -100)

outputs = model(**inputs, labels=labels)`,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"),k=i("Example:"),f=m(),v(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Example:"),c.forEach(o),f=u(n),w(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,f,c),T(p,n,c),_=!0},p:Lt,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(p,n)}}}function rl(B){let d,k,f,p,_;return{c(){d=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),p=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=r(n,"P",{});var c=a(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var q=a(f);p=l(q,"Module"),q.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,k),e(d,f),e(f,p),e(d,_)},d(n){n&&o(d)}}}function al(B){let d,k,f,p,_;return p=new Ot({props:{code:`import torch
from transformers import AutoTokenizer, IBertForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("kssteven/ibert-roberta-base")
model = IBertForSequenceClassification.from_pretrained("kssteven/ibert-roberta-base")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = IBertForSequenceClassification.from_pretrained("kssteven/ibert-roberta-base", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss`,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"),k=i("Example of single-label classification:"),f=m(),v(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Example of single-label classification:"),c.forEach(o),f=u(n),w(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,f,c),T(p,n,c),_=!0},p:Lt,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(p,n)}}}function il(B){let d,k,f,p,_;return p=new Ot({props:{code:`import torch
from transformers import AutoTokenizer, IBertForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("kssteven/ibert-roberta-base")
model = IBertForSequenceClassification.from_pretrained("kssteven/ibert-roberta-base", problem_type="multi_label_classification")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_ids = torch.arange(0, logits.shape[-1])[torch.sigmoid(logits).squeeze(dim=0) > 0.5]

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = IBertForSequenceClassification.from_pretrained(
    "kssteven/ibert-roberta-base", num_labels=num_labels, problem_type="multi_label_classification"
)

labels = torch.sum(
    torch.nn.functional.one_hot(predicted_class_ids[None, :].clone(), num_classes=num_labels), dim=1
).to(torch.float)
loss = model(**inputs, labels=labels).loss`,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"),k=i("Example of multi-label classification:"),f=m(),v(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Example of multi-label classification:"),c.forEach(o),f=u(n),w(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,f,c),T(p,n,c),_=!0},p:Lt,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(p,n)}}}function ll(B){let d,k,f,p,_;return{c(){d=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),p=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=r(n,"P",{});var c=a(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var q=a(f);p=l(q,"Module"),q.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,k),e(d,f),e(f,p),e(d,_)},d(n){n&&o(d)}}}function dl(B){let d,k,f,p,_;return p=new Ot({props:{code:`from transformers import AutoTokenizer, IBertForMultipleChoice
import torch

tokenizer = AutoTokenizer.from_pretrained("kssteven/ibert-roberta-base")
model = IBertForMultipleChoice.from_pretrained("kssteven/ibert-roberta-base")

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
choice0 = "It is eaten with a fork and a knife."
choice1 = "It is eaten while held in the hand."
labels = torch.tensor(0).unsqueeze(0)  # choice0 is correct (according to Wikipedia ;)), batch size 1

encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors="pt", padding=True)
outputs = model(**{k: v.unsqueeze(0) for k, v in encoding.items()}, labels=labels)  # batch size is 1

# the linear classifier still needs to be trained
loss = outputs.loss
logits = outputs.logits`,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"),k=i("Example:"),f=m(),v(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Example:"),c.forEach(o),f=u(n),w(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,f,c),T(p,n,c),_=!0},p:Lt,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(p,n)}}}function cl(B){let d,k,f,p,_;return{c(){d=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),p=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=r(n,"P",{});var c=a(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var q=a(f);p=l(q,"Module"),q.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,k),e(d,f),e(f,p),e(d,_)},d(n){n&&o(d)}}}function pl(B){let d,k,f,p,_;return p=new Ot({props:{code:`from transformers import AutoTokenizer, IBertForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("kssteven/ibert-roberta-base")
model = IBertForTokenClassification.from_pretrained("kssteven/ibert-roberta-base")

inputs = tokenizer(
    "HuggingFace is a company based in Paris and New York", add_special_tokens=False, return_tensors="pt"
)

with torch.no_grad():
    logits = model(**inputs).logits

predicted_token_class_ids = logits.argmax(-1)

# Note that tokens are classified rather then input words which means that
# there might be more predicted token classes than words.
# Multiple token classes might account for the same word
predicted_tokens_classes = [model.config.id2label[t.item()] for t in predicted_token_class_ids[0]]

labels = predicted_token_class_ids
loss = model(**inputs, labels=labels).loss`,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"),k=i("Example:"),f=m(),v(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Example:"),c.forEach(o),f=u(n),w(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,f,c),T(p,n,c),_=!0},p:Lt,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(p,n)}}}function hl(B){let d,k,f,p,_;return{c(){d=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),p=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=r(n,"P",{});var c=a(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var q=a(f);p=l(q,"Module"),q.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,k),e(d,f),e(f,p),e(d,_)},d(n){n&&o(d)}}}function ml(B){let d,k,f,p,_;return p=new Ot({props:{code:`from transformers import AutoTokenizer, IBertForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("kssteven/ibert-roberta-base")
model = IBertForQuestionAnswering.from_pretrained("kssteven/ibert-roberta-base")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

answer_start_index = outputs.start_logits.argmax()
answer_end_index = outputs.end_logits.argmax()

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]

# target is "nice puppet"
target_start_index = torch.tensor([14])
target_end_index = torch.tensor([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss`,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"),k=i("Example:"),f=m(),v(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Example:"),c.forEach(o),f=u(n),w(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,f,c),T(p,n,c),_=!0},p:Lt,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(p,n)}}}function ul(B){let d,k,f,p,_,n,c,q,Wn,tn,K,ue,fo,De,Qn,go,Hn,on,fe,Un,Re,Gn,Vn,nn,St,Jn,sn,Nt,_o,Kn,rn,W,Yn,We,Zn,Xn,Qe,es,ts,an,Y,ge,bo,He,os,ko,ns,ln,R,Ue,ss,Z,rs,Dt,as,is,Ge,ls,ds,cs,X,ps,Rt,hs,ms,Wt,us,fs,dn,ee,_e,vo,Ve,gs,wo,_s,cn,M,Je,bs,To,ks,vs,Ke,ws,Qt,Ts,ys,$s,Ye,Is,Ze,Bs,qs,Ms,Xe,zs,et,Fs,xs,Es,A,tt,Cs,te,js,Ht,Ps,As,yo,Ls,Os,Ss,be,Ns,ke,pn,oe,ve,$o,ot,Ds,Io,Rs,hn,z,nt,Ws,st,Qs,Bo,Hs,Us,Gs,rt,Vs,Ut,Js,Ks,Ys,at,Zs,it,Xs,er,tr,L,lt,or,ne,nr,Gt,sr,rr,qo,ar,ir,lr,we,dr,Te,mn,se,ye,Mo,dt,cr,zo,pr,un,F,ct,hr,Fo,mr,ur,pt,fr,Vt,gr,_r,br,ht,kr,mt,vr,wr,Tr,j,ut,yr,re,$r,Jt,Ir,Br,xo,qr,Mr,zr,$e,Fr,Ie,xr,Be,fn,ae,qe,Eo,ft,Er,Co,Cr,gn,x,gt,jr,jo,Pr,Ar,_t,Lr,Kt,Or,Sr,Nr,bt,Dr,kt,Rr,Wr,Qr,O,vt,Hr,ie,Ur,Yt,Gr,Vr,Po,Jr,Kr,Yr,Me,Zr,ze,_n,le,Fe,Ao,wt,Xr,Lo,ea,bn,E,Tt,ta,Oo,oa,na,yt,sa,Zt,ra,aa,ia,$t,la,It,da,ca,pa,S,Bt,ha,de,ma,Xt,ua,fa,So,ga,_a,ba,xe,ka,Ee,kn,ce,Ce,No,qt,va,Do,wa,vn,C,Mt,Ta,pe,ya,Ro,$a,Ia,Wo,Ba,qa,Ma,zt,za,eo,Fa,xa,Ea,Ft,Ca,xt,ja,Pa,Aa,N,Et,La,he,Oa,to,Sa,Na,Qo,Da,Ra,Wa,je,Qa,Pe,wn;return n=new me({}),De=new me({}),He=new me({}),Ue=new P({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#L38"}}),Ve=new me({}),Je=new P({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#L733"}}),tt=new P({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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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>
`}}),be=new uo({props:{$$slots:{default:[tl]},$$scope:{ctx:B}}}),ke=new At({props:{anchor:"transformers.IBertModel.forward.example",$$slots:{default:[ol]},$$scope:{ctx:B}}}),ot=new me({}),nt=new P({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#L856"}}),lt=new P({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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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>
`}}),we=new uo({props:{$$slots:{default:[nl]},$$scope:{ctx:B}}}),Te=new At({props:{anchor:"transformers.IBertForMaskedLM.forward.example",$$slots:{default:[sl]},$$scope:{ctx:B}}}),dt=new me({}),ct=new P({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"}}),ut=new P({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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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#L983",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 uo({props:{$$slots:{default:[rl]},$$scope:{ctx:B}}}),Ie=new At({props:{anchor:"transformers.IBertForSequenceClassification.forward.example",$$slots:{default:[al]},$$scope:{ctx:B}}}),Be=new At({props:{anchor:"transformers.IBertForSequenceClassification.forward.example-2",$$slots:{default:[il]},$$scope:{ctx:B}}}),ft=new me({}),gt=new P({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#L1065"}}),vt=new P({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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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#L1078",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>
`}}),Me=new uo({props:{$$slots:{default:[ll]},$$scope:{ctx:B}}}),ze=new At({props:{anchor:"transformers.IBertForMultipleChoice.forward.example",$$slots:{default:[dl]},$$scope:{ctx:B}}}),wt=new me({}),Tt=new P({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#L1157"}}),Bt=new P({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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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#L1172",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>
`}}),xe=new uo({props:{$$slots:{default:[cl]},$$scope:{ctx:B}}}),Ee=new At({props:{anchor:"transformers.IBertForTokenClassification.forward.example",$$slots:{default:[pl]},$$scope:{ctx:B}}}),qt=new me({}),Mt=new P({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#L1257"}}),Et=new P({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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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#L1271",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>
`}}),je=new uo({props:{$$slots:{default:[hl]},$$scope:{ctx:B}}}),Pe=new At({props:{anchor:"transformers.IBertForQuestionAnswering.forward.example",$$slots:{default:[ml]},$$scope:{ctx:B}}}),{c(){d=s("meta"),k=m(),f=s("h1"),p=s("a"),_=s("span"),v(n.$$.fragment),c=m(),q=s("span"),Wn=i("I-BERT"),tn=m(),K=s("h2"),ue=s("a"),fo=s("span"),v(De.$$.fragment),Qn=m(),go=s("span"),Hn=i("Overview"),on=m(),fe=s("p"),Un=i("The I-BERT model was proposed in "),Re=s("a"),Gn=i("I-BERT: Integer-only BERT Quantization"),Vn=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.`),nn=m(),St=s("p"),Jn=i("The abstract from the paper is the following:"),sn=m(),Nt=s("p"),_o=s("em"),Kn=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.`),rn=m(),W=s("p"),Yn=i("This model was contributed by "),We=s("a"),Zn=i("kssteven"),Xn=i(". The original code can be found "),Qe=s("a"),es=i("here"),ts=i("."),an=m(),Y=s("h2"),ge=s("a"),bo=s("span"),v(He.$$.fragment),os=m(),ko=s("span"),ns=i("IBertConfig"),ln=m(),R=s("div"),v(Ue.$$.fragment),ss=m(),Z=s("p"),rs=i("This is the configuration class to store the configuration of a "),Dt=s("a"),as=i("IBertModel"),is=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
`),Ge=s("a"),ls=i("kssteven/ibert-roberta-base"),ds=i(" architecture."),cs=m(),X=s("p"),ps=i("Configuration objects inherit from "),Rt=s("a"),hs=i("PretrainedConfig"),ms=i(` and can be used to control the model outputs. Read the
documentation from `),Wt=s("a"),us=i("PretrainedConfig"),fs=i(" for more information."),dn=m(),ee=s("h2"),_e=s("a"),vo=s("span"),v(Ve.$$.fragment),gs=m(),wo=s("span"),_s=i("IBertModel"),cn=m(),M=s("div"),v(Je.$$.fragment),bs=m(),To=s("p"),ks=i("The bare I-BERT Model transformer outputting raw hidden-states without any specific head on top."),vs=m(),Ke=s("p"),ws=i("This model inherits from "),Qt=s("a"),Ts=i("PreTrainedModel"),ys=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.)`),$s=m(),Ye=s("p"),Is=i("This model is also a PyTorch "),Ze=s("a"),Bs=i("torch.nn.Module"),qs=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ms=m(),Xe=s("p"),zs=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 `),et=s("a"),Fs=i(`Attention is
all you need`),xs=i(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Es=m(),A=s("div"),v(tt.$$.fragment),Cs=m(),te=s("p"),js=i("The "),Ht=s("a"),Ps=i("IBertModel"),As=i(" forward method, overrides the "),yo=s("code"),Ls=i("__call__"),Os=i(" special method."),Ss=m(),v(be.$$.fragment),Ns=m(),v(ke.$$.fragment),pn=m(),oe=s("h2"),ve=s("a"),$o=s("span"),v(ot.$$.fragment),Ds=m(),Io=s("span"),Rs=i("IBertForMaskedLM"),hn=m(),z=s("div"),v(nt.$$.fragment),Ws=m(),st=s("p"),Qs=i("I-BERT Model with a "),Bo=s("code"),Hs=i("language modeling"),Us=i(" head on top."),Gs=m(),rt=s("p"),Vs=i("This model inherits from "),Ut=s("a"),Js=i("PreTrainedModel"),Ks=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.)`),Ys=m(),at=s("p"),Zs=i("This model is also a PyTorch "),it=s("a"),Xs=i("torch.nn.Module"),er=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),tr=m(),L=s("div"),v(lt.$$.fragment),or=m(),ne=s("p"),nr=i("The "),Gt=s("a"),sr=i("IBertForMaskedLM"),rr=i(" forward method, overrides the "),qo=s("code"),ar=i("__call__"),ir=i(" special method."),lr=m(),v(we.$$.fragment),dr=m(),v(Te.$$.fragment),mn=m(),se=s("h2"),ye=s("a"),Mo=s("span"),v(dt.$$.fragment),cr=m(),zo=s("span"),pr=i("IBertForSequenceClassification"),un=m(),F=s("div"),v(ct.$$.fragment),hr=m(),Fo=s("p"),mr=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.`),ur=m(),pt=s("p"),fr=i("This model inherits from "),Vt=s("a"),gr=i("PreTrainedModel"),_r=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.)`),br=m(),ht=s("p"),kr=i("This model is also a PyTorch "),mt=s("a"),vr=i("torch.nn.Module"),wr=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Tr=m(),j=s("div"),v(ut.$$.fragment),yr=m(),re=s("p"),$r=i("The "),Jt=s("a"),Ir=i("IBertForSequenceClassification"),Br=i(" forward method, overrides the "),xo=s("code"),qr=i("__call__"),Mr=i(" special method."),zr=m(),v($e.$$.fragment),Fr=m(),v(Ie.$$.fragment),xr=m(),v(Be.$$.fragment),fn=m(),ae=s("h2"),qe=s("a"),Eo=s("span"),v(ft.$$.fragment),Er=m(),Co=s("span"),Cr=i("IBertForMultipleChoice"),gn=m(),x=s("div"),v(gt.$$.fragment),jr=m(),jo=s("p"),Pr=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.`),Ar=m(),_t=s("p"),Lr=i("This model inherits from "),Kt=s("a"),Or=i("PreTrainedModel"),Sr=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.)`),Nr=m(),bt=s("p"),Dr=i("This model is also a PyTorch "),kt=s("a"),Rr=i("torch.nn.Module"),Wr=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Qr=m(),O=s("div"),v(vt.$$.fragment),Hr=m(),ie=s("p"),Ur=i("The "),Yt=s("a"),Gr=i("IBertForMultipleChoice"),Vr=i(" forward method, overrides the "),Po=s("code"),Jr=i("__call__"),Kr=i(" special method."),Yr=m(),v(Me.$$.fragment),Zr=m(),v(ze.$$.fragment),_n=m(),le=s("h2"),Fe=s("a"),Ao=s("span"),v(wt.$$.fragment),Xr=m(),Lo=s("span"),ea=i("IBertForTokenClassification"),bn=m(),E=s("div"),v(Tt.$$.fragment),ta=m(),Oo=s("p"),oa=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.`),na=m(),yt=s("p"),sa=i("This model inherits from "),Zt=s("a"),ra=i("PreTrainedModel"),aa=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.)`),ia=m(),$t=s("p"),la=i("This model is also a PyTorch "),It=s("a"),da=i("torch.nn.Module"),ca=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pa=m(),S=s("div"),v(Bt.$$.fragment),ha=m(),de=s("p"),ma=i("The "),Xt=s("a"),ua=i("IBertForTokenClassification"),fa=i(" forward method, overrides the "),So=s("code"),ga=i("__call__"),_a=i(" special method."),ba=m(),v(xe.$$.fragment),ka=m(),v(Ee.$$.fragment),kn=m(),ce=s("h2"),Ce=s("a"),No=s("span"),v(qt.$$.fragment),va=m(),Do=s("span"),wa=i("IBertForQuestionAnswering"),vn=m(),C=s("div"),v(Mt.$$.fragment),Ta=m(),pe=s("p"),ya=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 `),Ro=s("code"),$a=i("span start logits"),Ia=i(" and "),Wo=s("code"),Ba=i("span end logits"),qa=i(")."),Ma=m(),zt=s("p"),za=i("This model inherits from "),eo=s("a"),Fa=i("PreTrainedModel"),xa=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.)`),Ea=m(),Ft=s("p"),Ca=i("This model is also a PyTorch "),xt=s("a"),ja=i("torch.nn.Module"),Pa=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=m(),N=s("div"),v(Et.$$.fragment),La=m(),he=s("p"),Oa=i("The "),to=s("a"),Sa=i("IBertForQuestionAnswering"),Na=i(" forward method, overrides the "),Qo=s("code"),Da=i("__call__"),Ra=i(" special method."),Wa=m(),v(je.$$.fragment),Qa=m(),v(Pe.$$.fragment),this.h()},l(t){const g=Xi('[data-svelte="svelte-1phssyn"]',document.head);d=r(g,"META",{name:!0,content:!0}),g.forEach(o),k=u(t),f=r(t,"H1",{class:!0});var Ct=a(f);p=r(Ct,"A",{id:!0,class:!0,href:!0});var Ho=a(p);_=r(Ho,"SPAN",{});var Uo=a(_);w(n.$$.fragment,Uo),Uo.forEach(o),Ho.forEach(o),c=u(Ct),q=r(Ct,"SPAN",{});var Go=a(q);Wn=l(Go,"I-BERT"),Go.forEach(o),Ct.forEach(o),tn=u(t),K=r(t,"H2",{class:!0});var jt=a(K);ue=r(jt,"A",{id:!0,class:!0,href:!0});var Vo=a(ue);fo=r(Vo,"SPAN",{});var Jo=a(fo);w(De.$$.fragment,Jo),Jo.forEach(o),Vo.forEach(o),Qn=u(jt),go=r(jt,"SPAN",{});var Ko=a(go);Hn=l(Ko,"Overview"),Ko.forEach(o),jt.forEach(o),on=u(t),fe=r(t,"P",{});var Pt=a(fe);Un=l(Pt,"The I-BERT model was proposed in "),Re=r(Pt,"A",{href:!0,rel:!0});var Yo=a(Re);Gn=l(Yo,"I-BERT: Integer-only BERT Quantization"),Yo.forEach(o),Vn=l(Pt,` 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.`),Pt.forEach(o),nn=u(t),St=r(t,"P",{});var Zo=a(St);Jn=l(Zo,"The abstract from the paper is the following:"),Zo.forEach(o),sn=u(t),Nt=r(t,"P",{});var Xo=a(Nt);_o=r(Xo,"EM",{});var en=a(_o);Kn=l(en,`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.`),en.forEach(o),Xo.forEach(o),rn=u(t),W=r(t,"P",{});var oo=a(W);Yn=l(oo,"This model was contributed by "),We=r(oo,"A",{href:!0,rel:!0});var Ha=a(We);Zn=l(Ha,"kssteven"),Ha.forEach(o),Xn=l(oo,". The original code can be found "),Qe=r(oo,"A",{href:!0,rel:!0});var Ua=a(Qe);es=l(Ua,"here"),Ua.forEach(o),ts=l(oo,"."),oo.forEach(o),an=u(t),Y=r(t,"H2",{class:!0});var Tn=a(Y);ge=r(Tn,"A",{id:!0,class:!0,href:!0});var Ga=a(ge);bo=r(Ga,"SPAN",{});var Va=a(bo);w(He.$$.fragment,Va),Va.forEach(o),Ga.forEach(o),os=u(Tn),ko=r(Tn,"SPAN",{});var Ja=a(ko);ns=l(Ja,"IBertConfig"),Ja.forEach(o),Tn.forEach(o),ln=u(t),R=r(t,"DIV",{class:!0});var no=a(R);w(Ue.$$.fragment,no),ss=u(no),Z=r(no,"P",{});var so=a(Z);rs=l(so,"This is the configuration class to store the configuration of a "),Dt=r(so,"A",{href:!0});var Ka=a(Dt);as=l(Ka,"IBertModel"),Ka.forEach(o),is=l(so,`. 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
`),Ge=r(so,"A",{href:!0,rel:!0});var Ya=a(Ge);ls=l(Ya,"kssteven/ibert-roberta-base"),Ya.forEach(o),ds=l(so," architecture."),so.forEach(o),cs=u(no),X=r(no,"P",{});var ro=a(X);ps=l(ro,"Configuration objects inherit from "),Rt=r(ro,"A",{href:!0});var Za=a(Rt);hs=l(Za,"PretrainedConfig"),Za.forEach(o),ms=l(ro,` and can be used to control the model outputs. Read the
documentation from `),Wt=r(ro,"A",{href:!0});var Xa=a(Wt);us=l(Xa,"PretrainedConfig"),Xa.forEach(o),fs=l(ro," for more information."),ro.forEach(o),no.forEach(o),dn=u(t),ee=r(t,"H2",{class:!0});var yn=a(ee);_e=r(yn,"A",{id:!0,class:!0,href:!0});var ei=a(_e);vo=r(ei,"SPAN",{});var ti=a(vo);w(Ve.$$.fragment,ti),ti.forEach(o),ei.forEach(o),gs=u(yn),wo=r(yn,"SPAN",{});var oi=a(wo);_s=l(oi,"IBertModel"),oi.forEach(o),yn.forEach(o),cn=u(t),M=r(t,"DIV",{class:!0});var D=a(M);w(Je.$$.fragment,D),bs=u(D),To=r(D,"P",{});var ni=a(To);ks=l(ni,"The bare I-BERT Model transformer outputting raw hidden-states without any specific head on top."),ni.forEach(o),vs=u(D),Ke=r(D,"P",{});var $n=a(Ke);ws=l($n,"This model inherits from "),Qt=r($n,"A",{href:!0});var si=a(Qt);Ts=l(si,"PreTrainedModel"),si.forEach(o),ys=l($n,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),$n.forEach(o),$s=u(D),Ye=r(D,"P",{});var In=a(Ye);Is=l(In,"This model is also a PyTorch "),Ze=r(In,"A",{href:!0,rel:!0});var ri=a(Ze);Bs=l(ri,"torch.nn.Module"),ri.forEach(o),qs=l(In,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),In.forEach(o),Ms=u(D),Xe=r(D,"P",{});var Bn=a(Xe);zs=l(Bn,`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 `),et=r(Bn,"A",{href:!0,rel:!0});var ai=a(et);Fs=l(ai,`Attention is
all you need`),ai.forEach(o),xs=l(Bn,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Bn.forEach(o),Es=u(D),A=r(D,"DIV",{class:!0});var Ae=a(A);w(tt.$$.fragment,Ae),Cs=u(Ae),te=r(Ae,"P",{});var ao=a(te);js=l(ao,"The "),Ht=r(ao,"A",{href:!0});var ii=a(Ht);Ps=l(ii,"IBertModel"),ii.forEach(o),As=l(ao," forward method, overrides the "),yo=r(ao,"CODE",{});var li=a(yo);Ls=l(li,"__call__"),li.forEach(o),Os=l(ao," special method."),ao.forEach(o),Ss=u(Ae),w(be.$$.fragment,Ae),Ns=u(Ae),w(ke.$$.fragment,Ae),Ae.forEach(o),D.forEach(o),pn=u(t),oe=r(t,"H2",{class:!0});var qn=a(oe);ve=r(qn,"A",{id:!0,class:!0,href:!0});var di=a(ve);$o=r(di,"SPAN",{});var ci=a($o);w(ot.$$.fragment,ci),ci.forEach(o),di.forEach(o),Ds=u(qn),Io=r(qn,"SPAN",{});var pi=a(Io);Rs=l(pi,"IBertForMaskedLM"),pi.forEach(o),qn.forEach(o),hn=u(t),z=r(t,"DIV",{class:!0});var Q=a(z);w(nt.$$.fragment,Q),Ws=u(Q),st=r(Q,"P",{});var Mn=a(st);Qs=l(Mn,"I-BERT Model with a "),Bo=r(Mn,"CODE",{});var hi=a(Bo);Hs=l(hi,"language modeling"),hi.forEach(o),Us=l(Mn," head on top."),Mn.forEach(o),Gs=u(Q),rt=r(Q,"P",{});var zn=a(rt);Vs=l(zn,"This model inherits from "),Ut=r(zn,"A",{href:!0});var mi=a(Ut);Js=l(mi,"PreTrainedModel"),mi.forEach(o),Ks=l(zn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),zn.forEach(o),Ys=u(Q),at=r(Q,"P",{});var Fn=a(at);Zs=l(Fn,"This model is also a PyTorch "),it=r(Fn,"A",{href:!0,rel:!0});var ui=a(it);Xs=l(ui,"torch.nn.Module"),ui.forEach(o),er=l(Fn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Fn.forEach(o),tr=u(Q),L=r(Q,"DIV",{class:!0});var Le=a(L);w(lt.$$.fragment,Le),or=u(Le),ne=r(Le,"P",{});var io=a(ne);nr=l(io,"The "),Gt=r(io,"A",{href:!0});var fi=a(Gt);sr=l(fi,"IBertForMaskedLM"),fi.forEach(o),rr=l(io," forward method, overrides the "),qo=r(io,"CODE",{});var gi=a(qo);ar=l(gi,"__call__"),gi.forEach(o),ir=l(io," special method."),io.forEach(o),lr=u(Le),w(we.$$.fragment,Le),dr=u(Le),w(Te.$$.fragment,Le),Le.forEach(o),Q.forEach(o),mn=u(t),se=r(t,"H2",{class:!0});var xn=a(se);ye=r(xn,"A",{id:!0,class:!0,href:!0});var _i=a(ye);Mo=r(_i,"SPAN",{});var bi=a(Mo);w(dt.$$.fragment,bi),bi.forEach(o),_i.forEach(o),cr=u(xn),zo=r(xn,"SPAN",{});var ki=a(zo);pr=l(ki,"IBertForSequenceClassification"),ki.forEach(o),xn.forEach(o),un=u(t),F=r(t,"DIV",{class:!0});var H=a(F);w(ct.$$.fragment,H),hr=u(H),Fo=r(H,"P",{});var vi=a(Fo);mr=l(vi,`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.`),vi.forEach(o),ur=u(H),pt=r(H,"P",{});var En=a(pt);fr=l(En,"This model inherits from "),Vt=r(En,"A",{href:!0});var wi=a(Vt);gr=l(wi,"PreTrainedModel"),wi.forEach(o),_r=l(En,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),En.forEach(o),br=u(H),ht=r(H,"P",{});var Cn=a(ht);kr=l(Cn,"This model is also a PyTorch "),mt=r(Cn,"A",{href:!0,rel:!0});var Ti=a(mt);vr=l(Ti,"torch.nn.Module"),Ti.forEach(o),wr=l(Cn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Cn.forEach(o),Tr=u(H),j=r(H,"DIV",{class:!0});var U=a(j);w(ut.$$.fragment,U),yr=u(U),re=r(U,"P",{});var lo=a(re);$r=l(lo,"The "),Jt=r(lo,"A",{href:!0});var yi=a(Jt);Ir=l(yi,"IBertForSequenceClassification"),yi.forEach(o),Br=l(lo," forward method, overrides the "),xo=r(lo,"CODE",{});var $i=a(xo);qr=l($i,"__call__"),$i.forEach(o),Mr=l(lo," special method."),lo.forEach(o),zr=u(U),w($e.$$.fragment,U),Fr=u(U),w(Ie.$$.fragment,U),xr=u(U),w(Be.$$.fragment,U),U.forEach(o),H.forEach(o),fn=u(t),ae=r(t,"H2",{class:!0});var jn=a(ae);qe=r(jn,"A",{id:!0,class:!0,href:!0});var Ii=a(qe);Eo=r(Ii,"SPAN",{});var Bi=a(Eo);w(ft.$$.fragment,Bi),Bi.forEach(o),Ii.forEach(o),Er=u(jn),Co=r(jn,"SPAN",{});var qi=a(Co);Cr=l(qi,"IBertForMultipleChoice"),qi.forEach(o),jn.forEach(o),gn=u(t),x=r(t,"DIV",{class:!0});var G=a(x);w(gt.$$.fragment,G),jr=u(G),jo=r(G,"P",{});var Mi=a(jo);Pr=l(Mi,`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.`),Mi.forEach(o),Ar=u(G),_t=r(G,"P",{});var Pn=a(_t);Lr=l(Pn,"This model inherits from "),Kt=r(Pn,"A",{href:!0});var zi=a(Kt);Or=l(zi,"PreTrainedModel"),zi.forEach(o),Sr=l(Pn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Pn.forEach(o),Nr=u(G),bt=r(G,"P",{});var An=a(bt);Dr=l(An,"This model is also a PyTorch "),kt=r(An,"A",{href:!0,rel:!0});var Fi=a(kt);Rr=l(Fi,"torch.nn.Module"),Fi.forEach(o),Wr=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),Qr=u(G),O=r(G,"DIV",{class:!0});var Oe=a(O);w(vt.$$.fragment,Oe),Hr=u(Oe),ie=r(Oe,"P",{});var co=a(ie);Ur=l(co,"The "),Yt=r(co,"A",{href:!0});var xi=a(Yt);Gr=l(xi,"IBertForMultipleChoice"),xi.forEach(o),Vr=l(co," forward method, overrides the "),Po=r(co,"CODE",{});var Ei=a(Po);Jr=l(Ei,"__call__"),Ei.forEach(o),Kr=l(co," special method."),co.forEach(o),Yr=u(Oe),w(Me.$$.fragment,Oe),Zr=u(Oe),w(ze.$$.fragment,Oe),Oe.forEach(o),G.forEach(o),_n=u(t),le=r(t,"H2",{class:!0});var Ln=a(le);Fe=r(Ln,"A",{id:!0,class:!0,href:!0});var Ci=a(Fe);Ao=r(Ci,"SPAN",{});var ji=a(Ao);w(wt.$$.fragment,ji),ji.forEach(o),Ci.forEach(o),Xr=u(Ln),Lo=r(Ln,"SPAN",{});var Pi=a(Lo);ea=l(Pi,"IBertForTokenClassification"),Pi.forEach(o),Ln.forEach(o),bn=u(t),E=r(t,"DIV",{class:!0});var V=a(E);w(Tt.$$.fragment,V),ta=u(V),Oo=r(V,"P",{});var Ai=a(Oo);oa=l(Ai,`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.`),Ai.forEach(o),na=u(V),yt=r(V,"P",{});var On=a(yt);sa=l(On,"This model inherits from "),Zt=r(On,"A",{href:!0});var Li=a(Zt);ra=l(Li,"PreTrainedModel"),Li.forEach(o),aa=l(On,`. 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.)`),On.forEach(o),ia=u(V),$t=r(V,"P",{});var Sn=a($t);la=l(Sn,"This model is also a PyTorch "),It=r(Sn,"A",{href:!0,rel:!0});var Oi=a(It);da=l(Oi,"torch.nn.Module"),Oi.forEach(o),ca=l(Sn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sn.forEach(o),pa=u(V),S=r(V,"DIV",{class:!0});var Se=a(S);w(Bt.$$.fragment,Se),ha=u(Se),de=r(Se,"P",{});var po=a(de);ma=l(po,"The "),Xt=r(po,"A",{href:!0});var Si=a(Xt);ua=l(Si,"IBertForTokenClassification"),Si.forEach(o),fa=l(po," forward method, overrides the "),So=r(po,"CODE",{});var Ni=a(So);ga=l(Ni,"__call__"),Ni.forEach(o),_a=l(po," special method."),po.forEach(o),ba=u(Se),w(xe.$$.fragment,Se),ka=u(Se),w(Ee.$$.fragment,Se),Se.forEach(o),V.forEach(o),kn=u(t),ce=r(t,"H2",{class:!0});var Nn=a(ce);Ce=r(Nn,"A",{id:!0,class:!0,href:!0});var Di=a(Ce);No=r(Di,"SPAN",{});var Ri=a(No);w(qt.$$.fragment,Ri),Ri.forEach(o),Di.forEach(o),va=u(Nn),Do=r(Nn,"SPAN",{});var Wi=a(Do);wa=l(Wi,"IBertForQuestionAnswering"),Wi.forEach(o),Nn.forEach(o),vn=u(t),C=r(t,"DIV",{class:!0});var J=a(C);w(Mt.$$.fragment,J),Ta=u(J),pe=r(J,"P",{});var ho=a(pe);ya=l(ho,`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 `),Ro=r(ho,"CODE",{});var Qi=a(Ro);$a=l(Qi,"span start logits"),Qi.forEach(o),Ia=l(ho," and "),Wo=r(ho,"CODE",{});var Hi=a(Wo);Ba=l(Hi,"span end logits"),Hi.forEach(o),qa=l(ho,")."),ho.forEach(o),Ma=u(J),zt=r(J,"P",{});var Dn=a(zt);za=l(Dn,"This model inherits from "),eo=r(Dn,"A",{href:!0});var Ui=a(eo);Fa=l(Ui,"PreTrainedModel"),Ui.forEach(o),xa=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),Ea=u(J),Ft=r(J,"P",{});var Rn=a(Ft);Ca=l(Rn,"This model is also a PyTorch "),xt=r(Rn,"A",{href:!0,rel:!0});var Gi=a(xt);ja=l(Gi,"torch.nn.Module"),Gi.forEach(o),Pa=l(Rn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Rn.forEach(o),Aa=u(J),N=r(J,"DIV",{class:!0});var Ne=a(N);w(Et.$$.fragment,Ne),La=u(Ne),he=r(Ne,"P",{});var mo=a(he);Oa=l(mo,"The "),to=r(mo,"A",{href:!0});var Vi=a(to);Sa=l(Vi,"IBertForQuestionAnswering"),Vi.forEach(o),Na=l(mo," forward method, overrides the "),Qo=r(mo,"CODE",{});var Ji=a(Qo);Da=l(Ji,"__call__"),Ji.forEach(o),Ra=l(mo," special method."),mo.forEach(o),Wa=u(Ne),w(je.$$.fragment,Ne),Qa=u(Ne),w(Pe.$$.fragment,Ne),Ne.forEach(o),J.forEach(o),this.h()},h(){h(d,"name","hf:doc:metadata"),h(d,"content",JSON.stringify(fl)),h(p,"id","ibert"),h(p,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(p,"href","#ibert"),h(f,"class","relative group"),h(ue,"id","overview"),h(ue,"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"),h(ue,"href","#overview"),h(K,"class","relative group"),h(Re,"href","https://arxiv.org/abs/2101.01321"),h(Re,"rel","nofollow"),h(We,"href","https://huggingface.co/kssteven"),h(We,"rel","nofollow"),h(Qe,"href","https://github.com/kssteven418/I-BERT"),h(Qe,"rel","nofollow"),h(ge,"id","transformers.IBertConfig"),h(ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ge,"href","#transformers.IBertConfig"),h(Y,"class","relative group"),h(Dt,"href","/docs/transformers/main/en/model_doc/ibert#transformers.IBertModel"),h(Ge,"href","https://huggingface.co/kssteven/ibert-roberta-base"),h(Ge,"rel","nofollow"),h(Rt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),h(Wt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),h(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(_e,"id","transformers.IBertModel"),h(_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"),h(_e,"href","#transformers.IBertModel"),h(ee,"class","relative group"),h(Qt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(Ze,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Ze,"rel","nofollow"),h(et,"href","https://arxiv.org/abs/1706.03762"),h(et,"rel","nofollow"),h(Ht,"href","/docs/transformers/main/en/model_doc/ibert#transformers.IBertModel"),h(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ve,"id","transformers.IBertForMaskedLM"),h(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"),h(ve,"href","#transformers.IBertForMaskedLM"),h(oe,"class","relative group"),h(Ut,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(it,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(it,"rel","nofollow"),h(Gt,"href","/docs/transformers/main/en/model_doc/ibert#transformers.IBertForMaskedLM"),h(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ye,"id","transformers.IBertForSequenceClassification"),h(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"),h(ye,"href","#transformers.IBertForSequenceClassification"),h(se,"class","relative group"),h(Vt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(mt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(mt,"rel","nofollow"),h(Jt,"href","/docs/transformers/main/en/model_doc/ibert#transformers.IBertForSequenceClassification"),h(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(qe,"id","transformers.IBertForMultipleChoice"),h(qe,"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"),h(qe,"href","#transformers.IBertForMultipleChoice"),h(ae,"class","relative group"),h(Kt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(kt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(kt,"rel","nofollow"),h(Yt,"href","/docs/transformers/main/en/model_doc/ibert#transformers.IBertForMultipleChoice"),h(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Fe,"id","transformers.IBertForTokenClassification"),h(Fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Fe,"href","#transformers.IBertForTokenClassification"),h(le,"class","relative group"),h(Zt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(It,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(It,"rel","nofollow"),h(Xt,"href","/docs/transformers/main/en/model_doc/ibert#transformers.IBertForTokenClassification"),h(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ce,"id","transformers.IBertForQuestionAnswering"),h(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"),h(Ce,"href","#transformers.IBertForQuestionAnswering"),h(ce,"class","relative group"),h(eo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(xt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(xt,"rel","nofollow"),h(to,"href","/docs/transformers/main/en/model_doc/ibert#transformers.IBertForQuestionAnswering"),h(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,g){e(document.head,d),b(t,k,g),b(t,f,g),e(f,p),e(p,_),T(n,_,null),e(f,c),e(f,q),e(q,Wn),b(t,tn,g),b(t,K,g),e(K,ue),e(ue,fo),T(De,fo,null),e(K,Qn),e(K,go),e(go,Hn),b(t,on,g),b(t,fe,g),e(fe,Un),e(fe,Re),e(Re,Gn),e(fe,Vn),b(t,nn,g),b(t,St,g),e(St,Jn),b(t,sn,g),b(t,Nt,g),e(Nt,_o),e(_o,Kn),b(t,rn,g),b(t,W,g),e(W,Yn),e(W,We),e(We,Zn),e(W,Xn),e(W,Qe),e(Qe,es),e(W,ts),b(t,an,g),b(t,Y,g),e(Y,ge),e(ge,bo),T(He,bo,null),e(Y,os),e(Y,ko),e(ko,ns),b(t,ln,g),b(t,R,g),T(Ue,R,null),e(R,ss),e(R,Z),e(Z,rs),e(Z,Dt),e(Dt,as),e(Z,is),e(Z,Ge),e(Ge,ls),e(Z,ds),e(R,cs),e(R,X),e(X,ps),e(X,Rt),e(Rt,hs),e(X,ms),e(X,Wt),e(Wt,us),e(X,fs),b(t,dn,g),b(t,ee,g),e(ee,_e),e(_e,vo),T(Ve,vo,null),e(ee,gs),e(ee,wo),e(wo,_s),b(t,cn,g),b(t,M,g),T(Je,M,null),e(M,bs),e(M,To),e(To,ks),e(M,vs),e(M,Ke),e(Ke,ws),e(Ke,Qt),e(Qt,Ts),e(Ke,ys),e(M,$s),e(M,Ye),e(Ye,Is),e(Ye,Ze),e(Ze,Bs),e(Ye,qs),e(M,Ms),e(M,Xe),e(Xe,zs),e(Xe,et),e(et,Fs),e(Xe,xs),e(M,Es),e(M,A),T(tt,A,null),e(A,Cs),e(A,te),e(te,js),e(te,Ht),e(Ht,Ps),e(te,As),e(te,yo),e(yo,Ls),e(te,Os),e(A,Ss),T(be,A,null),e(A,Ns),T(ke,A,null),b(t,pn,g),b(t,oe,g),e(oe,ve),e(ve,$o),T(ot,$o,null),e(oe,Ds),e(oe,Io),e(Io,Rs),b(t,hn,g),b(t,z,g),T(nt,z,null),e(z,Ws),e(z,st),e(st,Qs),e(st,Bo),e(Bo,Hs),e(st,Us),e(z,Gs),e(z,rt),e(rt,Vs),e(rt,Ut),e(Ut,Js),e(rt,Ks),e(z,Ys),e(z,at),e(at,Zs),e(at,it),e(it,Xs),e(at,er),e(z,tr),e(z,L),T(lt,L,null),e(L,or),e(L,ne),e(ne,nr),e(ne,Gt),e(Gt,sr),e(ne,rr),e(ne,qo),e(qo,ar),e(ne,ir),e(L,lr),T(we,L,null),e(L,dr),T(Te,L,null),b(t,mn,g),b(t,se,g),e(se,ye),e(ye,Mo),T(dt,Mo,null),e(se,cr),e(se,zo),e(zo,pr),b(t,un,g),b(t,F,g),T(ct,F,null),e(F,hr),e(F,Fo),e(Fo,mr),e(F,ur),e(F,pt),e(pt,fr),e(pt,Vt),e(Vt,gr),e(pt,_r),e(F,br),e(F,ht),e(ht,kr),e(ht,mt),e(mt,vr),e(ht,wr),e(F,Tr),e(F,j),T(ut,j,null),e(j,yr),e(j,re),e(re,$r),e(re,Jt),e(Jt,Ir),e(re,Br),e(re,xo),e(xo,qr),e(re,Mr),e(j,zr),T($e,j,null),e(j,Fr),T(Ie,j,null),e(j,xr),T(Be,j,null),b(t,fn,g),b(t,ae,g),e(ae,qe),e(qe,Eo),T(ft,Eo,null),e(ae,Er),e(ae,Co),e(Co,Cr),b(t,gn,g),b(t,x,g),T(gt,x,null),e(x,jr),e(x,jo),e(jo,Pr),e(x,Ar),e(x,_t),e(_t,Lr),e(_t,Kt),e(Kt,Or),e(_t,Sr),e(x,Nr),e(x,bt),e(bt,Dr),e(bt,kt),e(kt,Rr),e(bt,Wr),e(x,Qr),e(x,O),T(vt,O,null),e(O,Hr),e(O,ie),e(ie,Ur),e(ie,Yt),e(Yt,Gr),e(ie,Vr),e(ie,Po),e(Po,Jr),e(ie,Kr),e(O,Yr),T(Me,O,null),e(O,Zr),T(ze,O,null),b(t,_n,g),b(t,le,g),e(le,Fe),e(Fe,Ao),T(wt,Ao,null),e(le,Xr),e(le,Lo),e(Lo,ea),b(t,bn,g),b(t,E,g),T(Tt,E,null),e(E,ta),e(E,Oo),e(Oo,oa),e(E,na),e(E,yt),e(yt,sa),e(yt,Zt),e(Zt,ra),e(yt,aa),e(E,ia),e(E,$t),e($t,la),e($t,It),e(It,da),e($t,ca),e(E,pa),e(E,S),T(Bt,S,null),e(S,ha),e(S,de),e(de,ma),e(de,Xt),e(Xt,ua),e(de,fa),e(de,So),e(So,ga),e(de,_a),e(S,ba),T(xe,S,null),e(S,ka),T(Ee,S,null),b(t,kn,g),b(t,ce,g),e(ce,Ce),e(Ce,No),T(qt,No,null),e(ce,va),e(ce,Do),e(Do,wa),b(t,vn,g),b(t,C,g),T(Mt,C,null),e(C,Ta),e(C,pe),e(pe,ya),e(pe,Ro),e(Ro,$a),e(pe,Ia),e(pe,Wo),e(Wo,Ba),e(pe,qa),e(C,Ma),e(C,zt),e(zt,za),e(zt,eo),e(eo,Fa),e(zt,xa),e(C,Ea),e(C,Ft),e(Ft,Ca),e(Ft,xt),e(xt,ja),e(Ft,Pa),e(C,Aa),e(C,N),T(Et,N,null),e(N,La),e(N,he),e(he,Oa),e(he,to),e(to,Sa),e(he,Na),e(he,Qo),e(Qo,Da),e(he,Ra),e(N,Wa),T(je,N,null),e(N,Qa),T(Pe,N,null),wn=!0},p(t,[g]){const Ct={};g&2&&(Ct.$$scope={dirty:g,ctx:t}),be.$set(Ct);const Ho={};g&2&&(Ho.$$scope={dirty:g,ctx:t}),ke.$set(Ho);const Uo={};g&2&&(Uo.$$scope={dirty:g,ctx:t}),we.$set(Uo);const Go={};g&2&&(Go.$$scope={dirty:g,ctx:t}),Te.$set(Go);const jt={};g&2&&(jt.$$scope={dirty:g,ctx:t}),$e.$set(jt);const Vo={};g&2&&(Vo.$$scope={dirty:g,ctx:t}),Ie.$set(Vo);const Jo={};g&2&&(Jo.$$scope={dirty:g,ctx:t}),Be.$set(Jo);const Ko={};g&2&&(Ko.$$scope={dirty:g,ctx:t}),Me.$set(Ko);const Pt={};g&2&&(Pt.$$scope={dirty:g,ctx:t}),ze.$set(Pt);const Yo={};g&2&&(Yo.$$scope={dirty:g,ctx:t}),xe.$set(Yo);const Zo={};g&2&&(Zo.$$scope={dirty:g,ctx:t}),Ee.$set(Zo);const Xo={};g&2&&(Xo.$$scope={dirty:g,ctx:t}),je.$set(Xo);const en={};g&2&&(en.$$scope={dirty:g,ctx:t}),Pe.$set(en)},i(t){wn||(y(n.$$.fragment,t),y(De.$$.fragment,t),y(He.$$.fragment,t),y(Ue.$$.fragment,t),y(Ve.$$.fragment,t),y(Je.$$.fragment,t),y(tt.$$.fragment,t),y(be.$$.fragment,t),y(ke.$$.fragment,t),y(ot.$$.fragment,t),y(nt.$$.fragment,t),y(lt.$$.fragment,t),y(we.$$.fragment,t),y(Te.$$.fragment,t),y(dt.$$.fragment,t),y(ct.$$.fragment,t),y(ut.$$.fragment,t),y($e.$$.fragment,t),y(Ie.$$.fragment,t),y(Be.$$.fragment,t),y(ft.$$.fragment,t),y(gt.$$.fragment,t),y(vt.$$.fragment,t),y(Me.$$.fragment,t),y(ze.$$.fragment,t),y(wt.$$.fragment,t),y(Tt.$$.fragment,t),y(Bt.$$.fragment,t),y(xe.$$.fragment,t),y(Ee.$$.fragment,t),y(qt.$$.fragment,t),y(Mt.$$.fragment,t),y(Et.$$.fragment,t),y(je.$$.fragment,t),y(Pe.$$.fragment,t),wn=!0)},o(t){$(n.$$.fragment,t),$(De.$$.fragment,t),$(He.$$.fragment,t),$(Ue.$$.fragment,t),$(Ve.$$.fragment,t),$(Je.$$.fragment,t),$(tt.$$.fragment,t),$(be.$$.fragment,t),$(ke.$$.fragment,t),$(ot.$$.fragment,t),$(nt.$$.fragment,t),$(lt.$$.fragment,t),$(we.$$.fragment,t),$(Te.$$.fragment,t),$(dt.$$.fragment,t),$(ct.$$.fragment,t),$(ut.$$.fragment,t),$($e.$$.fragment,t),$(Ie.$$.fragment,t),$(Be.$$.fragment,t),$(ft.$$.fragment,t),$(gt.$$.fragment,t),$(vt.$$.fragment,t),$(Me.$$.fragment,t),$(ze.$$.fragment,t),$(wt.$$.fragment,t),$(Tt.$$.fragment,t),$(Bt.$$.fragment,t),$(xe.$$.fragment,t),$(Ee.$$.fragment,t),$(qt.$$.fragment,t),$(Mt.$$.fragment,t),$(Et.$$.fragment,t),$(je.$$.fragment,t),$(Pe.$$.fragment,t),wn=!1},d(t){o(d),t&&o(k),t&&o(f),I(n),t&&o(tn),t&&o(K),I(De),t&&o(on),t&&o(fe),t&&o(nn),t&&o(St),t&&o(sn),t&&o(Nt),t&&o(rn),t&&o(W),t&&o(an),t&&o(Y),I(He),t&&o(ln),t&&o(R),I(Ue),t&&o(dn),t&&o(ee),I(Ve),t&&o(cn),t&&o(M),I(Je),I(tt),I(be),I(ke),t&&o(pn),t&&o(oe),I(ot),t&&o(hn),t&&o(z),I(nt),I(lt),I(we),I(Te),t&&o(mn),t&&o(se),I(dt),t&&o(un),t&&o(F),I(ct),I(ut),I($e),I(Ie),I(Be),t&&o(fn),t&&o(ae),I(ft),t&&o(gn),t&&o(x),I(gt),I(vt),I(Me),I(ze),t&&o(_n),t&&o(le),I(wt),t&&o(bn),t&&o(E),I(Tt),I(Bt),I(xe),I(Ee),t&&o(kn),t&&o(ce),I(qt),t&&o(vn),t&&o(C),I(Mt),I(Et),I(je),I(Pe)}}}const fl={local:"ibert",sections:[{local:"overview",title:"Overview"},{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 gl(B){return el(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class yl extends Ki{constructor(d){super();Yi(this,d,gl,ul,Zi,{})}}export{yl as default,fl as metadata};
