import{S as Nl,i as Dl,s as Rl,e as s,k as h,w as v,t as i,M as Wl,c as r,d as o,m as u,a,x as w,h as l,b as c,G as e,g as b,y as T,q as y,o as $,B as I,v as Ql,L as Rt}from"../../chunks/vendor-hf-doc-builder.js";import{T as $o}from"../../chunks/Tip-hf-doc-builder.js";import{D as P}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Wt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Z}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Dt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Hl(B){let d,k,f,m,_;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"),m=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 p=a(d);k=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var q=a(f);m=l(q,"Module"),q.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){b(n,d,p),e(d,k),e(d,f),e(f,m),e(d,_)},d(n){n&&o(d)}}}function Ul(B){let d,k,f,m,_;return m=new Wt({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=h(),v(m.$$.fragment)},l(n){d=r(n,"P",{});var p=a(d);k=l(p,"Example:"),p.forEach(o),f=u(n),w(m.$$.fragment,n)},m(n,p){b(n,d,p),e(d,k),b(n,f,p),T(m,n,p),_=!0},p:Rt,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(m,n)}}}function Gl(B){let d,k,f,m,_;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"),m=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 p=a(d);k=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var q=a(f);m=l(q,"Module"),q.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){b(n,d,p),e(d,k),e(d,f),e(f,m),e(d,_)},d(n){n&&o(d)}}}function Vl(B){let d,k,f,m,_;return m=new Wt({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=h(),v(m.$$.fragment)},l(n){d=r(n,"P",{});var p=a(d);k=l(p,"Example:"),p.forEach(o),f=u(n),w(m.$$.fragment,n)},m(n,p){b(n,d,p),e(d,k),b(n,f,p),T(m,n,p),_=!0},p:Rt,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(m,n)}}}function Jl(B){let d,k,f,m,_;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"),m=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 p=a(d);k=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var q=a(f);m=l(q,"Module"),q.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){b(n,d,p),e(d,k),e(d,f),e(f,m),e(d,_)},d(n){n&&o(d)}}}function Kl(B){let d,k,f,m,_;return m=new Wt({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=h(),v(m.$$.fragment)},l(n){d=r(n,"P",{});var p=a(d);k=l(p,"Example of single-label classification:"),p.forEach(o),f=u(n),w(m.$$.fragment,n)},m(n,p){b(n,d,p),e(d,k),b(n,f,p),T(m,n,p),_=!0},p:Rt,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(m,n)}}}function Yl(B){let d,k,f,m,_;return m=new Wt({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=h(),v(m.$$.fragment)},l(n){d=r(n,"P",{});var p=a(d);k=l(p,"Example of multi-label classification:"),p.forEach(o),f=u(n),w(m.$$.fragment,n)},m(n,p){b(n,d,p),e(d,k),b(n,f,p),T(m,n,p),_=!0},p:Rt,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(m,n)}}}function Zl(B){let d,k,f,m,_;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"),m=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 p=a(d);k=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var q=a(f);m=l(q,"Module"),q.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){b(n,d,p),e(d,k),e(d,f),e(f,m),e(d,_)},d(n){n&&o(d)}}}function Xl(B){let d,k,f,m,_;return m=new Wt({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=h(),v(m.$$.fragment)},l(n){d=r(n,"P",{});var p=a(d);k=l(p,"Example:"),p.forEach(o),f=u(n),w(m.$$.fragment,n)},m(n,p){b(n,d,p),e(d,k),b(n,f,p),T(m,n,p),_=!0},p:Rt,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(m,n)}}}function ed(B){let d,k,f,m,_;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"),m=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 p=a(d);k=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var q=a(f);m=l(q,"Module"),q.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){b(n,d,p),e(d,k),e(d,f),e(f,m),e(d,_)},d(n){n&&o(d)}}}function td(B){let d,k,f,m,_;return m=new Wt({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=h(),v(m.$$.fragment)},l(n){d=r(n,"P",{});var p=a(d);k=l(p,"Example:"),p.forEach(o),f=u(n),w(m.$$.fragment,n)},m(n,p){b(n,d,p),e(d,k),b(n,f,p),T(m,n,p),_=!0},p:Rt,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(m,n)}}}function od(B){let d,k,f,m,_;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"),m=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 p=a(d);k=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var q=a(f);m=l(q,"Module"),q.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){b(n,d,p),e(d,k),e(d,f),e(f,m),e(d,_)},d(n){n&&o(d)}}}function nd(B){let d,k,f,m,_;return m=new Wt({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=h(),v(m.$$.fragment)},l(n){d=r(n,"P",{});var p=a(d);k=l(p,"Example:"),p.forEach(o),f=u(n),w(m.$$.fragment,n)},m(n,p){b(n,d,p),e(d,k),b(n,f,p),T(m,n,p),_=!0},p:Rt,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){$(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(f),I(m,n)}}}function sd(B){let d,k,f,m,_,n,p,q,ds,kn,X,_e,Io,He,cs,Bo,ps,vn,be,hs,Ue,us,ms,wn,Qt,fs,Tn,Ht,qo,gs,yn,Q,_s,Ge,bs,ks,Ve,vs,ws,$n,ee,ke,Mo,Je,Ts,zo,ys,In,j,Fo,Ut,$s,Is,Eo,Gt,Bs,qs,xo,Vt,Ms,zs,Co,Jt,Fs,Es,jo,Kt,xs,Bn,te,ve,Ao,Ke,Cs,Po,js,qn,W,Ye,As,oe,Ps,Yt,Ls,Ss,Ze,Os,Ns,Ds,ne,Rs,Zt,Ws,Qs,Xt,Hs,Us,Mn,se,we,Lo,Xe,Gs,So,Vs,zn,M,et,Js,Oo,Ks,Ys,tt,Zs,eo,Xs,er,tr,ot,or,nt,nr,sr,rr,st,ar,rt,ir,lr,dr,L,at,cr,re,pr,to,hr,ur,No,mr,fr,gr,Te,_r,ye,Fn,ae,$e,Do,it,br,Ro,kr,En,z,lt,vr,dt,wr,Wo,Tr,yr,$r,ct,Ir,oo,Br,qr,Mr,pt,zr,ht,Fr,Er,xr,S,ut,Cr,ie,jr,no,Ar,Pr,Qo,Lr,Sr,Or,Ie,Nr,Be,xn,le,qe,Ho,mt,Dr,Uo,Rr,Cn,F,ft,Wr,Go,Qr,Hr,gt,Ur,so,Gr,Vr,Jr,_t,Kr,bt,Yr,Zr,Xr,A,kt,ea,de,ta,ro,oa,na,Vo,sa,ra,aa,Me,ia,ze,la,Fe,jn,ce,Ee,Jo,vt,da,Ko,ca,An,E,wt,pa,Yo,ha,ua,Tt,ma,ao,fa,ga,_a,yt,ba,$t,ka,va,wa,O,It,Ta,pe,ya,io,$a,Ia,Zo,Ba,qa,Ma,xe,za,Ce,Pn,he,je,Xo,Bt,Fa,en,Ea,Ln,x,qt,xa,tn,Ca,ja,Mt,Aa,lo,Pa,La,Sa,zt,Oa,Ft,Na,Da,Ra,N,Et,Wa,ue,Qa,co,Ha,Ua,on,Ga,Va,Ja,Ae,Ka,Pe,Sn,me,Le,nn,xt,Ya,sn,Za,On,C,Ct,Xa,fe,ei,rn,ti,oi,an,ni,si,ri,jt,ai,po,ii,li,di,At,ci,Pt,pi,hi,ui,D,Lt,mi,ge,fi,ho,gi,_i,ln,bi,ki,vi,Se,wi,Oe,Nn;return n=new Z({}),He=new Z({}),Je=new Z({}),Ke=new Z({}),Ye=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/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/ibert/configuration_ibert.py#L37"}}),Xe=new Z({}),et=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/ibert/modeling_ibert.py#L733"}}),at=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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/ibert/modeling_ibert.py#L772",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Te=new $o({props:{$$slots:{default:[Hl]},$$scope:{ctx:B}}}),ye=new Dt({props:{anchor:"transformers.IBertModel.forward.example",$$slots:{default:[Ul]},$$scope:{ctx:B}}}),it=new Z({}),lt=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/ibert/modeling_ibert.py#L856"}}),ut=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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/ibert/modeling_ibert.py#L875",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/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/v4.27.1/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ie=new $o({props:{$$slots:{default:[Gl]},$$scope:{ctx:B}}}),Be=new Dt({props:{anchor:"transformers.IBertForMaskedLM.forward.example",$$slots:{default:[Vl]},$$scope:{ctx:B}}}),mt=new Z({}),ft=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/ibert/modeling_ibert.py#L970"}}),kt=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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/ibert/modeling_ibert.py#L983",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/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/v4.27.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Me=new $o({props:{$$slots:{default:[Jl]},$$scope:{ctx:B}}}),ze=new Dt({props:{anchor:"transformers.IBertForSequenceClassification.forward.example",$$slots:{default:[Kl]},$$scope:{ctx:B}}}),Fe=new Dt({props:{anchor:"transformers.IBertForSequenceClassification.forward.example-2",$$slots:{default:[Yl]},$$scope:{ctx:B}}}),vt=new Z({}),wt=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/ibert/modeling_ibert.py#L1065"}}),It=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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/ibert/modeling_ibert.py#L1078",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/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/v4.27.1/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xe=new $o({props:{$$slots:{default:[Zl]},$$scope:{ctx:B}}}),Ce=new Dt({props:{anchor:"transformers.IBertForMultipleChoice.forward.example",$$slots:{default:[Xl]},$$scope:{ctx:B}}}),Bt=new Z({}),qt=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/ibert/modeling_ibert.py#L1157"}}),Et=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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/ibert/modeling_ibert.py#L1172",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/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/v4.27.1/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ae=new $o({props:{$$slots:{default:[ed]},$$scope:{ctx:B}}}),Pe=new Dt({props:{anchor:"transformers.IBertForTokenClassification.forward.example",$$slots:{default:[td]},$$scope:{ctx:B}}}),xt=new Z({}),Ct=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/ibert/modeling_ibert.py#L1257"}}),Lt=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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/ibert/modeling_ibert.py#L1271",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/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/v4.27.1/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Se=new $o({props:{$$slots:{default:[od]},$$scope:{ctx:B}}}),Oe=new Dt({props:{anchor:"transformers.IBertForQuestionAnswering.forward.example",$$slots:{default:[nd]},$$scope:{ctx:B}}}),{c(){d=s("meta"),k=h(),f=s("h1"),m=s("a"),_=s("span"),v(n.$$.fragment),p=h(),q=s("span"),ds=i("I-BERT"),kn=h(),X=s("h2"),_e=s("a"),Io=s("span"),v(He.$$.fragment),cs=h(),Bo=s("span"),ps=i("Overview"),vn=h(),be=s("p"),hs=i("The I-BERT model was proposed in "),Ue=s("a"),us=i("I-BERT: Integer-only BERT Quantization"),ms=i(` by
Sehoon Kim, Amir Gholami, Zhewei Yao, Michael W. Mahoney and Kurt Keutzer. It\u2019s a quantized version of RoBERTa running
inference up to four times faster.`),wn=h(),Qt=s("p"),fs=i("The abstract from the paper is the following:"),Tn=h(),Ht=s("p"),qo=s("em"),gs=i(`Transformer based models, like BERT and RoBERTa, have achieved state-of-the-art results in many Natural Language
Processing tasks. However, their memory footprint, inference latency, and power consumption are prohibitive for
efficient inference at the edge, and even at the data center. While quantization can be a viable solution for this,
previous work on quantizing Transformer based models use floating-point arithmetic during inference, which cannot
efficiently utilize integer-only logical units such as the recent Turing Tensor Cores, or traditional integer-only ARM
processors. In this work, we propose I-BERT, a novel quantization scheme for Transformer based models that quantizes
the entire inference with integer-only arithmetic. Based on lightweight integer-only approximation methods for
nonlinear operations, e.g., GELU, Softmax, and Layer Normalization, I-BERT performs an end-to-end integer-only BERT
inference without any floating point calculation. We evaluate our approach on GLUE downstream tasks using
RoBERTa-Base/Large. We show that for both cases, I-BERT achieves similar (and slightly higher) accuracy as compared to
the full-precision baseline. Furthermore, our preliminary implementation of I-BERT shows a speedup of 2.4 - 4.0x for
INT8 inference on a T4 GPU system as compared to FP32 inference. The framework has been developed in PyTorch and has
been open-sourced.`),yn=h(),Q=s("p"),_s=i("This model was contributed by "),Ge=s("a"),bs=i("kssteven"),ks=i(". The original code can be found "),Ve=s("a"),vs=i("here"),ws=i("."),$n=h(),ee=s("h2"),ke=s("a"),Mo=s("span"),v(Je.$$.fragment),Ts=h(),zo=s("span"),ys=i("Documentation resources"),In=h(),j=s("ul"),Fo=s("li"),Ut=s("a"),$s=i("Text classification task guide"),Is=h(),Eo=s("li"),Gt=s("a"),Bs=i("Token classification task guide"),qs=h(),xo=s("li"),Vt=s("a"),Ms=i("Question answering task guide"),zs=h(),Co=s("li"),Jt=s("a"),Fs=i("Masked language modeling task guide"),Es=h(),jo=s("li"),Kt=s("a"),xs=i("Multiple choice task guide"),Bn=h(),te=s("h2"),ve=s("a"),Ao=s("span"),v(Ke.$$.fragment),Cs=h(),Po=s("span"),js=i("IBertConfig"),qn=h(),W=s("div"),v(Ye.$$.fragment),As=h(),oe=s("p"),Ps=i("This is the configuration class to store the configuration of a "),Yt=s("a"),Ls=i("IBertModel"),Ss=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
`),Ze=s("a"),Os=i("kssteven/ibert-roberta-base"),Ns=i(" architecture."),Ds=h(),ne=s("p"),Rs=i("Configuration objects inherit from "),Zt=s("a"),Ws=i("PretrainedConfig"),Qs=i(` and can be used to control the model outputs. Read the
documentation from `),Xt=s("a"),Hs=i("PretrainedConfig"),Us=i(" for more information."),Mn=h(),se=s("h2"),we=s("a"),Lo=s("span"),v(Xe.$$.fragment),Gs=h(),So=s("span"),Vs=i("IBertModel"),zn=h(),M=s("div"),v(et.$$.fragment),Js=h(),Oo=s("p"),Ks=i("The bare I-BERT Model transformer outputting raw hidden-states without any specific head on top."),Ys=h(),tt=s("p"),Zs=i("This model inherits from "),eo=s("a"),Xs=i("PreTrainedModel"),er=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.)`),tr=h(),ot=s("p"),or=i("This model is also a PyTorch "),nt=s("a"),nr=i("torch.nn.Module"),sr=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),rr=h(),st=s("p"),ar=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 `),rt=s("a"),ir=i(`Attention is
all you need`),lr=i(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),dr=h(),L=s("div"),v(at.$$.fragment),cr=h(),re=s("p"),pr=i("The "),to=s("a"),hr=i("IBertModel"),ur=i(" forward method, overrides the "),No=s("code"),mr=i("__call__"),fr=i(" special method."),gr=h(),v(Te.$$.fragment),_r=h(),v(ye.$$.fragment),Fn=h(),ae=s("h2"),$e=s("a"),Do=s("span"),v(it.$$.fragment),br=h(),Ro=s("span"),kr=i("IBertForMaskedLM"),En=h(),z=s("div"),v(lt.$$.fragment),vr=h(),dt=s("p"),wr=i("I-BERT Model with a "),Wo=s("code"),Tr=i("language modeling"),yr=i(" head on top."),$r=h(),ct=s("p"),Ir=i("This model inherits from "),oo=s("a"),Br=i("PreTrainedModel"),qr=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.)`),Mr=h(),pt=s("p"),zr=i("This model is also a PyTorch "),ht=s("a"),Fr=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.`),xr=h(),S=s("div"),v(ut.$$.fragment),Cr=h(),ie=s("p"),jr=i("The "),no=s("a"),Ar=i("IBertForMaskedLM"),Pr=i(" forward method, overrides the "),Qo=s("code"),Lr=i("__call__"),Sr=i(" special method."),Or=h(),v(Ie.$$.fragment),Nr=h(),v(Be.$$.fragment),xn=h(),le=s("h2"),qe=s("a"),Ho=s("span"),v(mt.$$.fragment),Dr=h(),Uo=s("span"),Rr=i("IBertForSequenceClassification"),Cn=h(),F=s("div"),v(ft.$$.fragment),Wr=h(),Go=s("p"),Qr=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.`),Hr=h(),gt=s("p"),Ur=i("This model inherits from "),so=s("a"),Gr=i("PreTrainedModel"),Vr=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.)`),Jr=h(),_t=s("p"),Kr=i("This model is also a PyTorch "),bt=s("a"),Yr=i("torch.nn.Module"),Zr=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Xr=h(),A=s("div"),v(kt.$$.fragment),ea=h(),de=s("p"),ta=i("The "),ro=s("a"),oa=i("IBertForSequenceClassification"),na=i(" forward method, overrides the "),Vo=s("code"),sa=i("__call__"),ra=i(" special method."),aa=h(),v(Me.$$.fragment),ia=h(),v(ze.$$.fragment),la=h(),v(Fe.$$.fragment),jn=h(),ce=s("h2"),Ee=s("a"),Jo=s("span"),v(vt.$$.fragment),da=h(),Ko=s("span"),ca=i("IBertForMultipleChoice"),An=h(),E=s("div"),v(wt.$$.fragment),pa=h(),Yo=s("p"),ha=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.`),ua=h(),Tt=s("p"),ma=i("This model inherits from "),ao=s("a"),fa=i("PreTrainedModel"),ga=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),_a=h(),yt=s("p"),ba=i("This model is also a PyTorch "),$t=s("a"),ka=i("torch.nn.Module"),va=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),wa=h(),O=s("div"),v(It.$$.fragment),Ta=h(),pe=s("p"),ya=i("The "),io=s("a"),$a=i("IBertForMultipleChoice"),Ia=i(" forward method, overrides the "),Zo=s("code"),Ba=i("__call__"),qa=i(" special method."),Ma=h(),v(xe.$$.fragment),za=h(),v(Ce.$$.fragment),Pn=h(),he=s("h2"),je=s("a"),Xo=s("span"),v(Bt.$$.fragment),Fa=h(),en=s("span"),Ea=i("IBertForTokenClassification"),Ln=h(),x=s("div"),v(qt.$$.fragment),xa=h(),tn=s("p"),Ca=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.`),ja=h(),Mt=s("p"),Aa=i("This model inherits from "),lo=s("a"),Pa=i("PreTrainedModel"),La=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Sa=h(),zt=s("p"),Oa=i("This model is also a PyTorch "),Ft=s("a"),Na=i("torch.nn.Module"),Da=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ra=h(),N=s("div"),v(Et.$$.fragment),Wa=h(),ue=s("p"),Qa=i("The "),co=s("a"),Ha=i("IBertForTokenClassification"),Ua=i(" forward method, overrides the "),on=s("code"),Ga=i("__call__"),Va=i(" special method."),Ja=h(),v(Ae.$$.fragment),Ka=h(),v(Pe.$$.fragment),Sn=h(),me=s("h2"),Le=s("a"),nn=s("span"),v(xt.$$.fragment),Ya=h(),sn=s("span"),Za=i("IBertForQuestionAnswering"),On=h(),C=s("div"),v(Ct.$$.fragment),Xa=h(),fe=s("p"),ei=i(`I-BERT Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `),rn=s("code"),ti=i("span start logits"),oi=i(" and "),an=s("code"),ni=i("span end logits"),si=i(")."),ri=h(),jt=s("p"),ai=i("This model inherits from "),po=s("a"),ii=i("PreTrainedModel"),li=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),di=h(),At=s("p"),ci=i("This model is also a PyTorch "),Pt=s("a"),pi=i("torch.nn.Module"),hi=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ui=h(),D=s("div"),v(Lt.$$.fragment),mi=h(),ge=s("p"),fi=i("The "),ho=s("a"),gi=i("IBertForQuestionAnswering"),_i=i(" forward method, overrides the "),ln=s("code"),bi=i("__call__"),ki=i(" special method."),vi=h(),v(Se.$$.fragment),wi=h(),v(Oe.$$.fragment),this.h()},l(t){const g=Wl('[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 St=a(f);m=r(St,"A",{id:!0,class:!0,href:!0});var dn=a(m);_=r(dn,"SPAN",{});var cn=a(_);w(n.$$.fragment,cn),cn.forEach(o),dn.forEach(o),p=u(St),q=r(St,"SPAN",{});var pn=a(q);ds=l(pn,"I-BERT"),pn.forEach(o),St.forEach(o),kn=u(t),X=r(t,"H2",{class:!0});var Ot=a(X);_e=r(Ot,"A",{id:!0,class:!0,href:!0});var hn=a(_e);Io=r(hn,"SPAN",{});var un=a(Io);w(He.$$.fragment,un),un.forEach(o),hn.forEach(o),cs=u(Ot),Bo=r(Ot,"SPAN",{});var mn=a(Bo);ps=l(mn,"Overview"),mn.forEach(o),Ot.forEach(o),vn=u(t),be=r(t,"P",{});var Nt=a(be);hs=l(Nt,"The I-BERT model was proposed in "),Ue=r(Nt,"A",{href:!0,rel:!0});var fn=a(Ue);us=l(fn,"I-BERT: Integer-only BERT Quantization"),fn.forEach(o),ms=l(Nt,` by
Sehoon Kim, Amir Gholami, Zhewei Yao, Michael W. Mahoney and Kurt Keutzer. It\u2019s a quantized version of RoBERTa running
inference up to four times faster.`),Nt.forEach(o),wn=u(t),Qt=r(t,"P",{});var gn=a(Qt);fs=l(gn,"The abstract from the paper is the following:"),gn.forEach(o),Tn=u(t),Ht=r(t,"P",{});var _n=a(Ht);qo=r(_n,"EM",{});var bn=a(qo);gs=l(bn,`Transformer based models, like BERT and RoBERTa, have achieved state-of-the-art results in many Natural Language
Processing tasks. However, their memory footprint, inference latency, and power consumption are prohibitive for
efficient inference at the edge, and even at the data center. While quantization can be a viable solution for this,
previous work on quantizing Transformer based models use floating-point arithmetic during inference, which cannot
efficiently utilize integer-only logical units such as the recent Turing Tensor Cores, or traditional integer-only ARM
processors. In this work, we propose I-BERT, a novel quantization scheme for Transformer based models that quantizes
the entire inference with integer-only arithmetic. Based on lightweight integer-only approximation methods for
nonlinear operations, e.g., GELU, Softmax, and Layer Normalization, I-BERT performs an end-to-end integer-only BERT
inference without any floating point calculation. We evaluate our approach on GLUE downstream tasks using
RoBERTa-Base/Large. We show that for both cases, I-BERT achieves similar (and slightly higher) accuracy as compared to
the full-precision baseline. Furthermore, our preliminary implementation of I-BERT shows a speedup of 2.4 - 4.0x for
INT8 inference on a T4 GPU system as compared to FP32 inference. The framework has been developed in PyTorch and has
been open-sourced.`),bn.forEach(o),_n.forEach(o),yn=u(t),Q=r(t,"P",{});var uo=a(Q);_s=l(uo,"This model was contributed by "),Ge=r(uo,"A",{href:!0,rel:!0});var Ti=a(Ge);bs=l(Ti,"kssteven"),Ti.forEach(o),ks=l(uo,". The original code can be found "),Ve=r(uo,"A",{href:!0,rel:!0});var yi=a(Ve);vs=l(yi,"here"),yi.forEach(o),ws=l(uo,"."),uo.forEach(o),$n=u(t),ee=r(t,"H2",{class:!0});var Dn=a(ee);ke=r(Dn,"A",{id:!0,class:!0,href:!0});var $i=a(ke);Mo=r($i,"SPAN",{});var Ii=a(Mo);w(Je.$$.fragment,Ii),Ii.forEach(o),$i.forEach(o),Ts=u(Dn),zo=r(Dn,"SPAN",{});var Bi=a(zo);ys=l(Bi,"Documentation resources"),Bi.forEach(o),Dn.forEach(o),In=u(t),j=r(t,"UL",{});var H=a(j);Fo=r(H,"LI",{});var qi=a(Fo);Ut=r(qi,"A",{href:!0});var Mi=a(Ut);$s=l(Mi,"Text classification task guide"),Mi.forEach(o),qi.forEach(o),Is=u(H),Eo=r(H,"LI",{});var zi=a(Eo);Gt=r(zi,"A",{href:!0});var Fi=a(Gt);Bs=l(Fi,"Token classification task guide"),Fi.forEach(o),zi.forEach(o),qs=u(H),xo=r(H,"LI",{});var Ei=a(xo);Vt=r(Ei,"A",{href:!0});var xi=a(Vt);Ms=l(xi,"Question answering task guide"),xi.forEach(o),Ei.forEach(o),zs=u(H),Co=r(H,"LI",{});var Ci=a(Co);Jt=r(Ci,"A",{href:!0});var ji=a(Jt);Fs=l(ji,"Masked language modeling task guide"),ji.forEach(o),Ci.forEach(o),Es=u(H),jo=r(H,"LI",{});var Ai=a(jo);Kt=r(Ai,"A",{href:!0});var Pi=a(Kt);xs=l(Pi,"Multiple choice task guide"),Pi.forEach(o),Ai.forEach(o),H.forEach(o),Bn=u(t),te=r(t,"H2",{class:!0});var Rn=a(te);ve=r(Rn,"A",{id:!0,class:!0,href:!0});var Li=a(ve);Ao=r(Li,"SPAN",{});var Si=a(Ao);w(Ke.$$.fragment,Si),Si.forEach(o),Li.forEach(o),Cs=u(Rn),Po=r(Rn,"SPAN",{});var Oi=a(Po);js=l(Oi,"IBertConfig"),Oi.forEach(o),Rn.forEach(o),qn=u(t),W=r(t,"DIV",{class:!0});var mo=a(W);w(Ye.$$.fragment,mo),As=u(mo),oe=r(mo,"P",{});var fo=a(oe);Ps=l(fo,"This is the configuration class to store the configuration of a "),Yt=r(fo,"A",{href:!0});var Ni=a(Yt);Ls=l(Ni,"IBertModel"),Ni.forEach(o),Ss=l(fo,`. It is used to instantiate a I-BERT
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the IBERT
`),Ze=r(fo,"A",{href:!0,rel:!0});var Di=a(Ze);Os=l(Di,"kssteven/ibert-roberta-base"),Di.forEach(o),Ns=l(fo," architecture."),fo.forEach(o),Ds=u(mo),ne=r(mo,"P",{});var go=a(ne);Rs=l(go,"Configuration objects inherit from "),Zt=r(go,"A",{href:!0});var Ri=a(Zt);Ws=l(Ri,"PretrainedConfig"),Ri.forEach(o),Qs=l(go,` and can be used to control the model outputs. Read the
documentation from `),Xt=r(go,"A",{href:!0});var Wi=a(Xt);Hs=l(Wi,"PretrainedConfig"),Wi.forEach(o),Us=l(go," for more information."),go.forEach(o),mo.forEach(o),Mn=u(t),se=r(t,"H2",{class:!0});var Wn=a(se);we=r(Wn,"A",{id:!0,class:!0,href:!0});var Qi=a(we);Lo=r(Qi,"SPAN",{});var Hi=a(Lo);w(Xe.$$.fragment,Hi),Hi.forEach(o),Qi.forEach(o),Gs=u(Wn),So=r(Wn,"SPAN",{});var Ui=a(So);Vs=l(Ui,"IBertModel"),Ui.forEach(o),Wn.forEach(o),zn=u(t),M=r(t,"DIV",{class:!0});var R=a(M);w(et.$$.fragment,R),Js=u(R),Oo=r(R,"P",{});var Gi=a(Oo);Ks=l(Gi,"The bare I-BERT Model transformer outputting raw hidden-states without any specific head on top."),Gi.forEach(o),Ys=u(R),tt=r(R,"P",{});var Qn=a(tt);Zs=l(Qn,"This model inherits from "),eo=r(Qn,"A",{href:!0});var Vi=a(eo);Xs=l(Vi,"PreTrainedModel"),Vi.forEach(o),er=l(Qn,`. 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.)`),Qn.forEach(o),tr=u(R),ot=r(R,"P",{});var Hn=a(ot);or=l(Hn,"This model is also a PyTorch "),nt=r(Hn,"A",{href:!0,rel:!0});var Ji=a(nt);nr=l(Ji,"torch.nn.Module"),Ji.forEach(o),sr=l(Hn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Hn.forEach(o),rr=u(R),st=r(R,"P",{});var Un=a(st);ar=l(Un,`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 `),rt=r(Un,"A",{href:!0,rel:!0});var Ki=a(rt);ir=l(Ki,`Attention is
all you need`),Ki.forEach(o),lr=l(Un,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Un.forEach(o),dr=u(R),L=r(R,"DIV",{class:!0});var Ne=a(L);w(at.$$.fragment,Ne),cr=u(Ne),re=r(Ne,"P",{});var _o=a(re);pr=l(_o,"The "),to=r(_o,"A",{href:!0});var Yi=a(to);hr=l(Yi,"IBertModel"),Yi.forEach(o),ur=l(_o," forward method, overrides the "),No=r(_o,"CODE",{});var Zi=a(No);mr=l(Zi,"__call__"),Zi.forEach(o),fr=l(_o," special method."),_o.forEach(o),gr=u(Ne),w(Te.$$.fragment,Ne),_r=u(Ne),w(ye.$$.fragment,Ne),Ne.forEach(o),R.forEach(o),Fn=u(t),ae=r(t,"H2",{class:!0});var Gn=a(ae);$e=r(Gn,"A",{id:!0,class:!0,href:!0});var Xi=a($e);Do=r(Xi,"SPAN",{});var el=a(Do);w(it.$$.fragment,el),el.forEach(o),Xi.forEach(o),br=u(Gn),Ro=r(Gn,"SPAN",{});var tl=a(Ro);kr=l(tl,"IBertForMaskedLM"),tl.forEach(o),Gn.forEach(o),En=u(t),z=r(t,"DIV",{class:!0});var U=a(z);w(lt.$$.fragment,U),vr=u(U),dt=r(U,"P",{});var Vn=a(dt);wr=l(Vn,"I-BERT Model with a "),Wo=r(Vn,"CODE",{});var ol=a(Wo);Tr=l(ol,"language modeling"),ol.forEach(o),yr=l(Vn," head on top."),Vn.forEach(o),$r=u(U),ct=r(U,"P",{});var Jn=a(ct);Ir=l(Jn,"This model inherits from "),oo=r(Jn,"A",{href:!0});var nl=a(oo);Br=l(nl,"PreTrainedModel"),nl.forEach(o),qr=l(Jn,`. 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.)`),Jn.forEach(o),Mr=u(U),pt=r(U,"P",{});var Kn=a(pt);zr=l(Kn,"This model is also a PyTorch "),ht=r(Kn,"A",{href:!0,rel:!0});var sl=a(ht);Fr=l(sl,"torch.nn.Module"),sl.forEach(o),Er=l(Kn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Kn.forEach(o),xr=u(U),S=r(U,"DIV",{class:!0});var De=a(S);w(ut.$$.fragment,De),Cr=u(De),ie=r(De,"P",{});var bo=a(ie);jr=l(bo,"The "),no=r(bo,"A",{href:!0});var rl=a(no);Ar=l(rl,"IBertForMaskedLM"),rl.forEach(o),Pr=l(bo," forward method, overrides the "),Qo=r(bo,"CODE",{});var al=a(Qo);Lr=l(al,"__call__"),al.forEach(o),Sr=l(bo," special method."),bo.forEach(o),Or=u(De),w(Ie.$$.fragment,De),Nr=u(De),w(Be.$$.fragment,De),De.forEach(o),U.forEach(o),xn=u(t),le=r(t,"H2",{class:!0});var Yn=a(le);qe=r(Yn,"A",{id:!0,class:!0,href:!0});var il=a(qe);Ho=r(il,"SPAN",{});var ll=a(Ho);w(mt.$$.fragment,ll),ll.forEach(o),il.forEach(o),Dr=u(Yn),Uo=r(Yn,"SPAN",{});var dl=a(Uo);Rr=l(dl,"IBertForSequenceClassification"),dl.forEach(o),Yn.forEach(o),Cn=u(t),F=r(t,"DIV",{class:!0});var G=a(F);w(ft.$$.fragment,G),Wr=u(G),Go=r(G,"P",{});var cl=a(Go);Qr=l(cl,`I-BERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),cl.forEach(o),Hr=u(G),gt=r(G,"P",{});var Zn=a(gt);Ur=l(Zn,"This model inherits from "),so=r(Zn,"A",{href:!0});var pl=a(so);Gr=l(pl,"PreTrainedModel"),pl.forEach(o),Vr=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),Jr=u(G),_t=r(G,"P",{});var Xn=a(_t);Kr=l(Xn,"This model is also a PyTorch "),bt=r(Xn,"A",{href:!0,rel:!0});var hl=a(bt);Yr=l(hl,"torch.nn.Module"),hl.forEach(o),Zr=l(Xn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Xn.forEach(o),Xr=u(G),A=r(G,"DIV",{class:!0});var V=a(A);w(kt.$$.fragment,V),ea=u(V),de=r(V,"P",{});var ko=a(de);ta=l(ko,"The "),ro=r(ko,"A",{href:!0});var ul=a(ro);oa=l(ul,"IBertForSequenceClassification"),ul.forEach(o),na=l(ko," forward method, overrides the "),Vo=r(ko,"CODE",{});var ml=a(Vo);sa=l(ml,"__call__"),ml.forEach(o),ra=l(ko," special method."),ko.forEach(o),aa=u(V),w(Me.$$.fragment,V),ia=u(V),w(ze.$$.fragment,V),la=u(V),w(Fe.$$.fragment,V),V.forEach(o),G.forEach(o),jn=u(t),ce=r(t,"H2",{class:!0});var es=a(ce);Ee=r(es,"A",{id:!0,class:!0,href:!0});var fl=a(Ee);Jo=r(fl,"SPAN",{});var gl=a(Jo);w(vt.$$.fragment,gl),gl.forEach(o),fl.forEach(o),da=u(es),Ko=r(es,"SPAN",{});var _l=a(Ko);ca=l(_l,"IBertForMultipleChoice"),_l.forEach(o),es.forEach(o),An=u(t),E=r(t,"DIV",{class:!0});var J=a(E);w(wt.$$.fragment,J),pa=u(J),Yo=r(J,"P",{});var bl=a(Yo);ha=l(bl,`I-BERT Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a
softmax) e.g. for RocStories/SWAG tasks.`),bl.forEach(o),ua=u(J),Tt=r(J,"P",{});var ts=a(Tt);ma=l(ts,"This model inherits from "),ao=r(ts,"A",{href:!0});var kl=a(ao);fa=l(kl,"PreTrainedModel"),kl.forEach(o),ga=l(ts,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ts.forEach(o),_a=u(J),yt=r(J,"P",{});var os=a(yt);ba=l(os,"This model is also a PyTorch "),$t=r(os,"A",{href:!0,rel:!0});var vl=a($t);ka=l(vl,"torch.nn.Module"),vl.forEach(o),va=l(os,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),os.forEach(o),wa=u(J),O=r(J,"DIV",{class:!0});var Re=a(O);w(It.$$.fragment,Re),Ta=u(Re),pe=r(Re,"P",{});var vo=a(pe);ya=l(vo,"The "),io=r(vo,"A",{href:!0});var wl=a(io);$a=l(wl,"IBertForMultipleChoice"),wl.forEach(o),Ia=l(vo," forward method, overrides the "),Zo=r(vo,"CODE",{});var Tl=a(Zo);Ba=l(Tl,"__call__"),Tl.forEach(o),qa=l(vo," special method."),vo.forEach(o),Ma=u(Re),w(xe.$$.fragment,Re),za=u(Re),w(Ce.$$.fragment,Re),Re.forEach(o),J.forEach(o),Pn=u(t),he=r(t,"H2",{class:!0});var ns=a(he);je=r(ns,"A",{id:!0,class:!0,href:!0});var yl=a(je);Xo=r(yl,"SPAN",{});var $l=a(Xo);w(Bt.$$.fragment,$l),$l.forEach(o),yl.forEach(o),Fa=u(ns),en=r(ns,"SPAN",{});var Il=a(en);Ea=l(Il,"IBertForTokenClassification"),Il.forEach(o),ns.forEach(o),Ln=u(t),x=r(t,"DIV",{class:!0});var K=a(x);w(qt.$$.fragment,K),xa=u(K),tn=r(K,"P",{});var Bl=a(tn);Ca=l(Bl,`I-BERT Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),Bl.forEach(o),ja=u(K),Mt=r(K,"P",{});var ss=a(Mt);Aa=l(ss,"This model inherits from "),lo=r(ss,"A",{href:!0});var ql=a(lo);Pa=l(ql,"PreTrainedModel"),ql.forEach(o),La=l(ss,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ss.forEach(o),Sa=u(K),zt=r(K,"P",{});var rs=a(zt);Oa=l(rs,"This model is also a PyTorch "),Ft=r(rs,"A",{href:!0,rel:!0});var Ml=a(Ft);Na=l(Ml,"torch.nn.Module"),Ml.forEach(o),Da=l(rs,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),rs.forEach(o),Ra=u(K),N=r(K,"DIV",{class:!0});var We=a(N);w(Et.$$.fragment,We),Wa=u(We),ue=r(We,"P",{});var wo=a(ue);Qa=l(wo,"The "),co=r(wo,"A",{href:!0});var zl=a(co);Ha=l(zl,"IBertForTokenClassification"),zl.forEach(o),Ua=l(wo," forward method, overrides the "),on=r(wo,"CODE",{});var Fl=a(on);Ga=l(Fl,"__call__"),Fl.forEach(o),Va=l(wo," special method."),wo.forEach(o),Ja=u(We),w(Ae.$$.fragment,We),Ka=u(We),w(Pe.$$.fragment,We),We.forEach(o),K.forEach(o),Sn=u(t),me=r(t,"H2",{class:!0});var as=a(me);Le=r(as,"A",{id:!0,class:!0,href:!0});var El=a(Le);nn=r(El,"SPAN",{});var xl=a(nn);w(xt.$$.fragment,xl),xl.forEach(o),El.forEach(o),Ya=u(as),sn=r(as,"SPAN",{});var Cl=a(sn);Za=l(Cl,"IBertForQuestionAnswering"),Cl.forEach(o),as.forEach(o),On=u(t),C=r(t,"DIV",{class:!0});var Y=a(C);w(Ct.$$.fragment,Y),Xa=u(Y),fe=r(Y,"P",{});var To=a(fe);ei=l(To,`I-BERT Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `),rn=r(To,"CODE",{});var jl=a(rn);ti=l(jl,"span start logits"),jl.forEach(o),oi=l(To," and "),an=r(To,"CODE",{});var Al=a(an);ni=l(Al,"span end logits"),Al.forEach(o),si=l(To,")."),To.forEach(o),ri=u(Y),jt=r(Y,"P",{});var is=a(jt);ai=l(is,"This model inherits from "),po=r(is,"A",{href:!0});var Pl=a(po);ii=l(Pl,"PreTrainedModel"),Pl.forEach(o),li=l(is,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),is.forEach(o),di=u(Y),At=r(Y,"P",{});var ls=a(At);ci=l(ls,"This model is also a PyTorch "),Pt=r(ls,"A",{href:!0,rel:!0});var Ll=a(Pt);pi=l(Ll,"torch.nn.Module"),Ll.forEach(o),hi=l(ls,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ls.forEach(o),ui=u(Y),D=r(Y,"DIV",{class:!0});var Qe=a(D);w(Lt.$$.fragment,Qe),mi=u(Qe),ge=r(Qe,"P",{});var yo=a(ge);fi=l(yo,"The "),ho=r(yo,"A",{href:!0});var Sl=a(ho);gi=l(Sl,"IBertForQuestionAnswering"),Sl.forEach(o),_i=l(yo," forward method, overrides the "),ln=r(yo,"CODE",{});var Ol=a(ln);bi=l(Ol,"__call__"),Ol.forEach(o),ki=l(yo," special method."),yo.forEach(o),vi=u(Qe),w(Se.$$.fragment,Qe),wi=u(Qe),w(Oe.$$.fragment,Qe),Qe.forEach(o),Y.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(rd)),c(m,"id","ibert"),c(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(m,"href","#ibert"),c(f,"class","relative group"),c(_e,"id","overview"),c(_e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(_e,"href","#overview"),c(X,"class","relative group"),c(Ue,"href","https://arxiv.org/abs/2101.01321"),c(Ue,"rel","nofollow"),c(Ge,"href","https://huggingface.co/kssteven"),c(Ge,"rel","nofollow"),c(Ve,"href","https://github.com/kssteven418/I-BERT"),c(Ve,"rel","nofollow"),c(ke,"id","documentation-resources"),c(ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ke,"href","#documentation-resources"),c(ee,"class","relative group"),c(Ut,"href","./tasks/sequence_classification"),c(Gt,"href","./tasks/token_classification"),c(Vt,"href","./tasks/question_answering"),c(Jt,"href","./tasks/masked_language_modeling"),c(Kt,"href","./tasks/masked_language_modeling"),c(ve,"id","transformers.IBertConfig"),c(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ve,"href","#transformers.IBertConfig"),c(te,"class","relative group"),c(Yt,"href","/docs/transformers/v4.27.1/en/model_doc/ibert#transformers.IBertModel"),c(Ze,"href","https://huggingface.co/kssteven/ibert-roberta-base"),c(Ze,"rel","nofollow"),c(Zt,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(Xt,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(we,"id","transformers.IBertModel"),c(we,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(we,"href","#transformers.IBertModel"),c(se,"class","relative group"),c(eo,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(nt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(nt,"rel","nofollow"),c(rt,"href","https://arxiv.org/abs/1706.03762"),c(rt,"rel","nofollow"),c(to,"href","/docs/transformers/v4.27.1/en/model_doc/ibert#transformers.IBertModel"),c(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c($e,"id","transformers.IBertForMaskedLM"),c($e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c($e,"href","#transformers.IBertForMaskedLM"),c(ae,"class","relative group"),c(oo,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(ht,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ht,"rel","nofollow"),c(no,"href","/docs/transformers/v4.27.1/en/model_doc/ibert#transformers.IBertForMaskedLM"),c(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(qe,"id","transformers.IBertForSequenceClassification"),c(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"),c(qe,"href","#transformers.IBertForSequenceClassification"),c(le,"class","relative group"),c(so,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(bt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(bt,"rel","nofollow"),c(ro,"href","/docs/transformers/v4.27.1/en/model_doc/ibert#transformers.IBertForSequenceClassification"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ee,"id","transformers.IBertForMultipleChoice"),c(Ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ee,"href","#transformers.IBertForMultipleChoice"),c(ce,"class","relative group"),c(ao,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c($t,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c($t,"rel","nofollow"),c(io,"href","/docs/transformers/v4.27.1/en/model_doc/ibert#transformers.IBertForMultipleChoice"),c(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(je,"id","transformers.IBertForTokenClassification"),c(je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(je,"href","#transformers.IBertForTokenClassification"),c(he,"class","relative group"),c(lo,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(Ft,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ft,"rel","nofollow"),c(co,"href","/docs/transformers/v4.27.1/en/model_doc/ibert#transformers.IBertForTokenClassification"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Le,"id","transformers.IBertForQuestionAnswering"),c(Le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Le,"href","#transformers.IBertForQuestionAnswering"),c(me,"class","relative group"),c(po,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(Pt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Pt,"rel","nofollow"),c(ho,"href","/docs/transformers/v4.27.1/en/model_doc/ibert#transformers.IBertForQuestionAnswering"),c(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(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,m),e(m,_),T(n,_,null),e(f,p),e(f,q),e(q,ds),b(t,kn,g),b(t,X,g),e(X,_e),e(_e,Io),T(He,Io,null),e(X,cs),e(X,Bo),e(Bo,ps),b(t,vn,g),b(t,be,g),e(be,hs),e(be,Ue),e(Ue,us),e(be,ms),b(t,wn,g),b(t,Qt,g),e(Qt,fs),b(t,Tn,g),b(t,Ht,g),e(Ht,qo),e(qo,gs),b(t,yn,g),b(t,Q,g),e(Q,_s),e(Q,Ge),e(Ge,bs),e(Q,ks),e(Q,Ve),e(Ve,vs),e(Q,ws),b(t,$n,g),b(t,ee,g),e(ee,ke),e(ke,Mo),T(Je,Mo,null),e(ee,Ts),e(ee,zo),e(zo,ys),b(t,In,g),b(t,j,g),e(j,Fo),e(Fo,Ut),e(Ut,$s),e(j,Is),e(j,Eo),e(Eo,Gt),e(Gt,Bs),e(j,qs),e(j,xo),e(xo,Vt),e(Vt,Ms),e(j,zs),e(j,Co),e(Co,Jt),e(Jt,Fs),e(j,Es),e(j,jo),e(jo,Kt),e(Kt,xs),b(t,Bn,g),b(t,te,g),e(te,ve),e(ve,Ao),T(Ke,Ao,null),e(te,Cs),e(te,Po),e(Po,js),b(t,qn,g),b(t,W,g),T(Ye,W,null),e(W,As),e(W,oe),e(oe,Ps),e(oe,Yt),e(Yt,Ls),e(oe,Ss),e(oe,Ze),e(Ze,Os),e(oe,Ns),e(W,Ds),e(W,ne),e(ne,Rs),e(ne,Zt),e(Zt,Ws),e(ne,Qs),e(ne,Xt),e(Xt,Hs),e(ne,Us),b(t,Mn,g),b(t,se,g),e(se,we),e(we,Lo),T(Xe,Lo,null),e(se,Gs),e(se,So),e(So,Vs),b(t,zn,g),b(t,M,g),T(et,M,null),e(M,Js),e(M,Oo),e(Oo,Ks),e(M,Ys),e(M,tt),e(tt,Zs),e(tt,eo),e(eo,Xs),e(tt,er),e(M,tr),e(M,ot),e(ot,or),e(ot,nt),e(nt,nr),e(ot,sr),e(M,rr),e(M,st),e(st,ar),e(st,rt),e(rt,ir),e(st,lr),e(M,dr),e(M,L),T(at,L,null),e(L,cr),e(L,re),e(re,pr),e(re,to),e(to,hr),e(re,ur),e(re,No),e(No,mr),e(re,fr),e(L,gr),T(Te,L,null),e(L,_r),T(ye,L,null),b(t,Fn,g),b(t,ae,g),e(ae,$e),e($e,Do),T(it,Do,null),e(ae,br),e(ae,Ro),e(Ro,kr),b(t,En,g),b(t,z,g),T(lt,z,null),e(z,vr),e(z,dt),e(dt,wr),e(dt,Wo),e(Wo,Tr),e(dt,yr),e(z,$r),e(z,ct),e(ct,Ir),e(ct,oo),e(oo,Br),e(ct,qr),e(z,Mr),e(z,pt),e(pt,zr),e(pt,ht),e(ht,Fr),e(pt,Er),e(z,xr),e(z,S),T(ut,S,null),e(S,Cr),e(S,ie),e(ie,jr),e(ie,no),e(no,Ar),e(ie,Pr),e(ie,Qo),e(Qo,Lr),e(ie,Sr),e(S,Or),T(Ie,S,null),e(S,Nr),T(Be,S,null),b(t,xn,g),b(t,le,g),e(le,qe),e(qe,Ho),T(mt,Ho,null),e(le,Dr),e(le,Uo),e(Uo,Rr),b(t,Cn,g),b(t,F,g),T(ft,F,null),e(F,Wr),e(F,Go),e(Go,Qr),e(F,Hr),e(F,gt),e(gt,Ur),e(gt,so),e(so,Gr),e(gt,Vr),e(F,Jr),e(F,_t),e(_t,Kr),e(_t,bt),e(bt,Yr),e(_t,Zr),e(F,Xr),e(F,A),T(kt,A,null),e(A,ea),e(A,de),e(de,ta),e(de,ro),e(ro,oa),e(de,na),e(de,Vo),e(Vo,sa),e(de,ra),e(A,aa),T(Me,A,null),e(A,ia),T(ze,A,null),e(A,la),T(Fe,A,null),b(t,jn,g),b(t,ce,g),e(ce,Ee),e(Ee,Jo),T(vt,Jo,null),e(ce,da),e(ce,Ko),e(Ko,ca),b(t,An,g),b(t,E,g),T(wt,E,null),e(E,pa),e(E,Yo),e(Yo,ha),e(E,ua),e(E,Tt),e(Tt,ma),e(Tt,ao),e(ao,fa),e(Tt,ga),e(E,_a),e(E,yt),e(yt,ba),e(yt,$t),e($t,ka),e(yt,va),e(E,wa),e(E,O),T(It,O,null),e(O,Ta),e(O,pe),e(pe,ya),e(pe,io),e(io,$a),e(pe,Ia),e(pe,Zo),e(Zo,Ba),e(pe,qa),e(O,Ma),T(xe,O,null),e(O,za),T(Ce,O,null),b(t,Pn,g),b(t,he,g),e(he,je),e(je,Xo),T(Bt,Xo,null),e(he,Fa),e(he,en),e(en,Ea),b(t,Ln,g),b(t,x,g),T(qt,x,null),e(x,xa),e(x,tn),e(tn,Ca),e(x,ja),e(x,Mt),e(Mt,Aa),e(Mt,lo),e(lo,Pa),e(Mt,La),e(x,Sa),e(x,zt),e(zt,Oa),e(zt,Ft),e(Ft,Na),e(zt,Da),e(x,Ra),e(x,N),T(Et,N,null),e(N,Wa),e(N,ue),e(ue,Qa),e(ue,co),e(co,Ha),e(ue,Ua),e(ue,on),e(on,Ga),e(ue,Va),e(N,Ja),T(Ae,N,null),e(N,Ka),T(Pe,N,null),b(t,Sn,g),b(t,me,g),e(me,Le),e(Le,nn),T(xt,nn,null),e(me,Ya),e(me,sn),e(sn,Za),b(t,On,g),b(t,C,g),T(Ct,C,null),e(C,Xa),e(C,fe),e(fe,ei),e(fe,rn),e(rn,ti),e(fe,oi),e(fe,an),e(an,ni),e(fe,si),e(C,ri),e(C,jt),e(jt,ai),e(jt,po),e(po,ii),e(jt,li),e(C,di),e(C,At),e(At,ci),e(At,Pt),e(Pt,pi),e(At,hi),e(C,ui),e(C,D),T(Lt,D,null),e(D,mi),e(D,ge),e(ge,fi),e(ge,ho),e(ho,gi),e(ge,_i),e(ge,ln),e(ln,bi),e(ge,ki),e(D,vi),T(Se,D,null),e(D,wi),T(Oe,D,null),Nn=!0},p(t,[g]){const St={};g&2&&(St.$$scope={dirty:g,ctx:t}),Te.$set(St);const dn={};g&2&&(dn.$$scope={dirty:g,ctx:t}),ye.$set(dn);const cn={};g&2&&(cn.$$scope={dirty:g,ctx:t}),Ie.$set(cn);const pn={};g&2&&(pn.$$scope={dirty:g,ctx:t}),Be.$set(pn);const Ot={};g&2&&(Ot.$$scope={dirty:g,ctx:t}),Me.$set(Ot);const hn={};g&2&&(hn.$$scope={dirty:g,ctx:t}),ze.$set(hn);const un={};g&2&&(un.$$scope={dirty:g,ctx:t}),Fe.$set(un);const mn={};g&2&&(mn.$$scope={dirty:g,ctx:t}),xe.$set(mn);const Nt={};g&2&&(Nt.$$scope={dirty:g,ctx:t}),Ce.$set(Nt);const fn={};g&2&&(fn.$$scope={dirty:g,ctx:t}),Ae.$set(fn);const gn={};g&2&&(gn.$$scope={dirty:g,ctx:t}),Pe.$set(gn);const _n={};g&2&&(_n.$$scope={dirty:g,ctx:t}),Se.$set(_n);const bn={};g&2&&(bn.$$scope={dirty:g,ctx:t}),Oe.$set(bn)},i(t){Nn||(y(n.$$.fragment,t),y(He.$$.fragment,t),y(Je.$$.fragment,t),y(Ke.$$.fragment,t),y(Ye.$$.fragment,t),y(Xe.$$.fragment,t),y(et.$$.fragment,t),y(at.$$.fragment,t),y(Te.$$.fragment,t),y(ye.$$.fragment,t),y(it.$$.fragment,t),y(lt.$$.fragment,t),y(ut.$$.fragment,t),y(Ie.$$.fragment,t),y(Be.$$.fragment,t),y(mt.$$.fragment,t),y(ft.$$.fragment,t),y(kt.$$.fragment,t),y(Me.$$.fragment,t),y(ze.$$.fragment,t),y(Fe.$$.fragment,t),y(vt.$$.fragment,t),y(wt.$$.fragment,t),y(It.$$.fragment,t),y(xe.$$.fragment,t),y(Ce.$$.fragment,t),y(Bt.$$.fragment,t),y(qt.$$.fragment,t),y(Et.$$.fragment,t),y(Ae.$$.fragment,t),y(Pe.$$.fragment,t),y(xt.$$.fragment,t),y(Ct.$$.fragment,t),y(Lt.$$.fragment,t),y(Se.$$.fragment,t),y(Oe.$$.fragment,t),Nn=!0)},o(t){$(n.$$.fragment,t),$(He.$$.fragment,t),$(Je.$$.fragment,t),$(Ke.$$.fragment,t),$(Ye.$$.fragment,t),$(Xe.$$.fragment,t),$(et.$$.fragment,t),$(at.$$.fragment,t),$(Te.$$.fragment,t),$(ye.$$.fragment,t),$(it.$$.fragment,t),$(lt.$$.fragment,t),$(ut.$$.fragment,t),$(Ie.$$.fragment,t),$(Be.$$.fragment,t),$(mt.$$.fragment,t),$(ft.$$.fragment,t),$(kt.$$.fragment,t),$(Me.$$.fragment,t),$(ze.$$.fragment,t),$(Fe.$$.fragment,t),$(vt.$$.fragment,t),$(wt.$$.fragment,t),$(It.$$.fragment,t),$(xe.$$.fragment,t),$(Ce.$$.fragment,t),$(Bt.$$.fragment,t),$(qt.$$.fragment,t),$(Et.$$.fragment,t),$(Ae.$$.fragment,t),$(Pe.$$.fragment,t),$(xt.$$.fragment,t),$(Ct.$$.fragment,t),$(Lt.$$.fragment,t),$(Se.$$.fragment,t),$(Oe.$$.fragment,t),Nn=!1},d(t){o(d),t&&o(k),t&&o(f),I(n),t&&o(kn),t&&o(X),I(He),t&&o(vn),t&&o(be),t&&o(wn),t&&o(Qt),t&&o(Tn),t&&o(Ht),t&&o(yn),t&&o(Q),t&&o($n),t&&o(ee),I(Je),t&&o(In),t&&o(j),t&&o(Bn),t&&o(te),I(Ke),t&&o(qn),t&&o(W),I(Ye),t&&o(Mn),t&&o(se),I(Xe),t&&o(zn),t&&o(M),I(et),I(at),I(Te),I(ye),t&&o(Fn),t&&o(ae),I(it),t&&o(En),t&&o(z),I(lt),I(ut),I(Ie),I(Be),t&&o(xn),t&&o(le),I(mt),t&&o(Cn),t&&o(F),I(ft),I(kt),I(Me),I(ze),I(Fe),t&&o(jn),t&&o(ce),I(vt),t&&o(An),t&&o(E),I(wt),I(It),I(xe),I(Ce),t&&o(Pn),t&&o(he),I(Bt),t&&o(Ln),t&&o(x),I(qt),I(Et),I(Ae),I(Pe),t&&o(Sn),t&&o(me),I(xt),t&&o(On),t&&o(C),I(Ct),I(Lt),I(Se),I(Oe)}}}const rd={local:"ibert",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.IBertConfig",title:"IBertConfig"},{local:"transformers.IBertModel",title:"IBertModel"},{local:"transformers.IBertForMaskedLM",title:"IBertForMaskedLM"},{local:"transformers.IBertForSequenceClassification",title:"IBertForSequenceClassification"},{local:"transformers.IBertForMultipleChoice",title:"IBertForMultipleChoice"},{local:"transformers.IBertForTokenClassification",title:"IBertForTokenClassification"},{local:"transformers.IBertForQuestionAnswering",title:"IBertForQuestionAnswering"}],title:"I-BERT"};function ad(B){return Ql(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ud extends Nl{constructor(d){super();Dl(this,d,ad,sd,Rl,{})}}export{ud as default,rd as metadata};
