import{S as gU,i as _U,s as bU,e as s,k as c,w as T,t as o,M as kU,c as r,d as t,m as p,a,x as v,h as n,b as h,G as e,g,y as w,q as $,o as F,B as x,v as yU,L as be}from"../../chunks/vendor-hf-doc-builder.js";import{T as Se}from"../../chunks/Tip-hf-doc-builder.js";import{D as O}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ke}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as De}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as _e}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Rw}from"../../chunks/PipelineTag-hf-doc-builder.js";function TU(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import BertConfig, BertModel

# Initializing a BERT bert-base-uncased style configuration
configuration = BertConfig()

# Initializing a model (with random weights) from the bert-base-uncased style configuration
model = BertModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertConfig, BertModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BERT bert-base-uncased style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BertConfig()

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){d=s("p"),k=o("Examples:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Examples:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function vU(E){let d,k,f,u,b;return u=new ke({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){d=s("p"),k=o("pair mask has the following format:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"pair mask has the following format:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function wU(E){let d,k,f,u,b;return u=new ke({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){d=s("p"),k=o("pair mask has the following format:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"pair mask has the following format:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function $U(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import TFBertTokenizer

tf_tokenizer = TFBertTokenizer.from_pretrained("bert-base-uncased")`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFBertTokenizer

tf_tokenizer = TFBertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)`}}),{c(){d=s("p"),k=o("Examples:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Examples:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function FU(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, TFBertTokenizer

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
tf_tokenizer = TFBertTokenizer.from_tokenizer(tokenizer)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFBertTokenizer

tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
tf_tokenizer = TFBertTokenizer.from_tokenizer(tokenizer)`}}),{c(){d=s("p"),k=o("Examples:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Examples:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function xU(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function EU(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, BertModel
import torch

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = BertModel.from_pretrained("bert-base-uncased")

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, BertModel
<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;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertModel.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function BU(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function zU(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, BertForPreTraining
import torch

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = BertForPreTraining.from_pretrained("bert-base-uncased")

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

prediction_logits = outputs.prediction_logits
seq_relationship_logits = outputs.seq_relationship_logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertForPreTraining
<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;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForPreTraining.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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>prediction_logits = outputs.prediction_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>seq_relationship_logits = outputs.seq_relationship_logits`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function MU(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function PU(E){let d,k,f,u,b;return u=new ke({props:{code:`import torch
from transformers import AutoTokenizer, BertLMHeadModel

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = BertLMHeadModel.from_pretrained("bert-base-uncased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs, labels=inputs["input_ids"])
loss = outputs.loss
logits = outputs.logits`,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, BertLMHeadModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertLMHeadModel.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = BertForMaskedLM.from_pretrained("bert-base-uncased")

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)
tokenizer.decode(predicted_token_id)

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)
round(outputs.loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertForMaskedLM
<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;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is [MASK].&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve index of [MASK]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>].nonzero(as_tuple=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(outputs.loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.88</span>`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function CU(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function AU(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, BertForNextSentencePrediction
import torch

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = BertForNextSentencePrediction.from_pretrained("bert-base-uncased")

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
next_sentence = "The sky is blue due to the shorter wavelength of blue light."
encoding = tokenizer(prompt, next_sentence, return_tensors="pt")

outputs = model(**encoding, labels=torch.LongTensor([1]))
logits = outputs.logits
assert logits[0, 0] < logits[0, 1]  # next sentence was random`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertForNextSentencePrediction
<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;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForNextSentencePrediction.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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>next_sentence = <span class="hljs-string">&quot;The sky is blue due to the shorter wavelength of blue light.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(prompt, next_sentence, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding, labels=torch.LongTensor([<span class="hljs-number">1</span>]))
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> logits[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>] &lt; logits[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>]  <span class="hljs-comment"># next sentence was random</span>`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function NU(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function OU(E){let d,k,f,u,b;return u=new ke({props:{code:`import torch
from transformers import AutoTokenizer, BertForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("textattack/bert-base-uncased-yelp-polarity")
model = BertForSequenceClassification.from_pretrained("textattack/bert-base-uncased-yelp-polarity")

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

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

predicted_class_id = logits.argmax().item()
model.config.id2label[predicted_class_id]

# 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 = BertForSequenceClassification.from_pretrained("textattack/bert-base-uncased-yelp-polarity", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss
round(loss.item(), 2)`,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, BertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;textattack/bert-base-uncased-yelp-polarity&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;textattack/bert-base-uncased-yelp-polarity&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>model.config.id2label[predicted_class_id]
<span class="hljs-string">&#x27;LABEL_1&#x27;</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 = BertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;textattack/bert-base-uncased-yelp-polarity&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
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.01</span>`}}),{c(){d=s("p"),k=o("Example of single-label classification:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example of single-label classification:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function IU(E){let d,k,f,u,b;return u=new ke({props:{code:`import torch
from transformers import AutoTokenizer, BertForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("textattack/bert-base-uncased-yelp-polarity")
model = BertForSequenceClassification.from_pretrained("textattack/bert-base-uncased-yelp-polarity", 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 = BertForSequenceClassification.from_pretrained(
    "textattack/bert-base-uncased-yelp-polarity", 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, BertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;textattack/bert-base-uncased-yelp-polarity&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;textattack/bert-base-uncased-yelp-polarity&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 = BertForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;textattack/bert-base-uncased-yelp-polarity&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=o("Example of multi-label classification:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example of multi-label classification:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function LU(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function DU(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, BertForMultipleChoice
import torch

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = BertForMultipleChoice.from_pretrained("bert-base-uncased")

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, BertForMultipleChoice
<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;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function SU(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function UU(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, BertForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("dbmdz/bert-large-cased-finetuned-conll03-english")
model = BertForTokenClassification.from_pretrained("dbmdz/bert-large-cased-finetuned-conll03-english")

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]]
predicted_tokens_classes

labels = predicted_token_class_ids
loss = model(**inputs, labels=labels).loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertForTokenClassification
<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;dbmdz/bert-large-cased-finetuned-conll03-english&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;dbmdz/bert-large-cased-finetuned-conll03-english&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>predicted_tokens_classes
[<span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;I-LOC&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;I-LOC&#x27;</span>, <span class="hljs-string">&#x27;I-LOC&#x27;</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
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.01</span>`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function WU(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function HU(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, BertForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("deepset/bert-base-cased-squad2")
model = BertForQuestionAnswering.from_pretrained("deepset/bert-base-cased-squad2")

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]
tokenizer.decode(predict_answer_tokens, skip_special_tokens=True)

# 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
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertForQuestionAnswering
<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;deepset/bert-base-cased-squad2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;deepset/bert-base-cased-squad2&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>tokenizer.decode(predict_answer_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-string">&#x27;a nice puppet&#x27;</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
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">7.41</span>`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function RU(E){let d,k,f,u,b,l,m,z,Fe,ye,S,le,Z,B,xe,Q,Ee,Te,U,Be,ce,X,ze,ve,R,Me,we,K,fe,Pe,te,j,q,je,G,me,qe,J,de,ue,A,Ce,V,Ae,$e,D,Ne,pe,L,Oe,W,Ie,ne,C,ie,N,ge,he;return{c(){d=s("p"),k=o("TensorFlow models and layers in "),f=s("code"),u=o("transformers"),b=o(" accept two formats as input:"),l=c(),m=s("ul"),z=s("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ye=c(),S=s("li"),le=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),B=s("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=s("code"),Ee=o("model.fit()"),Te=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=s("code"),Be=o("model.fit()"),ce=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=s("code"),ze=o("fit()"),ve=o(" and "),R=s("code"),Me=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=s("code"),fe=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=s("ul"),q=s("li"),je=o("a single Tensor with "),G=s("code"),me=o("input_ids"),qe=o(" only and nothing else: "),J=s("code"),de=o("model(input_ids)"),ue=c(),A=s("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=s("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=s("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),pe=c(),L=s("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=s("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=s("p"),ie=o(`Note that when creating models and layers with
`),N=s("a"),ge=o("subclassing"),he=o(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(y){d=r(y,"P",{});var M=a(d);k=n(M,"TensorFlow models and layers in "),f=r(M,"CODE",{});var Ve=a(f);u=n(Ve,"transformers"),Ve.forEach(t),b=n(M," accept two formats as input:"),M.forEach(t),l=p(y),m=r(y,"UL",{});var oe=a(m);z=r(oe,"LI",{});var Ke=a(z);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ye=p(oe),S=r(oe,"LI",{});var Ge=a(S);le=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(y),B=r(y,"P",{});var P=a(B);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r(P,"CODE",{});var Ue=a(Q);Ee=n(Ue,"model.fit()"),Ue.forEach(t),Te=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r(P,"CODE",{});var Qe=a(U);Be=n(Qe,"model.fit()"),Qe.forEach(t),ce=n(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r(P,"CODE",{});var re=a(X);ze=n(re,"fit()"),re.forEach(t),ve=n(P," and "),R=r(P,"CODE",{});var We=a(R);Me=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=r(P,"CODE",{});var Je=a(K);fe=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(y),j=r(y,"UL",{});var I=a(j);q=r(I,"LI",{});var Y=a(q);je=n(Y,"a single Tensor with "),G=r(Y,"CODE",{});var Xe=a(G);me=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=r(Y,"CODE",{});var Ye=a(J);de=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),ue=p(I),A=r(I,"LI",{});var H=a(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r(H,"CODE",{});var Ze=a(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=r(H,"CODE",{});var He=a(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),pe=p(I),L=r(I,"LI",{});var Le=a(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r(Le,"CODE",{});var et=a(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(y),C=r(y,"P",{});var se=a(C);ie=n(se,`Note that when creating models and layers with
`),N=r(se,"A",{href:!0,rel:!0});var Re=a(N);ge=n(Re,"subclassing"),Re.forEach(t),he=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(y,M){g(y,d,M),e(d,k),e(d,f),e(f,u),e(d,b),g(y,l,M),g(y,m,M),e(m,z),e(z,Fe),e(m,ye),e(m,S),e(S,le),g(y,Z,M),g(y,B,M),e(B,xe),e(B,Q),e(Q,Ee),e(B,Te),e(B,U),e(U,Be),e(B,ce),e(B,X),e(X,ze),e(B,ve),e(B,R),e(R,Me),e(B,we),e(B,K),e(K,fe),e(B,Pe),g(y,te,M),g(y,j,M),e(j,q),e(q,je),e(q,G),e(G,me),e(q,qe),e(q,J),e(J,de),e(j,ue),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,pe),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(y,ne,M),g(y,C,M),e(C,ie),e(C,N),e(N,ge),e(C,he)},d(y){y&&t(d),y&&t(l),y&&t(m),y&&t(Z),y&&t(B),y&&t(te),y&&t(j),y&&t(ne),y&&t(C)}}}function KU(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function QU(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, TFBertModel
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = TFBertModel.from_pretrained("bert-base-uncased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
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, TFBertModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertModel.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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;tf&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=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function VU(E){let d,k,f,u,b,l,m,z,Fe,ye,S,le,Z,B,xe,Q,Ee,Te,U,Be,ce,X,ze,ve,R,Me,we,K,fe,Pe,te,j,q,je,G,me,qe,J,de,ue,A,Ce,V,Ae,$e,D,Ne,pe,L,Oe,W,Ie,ne,C,ie,N,ge,he;return{c(){d=s("p"),k=o("TensorFlow models and layers in "),f=s("code"),u=o("transformers"),b=o(" accept two formats as input:"),l=c(),m=s("ul"),z=s("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ye=c(),S=s("li"),le=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),B=s("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=s("code"),Ee=o("model.fit()"),Te=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=s("code"),Be=o("model.fit()"),ce=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=s("code"),ze=o("fit()"),ve=o(" and "),R=s("code"),Me=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=s("code"),fe=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=s("ul"),q=s("li"),je=o("a single Tensor with "),G=s("code"),me=o("input_ids"),qe=o(" only and nothing else: "),J=s("code"),de=o("model(input_ids)"),ue=c(),A=s("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=s("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=s("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),pe=c(),L=s("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=s("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=s("p"),ie=o(`Note that when creating models and layers with
`),N=s("a"),ge=o("subclassing"),he=o(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(y){d=r(y,"P",{});var M=a(d);k=n(M,"TensorFlow models and layers in "),f=r(M,"CODE",{});var Ve=a(f);u=n(Ve,"transformers"),Ve.forEach(t),b=n(M," accept two formats as input:"),M.forEach(t),l=p(y),m=r(y,"UL",{});var oe=a(m);z=r(oe,"LI",{});var Ke=a(z);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ye=p(oe),S=r(oe,"LI",{});var Ge=a(S);le=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(y),B=r(y,"P",{});var P=a(B);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r(P,"CODE",{});var Ue=a(Q);Ee=n(Ue,"model.fit()"),Ue.forEach(t),Te=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r(P,"CODE",{});var Qe=a(U);Be=n(Qe,"model.fit()"),Qe.forEach(t),ce=n(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r(P,"CODE",{});var re=a(X);ze=n(re,"fit()"),re.forEach(t),ve=n(P," and "),R=r(P,"CODE",{});var We=a(R);Me=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=r(P,"CODE",{});var Je=a(K);fe=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(y),j=r(y,"UL",{});var I=a(j);q=r(I,"LI",{});var Y=a(q);je=n(Y,"a single Tensor with "),G=r(Y,"CODE",{});var Xe=a(G);me=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=r(Y,"CODE",{});var Ye=a(J);de=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),ue=p(I),A=r(I,"LI",{});var H=a(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r(H,"CODE",{});var Ze=a(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=r(H,"CODE",{});var He=a(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),pe=p(I),L=r(I,"LI",{});var Le=a(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r(Le,"CODE",{});var et=a(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(y),C=r(y,"P",{});var se=a(C);ie=n(se,`Note that when creating models and layers with
`),N=r(se,"A",{href:!0,rel:!0});var Re=a(N);ge=n(Re,"subclassing"),Re.forEach(t),he=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(y,M){g(y,d,M),e(d,k),e(d,f),e(f,u),e(d,b),g(y,l,M),g(y,m,M),e(m,z),e(z,Fe),e(m,ye),e(m,S),e(S,le),g(y,Z,M),g(y,B,M),e(B,xe),e(B,Q),e(Q,Ee),e(B,Te),e(B,U),e(U,Be),e(B,ce),e(B,X),e(X,ze),e(B,ve),e(B,R),e(R,Me),e(B,we),e(B,K),e(K,fe),e(B,Pe),g(y,te,M),g(y,j,M),e(j,q),e(q,je),e(q,G),e(G,me),e(q,qe),e(q,J),e(J,de),e(j,ue),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,pe),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(y,ne,M),g(y,C,M),e(C,ie),e(C,N),e(N,ge),e(C,he)},d(y){y&&t(d),y&&t(l),y&&t(m),y&&t(Z),y&&t(B),y&&t(te),y&&t(j),y&&t(ne),y&&t(C)}}}function GU(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function JU(E){let d,k,f,u,b;return u=new ke({props:{code:`import tensorflow as tf
from transformers import AutoTokenizer, TFBertForPreTraining

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = TFBertForPreTraining.from_pretrained("bert-base-uncased")
input_ids = tokenizer("Hello, my dog is cute", add_special_tokens=True, return_tensors="tf")
# Batch size 1

outputs = model(input_ids)
prediction_logits, seq_relationship_logits = outputs[:2]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFBertForPreTraining

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForPreTraining.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, add_special_tokens=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>prediction_logits, seq_relationship_logits = outputs[:<span class="hljs-number">2</span>]`}}),{c(){d=s("p"),k=o("Examples:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Examples:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function XU(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, TFBertLMHeadModel
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = TFBertLMHeadModel.from_pretrained("bert-base-uncased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
outputs = model(inputs)
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, TFBertLMHeadModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertLMHeadModel.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function YU(E){let d,k,f,u,b,l,m,z,Fe,ye,S,le,Z,B,xe,Q,Ee,Te,U,Be,ce,X,ze,ve,R,Me,we,K,fe,Pe,te,j,q,je,G,me,qe,J,de,ue,A,Ce,V,Ae,$e,D,Ne,pe,L,Oe,W,Ie,ne,C,ie,N,ge,he;return{c(){d=s("p"),k=o("TensorFlow models and layers in "),f=s("code"),u=o("transformers"),b=o(" accept two formats as input:"),l=c(),m=s("ul"),z=s("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ye=c(),S=s("li"),le=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),B=s("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=s("code"),Ee=o("model.fit()"),Te=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=s("code"),Be=o("model.fit()"),ce=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=s("code"),ze=o("fit()"),ve=o(" and "),R=s("code"),Me=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=s("code"),fe=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=s("ul"),q=s("li"),je=o("a single Tensor with "),G=s("code"),me=o("input_ids"),qe=o(" only and nothing else: "),J=s("code"),de=o("model(input_ids)"),ue=c(),A=s("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=s("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=s("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),pe=c(),L=s("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=s("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=s("p"),ie=o(`Note that when creating models and layers with
`),N=s("a"),ge=o("subclassing"),he=o(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(y){d=r(y,"P",{});var M=a(d);k=n(M,"TensorFlow models and layers in "),f=r(M,"CODE",{});var Ve=a(f);u=n(Ve,"transformers"),Ve.forEach(t),b=n(M," accept two formats as input:"),M.forEach(t),l=p(y),m=r(y,"UL",{});var oe=a(m);z=r(oe,"LI",{});var Ke=a(z);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ye=p(oe),S=r(oe,"LI",{});var Ge=a(S);le=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(y),B=r(y,"P",{});var P=a(B);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r(P,"CODE",{});var Ue=a(Q);Ee=n(Ue,"model.fit()"),Ue.forEach(t),Te=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r(P,"CODE",{});var Qe=a(U);Be=n(Qe,"model.fit()"),Qe.forEach(t),ce=n(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r(P,"CODE",{});var re=a(X);ze=n(re,"fit()"),re.forEach(t),ve=n(P," and "),R=r(P,"CODE",{});var We=a(R);Me=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=r(P,"CODE",{});var Je=a(K);fe=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(y),j=r(y,"UL",{});var I=a(j);q=r(I,"LI",{});var Y=a(q);je=n(Y,"a single Tensor with "),G=r(Y,"CODE",{});var Xe=a(G);me=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=r(Y,"CODE",{});var Ye=a(J);de=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),ue=p(I),A=r(I,"LI",{});var H=a(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r(H,"CODE",{});var Ze=a(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=r(H,"CODE",{});var He=a(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),pe=p(I),L=r(I,"LI",{});var Le=a(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r(Le,"CODE",{});var et=a(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(y),C=r(y,"P",{});var se=a(C);ie=n(se,`Note that when creating models and layers with
`),N=r(se,"A",{href:!0,rel:!0});var Re=a(N);ge=n(Re,"subclassing"),Re.forEach(t),he=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(y,M){g(y,d,M),e(d,k),e(d,f),e(f,u),e(d,b),g(y,l,M),g(y,m,M),e(m,z),e(z,Fe),e(m,ye),e(m,S),e(S,le),g(y,Z,M),g(y,B,M),e(B,xe),e(B,Q),e(Q,Ee),e(B,Te),e(B,U),e(U,Be),e(B,ce),e(B,X),e(X,ze),e(B,ve),e(B,R),e(R,Me),e(B,we),e(B,K),e(K,fe),e(B,Pe),g(y,te,M),g(y,j,M),e(j,q),e(q,je),e(q,G),e(G,me),e(q,qe),e(q,J),e(J,de),e(j,ue),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,pe),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(y,ne,M),g(y,C,M),e(C,ie),e(C,N),e(N,ge),e(C,he)},d(y){y&&t(d),y&&t(l),y&&t(m),y&&t(Z),y&&t(B),y&&t(te),y&&t(j),y&&t(ne),y&&t(C)}}}function ZU(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function eW(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, TFBertForMaskedLM
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = TFBertForMaskedLM.from_pretrained("bert-base-uncased")

inputs = tokenizer("The capital of France is [MASK].", return_tensors="tf")
logits = model(**inputs).logits

# retrieve index of [MASK]
mask_token_index = tf.where((inputs.input_ids == tokenizer.mask_token_id)[0])
selected_logits = tf.gather_nd(logits[0], indices=mask_token_index)

predicted_token_id = tf.math.argmax(selected_logits, axis=-1)
tokenizer.decode(predicted_token_id)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFBertForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is [MASK].&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve index of [MASK]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = tf.where((inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>selected_logits = tf.gather_nd(logits[<span class="hljs-number">0</span>], indices=mask_token_index)

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_id = tf.math.argmax(selected_logits, axis=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predicted_token_id)
<span class="hljs-string">&#x27;paris&#x27;</span>`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function tW(E){let d,k;return d=new ke({props:{code:`labels = tokenizer("The capital of France is Paris.", return_tensors="tf")["input_ids"]
# mask labels of non-[MASK] tokens
labels = tf.where(inputs.input_ids == tokenizer.mask_token_id, labels, -100)

outputs = model(**inputs, labels=labels)
round(float(outputs.loss), 2)`,highlighted:`<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;tf&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask labels of non-[MASK] tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tf.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)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(<span class="hljs-built_in">float</span>(outputs.loss), <span class="hljs-number">2</span>)
<span class="hljs-number">0.88</span>`}}),{c(){T(d.$$.fragment)},l(f){v(d.$$.fragment,f)},m(f,u){w(d,f,u),k=!0},p:be,i(f){k||($(d.$$.fragment,f),k=!0)},o(f){F(d.$$.fragment,f),k=!1},d(f){x(d,f)}}}function oW(E){let d,k,f,u,b,l,m,z,Fe,ye,S,le,Z,B,xe,Q,Ee,Te,U,Be,ce,X,ze,ve,R,Me,we,K,fe,Pe,te,j,q,je,G,me,qe,J,de,ue,A,Ce,V,Ae,$e,D,Ne,pe,L,Oe,W,Ie,ne,C,ie,N,ge,he;return{c(){d=s("p"),k=o("TensorFlow models and layers in "),f=s("code"),u=o("transformers"),b=o(" accept two formats as input:"),l=c(),m=s("ul"),z=s("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ye=c(),S=s("li"),le=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),B=s("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=s("code"),Ee=o("model.fit()"),Te=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=s("code"),Be=o("model.fit()"),ce=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=s("code"),ze=o("fit()"),ve=o(" and "),R=s("code"),Me=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=s("code"),fe=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=s("ul"),q=s("li"),je=o("a single Tensor with "),G=s("code"),me=o("input_ids"),qe=o(" only and nothing else: "),J=s("code"),de=o("model(input_ids)"),ue=c(),A=s("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=s("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=s("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),pe=c(),L=s("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=s("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=s("p"),ie=o(`Note that when creating models and layers with
`),N=s("a"),ge=o("subclassing"),he=o(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(y){d=r(y,"P",{});var M=a(d);k=n(M,"TensorFlow models and layers in "),f=r(M,"CODE",{});var Ve=a(f);u=n(Ve,"transformers"),Ve.forEach(t),b=n(M," accept two formats as input:"),M.forEach(t),l=p(y),m=r(y,"UL",{});var oe=a(m);z=r(oe,"LI",{});var Ke=a(z);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ye=p(oe),S=r(oe,"LI",{});var Ge=a(S);le=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(y),B=r(y,"P",{});var P=a(B);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r(P,"CODE",{});var Ue=a(Q);Ee=n(Ue,"model.fit()"),Ue.forEach(t),Te=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r(P,"CODE",{});var Qe=a(U);Be=n(Qe,"model.fit()"),Qe.forEach(t),ce=n(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r(P,"CODE",{});var re=a(X);ze=n(re,"fit()"),re.forEach(t),ve=n(P," and "),R=r(P,"CODE",{});var We=a(R);Me=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=r(P,"CODE",{});var Je=a(K);fe=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(y),j=r(y,"UL",{});var I=a(j);q=r(I,"LI",{});var Y=a(q);je=n(Y,"a single Tensor with "),G=r(Y,"CODE",{});var Xe=a(G);me=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=r(Y,"CODE",{});var Ye=a(J);de=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),ue=p(I),A=r(I,"LI",{});var H=a(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r(H,"CODE",{});var Ze=a(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=r(H,"CODE",{});var He=a(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),pe=p(I),L=r(I,"LI",{});var Le=a(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r(Le,"CODE",{});var et=a(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(y),C=r(y,"P",{});var se=a(C);ie=n(se,`Note that when creating models and layers with
`),N=r(se,"A",{href:!0,rel:!0});var Re=a(N);ge=n(Re,"subclassing"),Re.forEach(t),he=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(y,M){g(y,d,M),e(d,k),e(d,f),e(f,u),e(d,b),g(y,l,M),g(y,m,M),e(m,z),e(z,Fe),e(m,ye),e(m,S),e(S,le),g(y,Z,M),g(y,B,M),e(B,xe),e(B,Q),e(Q,Ee),e(B,Te),e(B,U),e(U,Be),e(B,ce),e(B,X),e(X,ze),e(B,ve),e(B,R),e(R,Me),e(B,we),e(B,K),e(K,fe),e(B,Pe),g(y,te,M),g(y,j,M),e(j,q),e(q,je),e(q,G),e(G,me),e(q,qe),e(q,J),e(J,de),e(j,ue),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,pe),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(y,ne,M),g(y,C,M),e(C,ie),e(C,N),e(N,ge),e(C,he)},d(y){y&&t(d),y&&t(l),y&&t(m),y&&t(Z),y&&t(B),y&&t(te),y&&t(j),y&&t(ne),y&&t(C)}}}function nW(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function sW(E){let d,k,f,u,b;return u=new ke({props:{code:`import tensorflow as tf
from transformers import AutoTokenizer, TFBertForNextSentencePrediction

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = TFBertForNextSentencePrediction.from_pretrained("bert-base-uncased")

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
next_sentence = "The sky is blue due to the shorter wavelength of blue light."
encoding = tokenizer(prompt, next_sentence, return_tensors="tf")

logits = model(encoding["input_ids"], token_type_ids=encoding["token_type_ids"])[0]
assert logits[0][0] < logits[0][1]  # the next sentence was random`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFBertForNextSentencePrediction

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForNextSentencePrediction.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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>next_sentence = <span class="hljs-string">&quot;The sky is blue due to the shorter wavelength of blue light.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(prompt, next_sentence, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(encoding[<span class="hljs-string">&quot;input_ids&quot;</span>], token_type_ids=encoding[<span class="hljs-string">&quot;token_type_ids&quot;</span>])[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> logits[<span class="hljs-number">0</span>][<span class="hljs-number">0</span>] &lt; logits[<span class="hljs-number">0</span>][<span class="hljs-number">1</span>]  <span class="hljs-comment"># the next sentence was random</span>`}}),{c(){d=s("p"),k=o("Examples:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Examples:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function rW(E){let d,k,f,u,b,l,m,z,Fe,ye,S,le,Z,B,xe,Q,Ee,Te,U,Be,ce,X,ze,ve,R,Me,we,K,fe,Pe,te,j,q,je,G,me,qe,J,de,ue,A,Ce,V,Ae,$e,D,Ne,pe,L,Oe,W,Ie,ne,C,ie,N,ge,he;return{c(){d=s("p"),k=o("TensorFlow models and layers in "),f=s("code"),u=o("transformers"),b=o(" accept two formats as input:"),l=c(),m=s("ul"),z=s("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ye=c(),S=s("li"),le=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),B=s("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=s("code"),Ee=o("model.fit()"),Te=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=s("code"),Be=o("model.fit()"),ce=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=s("code"),ze=o("fit()"),ve=o(" and "),R=s("code"),Me=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=s("code"),fe=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=s("ul"),q=s("li"),je=o("a single Tensor with "),G=s("code"),me=o("input_ids"),qe=o(" only and nothing else: "),J=s("code"),de=o("model(input_ids)"),ue=c(),A=s("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=s("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=s("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),pe=c(),L=s("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=s("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=s("p"),ie=o(`Note that when creating models and layers with
`),N=s("a"),ge=o("subclassing"),he=o(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(y){d=r(y,"P",{});var M=a(d);k=n(M,"TensorFlow models and layers in "),f=r(M,"CODE",{});var Ve=a(f);u=n(Ve,"transformers"),Ve.forEach(t),b=n(M," accept two formats as input:"),M.forEach(t),l=p(y),m=r(y,"UL",{});var oe=a(m);z=r(oe,"LI",{});var Ke=a(z);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ye=p(oe),S=r(oe,"LI",{});var Ge=a(S);le=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(y),B=r(y,"P",{});var P=a(B);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r(P,"CODE",{});var Ue=a(Q);Ee=n(Ue,"model.fit()"),Ue.forEach(t),Te=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r(P,"CODE",{});var Qe=a(U);Be=n(Qe,"model.fit()"),Qe.forEach(t),ce=n(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r(P,"CODE",{});var re=a(X);ze=n(re,"fit()"),re.forEach(t),ve=n(P," and "),R=r(P,"CODE",{});var We=a(R);Me=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=r(P,"CODE",{});var Je=a(K);fe=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(y),j=r(y,"UL",{});var I=a(j);q=r(I,"LI",{});var Y=a(q);je=n(Y,"a single Tensor with "),G=r(Y,"CODE",{});var Xe=a(G);me=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=r(Y,"CODE",{});var Ye=a(J);de=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),ue=p(I),A=r(I,"LI",{});var H=a(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r(H,"CODE",{});var Ze=a(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=r(H,"CODE",{});var He=a(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),pe=p(I),L=r(I,"LI",{});var Le=a(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r(Le,"CODE",{});var et=a(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(y),C=r(y,"P",{});var se=a(C);ie=n(se,`Note that when creating models and layers with
`),N=r(se,"A",{href:!0,rel:!0});var Re=a(N);ge=n(Re,"subclassing"),Re.forEach(t),he=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(y,M){g(y,d,M),e(d,k),e(d,f),e(f,u),e(d,b),g(y,l,M),g(y,m,M),e(m,z),e(z,Fe),e(m,ye),e(m,S),e(S,le),g(y,Z,M),g(y,B,M),e(B,xe),e(B,Q),e(Q,Ee),e(B,Te),e(B,U),e(U,Be),e(B,ce),e(B,X),e(X,ze),e(B,ve),e(B,R),e(R,Me),e(B,we),e(B,K),e(K,fe),e(B,Pe),g(y,te,M),g(y,j,M),e(j,q),e(q,je),e(q,G),e(G,me),e(q,qe),e(q,J),e(J,de),e(j,ue),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,pe),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(y,ne,M),g(y,C,M),e(C,ie),e(C,N),e(N,ge),e(C,he)},d(y){y&&t(d),y&&t(l),y&&t(m),y&&t(Z),y&&t(B),y&&t(te),y&&t(j),y&&t(ne),y&&t(C)}}}function aW(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function iW(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, TFBertForSequenceClassification
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("ydshieh/bert-base-uncased-yelp-polarity")
model = TFBertForSequenceClassification.from_pretrained("ydshieh/bert-base-uncased-yelp-polarity")

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

logits = model(**inputs).logits

predicted_class_id = int(tf.math.argmax(logits, axis=-1)[0])
model.config.id2label[predicted_class_id]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFBertForSequenceClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;ydshieh/bert-base-uncased-yelp-polarity&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;ydshieh/bert-base-uncased-yelp-polarity&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;tf&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
<span class="hljs-string">&#x27;LABEL_1&#x27;</span>`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function lW(E){let d,k;return d=new ke({props:{code:'# To train a model on `num_labels` classes, you can pass `num_labels=num_labels` to `.from_pretrained(...)`\nnum_labels = len(model.config.id2label)\nmodel = TFBertForSequenceClassification.from_pretrained("ydshieh/bert-base-uncased-yelp-polarity", num_labels=num_labels)\n\nlabels = tf.constant(1)\nloss = model(**inputs, labels=labels).loss\nround(float(loss), 2)',highlighted:`<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 = TFBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;ydshieh/bert-base-uncased-yelp-polarity&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tf.constant(<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(<span class="hljs-built_in">float</span>(loss), <span class="hljs-number">2</span>)
<span class="hljs-number">0.01</span>`}}),{c(){T(d.$$.fragment)},l(f){v(d.$$.fragment,f)},m(f,u){w(d,f,u),k=!0},p:be,i(f){k||($(d.$$.fragment,f),k=!0)},o(f){F(d.$$.fragment,f),k=!1},d(f){x(d,f)}}}function dW(E){let d,k,f,u,b,l,m,z,Fe,ye,S,le,Z,B,xe,Q,Ee,Te,U,Be,ce,X,ze,ve,R,Me,we,K,fe,Pe,te,j,q,je,G,me,qe,J,de,ue,A,Ce,V,Ae,$e,D,Ne,pe,L,Oe,W,Ie,ne,C,ie,N,ge,he;return{c(){d=s("p"),k=o("TensorFlow models and layers in "),f=s("code"),u=o("transformers"),b=o(" accept two formats as input:"),l=c(),m=s("ul"),z=s("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ye=c(),S=s("li"),le=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),B=s("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=s("code"),Ee=o("model.fit()"),Te=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=s("code"),Be=o("model.fit()"),ce=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=s("code"),ze=o("fit()"),ve=o(" and "),R=s("code"),Me=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=s("code"),fe=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=s("ul"),q=s("li"),je=o("a single Tensor with "),G=s("code"),me=o("input_ids"),qe=o(" only and nothing else: "),J=s("code"),de=o("model(input_ids)"),ue=c(),A=s("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=s("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=s("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),pe=c(),L=s("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=s("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=s("p"),ie=o(`Note that when creating models and layers with
`),N=s("a"),ge=o("subclassing"),he=o(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(y){d=r(y,"P",{});var M=a(d);k=n(M,"TensorFlow models and layers in "),f=r(M,"CODE",{});var Ve=a(f);u=n(Ve,"transformers"),Ve.forEach(t),b=n(M," accept two formats as input:"),M.forEach(t),l=p(y),m=r(y,"UL",{});var oe=a(m);z=r(oe,"LI",{});var Ke=a(z);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ye=p(oe),S=r(oe,"LI",{});var Ge=a(S);le=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(y),B=r(y,"P",{});var P=a(B);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r(P,"CODE",{});var Ue=a(Q);Ee=n(Ue,"model.fit()"),Ue.forEach(t),Te=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r(P,"CODE",{});var Qe=a(U);Be=n(Qe,"model.fit()"),Qe.forEach(t),ce=n(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r(P,"CODE",{});var re=a(X);ze=n(re,"fit()"),re.forEach(t),ve=n(P," and "),R=r(P,"CODE",{});var We=a(R);Me=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=r(P,"CODE",{});var Je=a(K);fe=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(y),j=r(y,"UL",{});var I=a(j);q=r(I,"LI",{});var Y=a(q);je=n(Y,"a single Tensor with "),G=r(Y,"CODE",{});var Xe=a(G);me=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=r(Y,"CODE",{});var Ye=a(J);de=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),ue=p(I),A=r(I,"LI",{});var H=a(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r(H,"CODE",{});var Ze=a(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=r(H,"CODE",{});var He=a(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),pe=p(I),L=r(I,"LI",{});var Le=a(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r(Le,"CODE",{});var et=a(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(y),C=r(y,"P",{});var se=a(C);ie=n(se,`Note that when creating models and layers with
`),N=r(se,"A",{href:!0,rel:!0});var Re=a(N);ge=n(Re,"subclassing"),Re.forEach(t),he=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(y,M){g(y,d,M),e(d,k),e(d,f),e(f,u),e(d,b),g(y,l,M),g(y,m,M),e(m,z),e(z,Fe),e(m,ye),e(m,S),e(S,le),g(y,Z,M),g(y,B,M),e(B,xe),e(B,Q),e(Q,Ee),e(B,Te),e(B,U),e(U,Be),e(B,ce),e(B,X),e(X,ze),e(B,ve),e(B,R),e(R,Me),e(B,we),e(B,K),e(K,fe),e(B,Pe),g(y,te,M),g(y,j,M),e(j,q),e(q,je),e(q,G),e(G,me),e(q,qe),e(q,J),e(J,de),e(j,ue),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,pe),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(y,ne,M),g(y,C,M),e(C,ie),e(C,N),e(N,ge),e(C,he)},d(y){y&&t(d),y&&t(l),y&&t(m),y&&t(Z),y&&t(B),y&&t(te),y&&t(j),y&&t(ne),y&&t(C)}}}function cW(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function pW(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, TFBertForMultipleChoice
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = TFBertForMultipleChoice.from_pretrained("bert-base-uncased")

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."

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

# the linear classifier still needs to be trained
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, TFBertForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;tf&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = {k: tf.expand_dims(v, <span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)  <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>logits = outputs.logits`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function hW(E){let d,k,f,u,b,l,m,z,Fe,ye,S,le,Z,B,xe,Q,Ee,Te,U,Be,ce,X,ze,ve,R,Me,we,K,fe,Pe,te,j,q,je,G,me,qe,J,de,ue,A,Ce,V,Ae,$e,D,Ne,pe,L,Oe,W,Ie,ne,C,ie,N,ge,he;return{c(){d=s("p"),k=o("TensorFlow models and layers in "),f=s("code"),u=o("transformers"),b=o(" accept two formats as input:"),l=c(),m=s("ul"),z=s("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ye=c(),S=s("li"),le=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),B=s("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=s("code"),Ee=o("model.fit()"),Te=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=s("code"),Be=o("model.fit()"),ce=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=s("code"),ze=o("fit()"),ve=o(" and "),R=s("code"),Me=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=s("code"),fe=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=s("ul"),q=s("li"),je=o("a single Tensor with "),G=s("code"),me=o("input_ids"),qe=o(" only and nothing else: "),J=s("code"),de=o("model(input_ids)"),ue=c(),A=s("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=s("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=s("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),pe=c(),L=s("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=s("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=s("p"),ie=o(`Note that when creating models and layers with
`),N=s("a"),ge=o("subclassing"),he=o(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(y){d=r(y,"P",{});var M=a(d);k=n(M,"TensorFlow models and layers in "),f=r(M,"CODE",{});var Ve=a(f);u=n(Ve,"transformers"),Ve.forEach(t),b=n(M," accept two formats as input:"),M.forEach(t),l=p(y),m=r(y,"UL",{});var oe=a(m);z=r(oe,"LI",{});var Ke=a(z);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ye=p(oe),S=r(oe,"LI",{});var Ge=a(S);le=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(y),B=r(y,"P",{});var P=a(B);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r(P,"CODE",{});var Ue=a(Q);Ee=n(Ue,"model.fit()"),Ue.forEach(t),Te=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r(P,"CODE",{});var Qe=a(U);Be=n(Qe,"model.fit()"),Qe.forEach(t),ce=n(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r(P,"CODE",{});var re=a(X);ze=n(re,"fit()"),re.forEach(t),ve=n(P," and "),R=r(P,"CODE",{});var We=a(R);Me=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=r(P,"CODE",{});var Je=a(K);fe=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(y),j=r(y,"UL",{});var I=a(j);q=r(I,"LI",{});var Y=a(q);je=n(Y,"a single Tensor with "),G=r(Y,"CODE",{});var Xe=a(G);me=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=r(Y,"CODE",{});var Ye=a(J);de=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),ue=p(I),A=r(I,"LI",{});var H=a(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r(H,"CODE",{});var Ze=a(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=r(H,"CODE",{});var He=a(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),pe=p(I),L=r(I,"LI",{});var Le=a(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r(Le,"CODE",{});var et=a(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(y),C=r(y,"P",{});var se=a(C);ie=n(se,`Note that when creating models and layers with
`),N=r(se,"A",{href:!0,rel:!0});var Re=a(N);ge=n(Re,"subclassing"),Re.forEach(t),he=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(y,M){g(y,d,M),e(d,k),e(d,f),e(f,u),e(d,b),g(y,l,M),g(y,m,M),e(m,z),e(z,Fe),e(m,ye),e(m,S),e(S,le),g(y,Z,M),g(y,B,M),e(B,xe),e(B,Q),e(Q,Ee),e(B,Te),e(B,U),e(U,Be),e(B,ce),e(B,X),e(X,ze),e(B,ve),e(B,R),e(R,Me),e(B,we),e(B,K),e(K,fe),e(B,Pe),g(y,te,M),g(y,j,M),e(j,q),e(q,je),e(q,G),e(G,me),e(q,qe),e(q,J),e(J,de),e(j,ue),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,pe),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(y,ne,M),g(y,C,M),e(C,ie),e(C,N),e(N,ge),e(C,he)},d(y){y&&t(d),y&&t(l),y&&t(m),y&&t(Z),y&&t(B),y&&t(te),y&&t(j),y&&t(ne),y&&t(C)}}}function mW(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function fW(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, TFBertForTokenClassification
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("dbmdz/bert-large-cased-finetuned-conll03-english")
model = TFBertForTokenClassification.from_pretrained("dbmdz/bert-large-cased-finetuned-conll03-english")

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

logits = model(**inputs).logits
predicted_token_class_ids = tf.math.argmax(logits, axis=-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] for t in predicted_token_class_ids[0].numpy().tolist()]
predicted_tokens_classes`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFBertForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;dbmdz/bert-large-cased-finetuned-conll03-english&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;dbmdz/bert-large-cased-finetuned-conll03-english&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;tf&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = tf.math.argmax(logits, axis=-<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] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>].numpy().tolist()]
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes
[<span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;I-LOC&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;I-LOC&#x27;</span>, <span class="hljs-string">&#x27;I-LOC&#x27;</span>] `}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function uW(E){let d,k;return d=new ke({props:{code:`labels = predicted_token_class_ids
loss = tf.math.reduce_mean(model(**inputs, labels=labels).loss)
round(float(loss), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = tf.math.reduce_mean(model(**inputs, labels=labels).loss)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(<span class="hljs-built_in">float</span>(loss), <span class="hljs-number">2</span>)
<span class="hljs-number">0.01</span>`}}),{c(){T(d.$$.fragment)},l(f){v(d.$$.fragment,f)},m(f,u){w(d,f,u),k=!0},p:be,i(f){k||($(d.$$.fragment,f),k=!0)},o(f){F(d.$$.fragment,f),k=!1},d(f){x(d,f)}}}function gW(E){let d,k,f,u,b,l,m,z,Fe,ye,S,le,Z,B,xe,Q,Ee,Te,U,Be,ce,X,ze,ve,R,Me,we,K,fe,Pe,te,j,q,je,G,me,qe,J,de,ue,A,Ce,V,Ae,$e,D,Ne,pe,L,Oe,W,Ie,ne,C,ie,N,ge,he;return{c(){d=s("p"),k=o("TensorFlow models and layers in "),f=s("code"),u=o("transformers"),b=o(" accept two formats as input:"),l=c(),m=s("ul"),z=s("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ye=c(),S=s("li"),le=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),B=s("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=s("code"),Ee=o("model.fit()"),Te=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=s("code"),Be=o("model.fit()"),ce=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=s("code"),ze=o("fit()"),ve=o(" and "),R=s("code"),Me=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=s("code"),fe=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=s("ul"),q=s("li"),je=o("a single Tensor with "),G=s("code"),me=o("input_ids"),qe=o(" only and nothing else: "),J=s("code"),de=o("model(input_ids)"),ue=c(),A=s("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=s("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=s("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),pe=c(),L=s("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=s("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=s("p"),ie=o(`Note that when creating models and layers with
`),N=s("a"),ge=o("subclassing"),he=o(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(y){d=r(y,"P",{});var M=a(d);k=n(M,"TensorFlow models and layers in "),f=r(M,"CODE",{});var Ve=a(f);u=n(Ve,"transformers"),Ve.forEach(t),b=n(M," accept two formats as input:"),M.forEach(t),l=p(y),m=r(y,"UL",{});var oe=a(m);z=r(oe,"LI",{});var Ke=a(z);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ye=p(oe),S=r(oe,"LI",{});var Ge=a(S);le=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(y),B=r(y,"P",{});var P=a(B);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r(P,"CODE",{});var Ue=a(Q);Ee=n(Ue,"model.fit()"),Ue.forEach(t),Te=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r(P,"CODE",{});var Qe=a(U);Be=n(Qe,"model.fit()"),Qe.forEach(t),ce=n(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r(P,"CODE",{});var re=a(X);ze=n(re,"fit()"),re.forEach(t),ve=n(P," and "),R=r(P,"CODE",{});var We=a(R);Me=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=r(P,"CODE",{});var Je=a(K);fe=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(y),j=r(y,"UL",{});var I=a(j);q=r(I,"LI",{});var Y=a(q);je=n(Y,"a single Tensor with "),G=r(Y,"CODE",{});var Xe=a(G);me=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=r(Y,"CODE",{});var Ye=a(J);de=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),ue=p(I),A=r(I,"LI",{});var H=a(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r(H,"CODE",{});var Ze=a(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=r(H,"CODE",{});var He=a(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),pe=p(I),L=r(I,"LI",{});var Le=a(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r(Le,"CODE",{});var et=a(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(y),C=r(y,"P",{});var se=a(C);ie=n(se,`Note that when creating models and layers with
`),N=r(se,"A",{href:!0,rel:!0});var Re=a(N);ge=n(Re,"subclassing"),Re.forEach(t),he=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(y,M){g(y,d,M),e(d,k),e(d,f),e(f,u),e(d,b),g(y,l,M),g(y,m,M),e(m,z),e(z,Fe),e(m,ye),e(m,S),e(S,le),g(y,Z,M),g(y,B,M),e(B,xe),e(B,Q),e(Q,Ee),e(B,Te),e(B,U),e(U,Be),e(B,ce),e(B,X),e(X,ze),e(B,ve),e(B,R),e(R,Me),e(B,we),e(B,K),e(K,fe),e(B,Pe),g(y,te,M),g(y,j,M),e(j,q),e(q,je),e(q,G),e(G,me),e(q,qe),e(q,J),e(J,de),e(j,ue),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,pe),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(y,ne,M),g(y,C,M),e(C,ie),e(C,N),e(N,ge),e(C,he)},d(y){y&&t(d),y&&t(l),y&&t(m),y&&t(Z),y&&t(B),y&&t(te),y&&t(j),y&&t(ne),y&&t(C)}}}function _W(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function bW(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, TFBertForQuestionAnswering
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("ydshieh/bert-base-cased-squad2")
model = TFBertForQuestionAnswering.from_pretrained("ydshieh/bert-base-cased-squad2")

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

inputs = tokenizer(question, text, return_tensors="tf")
outputs = model(**inputs)

answer_start_index = int(tf.math.argmax(outputs.start_logits, axis=-1)[0])
answer_end_index = int(tf.math.argmax(outputs.end_logits, axis=-1)[0])

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
tokenizer.decode(predict_answer_tokens)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFBertForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;ydshieh/bert-base-cased-squad2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;ydshieh/bert-base-cased-squad2&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;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = <span class="hljs-built_in">int</span>(tf.math.argmax(outputs.start_logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = <span class="hljs-built_in">int</span>(tf.math.argmax(outputs.end_logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])

<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>tokenizer.decode(predict_answer_tokens)
<span class="hljs-string">&#x27;a nice puppet&#x27;</span>`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function kW(E){let d,k;return d=new ke({props:{code:`# target is "nice puppet"
target_start_index = tf.constant([14])
target_end_index = tf.constant([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = tf.math.reduce_mean(outputs.loss)
round(float(loss), 2)`,highlighted:`<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 = tf.constant([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = tf.constant([<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 = tf.math.reduce_mean(outputs.loss)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(<span class="hljs-built_in">float</span>(loss), <span class="hljs-number">2</span>)
<span class="hljs-number">7.41</span>`}}),{c(){T(d.$$.fragment)},l(f){v(d.$$.fragment,f)},m(f,u){w(d,f,u),k=!0},p:be,i(f){k||($(d.$$.fragment,f),k=!0)},o(f){F(d.$$.fragment,f),k=!1},d(f){x(d,f)}}}function yW(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function TW(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, FlaxBertModel

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = FlaxBertModel.from_pretrained("bert-base-uncased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="jax")
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, FlaxBertModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertModel.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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;jax&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=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function vW(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function wW(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, FlaxBertForPreTraining

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = FlaxBertForPreTraining.from_pretrained("bert-base-uncased")

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

prediction_logits = outputs.prediction_logits
seq_relationship_logits = outputs.seq_relationship_logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBertForPreTraining

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForPreTraining.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>prediction_logits = outputs.prediction_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>seq_relationship_logits = outputs.seq_relationship_logits`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function $W(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function FW(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, FlaxBertForCausalLM

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = FlaxBertForCausalLM.from_pretrained("bert-base-uncased")

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

# retrieve logts for next token
next_token_logits = outputs.logits[:, -1]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBertForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForCausalLM.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve logts for next token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_token_logits = outputs.logits[:, -<span class="hljs-number">1</span>]`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function xW(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function EW(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, FlaxBertForMaskedLM

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = FlaxBertForMaskedLM.from_pretrained("bert-base-uncased")

inputs = tokenizer("The capital of France is [MASK].", return_tensors="jax")

outputs = model(**inputs)
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, FlaxBertForMaskedLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is [MASK].&quot;</span>, return_tensors=<span class="hljs-string">&quot;jax&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function BW(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function zW(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, FlaxBertForNextSentencePrediction

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = FlaxBertForNextSentencePrediction.from_pretrained("bert-base-uncased")

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
next_sentence = "The sky is blue due to the shorter wavelength of blue light."
encoding = tokenizer(prompt, next_sentence, return_tensors="jax")

outputs = model(**encoding)
logits = outputs.logits
assert logits[0, 0] < logits[0, 1]  # next sentence was random`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBertForNextSentencePrediction

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForNextSentencePrediction.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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>next_sentence = <span class="hljs-string">&quot;The sky is blue due to the shorter wavelength of blue light.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(prompt, next_sentence, return_tensors=<span class="hljs-string">&quot;jax&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> logits[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>] &lt; logits[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>]  <span class="hljs-comment"># next sentence was random</span>`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function MW(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function PW(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, FlaxBertForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = FlaxBertForSequenceClassification.from_pretrained("bert-base-uncased")

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

outputs = model(**inputs)
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, FlaxBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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;jax&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function jW(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function qW(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, FlaxBertForMultipleChoice

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = FlaxBertForMultipleChoice.from_pretrained("bert-base-uncased")

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."

encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors="jax", padding=True)
outputs = model(**{k: v[None, :] for k, v in encoding.items()})

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, FlaxBertForMultipleChoice

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;jax&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**{k: v[<span class="hljs-literal">None</span>, :] <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()})

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function CW(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function AW(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, FlaxBertForTokenClassification

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = FlaxBertForTokenClassification.from_pretrained("bert-base-uncased")

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

outputs = model(**inputs)
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, FlaxBertForTokenClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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;jax&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function NW(E){let d,k,f,u,b;return{c(){d=s("p"),k=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),u=o("Module"),b=o(`
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(l){d=r(l,"P",{});var m=a(d);k=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(m,"CODE",{});var z=a(f);u=n(z,"Module"),z.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,k),e(d,f),e(f,u),e(d,b)},d(l){l&&t(d)}}}function OW(E){let d,k,f,u,b;return u=new ke({props:{code:`from transformers import AutoTokenizer, FlaxBertForQuestionAnswering

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = FlaxBertForQuestionAnswering.from_pretrained("bert-base-uncased")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
inputs = tokenizer(question, text, return_tensors="jax")

outputs = model(**inputs)
start_scores = outputs.start_logits
end_scores = outputs.end_logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBertForQuestionAnswering

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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;jax&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>start_scores = outputs.start_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>end_scores = outputs.end_logits`}}),{c(){d=s("p"),k=o("Example:"),f=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=a(d);k=n(m,"Example:"),m.forEach(t),f=p(l),v(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,k),g(l,f,m),w(u,l,m),b=!0},p:be,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){F(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),x(u,l)}}}function IW(E){let d,k,f,u,b,l,m,z,Fe,ye,S,le,Z,B,xe,Q,Ee,Te,U,Be,ce,X,ze,ve,R,Me,we,K,fe,Pe,te,j,q,je,G,me,qe,J,de,ue,A,Ce,V,Ae,$e,D,Ne,pe,L,Oe,W,Ie,ne,C,ie,N,ge,he,y,M,Ve,oe,Ke,Ge,P,Ue,Qe,re,We,Je,I,Y,Xe,Ye,H,Ze,He,Le,et,se,Re,Kw,Ii,Qw,Vw,Gw,Li,Jw,Di,Xw,Yw,Zw,Go,Mm,e$,t$,Si,o$,n$,Ui,s$,r$,a$,Jo,Pm,i$,l$,Wi,d$,c$,Hi,p$,h$,m$,Xo,jm,f$,u$,Ri,g$,_$,Ki,b$,k$,sT,Qi,rT,wt,Vi,y$,Gi,T$,v$,w$,Cn,$$,Ji,F$,x$,Xi,E$,B$,z$,Yo,qm,M$,P$,Yi,j$,q$,Zi,C$,A$,N$,Zo,Cm,O$,I$,el,L$,D$,tl,S$,U$,W$,tr,Am,H$,R$,ol,K$,Q$,V$,Nm,nl,G$,J$,aT,sl,iT,oo,en,Om,X$,Y$,rl,Z$,e2,al,t2,o2,n2,tn,Im,s2,r2,il,a2,i2,ll,l2,d2,c2,on,Lm,p2,h2,dl,m2,f2,cl,u2,g2,_2,Dm,pl,b2,k2,lT,hl,dT,no,nn,Sm,y2,T2,ml,v2,w2,fl,$2,F2,x2,sn,Um,E2,B2,ul,z2,M2,gl,P2,j2,q2,or,Wm,C2,A2,_l,N2,O2,I2,Hm,bl,L2,D2,cT,Rm,Uu,S2,pT,nr,rn,Km,U2,W2,kl,H2,R2,yl,K2,Q2,V2,an,Qm,G2,J2,Tl,X2,Y2,vl,Z2,eF,hT,wl,tF,Wu,oF,mT,sr,$l,nF,Fl,sF,rF,aF,xl,iF,El,lF,dF,fT,Bl,cF,Hu,pF,uT,Vm,zl,hF,Ml,mF,fF,gT,Pl,uF,Ru,gF,_T,$t,jl,_F,ql,bF,kF,yF,Cl,TF,Al,vF,wF,$F,Nl,FF,Ol,xF,EF,BF,Il,zF,Ll,MF,PF,jF,Dl,qF,Sl,CF,AF,NF,Ul,OF,Wl,IF,LF,bT,An,rr,Ku,Hl,DF,Qu,SF,kT,to,Rl,UF,Oo,WF,Gm,HF,RF,Jm,KF,QF,Kl,VF,GF,JF,Nn,XF,Xm,YF,ZF,Ym,ex,tx,ox,ar,yT,On,ir,Vu,Ql,nx,Gu,sx,TT,tt,Vl,rx,Ju,ax,ix,Gl,lx,Zm,dx,cx,px,ln,Jl,hx,Xu,mx,fx,Xl,ef,ux,Yu,gx,_x,tf,bx,Zu,kx,yx,lr,Yl,Tx,Zl,vx,eg,wx,$x,Fx,so,ed,xx,tg,Ex,Bx,dr,zx,In,Mx,og,Px,jx,ng,qx,Cx,Ax,of,td,vT,Ln,cr,sg,od,Nx,rg,Ox,wT,xt,nd,Ix,sd,Lx,ag,Dx,Sx,Ux,rd,Wx,nf,Hx,Rx,Kx,dn,ad,Qx,ig,Vx,Gx,id,sf,Jx,lg,Xx,Yx,rf,Zx,dg,e0,t0,ro,ld,o0,cg,n0,s0,pr,r0,Dn,a0,pg,i0,l0,hg,d0,c0,$T,Sn,hr,mg,dd,p0,fg,h0,FT,Et,cd,m0,Un,f0,ug,u0,g0,gg,_0,b0,k0,pd,y0,_g,T0,v0,w0,cn,hd,$0,md,F0,bg,x0,E0,B0,mr,z0,pn,fd,M0,Wn,P0,kg,j0,q0,yg,C0,A0,N0,fr,xT,Hn,ur,Tg,ud,O0,vg,I0,ET,Rn,gd,L0,_d,D0,af,S0,U0,BT,Kn,bd,W0,kd,H0,lf,R0,K0,zT,Io,yd,Q0,Td,V0,df,G0,J0,X0,gr,vd,Y0,wg,Z0,MT,Qn,_r,$g,wd,eE,Fg,tE,PT,ot,$d,oE,xg,nE,sE,Fd,rE,cf,aE,iE,lE,xd,dE,Ed,cE,pE,hE,Bd,mE,zd,fE,uE,gE,mt,_E,Eg,bE,kE,Bg,yE,TE,zg,vE,wE,Mg,$E,FE,Pg,xE,EE,jg,BE,zE,ME,ao,Md,PE,Vn,jE,pf,qE,CE,qg,AE,NE,OE,br,IE,kr,jT,Gn,yr,Cg,Pd,LE,Ag,DE,qT,Bt,jd,SE,Jn,UE,Ng,WE,HE,Og,RE,KE,QE,qd,VE,hf,GE,JE,XE,Cd,YE,Ad,ZE,eB,tB,io,Nd,oB,Xn,nB,mf,sB,rB,Ig,aB,iB,lB,Tr,dB,vr,CT,Yn,wr,Lg,Od,cB,Dg,pB,AT,zt,Id,hB,Ld,mB,Sg,fB,uB,gB,Dd,_B,ff,bB,kB,yB,Sd,TB,Ud,vB,wB,$B,lo,Wd,FB,Zn,xB,uf,EB,BB,Ug,zB,MB,PB,$r,jB,Fr,NT,es,xr,Wg,Hd,qB,Hg,CB,OT,Mt,Rd,AB,Kd,NB,Rg,OB,IB,LB,Qd,DB,gf,SB,UB,WB,Vd,HB,Gd,RB,KB,QB,co,Jd,VB,ts,GB,_f,JB,XB,Kg,YB,ZB,ez,Er,tz,Br,IT,os,zr,Qg,Xd,oz,Vg,nz,LT,Pt,Yd,sz,Zd,rz,Gg,az,iz,lz,ec,dz,bf,cz,pz,hz,tc,mz,oc,fz,uz,gz,po,nc,_z,ns,bz,kf,kz,yz,Jg,Tz,vz,wz,Mr,$z,Pr,DT,ss,jr,Xg,sc,Fz,Yg,xz,ST,jt,rc,Ez,Zg,Bz,zz,ac,Mz,yf,Pz,jz,qz,ic,Cz,lc,Az,Nz,Oz,Ot,dc,Iz,rs,Lz,Tf,Dz,Sz,e_,Uz,Wz,Hz,qr,Rz,Cr,Kz,Ar,UT,as,Nr,t_,cc,Qz,o_,Vz,WT,qt,pc,Gz,n_,Jz,Xz,hc,Yz,vf,Zz,eM,tM,mc,oM,fc,nM,sM,rM,ho,uc,aM,is,iM,wf,lM,dM,s_,cM,pM,hM,Or,mM,Ir,HT,ls,Lr,r_,gc,fM,a_,uM,RT,Ct,_c,gM,i_,_M,bM,bc,kM,$f,yM,TM,vM,kc,wM,yc,$M,FM,xM,mo,Tc,EM,ds,BM,Ff,zM,MM,l_,PM,jM,qM,Dr,CM,Sr,KT,cs,Ur,d_,vc,AM,c_,NM,QT,At,wc,OM,ps,IM,p_,LM,DM,h_,SM,UM,WM,$c,HM,xf,RM,KM,QM,Fc,VM,xc,GM,JM,XM,fo,Ec,YM,hs,ZM,Ef,e4,t4,m_,o4,n4,s4,Wr,r4,Hr,VT,ms,Rr,f_,Bc,a4,u_,i4,GT,ft,zc,l4,g_,d4,c4,Mc,p4,Bf,h4,m4,f4,Pc,u4,jc,g4,_4,b4,Kr,k4,uo,qc,y4,fs,T4,zf,v4,w4,__,$4,F4,x4,Qr,E4,Vr,JT,us,Gr,b_,Cc,B4,k_,z4,XT,ut,Ac,M4,gs,P4,y_,j4,q4,T_,C4,A4,N4,Nc,O4,Mf,I4,L4,D4,Oc,S4,Ic,U4,W4,H4,Jr,R4,go,Lc,K4,_s,Q4,Pf,V4,G4,v_,J4,X4,Y4,Xr,Z4,Yr,YT,bs,Zr,w_,Dc,eP,$_,tP,ZT,ks,Sc,oP,It,Uc,nP,nt,sP,F_,rP,aP,x_,iP,lP,E_,dP,cP,B_,pP,hP,z_,mP,fP,M_,uP,gP,P_,_P,bP,kP,Wc,Hc,yP,j_,TP,vP,wP,Rc,$P,q_,FP,xP,EP,ee,BP,C_,zP,MP,A_,PP,jP,N_,qP,CP,O_,AP,NP,I_,OP,IP,L_,LP,DP,D_,SP,UP,S_,WP,HP,U_,RP,KP,W_,QP,VP,H_,GP,JP,R_,XP,YP,K_,ZP,ej,Q_,tj,oj,V_,nj,sj,G_,rj,aj,J_,ij,lj,X_,dj,cj,Y_,pj,hj,Z_,mj,fj,uj,ea,ev,ys,ta,eb,Kc,gj,tb,_j,tv,gt,Qc,bj,Vc,kj,ob,yj,Tj,vj,Gc,wj,jf,$j,Fj,xj,Jc,Ej,Xc,Bj,zj,Mj,oa,Pj,Lt,Yc,jj,Ts,qj,qf,Cj,Aj,nb,Nj,Oj,Ij,na,Lj,sa,Dj,ra,ov,vs,aa,sb,Zc,Sj,rb,Uj,nv,_t,ep,Wj,tp,Hj,ab,Rj,Kj,Qj,op,Vj,Cf,Gj,Jj,Xj,np,Yj,sp,Zj,eq,tq,ia,oq,_o,rp,nq,ws,sq,Af,rq,aq,ib,iq,lq,dq,la,cq,da,sv,$s,ca,lb,ap,pq,db,hq,rv,bt,ip,mq,cb,fq,uq,lp,gq,Nf,_q,bq,kq,dp,yq,cp,Tq,vq,wq,pa,$q,Dt,pp,Fq,Fs,xq,Of,Eq,Bq,pb,zq,Mq,Pq,ha,jq,ma,qq,fa,av,xs,ua,hb,hp,Cq,mb,Aq,iv,kt,mp,Nq,fb,Oq,Iq,fp,Lq,If,Dq,Sq,Uq,up,Wq,gp,Hq,Rq,Kq,ga,Qq,bo,_p,Vq,Es,Gq,Lf,Jq,Xq,ub,Yq,Zq,e3,_a,t3,ba,lv,Bs,ka,gb,bp,o3,_b,n3,dv,yt,kp,s3,bb,r3,a3,yp,i3,Df,l3,d3,c3,Tp,p3,vp,h3,m3,f3,ya,u3,St,wp,g3,zs,_3,Sf,b3,k3,kb,y3,T3,v3,Ta,w3,va,$3,wa,cv,Ms,$a,yb,$p,F3,Tb,x3,pv,Tt,Fp,E3,Ps,B3,vb,z3,M3,wb,P3,j3,q3,xp,C3,Uf,A3,N3,O3,Ep,I3,Bp,L3,D3,S3,Fa,U3,Ut,zp,W3,js,H3,Wf,R3,K3,$b,Q3,V3,G3,xa,J3,Ea,X3,Ba,hv,qs,za,Fb,Mp,Y3,xb,Z3,mv,st,Pp,eC,Eb,tC,oC,jp,nC,Hf,sC,rC,aC,qp,iC,Cp,lC,dC,cC,Bb,pC,hC,Lo,zb,Ap,mC,fC,Mb,Np,uC,gC,Pb,Op,_C,bC,jb,Ip,kC,yC,ko,Lp,TC,Cs,vC,qb,wC,$C,Cb,FC,xC,EC,Ma,BC,Pa,fv,As,ja,Ab,Dp,zC,Nb,MC,uv,rt,Sp,PC,Ns,jC,Ob,qC,CC,Ib,AC,NC,OC,Up,IC,Rf,LC,DC,SC,Wp,UC,Hp,WC,HC,RC,Lb,KC,QC,Do,Db,Rp,VC,GC,Sb,Kp,JC,XC,Ub,Qp,YC,ZC,Wb,Vp,e6,t6,yo,Gp,o6,Os,n6,Hb,s6,r6,Rb,a6,i6,l6,qa,d6,Ca,gv,Is,Aa,Kb,Jp,c6,Qb,p6,_v,at,Xp,h6,Vb,m6,f6,Yp,u6,Kf,g6,_6,b6,Zp,k6,eh,y6,T6,v6,Gb,w6,$6,So,Jb,th,F6,x6,Xb,oh,E6,B6,Yb,nh,z6,M6,Zb,sh,P6,j6,To,rh,q6,Ls,C6,ek,A6,N6,tk,O6,I6,L6,Na,D6,Oa,bv,Ds,Ia,ok,ah,S6,nk,U6,kv,it,ih,W6,lh,H6,sk,R6,K6,Q6,dh,V6,Qf,G6,J6,X6,ch,Y6,ph,Z6,e5,t5,rk,o5,n5,Uo,ak,hh,s5,r5,ik,mh,a5,i5,lk,fh,l5,d5,dk,uh,c5,p5,vo,gh,h5,Ss,m5,ck,f5,u5,pk,g5,_5,b5,La,k5,Da,yv,Us,Sa,hk,_h,y5,mk,T5,Tv,lt,bh,v5,kh,w5,fk,$5,F5,x5,yh,E5,Vf,B5,z5,M5,Th,P5,vh,j5,q5,C5,uk,A5,N5,Wo,gk,wh,O5,I5,_k,$h,L5,D5,bk,Fh,S5,U5,kk,xh,W5,H5,wo,Eh,R5,Ws,K5,yk,Q5,V5,Tk,G5,J5,X5,Ua,Y5,Wa,vv,Hs,Ha,vk,Bh,Z5,wk,eA,wv,dt,zh,tA,$k,oA,nA,Mh,sA,Gf,rA,aA,iA,Ph,lA,jh,dA,cA,pA,Fk,hA,mA,Ho,xk,qh,fA,uA,Ek,Ch,gA,_A,Bk,Ah,bA,kA,zk,Nh,yA,TA,$o,Oh,vA,Rs,wA,Mk,$A,FA,Pk,xA,EA,BA,Ra,zA,Ka,$v,Ks,Qa,jk,Ih,MA,qk,PA,Fv,ct,Lh,jA,Ck,qA,CA,Dh,AA,Jf,NA,OA,IA,Sh,LA,Uh,DA,SA,UA,Ak,WA,HA,Ro,Nk,Wh,RA,KA,Ok,Hh,QA,VA,Ik,Rh,GA,JA,Lk,Kh,XA,YA,Fo,Qh,ZA,Qs,e7,Dk,t7,o7,Sk,n7,s7,r7,Va,a7,Ga,xv,Vs,Ja,Uk,Vh,i7,Wk,l7,Ev,pt,Gh,d7,Hk,c7,p7,Jh,h7,Xf,m7,f7,u7,Xh,g7,Yh,_7,b7,k7,Rk,y7,T7,Ko,Kk,Zh,v7,w7,Qk,em,$7,F7,Vk,tm,x7,E7,Gk,om,B7,z7,xo,nm,M7,Gs,P7,Jk,j7,q7,Xk,C7,A7,N7,Xa,O7,Ya,Bv,Js,Za,Yk,sm,I7,Zk,L7,zv,ht,rm,D7,Xs,S7,ey,U7,W7,ty,H7,R7,K7,am,Q7,Yf,V7,G7,J7,im,X7,lm,Y7,Z7,e8,oy,t8,o8,Qo,ny,dm,n8,s8,sy,cm,r8,a8,ry,pm,i8,l8,ay,hm,d8,c8,Eo,mm,p8,Ys,h8,iy,m8,f8,ly,u8,g8,_8,ei,b8,ti,Mv;return l=new De({}),B=new De({}),he=new De({}),Ue=new Rw({props:{pipeline:"text-classification"}}),Qi=new Rw({props:{pipeline:"token-classification"}}),sl=new Rw({props:{pipeline:"fill-mask"}}),hl=new Rw({props:{pipeline:"question-answering"}}),Hl=new De({}),Rl=new O({props:{name:"class transformers.BertConfig",anchor:"transformers.BertConfig",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:" = 0"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the BERT model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/main/en/model_doc/bert#transformers.TFBertModel">TFBertModel</a>.`,name:"vocab_size"},{anchor:"transformers.BertConfig.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.BertConfig.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.BertConfig.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.BertConfig.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.BertConfig.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.BertConfig.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.BertConfig.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.BertConfig.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.BertConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/main/en/model_doc/bert#transformers.TFBertModel">TFBertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.BertConfig.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.BertConfig.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.BertConfig.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.BertConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model is used as a decoder or not. If <code>False</code>, the model is used as an encoder.`,name:"is_decoder"},{anchor:"transformers.BertConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.BertConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/configuration_bert.py#L72"}}),ar=new _e({props:{anchor:"transformers.BertConfig.example",$$slots:{default:[TU]},$$scope:{ctx:E}}}),Ql=new De({}),Vl=new O({props:{name:"class transformers.BertTokenizer",anchor:"transformers.BertTokenizer",parameters:[{name:"vocab_file",val:""},{name:"do_lower_case",val:" = True"},{name:"do_basic_tokenize",val:" = True"},{name:"never_split",val:" = None"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BertTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.BertTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.BertTokenizer.do_basic_tokenize",description:`<strong>do_basic_tokenize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to do basic tokenization before WordPiece.`,name:"do_basic_tokenize"},{anchor:"transformers.BertTokenizer.never_split",description:`<strong>never_split</strong> (<code>Iterable</code>, <em>optional</em>) &#x2014;
Collection of tokens which will never be split during tokenization. Only has an effect when
<code>do_basic_tokenize=True</code>`,name:"never_split"},{anchor:"transformers.BertTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.BertTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.BertTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.BertTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.BertTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.BertTokenizer.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters.</p>
<p>This should likely be deactivated for Japanese (see this
<a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.BertTokenizer.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original BERT).`,name:"strip_accents"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/tokenization_bert.py#L137"}}),Jl=new O({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.BertTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.BertTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.BertTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/tokenization_bert.py#L268",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Yl=new O({props:{name:"get_special_tokens_mask",anchor:"transformers.BertTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.BertTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.BertTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.BertTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/tokenization_bert.py#L293",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),ed=new O({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.BertTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.BertTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.BertTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/tokenization_bert.py#L321",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),dr=new _e({props:{anchor:"transformers.BertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[vU]},$$scope:{ctx:E}}}),td=new O({props:{name:"save_vocabulary",anchor:"transformers.BertTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/tokenization_bert.py#L350"}}),od=new De({}),nd=new O({props:{name:"class transformers.BertTokenizerFast",anchor:"transformers.BertTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"do_lower_case",val:" = True"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BertTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.BertTokenizerFast.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.BertTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.BertTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.BertTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.BertTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.BertTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.BertTokenizerFast.clean_text",description:`<strong>clean_text</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the text before tokenization by removing any control characters and replacing all
whitespaces by the classic one.`,name:"clean_text"},{anchor:"transformers.BertTokenizerFast.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters. This should likely be deactivated for Japanese (see <a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">this
issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.BertTokenizerFast.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original BERT).`,name:"strip_accents"},{anchor:"transformers.BertTokenizerFast.wordpieces_prefix",description:`<strong>wordpieces_prefix</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;##&quot;</code>) &#x2014;
The prefix for subwords.`,name:"wordpieces_prefix"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/tokenization_bert_fast.py#L161"}}),ad=new O({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.BertTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],parametersDescription:[{anchor:"transformers.BertTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.BertTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/tokenization_bert_fast.py#L249",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),ld=new O({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.BertTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.BertTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.BertTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/tokenization_bert_fast.py#L273",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),pr=new _e({props:{anchor:"transformers.BertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[wU]},$$scope:{ctx:E}}}),dd=new De({}),cd=new O({props:{name:"class transformers.TFBertTokenizer",anchor:"transformers.TFBertTokenizer",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertTokenizer.vocab_list",description:`<strong>vocab_list</strong> (<code>list</code>) &#x2014;
List containing the vocabulary.`,name:"vocab_list"},{anchor:"transformers.TFBertTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.TFBertTokenizer.cls_token_id",description:`<strong>cls_token_id</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token_id"},{anchor:"transformers.TFBertTokenizer.sep_token_id",description:`<strong>sep_token_id</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token_id"},{anchor:"transformers.TFBertTokenizer.pad_token_id",description:`<strong>pad_token_id</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token_id"},{anchor:"transformers.TFBertTokenizer.padding",description:`<strong>padding</strong> (<code>str</code>, defaults to <code>&quot;longest&quot;</code>) &#x2014;
The type of padding to use. Can be either <code>&quot;longest&quot;</code>, to pad only up to the longest sample in the batch,
or \`&#x201C;max_length&#x201D;, to pad all inputs to the maximum length supported by the tokenizer.`,name:"padding"},{anchor:"transformers.TFBertTokenizer.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to truncate the sequence to the maximum length.`,name:"truncation"},{anchor:"transformers.TFBertTokenizer.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>, defaults to <code>512</code>) &#x2014;
The maximum length of the sequence, used for padding (if <code>padding</code> is &#x201C;max_length&#x201D;) and/or truncation (if
<code>truncation</code> is <code>True</code>).`,name:"max_length"},{anchor:"transformers.TFBertTokenizer.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set, the sequence will be padded to a multiple of this value.`,name:"pad_to_multiple_of"},{anchor:"transformers.TFBertTokenizer.return_token_type_ids",description:`<strong>return_token_type_ids</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to return token_type_ids.`,name:"return_token_type_ids"},{anchor:"transformers.TFBertTokenizer.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to return the attention_mask.`,name:"return_attention_mask"},{anchor:"transformers.TFBertTokenizer.use_fast_bert_tokenizer",description:`<strong>use_fast_bert_tokenizer</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to false will use standard TF Text BertTokenizer, making it servable by TF Serving.`,name:"use_fast_bert_tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/tokenization_bert_tf.py#L12"}}),hd=new O({props:{name:"from_pretrained",anchor:"transformers.TFBertTokenizer.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike]"},{name:"*init_inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertTokenizer.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
The name or path to the pre-trained tokenizer.`,name:"pretrained_model_name_or_path"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/tokenization_bert_tf.py#L130"}}),mr=new _e({props:{anchor:"transformers.TFBertTokenizer.from_pretrained.example",$$slots:{default:[$U]},$$scope:{ctx:E}}}),fd=new O({props:{name:"from_tokenizer",anchor:"transformers.TFBertTokenizer.from_tokenizer",parameters:[{name:"tokenizer",val:": PreTrainedTokenizerBase"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertTokenizer.from_tokenizer.tokenizer",description:`<strong>tokenizer</strong> (<code>PreTrainedTokenizerBase</code>) &#x2014;
The tokenizer to use to initialize the <code>TFBertTokenizer</code>.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/tokenization_bert_tf.py#L100"}}),fr=new _e({props:{anchor:"transformers.TFBertTokenizer.from_tokenizer.example",$$slots:{default:[FU]},$$scope:{ctx:E}}}),ud=new De({}),gd=new O({props:{name:"class transformers.models.bert.modeling_bert.BertForPreTrainingOutput",anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prediction_logits",val:": FloatTensor = None"},{name:"seq_relationship_logits",val:": FloatTensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.`,name:"loss"},{anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"prediction_logits"},{anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput.seq_relationship_logits",description:`<strong>seq_relationship_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).`,name:"seq_relationship_logits"},{anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput.hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + 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 initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput.attentions",description:`<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>) &#x2014;
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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L769"}}),bd=new O({props:{name:"class transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput",anchor:"transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput",parameters:[{name:"loss",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"prediction_logits",val:": Tensor = None"},{name:"seq_relationship_logits",val:": Tensor = None"},{name:"hidden_states",val:": typing.Union[typing.Tuple[tensorflow.python.framework.ops.Tensor], tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"attentions",val:": typing.Union[typing.Tuple[tensorflow.python.framework.ops.Tensor], tensorflow.python.framework.ops.Tensor, NoneType] = None"}],parametersDescription:[{anchor:"transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"prediction_logits"},{anchor:"transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput.seq_relationship_logits",description:`<strong>seq_relationship_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).`,name:"seq_relationship_logits"},{anchor:"transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L933"}}),yd=new O({props:{name:"class transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput",anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput",parameters:[{name:"prediction_logits",val:": ndarray = None"},{name:"seq_relationship_logits",val:": ndarray = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[jax._src.numpy.ndarray.ndarray]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[jax._src.numpy.ndarray.ndarray]] = None"}],parametersDescription:[{anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"prediction_logits"},{anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.seq_relationship_logits",description:`<strong>seq_relationship_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).`,name:"seq_relationship_logits"},{anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>jnp.ndarray</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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L63"}}),vd=new O({props:{name:"replace",anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/flax/struct.py#L108"}}),wd=new De({}),$d=new O({props:{name:"class transformers.BertModel",anchor:"transformers.BertModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.BertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L872"}}),Md=new O({props:{name:"forward",anchor:"transformers.BertModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertModel.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.BertModel.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.BertModel.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.BertModel.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.BertModel.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.BertModel.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.BertModel.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.BertModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.BertModel.forward.encoder_attention_mask",description:`<strong>encoder_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 the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. 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>`,name:"encoder_attention_mask"},{anchor:"transformers.BertModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BertModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L911",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),br=new Se({props:{$$slots:{default:[xU]},$$scope:{ctx:E}}}),kr=new _e({props:{anchor:"transformers.BertModel.forward.example",$$slots:{default:[EU]},$$scope:{ctx:E}}}),Pd=new De({}),jd=new O({props:{name:"class transformers.BertForPreTraining",anchor:"transformers.BertForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1054"}}),Nd=new O({props:{name:"forward",anchor:"transformers.BertForPreTraining.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"next_sentence_label",val:": typing.Optional[torch.Tensor] = 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.BertForPreTraining.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertForPreTraining.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.BertForPreTraining.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.BertForPreTraining.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.BertForPreTraining.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.BertForPreTraining.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.BertForPreTraining.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.BertForPreTraining.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.BertForPreTraining.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
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>
next_sentence_label (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>):
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence
pair (see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.
kwargs (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>):
Used to hide legacy arguments that have been deprecated.</li>
</ul>`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1072",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/bert#transformers.models.bert.modeling_bert.BertForPreTrainingOutput"
>transformers.models.bert.modeling_bert.BertForPreTrainingOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.</p>
</li>
<li>
<p><strong>prediction_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>seq_relationship_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
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 + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/bert#transformers.models.bert.modeling_bert.BertForPreTrainingOutput"
>transformers.models.bert.modeling_bert.BertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Tr=new Se({props:{$$slots:{default:[BU]},$$scope:{ctx:E}}}),vr=new _e({props:{anchor:"transformers.BertForPreTraining.forward.example",$$slots:{default:[zU]},$$scope:{ctx:E}}}),Od=new De({}),Id=new O({props:{name:"class transformers.BertLMHeadModel",anchor:"transformers.BertLMHeadModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1160"}}),Wd=new O({props:{name:"forward",anchor:"transformers.BertLMHeadModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertLMHeadModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertLMHeadModel.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.BertLMHeadModel.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.BertLMHeadModel.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.BertLMHeadModel.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.BertLMHeadModel.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.BertLMHeadModel.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.BertLMHeadModel.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.BertLMHeadModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertLMHeadModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.BertLMHeadModel.forward.encoder_attention_mask",description:`<strong>encoder_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 the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. 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>`,name:"encoder_attention_mask"},{anchor:"transformers.BertLMHeadModel.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 left-to-right language modeling loss (next word prediction). 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 n <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.BertLMHeadModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BertLMHeadModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1183",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$r=new Se({props:{$$slots:{default:[MU]},$$scope:{ctx:E}}}),Fr=new _e({props:{anchor:"transformers.BertLMHeadModel.forward.example",$$slots:{default:[PU]},$$scope:{ctx:E}}}),Hd=new De({}),Rd=new O({props:{name:"class transformers.BertForMaskedLM",anchor:"transformers.BertForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1301"}}),Jd=new O({props:{name:"forward",anchor:"transformers.BertForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = 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.BertForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertForMaskedLM.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.BertForMaskedLM.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.BertForMaskedLM.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.BertForMaskedLM.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.BertForMaskedLM.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.BertForMaskedLM.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.BertForMaskedLM.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.BertForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1327",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Er=new Se({props:{$$slots:{default:[jU]},$$scope:{ctx:E}}}),Br=new _e({props:{anchor:"transformers.BertForMaskedLM.forward.example",$$slots:{default:[qU]},$$scope:{ctx:E}}}),Xd=new De({}),Yd=new O({props:{name:"class transformers.BertForNextSentencePrediction",anchor:"transformers.BertForNextSentencePrediction",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1413"}}),nc=new O({props:{name:"forward",anchor:"transformers.BertForNextSentencePrediction.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BertForNextSentencePrediction.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertForNextSentencePrediction.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.BertForNextSentencePrediction.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.BertForNextSentencePrediction.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.BertForNextSentencePrediction.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.BertForNextSentencePrediction.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.BertForNextSentencePrediction.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.BertForNextSentencePrediction.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.BertForNextSentencePrediction.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertForNextSentencePrediction.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence pair
(see <code>input_ids</code> docstring). Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.</li>
</ul>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1423",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</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>next_sentence_label</code> is provided) \u2014 Next sequence prediction (classification) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Mr=new Se({props:{$$slots:{default:[CU]},$$scope:{ctx:E}}}),Pr=new _e({props:{anchor:"transformers.BertForNextSentencePrediction.forward.example",$$slots:{default:[AU]},$$scope:{ctx:E}}}),sc=new De({}),rc=new O({props:{name:"class transformers.BertForSequenceClassification",anchor:"transformers.BertForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1518"}}),dc=new O({props:{name:"forward",anchor:"transformers.BertForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_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.BertForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertForSequenceClassification.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.BertForSequenceClassification.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.BertForSequenceClassification.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.BertForSequenceClassification.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.BertForSequenceClassification.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.BertForSequenceClassification.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.BertForSequenceClassification.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.BertForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1534",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qr=new Se({props:{$$slots:{default:[NU]},$$scope:{ctx:E}}}),Cr=new _e({props:{anchor:"transformers.BertForSequenceClassification.forward.example",$$slots:{default:[OU]},$$scope:{ctx:E}}}),Ar=new _e({props:{anchor:"transformers.BertForSequenceClassification.forward.example-2",$$slots:{default:[IU]},$$scope:{ctx:E}}}),cc=new De({}),pc=new O({props:{name:"class transformers.BertForMultipleChoice",anchor:"transformers.BertForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1621"}}),uc=new O({props:{name:"forward",anchor:"transformers.BertForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_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.BertForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertForMultipleChoice.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.BertForMultipleChoice.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.BertForMultipleChoice.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.BertForMultipleChoice.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.BertForMultipleChoice.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.BertForMultipleChoice.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.BertForMultipleChoice.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.BertForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1635",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Or=new Se({props:{$$slots:{default:[LU]},$$scope:{ctx:E}}}),Ir=new _e({props:{anchor:"transformers.BertForMultipleChoice.forward.example",$$slots:{default:[DU]},$$scope:{ctx:E}}}),gc=new De({}),_c=new O({props:{name:"class transformers.BertForTokenClassification",anchor:"transformers.BertForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1715"}}),Tc=new O({props:{name:"forward",anchor:"transformers.BertForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_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.BertForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertForTokenClassification.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.BertForTokenClassification.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.BertForTokenClassification.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.BertForTokenClassification.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.BertForTokenClassification.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.BertForTokenClassification.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.BertForTokenClassification.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.BertForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1733",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Dr=new Se({props:{$$slots:{default:[SU]},$$scope:{ctx:E}}}),Sr=new _e({props:{anchor:"transformers.BertForTokenClassification.forward.example",$$slots:{default:[UU]},$$scope:{ctx:E}}}),vc=new De({}),wc=new O({props:{name:"class transformers.BertForQuestionAnswering",anchor:"transformers.BertForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1801"}}),Ec=new O({props:{name:"forward",anchor:"transformers.BertForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"end_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"output_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.BertForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertForQuestionAnswering.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.BertForQuestionAnswering.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.BertForQuestionAnswering.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.BertForQuestionAnswering.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.BertForQuestionAnswering.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.BertForQuestionAnswering.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.BertForQuestionAnswering.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.BertForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertForQuestionAnswering.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.BertForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1815",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Wr=new Se({props:{$$slots:{default:[WU]},$$scope:{ctx:E}}}),Hr=new _e({props:{anchor:"transformers.BertForQuestionAnswering.forward.example",$$slots:{default:[HU]},$$scope:{ctx:E}}}),Bc=new De({}),zc=new O({props:{name:"class transformers.TFBertModel",anchor:"transformers.TFBertModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1065"}}),Kr=new Se({props:{$$slots:{default:[RU]},$$scope:{ctx:E}}}),qc=new O({props:{name:"call",anchor:"transformers.TFBertModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_hidden_states",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertModel.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertModel.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertModel.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertModel.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertModel.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertModel.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertModel.call.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.TFBertModel.call.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. 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>`,name:"encoder_attention_mask"},{anchor:"transformers.TFBertModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFBertModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1071",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</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>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you\u2019re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Qr=new Se({props:{$$slots:{default:[KU]},$$scope:{ctx:E}}}),Vr=new _e({props:{anchor:"transformers.TFBertModel.call.example",$$slots:{default:[QU]},$$scope:{ctx:E}}}),Cc=new De({}),Ac=new O({props:{name:"class transformers.TFBertForPreTraining",anchor:"transformers.TFBertForPreTraining",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1161"}}),Jr=new Se({props:{$$slots:{default:[VU]},$$scope:{ctx:E}}}),Lc=new O({props:{name:"call",anchor:"transformers.TFBertForPreTraining.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"next_sentence_label",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForPreTraining.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForPreTraining.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForPreTraining.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForPreTraining.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForPreTraining.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForPreTraining.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForPreTraining.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForPreTraining.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForPreTraining.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForPreTraining.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForPreTraining.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</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.TFBertForPreTraining.call.next_sentence_label",description:`<strong>next_sentence_label</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence pair
(see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.</li>
</ul>`,name:"next_sentence_label"},{anchor:"transformers.TFBertForPreTraining.call.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>) &#x2014;
Used to hide legacy arguments that have been deprecated.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1183",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/bert#transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput"
>transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>prediction_logits</strong> (<code>tf.Tensor</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>seq_relationship_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/bert#transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput"
>transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Xr=new Se({props:{$$slots:{default:[GU]},$$scope:{ctx:E}}}),Yr=new _e({props:{anchor:"transformers.TFBertForPreTraining.call.example",$$slots:{default:[JU]},$$scope:{ctx:E}}}),Dc=new De({}),Sc=new O({props:{name:"class transformers.TFBertLMHeadModel",anchor:"transformers.TFBertLMHeadModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1369"}}),Uc=new O({props:{name:"call",anchor:"transformers.TFBertLMHeadModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_hidden_states",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1406",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</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>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ea=new _e({props:{anchor:"transformers.TFBertLMHeadModel.call.example",$$slots:{default:[XU]},$$scope:{ctx:E}}}),Kc=new De({}),Qc=new O({props:{name:"class transformers.TFBertForMaskedLM",anchor:"transformers.TFBertForMaskedLM",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1278"}}),oa=new Se({props:{$$slots:{default:[YU]},$$scope:{ctx:E}}}),Yc=new O({props:{name:"call",anchor:"transformers.TFBertForMaskedLM.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForMaskedLM.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForMaskedLM.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForMaskedLM.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForMaskedLM.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForMaskedLM.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForMaskedLM.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForMaskedLM.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForMaskedLM.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForMaskedLM.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForMaskedLM.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForMaskedLM.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1306",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),na=new Se({props:{$$slots:{default:[ZU]},$$scope:{ctx:E}}}),sa=new _e({props:{anchor:"transformers.TFBertForMaskedLM.call.example",$$slots:{default:[eW]},$$scope:{ctx:E}}}),ra=new _e({props:{anchor:"transformers.TFBertForMaskedLM.call.example-2",$$slots:{default:[tW]},$$scope:{ctx:E}}}),Zc=new De({}),ep=new O({props:{name:"class transformers.TFBertForNextSentencePrediction",anchor:"transformers.TFBertForNextSentencePrediction",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1511"}}),ia=new Se({props:{$$slots:{default:[oW]},$$scope:{ctx:E}}}),rp=new O({props:{name:"call",anchor:"transformers.TFBertForNextSentencePrediction.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"next_sentence_label",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForNextSentencePrediction.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForNextSentencePrediction.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForNextSentencePrediction.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForNextSentencePrediction.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForNextSentencePrediction.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForNextSentencePrediction.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForNextSentencePrediction.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForNextSentencePrediction.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForNextSentencePrediction.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForNextSentencePrediction.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1521",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFNextSentencePredictorOutput"
>transformers.modeling_tf_outputs.TFNextSentencePredictorOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>next_sentence_label</code> is provided) \u2014 Next sentence prediction loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFNextSentencePredictorOutput"
>transformers.modeling_tf_outputs.TFNextSentencePredictorOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),la=new Se({props:{$$slots:{default:[nW]},$$scope:{ctx:E}}}),da=new _e({props:{anchor:"transformers.TFBertForNextSentencePrediction.call.example",$$slots:{default:[sW]},$$scope:{ctx:E}}}),ap=new De({}),ip=new O({props:{name:"class transformers.TFBertForSequenceClassification",anchor:"transformers.TFBertForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1602"}}),pa=new Se({props:{$$slots:{default:[rW]},$$scope:{ctx:E}}}),pp=new O({props:{name:"call",anchor:"transformers.TFBertForSequenceClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForSequenceClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForSequenceClassification.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForSequenceClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForSequenceClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForSequenceClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForSequenceClassification.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForSequenceClassification.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForSequenceClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForSequenceClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForSequenceClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1623",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</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>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ha=new Se({props:{$$slots:{default:[aW]},$$scope:{ctx:E}}}),ma=new _e({props:{anchor:"transformers.TFBertForSequenceClassification.call.example",$$slots:{default:[iW]},$$scope:{ctx:E}}}),fa=new _e({props:{anchor:"transformers.TFBertForSequenceClassification.call.example-2",$$slots:{default:[lW]},$$scope:{ctx:E}}}),hp=new De({}),mp=new O({props:{name:"class transformers.TFBertForMultipleChoice",anchor:"transformers.TFBertForMultipleChoice",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1694"}}),ga=new Se({props:{$$slots:{default:[dW]},$$scope:{ctx:E}}}),_p=new O({props:{name:"call",anchor:"transformers.TFBertForMultipleChoice.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForMultipleChoice.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForMultipleChoice.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForMultipleChoice.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForMultipleChoice.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForMultipleChoice.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForMultipleChoice.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForMultipleChoice.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForMultipleChoice.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForMultipleChoice.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForMultipleChoice.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForMultipleChoice.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</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]</code>
where <code>num_choices</code> is the size of the second dimension of the input tensors. (See <code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1718",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <em>(batch_size, )</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),_a=new Se({props:{$$slots:{default:[cW]},$$scope:{ctx:E}}}),ba=new _e({props:{anchor:"transformers.TFBertForMultipleChoice.call.example",$$slots:{default:[pW]},$$scope:{ctx:E}}}),bp=new De({}),kp=new O({props:{name:"class transformers.TFBertForTokenClassification",anchor:"transformers.TFBertForTokenClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1823"}}),ya=new Se({props:{$$slots:{default:[hW]},$$scope:{ctx:E}}}),wp=new O({props:{name:"call",anchor:"transformers.TFBertForTokenClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForTokenClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForTokenClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForTokenClassification.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForTokenClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForTokenClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForTokenClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForTokenClassification.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForTokenClassification.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForTokenClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForTokenClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForTokenClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1850",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of unmasked labels, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Ta=new Se({props:{$$slots:{default:[mW]},$$scope:{ctx:E}}}),va=new _e({props:{anchor:"transformers.TFBertForTokenClassification.call.example",$$slots:{default:[fW]},$$scope:{ctx:E}}}),wa=new _e({props:{anchor:"transformers.TFBertForTokenClassification.call.example-2",$$slots:{default:[uW]},$$scope:{ctx:E}}}),$p=new De({}),Fp=new O({props:{name:"class transformers.TFBertForQuestionAnswering",anchor:"transformers.TFBertForQuestionAnswering",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1919"}}),Fa=new Se({props:{$$slots:{default:[gW]},$$scope:{ctx:E}}}),zp=new O({props:{name:"call",anchor:"transformers.TFBertForQuestionAnswering.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"start_positions",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"end_positions",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForQuestionAnswering.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForQuestionAnswering.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForQuestionAnswering.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForQuestionAnswering.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForQuestionAnswering.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForQuestionAnswering.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForQuestionAnswering.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForQuestionAnswering.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForQuestionAnswering.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForQuestionAnswering.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForQuestionAnswering.call.start_positions",description:`<strong>start_positions</strong> (<code>tf.Tensor</code> or <code>np.ndarray</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.TFBertForQuestionAnswering.call.end_positions",description:`<strong>end_positions</strong> (<code>tf.Tensor</code> or <code>np.ndarray</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_tf_bert.py#L1941",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>start_positions</code> and <code>end_positions</code> are 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>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),xa=new Se({props:{$$slots:{default:[_W]},$$scope:{ctx:E}}}),Ea=new _e({props:{anchor:"transformers.TFBertForQuestionAnswering.call.example",$$slots:{default:[bW]},$$scope:{ctx:E}}}),Ba=new _e({props:{anchor:"transformers.TFBertForQuestionAnswering.call.example-2",$$slots:{default:[kW]},$$scope:{ctx:E}}}),Mp=new De({}),Pp=new O({props:{name:"class transformers.FlaxBertModel",anchor:"transformers.FlaxBertModel",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L1030"}}),Lp=new O({props:{name:"__call__",anchor:"transformers.FlaxBertModel.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBertModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxBertModel.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxBertModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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>.`,name:"position_ids"},{anchor:"transformers.FlaxBertModel.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxBertModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L857",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</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>jnp.ndarray</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by 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(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ma=new Se({props:{$$slots:{default:[yW]},$$scope:{ctx:E}}}),Pa=new _e({props:{anchor:"transformers.FlaxBertModel.__call__.example",$$slots:{default:[TW]},$$scope:{ctx:E}}}),Dp=new De({}),Sp=new O({props:{name:"class transformers.FlaxBertForPreTraining",anchor:"transformers.FlaxBertForPreTraining",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForPreTraining.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForPreTraining.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L1106"}}),Gp=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForPreTraining.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForPreTraining.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBertForPreTraining.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxBertForPreTraining.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxBertForPreTraining.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForPreTraining.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxBertForPreTraining.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L857",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/bert#transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput"
>transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>prediction_logits</strong> (<code>jnp.ndarray</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>seq_relationship_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/bert#transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput"
>transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qa=new Se({props:{$$slots:{default:[vW]},$$scope:{ctx:E}}}),Ca=new _e({props:{anchor:"transformers.FlaxBertForPreTraining.__call__.example",$$slots:{default:[wW]},$$scope:{ctx:E}}}),Jp=new De({}),Xp=new O({props:{name:"class transformers.FlaxBertForCausalLM",anchor:"transformers.FlaxBertForCausalLM",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForCausalLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForCausalLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L1679"}}),rh=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForCausalLM.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForCausalLM.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBertForCausalLM.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxBertForCausalLM.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxBertForCausalLM.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForCausalLM.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxBertForCausalLM.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L857",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</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>jnp.ndarray</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key, value
states of the self-attention and the cross-attention layers if model is used in encoder-decoder setting.
Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Na=new Se({props:{$$slots:{default:[$W]},$$scope:{ctx:E}}}),Oa=new _e({props:{anchor:"transformers.FlaxBertForCausalLM.__call__.example",$$slots:{default:[FW]},$$scope:{ctx:E}}}),ah=new De({}),ih=new O({props:{name:"class transformers.FlaxBertForMaskedLM",anchor:"transformers.FlaxBertForMaskedLM",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForMaskedLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForMaskedLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L1197"}}),gh=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForMaskedLM.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForMaskedLM.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBertForMaskedLM.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxBertForMaskedLM.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxBertForMaskedLM.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForMaskedLM.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxBertForMaskedLM.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L857",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),La=new Se({props:{$$slots:{default:[xW]},$$scope:{ctx:E}}}),Da=new _e({props:{anchor:"transformers.FlaxBertForMaskedLM.__call__.example",$$slots:{default:[EW]},$$scope:{ctx:E}}}),_h=new De({}),bh=new O({props:{name:"class transformers.FlaxBertForNextSentencePrediction",anchor:"transformers.FlaxBertForNextSentencePrediction",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForNextSentencePrediction.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForNextSentencePrediction.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L1261"}}),Eh=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForNextSentencePrediction.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForNextSentencePrediction.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBertForNextSentencePrediction.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxBertForNextSentencePrediction.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxBertForNextSentencePrediction.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForNextSentencePrediction.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxBertForNextSentencePrediction.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L857",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput"
>transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput"
>transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ua=new Se({props:{$$slots:{default:[BW]},$$scope:{ctx:E}}}),Wa=new _e({props:{anchor:"transformers.FlaxBertForNextSentencePrediction.__call__.example",$$slots:{default:[zW]},$$scope:{ctx:E}}}),Bh=new De({}),zh=new O({props:{name:"class transformers.FlaxBertForSequenceClassification",anchor:"transformers.FlaxBertForSequenceClassification",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForSequenceClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForSequenceClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L1364"}}),Oh=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForSequenceClassification.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForSequenceClassification.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBertForSequenceClassification.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxBertForSequenceClassification.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxBertForSequenceClassification.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForSequenceClassification.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxBertForSequenceClassification.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L857",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ra=new Se({props:{$$slots:{default:[MW]},$$scope:{ctx:E}}}),Ka=new _e({props:{anchor:"transformers.FlaxBertForSequenceClassification.__call__.example",$$slots:{default:[PW]},$$scope:{ctx:E}}}),Ih=new De({}),Lh=new O({props:{name:"class transformers.FlaxBertForMultipleChoice",anchor:"transformers.FlaxBertForMultipleChoice",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForMultipleChoice.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForMultipleChoice.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L1444"}}),Qh=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForMultipleChoice.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForMultipleChoice.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBertForMultipleChoice.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxBertForMultipleChoice.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxBertForMultipleChoice.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForMultipleChoice.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxBertForMultipleChoice.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L857",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput"
>transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput"
>transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Va=new Se({props:{$$slots:{default:[jW]},$$scope:{ctx:E}}}),Ga=new _e({props:{anchor:"transformers.FlaxBertForMultipleChoice.__call__.example",$$slots:{default:[qW]},$$scope:{ctx:E}}}),Vh=new De({}),Gh=new O({props:{name:"class transformers.FlaxBertForTokenClassification",anchor:"transformers.FlaxBertForTokenClassification",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForTokenClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForTokenClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L1522"}}),nm=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForTokenClassification.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForTokenClassification.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBertForTokenClassification.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxBertForTokenClassification.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxBertForTokenClassification.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForTokenClassification.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxBertForTokenClassification.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L857",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxTokenClassifierOutput"
>transformers.modeling_flax_outputs.FlaxTokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxTokenClassifierOutput"
>transformers.modeling_flax_outputs.FlaxTokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Xa=new Se({props:{$$slots:{default:[CW]},$$scope:{ctx:E}}}),Ya=new _e({props:{anchor:"transformers.FlaxBertForTokenClassification.__call__.example",$$slots:{default:[AW]},$$scope:{ctx:E}}}),sm=new De({}),rm=new O({props:{name:"class transformers.FlaxBertForQuestionAnswering",anchor:"transformers.FlaxBertForQuestionAnswering",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForQuestionAnswering.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForQuestionAnswering.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L1595"}}),mm=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForQuestionAnswering.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForQuestionAnswering.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBertForQuestionAnswering.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxBertForQuestionAnswering.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxBertForQuestionAnswering.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForQuestionAnswering.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxBertForQuestionAnswering.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_flax_bert.py#L857",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>start_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ei=new Se({props:{$$slots:{default:[NW]},$$scope:{ctx:E}}}),ti=new _e({props:{anchor:"transformers.FlaxBertForQuestionAnswering.__call__.example",$$slots:{default:[OW]},$$scope:{ctx:E}}}),{c(){d=s("meta"),k=c(),f=s("h1"),u=s("a"),b=s("span"),T(l.$$.fragment),m=c(),z=s("span"),Fe=o("BERT"),ye=c(),S=s("h2"),le=s("a"),Z=s("span"),T(B.$$.fragment),xe=c(),Q=s("span"),Ee=o("Overview"),Te=c(),U=s("p"),Be=o("The BERT model was proposed in "),ce=s("a"),X=o("BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding"),ze=o(` by Jacob Devlin, Ming-Wei Chang, Kenton Lee and Kristina Toutanova. It\u2019s a
bidirectional transformer pretrained using a combination of masked language modeling objective and next sentence
prediction on a large corpus comprising the Toronto Book Corpus and Wikipedia.`),ve=c(),R=s("p"),Me=o("The abstract from the paper is the following:"),we=c(),K=s("p"),fe=s("em"),Pe=o(`We introduce a new language representation model called BERT, which stands for Bidirectional Encoder Representations
from Transformers. Unlike recent language representation models, BERT is designed to pre-train deep bidirectional
representations from unlabeled text by jointly conditioning on both left and right context in all layers. As a result,
the pre-trained BERT model can be fine-tuned with just one additional output layer to create state-of-the-art models
for a wide range of tasks, such as question answering and language inference, without substantial task-specific
architecture modifications.`),te=c(),j=s("p"),q=s("em"),je=o(`BERT is conceptually simple and empirically powerful. It obtains new state-of-the-art results on eleven natural
language processing tasks, including pushing the GLUE score to 80.5% (7.7% point absolute improvement), MultiNLI
accuracy to 86.7% (4.6% absolute improvement), SQuAD v1.1 question answering Test F1 to 93.2 (1.5 point absolute
improvement) and SQuAD v2.0 Test F1 to 83.1 (5.1 point absolute improvement).`),G=c(),me=s("p"),qe=o("Tips:"),J=c(),de=s("ul"),ue=s("li"),A=o(`BERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),Ce=c(),V=s("li"),Ae=o(`BERT was trained with the masked language modeling (MLM) and next sentence prediction (NSP) objectives. It is
efficient at predicting masked tokens and at NLU in general, but is not optimal for text generation.`),$e=c(),D=s("p"),Ne=o("This model was contributed by "),pe=s("a"),L=o("thomwolf"),Oe=o(". The original code can be found "),W=s("a"),Ie=o("here"),ne=o("."),C=c(),ie=s("h2"),N=s("a"),ge=s("span"),T(he.$$.fragment),y=c(),M=s("span"),Ve=o("Resources"),oe=c(),Ke=s("p"),Ge=o("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with BERT. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),P=c(),T(Ue.$$.fragment),Qe=c(),re=s("ul"),We=s("li"),Je=o("A blog post on "),I=s("a"),Y=o("BERT Text Classification in a different language"),Xe=o("."),Ye=c(),H=s("li"),Ze=o("A notebook for "),He=s("a"),Le=o("Finetuning BERT (and friends) for multi-label text classification"),et=o("."),se=c(),Re=s("li"),Kw=o("A notebook on how to "),Ii=s("a"),Qw=o("Finetune BERT for multi-label classification using PyTorch"),Vw=o(". \u{1F30E}"),Gw=c(),Li=s("li"),Jw=o("A notebook on how to "),Di=s("a"),Xw=o("warm-start an EncoderDecoder model with BERT for summarization"),Yw=o("."),Zw=c(),Go=s("li"),Mm=s("a"),e$=o("BertForSequenceClassification"),t$=o(" is supported by this "),Si=s("a"),o$=o("example script"),n$=o(" and "),Ui=s("a"),s$=o("notebook"),r$=o("."),a$=c(),Jo=s("li"),Pm=s("a"),i$=o("TFBertForSequenceClassification"),l$=o(" is supported by this "),Wi=s("a"),d$=o("example script"),c$=o(" and "),Hi=s("a"),p$=o("notebook"),h$=o("."),m$=c(),Xo=s("li"),jm=s("a"),f$=o("FlaxBertForSequenceClassification"),u$=o(" is supported by this "),Ri=s("a"),g$=o("example script"),_$=o(" and "),Ki=s("a"),b$=o("notebook"),k$=o("."),sT=c(),T(Qi.$$.fragment),rT=c(),wt=s("ul"),Vi=s("li"),y$=o("A blog post on how to use "),Gi=s("a"),T$=o("Hugging Face Transformers with Keras: Fine-tune a non-English BERT for Named Entity Recognition"),v$=o("."),w$=c(),Cn=s("li"),$$=o("A notebook for "),Ji=s("a"),F$=o("Finetuning BERT for named-entity recognition"),x$=o(" using only the first wordpiece of each word in the word label during tokenization. To propagate the label of the word to all wordpieces, see this "),Xi=s("a"),E$=o("version"),B$=o(" of the notebook instead."),z$=c(),Yo=s("li"),qm=s("a"),M$=o("BertForTokenClassification"),P$=o(" is supported by this "),Yi=s("a"),j$=o("example script"),q$=o(" and "),Zi=s("a"),C$=o("notebook"),A$=o("."),N$=c(),Zo=s("li"),Cm=s("a"),O$=o("TFBertForTokenClassification"),I$=o(" is supported by this "),el=s("a"),L$=o("example script"),D$=o(" and "),tl=s("a"),S$=o("notebook"),U$=o("."),W$=c(),tr=s("li"),Am=s("a"),H$=o("FlaxBertForTokenClassification"),R$=o(" is supported by this "),ol=s("a"),K$=o("example script"),Q$=o("."),V$=c(),Nm=s("li"),nl=s("a"),G$=o("Token classification"),J$=o(" chapter of the \u{1F917} Hugging Face Course."),aT=c(),T(sl.$$.fragment),iT=c(),oo=s("ul"),en=s("li"),Om=s("a"),X$=o("BertForMaskedLM"),Y$=o(" is supported by this "),rl=s("a"),Z$=o("example script"),e2=o(" and "),al=s("a"),t2=o("notebook"),o2=o("."),n2=c(),tn=s("li"),Im=s("a"),s2=o("TFBertForMaskedLM"),r2=o(" is supported by this "),il=s("a"),a2=o("example script"),i2=o(" and "),ll=s("a"),l2=o("notebook"),d2=o("."),c2=c(),on=s("li"),Lm=s("a"),p2=o("FlaxBertForMaskedLM"),h2=o(" is supported by this "),dl=s("a"),m2=o("example script"),f2=o(" and "),cl=s("a"),u2=o("notebook"),g2=o("."),_2=c(),Dm=s("li"),pl=s("a"),b2=o("Masked language modeling"),k2=o(" chapter of the \u{1F917} Hugging Face Course."),lT=c(),T(hl.$$.fragment),dT=c(),no=s("ul"),nn=s("li"),Sm=s("a"),y2=o("BertForQuestionAnswering"),T2=o(" is supported by this "),ml=s("a"),v2=o("example script"),w2=o(" and "),fl=s("a"),$2=o("notebook"),F2=o("."),x2=c(),sn=s("li"),Um=s("a"),E2=o("TFBertForQuestionAnswering"),B2=o(" is supported by this "),ul=s("a"),z2=o("example script"),M2=o(" and "),gl=s("a"),P2=o("notebook"),j2=o("."),q2=c(),or=s("li"),Wm=s("a"),C2=o("FlaxBertForQuestionAnswering"),A2=o(" is supported by this "),_l=s("a"),N2=o("example script"),O2=o("."),I2=c(),Hm=s("li"),bl=s("a"),L2=o("Question answering"),D2=o(" chapter of the \u{1F917} Hugging Face Course."),cT=c(),Rm=s("p"),Uu=s("strong"),S2=o("Multiple choice"),pT=c(),nr=s("ul"),rn=s("li"),Km=s("a"),U2=o("BertForMultipleChoice"),W2=o(" is supported by this "),kl=s("a"),H2=o("example script"),R2=o(" and "),yl=s("a"),K2=o("notebook"),Q2=o("."),V2=c(),an=s("li"),Qm=s("a"),G2=o("TFBertForMultipleChoice"),J2=o(" is supported by this "),Tl=s("a"),X2=o("example script"),Y2=o(" and "),vl=s("a"),Z2=o("notebook"),eF=o("."),hT=c(),wl=s("p"),tF=o("\u26A1\uFE0F "),Wu=s("strong"),oF=o("Inference"),mT=c(),sr=s("ul"),$l=s("li"),nF=o("A blog post on how to "),Fl=s("a"),sF=o("Accelerate BERT inference with Hugging Face Transformers and AWS Inferentia"),rF=o("."),aF=c(),xl=s("li"),iF=o("A blog post on how to "),El=s("a"),lF=o("Accelerate BERT inference with DeepSpeed-Inference on GPUs"),dF=o("."),fT=c(),Bl=s("p"),cF=o("\u2699\uFE0F "),Hu=s("strong"),pF=o("Pretraining"),uT=c(),Vm=s("ul"),zl=s("li"),hF=o("A blog post on "),Ml=s("a"),mF=o("Pre-Training BERT with Hugging Face Transformers and Habana Gaudi"),fF=o("."),gT=c(),Pl=s("p"),uF=o("\u{1F680} "),Ru=s("strong"),gF=o("Deploy"),_T=c(),$t=s("ul"),jl=s("li"),_F=o("A blog post on how to "),ql=s("a"),bF=o("Convert Transformers to ONNX with Hugging Face Optimum"),kF=o("."),yF=c(),Cl=s("li"),TF=o("A blog post on how to "),Al=s("a"),vF=o("Setup Deep Learning environment for Hugging Face Transformers with Habana Gaudi on AWS"),wF=o("."),$F=c(),Nl=s("li"),FF=o("A blog post on "),Ol=s("a"),xF=o("Autoscaling BERT with Hugging Face Transformers, Amazon SageMaker and Terraform module"),EF=o("."),BF=c(),Il=s("li"),zF=o("A blog post on "),Ll=s("a"),MF=o("Serverless BERT with HuggingFace, AWS Lambda, and Docker"),PF=o("."),jF=c(),Dl=s("li"),qF=o("A blog post on "),Sl=s("a"),CF=o("Hugging Face Transformers BERT fine-tuning using Amazon SageMaker and Training Compiler"),AF=o("."),NF=c(),Ul=s("li"),OF=o("A blog post on "),Wl=s("a"),IF=o("Task-specific knowledge distillation for BERT using Transformers & Amazon SageMaker"),LF=o("."),bT=c(),An=s("h2"),rr=s("a"),Ku=s("span"),T(Hl.$$.fragment),DF=c(),Qu=s("span"),SF=o("BertConfig"),kT=c(),to=s("div"),T(Rl.$$.fragment),UF=c(),Oo=s("p"),WF=o("This is the configuration class to store the configuration of a "),Gm=s("a"),HF=o("BertModel"),RF=o(" or a "),Jm=s("a"),KF=o("TFBertModel"),QF=o(`. It is used to
instantiate a 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 BERT
`),Kl=s("a"),VF=o("bert-base-uncased"),GF=o(" architecture."),JF=c(),Nn=s("p"),XF=o("Configuration objects inherit from "),Xm=s("a"),YF=o("PretrainedConfig"),ZF=o(` and can be used to control the model outputs. Read the
documentation from `),Ym=s("a"),ex=o("PretrainedConfig"),tx=o(" for more information."),ox=c(),T(ar.$$.fragment),yT=c(),On=s("h2"),ir=s("a"),Vu=s("span"),T(Ql.$$.fragment),nx=c(),Gu=s("span"),sx=o("BertTokenizer"),TT=c(),tt=s("div"),T(Vl.$$.fragment),rx=c(),Ju=s("p"),ax=o("Construct a BERT tokenizer. Based on WordPiece."),ix=c(),Gl=s("p"),lx=o("This tokenizer inherits from "),Zm=s("a"),dx=o("PreTrainedTokenizer"),cx=o(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),px=c(),ln=s("div"),T(Jl.$$.fragment),hx=c(),Xu=s("p"),mx=o(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),fx=c(),Xl=s("ul"),ef=s("li"),ux=o("single sequence: "),Yu=s("code"),gx=o("[CLS] X [SEP]"),_x=c(),tf=s("li"),bx=o("pair of sequences: "),Zu=s("code"),kx=o("[CLS] A [SEP] B [SEP]"),yx=c(),lr=s("div"),T(Yl.$$.fragment),Tx=c(),Zl=s("p"),vx=o(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),eg=s("code"),wx=o("prepare_for_model"),$x=o(" method."),Fx=c(),so=s("div"),T(ed.$$.fragment),xx=c(),tg=s("p"),Ex=o("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),Bx=c(),T(dr.$$.fragment),zx=c(),In=s("p"),Mx=o("If "),og=s("code"),Px=o("token_ids_1"),jx=o(" is "),ng=s("code"),qx=o("None"),Cx=o(", this method only returns the first portion of the mask (0s)."),Ax=c(),of=s("div"),T(td.$$.fragment),vT=c(),Ln=s("h2"),cr=s("a"),sg=s("span"),T(od.$$.fragment),Nx=c(),rg=s("span"),Ox=o("BertTokenizerFast"),wT=c(),xt=s("div"),T(nd.$$.fragment),Ix=c(),sd=s("p"),Lx=o("Construct a \u201Cfast\u201D BERT tokenizer (backed by HuggingFace\u2019s "),ag=s("em"),Dx=o("tokenizers"),Sx=o(" library). Based on WordPiece."),Ux=c(),rd=s("p"),Wx=o("This tokenizer inherits from "),nf=s("a"),Hx=o("PreTrainedTokenizerFast"),Rx=o(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Kx=c(),dn=s("div"),T(ad.$$.fragment),Qx=c(),ig=s("p"),Vx=o(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),Gx=c(),id=s("ul"),sf=s("li"),Jx=o("single sequence: "),lg=s("code"),Xx=o("[CLS] X [SEP]"),Yx=c(),rf=s("li"),Zx=o("pair of sequences: "),dg=s("code"),e0=o("[CLS] A [SEP] B [SEP]"),t0=c(),ro=s("div"),T(ld.$$.fragment),o0=c(),cg=s("p"),n0=o("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),s0=c(),T(pr.$$.fragment),r0=c(),Dn=s("p"),a0=o("If "),pg=s("code"),i0=o("token_ids_1"),l0=o(" is "),hg=s("code"),d0=o("None"),c0=o(", this method only returns the first portion of the mask (0s)."),$T=c(),Sn=s("h2"),hr=s("a"),mg=s("span"),T(dd.$$.fragment),p0=c(),fg=s("span"),h0=o("TFBertTokenizer"),FT=c(),Et=s("div"),T(cd.$$.fragment),m0=c(),Un=s("p"),f0=o(`This is an in-graph tokenizer for BERT. It should be initialized similarly to other tokenizers, using the
`),ug=s("code"),u0=o("from_pretrained()"),g0=o(" method. It can also be initialized with the "),gg=s("code"),_0=o("from_tokenizer()"),b0=o(` method, which imports settings
from an existing standard tokenizer object.`),k0=c(),pd=s("p"),y0=o(`In-graph tokenizers, unlike other Hugging Face tokenizers, are actually Keras layers and are designed to be run
when the model is called, rather than during preprocessing. As a result, they have somewhat more limited options
than standard tokenizer classes. They are most useful when you want to create an end-to-end model that goes
straight from `),_g=s("code"),T0=o("tf.string"),v0=o(" inputs to outputs."),w0=c(),cn=s("div"),T(hd.$$.fragment),$0=c(),md=s("p"),F0=o("Instantiate a "),bg=s("code"),x0=o("TFBertTokenizer"),E0=o(" from a pre-trained tokenizer."),B0=c(),T(mr.$$.fragment),z0=c(),pn=s("div"),T(fd.$$.fragment),M0=c(),Wn=s("p"),P0=o("Initialize a "),kg=s("code"),j0=o("TFBertTokenizer"),q0=o(" from an existing "),yg=s("code"),C0=o("Tokenizer"),A0=o("."),N0=c(),T(fr.$$.fragment),xT=c(),Hn=s("h2"),ur=s("a"),Tg=s("span"),T(ud.$$.fragment),O0=c(),vg=s("span"),I0=o("Bert specific outputs"),ET=c(),Rn=s("div"),T(gd.$$.fragment),L0=c(),_d=s("p"),D0=o("Output type of "),af=s("a"),S0=o("BertForPreTraining"),U0=o("."),BT=c(),Kn=s("div"),T(bd.$$.fragment),W0=c(),kd=s("p"),H0=o("Output type of "),lf=s("a"),R0=o("TFBertForPreTraining"),K0=o("."),zT=c(),Io=s("div"),T(yd.$$.fragment),Q0=c(),Td=s("p"),V0=o("Output type of "),df=s("a"),G0=o("BertForPreTraining"),J0=o("."),X0=c(),gr=s("div"),T(vd.$$.fragment),Y0=c(),wg=s("p"),Z0=o("\u201CReturns a new object replacing the specified fields with new values."),MT=c(),Qn=s("h2"),_r=s("a"),$g=s("span"),T(wd.$$.fragment),eE=c(),Fg=s("span"),tE=o("BertModel"),PT=c(),ot=s("div"),T($d.$$.fragment),oE=c(),xg=s("p"),nE=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),sE=c(),Fd=s("p"),rE=o("This model inherits from "),cf=s("a"),aE=o("PreTrainedModel"),iE=o(`. 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.)`),lE=c(),xd=s("p"),dE=o("This model is also a PyTorch "),Ed=s("a"),cE=o("torch.nn.Module"),pE=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),hE=c(),Bd=s("p"),mE=o(`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 `),zd=s("a"),fE=o(`Attention is
all you need`),uE=o(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),gE=c(),mt=s("p"),_E=o("To behave as an decoder the model needs to be initialized with the "),Eg=s("code"),bE=o("is_decoder"),kE=o(` argument of the configuration set
to `),Bg=s("code"),yE=o("True"),TE=o(". To be used in a Seq2Seq model, the model needs to initialized with both "),zg=s("code"),vE=o("is_decoder"),wE=o(` argument and
`),Mg=s("code"),$E=o("add_cross_attention"),FE=o(" set to "),Pg=s("code"),xE=o("True"),EE=o("; an "),jg=s("code"),BE=o("encoder_hidden_states"),zE=o(" is then expected as an input to the forward pass."),ME=c(),ao=s("div"),T(Md.$$.fragment),PE=c(),Vn=s("p"),jE=o("The "),pf=s("a"),qE=o("BertModel"),CE=o(" forward method, overrides the "),qg=s("code"),AE=o("__call__"),NE=o(" special method."),OE=c(),T(br.$$.fragment),IE=c(),T(kr.$$.fragment),jT=c(),Gn=s("h2"),yr=s("a"),Cg=s("span"),T(Pd.$$.fragment),LE=c(),Ag=s("span"),DE=o("BertForPreTraining"),qT=c(),Bt=s("div"),T(jd.$$.fragment),SE=c(),Jn=s("p"),UE=o("Bert Model with two heads on top as done during the pretraining: a "),Ng=s("code"),WE=o("masked language modeling"),HE=o(" head and a "),Og=s("code"),RE=o("next sentence prediction (classification)"),KE=o(" head."),QE=c(),qd=s("p"),VE=o("This model inherits from "),hf=s("a"),GE=o("PreTrainedModel"),JE=o(`. 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.)`),XE=c(),Cd=s("p"),YE=o("This model is also a PyTorch "),Ad=s("a"),ZE=o("torch.nn.Module"),eB=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),tB=c(),io=s("div"),T(Nd.$$.fragment),oB=c(),Xn=s("p"),nB=o("The "),mf=s("a"),sB=o("BertForPreTraining"),rB=o(" forward method, overrides the "),Ig=s("code"),aB=o("__call__"),iB=o(" special method."),lB=c(),T(Tr.$$.fragment),dB=c(),T(vr.$$.fragment),CT=c(),Yn=s("h2"),wr=s("a"),Lg=s("span"),T(Od.$$.fragment),cB=c(),Dg=s("span"),pB=o("BertLMHeadModel"),AT=c(),zt=s("div"),T(Id.$$.fragment),hB=c(),Ld=s("p"),mB=o("Bert Model with a "),Sg=s("code"),fB=o("language modeling"),uB=o(" head on top for CLM fine-tuning."),gB=c(),Dd=s("p"),_B=o("This model inherits from "),ff=s("a"),bB=o("PreTrainedModel"),kB=o(`. 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.)`),yB=c(),Sd=s("p"),TB=o("This model is also a PyTorch "),Ud=s("a"),vB=o("torch.nn.Module"),wB=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),$B=c(),lo=s("div"),T(Wd.$$.fragment),FB=c(),Zn=s("p"),xB=o("The "),uf=s("a"),EB=o("BertLMHeadModel"),BB=o(" forward method, overrides the "),Ug=s("code"),zB=o("__call__"),MB=o(" special method."),PB=c(),T($r.$$.fragment),jB=c(),T(Fr.$$.fragment),NT=c(),es=s("h2"),xr=s("a"),Wg=s("span"),T(Hd.$$.fragment),qB=c(),Hg=s("span"),CB=o("BertForMaskedLM"),OT=c(),Mt=s("div"),T(Rd.$$.fragment),AB=c(),Kd=s("p"),NB=o("Bert Model with a "),Rg=s("code"),OB=o("language modeling"),IB=o(" head on top."),LB=c(),Qd=s("p"),DB=o("This model inherits from "),gf=s("a"),SB=o("PreTrainedModel"),UB=o(`. 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.)`),WB=c(),Vd=s("p"),HB=o("This model is also a PyTorch "),Gd=s("a"),RB=o("torch.nn.Module"),KB=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),QB=c(),co=s("div"),T(Jd.$$.fragment),VB=c(),ts=s("p"),GB=o("The "),_f=s("a"),JB=o("BertForMaskedLM"),XB=o(" forward method, overrides the "),Kg=s("code"),YB=o("__call__"),ZB=o(" special method."),ez=c(),T(Er.$$.fragment),tz=c(),T(Br.$$.fragment),IT=c(),os=s("h2"),zr=s("a"),Qg=s("span"),T(Xd.$$.fragment),oz=c(),Vg=s("span"),nz=o("BertForNextSentencePrediction"),LT=c(),Pt=s("div"),T(Yd.$$.fragment),sz=c(),Zd=s("p"),rz=o("Bert Model with a "),Gg=s("code"),az=o("next sentence prediction (classification)"),iz=o(" head on top."),lz=c(),ec=s("p"),dz=o("This model inherits from "),bf=s("a"),cz=o("PreTrainedModel"),pz=o(`. 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.)`),hz=c(),tc=s("p"),mz=o("This model is also a PyTorch "),oc=s("a"),fz=o("torch.nn.Module"),uz=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),gz=c(),po=s("div"),T(nc.$$.fragment),_z=c(),ns=s("p"),bz=o("The "),kf=s("a"),kz=o("BertForNextSentencePrediction"),yz=o(" forward method, overrides the "),Jg=s("code"),Tz=o("__call__"),vz=o(" special method."),wz=c(),T(Mr.$$.fragment),$z=c(),T(Pr.$$.fragment),DT=c(),ss=s("h2"),jr=s("a"),Xg=s("span"),T(sc.$$.fragment),Fz=c(),Yg=s("span"),xz=o("BertForSequenceClassification"),ST=c(),jt=s("div"),T(rc.$$.fragment),Ez=c(),Zg=s("p"),Bz=o(`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.`),zz=c(),ac=s("p"),Mz=o("This model inherits from "),yf=s("a"),Pz=o("PreTrainedModel"),jz=o(`. 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.)`),qz=c(),ic=s("p"),Cz=o("This model is also a PyTorch "),lc=s("a"),Az=o("torch.nn.Module"),Nz=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Oz=c(),Ot=s("div"),T(dc.$$.fragment),Iz=c(),rs=s("p"),Lz=o("The "),Tf=s("a"),Dz=o("BertForSequenceClassification"),Sz=o(" forward method, overrides the "),e_=s("code"),Uz=o("__call__"),Wz=o(" special method."),Hz=c(),T(qr.$$.fragment),Rz=c(),T(Cr.$$.fragment),Kz=c(),T(Ar.$$.fragment),UT=c(),as=s("h2"),Nr=s("a"),t_=s("span"),T(cc.$$.fragment),Qz=c(),o_=s("span"),Vz=o("BertForMultipleChoice"),WT=c(),qt=s("div"),T(pc.$$.fragment),Gz=c(),n_=s("p"),Jz=o(`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.`),Xz=c(),hc=s("p"),Yz=o("This model inherits from "),vf=s("a"),Zz=o("PreTrainedModel"),eM=o(`. 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.)`),tM=c(),mc=s("p"),oM=o("This model is also a PyTorch "),fc=s("a"),nM=o("torch.nn.Module"),sM=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),rM=c(),ho=s("div"),T(uc.$$.fragment),aM=c(),is=s("p"),iM=o("The "),wf=s("a"),lM=o("BertForMultipleChoice"),dM=o(" forward method, overrides the "),s_=s("code"),cM=o("__call__"),pM=o(" special method."),hM=c(),T(Or.$$.fragment),mM=c(),T(Ir.$$.fragment),HT=c(),ls=s("h2"),Lr=s("a"),r_=s("span"),T(gc.$$.fragment),fM=c(),a_=s("span"),uM=o("BertForTokenClassification"),RT=c(),Ct=s("div"),T(_c.$$.fragment),gM=c(),i_=s("p"),_M=o(`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.`),bM=c(),bc=s("p"),kM=o("This model inherits from "),$f=s("a"),yM=o("PreTrainedModel"),TM=o(`. 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.)`),vM=c(),kc=s("p"),wM=o("This model is also a PyTorch "),yc=s("a"),$M=o("torch.nn.Module"),FM=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xM=c(),mo=s("div"),T(Tc.$$.fragment),EM=c(),ds=s("p"),BM=o("The "),Ff=s("a"),zM=o("BertForTokenClassification"),MM=o(" forward method, overrides the "),l_=s("code"),PM=o("__call__"),jM=o(" special method."),qM=c(),T(Dr.$$.fragment),CM=c(),T(Sr.$$.fragment),KT=c(),cs=s("h2"),Ur=s("a"),d_=s("span"),T(vc.$$.fragment),AM=c(),c_=s("span"),NM=o("BertForQuestionAnswering"),QT=c(),At=s("div"),T(wc.$$.fragment),OM=c(),ps=s("p"),IM=o(`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 `),p_=s("code"),LM=o("span start logits"),DM=o(" and "),h_=s("code"),SM=o("span end logits"),UM=o(")."),WM=c(),$c=s("p"),HM=o("This model inherits from "),xf=s("a"),RM=o("PreTrainedModel"),KM=o(`. 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.)`),QM=c(),Fc=s("p"),VM=o("This model is also a PyTorch "),xc=s("a"),GM=o("torch.nn.Module"),JM=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),XM=c(),fo=s("div"),T(Ec.$$.fragment),YM=c(),hs=s("p"),ZM=o("The "),Ef=s("a"),e4=o("BertForQuestionAnswering"),t4=o(" forward method, overrides the "),m_=s("code"),o4=o("__call__"),n4=o(" special method."),s4=c(),T(Wr.$$.fragment),r4=c(),T(Hr.$$.fragment),VT=c(),ms=s("h2"),Rr=s("a"),f_=s("span"),T(Bc.$$.fragment),a4=c(),u_=s("span"),i4=o("TFBertModel"),GT=c(),ft=s("div"),T(zc.$$.fragment),l4=c(),g_=s("p"),d4=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),c4=c(),Mc=s("p"),p4=o("This model inherits from "),Bf=s("a"),h4=o("TFPreTrainedModel"),m4=o(`. 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.)`),f4=c(),Pc=s("p"),u4=o("This model is also a "),jc=s("a"),g4=o("tf.keras.Model"),_4=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),b4=c(),T(Kr.$$.fragment),k4=c(),uo=s("div"),T(qc.$$.fragment),y4=c(),fs=s("p"),T4=o("The "),zf=s("a"),v4=o("TFBertModel"),w4=o(" forward method, overrides the "),__=s("code"),$4=o("__call__"),F4=o(" special method."),x4=c(),T(Qr.$$.fragment),E4=c(),T(Vr.$$.fragment),JT=c(),us=s("h2"),Gr=s("a"),b_=s("span"),T(Cc.$$.fragment),B4=c(),k_=s("span"),z4=o("TFBertForPreTraining"),XT=c(),ut=s("div"),T(Ac.$$.fragment),M4=c(),gs=s("p"),P4=o(`Bert Model with two heads on top as done during the pretraining:
a `),y_=s("code"),j4=o("masked language modeling"),q4=o(" head and a "),T_=s("code"),C4=o("next sentence prediction (classification)"),A4=o(" head."),N4=c(),Nc=s("p"),O4=o("This model inherits from "),Mf=s("a"),I4=o("TFPreTrainedModel"),L4=o(`. 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.)`),D4=c(),Oc=s("p"),S4=o("This model is also a "),Ic=s("a"),U4=o("tf.keras.Model"),W4=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),H4=c(),T(Jr.$$.fragment),R4=c(),go=s("div"),T(Lc.$$.fragment),K4=c(),_s=s("p"),Q4=o("The "),Pf=s("a"),V4=o("TFBertForPreTraining"),G4=o(" forward method, overrides the "),v_=s("code"),J4=o("__call__"),X4=o(" special method."),Y4=c(),T(Xr.$$.fragment),Z4=c(),T(Yr.$$.fragment),YT=c(),bs=s("h2"),Zr=s("a"),w_=s("span"),T(Dc.$$.fragment),eP=c(),$_=s("span"),tP=o("TFBertModelLMHeadModel"),ZT=c(),ks=s("div"),T(Sc.$$.fragment),oP=c(),It=s("div"),T(Uc.$$.fragment),nP=c(),nt=s("p"),sP=o("encoder_hidden_states  ("),F_=s("code"),rP=o("tf.Tensor"),aP=o(" of shape "),x_=s("code"),iP=o("(batch_size, sequence_length, hidden_size)"),lP=o(", "),E_=s("em"),dP=o("optional"),cP=o(`):
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.
encoder_attention_mask (`),B_=s("code"),pP=o("tf.Tensor"),hP=o(" of shape "),z_=s("code"),mP=o("(batch_size, sequence_length)"),fP=o(", "),M_=s("em"),uP=o("optional"),gP=o(`):
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in `),P_=s("code"),_P=o("[0, 1]"),bP=o(":"),kP=c(),Wc=s("ul"),Hc=s("li"),yP=o("1 for tokens that are "),j_=s("strong"),TP=o("not masked"),vP=o(","),wP=c(),Rc=s("li"),$P=o("0 for tokens that are "),q_=s("strong"),FP=o("masked"),xP=o("."),EP=c(),ee=s("p"),BP=o("past_key_values ("),C_=s("code"),zP=o("Tuple[Tuple[tf.Tensor]]"),MP=o(" of length "),A_=s("code"),PP=o("config.n_layers"),jP=o(`)
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),N_=s("code"),qP=o("past_key_values"),CP=o(" are used, the user can optionally input only the last "),O_=s("code"),AP=o("decoder_input_ids"),NP=o(` (those that
don\u2019t have their past key value states given to this model) of shape `),I_=s("code"),OP=o("(batch_size, 1)"),IP=o(` instead of all
`),L_=s("code"),LP=o("decoder_input_ids"),DP=o(" of shape "),D_=s("code"),SP=o("(batch_size, sequence_length)"),UP=o(`.
use_cache (`),S_=s("code"),WP=o("bool"),HP=o(", "),U_=s("em"),RP=o("optional"),KP=o(", defaults to "),W_=s("code"),QP=o("True"),VP=o(`):
If set to `),H_=s("code"),GP=o("True"),JP=o(", "),R_=s("code"),XP=o("past_key_values"),YP=o(` key value states are returned and can be used to speed up decoding (see
`),K_=s("code"),ZP=o("past_key_values"),ej=o("). Set to "),Q_=s("code"),tj=o("False"),oj=o(" during training, "),V_=s("code"),nj=o("True"),sj=o(` during generation
labels (`),G_=s("code"),rj=o("tf.Tensor"),aj=o(" or "),J_=s("code"),ij=o("np.ndarray"),lj=o(" of shape "),X_=s("code"),dj=o("(batch_size, sequence_length)"),cj=o(", "),Y_=s("em"),pj=o("optional"),hj=o(`):
Labels for computing the cross entropy classification loss. Indices should be in `),Z_=s("code"),mj=o("[0, ..., config.vocab_size - 1]"),fj=o("."),uj=c(),T(ea.$$.fragment),ev=c(),ys=s("h2"),ta=s("a"),eb=s("span"),T(Kc.$$.fragment),gj=c(),tb=s("span"),_j=o("TFBertForMaskedLM"),tv=c(),gt=s("div"),T(Qc.$$.fragment),bj=c(),Vc=s("p"),kj=o("Bert Model with a "),ob=s("code"),yj=o("language modeling"),Tj=o(" head on top."),vj=c(),Gc=s("p"),wj=o("This model inherits from "),jf=s("a"),$j=o("TFPreTrainedModel"),Fj=o(`. 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.)`),xj=c(),Jc=s("p"),Ej=o("This model is also a "),Xc=s("a"),Bj=o("tf.keras.Model"),zj=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Mj=c(),T(oa.$$.fragment),Pj=c(),Lt=s("div"),T(Yc.$$.fragment),jj=c(),Ts=s("p"),qj=o("The "),qf=s("a"),Cj=o("TFBertForMaskedLM"),Aj=o(" forward method, overrides the "),nb=s("code"),Nj=o("__call__"),Oj=o(" special method."),Ij=c(),T(na.$$.fragment),Lj=c(),T(sa.$$.fragment),Dj=c(),T(ra.$$.fragment),ov=c(),vs=s("h2"),aa=s("a"),sb=s("span"),T(Zc.$$.fragment),Sj=c(),rb=s("span"),Uj=o("TFBertForNextSentencePrediction"),nv=c(),_t=s("div"),T(ep.$$.fragment),Wj=c(),tp=s("p"),Hj=o("Bert Model with a "),ab=s("code"),Rj=o("next sentence prediction (classification)"),Kj=o(" head on top."),Qj=c(),op=s("p"),Vj=o("This model inherits from "),Cf=s("a"),Gj=o("TFPreTrainedModel"),Jj=o(`. 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.)`),Xj=c(),np=s("p"),Yj=o("This model is also a "),sp=s("a"),Zj=o("tf.keras.Model"),eq=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),tq=c(),T(ia.$$.fragment),oq=c(),_o=s("div"),T(rp.$$.fragment),nq=c(),ws=s("p"),sq=o("The "),Af=s("a"),rq=o("TFBertForNextSentencePrediction"),aq=o(" forward method, overrides the "),ib=s("code"),iq=o("__call__"),lq=o(" special method."),dq=c(),T(la.$$.fragment),cq=c(),T(da.$$.fragment),sv=c(),$s=s("h2"),ca=s("a"),lb=s("span"),T(ap.$$.fragment),pq=c(),db=s("span"),hq=o("TFBertForSequenceClassification"),rv=c(),bt=s("div"),T(ip.$$.fragment),mq=c(),cb=s("p"),fq=o(`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.`),uq=c(),lp=s("p"),gq=o("This model inherits from "),Nf=s("a"),_q=o("TFPreTrainedModel"),bq=o(`. 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.)`),kq=c(),dp=s("p"),yq=o("This model is also a "),cp=s("a"),Tq=o("tf.keras.Model"),vq=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),wq=c(),T(pa.$$.fragment),$q=c(),Dt=s("div"),T(pp.$$.fragment),Fq=c(),Fs=s("p"),xq=o("The "),Of=s("a"),Eq=o("TFBertForSequenceClassification"),Bq=o(" forward method, overrides the "),pb=s("code"),zq=o("__call__"),Mq=o(" special method."),Pq=c(),T(ha.$$.fragment),jq=c(),T(ma.$$.fragment),qq=c(),T(fa.$$.fragment),av=c(),xs=s("h2"),ua=s("a"),hb=s("span"),T(hp.$$.fragment),Cq=c(),mb=s("span"),Aq=o("TFBertForMultipleChoice"),iv=c(),kt=s("div"),T(mp.$$.fragment),Nq=c(),fb=s("p"),Oq=o(`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.`),Iq=c(),fp=s("p"),Lq=o("This model inherits from "),If=s("a"),Dq=o("TFPreTrainedModel"),Sq=o(`. 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.)`),Uq=c(),up=s("p"),Wq=o("This model is also a "),gp=s("a"),Hq=o("tf.keras.Model"),Rq=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Kq=c(),T(ga.$$.fragment),Qq=c(),bo=s("div"),T(_p.$$.fragment),Vq=c(),Es=s("p"),Gq=o("The "),Lf=s("a"),Jq=o("TFBertForMultipleChoice"),Xq=o(" forward method, overrides the "),ub=s("code"),Yq=o("__call__"),Zq=o(" special method."),e3=c(),T(_a.$$.fragment),t3=c(),T(ba.$$.fragment),lv=c(),Bs=s("h2"),ka=s("a"),gb=s("span"),T(bp.$$.fragment),o3=c(),_b=s("span"),n3=o("TFBertForTokenClassification"),dv=c(),yt=s("div"),T(kp.$$.fragment),s3=c(),bb=s("p"),r3=o(`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.`),a3=c(),yp=s("p"),i3=o("This model inherits from "),Df=s("a"),l3=o("TFPreTrainedModel"),d3=o(`. 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.)`),c3=c(),Tp=s("p"),p3=o("This model is also a "),vp=s("a"),h3=o("tf.keras.Model"),m3=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),f3=c(),T(ya.$$.fragment),u3=c(),St=s("div"),T(wp.$$.fragment),g3=c(),zs=s("p"),_3=o("The "),Sf=s("a"),b3=o("TFBertForTokenClassification"),k3=o(" forward method, overrides the "),kb=s("code"),y3=o("__call__"),T3=o(" special method."),v3=c(),T(Ta.$$.fragment),w3=c(),T(va.$$.fragment),$3=c(),T(wa.$$.fragment),cv=c(),Ms=s("h2"),$a=s("a"),yb=s("span"),T($p.$$.fragment),F3=c(),Tb=s("span"),x3=o("TFBertForQuestionAnswering"),pv=c(),Tt=s("div"),T(Fp.$$.fragment),E3=c(),Ps=s("p"),B3=o(`Bert Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layer on top of the hidden-states output to compute `),vb=s("code"),z3=o("span start logits"),M3=o(" and "),wb=s("code"),P3=o("span end logits"),j3=o(")."),q3=c(),xp=s("p"),C3=o("This model inherits from "),Uf=s("a"),A3=o("TFPreTrainedModel"),N3=o(`. 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.)`),O3=c(),Ep=s("p"),I3=o("This model is also a "),Bp=s("a"),L3=o("tf.keras.Model"),D3=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),S3=c(),T(Fa.$$.fragment),U3=c(),Ut=s("div"),T(zp.$$.fragment),W3=c(),js=s("p"),H3=o("The "),Wf=s("a"),R3=o("TFBertForQuestionAnswering"),K3=o(" forward method, overrides the "),$b=s("code"),Q3=o("__call__"),V3=o(" special method."),G3=c(),T(xa.$$.fragment),J3=c(),T(Ea.$$.fragment),X3=c(),T(Ba.$$.fragment),hv=c(),qs=s("h2"),za=s("a"),Fb=s("span"),T(Mp.$$.fragment),Y3=c(),xb=s("span"),Z3=o("FlaxBertModel"),mv=c(),st=s("div"),T(Pp.$$.fragment),eC=c(),Eb=s("p"),tC=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),oC=c(),jp=s("p"),nC=o("This model inherits from "),Hf=s("a"),sC=o("FlaxPreTrainedModel"),rC=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),aC=c(),qp=s("p"),iC=o("This model is also a Flax Linen "),Cp=s("a"),lC=o("flax.linen.Module"),dC=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),cC=c(),Bb=s("p"),pC=o("Finally, this model supports inherent JAX features such as:"),hC=c(),Lo=s("ul"),zb=s("li"),Ap=s("a"),mC=o("Just-In-Time (JIT) compilation"),fC=c(),Mb=s("li"),Np=s("a"),uC=o("Automatic Differentiation"),gC=c(),Pb=s("li"),Op=s("a"),_C=o("Vectorization"),bC=c(),jb=s("li"),Ip=s("a"),kC=o("Parallelization"),yC=c(),ko=s("div"),T(Lp.$$.fragment),TC=c(),Cs=s("p"),vC=o("The "),qb=s("code"),wC=o("FlaxBertPreTrainedModel"),$C=o(" forward method, overrides the "),Cb=s("code"),FC=o("__call__"),xC=o(" special method."),EC=c(),T(Ma.$$.fragment),BC=c(),T(Pa.$$.fragment),fv=c(),As=s("h2"),ja=s("a"),Ab=s("span"),T(Dp.$$.fragment),zC=c(),Nb=s("span"),MC=o("FlaxBertForPreTraining"),uv=c(),rt=s("div"),T(Sp.$$.fragment),PC=c(),Ns=s("p"),jC=o("Bert Model with two heads on top as done during the pretraining: a "),Ob=s("code"),qC=o("masked language modeling"),CC=o(" head and a "),Ib=s("code"),AC=o("next sentence prediction (classification)"),NC=o(" head."),OC=c(),Up=s("p"),IC=o("This model inherits from "),Rf=s("a"),LC=o("FlaxPreTrainedModel"),DC=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),SC=c(),Wp=s("p"),UC=o("This model is also a Flax Linen "),Hp=s("a"),WC=o("flax.linen.Module"),HC=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),RC=c(),Lb=s("p"),KC=o("Finally, this model supports inherent JAX features such as:"),QC=c(),Do=s("ul"),Db=s("li"),Rp=s("a"),VC=o("Just-In-Time (JIT) compilation"),GC=c(),Sb=s("li"),Kp=s("a"),JC=o("Automatic Differentiation"),XC=c(),Ub=s("li"),Qp=s("a"),YC=o("Vectorization"),ZC=c(),Wb=s("li"),Vp=s("a"),e6=o("Parallelization"),t6=c(),yo=s("div"),T(Gp.$$.fragment),o6=c(),Os=s("p"),n6=o("The "),Hb=s("code"),s6=o("FlaxBertPreTrainedModel"),r6=o(" forward method, overrides the "),Rb=s("code"),a6=o("__call__"),i6=o(" special method."),l6=c(),T(qa.$$.fragment),d6=c(),T(Ca.$$.fragment),gv=c(),Is=s("h2"),Aa=s("a"),Kb=s("span"),T(Jp.$$.fragment),c6=c(),Qb=s("span"),p6=o("FlaxBertForCausalLM"),_v=c(),at=s("div"),T(Xp.$$.fragment),h6=c(),Vb=s("p"),m6=o(`Bert Model with a language modeling head on top (a linear layer on top of the hidden-states output) e.g for
autoregressive tasks.`),f6=c(),Yp=s("p"),u6=o("This model inherits from "),Kf=s("a"),g6=o("FlaxPreTrainedModel"),_6=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),b6=c(),Zp=s("p"),k6=o("This model is also a Flax Linen "),eh=s("a"),y6=o("flax.linen.Module"),T6=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),v6=c(),Gb=s("p"),w6=o("Finally, this model supports inherent JAX features such as:"),$6=c(),So=s("ul"),Jb=s("li"),th=s("a"),F6=o("Just-In-Time (JIT) compilation"),x6=c(),Xb=s("li"),oh=s("a"),E6=o("Automatic Differentiation"),B6=c(),Yb=s("li"),nh=s("a"),z6=o("Vectorization"),M6=c(),Zb=s("li"),sh=s("a"),P6=o("Parallelization"),j6=c(),To=s("div"),T(rh.$$.fragment),q6=c(),Ls=s("p"),C6=o("The "),ek=s("code"),A6=o("FlaxBertPreTrainedModel"),N6=o(" forward method, overrides the "),tk=s("code"),O6=o("__call__"),I6=o(" special method."),L6=c(),T(Na.$$.fragment),D6=c(),T(Oa.$$.fragment),bv=c(),Ds=s("h2"),Ia=s("a"),ok=s("span"),T(ah.$$.fragment),S6=c(),nk=s("span"),U6=o("FlaxBertForMaskedLM"),kv=c(),it=s("div"),T(ih.$$.fragment),W6=c(),lh=s("p"),H6=o("Bert Model with a "),sk=s("code"),R6=o("language modeling"),K6=o(" head on top."),Q6=c(),dh=s("p"),V6=o("This model inherits from "),Qf=s("a"),G6=o("FlaxPreTrainedModel"),J6=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),X6=c(),ch=s("p"),Y6=o("This model is also a Flax Linen "),ph=s("a"),Z6=o("flax.linen.Module"),e5=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),t5=c(),rk=s("p"),o5=o("Finally, this model supports inherent JAX features such as:"),n5=c(),Uo=s("ul"),ak=s("li"),hh=s("a"),s5=o("Just-In-Time (JIT) compilation"),r5=c(),ik=s("li"),mh=s("a"),a5=o("Automatic Differentiation"),i5=c(),lk=s("li"),fh=s("a"),l5=o("Vectorization"),d5=c(),dk=s("li"),uh=s("a"),c5=o("Parallelization"),p5=c(),vo=s("div"),T(gh.$$.fragment),h5=c(),Ss=s("p"),m5=o("The "),ck=s("code"),f5=o("FlaxBertPreTrainedModel"),u5=o(" forward method, overrides the "),pk=s("code"),g5=o("__call__"),_5=o(" special method."),b5=c(),T(La.$$.fragment),k5=c(),T(Da.$$.fragment),yv=c(),Us=s("h2"),Sa=s("a"),hk=s("span"),T(_h.$$.fragment),y5=c(),mk=s("span"),T5=o("FlaxBertForNextSentencePrediction"),Tv=c(),lt=s("div"),T(bh.$$.fragment),v5=c(),kh=s("p"),w5=o("Bert Model with a "),fk=s("code"),$5=o("next sentence prediction (classification)"),F5=o(" head on top."),x5=c(),yh=s("p"),E5=o("This model inherits from "),Vf=s("a"),B5=o("FlaxPreTrainedModel"),z5=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),M5=c(),Th=s("p"),P5=o("This model is also a Flax Linen "),vh=s("a"),j5=o("flax.linen.Module"),q5=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),C5=c(),uk=s("p"),A5=o("Finally, this model supports inherent JAX features such as:"),N5=c(),Wo=s("ul"),gk=s("li"),wh=s("a"),O5=o("Just-In-Time (JIT) compilation"),I5=c(),_k=s("li"),$h=s("a"),L5=o("Automatic Differentiation"),D5=c(),bk=s("li"),Fh=s("a"),S5=o("Vectorization"),U5=c(),kk=s("li"),xh=s("a"),W5=o("Parallelization"),H5=c(),wo=s("div"),T(Eh.$$.fragment),R5=c(),Ws=s("p"),K5=o("The "),yk=s("code"),Q5=o("FlaxBertPreTrainedModel"),V5=o(" forward method, overrides the "),Tk=s("code"),G5=o("__call__"),J5=o(" special method."),X5=c(),T(Ua.$$.fragment),Y5=c(),T(Wa.$$.fragment),vv=c(),Hs=s("h2"),Ha=s("a"),vk=s("span"),T(Bh.$$.fragment),Z5=c(),wk=s("span"),eA=o("FlaxBertForSequenceClassification"),wv=c(),dt=s("div"),T(zh.$$.fragment),tA=c(),$k=s("p"),oA=o(`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.`),nA=c(),Mh=s("p"),sA=o("This model inherits from "),Gf=s("a"),rA=o("FlaxPreTrainedModel"),aA=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),iA=c(),Ph=s("p"),lA=o("This model is also a Flax Linen "),jh=s("a"),dA=o("flax.linen.Module"),cA=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),pA=c(),Fk=s("p"),hA=o("Finally, this model supports inherent JAX features such as:"),mA=c(),Ho=s("ul"),xk=s("li"),qh=s("a"),fA=o("Just-In-Time (JIT) compilation"),uA=c(),Ek=s("li"),Ch=s("a"),gA=o("Automatic Differentiation"),_A=c(),Bk=s("li"),Ah=s("a"),bA=o("Vectorization"),kA=c(),zk=s("li"),Nh=s("a"),yA=o("Parallelization"),TA=c(),$o=s("div"),T(Oh.$$.fragment),vA=c(),Rs=s("p"),wA=o("The "),Mk=s("code"),$A=o("FlaxBertPreTrainedModel"),FA=o(" forward method, overrides the "),Pk=s("code"),xA=o("__call__"),EA=o(" special method."),BA=c(),T(Ra.$$.fragment),zA=c(),T(Ka.$$.fragment),$v=c(),Ks=s("h2"),Qa=s("a"),jk=s("span"),T(Ih.$$.fragment),MA=c(),qk=s("span"),PA=o("FlaxBertForMultipleChoice"),Fv=c(),ct=s("div"),T(Lh.$$.fragment),jA=c(),Ck=s("p"),qA=o(`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.`),CA=c(),Dh=s("p"),AA=o("This model inherits from "),Jf=s("a"),NA=o("FlaxPreTrainedModel"),OA=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),IA=c(),Sh=s("p"),LA=o("This model is also a Flax Linen "),Uh=s("a"),DA=o("flax.linen.Module"),SA=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),UA=c(),Ak=s("p"),WA=o("Finally, this model supports inherent JAX features such as:"),HA=c(),Ro=s("ul"),Nk=s("li"),Wh=s("a"),RA=o("Just-In-Time (JIT) compilation"),KA=c(),Ok=s("li"),Hh=s("a"),QA=o("Automatic Differentiation"),VA=c(),Ik=s("li"),Rh=s("a"),GA=o("Vectorization"),JA=c(),Lk=s("li"),Kh=s("a"),XA=o("Parallelization"),YA=c(),Fo=s("div"),T(Qh.$$.fragment),ZA=c(),Qs=s("p"),e7=o("The "),Dk=s("code"),t7=o("FlaxBertPreTrainedModel"),o7=o(" forward method, overrides the "),Sk=s("code"),n7=o("__call__"),s7=o(" special method."),r7=c(),T(Va.$$.fragment),a7=c(),T(Ga.$$.fragment),xv=c(),Vs=s("h2"),Ja=s("a"),Uk=s("span"),T(Vh.$$.fragment),i7=c(),Wk=s("span"),l7=o("FlaxBertForTokenClassification"),Ev=c(),pt=s("div"),T(Gh.$$.fragment),d7=c(),Hk=s("p"),c7=o(`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.`),p7=c(),Jh=s("p"),h7=o("This model inherits from "),Xf=s("a"),m7=o("FlaxPreTrainedModel"),f7=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),u7=c(),Xh=s("p"),g7=o("This model is also a Flax Linen "),Yh=s("a"),_7=o("flax.linen.Module"),b7=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),k7=c(),Rk=s("p"),y7=o("Finally, this model supports inherent JAX features such as:"),T7=c(),Ko=s("ul"),Kk=s("li"),Zh=s("a"),v7=o("Just-In-Time (JIT) compilation"),w7=c(),Qk=s("li"),em=s("a"),$7=o("Automatic Differentiation"),F7=c(),Vk=s("li"),tm=s("a"),x7=o("Vectorization"),E7=c(),Gk=s("li"),om=s("a"),B7=o("Parallelization"),z7=c(),xo=s("div"),T(nm.$$.fragment),M7=c(),Gs=s("p"),P7=o("The "),Jk=s("code"),j7=o("FlaxBertPreTrainedModel"),q7=o(" forward method, overrides the "),Xk=s("code"),C7=o("__call__"),A7=o(" special method."),N7=c(),T(Xa.$$.fragment),O7=c(),T(Ya.$$.fragment),Bv=c(),Js=s("h2"),Za=s("a"),Yk=s("span"),T(sm.$$.fragment),I7=c(),Zk=s("span"),L7=o("FlaxBertForQuestionAnswering"),zv=c(),ht=s("div"),T(rm.$$.fragment),D7=c(),Xs=s("p"),S7=o(`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 `),ey=s("code"),U7=o("span start logits"),W7=o(" and "),ty=s("code"),H7=o("span end logits"),R7=o(")."),K7=c(),am=s("p"),Q7=o("This model inherits from "),Yf=s("a"),V7=o("FlaxPreTrainedModel"),G7=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),J7=c(),im=s("p"),X7=o("This model is also a Flax Linen "),lm=s("a"),Y7=o("flax.linen.Module"),Z7=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),e8=c(),oy=s("p"),t8=o("Finally, this model supports inherent JAX features such as:"),o8=c(),Qo=s("ul"),ny=s("li"),dm=s("a"),n8=o("Just-In-Time (JIT) compilation"),s8=c(),sy=s("li"),cm=s("a"),r8=o("Automatic Differentiation"),a8=c(),ry=s("li"),pm=s("a"),i8=o("Vectorization"),l8=c(),ay=s("li"),hm=s("a"),d8=o("Parallelization"),c8=c(),Eo=s("div"),T(mm.$$.fragment),p8=c(),Ys=s("p"),h8=o("The "),iy=s("code"),m8=o("FlaxBertPreTrainedModel"),f8=o(" forward method, overrides the "),ly=s("code"),u8=o("__call__"),g8=o(" special method."),_8=c(),T(ei.$$.fragment),b8=c(),T(ti.$$.fragment),this.h()},l(i){const _=kU('[data-svelte="svelte-1phssyn"]',document.head);d=r(_,"META",{name:!0,content:!0}),_.forEach(t),k=p(i),f=r(i,"H1",{class:!0});var fm=a(f);u=r(fm,"A",{id:!0,class:!0,href:!0});var dy=a(u);b=r(dy,"SPAN",{});var cy=a(b);v(l.$$.fragment,cy),cy.forEach(t),dy.forEach(t),m=p(fm),z=r(fm,"SPAN",{});var py=a(z);Fe=n(py,"BERT"),py.forEach(t),fm.forEach(t),ye=p(i),S=r(i,"H2",{class:!0});var um=a(S);le=r(um,"A",{id:!0,class:!0,href:!0});var hy=a(le);Z=r(hy,"SPAN",{});var my=a(Z);v(B.$$.fragment,my),my.forEach(t),hy.forEach(t),xe=p(um),Q=r(um,"SPAN",{});var fy=a(Q);Ee=n(fy,"Overview"),fy.forEach(t),um.forEach(t),Te=p(i),U=r(i,"P",{});var gm=a(U);Be=n(gm,"The BERT model was proposed in "),ce=r(gm,"A",{href:!0,rel:!0});var uy=a(ce);X=n(uy,"BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding"),uy.forEach(t),ze=n(gm,` by Jacob Devlin, Ming-Wei Chang, Kenton Lee and Kristina Toutanova. It\u2019s a
bidirectional transformer pretrained using a combination of masked language modeling objective and next sentence
prediction on a large corpus comprising the Toronto Book Corpus and Wikipedia.`),gm.forEach(t),ve=p(i),R=r(i,"P",{});var gy=a(R);Me=n(gy,"The abstract from the paper is the following:"),gy.forEach(t),we=p(i),K=r(i,"P",{});var _y=a(K);fe=r(_y,"EM",{});var by=a(fe);Pe=n(by,`We introduce a new language representation model called BERT, which stands for Bidirectional Encoder Representations
from Transformers. Unlike recent language representation models, BERT is designed to pre-train deep bidirectional
representations from unlabeled text by jointly conditioning on both left and right context in all layers. As a result,
the pre-trained BERT model can be fine-tuned with just one additional output layer to create state-of-the-art models
for a wide range of tasks, such as question answering and language inference, without substantial task-specific
architecture modifications.`),by.forEach(t),_y.forEach(t),te=p(i),j=r(i,"P",{});var ky=a(j);q=r(ky,"EM",{});var yy=a(q);je=n(yy,`BERT is conceptually simple and empirically powerful. It obtains new state-of-the-art results on eleven natural
language processing tasks, including pushing the GLUE score to 80.5% (7.7% point absolute improvement), MultiNLI
accuracy to 86.7% (4.6% absolute improvement), SQuAD v1.1 question answering Test F1 to 93.2 (1.5 point absolute
improvement) and SQuAD v2.0 Test F1 to 83.1 (5.1 point absolute improvement).`),yy.forEach(t),ky.forEach(t),G=p(i),me=r(i,"P",{});var Ty=a(me);qe=n(Ty,"Tips:"),Ty.forEach(t),J=p(i),de=r(i,"UL",{});var _m=a(de);ue=r(_m,"LI",{});var vy=a(ue);A=n(vy,`BERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),vy.forEach(t),Ce=p(_m),V=r(_m,"LI",{});var wy=a(V);Ae=n(wy,`BERT was trained with the masked language modeling (MLM) and next sentence prediction (NSP) objectives. It is
efficient at predicting masked tokens and at NLU in general, but is not optimal for text generation.`),wy.forEach(t),_m.forEach(t),$e=p(i),D=r(i,"P",{});var Zs=a(D);Ne=n(Zs,"This model was contributed by "),pe=r(Zs,"A",{href:!0,rel:!0});var $y=a(pe);L=n($y,"thomwolf"),$y.forEach(t),Oe=n(Zs,". The original code can be found "),W=r(Zs,"A",{href:!0,rel:!0});var Fy=a(W);Ie=n(Fy,"here"),Fy.forEach(t),ne=n(Zs,"."),Zs.forEach(t),C=p(i),ie=r(i,"H2",{class:!0});var bm=a(ie);N=r(bm,"A",{id:!0,class:!0,href:!0});var xy=a(N);ge=r(xy,"SPAN",{});var Ey=a(ge);v(he.$$.fragment,Ey),Ey.forEach(t),xy.forEach(t),y=p(bm),M=r(bm,"SPAN",{});var By=a(M);Ve=n(By,"Resources"),By.forEach(t),bm.forEach(t),oe=p(i),Ke=r(i,"P",{});var zy=a(Ke);Ge=n(zy,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with BERT. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),zy.forEach(t),P=p(i),v(Ue.$$.fragment,i),Qe=p(i),re=r(i,"UL",{});var vt=a(re);We=r(vt,"LI",{});var km=a(We);Je=n(km,"A blog post on "),I=r(km,"A",{href:!0,rel:!0});var My=a(I);Y=n(My,"BERT Text Classification in a different language"),My.forEach(t),Xe=n(km,"."),km.forEach(t),Ye=p(vt),H=r(vt,"LI",{});var ym=a(H);Ze=n(ym,"A notebook for "),He=r(ym,"A",{href:!0,rel:!0});var Py=a(He);Le=n(Py,"Finetuning BERT (and friends) for multi-label text classification"),Py.forEach(t),et=n(ym,"."),ym.forEach(t),se=p(vt),Re=r(vt,"LI",{});var Tm=a(Re);Kw=n(Tm,"A notebook on how to "),Ii=r(Tm,"A",{href:!0,rel:!0});var jy=a(Ii);Qw=n(jy,"Finetune BERT for multi-label classification using PyTorch"),jy.forEach(t),Vw=n(Tm,". \u{1F30E}"),Tm.forEach(t),Gw=p(vt),Li=r(vt,"LI",{});var vm=a(Li);Jw=n(vm,"A notebook on how to "),Di=r(vm,"A",{href:!0,rel:!0});var qy=a(Di);Xw=n(qy,"warm-start an EncoderDecoder model with BERT for summarization"),qy.forEach(t),Yw=n(vm,"."),vm.forEach(t),Zw=p(vt),Go=r(vt,"LI",{});var hn=a(Go);Mm=r(hn,"A",{href:!0});var Cy=a(Mm);e$=n(Cy,"BertForSequenceClassification"),Cy.forEach(t),t$=n(hn," is supported by this "),Si=r(hn,"A",{href:!0,rel:!0});var Ay=a(Si);o$=n(Ay,"example script"),Ay.forEach(t),n$=n(hn," and "),Ui=r(hn,"A",{href:!0,rel:!0});var Ny=a(Ui);s$=n(Ny,"notebook"),Ny.forEach(t),r$=n(hn,"."),hn.forEach(t),a$=p(vt),Jo=r(vt,"LI",{});var mn=a(Jo);Pm=r(mn,"A",{href:!0});var Oy=a(Pm);i$=n(Oy,"TFBertForSequenceClassification"),Oy.forEach(t),l$=n(mn," is supported by this "),Wi=r(mn,"A",{href:!0,rel:!0});var Iy=a(Wi);d$=n(Iy,"example script"),Iy.forEach(t),c$=n(mn," and "),Hi=r(mn,"A",{href:!0,rel:!0});var Ly=a(Hi);p$=n(Ly,"notebook"),Ly.forEach(t),h$=n(mn,"."),mn.forEach(t),m$=p(vt),Xo=r(vt,"LI",{});var fn=a(Xo);jm=r(fn,"A",{href:!0});var Dy=a(jm);f$=n(Dy,"FlaxBertForSequenceClassification"),Dy.forEach(t),u$=n(fn," is supported by this "),Ri=r(fn,"A",{href:!0,rel:!0});var Sy=a(Ri);g$=n(Sy,"example script"),Sy.forEach(t),_$=n(fn," and "),Ki=r(fn,"A",{href:!0,rel:!0});var Uy=a(Ki);b$=n(Uy,"notebook"),Uy.forEach(t),k$=n(fn,"."),fn.forEach(t),vt.forEach(t),sT=p(i),v(Qi.$$.fragment,i),rT=p(i),wt=r(i,"UL",{});var Nt=a(wt);Vi=r(Nt,"LI",{});var wm=a(Vi);y$=n(wm,"A blog post on how to use "),Gi=r(wm,"A",{href:!0,rel:!0});var Wy=a(Gi);T$=n(Wy,"Hugging Face Transformers with Keras: Fine-tune a non-English BERT for Named Entity Recognition"),Wy.forEach(t),v$=n(wm,"."),wm.forEach(t),w$=p(Nt),Cn=r(Nt,"LI",{});var er=a(Cn);$$=n(er,"A notebook for "),Ji=r(er,"A",{href:!0,rel:!0});var Hy=a(Ji);F$=n(Hy,"Finetuning BERT for named-entity recognition"),Hy.forEach(t),x$=n(er," using only the first wordpiece of each word in the word label during tokenization. To propagate the label of the word to all wordpieces, see this "),Xi=r(er,"A",{href:!0,rel:!0});var Ry=a(Xi);E$=n(Ry,"version"),Ry.forEach(t),B$=n(er," of the notebook instead."),er.forEach(t),z$=p(Nt),Yo=r(Nt,"LI",{});var un=a(Yo);qm=r(un,"A",{href:!0});var Ky=a(qm);M$=n(Ky,"BertForTokenClassification"),Ky.forEach(t),P$=n(un," is supported by this "),Yi=r(un,"A",{href:!0,rel:!0});var Qy=a(Yi);j$=n(Qy,"example script"),Qy.forEach(t),q$=n(un," and "),Zi=r(un,"A",{href:!0,rel:!0});var Vy=a(Zi);C$=n(Vy,"notebook"),Vy.forEach(t),A$=n(un,"."),un.forEach(t),N$=p(Nt),Zo=r(Nt,"LI",{});var gn=a(Zo);Cm=r(gn,"A",{href:!0});var Gy=a(Cm);O$=n(Gy,"TFBertForTokenClassification"),Gy.forEach(t),I$=n(gn," is supported by this "),el=r(gn,"A",{href:!0,rel:!0});var Jy=a(el);L$=n(Jy,"example script"),Jy.forEach(t),D$=n(gn," and "),tl=r(gn,"A",{href:!0,rel:!0});var Xy=a(tl);S$=n(Xy,"notebook"),Xy.forEach(t),U$=n(gn,"."),gn.forEach(t),W$=p(Nt),tr=r(Nt,"LI",{});var oi=a(tr);Am=r(oi,"A",{href:!0});var Yy=a(Am);H$=n(Yy,"FlaxBertForTokenClassification"),Yy.forEach(t),R$=n(oi," is supported by this "),ol=r(oi,"A",{href:!0,rel:!0});var Zy=a(ol);K$=n(Zy,"example script"),Zy.forEach(t),Q$=n(oi,"."),oi.forEach(t),V$=p(Nt),Nm=r(Nt,"LI",{});var Zf=a(Nm);nl=r(Zf,"A",{href:!0,rel:!0});var eT=a(nl);G$=n(eT,"Token classification"),eT.forEach(t),J$=n(Zf," chapter of the \u{1F917} Hugging Face Course."),Zf.forEach(t),Nt.forEach(t),aT=p(i),v(sl.$$.fragment,i),iT=p(i),oo=r(i,"UL",{});var Vo=a(oo);en=r(Vo,"LI",{});var _n=a(en);Om=r(_n,"A",{href:!0});var tT=a(Om);X$=n(tT,"BertForMaskedLM"),tT.forEach(t),Y$=n(_n," is supported by this "),rl=r(_n,"A",{href:!0,rel:!0});var oT=a(rl);Z$=n(oT,"example script"),oT.forEach(t),e2=n(_n," and "),al=r(_n,"A",{href:!0,rel:!0});var B8=a(al);t2=n(B8,"notebook"),B8.forEach(t),o2=n(_n,"."),_n.forEach(t),n2=p(Vo),tn=r(Vo,"LI",{});var $m=a(tn);Im=r($m,"A",{href:!0});var z8=a(Im);s2=n(z8,"TFBertForMaskedLM"),z8.forEach(t),r2=n($m," is supported by this "),il=r($m,"A",{href:!0,rel:!0});var M8=a(il);a2=n(M8,"example script"),M8.forEach(t),i2=n($m," and "),ll=r($m,"A",{href:!0,rel:!0});var P8=a(ll);l2=n(P8,"notebook"),P8.forEach(t),d2=n($m,"."),$m.forEach(t),c2=p(Vo),on=r(Vo,"LI",{});var Fm=a(on);Lm=r(Fm,"A",{href:!0});var j8=a(Lm);p2=n(j8,"FlaxBertForMaskedLM"),j8.forEach(t),h2=n(Fm," is supported by this "),dl=r(Fm,"A",{href:!0,rel:!0});var q8=a(dl);m2=n(q8,"example script"),q8.forEach(t),f2=n(Fm," and "),cl=r(Fm,"A",{href:!0,rel:!0});var C8=a(cl);u2=n(C8,"notebook"),C8.forEach(t),g2=n(Fm,"."),Fm.forEach(t),_2=p(Vo),Dm=r(Vo,"LI",{});var k8=a(Dm);pl=r(k8,"A",{href:!0,rel:!0});var A8=a(pl);b2=n(A8,"Masked language modeling"),A8.forEach(t),k2=n(k8," chapter of the \u{1F917} Hugging Face Course."),k8.forEach(t),Vo.forEach(t),lT=p(i),v(hl.$$.fragment,i),dT=p(i),no=r(i,"UL",{});var ni=a(no);nn=r(ni,"LI",{});var xm=a(nn);Sm=r(xm,"A",{href:!0});var N8=a(Sm);y2=n(N8,"BertForQuestionAnswering"),N8.forEach(t),T2=n(xm," is supported by this "),ml=r(xm,"A",{href:!0,rel:!0});var O8=a(ml);v2=n(O8,"example script"),O8.forEach(t),w2=n(xm," and "),fl=r(xm,"A",{href:!0,rel:!0});var I8=a(fl);$2=n(I8,"notebook"),I8.forEach(t),F2=n(xm,"."),xm.forEach(t),x2=p(ni),sn=r(ni,"LI",{});var Em=a(sn);Um=r(Em,"A",{href:!0});var L8=a(Um);E2=n(L8,"TFBertForQuestionAnswering"),L8.forEach(t),B2=n(Em," is supported by this "),ul=r(Em,"A",{href:!0,rel:!0});var D8=a(ul);z2=n(D8,"example script"),D8.forEach(t),M2=n(Em," and "),gl=r(Em,"A",{href:!0,rel:!0});var S8=a(gl);P2=n(S8,"notebook"),S8.forEach(t),j2=n(Em,"."),Em.forEach(t),q2=p(ni),or=r(ni,"LI",{});var nT=a(or);Wm=r(nT,"A",{href:!0});var U8=a(Wm);C2=n(U8,"FlaxBertForQuestionAnswering"),U8.forEach(t),A2=n(nT," is supported by this "),_l=r(nT,"A",{href:!0,rel:!0});var W8=a(_l);N2=n(W8,"example script"),W8.forEach(t),O2=n(nT,"."),nT.forEach(t),I2=p(ni),Hm=r(ni,"LI",{});var y8=a(Hm);bl=r(y8,"A",{href:!0,rel:!0});var H8=a(bl);L2=n(H8,"Question answering"),H8.forEach(t),D2=n(y8," chapter of the \u{1F917} Hugging Face Course."),y8.forEach(t),ni.forEach(t),cT=p(i),Rm=r(i,"P",{});var R8=a(Rm);Uu=r(R8,"STRONG",{});var K8=a(Uu);S2=n(K8,"Multiple choice"),K8.forEach(t),R8.forEach(t),pT=p(i),nr=r(i,"UL",{});var Pv=a(nr);rn=r(Pv,"LI",{});var Bm=a(rn);Km=r(Bm,"A",{href:!0});var Q8=a(Km);U2=n(Q8,"BertForMultipleChoice"),Q8.forEach(t),W2=n(Bm," is supported by this "),kl=r(Bm,"A",{href:!0,rel:!0});var V8=a(kl);H2=n(V8,"example script"),V8.forEach(t),R2=n(Bm," and "),yl=r(Bm,"A",{href:!0,rel:!0});var G8=a(yl);K2=n(G8,"notebook"),G8.forEach(t),Q2=n(Bm,"."),Bm.forEach(t),V2=p(Pv),an=r(Pv,"LI",{});var zm=a(an);Qm=r(zm,"A",{href:!0});var J8=a(Qm);G2=n(J8,"TFBertForMultipleChoice"),J8.forEach(t),J2=n(zm," is supported by this "),Tl=r(zm,"A",{href:!0,rel:!0});var X8=a(Tl);X2=n(X8,"example script"),X8.forEach(t),Y2=n(zm," and "),vl=r(zm,"A",{href:!0,rel:!0});var Y8=a(vl);Z2=n(Y8,"notebook"),Y8.forEach(t),eF=n(zm,"."),zm.forEach(t),Pv.forEach(t),hT=p(i),wl=r(i,"P",{});var T8=a(wl);tF=n(T8,"\u26A1\uFE0F "),Wu=r(T8,"STRONG",{});var Z8=a(Wu);oF=n(Z8,"Inference"),Z8.forEach(t),T8.forEach(t),mT=p(i),sr=r(i,"UL",{});var jv=a(sr);$l=r(jv,"LI",{});var qv=a($l);nF=n(qv,"A blog post on how to "),Fl=r(qv,"A",{href:!0,rel:!0});var eN=a(Fl);sF=n(eN,"Accelerate BERT inference with Hugging Face Transformers and AWS Inferentia"),eN.forEach(t),rF=n(qv,"."),qv.forEach(t),aF=p(jv),xl=r(jv,"LI",{});var Cv=a(xl);iF=n(Cv,"A blog post on how to "),El=r(Cv,"A",{href:!0,rel:!0});var tN=a(El);lF=n(tN,"Accelerate BERT inference with DeepSpeed-Inference on GPUs"),tN.forEach(t),dF=n(Cv,"."),Cv.forEach(t),jv.forEach(t),fT=p(i),Bl=r(i,"P",{});var v8=a(Bl);cF=n(v8,"\u2699\uFE0F "),Hu=r(v8,"STRONG",{});var oN=a(Hu);pF=n(oN,"Pretraining"),oN.forEach(t),v8.forEach(t),uT=p(i),Vm=r(i,"UL",{});var nN=a(Vm);zl=r(nN,"LI",{});var Av=a(zl);hF=n(Av,"A blog post on "),Ml=r(Av,"A",{href:!0,rel:!0});var sN=a(Ml);mF=n(sN,"Pre-Training BERT with Hugging Face Transformers and Habana Gaudi"),sN.forEach(t),fF=n(Av,"."),Av.forEach(t),nN.forEach(t),gT=p(i),Pl=r(i,"P",{});var w8=a(Pl);uF=n(w8,"\u{1F680} "),Ru=r(w8,"STRONG",{});var rN=a(Ru);gF=n(rN,"Deploy"),rN.forEach(t),w8.forEach(t),_T=p(i),$t=r(i,"UL",{});var Bo=a($t);jl=r(Bo,"LI",{});var Nv=a(jl);_F=n(Nv,"A blog post on how to "),ql=r(Nv,"A",{href:!0,rel:!0});var aN=a(ql);bF=n(aN,"Convert Transformers to ONNX with Hugging Face Optimum"),aN.forEach(t),kF=n(Nv,"."),Nv.forEach(t),yF=p(Bo),Cl=r(Bo,"LI",{});var Ov=a(Cl);TF=n(Ov,"A blog post on how to "),Al=r(Ov,"A",{href:!0,rel:!0});var iN=a(Al);vF=n(iN,"Setup Deep Learning environment for Hugging Face Transformers with Habana Gaudi on AWS"),iN.forEach(t),wF=n(Ov,"."),Ov.forEach(t),$F=p(Bo),Nl=r(Bo,"LI",{});var Iv=a(Nl);FF=n(Iv,"A blog post on "),Ol=r(Iv,"A",{href:!0,rel:!0});var lN=a(Ol);xF=n(lN,"Autoscaling BERT with Hugging Face Transformers, Amazon SageMaker and Terraform module"),lN.forEach(t),EF=n(Iv,"."),Iv.forEach(t),BF=p(Bo),Il=r(Bo,"LI",{});var Lv=a(Il);zF=n(Lv,"A blog post on "),Ll=r(Lv,"A",{href:!0,rel:!0});var dN=a(Ll);MF=n(dN,"Serverless BERT with HuggingFace, AWS Lambda, and Docker"),dN.forEach(t),PF=n(Lv,"."),Lv.forEach(t),jF=p(Bo),Dl=r(Bo,"LI",{});var Dv=a(Dl);qF=n(Dv,"A blog post on "),Sl=r(Dv,"A",{href:!0,rel:!0});var cN=a(Sl);CF=n(cN,"Hugging Face Transformers BERT fine-tuning using Amazon SageMaker and Training Compiler"),cN.forEach(t),AF=n(Dv,"."),Dv.forEach(t),NF=p(Bo),Ul=r(Bo,"LI",{});var Sv=a(Ul);OF=n(Sv,"A blog post on "),Wl=r(Sv,"A",{href:!0,rel:!0});var pN=a(Wl);IF=n(pN,"Task-specific knowledge distillation for BERT using Transformers & Amazon SageMaker"),pN.forEach(t),LF=n(Sv,"."),Sv.forEach(t),Bo.forEach(t),bT=p(i),An=r(i,"H2",{class:!0});var Uv=a(An);rr=r(Uv,"A",{id:!0,class:!0,href:!0});var hN=a(rr);Ku=r(hN,"SPAN",{});var mN=a(Ku);v(Hl.$$.fragment,mN),mN.forEach(t),hN.forEach(t),DF=p(Uv),Qu=r(Uv,"SPAN",{});var fN=a(Qu);SF=n(fN,"BertConfig"),fN.forEach(t),Uv.forEach(t),kT=p(i),to=r(i,"DIV",{class:!0});var si=a(to);v(Rl.$$.fragment,si),UF=p(si),Oo=r(si,"P",{});var ri=a(Oo);WF=n(ri,"This is the configuration class to store the configuration of a "),Gm=r(ri,"A",{href:!0});var uN=a(Gm);HF=n(uN,"BertModel"),uN.forEach(t),RF=n(ri," or a "),Jm=r(ri,"A",{href:!0});var gN=a(Jm);KF=n(gN,"TFBertModel"),gN.forEach(t),QF=n(ri,`. It is used to
instantiate a 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 BERT
`),Kl=r(ri,"A",{href:!0,rel:!0});var _N=a(Kl);VF=n(_N,"bert-base-uncased"),_N.forEach(t),GF=n(ri," architecture."),ri.forEach(t),JF=p(si),Nn=r(si,"P",{});var eu=a(Nn);XF=n(eu,"Configuration objects inherit from "),Xm=r(eu,"A",{href:!0});var bN=a(Xm);YF=n(bN,"PretrainedConfig"),bN.forEach(t),ZF=n(eu,` and can be used to control the model outputs. Read the
documentation from `),Ym=r(eu,"A",{href:!0});var kN=a(Ym);ex=n(kN,"PretrainedConfig"),kN.forEach(t),tx=n(eu," for more information."),eu.forEach(t),ox=p(si),v(ar.$$.fragment,si),si.forEach(t),yT=p(i),On=r(i,"H2",{class:!0});var Wv=a(On);ir=r(Wv,"A",{id:!0,class:!0,href:!0});var yN=a(ir);Vu=r(yN,"SPAN",{});var TN=a(Vu);v(Ql.$$.fragment,TN),TN.forEach(t),yN.forEach(t),nx=p(Wv),Gu=r(Wv,"SPAN",{});var vN=a(Gu);sx=n(vN,"BertTokenizer"),vN.forEach(t),Wv.forEach(t),TT=p(i),tt=r(i,"DIV",{class:!0});var Wt=a(tt);v(Vl.$$.fragment,Wt),rx=p(Wt),Ju=r(Wt,"P",{});var wN=a(Ju);ax=n(wN,"Construct a BERT tokenizer. Based on WordPiece."),wN.forEach(t),ix=p(Wt),Gl=r(Wt,"P",{});var Hv=a(Gl);lx=n(Hv,"This tokenizer inherits from "),Zm=r(Hv,"A",{href:!0});var $N=a(Zm);dx=n($N,"PreTrainedTokenizer"),$N.forEach(t),cx=n(Hv,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Hv.forEach(t),px=p(Wt),ln=r(Wt,"DIV",{class:!0});var tu=a(ln);v(Jl.$$.fragment,tu),hx=p(tu),Xu=r(tu,"P",{});var FN=a(Xu);mx=n(FN,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),FN.forEach(t),fx=p(tu),Xl=r(tu,"UL",{});var Rv=a(Xl);ef=r(Rv,"LI",{});var $8=a(ef);ux=n($8,"single sequence: "),Yu=r($8,"CODE",{});var xN=a(Yu);gx=n(xN,"[CLS] X [SEP]"),xN.forEach(t),$8.forEach(t),_x=p(Rv),tf=r(Rv,"LI",{});var F8=a(tf);bx=n(F8,"pair of sequences: "),Zu=r(F8,"CODE",{});var EN=a(Zu);kx=n(EN,"[CLS] A [SEP] B [SEP]"),EN.forEach(t),F8.forEach(t),Rv.forEach(t),tu.forEach(t),yx=p(Wt),lr=r(Wt,"DIV",{class:!0});var Kv=a(lr);v(Yl.$$.fragment,Kv),Tx=p(Kv),Zl=r(Kv,"P",{});var Qv=a(Zl);vx=n(Qv,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),eg=r(Qv,"CODE",{});var BN=a(eg);wx=n(BN,"prepare_for_model"),BN.forEach(t),$x=n(Qv," method."),Qv.forEach(t),Kv.forEach(t),Fx=p(Wt),so=r(Wt,"DIV",{class:!0});var ai=a(so);v(ed.$$.fragment,ai),xx=p(ai),tg=r(ai,"P",{});var zN=a(tg);Ex=n(zN,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),zN.forEach(t),Bx=p(ai),v(dr.$$.fragment,ai),zx=p(ai),In=r(ai,"P",{});var ou=a(In);Mx=n(ou,"If "),og=r(ou,"CODE",{});var MN=a(og);Px=n(MN,"token_ids_1"),MN.forEach(t),jx=n(ou," is "),ng=r(ou,"CODE",{});var PN=a(ng);qx=n(PN,"None"),PN.forEach(t),Cx=n(ou,", this method only returns the first portion of the mask (0s)."),ou.forEach(t),ai.forEach(t),Ax=p(Wt),of=r(Wt,"DIV",{class:!0});var jN=a(of);v(td.$$.fragment,jN),jN.forEach(t),Wt.forEach(t),vT=p(i),Ln=r(i,"H2",{class:!0});var Vv=a(Ln);cr=r(Vv,"A",{id:!0,class:!0,href:!0});var qN=a(cr);sg=r(qN,"SPAN",{});var CN=a(sg);v(od.$$.fragment,CN),CN.forEach(t),qN.forEach(t),Nx=p(Vv),rg=r(Vv,"SPAN",{});var AN=a(rg);Ox=n(AN,"BertTokenizerFast"),AN.forEach(t),Vv.forEach(t),wT=p(i),xt=r(i,"DIV",{class:!0});var bn=a(xt);v(nd.$$.fragment,bn),Ix=p(bn),sd=r(bn,"P",{});var Gv=a(sd);Lx=n(Gv,"Construct a \u201Cfast\u201D BERT tokenizer (backed by HuggingFace\u2019s "),ag=r(Gv,"EM",{});var NN=a(ag);Dx=n(NN,"tokenizers"),NN.forEach(t),Sx=n(Gv," library). Based on WordPiece."),Gv.forEach(t),Ux=p(bn),rd=r(bn,"P",{});var Jv=a(rd);Wx=n(Jv,"This tokenizer inherits from "),nf=r(Jv,"A",{href:!0});var ON=a(nf);Hx=n(ON,"PreTrainedTokenizerFast"),ON.forEach(t),Rx=n(Jv,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Jv.forEach(t),Kx=p(bn),dn=r(bn,"DIV",{class:!0});var nu=a(dn);v(ad.$$.fragment,nu),Qx=p(nu),ig=r(nu,"P",{});var IN=a(ig);Vx=n(IN,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),IN.forEach(t),Gx=p(nu),id=r(nu,"UL",{});var Xv=a(id);sf=r(Xv,"LI",{});var x8=a(sf);Jx=n(x8,"single sequence: "),lg=r(x8,"CODE",{});var LN=a(lg);Xx=n(LN,"[CLS] X [SEP]"),LN.forEach(t),x8.forEach(t),Yx=p(Xv),rf=r(Xv,"LI",{});var E8=a(rf);Zx=n(E8,"pair of sequences: "),dg=r(E8,"CODE",{});var DN=a(dg);e0=n(DN,"[CLS] A [SEP] B [SEP]"),DN.forEach(t),E8.forEach(t),Xv.forEach(t),nu.forEach(t),t0=p(bn),ro=r(bn,"DIV",{class:!0});var ii=a(ro);v(ld.$$.fragment,ii),o0=p(ii),cg=r(ii,"P",{});var SN=a(cg);n0=n(SN,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),SN.forEach(t),s0=p(ii),v(pr.$$.fragment,ii),r0=p(ii),Dn=r(ii,"P",{});var su=a(Dn);a0=n(su,"If "),pg=r(su,"CODE",{});var UN=a(pg);i0=n(UN,"token_ids_1"),UN.forEach(t),l0=n(su," is "),hg=r(su,"CODE",{});var WN=a(hg);d0=n(WN,"None"),WN.forEach(t),c0=n(su,", this method only returns the first portion of the mask (0s)."),su.forEach(t),ii.forEach(t),bn.forEach(t),$T=p(i),Sn=r(i,"H2",{class:!0});var Yv=a(Sn);hr=r(Yv,"A",{id:!0,class:!0,href:!0});var HN=a(hr);mg=r(HN,"SPAN",{});var RN=a(mg);v(dd.$$.fragment,RN),RN.forEach(t),HN.forEach(t),p0=p(Yv),fg=r(Yv,"SPAN",{});var KN=a(fg);h0=n(KN,"TFBertTokenizer"),KN.forEach(t),Yv.forEach(t),FT=p(i),Et=r(i,"DIV",{class:!0});var kn=a(Et);v(cd.$$.fragment,kn),m0=p(kn),Un=r(kn,"P",{});var ru=a(Un);f0=n(ru,`This is an in-graph tokenizer for BERT. It should be initialized similarly to other tokenizers, using the
`),ug=r(ru,"CODE",{});var QN=a(ug);u0=n(QN,"from_pretrained()"),QN.forEach(t),g0=n(ru," method. It can also be initialized with the "),gg=r(ru,"CODE",{});var VN=a(gg);_0=n(VN,"from_tokenizer()"),VN.forEach(t),b0=n(ru,` method, which imports settings
from an existing standard tokenizer object.`),ru.forEach(t),k0=p(kn),pd=r(kn,"P",{});var Zv=a(pd);y0=n(Zv,`In-graph tokenizers, unlike other Hugging Face tokenizers, are actually Keras layers and are designed to be run
when the model is called, rather than during preprocessing. As a result, they have somewhat more limited options
than standard tokenizer classes. They are most useful when you want to create an end-to-end model that goes
straight from `),_g=r(Zv,"CODE",{});var GN=a(_g);T0=n(GN,"tf.string"),GN.forEach(t),v0=n(Zv," inputs to outputs."),Zv.forEach(t),w0=p(kn),cn=r(kn,"DIV",{class:!0});var au=a(cn);v(hd.$$.fragment,au),$0=p(au),md=r(au,"P",{});var e1=a(md);F0=n(e1,"Instantiate a "),bg=r(e1,"CODE",{});var JN=a(bg);x0=n(JN,"TFBertTokenizer"),JN.forEach(t),E0=n(e1," from a pre-trained tokenizer."),e1.forEach(t),B0=p(au),v(mr.$$.fragment,au),au.forEach(t),z0=p(kn),pn=r(kn,"DIV",{class:!0});var iu=a(pn);v(fd.$$.fragment,iu),M0=p(iu),Wn=r(iu,"P",{});var lu=a(Wn);P0=n(lu,"Initialize a "),kg=r(lu,"CODE",{});var XN=a(kg);j0=n(XN,"TFBertTokenizer"),XN.forEach(t),q0=n(lu," from an existing "),yg=r(lu,"CODE",{});var YN=a(yg);C0=n(YN,"Tokenizer"),YN.forEach(t),A0=n(lu,"."),lu.forEach(t),N0=p(iu),v(fr.$$.fragment,iu),iu.forEach(t),kn.forEach(t),xT=p(i),Hn=r(i,"H2",{class:!0});var t1=a(Hn);ur=r(t1,"A",{id:!0,class:!0,href:!0});var ZN=a(ur);Tg=r(ZN,"SPAN",{});var eO=a(Tg);v(ud.$$.fragment,eO),eO.forEach(t),ZN.forEach(t),O0=p(t1),vg=r(t1,"SPAN",{});var tO=a(vg);I0=n(tO,"Bert specific outputs"),tO.forEach(t),t1.forEach(t),ET=p(i),Rn=r(i,"DIV",{class:!0});var o1=a(Rn);v(gd.$$.fragment,o1),L0=p(o1),_d=r(o1,"P",{});var n1=a(_d);D0=n(n1,"Output type of "),af=r(n1,"A",{href:!0});var oO=a(af);S0=n(oO,"BertForPreTraining"),oO.forEach(t),U0=n(n1,"."),n1.forEach(t),o1.forEach(t),BT=p(i),Kn=r(i,"DIV",{class:!0});var s1=a(Kn);v(bd.$$.fragment,s1),W0=p(s1),kd=r(s1,"P",{});var r1=a(kd);H0=n(r1,"Output type of "),lf=r(r1,"A",{href:!0});var nO=a(lf);R0=n(nO,"TFBertForPreTraining"),nO.forEach(t),K0=n(r1,"."),r1.forEach(t),s1.forEach(t),zT=p(i),Io=r(i,"DIV",{class:!0});var du=a(Io);v(yd.$$.fragment,du),Q0=p(du),Td=r(du,"P",{});var a1=a(Td);V0=n(a1,"Output type of "),df=r(a1,"A",{href:!0});var sO=a(df);G0=n(sO,"BertForPreTraining"),sO.forEach(t),J0=n(a1,"."),a1.forEach(t),X0=p(du),gr=r(du,"DIV",{class:!0});var i1=a(gr);v(vd.$$.fragment,i1),Y0=p(i1),wg=r(i1,"P",{});var rO=a(wg);Z0=n(rO,"\u201CReturns a new object replacing the specified fields with new values."),rO.forEach(t),i1.forEach(t),du.forEach(t),MT=p(i),Qn=r(i,"H2",{class:!0});var l1=a(Qn);_r=r(l1,"A",{id:!0,class:!0,href:!0});var aO=a(_r);$g=r(aO,"SPAN",{});var iO=a($g);v(wd.$$.fragment,iO),iO.forEach(t),aO.forEach(t),eE=p(l1),Fg=r(l1,"SPAN",{});var lO=a(Fg);tE=n(lO,"BertModel"),lO.forEach(t),l1.forEach(t),PT=p(i),ot=r(i,"DIV",{class:!0});var Ht=a(ot);v($d.$$.fragment,Ht),oE=p(Ht),xg=r(Ht,"P",{});var dO=a(xg);nE=n(dO,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),dO.forEach(t),sE=p(Ht),Fd=r(Ht,"P",{});var d1=a(Fd);rE=n(d1,"This model inherits from "),cf=r(d1,"A",{href:!0});var cO=a(cf);aE=n(cO,"PreTrainedModel"),cO.forEach(t),iE=n(d1,`. 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.)`),d1.forEach(t),lE=p(Ht),xd=r(Ht,"P",{});var c1=a(xd);dE=n(c1,"This model is also a PyTorch "),Ed=r(c1,"A",{href:!0,rel:!0});var pO=a(Ed);cE=n(pO,"torch.nn.Module"),pO.forEach(t),pE=n(c1,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),c1.forEach(t),hE=p(Ht),Bd=r(Ht,"P",{});var p1=a(Bd);mE=n(p1,`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 `),zd=r(p1,"A",{href:!0,rel:!0});var hO=a(zd);fE=n(hO,`Attention is
all you need`),hO.forEach(t),uE=n(p1,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),p1.forEach(t),gE=p(Ht),mt=r(Ht,"P",{});var Rt=a(mt);_E=n(Rt,"To behave as an decoder the model needs to be initialized with the "),Eg=r(Rt,"CODE",{});var mO=a(Eg);bE=n(mO,"is_decoder"),mO.forEach(t),kE=n(Rt,` argument of the configuration set
to `),Bg=r(Rt,"CODE",{});var fO=a(Bg);yE=n(fO,"True"),fO.forEach(t),TE=n(Rt,". To be used in a Seq2Seq model, the model needs to initialized with both "),zg=r(Rt,"CODE",{});var uO=a(zg);vE=n(uO,"is_decoder"),uO.forEach(t),wE=n(Rt,` argument and
`),Mg=r(Rt,"CODE",{});var gO=a(Mg);$E=n(gO,"add_cross_attention"),gO.forEach(t),FE=n(Rt," set to "),Pg=r(Rt,"CODE",{});var _O=a(Pg);xE=n(_O,"True"),_O.forEach(t),EE=n(Rt,"; an "),jg=r(Rt,"CODE",{});var bO=a(jg);BE=n(bO,"encoder_hidden_states"),bO.forEach(t),zE=n(Rt," is then expected as an input to the forward pass."),Rt.forEach(t),ME=p(Ht),ao=r(Ht,"DIV",{class:!0});var li=a(ao);v(Md.$$.fragment,li),PE=p(li),Vn=r(li,"P",{});var cu=a(Vn);jE=n(cu,"The "),pf=r(cu,"A",{href:!0});var kO=a(pf);qE=n(kO,"BertModel"),kO.forEach(t),CE=n(cu," forward method, overrides the "),qg=r(cu,"CODE",{});var yO=a(qg);AE=n(yO,"__call__"),yO.forEach(t),NE=n(cu," special method."),cu.forEach(t),OE=p(li),v(br.$$.fragment,li),IE=p(li),v(kr.$$.fragment,li),li.forEach(t),Ht.forEach(t),jT=p(i),Gn=r(i,"H2",{class:!0});var h1=a(Gn);yr=r(h1,"A",{id:!0,class:!0,href:!0});var TO=a(yr);Cg=r(TO,"SPAN",{});var vO=a(Cg);v(Pd.$$.fragment,vO),vO.forEach(t),TO.forEach(t),LE=p(h1),Ag=r(h1,"SPAN",{});var wO=a(Ag);DE=n(wO,"BertForPreTraining"),wO.forEach(t),h1.forEach(t),qT=p(i),Bt=r(i,"DIV",{class:!0});var yn=a(Bt);v(jd.$$.fragment,yn),SE=p(yn),Jn=r(yn,"P",{});var pu=a(Jn);UE=n(pu,"Bert Model with two heads on top as done during the pretraining: a "),Ng=r(pu,"CODE",{});var $O=a(Ng);WE=n($O,"masked language modeling"),$O.forEach(t),HE=n(pu," head and a "),Og=r(pu,"CODE",{});var FO=a(Og);RE=n(FO,"next sentence prediction (classification)"),FO.forEach(t),KE=n(pu," head."),pu.forEach(t),QE=p(yn),qd=r(yn,"P",{});var m1=a(qd);VE=n(m1,"This model inherits from "),hf=r(m1,"A",{href:!0});var xO=a(hf);GE=n(xO,"PreTrainedModel"),xO.forEach(t),JE=n(m1,`. 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.)`),m1.forEach(t),XE=p(yn),Cd=r(yn,"P",{});var f1=a(Cd);YE=n(f1,"This model is also a PyTorch "),Ad=r(f1,"A",{href:!0,rel:!0});var EO=a(Ad);ZE=n(EO,"torch.nn.Module"),EO.forEach(t),eB=n(f1,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),f1.forEach(t),tB=p(yn),io=r(yn,"DIV",{class:!0});var di=a(io);v(Nd.$$.fragment,di),oB=p(di),Xn=r(di,"P",{});var hu=a(Xn);nB=n(hu,"The "),mf=r(hu,"A",{href:!0});var BO=a(mf);sB=n(BO,"BertForPreTraining"),BO.forEach(t),rB=n(hu," forward method, overrides the "),Ig=r(hu,"CODE",{});var zO=a(Ig);aB=n(zO,"__call__"),zO.forEach(t),iB=n(hu," special method."),hu.forEach(t),lB=p(di),v(Tr.$$.fragment,di),dB=p(di),v(vr.$$.fragment,di),di.forEach(t),yn.forEach(t),CT=p(i),Yn=r(i,"H2",{class:!0});var u1=a(Yn);wr=r(u1,"A",{id:!0,class:!0,href:!0});var MO=a(wr);Lg=r(MO,"SPAN",{});var PO=a(Lg);v(Od.$$.fragment,PO),PO.forEach(t),MO.forEach(t),cB=p(u1),Dg=r(u1,"SPAN",{});var jO=a(Dg);pB=n(jO,"BertLMHeadModel"),jO.forEach(t),u1.forEach(t),AT=p(i),zt=r(i,"DIV",{class:!0});var Tn=a(zt);v(Id.$$.fragment,Tn),hB=p(Tn),Ld=r(Tn,"P",{});var g1=a(Ld);mB=n(g1,"Bert Model with a "),Sg=r(g1,"CODE",{});var qO=a(Sg);fB=n(qO,"language modeling"),qO.forEach(t),uB=n(g1," head on top for CLM fine-tuning."),g1.forEach(t),gB=p(Tn),Dd=r(Tn,"P",{});var _1=a(Dd);_B=n(_1,"This model inherits from "),ff=r(_1,"A",{href:!0});var CO=a(ff);bB=n(CO,"PreTrainedModel"),CO.forEach(t),kB=n(_1,`. 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.)`),_1.forEach(t),yB=p(Tn),Sd=r(Tn,"P",{});var b1=a(Sd);TB=n(b1,"This model is also a PyTorch "),Ud=r(b1,"A",{href:!0,rel:!0});var AO=a(Ud);vB=n(AO,"torch.nn.Module"),AO.forEach(t),wB=n(b1,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),b1.forEach(t),$B=p(Tn),lo=r(Tn,"DIV",{class:!0});var ci=a(lo);v(Wd.$$.fragment,ci),FB=p(ci),Zn=r(ci,"P",{});var mu=a(Zn);xB=n(mu,"The "),uf=r(mu,"A",{href:!0});var NO=a(uf);EB=n(NO,"BertLMHeadModel"),NO.forEach(t),BB=n(mu," forward method, overrides the "),Ug=r(mu,"CODE",{});var OO=a(Ug);zB=n(OO,"__call__"),OO.forEach(t),MB=n(mu," special method."),mu.forEach(t),PB=p(ci),v($r.$$.fragment,ci),jB=p(ci),v(Fr.$$.fragment,ci),ci.forEach(t),Tn.forEach(t),NT=p(i),es=r(i,"H2",{class:!0});var k1=a(es);xr=r(k1,"A",{id:!0,class:!0,href:!0});var IO=a(xr);Wg=r(IO,"SPAN",{});var LO=a(Wg);v(Hd.$$.fragment,LO),LO.forEach(t),IO.forEach(t),qB=p(k1),Hg=r(k1,"SPAN",{});var DO=a(Hg);CB=n(DO,"BertForMaskedLM"),DO.forEach(t),k1.forEach(t),OT=p(i),Mt=r(i,"DIV",{class:!0});var vn=a(Mt);v(Rd.$$.fragment,vn),AB=p(vn),Kd=r(vn,"P",{});var y1=a(Kd);NB=n(y1,"Bert Model with a "),Rg=r(y1,"CODE",{});var SO=a(Rg);OB=n(SO,"language modeling"),SO.forEach(t),IB=n(y1," head on top."),y1.forEach(t),LB=p(vn),Qd=r(vn,"P",{});var T1=a(Qd);DB=n(T1,"This model inherits from "),gf=r(T1,"A",{href:!0});var UO=a(gf);SB=n(UO,"PreTrainedModel"),UO.forEach(t),UB=n(T1,`. 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.)`),T1.forEach(t),WB=p(vn),Vd=r(vn,"P",{});var v1=a(Vd);HB=n(v1,"This model is also a PyTorch "),Gd=r(v1,"A",{href:!0,rel:!0});var WO=a(Gd);RB=n(WO,"torch.nn.Module"),WO.forEach(t),KB=n(v1,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),v1.forEach(t),QB=p(vn),co=r(vn,"DIV",{class:!0});var pi=a(co);v(Jd.$$.fragment,pi),VB=p(pi),ts=r(pi,"P",{});var fu=a(ts);GB=n(fu,"The "),_f=r(fu,"A",{href:!0});var HO=a(_f);JB=n(HO,"BertForMaskedLM"),HO.forEach(t),XB=n(fu," forward method, overrides the "),Kg=r(fu,"CODE",{});var RO=a(Kg);YB=n(RO,"__call__"),RO.forEach(t),ZB=n(fu," special method."),fu.forEach(t),ez=p(pi),v(Er.$$.fragment,pi),tz=p(pi),v(Br.$$.fragment,pi),pi.forEach(t),vn.forEach(t),IT=p(i),os=r(i,"H2",{class:!0});var w1=a(os);zr=r(w1,"A",{id:!0,class:!0,href:!0});var KO=a(zr);Qg=r(KO,"SPAN",{});var QO=a(Qg);v(Xd.$$.fragment,QO),QO.forEach(t),KO.forEach(t),oz=p(w1),Vg=r(w1,"SPAN",{});var VO=a(Vg);nz=n(VO,"BertForNextSentencePrediction"),VO.forEach(t),w1.forEach(t),LT=p(i),Pt=r(i,"DIV",{class:!0});var wn=a(Pt);v(Yd.$$.fragment,wn),sz=p(wn),Zd=r(wn,"P",{});var $1=a(Zd);rz=n($1,"Bert Model with a "),Gg=r($1,"CODE",{});var GO=a(Gg);az=n(GO,"next sentence prediction (classification)"),GO.forEach(t),iz=n($1," head on top."),$1.forEach(t),lz=p(wn),ec=r(wn,"P",{});var F1=a(ec);dz=n(F1,"This model inherits from "),bf=r(F1,"A",{href:!0});var JO=a(bf);cz=n(JO,"PreTrainedModel"),JO.forEach(t),pz=n(F1,`. 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.)`),F1.forEach(t),hz=p(wn),tc=r(wn,"P",{});var x1=a(tc);mz=n(x1,"This model is also a PyTorch "),oc=r(x1,"A",{href:!0,rel:!0});var XO=a(oc);fz=n(XO,"torch.nn.Module"),XO.forEach(t),uz=n(x1,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),x1.forEach(t),gz=p(wn),po=r(wn,"DIV",{class:!0});var hi=a(po);v(nc.$$.fragment,hi),_z=p(hi),ns=r(hi,"P",{});var uu=a(ns);bz=n(uu,"The "),kf=r(uu,"A",{href:!0});var YO=a(kf);kz=n(YO,"BertForNextSentencePrediction"),YO.forEach(t),yz=n(uu," forward method, overrides the "),Jg=r(uu,"CODE",{});var ZO=a(Jg);Tz=n(ZO,"__call__"),ZO.forEach(t),vz=n(uu," special method."),uu.forEach(t),wz=p(hi),v(Mr.$$.fragment,hi),$z=p(hi),v(Pr.$$.fragment,hi),hi.forEach(t),wn.forEach(t),DT=p(i),ss=r(i,"H2",{class:!0});var E1=a(ss);jr=r(E1,"A",{id:!0,class:!0,href:!0});var eI=a(jr);Xg=r(eI,"SPAN",{});var tI=a(Xg);v(sc.$$.fragment,tI),tI.forEach(t),eI.forEach(t),Fz=p(E1),Yg=r(E1,"SPAN",{});var oI=a(Yg);xz=n(oI,"BertForSequenceClassification"),oI.forEach(t),E1.forEach(t),ST=p(i),jt=r(i,"DIV",{class:!0});var $n=a(jt);v(rc.$$.fragment,$n),Ez=p($n),Zg=r($n,"P",{});var nI=a(Zg);Bz=n(nI,`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.`),nI.forEach(t),zz=p($n),ac=r($n,"P",{});var B1=a(ac);Mz=n(B1,"This model inherits from "),yf=r(B1,"A",{href:!0});var sI=a(yf);Pz=n(sI,"PreTrainedModel"),sI.forEach(t),jz=n(B1,`. 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.)`),B1.forEach(t),qz=p($n),ic=r($n,"P",{});var z1=a(ic);Cz=n(z1,"This model is also a PyTorch "),lc=r(z1,"A",{href:!0,rel:!0});var rI=a(lc);Az=n(rI,"torch.nn.Module"),rI.forEach(t),Nz=n(z1,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),z1.forEach(t),Oz=p($n),Ot=r($n,"DIV",{class:!0});var Fn=a(Ot);v(dc.$$.fragment,Fn),Iz=p(Fn),rs=r(Fn,"P",{});var gu=a(rs);Lz=n(gu,"The "),Tf=r(gu,"A",{href:!0});var aI=a(Tf);Dz=n(aI,"BertForSequenceClassification"),aI.forEach(t),Sz=n(gu," forward method, overrides the "),e_=r(gu,"CODE",{});var iI=a(e_);Uz=n(iI,"__call__"),iI.forEach(t),Wz=n(gu," special method."),gu.forEach(t),Hz=p(Fn),v(qr.$$.fragment,Fn),Rz=p(Fn),v(Cr.$$.fragment,Fn),Kz=p(Fn),v(Ar.$$.fragment,Fn),Fn.forEach(t),$n.forEach(t),UT=p(i),as=r(i,"H2",{class:!0});var M1=a(as);Nr=r(M1,"A",{id:!0,class:!0,href:!0});var lI=a(Nr);t_=r(lI,"SPAN",{});var dI=a(t_);v(cc.$$.fragment,dI),dI.forEach(t),lI.forEach(t),Qz=p(M1),o_=r(M1,"SPAN",{});var cI=a(o_);Vz=n(cI,"BertForMultipleChoice"),cI.forEach(t),M1.forEach(t),WT=p(i),qt=r(i,"DIV",{class:!0});var xn=a(qt);v(pc.$$.fragment,xn),Gz=p(xn),n_=r(xn,"P",{});var pI=a(n_);Jz=n(pI,`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.`),pI.forEach(t),Xz=p(xn),hc=r(xn,"P",{});var P1=a(hc);Yz=n(P1,"This model inherits from "),vf=r(P1,"A",{href:!0});var hI=a(vf);Zz=n(hI,"PreTrainedModel"),hI.forEach(t),eM=n(P1,`. 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.)`),P1.forEach(t),tM=p(xn),mc=r(xn,"P",{});var j1=a(mc);oM=n(j1,"This model is also a PyTorch "),fc=r(j1,"A",{href:!0,rel:!0});var mI=a(fc);nM=n(mI,"torch.nn.Module"),mI.forEach(t),sM=n(j1,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),j1.forEach(t),rM=p(xn),ho=r(xn,"DIV",{class:!0});var mi=a(ho);v(uc.$$.fragment,mi),aM=p(mi),is=r(mi,"P",{});var _u=a(is);iM=n(_u,"The "),wf=r(_u,"A",{href:!0});var fI=a(wf);lM=n(fI,"BertForMultipleChoice"),fI.forEach(t),dM=n(_u," forward method, overrides the "),s_=r(_u,"CODE",{});var uI=a(s_);cM=n(uI,"__call__"),uI.forEach(t),pM=n(_u," special method."),_u.forEach(t),hM=p(mi),v(Or.$$.fragment,mi),mM=p(mi),v(Ir.$$.fragment,mi),mi.forEach(t),xn.forEach(t),HT=p(i),ls=r(i,"H2",{class:!0});var q1=a(ls);Lr=r(q1,"A",{id:!0,class:!0,href:!0});var gI=a(Lr);r_=r(gI,"SPAN",{});var _I=a(r_);v(gc.$$.fragment,_I),_I.forEach(t),gI.forEach(t),fM=p(q1),a_=r(q1,"SPAN",{});var bI=a(a_);uM=n(bI,"BertForTokenClassification"),bI.forEach(t),q1.forEach(t),RT=p(i),Ct=r(i,"DIV",{class:!0});var En=a(Ct);v(_c.$$.fragment,En),gM=p(En),i_=r(En,"P",{});var kI=a(i_);_M=n(kI,`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.`),kI.forEach(t),bM=p(En),bc=r(En,"P",{});var C1=a(bc);kM=n(C1,"This model inherits from "),$f=r(C1,"A",{href:!0});var yI=a($f);yM=n(yI,"PreTrainedModel"),yI.forEach(t),TM=n(C1,`. 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.)`),C1.forEach(t),vM=p(En),kc=r(En,"P",{});var A1=a(kc);wM=n(A1,"This model is also a PyTorch "),yc=r(A1,"A",{href:!0,rel:!0});var TI=a(yc);$M=n(TI,"torch.nn.Module"),TI.forEach(t),FM=n(A1,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),A1.forEach(t),xM=p(En),mo=r(En,"DIV",{class:!0});var fi=a(mo);v(Tc.$$.fragment,fi),EM=p(fi),ds=r(fi,"P",{});var bu=a(ds);BM=n(bu,"The "),Ff=r(bu,"A",{href:!0});var vI=a(Ff);zM=n(vI,"BertForTokenClassification"),vI.forEach(t),MM=n(bu," forward method, overrides the "),l_=r(bu,"CODE",{});var wI=a(l_);PM=n(wI,"__call__"),wI.forEach(t),jM=n(bu," special method."),bu.forEach(t),qM=p(fi),v(Dr.$$.fragment,fi),CM=p(fi),v(Sr.$$.fragment,fi),fi.forEach(t),En.forEach(t),KT=p(i),cs=r(i,"H2",{class:!0});var N1=a(cs);Ur=r(N1,"A",{id:!0,class:!0,href:!0});var $I=a(Ur);d_=r($I,"SPAN",{});var FI=a(d_);v(vc.$$.fragment,FI),FI.forEach(t),$I.forEach(t),AM=p(N1),c_=r(N1,"SPAN",{});var xI=a(c_);NM=n(xI,"BertForQuestionAnswering"),xI.forEach(t),N1.forEach(t),QT=p(i),At=r(i,"DIV",{class:!0});var Bn=a(At);v(wc.$$.fragment,Bn),OM=p(Bn),ps=r(Bn,"P",{});var ku=a(ps);IM=n(ku,`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 `),p_=r(ku,"CODE",{});var EI=a(p_);LM=n(EI,"span start logits"),EI.forEach(t),DM=n(ku," and "),h_=r(ku,"CODE",{});var BI=a(h_);SM=n(BI,"span end logits"),BI.forEach(t),UM=n(ku,")."),ku.forEach(t),WM=p(Bn),$c=r(Bn,"P",{});var O1=a($c);HM=n(O1,"This model inherits from "),xf=r(O1,"A",{href:!0});var zI=a(xf);RM=n(zI,"PreTrainedModel"),zI.forEach(t),KM=n(O1,`. 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.)`),O1.forEach(t),QM=p(Bn),Fc=r(Bn,"P",{});var I1=a(Fc);VM=n(I1,"This model is also a PyTorch "),xc=r(I1,"A",{href:!0,rel:!0});var MI=a(xc);GM=n(MI,"torch.nn.Module"),MI.forEach(t),JM=n(I1,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),I1.forEach(t),XM=p(Bn),fo=r(Bn,"DIV",{class:!0});var ui=a(fo);v(Ec.$$.fragment,ui),YM=p(ui),hs=r(ui,"P",{});var yu=a(hs);ZM=n(yu,"The "),Ef=r(yu,"A",{href:!0});var PI=a(Ef);e4=n(PI,"BertForQuestionAnswering"),PI.forEach(t),t4=n(yu," forward method, overrides the "),m_=r(yu,"CODE",{});var jI=a(m_);o4=n(jI,"__call__"),jI.forEach(t),n4=n(yu," special method."),yu.forEach(t),s4=p(ui),v(Wr.$$.fragment,ui),r4=p(ui),v(Hr.$$.fragment,ui),ui.forEach(t),Bn.forEach(t),VT=p(i),ms=r(i,"H2",{class:!0});var L1=a(ms);Rr=r(L1,"A",{id:!0,class:!0,href:!0});var qI=a(Rr);f_=r(qI,"SPAN",{});var CI=a(f_);v(Bc.$$.fragment,CI),CI.forEach(t),qI.forEach(t),a4=p(L1),u_=r(L1,"SPAN",{});var AI=a(u_);i4=n(AI,"TFBertModel"),AI.forEach(t),L1.forEach(t),GT=p(i),ft=r(i,"DIV",{class:!0});var zo=a(ft);v(zc.$$.fragment,zo),l4=p(zo),g_=r(zo,"P",{});var NI=a(g_);d4=n(NI,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),NI.forEach(t),c4=p(zo),Mc=r(zo,"P",{});var D1=a(Mc);p4=n(D1,"This model inherits from "),Bf=r(D1,"A",{href:!0});var OI=a(Bf);h4=n(OI,"TFPreTrainedModel"),OI.forEach(t),m4=n(D1,`. 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.)`),D1.forEach(t),f4=p(zo),Pc=r(zo,"P",{});var S1=a(Pc);u4=n(S1,"This model is also a "),jc=r(S1,"A",{href:!0,rel:!0});var II=a(jc);g4=n(II,"tf.keras.Model"),II.forEach(t),_4=n(S1,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),S1.forEach(t),b4=p(zo),v(Kr.$$.fragment,zo),k4=p(zo),uo=r(zo,"DIV",{class:!0});var gi=a(uo);v(qc.$$.fragment,gi),y4=p(gi),fs=r(gi,"P",{});var Tu=a(fs);T4=n(Tu,"The "),zf=r(Tu,"A",{href:!0});var LI=a(zf);v4=n(LI,"TFBertModel"),LI.forEach(t),w4=n(Tu," forward method, overrides the "),__=r(Tu,"CODE",{});var DI=a(__);$4=n(DI,"__call__"),DI.forEach(t),F4=n(Tu," special method."),Tu.forEach(t),x4=p(gi),v(Qr.$$.fragment,gi),E4=p(gi),v(Vr.$$.fragment,gi),gi.forEach(t),zo.forEach(t),JT=p(i),us=r(i,"H2",{class:!0});var U1=a(us);Gr=r(U1,"A",{id:!0,class:!0,href:!0});var SI=a(Gr);b_=r(SI,"SPAN",{});var UI=a(b_);v(Cc.$$.fragment,UI),UI.forEach(t),SI.forEach(t),B4=p(U1),k_=r(U1,"SPAN",{});var WI=a(k_);z4=n(WI,"TFBertForPreTraining"),WI.forEach(t),U1.forEach(t),XT=p(i),ut=r(i,"DIV",{class:!0});var Mo=a(ut);v(Ac.$$.fragment,Mo),M4=p(Mo),gs=r(Mo,"P",{});var vu=a(gs);P4=n(vu,`Bert Model with two heads on top as done during the pretraining:
a `),y_=r(vu,"CODE",{});var HI=a(y_);j4=n(HI,"masked language modeling"),HI.forEach(t),q4=n(vu," head and a "),T_=r(vu,"CODE",{});var RI=a(T_);C4=n(RI,"next sentence prediction (classification)"),RI.forEach(t),A4=n(vu," head."),vu.forEach(t),N4=p(Mo),Nc=r(Mo,"P",{});var W1=a(Nc);O4=n(W1,"This model inherits from "),Mf=r(W1,"A",{href:!0});var KI=a(Mf);I4=n(KI,"TFPreTrainedModel"),KI.forEach(t),L4=n(W1,`. 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.)`),W1.forEach(t),D4=p(Mo),Oc=r(Mo,"P",{});var H1=a(Oc);S4=n(H1,"This model is also a "),Ic=r(H1,"A",{href:!0,rel:!0});var QI=a(Ic);U4=n(QI,"tf.keras.Model"),QI.forEach(t),W4=n(H1,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),H1.forEach(t),H4=p(Mo),v(Jr.$$.fragment,Mo),R4=p(Mo),go=r(Mo,"DIV",{class:!0});var _i=a(go);v(Lc.$$.fragment,_i),K4=p(_i),_s=r(_i,"P",{});var wu=a(_s);Q4=n(wu,"The "),Pf=r(wu,"A",{href:!0});var VI=a(Pf);V4=n(VI,"TFBertForPreTraining"),VI.forEach(t),G4=n(wu," forward method, overrides the "),v_=r(wu,"CODE",{});var GI=a(v_);J4=n(GI,"__call__"),GI.forEach(t),X4=n(wu," special method."),wu.forEach(t),Y4=p(_i),v(Xr.$$.fragment,_i),Z4=p(_i),v(Yr.$$.fragment,_i),_i.forEach(t),Mo.forEach(t),YT=p(i),bs=r(i,"H2",{class:!0});var R1=a(bs);Zr=r(R1,"A",{id:!0,class:!0,href:!0});var JI=a(Zr);w_=r(JI,"SPAN",{});var XI=a(w_);v(Dc.$$.fragment,XI),XI.forEach(t),JI.forEach(t),eP=p(R1),$_=r(R1,"SPAN",{});var YI=a($_);tP=n(YI,"TFBertModelLMHeadModel"),YI.forEach(t),R1.forEach(t),ZT=p(i),ks=r(i,"DIV",{class:!0});var K1=a(ks);v(Sc.$$.fragment,K1),oP=p(K1),It=r(K1,"DIV",{class:!0});var zn=a(It);v(Uc.$$.fragment,zn),nP=p(zn),nt=r(zn,"P",{});var Ft=a(nt);sP=n(Ft,"encoder_hidden_states  ("),F_=r(Ft,"CODE",{});var ZI=a(F_);rP=n(ZI,"tf.Tensor"),ZI.forEach(t),aP=n(Ft," of shape "),x_=r(Ft,"CODE",{});var e9=a(x_);iP=n(e9,"(batch_size, sequence_length, hidden_size)"),e9.forEach(t),lP=n(Ft,", "),E_=r(Ft,"EM",{});var t9=a(E_);dP=n(t9,"optional"),t9.forEach(t),cP=n(Ft,`):
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.
encoder_attention_mask (`),B_=r(Ft,"CODE",{});var o9=a(B_);pP=n(o9,"tf.Tensor"),o9.forEach(t),hP=n(Ft," of shape "),z_=r(Ft,"CODE",{});var n9=a(z_);mP=n(n9,"(batch_size, sequence_length)"),n9.forEach(t),fP=n(Ft,", "),M_=r(Ft,"EM",{});var s9=a(M_);uP=n(s9,"optional"),s9.forEach(t),gP=n(Ft,`):
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in `),P_=r(Ft,"CODE",{});var r9=a(P_);_P=n(r9,"[0, 1]"),r9.forEach(t),bP=n(Ft,":"),Ft.forEach(t),kP=p(zn),Wc=r(zn,"UL",{});var Q1=a(Wc);Hc=r(Q1,"LI",{});var V1=a(Hc);yP=n(V1,"1 for tokens that are "),j_=r(V1,"STRONG",{});var a9=a(j_);TP=n(a9,"not masked"),a9.forEach(t),vP=n(V1,","),V1.forEach(t),wP=p(Q1),Rc=r(Q1,"LI",{});var G1=a(Rc);$P=n(G1,"0 for tokens that are "),q_=r(G1,"STRONG",{});var i9=a(q_);FP=n(i9,"masked"),i9.forEach(t),xP=n(G1,"."),G1.forEach(t),Q1.forEach(t),EP=p(zn),ee=r(zn,"P",{});var ae=a(ee);BP=n(ae,"past_key_values ("),C_=r(ae,"CODE",{});var l9=a(C_);zP=n(l9,"Tuple[Tuple[tf.Tensor]]"),l9.forEach(t),MP=n(ae," of length "),A_=r(ae,"CODE",{});var d9=a(A_);PP=n(d9,"config.n_layers"),d9.forEach(t),jP=n(ae,`)
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),N_=r(ae,"CODE",{});var c9=a(N_);qP=n(c9,"past_key_values"),c9.forEach(t),CP=n(ae," are used, the user can optionally input only the last "),O_=r(ae,"CODE",{});var p9=a(O_);AP=n(p9,"decoder_input_ids"),p9.forEach(t),NP=n(ae,` (those that
don\u2019t have their past key value states given to this model) of shape `),I_=r(ae,"CODE",{});var h9=a(I_);OP=n(h9,"(batch_size, 1)"),h9.forEach(t),IP=n(ae,` instead of all
`),L_=r(ae,"CODE",{});var m9=a(L_);LP=n(m9,"decoder_input_ids"),m9.forEach(t),DP=n(ae," of shape "),D_=r(ae,"CODE",{});var f9=a(D_);SP=n(f9,"(batch_size, sequence_length)"),f9.forEach(t),UP=n(ae,`.
use_cache (`),S_=r(ae,"CODE",{});var u9=a(S_);WP=n(u9,"bool"),u9.forEach(t),HP=n(ae,", "),U_=r(ae,"EM",{});var g9=a(U_);RP=n(g9,"optional"),g9.forEach(t),KP=n(ae,", defaults to "),W_=r(ae,"CODE",{});var _9=a(W_);QP=n(_9,"True"),_9.forEach(t),VP=n(ae,`):
If set to `),H_=r(ae,"CODE",{});var b9=a(H_);GP=n(b9,"True"),b9.forEach(t),JP=n(ae,", "),R_=r(ae,"CODE",{});var k9=a(R_);XP=n(k9,"past_key_values"),k9.forEach(t),YP=n(ae,` key value states are returned and can be used to speed up decoding (see
`),K_=r(ae,"CODE",{});var y9=a(K_);ZP=n(y9,"past_key_values"),y9.forEach(t),ej=n(ae,"). Set to "),Q_=r(ae,"CODE",{});var T9=a(Q_);tj=n(T9,"False"),T9.forEach(t),oj=n(ae," during training, "),V_=r(ae,"CODE",{});var v9=a(V_);nj=n(v9,"True"),v9.forEach(t),sj=n(ae,` during generation
labels (`),G_=r(ae,"CODE",{});var w9=a(G_);rj=n(w9,"tf.Tensor"),w9.forEach(t),aj=n(ae," or "),J_=r(ae,"CODE",{});var $9=a(J_);ij=n($9,"np.ndarray"),$9.forEach(t),lj=n(ae," of shape "),X_=r(ae,"CODE",{});var F9=a(X_);dj=n(F9,"(batch_size, sequence_length)"),F9.forEach(t),cj=n(ae,", "),Y_=r(ae,"EM",{});var x9=a(Y_);pj=n(x9,"optional"),x9.forEach(t),hj=n(ae,`):
Labels for computing the cross entropy classification loss. Indices should be in `),Z_=r(ae,"CODE",{});var E9=a(Z_);mj=n(E9,"[0, ..., config.vocab_size - 1]"),E9.forEach(t),fj=n(ae,"."),ae.forEach(t),uj=p(zn),v(ea.$$.fragment,zn),zn.forEach(t),K1.forEach(t),ev=p(i),ys=r(i,"H2",{class:!0});var J1=a(ys);ta=r(J1,"A",{id:!0,class:!0,href:!0});var B9=a(ta);eb=r(B9,"SPAN",{});var z9=a(eb);v(Kc.$$.fragment,z9),z9.forEach(t),B9.forEach(t),gj=p(J1),tb=r(J1,"SPAN",{});var M9=a(tb);_j=n(M9,"TFBertForMaskedLM"),M9.forEach(t),J1.forEach(t),tv=p(i),gt=r(i,"DIV",{class:!0});var Po=a(gt);v(Qc.$$.fragment,Po),bj=p(Po),Vc=r(Po,"P",{});var X1=a(Vc);kj=n(X1,"Bert Model with a "),ob=r(X1,"CODE",{});var P9=a(ob);yj=n(P9,"language modeling"),P9.forEach(t),Tj=n(X1," head on top."),X1.forEach(t),vj=p(Po),Gc=r(Po,"P",{});var Y1=a(Gc);wj=n(Y1,"This model inherits from "),jf=r(Y1,"A",{href:!0});var j9=a(jf);$j=n(j9,"TFPreTrainedModel"),j9.forEach(t),Fj=n(Y1,`. 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.)`),Y1.forEach(t),xj=p(Po),Jc=r(Po,"P",{});var Z1=a(Jc);Ej=n(Z1,"This model is also a "),Xc=r(Z1,"A",{href:!0,rel:!0});var q9=a(Xc);Bj=n(q9,"tf.keras.Model"),q9.forEach(t),zj=n(Z1,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Z1.forEach(t),Mj=p(Po),v(oa.$$.fragment,Po),Pj=p(Po),Lt=r(Po,"DIV",{class:!0});var Mn=a(Lt);v(Yc.$$.fragment,Mn),jj=p(Mn),Ts=r(Mn,"P",{});var $u=a(Ts);qj=n($u,"The "),qf=r($u,"A",{href:!0});var C9=a(qf);Cj=n(C9,"TFBertForMaskedLM"),C9.forEach(t),Aj=n($u," forward method, overrides the "),nb=r($u,"CODE",{});var A9=a(nb);Nj=n(A9,"__call__"),A9.forEach(t),Oj=n($u," special method."),$u.forEach(t),Ij=p(Mn),v(na.$$.fragment,Mn),Lj=p(Mn),v(sa.$$.fragment,Mn),Dj=p(Mn),v(ra.$$.fragment,Mn),Mn.forEach(t),Po.forEach(t),ov=p(i),vs=r(i,"H2",{class:!0});var ew=a(vs);aa=r(ew,"A",{id:!0,class:!0,href:!0});var N9=a(aa);sb=r(N9,"SPAN",{});var O9=a(sb);v(Zc.$$.fragment,O9),O9.forEach(t),N9.forEach(t),Sj=p(ew),rb=r(ew,"SPAN",{});var I9=a(rb);Uj=n(I9,"TFBertForNextSentencePrediction"),I9.forEach(t),ew.forEach(t),nv=p(i),_t=r(i,"DIV",{class:!0});var jo=a(_t);v(ep.$$.fragment,jo),Wj=p(jo),tp=r(jo,"P",{});var tw=a(tp);Hj=n(tw,"Bert Model with a "),ab=r(tw,"CODE",{});var L9=a(ab);Rj=n(L9,"next sentence prediction (classification)"),L9.forEach(t),Kj=n(tw," head on top."),tw.forEach(t),Qj=p(jo),op=r(jo,"P",{});var ow=a(op);Vj=n(ow,"This model inherits from "),Cf=r(ow,"A",{href:!0});var D9=a(Cf);Gj=n(D9,"TFPreTrainedModel"),D9.forEach(t),Jj=n(ow,`. 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.)`),ow.forEach(t),Xj=p(jo),np=r(jo,"P",{});var nw=a(np);Yj=n(nw,"This model is also a "),sp=r(nw,"A",{href:!0,rel:!0});var S9=a(sp);Zj=n(S9,"tf.keras.Model"),S9.forEach(t),eq=n(nw,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),nw.forEach(t),tq=p(jo),v(ia.$$.fragment,jo),oq=p(jo),_o=r(jo,"DIV",{class:!0});var bi=a(_o);v(rp.$$.fragment,bi),nq=p(bi),ws=r(bi,"P",{});var Fu=a(ws);sq=n(Fu,"The "),Af=r(Fu,"A",{href:!0});var U9=a(Af);rq=n(U9,"TFBertForNextSentencePrediction"),U9.forEach(t),aq=n(Fu," forward method, overrides the "),ib=r(Fu,"CODE",{});var W9=a(ib);iq=n(W9,"__call__"),W9.forEach(t),lq=n(Fu," special method."),Fu.forEach(t),dq=p(bi),v(la.$$.fragment,bi),cq=p(bi),v(da.$$.fragment,bi),bi.forEach(t),jo.forEach(t),sv=p(i),$s=r(i,"H2",{class:!0});var sw=a($s);ca=r(sw,"A",{id:!0,class:!0,href:!0});var H9=a(ca);lb=r(H9,"SPAN",{});var R9=a(lb);v(ap.$$.fragment,R9),R9.forEach(t),H9.forEach(t),pq=p(sw),db=r(sw,"SPAN",{});var K9=a(db);hq=n(K9,"TFBertForSequenceClassification"),K9.forEach(t),sw.forEach(t),rv=p(i),bt=r(i,"DIV",{class:!0});var qo=a(bt);v(ip.$$.fragment,qo),mq=p(qo),cb=r(qo,"P",{});var Q9=a(cb);fq=n(Q9,`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.`),Q9.forEach(t),uq=p(qo),lp=r(qo,"P",{});var rw=a(lp);gq=n(rw,"This model inherits from "),Nf=r(rw,"A",{href:!0});var V9=a(Nf);_q=n(V9,"TFPreTrainedModel"),V9.forEach(t),bq=n(rw,`. 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.)`),rw.forEach(t),kq=p(qo),dp=r(qo,"P",{});var aw=a(dp);yq=n(aw,"This model is also a "),cp=r(aw,"A",{href:!0,rel:!0});var G9=a(cp);Tq=n(G9,"tf.keras.Model"),G9.forEach(t),vq=n(aw,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),aw.forEach(t),wq=p(qo),v(pa.$$.fragment,qo),$q=p(qo),Dt=r(qo,"DIV",{class:!0});var Pn=a(Dt);v(pp.$$.fragment,Pn),Fq=p(Pn),Fs=r(Pn,"P",{});var xu=a(Fs);xq=n(xu,"The "),Of=r(xu,"A",{href:!0});var J9=a(Of);Eq=n(J9,"TFBertForSequenceClassification"),J9.forEach(t),Bq=n(xu," forward method, overrides the "),pb=r(xu,"CODE",{});var X9=a(pb);zq=n(X9,"__call__"),X9.forEach(t),Mq=n(xu," special method."),xu.forEach(t),Pq=p(Pn),v(ha.$$.fragment,Pn),jq=p(Pn),v(ma.$$.fragment,Pn),qq=p(Pn),v(fa.$$.fragment,Pn),Pn.forEach(t),qo.forEach(t),av=p(i),xs=r(i,"H2",{class:!0});var iw=a(xs);ua=r(iw,"A",{id:!0,class:!0,href:!0});var Y9=a(ua);hb=r(Y9,"SPAN",{});var Z9=a(hb);v(hp.$$.fragment,Z9),Z9.forEach(t),Y9.forEach(t),Cq=p(iw),mb=r(iw,"SPAN",{});var eL=a(mb);Aq=n(eL,"TFBertForMultipleChoice"),eL.forEach(t),iw.forEach(t),iv=p(i),kt=r(i,"DIV",{class:!0});var Co=a(kt);v(mp.$$.fragment,Co),Nq=p(Co),fb=r(Co,"P",{});var tL=a(fb);Oq=n(tL,`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.`),tL.forEach(t),Iq=p(Co),fp=r(Co,"P",{});var lw=a(fp);Lq=n(lw,"This model inherits from "),If=r(lw,"A",{href:!0});var oL=a(If);Dq=n(oL,"TFPreTrainedModel"),oL.forEach(t),Sq=n(lw,`. 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.)`),lw.forEach(t),Uq=p(Co),up=r(Co,"P",{});var dw=a(up);Wq=n(dw,"This model is also a "),gp=r(dw,"A",{href:!0,rel:!0});var nL=a(gp);Hq=n(nL,"tf.keras.Model"),nL.forEach(t),Rq=n(dw,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),dw.forEach(t),Kq=p(Co),v(ga.$$.fragment,Co),Qq=p(Co),bo=r(Co,"DIV",{class:!0});var ki=a(bo);v(_p.$$.fragment,ki),Vq=p(ki),Es=r(ki,"P",{});var Eu=a(Es);Gq=n(Eu,"The "),Lf=r(Eu,"A",{href:!0});var sL=a(Lf);Jq=n(sL,"TFBertForMultipleChoice"),sL.forEach(t),Xq=n(Eu," forward method, overrides the "),ub=r(Eu,"CODE",{});var rL=a(ub);Yq=n(rL,"__call__"),rL.forEach(t),Zq=n(Eu," special method."),Eu.forEach(t),e3=p(ki),v(_a.$$.fragment,ki),t3=p(ki),v(ba.$$.fragment,ki),ki.forEach(t),Co.forEach(t),lv=p(i),Bs=r(i,"H2",{class:!0});var cw=a(Bs);ka=r(cw,"A",{id:!0,class:!0,href:!0});var aL=a(ka);gb=r(aL,"SPAN",{});var iL=a(gb);v(bp.$$.fragment,iL),iL.forEach(t),aL.forEach(t),o3=p(cw),_b=r(cw,"SPAN",{});var lL=a(_b);n3=n(lL,"TFBertForTokenClassification"),lL.forEach(t),cw.forEach(t),dv=p(i),yt=r(i,"DIV",{class:!0});var Ao=a(yt);v(kp.$$.fragment,Ao),s3=p(Ao),bb=r(Ao,"P",{});var dL=a(bb);r3=n(dL,`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.`),dL.forEach(t),a3=p(Ao),yp=r(Ao,"P",{});var pw=a(yp);i3=n(pw,"This model inherits from "),Df=r(pw,"A",{href:!0});var cL=a(Df);l3=n(cL,"TFPreTrainedModel"),cL.forEach(t),d3=n(pw,`. 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.)`),pw.forEach(t),c3=p(Ao),Tp=r(Ao,"P",{});var hw=a(Tp);p3=n(hw,"This model is also a "),vp=r(hw,"A",{href:!0,rel:!0});var pL=a(vp);h3=n(pL,"tf.keras.Model"),pL.forEach(t),m3=n(hw,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),hw.forEach(t),f3=p(Ao),v(ya.$$.fragment,Ao),u3=p(Ao),St=r(Ao,"DIV",{class:!0});var jn=a(St);v(wp.$$.fragment,jn),g3=p(jn),zs=r(jn,"P",{});var Bu=a(zs);_3=n(Bu,"The "),Sf=r(Bu,"A",{href:!0});var hL=a(Sf);b3=n(hL,"TFBertForTokenClassification"),hL.forEach(t),k3=n(Bu," forward method, overrides the "),kb=r(Bu,"CODE",{});var mL=a(kb);y3=n(mL,"__call__"),mL.forEach(t),T3=n(Bu," special method."),Bu.forEach(t),v3=p(jn),v(Ta.$$.fragment,jn),w3=p(jn),v(va.$$.fragment,jn),$3=p(jn),v(wa.$$.fragment,jn),jn.forEach(t),Ao.forEach(t),cv=p(i),Ms=r(i,"H2",{class:!0});var mw=a(Ms);$a=r(mw,"A",{id:!0,class:!0,href:!0});var fL=a($a);yb=r(fL,"SPAN",{});var uL=a(yb);v($p.$$.fragment,uL),uL.forEach(t),fL.forEach(t),F3=p(mw),Tb=r(mw,"SPAN",{});var gL=a(Tb);x3=n(gL,"TFBertForQuestionAnswering"),gL.forEach(t),mw.forEach(t),pv=p(i),Tt=r(i,"DIV",{class:!0});var No=a(Tt);v(Fp.$$.fragment,No),E3=p(No),Ps=r(No,"P",{});var zu=a(Ps);B3=n(zu,`Bert Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layer on top of the hidden-states output to compute `),vb=r(zu,"CODE",{});var _L=a(vb);z3=n(_L,"span start logits"),_L.forEach(t),M3=n(zu," and "),wb=r(zu,"CODE",{});var bL=a(wb);P3=n(bL,"span end logits"),bL.forEach(t),j3=n(zu,")."),zu.forEach(t),q3=p(No),xp=r(No,"P",{});var fw=a(xp);C3=n(fw,"This model inherits from "),Uf=r(fw,"A",{href:!0});var kL=a(Uf);A3=n(kL,"TFPreTrainedModel"),kL.forEach(t),N3=n(fw,`. 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.)`),fw.forEach(t),O3=p(No),Ep=r(No,"P",{});var uw=a(Ep);I3=n(uw,"This model is also a "),Bp=r(uw,"A",{href:!0,rel:!0});var yL=a(Bp);L3=n(yL,"tf.keras.Model"),yL.forEach(t),D3=n(uw,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),uw.forEach(t),S3=p(No),v(Fa.$$.fragment,No),U3=p(No),Ut=r(No,"DIV",{class:!0});var qn=a(Ut);v(zp.$$.fragment,qn),W3=p(qn),js=r(qn,"P",{});var Mu=a(js);H3=n(Mu,"The "),Wf=r(Mu,"A",{href:!0});var TL=a(Wf);R3=n(TL,"TFBertForQuestionAnswering"),TL.forEach(t),K3=n(Mu," forward method, overrides the "),$b=r(Mu,"CODE",{});var vL=a($b);Q3=n(vL,"__call__"),vL.forEach(t),V3=n(Mu," special method."),Mu.forEach(t),G3=p(qn),v(xa.$$.fragment,qn),J3=p(qn),v(Ea.$$.fragment,qn),X3=p(qn),v(Ba.$$.fragment,qn),qn.forEach(t),No.forEach(t),hv=p(i),qs=r(i,"H2",{class:!0});var gw=a(qs);za=r(gw,"A",{id:!0,class:!0,href:!0});var wL=a(za);Fb=r(wL,"SPAN",{});var $L=a(Fb);v(Mp.$$.fragment,$L),$L.forEach(t),wL.forEach(t),Y3=p(gw),xb=r(gw,"SPAN",{});var FL=a(xb);Z3=n(FL,"FlaxBertModel"),FL.forEach(t),gw.forEach(t),mv=p(i),st=r(i,"DIV",{class:!0});var Kt=a(st);v(Pp.$$.fragment,Kt),eC=p(Kt),Eb=r(Kt,"P",{});var xL=a(Eb);tC=n(xL,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),xL.forEach(t),oC=p(Kt),jp=r(Kt,"P",{});var _w=a(jp);nC=n(_w,"This model inherits from "),Hf=r(_w,"A",{href:!0});var EL=a(Hf);sC=n(EL,"FlaxPreTrainedModel"),EL.forEach(t),rC=n(_w,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),_w.forEach(t),aC=p(Kt),qp=r(Kt,"P",{});var bw=a(qp);iC=n(bw,"This model is also a Flax Linen "),Cp=r(bw,"A",{href:!0,rel:!0});var BL=a(Cp);lC=n(BL,"flax.linen.Module"),BL.forEach(t),dC=n(bw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),bw.forEach(t),cC=p(Kt),Bb=r(Kt,"P",{});var zL=a(Bb);pC=n(zL,"Finally, this model supports inherent JAX features such as:"),zL.forEach(t),hC=p(Kt),Lo=r(Kt,"UL",{});var yi=a(Lo);zb=r(yi,"LI",{});var ML=a(zb);Ap=r(ML,"A",{href:!0,rel:!0});var PL=a(Ap);mC=n(PL,"Just-In-Time (JIT) compilation"),PL.forEach(t),ML.forEach(t),fC=p(yi),Mb=r(yi,"LI",{});var jL=a(Mb);Np=r(jL,"A",{href:!0,rel:!0});var qL=a(Np);uC=n(qL,"Automatic Differentiation"),qL.forEach(t),jL.forEach(t),gC=p(yi),Pb=r(yi,"LI",{});var CL=a(Pb);Op=r(CL,"A",{href:!0,rel:!0});var AL=a(Op);_C=n(AL,"Vectorization"),AL.forEach(t),CL.forEach(t),bC=p(yi),jb=r(yi,"LI",{});var NL=a(jb);Ip=r(NL,"A",{href:!0,rel:!0});var OL=a(Ip);kC=n(OL,"Parallelization"),OL.forEach(t),NL.forEach(t),yi.forEach(t),yC=p(Kt),ko=r(Kt,"DIV",{class:!0});var Ti=a(ko);v(Lp.$$.fragment,Ti),TC=p(Ti),Cs=r(Ti,"P",{});var Pu=a(Cs);vC=n(Pu,"The "),qb=r(Pu,"CODE",{});var IL=a(qb);wC=n(IL,"FlaxBertPreTrainedModel"),IL.forEach(t),$C=n(Pu," forward method, overrides the "),Cb=r(Pu,"CODE",{});var LL=a(Cb);FC=n(LL,"__call__"),LL.forEach(t),xC=n(Pu," special method."),Pu.forEach(t),EC=p(Ti),v(Ma.$$.fragment,Ti),BC=p(Ti),v(Pa.$$.fragment,Ti),Ti.forEach(t),Kt.forEach(t),fv=p(i),As=r(i,"H2",{class:!0});var kw=a(As);ja=r(kw,"A",{id:!0,class:!0,href:!0});var DL=a(ja);Ab=r(DL,"SPAN",{});var SL=a(Ab);v(Dp.$$.fragment,SL),SL.forEach(t),DL.forEach(t),zC=p(kw),Nb=r(kw,"SPAN",{});var UL=a(Nb);MC=n(UL,"FlaxBertForPreTraining"),UL.forEach(t),kw.forEach(t),uv=p(i),rt=r(i,"DIV",{class:!0});var Qt=a(rt);v(Sp.$$.fragment,Qt),PC=p(Qt),Ns=r(Qt,"P",{});var ju=a(Ns);jC=n(ju,"Bert Model with two heads on top as done during the pretraining: a "),Ob=r(ju,"CODE",{});var WL=a(Ob);qC=n(WL,"masked language modeling"),WL.forEach(t),CC=n(ju," head and a "),Ib=r(ju,"CODE",{});var HL=a(Ib);AC=n(HL,"next sentence prediction (classification)"),HL.forEach(t),NC=n(ju," head."),ju.forEach(t),OC=p(Qt),Up=r(Qt,"P",{});var yw=a(Up);IC=n(yw,"This model inherits from "),Rf=r(yw,"A",{href:!0});var RL=a(Rf);LC=n(RL,"FlaxPreTrainedModel"),RL.forEach(t),DC=n(yw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),yw.forEach(t),SC=p(Qt),Wp=r(Qt,"P",{});var Tw=a(Wp);UC=n(Tw,"This model is also a Flax Linen "),Hp=r(Tw,"A",{href:!0,rel:!0});var KL=a(Hp);WC=n(KL,"flax.linen.Module"),KL.forEach(t),HC=n(Tw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Tw.forEach(t),RC=p(Qt),Lb=r(Qt,"P",{});var QL=a(Lb);KC=n(QL,"Finally, this model supports inherent JAX features such as:"),QL.forEach(t),QC=p(Qt),Do=r(Qt,"UL",{});var vi=a(Do);Db=r(vi,"LI",{});var VL=a(Db);Rp=r(VL,"A",{href:!0,rel:!0});var GL=a(Rp);VC=n(GL,"Just-In-Time (JIT) compilation"),GL.forEach(t),VL.forEach(t),GC=p(vi),Sb=r(vi,"LI",{});var JL=a(Sb);Kp=r(JL,"A",{href:!0,rel:!0});var XL=a(Kp);JC=n(XL,"Automatic Differentiation"),XL.forEach(t),JL.forEach(t),XC=p(vi),Ub=r(vi,"LI",{});var YL=a(Ub);Qp=r(YL,"A",{href:!0,rel:!0});var ZL=a(Qp);YC=n(ZL,"Vectorization"),ZL.forEach(t),YL.forEach(t),ZC=p(vi),Wb=r(vi,"LI",{});var eD=a(Wb);Vp=r(eD,"A",{href:!0,rel:!0});var tD=a(Vp);e6=n(tD,"Parallelization"),tD.forEach(t),eD.forEach(t),vi.forEach(t),t6=p(Qt),yo=r(Qt,"DIV",{class:!0});var wi=a(yo);v(Gp.$$.fragment,wi),o6=p(wi),Os=r(wi,"P",{});var qu=a(Os);n6=n(qu,"The "),Hb=r(qu,"CODE",{});var oD=a(Hb);s6=n(oD,"FlaxBertPreTrainedModel"),oD.forEach(t),r6=n(qu," forward method, overrides the "),Rb=r(qu,"CODE",{});var nD=a(Rb);a6=n(nD,"__call__"),nD.forEach(t),i6=n(qu," special method."),qu.forEach(t),l6=p(wi),v(qa.$$.fragment,wi),d6=p(wi),v(Ca.$$.fragment,wi),wi.forEach(t),Qt.forEach(t),gv=p(i),Is=r(i,"H2",{class:!0});var vw=a(Is);Aa=r(vw,"A",{id:!0,class:!0,href:!0});var sD=a(Aa);Kb=r(sD,"SPAN",{});var rD=a(Kb);v(Jp.$$.fragment,rD),rD.forEach(t),sD.forEach(t),c6=p(vw),Qb=r(vw,"SPAN",{});var aD=a(Qb);p6=n(aD,"FlaxBertForCausalLM"),aD.forEach(t),vw.forEach(t),_v=p(i),at=r(i,"DIV",{class:!0});var Vt=a(at);v(Xp.$$.fragment,Vt),h6=p(Vt),Vb=r(Vt,"P",{});var iD=a(Vb);m6=n(iD,`Bert Model with a language modeling head on top (a linear layer on top of the hidden-states output) e.g for
autoregressive tasks.`),iD.forEach(t),f6=p(Vt),Yp=r(Vt,"P",{});var ww=a(Yp);u6=n(ww,"This model inherits from "),Kf=r(ww,"A",{href:!0});var lD=a(Kf);g6=n(lD,"FlaxPreTrainedModel"),lD.forEach(t),_6=n(ww,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),ww.forEach(t),b6=p(Vt),Zp=r(Vt,"P",{});var $w=a(Zp);k6=n($w,"This model is also a Flax Linen "),eh=r($w,"A",{href:!0,rel:!0});var dD=a(eh);y6=n(dD,"flax.linen.Module"),dD.forEach(t),T6=n($w,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),$w.forEach(t),v6=p(Vt),Gb=r(Vt,"P",{});var cD=a(Gb);w6=n(cD,"Finally, this model supports inherent JAX features such as:"),cD.forEach(t),$6=p(Vt),So=r(Vt,"UL",{});var $i=a(So);Jb=r($i,"LI",{});var pD=a(Jb);th=r(pD,"A",{href:!0,rel:!0});var hD=a(th);F6=n(hD,"Just-In-Time (JIT) compilation"),hD.forEach(t),pD.forEach(t),x6=p($i),Xb=r($i,"LI",{});var mD=a(Xb);oh=r(mD,"A",{href:!0,rel:!0});var fD=a(oh);E6=n(fD,"Automatic Differentiation"),fD.forEach(t),mD.forEach(t),B6=p($i),Yb=r($i,"LI",{});var uD=a(Yb);nh=r(uD,"A",{href:!0,rel:!0});var gD=a(nh);z6=n(gD,"Vectorization"),gD.forEach(t),uD.forEach(t),M6=p($i),Zb=r($i,"LI",{});var _D=a(Zb);sh=r(_D,"A",{href:!0,rel:!0});var bD=a(sh);P6=n(bD,"Parallelization"),bD.forEach(t),_D.forEach(t),$i.forEach(t),j6=p(Vt),To=r(Vt,"DIV",{class:!0});var Fi=a(To);v(rh.$$.fragment,Fi),q6=p(Fi),Ls=r(Fi,"P",{});var Cu=a(Ls);C6=n(Cu,"The "),ek=r(Cu,"CODE",{});var kD=a(ek);A6=n(kD,"FlaxBertPreTrainedModel"),kD.forEach(t),N6=n(Cu," forward method, overrides the "),tk=r(Cu,"CODE",{});var yD=a(tk);O6=n(yD,"__call__"),yD.forEach(t),I6=n(Cu," special method."),Cu.forEach(t),L6=p(Fi),v(Na.$$.fragment,Fi),D6=p(Fi),v(Oa.$$.fragment,Fi),Fi.forEach(t),Vt.forEach(t),bv=p(i),Ds=r(i,"H2",{class:!0});var Fw=a(Ds);Ia=r(Fw,"A",{id:!0,class:!0,href:!0});var TD=a(Ia);ok=r(TD,"SPAN",{});var vD=a(ok);v(ah.$$.fragment,vD),vD.forEach(t),TD.forEach(t),S6=p(Fw),nk=r(Fw,"SPAN",{});var wD=a(nk);U6=n(wD,"FlaxBertForMaskedLM"),wD.forEach(t),Fw.forEach(t),kv=p(i),it=r(i,"DIV",{class:!0});var Gt=a(it);v(ih.$$.fragment,Gt),W6=p(Gt),lh=r(Gt,"P",{});var xw=a(lh);H6=n(xw,"Bert Model with a "),sk=r(xw,"CODE",{});var $D=a(sk);R6=n($D,"language modeling"),$D.forEach(t),K6=n(xw," head on top."),xw.forEach(t),Q6=p(Gt),dh=r(Gt,"P",{});var Ew=a(dh);V6=n(Ew,"This model inherits from "),Qf=r(Ew,"A",{href:!0});var FD=a(Qf);G6=n(FD,"FlaxPreTrainedModel"),FD.forEach(t),J6=n(Ew,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Ew.forEach(t),X6=p(Gt),ch=r(Gt,"P",{});var Bw=a(ch);Y6=n(Bw,"This model is also a Flax Linen "),ph=r(Bw,"A",{href:!0,rel:!0});var xD=a(ph);Z6=n(xD,"flax.linen.Module"),xD.forEach(t),e5=n(Bw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Bw.forEach(t),t5=p(Gt),rk=r(Gt,"P",{});var ED=a(rk);o5=n(ED,"Finally, this model supports inherent JAX features such as:"),ED.forEach(t),n5=p(Gt),Uo=r(Gt,"UL",{});var xi=a(Uo);ak=r(xi,"LI",{});var BD=a(ak);hh=r(BD,"A",{href:!0,rel:!0});var zD=a(hh);s5=n(zD,"Just-In-Time (JIT) compilation"),zD.forEach(t),BD.forEach(t),r5=p(xi),ik=r(xi,"LI",{});var MD=a(ik);mh=r(MD,"A",{href:!0,rel:!0});var PD=a(mh);a5=n(PD,"Automatic Differentiation"),PD.forEach(t),MD.forEach(t),i5=p(xi),lk=r(xi,"LI",{});var jD=a(lk);fh=r(jD,"A",{href:!0,rel:!0});var qD=a(fh);l5=n(qD,"Vectorization"),qD.forEach(t),jD.forEach(t),d5=p(xi),dk=r(xi,"LI",{});var CD=a(dk);uh=r(CD,"A",{href:!0,rel:!0});var AD=a(uh);c5=n(AD,"Parallelization"),AD.forEach(t),CD.forEach(t),xi.forEach(t),p5=p(Gt),vo=r(Gt,"DIV",{class:!0});var Ei=a(vo);v(gh.$$.fragment,Ei),h5=p(Ei),Ss=r(Ei,"P",{});var Au=a(Ss);m5=n(Au,"The "),ck=r(Au,"CODE",{});var ND=a(ck);f5=n(ND,"FlaxBertPreTrainedModel"),ND.forEach(t),u5=n(Au," forward method, overrides the "),pk=r(Au,"CODE",{});var OD=a(pk);g5=n(OD,"__call__"),OD.forEach(t),_5=n(Au," special method."),Au.forEach(t),b5=p(Ei),v(La.$$.fragment,Ei),k5=p(Ei),v(Da.$$.fragment,Ei),Ei.forEach(t),Gt.forEach(t),yv=p(i),Us=r(i,"H2",{class:!0});var zw=a(Us);Sa=r(zw,"A",{id:!0,class:!0,href:!0});var ID=a(Sa);hk=r(ID,"SPAN",{});var LD=a(hk);v(_h.$$.fragment,LD),LD.forEach(t),ID.forEach(t),y5=p(zw),mk=r(zw,"SPAN",{});var DD=a(mk);T5=n(DD,"FlaxBertForNextSentencePrediction"),DD.forEach(t),zw.forEach(t),Tv=p(i),lt=r(i,"DIV",{class:!0});var Jt=a(lt);v(bh.$$.fragment,Jt),v5=p(Jt),kh=r(Jt,"P",{});var Mw=a(kh);w5=n(Mw,"Bert Model with a "),fk=r(Mw,"CODE",{});var SD=a(fk);$5=n(SD,"next sentence prediction (classification)"),SD.forEach(t),F5=n(Mw," head on top."),Mw.forEach(t),x5=p(Jt),yh=r(Jt,"P",{});var Pw=a(yh);E5=n(Pw,"This model inherits from "),Vf=r(Pw,"A",{href:!0});var UD=a(Vf);B5=n(UD,"FlaxPreTrainedModel"),UD.forEach(t),z5=n(Pw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Pw.forEach(t),M5=p(Jt),Th=r(Jt,"P",{});var jw=a(Th);P5=n(jw,"This model is also a Flax Linen "),vh=r(jw,"A",{href:!0,rel:!0});var WD=a(vh);j5=n(WD,"flax.linen.Module"),WD.forEach(t),q5=n(jw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),jw.forEach(t),C5=p(Jt),uk=r(Jt,"P",{});var HD=a(uk);A5=n(HD,"Finally, this model supports inherent JAX features such as:"),HD.forEach(t),N5=p(Jt),Wo=r(Jt,"UL",{});var Bi=a(Wo);gk=r(Bi,"LI",{});var RD=a(gk);wh=r(RD,"A",{href:!0,rel:!0});var KD=a(wh);O5=n(KD,"Just-In-Time (JIT) compilation"),KD.forEach(t),RD.forEach(t),I5=p(Bi),_k=r(Bi,"LI",{});var QD=a(_k);$h=r(QD,"A",{href:!0,rel:!0});var VD=a($h);L5=n(VD,"Automatic Differentiation"),VD.forEach(t),QD.forEach(t),D5=p(Bi),bk=r(Bi,"LI",{});var GD=a(bk);Fh=r(GD,"A",{href:!0,rel:!0});var JD=a(Fh);S5=n(JD,"Vectorization"),JD.forEach(t),GD.forEach(t),U5=p(Bi),kk=r(Bi,"LI",{});var XD=a(kk);xh=r(XD,"A",{href:!0,rel:!0});var YD=a(xh);W5=n(YD,"Parallelization"),YD.forEach(t),XD.forEach(t),Bi.forEach(t),H5=p(Jt),wo=r(Jt,"DIV",{class:!0});var zi=a(wo);v(Eh.$$.fragment,zi),R5=p(zi),Ws=r(zi,"P",{});var Nu=a(Ws);K5=n(Nu,"The "),yk=r(Nu,"CODE",{});var ZD=a(yk);Q5=n(ZD,"FlaxBertPreTrainedModel"),ZD.forEach(t),V5=n(Nu," forward method, overrides the "),Tk=r(Nu,"CODE",{});var eS=a(Tk);G5=n(eS,"__call__"),eS.forEach(t),J5=n(Nu," special method."),Nu.forEach(t),X5=p(zi),v(Ua.$$.fragment,zi),Y5=p(zi),v(Wa.$$.fragment,zi),zi.forEach(t),Jt.forEach(t),vv=p(i),Hs=r(i,"H2",{class:!0});var qw=a(Hs);Ha=r(qw,"A",{id:!0,class:!0,href:!0});var tS=a(Ha);vk=r(tS,"SPAN",{});var oS=a(vk);v(Bh.$$.fragment,oS),oS.forEach(t),tS.forEach(t),Z5=p(qw),wk=r(qw,"SPAN",{});var nS=a(wk);eA=n(nS,"FlaxBertForSequenceClassification"),nS.forEach(t),qw.forEach(t),wv=p(i),dt=r(i,"DIV",{class:!0});var Xt=a(dt);v(zh.$$.fragment,Xt),tA=p(Xt),$k=r(Xt,"P",{});var sS=a($k);oA=n(sS,`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.`),sS.forEach(t),nA=p(Xt),Mh=r(Xt,"P",{});var Cw=a(Mh);sA=n(Cw,"This model inherits from "),Gf=r(Cw,"A",{href:!0});var rS=a(Gf);rA=n(rS,"FlaxPreTrainedModel"),rS.forEach(t),aA=n(Cw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Cw.forEach(t),iA=p(Xt),Ph=r(Xt,"P",{});var Aw=a(Ph);lA=n(Aw,"This model is also a Flax Linen "),jh=r(Aw,"A",{href:!0,rel:!0});var aS=a(jh);dA=n(aS,"flax.linen.Module"),aS.forEach(t),cA=n(Aw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Aw.forEach(t),pA=p(Xt),Fk=r(Xt,"P",{});var iS=a(Fk);hA=n(iS,"Finally, this model supports inherent JAX features such as:"),iS.forEach(t),mA=p(Xt),Ho=r(Xt,"UL",{});var Mi=a(Ho);xk=r(Mi,"LI",{});var lS=a(xk);qh=r(lS,"A",{href:!0,rel:!0});var dS=a(qh);fA=n(dS,"Just-In-Time (JIT) compilation"),dS.forEach(t),lS.forEach(t),uA=p(Mi),Ek=r(Mi,"LI",{});var cS=a(Ek);Ch=r(cS,"A",{href:!0,rel:!0});var pS=a(Ch);gA=n(pS,"Automatic Differentiation"),pS.forEach(t),cS.forEach(t),_A=p(Mi),Bk=r(Mi,"LI",{});var hS=a(Bk);Ah=r(hS,"A",{href:!0,rel:!0});var mS=a(Ah);bA=n(mS,"Vectorization"),mS.forEach(t),hS.forEach(t),kA=p(Mi),zk=r(Mi,"LI",{});var fS=a(zk);Nh=r(fS,"A",{href:!0,rel:!0});var uS=a(Nh);yA=n(uS,"Parallelization"),uS.forEach(t),fS.forEach(t),Mi.forEach(t),TA=p(Xt),$o=r(Xt,"DIV",{class:!0});var Pi=a($o);v(Oh.$$.fragment,Pi),vA=p(Pi),Rs=r(Pi,"P",{});var Ou=a(Rs);wA=n(Ou,"The "),Mk=r(Ou,"CODE",{});var gS=a(Mk);$A=n(gS,"FlaxBertPreTrainedModel"),gS.forEach(t),FA=n(Ou," forward method, overrides the "),Pk=r(Ou,"CODE",{});var _S=a(Pk);xA=n(_S,"__call__"),_S.forEach(t),EA=n(Ou," special method."),Ou.forEach(t),BA=p(Pi),v(Ra.$$.fragment,Pi),zA=p(Pi),v(Ka.$$.fragment,Pi),Pi.forEach(t),Xt.forEach(t),$v=p(i),Ks=r(i,"H2",{class:!0});var Nw=a(Ks);Qa=r(Nw,"A",{id:!0,class:!0,href:!0});var bS=a(Qa);jk=r(bS,"SPAN",{});var kS=a(jk);v(Ih.$$.fragment,kS),kS.forEach(t),bS.forEach(t),MA=p(Nw),qk=r(Nw,"SPAN",{});var yS=a(qk);PA=n(yS,"FlaxBertForMultipleChoice"),yS.forEach(t),Nw.forEach(t),Fv=p(i),ct=r(i,"DIV",{class:!0});var Yt=a(ct);v(Lh.$$.fragment,Yt),jA=p(Yt),Ck=r(Yt,"P",{});var TS=a(Ck);qA=n(TS,`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.`),TS.forEach(t),CA=p(Yt),Dh=r(Yt,"P",{});var Ow=a(Dh);AA=n(Ow,"This model inherits from "),Jf=r(Ow,"A",{href:!0});var vS=a(Jf);NA=n(vS,"FlaxPreTrainedModel"),vS.forEach(t),OA=n(Ow,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Ow.forEach(t),IA=p(Yt),Sh=r(Yt,"P",{});var Iw=a(Sh);LA=n(Iw,"This model is also a Flax Linen "),Uh=r(Iw,"A",{href:!0,rel:!0});var wS=a(Uh);DA=n(wS,"flax.linen.Module"),wS.forEach(t),SA=n(Iw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Iw.forEach(t),UA=p(Yt),Ak=r(Yt,"P",{});var $S=a(Ak);WA=n($S,"Finally, this model supports inherent JAX features such as:"),$S.forEach(t),HA=p(Yt),Ro=r(Yt,"UL",{});var ji=a(Ro);Nk=r(ji,"LI",{});var FS=a(Nk);Wh=r(FS,"A",{href:!0,rel:!0});var xS=a(Wh);RA=n(xS,"Just-In-Time (JIT) compilation"),xS.forEach(t),FS.forEach(t),KA=p(ji),Ok=r(ji,"LI",{});var ES=a(Ok);Hh=r(ES,"A",{href:!0,rel:!0});var BS=a(Hh);QA=n(BS,"Automatic Differentiation"),BS.forEach(t),ES.forEach(t),VA=p(ji),Ik=r(ji,"LI",{});var zS=a(Ik);Rh=r(zS,"A",{href:!0,rel:!0});var MS=a(Rh);GA=n(MS,"Vectorization"),MS.forEach(t),zS.forEach(t),JA=p(ji),Lk=r(ji,"LI",{});var PS=a(Lk);Kh=r(PS,"A",{href:!0,rel:!0});var jS=a(Kh);XA=n(jS,"Parallelization"),jS.forEach(t),PS.forEach(t),ji.forEach(t),YA=p(Yt),Fo=r(Yt,"DIV",{class:!0});var qi=a(Fo);v(Qh.$$.fragment,qi),ZA=p(qi),Qs=r(qi,"P",{});var Iu=a(Qs);e7=n(Iu,"The "),Dk=r(Iu,"CODE",{});var qS=a(Dk);t7=n(qS,"FlaxBertPreTrainedModel"),qS.forEach(t),o7=n(Iu," forward method, overrides the "),Sk=r(Iu,"CODE",{});var CS=a(Sk);n7=n(CS,"__call__"),CS.forEach(t),s7=n(Iu," special method."),Iu.forEach(t),r7=p(qi),v(Va.$$.fragment,qi),a7=p(qi),v(Ga.$$.fragment,qi),qi.forEach(t),Yt.forEach(t),xv=p(i),Vs=r(i,"H2",{class:!0});var Lw=a(Vs);Ja=r(Lw,"A",{id:!0,class:!0,href:!0});var AS=a(Ja);Uk=r(AS,"SPAN",{});var NS=a(Uk);v(Vh.$$.fragment,NS),NS.forEach(t),AS.forEach(t),i7=p(Lw),Wk=r(Lw,"SPAN",{});var OS=a(Wk);l7=n(OS,"FlaxBertForTokenClassification"),OS.forEach(t),Lw.forEach(t),Ev=p(i),pt=r(i,"DIV",{class:!0});var Zt=a(pt);v(Gh.$$.fragment,Zt),d7=p(Zt),Hk=r(Zt,"P",{});var IS=a(Hk);c7=n(IS,`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.`),IS.forEach(t),p7=p(Zt),Jh=r(Zt,"P",{});var Dw=a(Jh);h7=n(Dw,"This model inherits from "),Xf=r(Dw,"A",{href:!0});var LS=a(Xf);m7=n(LS,"FlaxPreTrainedModel"),LS.forEach(t),f7=n(Dw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Dw.forEach(t),u7=p(Zt),Xh=r(Zt,"P",{});var Sw=a(Xh);g7=n(Sw,"This model is also a Flax Linen "),Yh=r(Sw,"A",{href:!0,rel:!0});var DS=a(Yh);_7=n(DS,"flax.linen.Module"),DS.forEach(t),b7=n(Sw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Sw.forEach(t),k7=p(Zt),Rk=r(Zt,"P",{});var SS=a(Rk);y7=n(SS,"Finally, this model supports inherent JAX features such as:"),SS.forEach(t),T7=p(Zt),Ko=r(Zt,"UL",{});var Ci=a(Ko);Kk=r(Ci,"LI",{});var US=a(Kk);Zh=r(US,"A",{href:!0,rel:!0});var WS=a(Zh);v7=n(WS,"Just-In-Time (JIT) compilation"),WS.forEach(t),US.forEach(t),w7=p(Ci),Qk=r(Ci,"LI",{});var HS=a(Qk);em=r(HS,"A",{href:!0,rel:!0});var RS=a(em);$7=n(RS,"Automatic Differentiation"),RS.forEach(t),HS.forEach(t),F7=p(Ci),Vk=r(Ci,"LI",{});var KS=a(Vk);tm=r(KS,"A",{href:!0,rel:!0});var QS=a(tm);x7=n(QS,"Vectorization"),QS.forEach(t),KS.forEach(t),E7=p(Ci),Gk=r(Ci,"LI",{});var VS=a(Gk);om=r(VS,"A",{href:!0,rel:!0});var GS=a(om);B7=n(GS,"Parallelization"),GS.forEach(t),VS.forEach(t),Ci.forEach(t),z7=p(Zt),xo=r(Zt,"DIV",{class:!0});var Ai=a(xo);v(nm.$$.fragment,Ai),M7=p(Ai),Gs=r(Ai,"P",{});var Lu=a(Gs);P7=n(Lu,"The "),Jk=r(Lu,"CODE",{});var JS=a(Jk);j7=n(JS,"FlaxBertPreTrainedModel"),JS.forEach(t),q7=n(Lu," forward method, overrides the "),Xk=r(Lu,"CODE",{});var XS=a(Xk);C7=n(XS,"__call__"),XS.forEach(t),A7=n(Lu," special method."),Lu.forEach(t),N7=p(Ai),v(Xa.$$.fragment,Ai),O7=p(Ai),v(Ya.$$.fragment,Ai),Ai.forEach(t),Zt.forEach(t),Bv=p(i),Js=r(i,"H2",{class:!0});var Uw=a(Js);Za=r(Uw,"A",{id:!0,class:!0,href:!0});var YS=a(Za);Yk=r(YS,"SPAN",{});var ZS=a(Yk);v(sm.$$.fragment,ZS),ZS.forEach(t),YS.forEach(t),I7=p(Uw),Zk=r(Uw,"SPAN",{});var eU=a(Zk);L7=n(eU,"FlaxBertForQuestionAnswering"),eU.forEach(t),Uw.forEach(t),zv=p(i),ht=r(i,"DIV",{class:!0});var eo=a(ht);v(rm.$$.fragment,eo),D7=p(eo),Xs=r(eo,"P",{});var Du=a(Xs);S7=n(Du,`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 `),ey=r(Du,"CODE",{});var tU=a(ey);U7=n(tU,"span start logits"),tU.forEach(t),W7=n(Du," and "),ty=r(Du,"CODE",{});var oU=a(ty);H7=n(oU,"span end logits"),oU.forEach(t),R7=n(Du,")."),Du.forEach(t),K7=p(eo),am=r(eo,"P",{});var Ww=a(am);Q7=n(Ww,"This model inherits from "),Yf=r(Ww,"A",{href:!0});var nU=a(Yf);V7=n(nU,"FlaxPreTrainedModel"),nU.forEach(t),G7=n(Ww,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Ww.forEach(t),J7=p(eo),im=r(eo,"P",{});var Hw=a(im);X7=n(Hw,"This model is also a Flax Linen "),lm=r(Hw,"A",{href:!0,rel:!0});var sU=a(lm);Y7=n(sU,"flax.linen.Module"),sU.forEach(t),Z7=n(Hw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Hw.forEach(t),e8=p(eo),oy=r(eo,"P",{});var rU=a(oy);t8=n(rU,"Finally, this model supports inherent JAX features such as:"),rU.forEach(t),o8=p(eo),Qo=r(eo,"UL",{});var Ni=a(Qo);ny=r(Ni,"LI",{});var aU=a(ny);dm=r(aU,"A",{href:!0,rel:!0});var iU=a(dm);n8=n(iU,"Just-In-Time (JIT) compilation"),iU.forEach(t),aU.forEach(t),s8=p(Ni),sy=r(Ni,"LI",{});var lU=a(sy);cm=r(lU,"A",{href:!0,rel:!0});var dU=a(cm);r8=n(dU,"Automatic Differentiation"),dU.forEach(t),lU.forEach(t),a8=p(Ni),ry=r(Ni,"LI",{});var cU=a(ry);pm=r(cU,"A",{href:!0,rel:!0});var pU=a(pm);i8=n(pU,"Vectorization"),pU.forEach(t),cU.forEach(t),l8=p(Ni),ay=r(Ni,"LI",{});var hU=a(ay);hm=r(hU,"A",{href:!0,rel:!0});var mU=a(hm);d8=n(mU,"Parallelization"),mU.forEach(t),hU.forEach(t),Ni.forEach(t),c8=p(eo),Eo=r(eo,"DIV",{class:!0});var Oi=a(Eo);v(mm.$$.fragment,Oi),p8=p(Oi),Ys=r(Oi,"P",{});var Su=a(Ys);h8=n(Su,"The "),iy=r(Su,"CODE",{});var fU=a(iy);m8=n(fU,"FlaxBertPreTrainedModel"),fU.forEach(t),f8=n(Su," forward method, overrides the "),ly=r(Su,"CODE",{});var uU=a(ly);u8=n(uU,"__call__"),uU.forEach(t),g8=n(Su," special method."),Su.forEach(t),_8=p(Oi),v(ei.$$.fragment,Oi),b8=p(Oi),v(ti.$$.fragment,Oi),Oi.forEach(t),eo.forEach(t),this.h()},h(){h(d,"name","hf:doc:metadata"),h(d,"content",JSON.stringify(LW)),h(u,"id","bert"),h(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(u,"href","#bert"),h(f,"class","relative group"),h(le,"id","overview"),h(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"),h(le,"href","#overview"),h(S,"class","relative group"),h(ce,"href","https://arxiv.org/abs/1810.04805"),h(ce,"rel","nofollow"),h(pe,"href","https://huggingface.co/thomwolf"),h(pe,"rel","nofollow"),h(W,"href","https://github.com/google-research/bert"),h(W,"rel","nofollow"),h(N,"id","resources"),h(N,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(N,"href","#resources"),h(ie,"class","relative group"),h(I,"href","https://www.philschmid.de/bert-text-classification-in-a-different-language"),h(I,"rel","nofollow"),h(He,"href","https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/BERT/Fine_tuning_BERT_(and_friends)_for_multi_label_text_classification.ipynb"),h(He,"rel","nofollow"),h(Ii,"href","https://colab.research.google.com/github/abhimishra91/transformers-tutorials/blob/master/transformers_multi_label_classification.ipynb"),h(Ii,"rel","nofollow"),h(Di,"href","https://colab.research.google.com/github/patrickvonplaten/notebooks/blob/master/BERT2BERT_for_CNN_Dailymail.ipynb"),h(Di,"rel","nofollow"),h(Mm,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertForSequenceClassification"),h(Si,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/text-classification"),h(Si,"rel","nofollow"),h(Ui,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification.ipynb"),h(Ui,"rel","nofollow"),h(Pm,"href","/docs/transformers/main/en/model_doc/bert#transformers.TFBertForSequenceClassification"),h(Wi,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/text-classification"),h(Wi,"rel","nofollow"),h(Hi,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification-tf.ipynb"),h(Hi,"rel","nofollow"),h(jm,"href","/docs/transformers/main/en/model_doc/bert#transformers.FlaxBertForSequenceClassification"),h(Ri,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/text-classification"),h(Ri,"rel","nofollow"),h(Ki,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification_flax.ipynb"),h(Ki,"rel","nofollow"),h(Gi,"href","https://www.philschmid.de/huggingface-transformers-keras-tf"),h(Gi,"rel","nofollow"),h(Ji,"href","https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/Custom_Named_Entity_Recognition_with_BERT_only_first_wordpiece.ipynb"),h(Ji,"rel","nofollow"),h(Xi,"href","https://github.com/NielsRogge/Transformers-Tutorials/blob/master/BERT/Custom_Named_Entity_Recognition_with_BERT.ipynb"),h(Xi,"rel","nofollow"),h(qm,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertForTokenClassification"),h(Yi,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/token-classification"),h(Yi,"rel","nofollow"),h(Zi,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/token_classification.ipynb"),h(Zi,"rel","nofollow"),h(Cm,"href","/docs/transformers/main/en/model_doc/bert#transformers.TFBertForTokenClassification"),h(el,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/token-classification"),h(el,"rel","nofollow"),h(tl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/token_classification-tf.ipynb"),h(tl,"rel","nofollow"),h(Am,"href","/docs/transformers/main/en/model_doc/bert#transformers.FlaxBertForTokenClassification"),h(ol,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/token-classification"),h(ol,"rel","nofollow"),h(nl,"href","https://huggingface.co/course/chapter7/2?fw=pt"),h(nl,"rel","nofollow"),h(Om,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertForMaskedLM"),h(rl,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/language-modeling#robertabertdistilbert-and-masked-language-modeling"),h(rl,"rel","nofollow"),h(al,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb"),h(al,"rel","nofollow"),h(Im,"href","/docs/transformers/main/en/model_doc/bert#transformers.TFBertForMaskedLM"),h(il,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/language-modeling#run_mlmpy"),h(il,"rel","nofollow"),h(ll,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb"),h(ll,"rel","nofollow"),h(Lm,"href","/docs/transformers/main/en/model_doc/bert#transformers.FlaxBertForMaskedLM"),h(dl,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/language-modeling#masked-language-modeling"),h(dl,"rel","nofollow"),h(cl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/masked_language_modeling_flax.ipynb"),h(cl,"rel","nofollow"),h(pl,"href","https://huggingface.co/course/chapter7/3?fw=pt"),h(pl,"rel","nofollow"),h(Sm,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertForQuestionAnswering"),h(ml,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/question-answering"),h(ml,"rel","nofollow"),h(fl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/question_answering.ipynb"),h(fl,"rel","nofollow"),h(Um,"href","/docs/transformers/main/en/model_doc/bert#transformers.TFBertForQuestionAnswering"),h(ul,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/question-answering"),h(ul,"rel","nofollow"),h(gl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/question_answering-tf.ipynb"),h(gl,"rel","nofollow"),h(Wm,"href","/docs/transformers/main/en/model_doc/bert#transformers.FlaxBertForQuestionAnswering"),h(_l,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/question-answering"),h(_l,"rel","nofollow"),h(bl,"href","https://huggingface.co/course/chapter7/7?fw=pt"),h(bl,"rel","nofollow"),h(Km,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertForMultipleChoice"),h(kl,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/multiple-choice"),h(kl,"rel","nofollow"),h(yl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice.ipynb"),h(yl,"rel","nofollow"),h(Qm,"href","/docs/transformers/main/en/model_doc/bert#transformers.TFBertForMultipleChoice"),h(Tl,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/multiple-choice"),h(Tl,"rel","nofollow"),h(vl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice-tf.ipynb"),h(vl,"rel","nofollow"),h(Fl,"href","https://huggingface.co/blog/bert-inferentia-sagemaker"),h(Fl,"rel","nofollow"),h(El,"href","https://www.philschmid.de/bert-deepspeed-inference"),h(El,"rel","nofollow"),h(Ml,"href","https://www.philschmid.de/pre-training-bert-habana"),h(Ml,"rel","nofollow"),h(ql,"href","https://www.philschmid.de/convert-transformers-to-onnx"),h(ql,"rel","nofollow"),h(Al,"href","https://www.philschmid.de/getting-started-habana-gaudi#conclusion"),h(Al,"rel","nofollow"),h(Ol,"href","https://www.philschmid.de/terraform-huggingface-amazon-sagemaker-advanced"),h(Ol,"rel","nofollow"),h(Ll,"href","https://www.philschmid.de/serverless-bert-with-huggingface-aws-lambda-docker"),h(Ll,"rel","nofollow"),h(Sl,"href","https://www.philschmid.de/huggingface-amazon-sagemaker-training-compiler"),h(Sl,"rel","nofollow"),h(Wl,"href","https://www.philschmid.de/knowledge-distillation-bert-transformers"),h(Wl,"rel","nofollow"),h(rr,"id","transformers.BertConfig"),h(rr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(rr,"href","#transformers.BertConfig"),h(An,"class","relative group"),h(Gm,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertModel"),h(Jm,"href","/docs/transformers/main/en/model_doc/bert#transformers.TFBertModel"),h(Kl,"href","https://huggingface.co/bert-base-uncased"),h(Kl,"rel","nofollow"),h(Xm,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),h(Ym,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),h(to,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ir,"id","transformers.BertTokenizer"),h(ir,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ir,"href","#transformers.BertTokenizer"),h(On,"class","relative group"),h(Zm,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),h(ln,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(lr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(so,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(of,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(cr,"id","transformers.BertTokenizerFast"),h(cr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(cr,"href","#transformers.BertTokenizerFast"),h(Ln,"class","relative group"),h(nf,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),h(dn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(hr,"id","transformers.TFBertTokenizer"),h(hr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(hr,"href","#transformers.TFBertTokenizer"),h(Sn,"class","relative group"),h(cn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(pn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ur,"id","transformers.models.bert.modeling_bert.BertForPreTrainingOutput"),h(ur,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ur,"href","#transformers.models.bert.modeling_bert.BertForPreTrainingOutput"),h(Hn,"class","relative group"),h(af,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertForPreTraining"),h(Rn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(lf,"href","/docs/transformers/main/en/model_doc/bert#transformers.TFBertForPreTraining"),h(Kn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(df,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertForPreTraining"),h(gr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Io,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(_r,"id","transformers.BertModel"),h(_r,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(_r,"href","#transformers.BertModel"),h(Qn,"class","relative group"),h(cf,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(Ed,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Ed,"rel","nofollow"),h(zd,"href","https://arxiv.org/abs/1706.03762"),h(zd,"rel","nofollow"),h(pf,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertModel"),h(ao,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(yr,"id","transformers.BertForPreTraining"),h(yr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(yr,"href","#transformers.BertForPreTraining"),h(Gn,"class","relative group"),h(hf,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(Ad,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Ad,"rel","nofollow"),h(mf,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertForPreTraining"),h(io,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(wr,"id","transformers.BertLMHeadModel"),h(wr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(wr,"href","#transformers.BertLMHeadModel"),h(Yn,"class","relative group"),h(ff,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(Ud,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Ud,"rel","nofollow"),h(uf,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertLMHeadModel"),h(lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(xr,"id","transformers.BertForMaskedLM"),h(xr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(xr,"href","#transformers.BertForMaskedLM"),h(es,"class","relative group"),h(gf,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(Gd,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Gd,"rel","nofollow"),h(_f,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertForMaskedLM"),h(co,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(zr,"id","transformers.BertForNextSentencePrediction"),h(zr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(zr,"href","#transformers.BertForNextSentencePrediction"),h(os,"class","relative group"),h(bf,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(oc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(oc,"rel","nofollow"),h(kf,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertForNextSentencePrediction"),h(po,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(jr,"id","transformers.BertForSequenceClassification"),h(jr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(jr,"href","#transformers.BertForSequenceClassification"),h(ss,"class","relative group"),h(yf,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(lc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(lc,"rel","nofollow"),h(Tf,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertForSequenceClassification"),h(Ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Nr,"id","transformers.BertForMultipleChoice"),h(Nr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Nr,"href","#transformers.BertForMultipleChoice"),h(as,"class","relative group"),h(vf,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(fc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(fc,"rel","nofollow"),h(wf,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertForMultipleChoice"),h(ho,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Lr,"id","transformers.BertForTokenClassification"),h(Lr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Lr,"href","#transformers.BertForTokenClassification"),h(ls,"class","relative group"),h($f,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(yc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(yc,"rel","nofollow"),h(Ff,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertForTokenClassification"),h(mo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ur,"id","transformers.BertForQuestionAnswering"),h(Ur,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ur,"href","#transformers.BertForQuestionAnswering"),h(cs,"class","relative group"),h(xf,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(xc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(xc,"rel","nofollow"),h(Ef,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertForQuestionAnswering"),h(fo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Rr,"id","transformers.TFBertModel"),h(Rr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Rr,"href","#transformers.TFBertModel"),h(ms,"class","relative group"),h(Bf,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),h(jc,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(jc,"rel","nofollow"),h(zf,"href","/docs/transformers/main/en/model_doc/bert#transformers.TFBertModel"),h(uo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Gr,"id","transformers.TFBertForPreTraining"),h(Gr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Gr,"href","#transformers.TFBertForPreTraining"),h(us,"class","relative group"),h(Mf,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),h(Ic,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Ic,"rel","nofollow"),h(Pf,"href","/docs/transformers/main/en/model_doc/bert#transformers.TFBertForPreTraining"),h(go,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Zr,"id","transformers.TFBertLMHeadModel"),h(Zr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Zr,"href","#transformers.TFBertLMHeadModel"),h(bs,"class","relative group"),h(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ks,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ta,"id","transformers.TFBertForMaskedLM"),h(ta,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ta,"href","#transformers.TFBertForMaskedLM"),h(ys,"class","relative group"),h(jf,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),h(Xc,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Xc,"rel","nofollow"),h(qf,"href","/docs/transformers/main/en/model_doc/bert#transformers.TFBertForMaskedLM"),h(Lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(aa,"id","transformers.TFBertForNextSentencePrediction"),h(aa,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(aa,"href","#transformers.TFBertForNextSentencePrediction"),h(vs,"class","relative group"),h(Cf,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),h(sp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(sp,"rel","nofollow"),h(Af,"href","/docs/transformers/main/en/model_doc/bert#transformers.TFBertForNextSentencePrediction"),h(_o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ca,"id","transformers.TFBertForSequenceClassification"),h(ca,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ca,"href","#transformers.TFBertForSequenceClassification"),h($s,"class","relative group"),h(Nf,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),h(cp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(cp,"rel","nofollow"),h(Of,"href","/docs/transformers/main/en/model_doc/bert#transformers.TFBertForSequenceClassification"),h(Dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ua,"id","transformers.TFBertForMultipleChoice"),h(ua,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ua,"href","#transformers.TFBertForMultipleChoice"),h(xs,"class","relative group"),h(If,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),h(gp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(gp,"rel","nofollow"),h(Lf,"href","/docs/transformers/main/en/model_doc/bert#transformers.TFBertForMultipleChoice"),h(bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ka,"id","transformers.TFBertForTokenClassification"),h(ka,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ka,"href","#transformers.TFBertForTokenClassification"),h(Bs,"class","relative group"),h(Df,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),h(vp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(vp,"rel","nofollow"),h(Sf,"href","/docs/transformers/main/en/model_doc/bert#transformers.TFBertForTokenClassification"),h(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h($a,"id","transformers.TFBertForQuestionAnswering"),h($a,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h($a,"href","#transformers.TFBertForQuestionAnswering"),h(Ms,"class","relative group"),h(Uf,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),h(Bp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Bp,"rel","nofollow"),h(Wf,"href","/docs/transformers/main/en/model_doc/bert#transformers.TFBertForQuestionAnswering"),h(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(za,"id","transformers.FlaxBertModel"),h(za,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(za,"href","#transformers.FlaxBertModel"),h(qs,"class","relative group"),h(Hf,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Cp,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Cp,"rel","nofollow"),h(Ap,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Ap,"rel","nofollow"),h(Np,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Np,"rel","nofollow"),h(Op,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Op,"rel","nofollow"),h(Ip,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Ip,"rel","nofollow"),h(ko,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ja,"id","transformers.FlaxBertForPreTraining"),h(ja,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ja,"href","#transformers.FlaxBertForPreTraining"),h(As,"class","relative group"),h(Rf,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Hp,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Hp,"rel","nofollow"),h(Rp,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Rp,"rel","nofollow"),h(Kp,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Kp,"rel","nofollow"),h(Qp,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Qp,"rel","nofollow"),h(Vp,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Vp,"rel","nofollow"),h(yo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Aa,"id","transformers.FlaxBertForCausalLM"),h(Aa,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Aa,"href","#transformers.FlaxBertForCausalLM"),h(Is,"class","relative group"),h(Kf,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(eh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(eh,"rel","nofollow"),h(th,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(th,"rel","nofollow"),h(oh,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(oh,"rel","nofollow"),h(nh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(nh,"rel","nofollow"),h(sh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(sh,"rel","nofollow"),h(To,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ia,"id","transformers.FlaxBertForMaskedLM"),h(Ia,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ia,"href","#transformers.FlaxBertForMaskedLM"),h(Ds,"class","relative group"),h(Qf,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(ph,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(ph,"rel","nofollow"),h(hh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(hh,"rel","nofollow"),h(mh,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(mh,"rel","nofollow"),h(fh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(fh,"rel","nofollow"),h(uh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(uh,"rel","nofollow"),h(vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Sa,"id","transformers.FlaxBertForNextSentencePrediction"),h(Sa,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Sa,"href","#transformers.FlaxBertForNextSentencePrediction"),h(Us,"class","relative group"),h(Vf,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(vh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(vh,"rel","nofollow"),h(wh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(wh,"rel","nofollow"),h($h,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h($h,"rel","nofollow"),h(Fh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Fh,"rel","nofollow"),h(xh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(xh,"rel","nofollow"),h(wo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ha,"id","transformers.FlaxBertForSequenceClassification"),h(Ha,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ha,"href","#transformers.FlaxBertForSequenceClassification"),h(Hs,"class","relative group"),h(Gf,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(jh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(jh,"rel","nofollow"),h(qh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(qh,"rel","nofollow"),h(Ch,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Ch,"rel","nofollow"),h(Ah,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Ah,"rel","nofollow"),h(Nh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Nh,"rel","nofollow"),h($o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Qa,"id","transformers.FlaxBertForMultipleChoice"),h(Qa,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Qa,"href","#transformers.FlaxBertForMultipleChoice"),h(Ks,"class","relative group"),h(Jf,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Uh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Uh,"rel","nofollow"),h(Wh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Wh,"rel","nofollow"),h(Hh,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Hh,"rel","nofollow"),h(Rh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Rh,"rel","nofollow"),h(Kh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Kh,"rel","nofollow"),h(Fo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ja,"id","transformers.FlaxBertForTokenClassification"),h(Ja,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ja,"href","#transformers.FlaxBertForTokenClassification"),h(Vs,"class","relative group"),h(Xf,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Yh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Yh,"rel","nofollow"),h(Zh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Zh,"rel","nofollow"),h(em,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(em,"rel","nofollow"),h(tm,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(tm,"rel","nofollow"),h(om,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(om,"rel","nofollow"),h(xo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Za,"id","transformers.FlaxBertForQuestionAnswering"),h(Za,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Za,"href","#transformers.FlaxBertForQuestionAnswering"),h(Js,"class","relative group"),h(Yf,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(lm,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(lm,"rel","nofollow"),h(dm,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(dm,"rel","nofollow"),h(cm,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(cm,"rel","nofollow"),h(pm,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(pm,"rel","nofollow"),h(hm,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(hm,"rel","nofollow"),h(Eo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(i,_){e(document.head,d),g(i,k,_),g(i,f,_),e(f,u),e(u,b),w(l,b,null),e(f,m),e(f,z),e(z,Fe),g(i,ye,_),g(i,S,_),e(S,le),e(le,Z),w(B,Z,null),e(S,xe),e(S,Q),e(Q,Ee),g(i,Te,_),g(i,U,_),e(U,Be),e(U,ce),e(ce,X),e(U,ze),g(i,ve,_),g(i,R,_),e(R,Me),g(i,we,_),g(i,K,_),e(K,fe),e(fe,Pe),g(i,te,_),g(i,j,_),e(j,q),e(q,je),g(i,G,_),g(i,me,_),e(me,qe),g(i,J,_),g(i,de,_),e(de,ue),e(ue,A),e(de,Ce),e(de,V),e(V,Ae),g(i,$e,_),g(i,D,_),e(D,Ne),e(D,pe),e(pe,L),e(D,Oe),e(D,W),e(W,Ie),e(D,ne),g(i,C,_),g(i,ie,_),e(ie,N),e(N,ge),w(he,ge,null),e(ie,y),e(ie,M),e(M,Ve),g(i,oe,_),g(i,Ke,_),e(Ke,Ge),g(i,P,_),w(Ue,i,_),g(i,Qe,_),g(i,re,_),e(re,We),e(We,Je),e(We,I),e(I,Y),e(We,Xe),e(re,Ye),e(re,H),e(H,Ze),e(H,He),e(He,Le),e(H,et),e(re,se),e(re,Re),e(Re,Kw),e(Re,Ii),e(Ii,Qw),e(Re,Vw),e(re,Gw),e(re,Li),e(Li,Jw),e(Li,Di),e(Di,Xw),e(Li,Yw),e(re,Zw),e(re,Go),e(Go,Mm),e(Mm,e$),e(Go,t$),e(Go,Si),e(Si,o$),e(Go,n$),e(Go,Ui),e(Ui,s$),e(Go,r$),e(re,a$),e(re,Jo),e(Jo,Pm),e(Pm,i$),e(Jo,l$),e(Jo,Wi),e(Wi,d$),e(Jo,c$),e(Jo,Hi),e(Hi,p$),e(Jo,h$),e(re,m$),e(re,Xo),e(Xo,jm),e(jm,f$),e(Xo,u$),e(Xo,Ri),e(Ri,g$),e(Xo,_$),e(Xo,Ki),e(Ki,b$),e(Xo,k$),g(i,sT,_),w(Qi,i,_),g(i,rT,_),g(i,wt,_),e(wt,Vi),e(Vi,y$),e(Vi,Gi),e(Gi,T$),e(Vi,v$),e(wt,w$),e(wt,Cn),e(Cn,$$),e(Cn,Ji),e(Ji,F$),e(Cn,x$),e(Cn,Xi),e(Xi,E$),e(Cn,B$),e(wt,z$),e(wt,Yo),e(Yo,qm),e(qm,M$),e(Yo,P$),e(Yo,Yi),e(Yi,j$),e(Yo,q$),e(Yo,Zi),e(Zi,C$),e(Yo,A$),e(wt,N$),e(wt,Zo),e(Zo,Cm),e(Cm,O$),e(Zo,I$),e(Zo,el),e(el,L$),e(Zo,D$),e(Zo,tl),e(tl,S$),e(Zo,U$),e(wt,W$),e(wt,tr),e(tr,Am),e(Am,H$),e(tr,R$),e(tr,ol),e(ol,K$),e(tr,Q$),e(wt,V$),e(wt,Nm),e(Nm,nl),e(nl,G$),e(Nm,J$),g(i,aT,_),w(sl,i,_),g(i,iT,_),g(i,oo,_),e(oo,en),e(en,Om),e(Om,X$),e(en,Y$),e(en,rl),e(rl,Z$),e(en,e2),e(en,al),e(al,t2),e(en,o2),e(oo,n2),e(oo,tn),e(tn,Im),e(Im,s2),e(tn,r2),e(tn,il),e(il,a2),e(tn,i2),e(tn,ll),e(ll,l2),e(tn,d2),e(oo,c2),e(oo,on),e(on,Lm),e(Lm,p2),e(on,h2),e(on,dl),e(dl,m2),e(on,f2),e(on,cl),e(cl,u2),e(on,g2),e(oo,_2),e(oo,Dm),e(Dm,pl),e(pl,b2),e(Dm,k2),g(i,lT,_),w(hl,i,_),g(i,dT,_),g(i,no,_),e(no,nn),e(nn,Sm),e(Sm,y2),e(nn,T2),e(nn,ml),e(ml,v2),e(nn,w2),e(nn,fl),e(fl,$2),e(nn,F2),e(no,x2),e(no,sn),e(sn,Um),e(Um,E2),e(sn,B2),e(sn,ul),e(ul,z2),e(sn,M2),e(sn,gl),e(gl,P2),e(sn,j2),e(no,q2),e(no,or),e(or,Wm),e(Wm,C2),e(or,A2),e(or,_l),e(_l,N2),e(or,O2),e(no,I2),e(no,Hm),e(Hm,bl),e(bl,L2),e(Hm,D2),g(i,cT,_),g(i,Rm,_),e(Rm,Uu),e(Uu,S2),g(i,pT,_),g(i,nr,_),e(nr,rn),e(rn,Km),e(Km,U2),e(rn,W2),e(rn,kl),e(kl,H2),e(rn,R2),e(rn,yl),e(yl,K2),e(rn,Q2),e(nr,V2),e(nr,an),e(an,Qm),e(Qm,G2),e(an,J2),e(an,Tl),e(Tl,X2),e(an,Y2),e(an,vl),e(vl,Z2),e(an,eF),g(i,hT,_),g(i,wl,_),e(wl,tF),e(wl,Wu),e(Wu,oF),g(i,mT,_),g(i,sr,_),e(sr,$l),e($l,nF),e($l,Fl),e(Fl,sF),e($l,rF),e(sr,aF),e(sr,xl),e(xl,iF),e(xl,El),e(El,lF),e(xl,dF),g(i,fT,_),g(i,Bl,_),e(Bl,cF),e(Bl,Hu),e(Hu,pF),g(i,uT,_),g(i,Vm,_),e(Vm,zl),e(zl,hF),e(zl,Ml),e(Ml,mF),e(zl,fF),g(i,gT,_),g(i,Pl,_),e(Pl,uF),e(Pl,Ru),e(Ru,gF),g(i,_T,_),g(i,$t,_),e($t,jl),e(jl,_F),e(jl,ql),e(ql,bF),e(jl,kF),e($t,yF),e($t,Cl),e(Cl,TF),e(Cl,Al),e(Al,vF),e(Cl,wF),e($t,$F),e($t,Nl),e(Nl,FF),e(Nl,Ol),e(Ol,xF),e(Nl,EF),e($t,BF),e($t,Il),e(Il,zF),e(Il,Ll),e(Ll,MF),e(Il,PF),e($t,jF),e($t,Dl),e(Dl,qF),e(Dl,Sl),e(Sl,CF),e(Dl,AF),e($t,NF),e($t,Ul),e(Ul,OF),e(Ul,Wl),e(Wl,IF),e(Ul,LF),g(i,bT,_),g(i,An,_),e(An,rr),e(rr,Ku),w(Hl,Ku,null),e(An,DF),e(An,Qu),e(Qu,SF),g(i,kT,_),g(i,to,_),w(Rl,to,null),e(to,UF),e(to,Oo),e(Oo,WF),e(Oo,Gm),e(Gm,HF),e(Oo,RF),e(Oo,Jm),e(Jm,KF),e(Oo,QF),e(Oo,Kl),e(Kl,VF),e(Oo,GF),e(to,JF),e(to,Nn),e(Nn,XF),e(Nn,Xm),e(Xm,YF),e(Nn,ZF),e(Nn,Ym),e(Ym,ex),e(Nn,tx),e(to,ox),w(ar,to,null),g(i,yT,_),g(i,On,_),e(On,ir),e(ir,Vu),w(Ql,Vu,null),e(On,nx),e(On,Gu),e(Gu,sx),g(i,TT,_),g(i,tt,_),w(Vl,tt,null),e(tt,rx),e(tt,Ju),e(Ju,ax),e(tt,ix),e(tt,Gl),e(Gl,lx),e(Gl,Zm),e(Zm,dx),e(Gl,cx),e(tt,px),e(tt,ln),w(Jl,ln,null),e(ln,hx),e(ln,Xu),e(Xu,mx),e(ln,fx),e(ln,Xl),e(Xl,ef),e(ef,ux),e(ef,Yu),e(Yu,gx),e(Xl,_x),e(Xl,tf),e(tf,bx),e(tf,Zu),e(Zu,kx),e(tt,yx),e(tt,lr),w(Yl,lr,null),e(lr,Tx),e(lr,Zl),e(Zl,vx),e(Zl,eg),e(eg,wx),e(Zl,$x),e(tt,Fx),e(tt,so),w(ed,so,null),e(so,xx),e(so,tg),e(tg,Ex),e(so,Bx),w(dr,so,null),e(so,zx),e(so,In),e(In,Mx),e(In,og),e(og,Px),e(In,jx),e(In,ng),e(ng,qx),e(In,Cx),e(tt,Ax),e(tt,of),w(td,of,null),g(i,vT,_),g(i,Ln,_),e(Ln,cr),e(cr,sg),w(od,sg,null),e(Ln,Nx),e(Ln,rg),e(rg,Ox),g(i,wT,_),g(i,xt,_),w(nd,xt,null),e(xt,Ix),e(xt,sd),e(sd,Lx),e(sd,ag),e(ag,Dx),e(sd,Sx),e(xt,Ux),e(xt,rd),e(rd,Wx),e(rd,nf),e(nf,Hx),e(rd,Rx),e(xt,Kx),e(xt,dn),w(ad,dn,null),e(dn,Qx),e(dn,ig),e(ig,Vx),e(dn,Gx),e(dn,id),e(id,sf),e(sf,Jx),e(sf,lg),e(lg,Xx),e(id,Yx),e(id,rf),e(rf,Zx),e(rf,dg),e(dg,e0),e(xt,t0),e(xt,ro),w(ld,ro,null),e(ro,o0),e(ro,cg),e(cg,n0),e(ro,s0),w(pr,ro,null),e(ro,r0),e(ro,Dn),e(Dn,a0),e(Dn,pg),e(pg,i0),e(Dn,l0),e(Dn,hg),e(hg,d0),e(Dn,c0),g(i,$T,_),g(i,Sn,_),e(Sn,hr),e(hr,mg),w(dd,mg,null),e(Sn,p0),e(Sn,fg),e(fg,h0),g(i,FT,_),g(i,Et,_),w(cd,Et,null),e(Et,m0),e(Et,Un),e(Un,f0),e(Un,ug),e(ug,u0),e(Un,g0),e(Un,gg),e(gg,_0),e(Un,b0),e(Et,k0),e(Et,pd),e(pd,y0),e(pd,_g),e(_g,T0),e(pd,v0),e(Et,w0),e(Et,cn),w(hd,cn,null),e(cn,$0),e(cn,md),e(md,F0),e(md,bg),e(bg,x0),e(md,E0),e(cn,B0),w(mr,cn,null),e(Et,z0),e(Et,pn),w(fd,pn,null),e(pn,M0),e(pn,Wn),e(Wn,P0),e(Wn,kg),e(kg,j0),e(Wn,q0),e(Wn,yg),e(yg,C0),e(Wn,A0),e(pn,N0),w(fr,pn,null),g(i,xT,_),g(i,Hn,_),e(Hn,ur),e(ur,Tg),w(ud,Tg,null),e(Hn,O0),e(Hn,vg),e(vg,I0),g(i,ET,_),g(i,Rn,_),w(gd,Rn,null),e(Rn,L0),e(Rn,_d),e(_d,D0),e(_d,af),e(af,S0),e(_d,U0),g(i,BT,_),g(i,Kn,_),w(bd,Kn,null),e(Kn,W0),e(Kn,kd),e(kd,H0),e(kd,lf),e(lf,R0),e(kd,K0),g(i,zT,_),g(i,Io,_),w(yd,Io,null),e(Io,Q0),e(Io,Td),e(Td,V0),e(Td,df),e(df,G0),e(Td,J0),e(Io,X0),e(Io,gr),w(vd,gr,null),e(gr,Y0),e(gr,wg),e(wg,Z0),g(i,MT,_),g(i,Qn,_),e(Qn,_r),e(_r,$g),w(wd,$g,null),e(Qn,eE),e(Qn,Fg),e(Fg,tE),g(i,PT,_),g(i,ot,_),w($d,ot,null),e(ot,oE),e(ot,xg),e(xg,nE),e(ot,sE),e(ot,Fd),e(Fd,rE),e(Fd,cf),e(cf,aE),e(Fd,iE),e(ot,lE),e(ot,xd),e(xd,dE),e(xd,Ed),e(Ed,cE),e(xd,pE),e(ot,hE),e(ot,Bd),e(Bd,mE),e(Bd,zd),e(zd,fE),e(Bd,uE),e(ot,gE),e(ot,mt),e(mt,_E),e(mt,Eg),e(Eg,bE),e(mt,kE),e(mt,Bg),e(Bg,yE),e(mt,TE),e(mt,zg),e(zg,vE),e(mt,wE),e(mt,Mg),e(Mg,$E),e(mt,FE),e(mt,Pg),e(Pg,xE),e(mt,EE),e(mt,jg),e(jg,BE),e(mt,zE),e(ot,ME),e(ot,ao),w(Md,ao,null),e(ao,PE),e(ao,Vn),e(Vn,jE),e(Vn,pf),e(pf,qE),e(Vn,CE),e(Vn,qg),e(qg,AE),e(Vn,NE),e(ao,OE),w(br,ao,null),e(ao,IE),w(kr,ao,null),g(i,jT,_),g(i,Gn,_),e(Gn,yr),e(yr,Cg),w(Pd,Cg,null),e(Gn,LE),e(Gn,Ag),e(Ag,DE),g(i,qT,_),g(i,Bt,_),w(jd,Bt,null),e(Bt,SE),e(Bt,Jn),e(Jn,UE),e(Jn,Ng),e(Ng,WE),e(Jn,HE),e(Jn,Og),e(Og,RE),e(Jn,KE),e(Bt,QE),e(Bt,qd),e(qd,VE),e(qd,hf),e(hf,GE),e(qd,JE),e(Bt,XE),e(Bt,Cd),e(Cd,YE),e(Cd,Ad),e(Ad,ZE),e(Cd,eB),e(Bt,tB),e(Bt,io),w(Nd,io,null),e(io,oB),e(io,Xn),e(Xn,nB),e(Xn,mf),e(mf,sB),e(Xn,rB),e(Xn,Ig),e(Ig,aB),e(Xn,iB),e(io,lB),w(Tr,io,null),e(io,dB),w(vr,io,null),g(i,CT,_),g(i,Yn,_),e(Yn,wr),e(wr,Lg),w(Od,Lg,null),e(Yn,cB),e(Yn,Dg),e(Dg,pB),g(i,AT,_),g(i,zt,_),w(Id,zt,null),e(zt,hB),e(zt,Ld),e(Ld,mB),e(Ld,Sg),e(Sg,fB),e(Ld,uB),e(zt,gB),e(zt,Dd),e(Dd,_B),e(Dd,ff),e(ff,bB),e(Dd,kB),e(zt,yB),e(zt,Sd),e(Sd,TB),e(Sd,Ud),e(Ud,vB),e(Sd,wB),e(zt,$B),e(zt,lo),w(Wd,lo,null),e(lo,FB),e(lo,Zn),e(Zn,xB),e(Zn,uf),e(uf,EB),e(Zn,BB),e(Zn,Ug),e(Ug,zB),e(Zn,MB),e(lo,PB),w($r,lo,null),e(lo,jB),w(Fr,lo,null),g(i,NT,_),g(i,es,_),e(es,xr),e(xr,Wg),w(Hd,Wg,null),e(es,qB),e(es,Hg),e(Hg,CB),g(i,OT,_),g(i,Mt,_),w(Rd,Mt,null),e(Mt,AB),e(Mt,Kd),e(Kd,NB),e(Kd,Rg),e(Rg,OB),e(Kd,IB),e(Mt,LB),e(Mt,Qd),e(Qd,DB),e(Qd,gf),e(gf,SB),e(Qd,UB),e(Mt,WB),e(Mt,Vd),e(Vd,HB),e(Vd,Gd),e(Gd,RB),e(Vd,KB),e(Mt,QB),e(Mt,co),w(Jd,co,null),e(co,VB),e(co,ts),e(ts,GB),e(ts,_f),e(_f,JB),e(ts,XB),e(ts,Kg),e(Kg,YB),e(ts,ZB),e(co,ez),w(Er,co,null),e(co,tz),w(Br,co,null),g(i,IT,_),g(i,os,_),e(os,zr),e(zr,Qg),w(Xd,Qg,null),e(os,oz),e(os,Vg),e(Vg,nz),g(i,LT,_),g(i,Pt,_),w(Yd,Pt,null),e(Pt,sz),e(Pt,Zd),e(Zd,rz),e(Zd,Gg),e(Gg,az),e(Zd,iz),e(Pt,lz),e(Pt,ec),e(ec,dz),e(ec,bf),e(bf,cz),e(ec,pz),e(Pt,hz),e(Pt,tc),e(tc,mz),e(tc,oc),e(oc,fz),e(tc,uz),e(Pt,gz),e(Pt,po),w(nc,po,null),e(po,_z),e(po,ns),e(ns,bz),e(ns,kf),e(kf,kz),e(ns,yz),e(ns,Jg),e(Jg,Tz),e(ns,vz),e(po,wz),w(Mr,po,null),e(po,$z),w(Pr,po,null),g(i,DT,_),g(i,ss,_),e(ss,jr),e(jr,Xg),w(sc,Xg,null),e(ss,Fz),e(ss,Yg),e(Yg,xz),g(i,ST,_),g(i,jt,_),w(rc,jt,null),e(jt,Ez),e(jt,Zg),e(Zg,Bz),e(jt,zz),e(jt,ac),e(ac,Mz),e(ac,yf),e(yf,Pz),e(ac,jz),e(jt,qz),e(jt,ic),e(ic,Cz),e(ic,lc),e(lc,Az),e(ic,Nz),e(jt,Oz),e(jt,Ot),w(dc,Ot,null),e(Ot,Iz),e(Ot,rs),e(rs,Lz),e(rs,Tf),e(Tf,Dz),e(rs,Sz),e(rs,e_),e(e_,Uz),e(rs,Wz),e(Ot,Hz),w(qr,Ot,null),e(Ot,Rz),w(Cr,Ot,null),e(Ot,Kz),w(Ar,Ot,null),g(i,UT,_),g(i,as,_),e(as,Nr),e(Nr,t_),w(cc,t_,null),e(as,Qz),e(as,o_),e(o_,Vz),g(i,WT,_),g(i,qt,_),w(pc,qt,null),e(qt,Gz),e(qt,n_),e(n_,Jz),e(qt,Xz),e(qt,hc),e(hc,Yz),e(hc,vf),e(vf,Zz),e(hc,eM),e(qt,tM),e(qt,mc),e(mc,oM),e(mc,fc),e(fc,nM),e(mc,sM),e(qt,rM),e(qt,ho),w(uc,ho,null),e(ho,aM),e(ho,is),e(is,iM),e(is,wf),e(wf,lM),e(is,dM),e(is,s_),e(s_,cM),e(is,pM),e(ho,hM),w(Or,ho,null),e(ho,mM),w(Ir,ho,null),g(i,HT,_),g(i,ls,_),e(ls,Lr),e(Lr,r_),w(gc,r_,null),e(ls,fM),e(ls,a_),e(a_,uM),g(i,RT,_),g(i,Ct,_),w(_c,Ct,null),e(Ct,gM),e(Ct,i_),e(i_,_M),e(Ct,bM),e(Ct,bc),e(bc,kM),e(bc,$f),e($f,yM),e(bc,TM),e(Ct,vM),e(Ct,kc),e(kc,wM),e(kc,yc),e(yc,$M),e(kc,FM),e(Ct,xM),e(Ct,mo),w(Tc,mo,null),e(mo,EM),e(mo,ds),e(ds,BM),e(ds,Ff),e(Ff,zM),e(ds,MM),e(ds,l_),e(l_,PM),e(ds,jM),e(mo,qM),w(Dr,mo,null),e(mo,CM),w(Sr,mo,null),g(i,KT,_),g(i,cs,_),e(cs,Ur),e(Ur,d_),w(vc,d_,null),e(cs,AM),e(cs,c_),e(c_,NM),g(i,QT,_),g(i,At,_),w(wc,At,null),e(At,OM),e(At,ps),e(ps,IM),e(ps,p_),e(p_,LM),e(ps,DM),e(ps,h_),e(h_,SM),e(ps,UM),e(At,WM),e(At,$c),e($c,HM),e($c,xf),e(xf,RM),e($c,KM),e(At,QM),e(At,Fc),e(Fc,VM),e(Fc,xc),e(xc,GM),e(Fc,JM),e(At,XM),e(At,fo),w(Ec,fo,null),e(fo,YM),e(fo,hs),e(hs,ZM),e(hs,Ef),e(Ef,e4),e(hs,t4),e(hs,m_),e(m_,o4),e(hs,n4),e(fo,s4),w(Wr,fo,null),e(fo,r4),w(Hr,fo,null),g(i,VT,_),g(i,ms,_),e(ms,Rr),e(Rr,f_),w(Bc,f_,null),e(ms,a4),e(ms,u_),e(u_,i4),g(i,GT,_),g(i,ft,_),w(zc,ft,null),e(ft,l4),e(ft,g_),e(g_,d4),e(ft,c4),e(ft,Mc),e(Mc,p4),e(Mc,Bf),e(Bf,h4),e(Mc,m4),e(ft,f4),e(ft,Pc),e(Pc,u4),e(Pc,jc),e(jc,g4),e(Pc,_4),e(ft,b4),w(Kr,ft,null),e(ft,k4),e(ft,uo),w(qc,uo,null),e(uo,y4),e(uo,fs),e(fs,T4),e(fs,zf),e(zf,v4),e(fs,w4),e(fs,__),e(__,$4),e(fs,F4),e(uo,x4),w(Qr,uo,null),e(uo,E4),w(Vr,uo,null),g(i,JT,_),g(i,us,_),e(us,Gr),e(Gr,b_),w(Cc,b_,null),e(us,B4),e(us,k_),e(k_,z4),g(i,XT,_),g(i,ut,_),w(Ac,ut,null),e(ut,M4),e(ut,gs),e(gs,P4),e(gs,y_),e(y_,j4),e(gs,q4),e(gs,T_),e(T_,C4),e(gs,A4),e(ut,N4),e(ut,Nc),e(Nc,O4),e(Nc,Mf),e(Mf,I4),e(Nc,L4),e(ut,D4),e(ut,Oc),e(Oc,S4),e(Oc,Ic),e(Ic,U4),e(Oc,W4),e(ut,H4),w(Jr,ut,null),e(ut,R4),e(ut,go),w(Lc,go,null),e(go,K4),e(go,_s),e(_s,Q4),e(_s,Pf),e(Pf,V4),e(_s,G4),e(_s,v_),e(v_,J4),e(_s,X4),e(go,Y4),w(Xr,go,null),e(go,Z4),w(Yr,go,null),g(i,YT,_),g(i,bs,_),e(bs,Zr),e(Zr,w_),w(Dc,w_,null),e(bs,eP),e(bs,$_),e($_,tP),g(i,ZT,_),g(i,ks,_),w(Sc,ks,null),e(ks,oP),e(ks,It),w(Uc,It,null),e(It,nP),e(It,nt),e(nt,sP),e(nt,F_),e(F_,rP),e(nt,aP),e(nt,x_),e(x_,iP),e(nt,lP),e(nt,E_),e(E_,dP),e(nt,cP),e(nt,B_),e(B_,pP),e(nt,hP),e(nt,z_),e(z_,mP),e(nt,fP),e(nt,M_),e(M_,uP),e(nt,gP),e(nt,P_),e(P_,_P),e(nt,bP),e(It,kP),e(It,Wc),e(Wc,Hc),e(Hc,yP),e(Hc,j_),e(j_,TP),e(Hc,vP),e(Wc,wP),e(Wc,Rc),e(Rc,$P),e(Rc,q_),e(q_,FP),e(Rc,xP),e(It,EP),e(It,ee),e(ee,BP),e(ee,C_),e(C_,zP),e(ee,MP),e(ee,A_),e(A_,PP),e(ee,jP),e(ee,N_),e(N_,qP),e(ee,CP),e(ee,O_),e(O_,AP),e(ee,NP),e(ee,I_),e(I_,OP),e(ee,IP),e(ee,L_),e(L_,LP),e(ee,DP),e(ee,D_),e(D_,SP),e(ee,UP),e(ee,S_),e(S_,WP),e(ee,HP),e(ee,U_),e(U_,RP),e(ee,KP),e(ee,W_),e(W_,QP),e(ee,VP),e(ee,H_),e(H_,GP),e(ee,JP),e(ee,R_),e(R_,XP),e(ee,YP),e(ee,K_),e(K_,ZP),e(ee,ej),e(ee,Q_),e(Q_,tj),e(ee,oj),e(ee,V_),e(V_,nj),e(ee,sj),e(ee,G_),e(G_,rj),e(ee,aj),e(ee,J_),e(J_,ij),e(ee,lj),e(ee,X_),e(X_,dj),e(ee,cj),e(ee,Y_),e(Y_,pj),e(ee,hj),e(ee,Z_),e(Z_,mj),e(ee,fj),e(It,uj),w(ea,It,null),g(i,ev,_),g(i,ys,_),e(ys,ta),e(ta,eb),w(Kc,eb,null),e(ys,gj),e(ys,tb),e(tb,_j),g(i,tv,_),g(i,gt,_),w(Qc,gt,null),e(gt,bj),e(gt,Vc),e(Vc,kj),e(Vc,ob),e(ob,yj),e(Vc,Tj),e(gt,vj),e(gt,Gc),e(Gc,wj),e(Gc,jf),e(jf,$j),e(Gc,Fj),e(gt,xj),e(gt,Jc),e(Jc,Ej),e(Jc,Xc),e(Xc,Bj),e(Jc,zj),e(gt,Mj),w(oa,gt,null),e(gt,Pj),e(gt,Lt),w(Yc,Lt,null),e(Lt,jj),e(Lt,Ts),e(Ts,qj),e(Ts,qf),e(qf,Cj),e(Ts,Aj),e(Ts,nb),e(nb,Nj),e(Ts,Oj),e(Lt,Ij),w(na,Lt,null),e(Lt,Lj),w(sa,Lt,null),e(Lt,Dj),w(ra,Lt,null),g(i,ov,_),g(i,vs,_),e(vs,aa),e(aa,sb),w(Zc,sb,null),e(vs,Sj),e(vs,rb),e(rb,Uj),g(i,nv,_),g(i,_t,_),w(ep,_t,null),e(_t,Wj),e(_t,tp),e(tp,Hj),e(tp,ab),e(ab,Rj),e(tp,Kj),e(_t,Qj),e(_t,op),e(op,Vj),e(op,Cf),e(Cf,Gj),e(op,Jj),e(_t,Xj),e(_t,np),e(np,Yj),e(np,sp),e(sp,Zj),e(np,eq),e(_t,tq),w(ia,_t,null),e(_t,oq),e(_t,_o),w(rp,_o,null),e(_o,nq),e(_o,ws),e(ws,sq),e(ws,Af),e(Af,rq),e(ws,aq),e(ws,ib),e(ib,iq),e(ws,lq),e(_o,dq),w(la,_o,null),e(_o,cq),w(da,_o,null),g(i,sv,_),g(i,$s,_),e($s,ca),e(ca,lb),w(ap,lb,null),e($s,pq),e($s,db),e(db,hq),g(i,rv,_),g(i,bt,_),w(ip,bt,null),e(bt,mq),e(bt,cb),e(cb,fq),e(bt,uq),e(bt,lp),e(lp,gq),e(lp,Nf),e(Nf,_q),e(lp,bq),e(bt,kq),e(bt,dp),e(dp,yq),e(dp,cp),e(cp,Tq),e(dp,vq),e(bt,wq),w(pa,bt,null),e(bt,$q),e(bt,Dt),w(pp,Dt,null),e(Dt,Fq),e(Dt,Fs),e(Fs,xq),e(Fs,Of),e(Of,Eq),e(Fs,Bq),e(Fs,pb),e(pb,zq),e(Fs,Mq),e(Dt,Pq),w(ha,Dt,null),e(Dt,jq),w(ma,Dt,null),e(Dt,qq),w(fa,Dt,null),g(i,av,_),g(i,xs,_),e(xs,ua),e(ua,hb),w(hp,hb,null),e(xs,Cq),e(xs,mb),e(mb,Aq),g(i,iv,_),g(i,kt,_),w(mp,kt,null),e(kt,Nq),e(kt,fb),e(fb,Oq),e(kt,Iq),e(kt,fp),e(fp,Lq),e(fp,If),e(If,Dq),e(fp,Sq),e(kt,Uq),e(kt,up),e(up,Wq),e(up,gp),e(gp,Hq),e(up,Rq),e(kt,Kq),w(ga,kt,null),e(kt,Qq),e(kt,bo),w(_p,bo,null),e(bo,Vq),e(bo,Es),e(Es,Gq),e(Es,Lf),e(Lf,Jq),e(Es,Xq),e(Es,ub),e(ub,Yq),e(Es,Zq),e(bo,e3),w(_a,bo,null),e(bo,t3),w(ba,bo,null),g(i,lv,_),g(i,Bs,_),e(Bs,ka),e(ka,gb),w(bp,gb,null),e(Bs,o3),e(Bs,_b),e(_b,n3),g(i,dv,_),g(i,yt,_),w(kp,yt,null),e(yt,s3),e(yt,bb),e(bb,r3),e(yt,a3),e(yt,yp),e(yp,i3),e(yp,Df),e(Df,l3),e(yp,d3),e(yt,c3),e(yt,Tp),e(Tp,p3),e(Tp,vp),e(vp,h3),e(Tp,m3),e(yt,f3),w(ya,yt,null),e(yt,u3),e(yt,St),w(wp,St,null),e(St,g3),e(St,zs),e(zs,_3),e(zs,Sf),e(Sf,b3),e(zs,k3),e(zs,kb),e(kb,y3),e(zs,T3),e(St,v3),w(Ta,St,null),e(St,w3),w(va,St,null),e(St,$3),w(wa,St,null),g(i,cv,_),g(i,Ms,_),e(Ms,$a),e($a,yb),w($p,yb,null),e(Ms,F3),e(Ms,Tb),e(Tb,x3),g(i,pv,_),g(i,Tt,_),w(Fp,Tt,null),e(Tt,E3),e(Tt,Ps),e(Ps,B3),e(Ps,vb),e(vb,z3),e(Ps,M3),e(Ps,wb),e(wb,P3),e(Ps,j3),e(Tt,q3),e(Tt,xp),e(xp,C3),e(xp,Uf),e(Uf,A3),e(xp,N3),e(Tt,O3),e(Tt,Ep),e(Ep,I3),e(Ep,Bp),e(Bp,L3),e(Ep,D3),e(Tt,S3),w(Fa,Tt,null),e(Tt,U3),e(Tt,Ut),w(zp,Ut,null),e(Ut,W3),e(Ut,js),e(js,H3),e(js,Wf),e(Wf,R3),e(js,K3),e(js,$b),e($b,Q3),e(js,V3),e(Ut,G3),w(xa,Ut,null),e(Ut,J3),w(Ea,Ut,null),e(Ut,X3),w(Ba,Ut,null),g(i,hv,_),g(i,qs,_),e(qs,za),e(za,Fb),w(Mp,Fb,null),e(qs,Y3),e(qs,xb),e(xb,Z3),g(i,mv,_),g(i,st,_),w(Pp,st,null),e(st,eC),e(st,Eb),e(Eb,tC),e(st,oC),e(st,jp),e(jp,nC),e(jp,Hf),e(Hf,sC),e(jp,rC),e(st,aC),e(st,qp),e(qp,iC),e(qp,Cp),e(Cp,lC),e(qp,dC),e(st,cC),e(st,Bb),e(Bb,pC),e(st,hC),e(st,Lo),e(Lo,zb),e(zb,Ap),e(Ap,mC),e(Lo,fC),e(Lo,Mb),e(Mb,Np),e(Np,uC),e(Lo,gC),e(Lo,Pb),e(Pb,Op),e(Op,_C),e(Lo,bC),e(Lo,jb),e(jb,Ip),e(Ip,kC),e(st,yC),e(st,ko),w(Lp,ko,null),e(ko,TC),e(ko,Cs),e(Cs,vC),e(Cs,qb),e(qb,wC),e(Cs,$C),e(Cs,Cb),e(Cb,FC),e(Cs,xC),e(ko,EC),w(Ma,ko,null),e(ko,BC),w(Pa,ko,null),g(i,fv,_),g(i,As,_),e(As,ja),e(ja,Ab),w(Dp,Ab,null),e(As,zC),e(As,Nb),e(Nb,MC),g(i,uv,_),g(i,rt,_),w(Sp,rt,null),e(rt,PC),e(rt,Ns),e(Ns,jC),e(Ns,Ob),e(Ob,qC),e(Ns,CC),e(Ns,Ib),e(Ib,AC),e(Ns,NC),e(rt,OC),e(rt,Up),e(Up,IC),e(Up,Rf),e(Rf,LC),e(Up,DC),e(rt,SC),e(rt,Wp),e(Wp,UC),e(Wp,Hp),e(Hp,WC),e(Wp,HC),e(rt,RC),e(rt,Lb),e(Lb,KC),e(rt,QC),e(rt,Do),e(Do,Db),e(Db,Rp),e(Rp,VC),e(Do,GC),e(Do,Sb),e(Sb,Kp),e(Kp,JC),e(Do,XC),e(Do,Ub),e(Ub,Qp),e(Qp,YC),e(Do,ZC),e(Do,Wb),e(Wb,Vp),e(Vp,e6),e(rt,t6),e(rt,yo),w(Gp,yo,null),e(yo,o6),e(yo,Os),e(Os,n6),e(Os,Hb),e(Hb,s6),e(Os,r6),e(Os,Rb),e(Rb,a6),e(Os,i6),e(yo,l6),w(qa,yo,null),e(yo,d6),w(Ca,yo,null),g(i,gv,_),g(i,Is,_),e(Is,Aa),e(Aa,Kb),w(Jp,Kb,null),e(Is,c6),e(Is,Qb),e(Qb,p6),g(i,_v,_),g(i,at,_),w(Xp,at,null),e(at,h6),e(at,Vb),e(Vb,m6),e(at,f6),e(at,Yp),e(Yp,u6),e(Yp,Kf),e(Kf,g6),e(Yp,_6),e(at,b6),e(at,Zp),e(Zp,k6),e(Zp,eh),e(eh,y6),e(Zp,T6),e(at,v6),e(at,Gb),e(Gb,w6),e(at,$6),e(at,So),e(So,Jb),e(Jb,th),e(th,F6),e(So,x6),e(So,Xb),e(Xb,oh),e(oh,E6),e(So,B6),e(So,Yb),e(Yb,nh),e(nh,z6),e(So,M6),e(So,Zb),e(Zb,sh),e(sh,P6),e(at,j6),e(at,To),w(rh,To,null),e(To,q6),e(To,Ls),e(Ls,C6),e(Ls,ek),e(ek,A6),e(Ls,N6),e(Ls,tk),e(tk,O6),e(Ls,I6),e(To,L6),w(Na,To,null),e(To,D6),w(Oa,To,null),g(i,bv,_),g(i,Ds,_),e(Ds,Ia),e(Ia,ok),w(ah,ok,null),e(Ds,S6),e(Ds,nk),e(nk,U6),g(i,kv,_),g(i,it,_),w(ih,it,null),e(it,W6),e(it,lh),e(lh,H6),e(lh,sk),e(sk,R6),e(lh,K6),e(it,Q6),e(it,dh),e(dh,V6),e(dh,Qf),e(Qf,G6),e(dh,J6),e(it,X6),e(it,ch),e(ch,Y6),e(ch,ph),e(ph,Z6),e(ch,e5),e(it,t5),e(it,rk),e(rk,o5),e(it,n5),e(it,Uo),e(Uo,ak),e(ak,hh),e(hh,s5),e(Uo,r5),e(Uo,ik),e(ik,mh),e(mh,a5),e(Uo,i5),e(Uo,lk),e(lk,fh),e(fh,l5),e(Uo,d5),e(Uo,dk),e(dk,uh),e(uh,c5),e(it,p5),e(it,vo),w(gh,vo,null),e(vo,h5),e(vo,Ss),e(Ss,m5),e(Ss,ck),e(ck,f5),e(Ss,u5),e(Ss,pk),e(pk,g5),e(Ss,_5),e(vo,b5),w(La,vo,null),e(vo,k5),w(Da,vo,null),g(i,yv,_),g(i,Us,_),e(Us,Sa),e(Sa,hk),w(_h,hk,null),e(Us,y5),e(Us,mk),e(mk,T5),g(i,Tv,_),g(i,lt,_),w(bh,lt,null),e(lt,v5),e(lt,kh),e(kh,w5),e(kh,fk),e(fk,$5),e(kh,F5),e(lt,x5),e(lt,yh),e(yh,E5),e(yh,Vf),e(Vf,B5),e(yh,z5),e(lt,M5),e(lt,Th),e(Th,P5),e(Th,vh),e(vh,j5),e(Th,q5),e(lt,C5),e(lt,uk),e(uk,A5),e(lt,N5),e(lt,Wo),e(Wo,gk),e(gk,wh),e(wh,O5),e(Wo,I5),e(Wo,_k),e(_k,$h),e($h,L5),e(Wo,D5),e(Wo,bk),e(bk,Fh),e(Fh,S5),e(Wo,U5),e(Wo,kk),e(kk,xh),e(xh,W5),e(lt,H5),e(lt,wo),w(Eh,wo,null),e(wo,R5),e(wo,Ws),e(Ws,K5),e(Ws,yk),e(yk,Q5),e(Ws,V5),e(Ws,Tk),e(Tk,G5),e(Ws,J5),e(wo,X5),w(Ua,wo,null),e(wo,Y5),w(Wa,wo,null),g(i,vv,_),g(i,Hs,_),e(Hs,Ha),e(Ha,vk),w(Bh,vk,null),e(Hs,Z5),e(Hs,wk),e(wk,eA),g(i,wv,_),g(i,dt,_),w(zh,dt,null),e(dt,tA),e(dt,$k),e($k,oA),e(dt,nA),e(dt,Mh),e(Mh,sA),e(Mh,Gf),e(Gf,rA),e(Mh,aA),e(dt,iA),e(dt,Ph),e(Ph,lA),e(Ph,jh),e(jh,dA),e(Ph,cA),e(dt,pA),e(dt,Fk),e(Fk,hA),e(dt,mA),e(dt,Ho),e(Ho,xk),e(xk,qh),e(qh,fA),e(Ho,uA),e(Ho,Ek),e(Ek,Ch),e(Ch,gA),e(Ho,_A),e(Ho,Bk),e(Bk,Ah),e(Ah,bA),e(Ho,kA),e(Ho,zk),e(zk,Nh),e(Nh,yA),e(dt,TA),e(dt,$o),w(Oh,$o,null),e($o,vA),e($o,Rs),e(Rs,wA),e(Rs,Mk),e(Mk,$A),e(Rs,FA),e(Rs,Pk),e(Pk,xA),e(Rs,EA),e($o,BA),w(Ra,$o,null),e($o,zA),w(Ka,$o,null),g(i,$v,_),g(i,Ks,_),e(Ks,Qa),e(Qa,jk),w(Ih,jk,null),e(Ks,MA),e(Ks,qk),e(qk,PA),g(i,Fv,_),g(i,ct,_),w(Lh,ct,null),e(ct,jA),e(ct,Ck),e(Ck,qA),e(ct,CA),e(ct,Dh),e(Dh,AA),e(Dh,Jf),e(Jf,NA),e(Dh,OA),e(ct,IA),e(ct,Sh),e(Sh,LA),e(Sh,Uh),e(Uh,DA),e(Sh,SA),e(ct,UA),e(ct,Ak),e(Ak,WA),e(ct,HA),e(ct,Ro),e(Ro,Nk),e(Nk,Wh),e(Wh,RA),e(Ro,KA),e(Ro,Ok),e(Ok,Hh),e(Hh,QA),e(Ro,VA),e(Ro,Ik),e(Ik,Rh),e(Rh,GA),e(Ro,JA),e(Ro,Lk),e(Lk,Kh),e(Kh,XA),e(ct,YA),e(ct,Fo),w(Qh,Fo,null),e(Fo,ZA),e(Fo,Qs),e(Qs,e7),e(Qs,Dk),e(Dk,t7),e(Qs,o7),e(Qs,Sk),e(Sk,n7),e(Qs,s7),e(Fo,r7),w(Va,Fo,null),e(Fo,a7),w(Ga,Fo,null),g(i,xv,_),g(i,Vs,_),e(Vs,Ja),e(Ja,Uk),w(Vh,Uk,null),e(Vs,i7),e(Vs,Wk),e(Wk,l7),g(i,Ev,_),g(i,pt,_),w(Gh,pt,null),e(pt,d7),e(pt,Hk),e(Hk,c7),e(pt,p7),e(pt,Jh),e(Jh,h7),e(Jh,Xf),e(Xf,m7),e(Jh,f7),e(pt,u7),e(pt,Xh),e(Xh,g7),e(Xh,Yh),e(Yh,_7),e(Xh,b7),e(pt,k7),e(pt,Rk),e(Rk,y7),e(pt,T7),e(pt,Ko),e(Ko,Kk),e(Kk,Zh),e(Zh,v7),e(Ko,w7),e(Ko,Qk),e(Qk,em),e(em,$7),e(Ko,F7),e(Ko,Vk),e(Vk,tm),e(tm,x7),e(Ko,E7),e(Ko,Gk),e(Gk,om),e(om,B7),e(pt,z7),e(pt,xo),w(nm,xo,null),e(xo,M7),e(xo,Gs),e(Gs,P7),e(Gs,Jk),e(Jk,j7),e(Gs,q7),e(Gs,Xk),e(Xk,C7),e(Gs,A7),e(xo,N7),w(Xa,xo,null),e(xo,O7),w(Ya,xo,null),g(i,Bv,_),g(i,Js,_),e(Js,Za),e(Za,Yk),w(sm,Yk,null),e(Js,I7),e(Js,Zk),e(Zk,L7),g(i,zv,_),g(i,ht,_),w(rm,ht,null),e(ht,D7),e(ht,Xs),e(Xs,S7),e(Xs,ey),e(ey,U7),e(Xs,W7),e(Xs,ty),e(ty,H7),e(Xs,R7),e(ht,K7),e(ht,am),e(am,Q7),e(am,Yf),e(Yf,V7),e(am,G7),e(ht,J7),e(ht,im),e(im,X7),e(im,lm),e(lm,Y7),e(im,Z7),e(ht,e8),e(ht,oy),e(oy,t8),e(ht,o8),e(ht,Qo),e(Qo,ny),e(ny,dm),e(dm,n8),e(Qo,s8),e(Qo,sy),e(sy,cm),e(cm,r8),e(Qo,a8),e(Qo,ry),e(ry,pm),e(pm,i8),e(Qo,l8),e(Qo,ay),e(ay,hm),e(hm,d8),e(ht,c8),e(ht,Eo),w(mm,Eo,null),e(Eo,p8),e(Eo,Ys),e(Ys,h8),e(Ys,iy),e(iy,m8),e(Ys,f8),e(Ys,ly),e(ly,u8),e(Ys,g8),e(Eo,_8),w(ei,Eo,null),e(Eo,b8),w(ti,Eo,null),Mv=!0},p(i,[_]){const fm={};_&2&&(fm.$$scope={dirty:_,ctx:i}),ar.$set(fm);const dy={};_&2&&(dy.$$scope={dirty:_,ctx:i}),dr.$set(dy);const cy={};_&2&&(cy.$$scope={dirty:_,ctx:i}),pr.$set(cy);const py={};_&2&&(py.$$scope={dirty:_,ctx:i}),mr.$set(py);const um={};_&2&&(um.$$scope={dirty:_,ctx:i}),fr.$set(um);const hy={};_&2&&(hy.$$scope={dirty:_,ctx:i}),br.$set(hy);const my={};_&2&&(my.$$scope={dirty:_,ctx:i}),kr.$set(my);const fy={};_&2&&(fy.$$scope={dirty:_,ctx:i}),Tr.$set(fy);const gm={};_&2&&(gm.$$scope={dirty:_,ctx:i}),vr.$set(gm);const uy={};_&2&&(uy.$$scope={dirty:_,ctx:i}),$r.$set(uy);const gy={};_&2&&(gy.$$scope={dirty:_,ctx:i}),Fr.$set(gy);const _y={};_&2&&(_y.$$scope={dirty:_,ctx:i}),Er.$set(_y);const by={};_&2&&(by.$$scope={dirty:_,ctx:i}),Br.$set(by);const ky={};_&2&&(ky.$$scope={dirty:_,ctx:i}),Mr.$set(ky);const yy={};_&2&&(yy.$$scope={dirty:_,ctx:i}),Pr.$set(yy);const Ty={};_&2&&(Ty.$$scope={dirty:_,ctx:i}),qr.$set(Ty);const _m={};_&2&&(_m.$$scope={dirty:_,ctx:i}),Cr.$set(_m);const vy={};_&2&&(vy.$$scope={dirty:_,ctx:i}),Ar.$set(vy);const wy={};_&2&&(wy.$$scope={dirty:_,ctx:i}),Or.$set(wy);const Zs={};_&2&&(Zs.$$scope={dirty:_,ctx:i}),Ir.$set(Zs);const $y={};_&2&&($y.$$scope={dirty:_,ctx:i}),Dr.$set($y);const Fy={};_&2&&(Fy.$$scope={dirty:_,ctx:i}),Sr.$set(Fy);const bm={};_&2&&(bm.$$scope={dirty:_,ctx:i}),Wr.$set(bm);const xy={};_&2&&(xy.$$scope={dirty:_,ctx:i}),Hr.$set(xy);const Ey={};_&2&&(Ey.$$scope={dirty:_,ctx:i}),Kr.$set(Ey);const By={};_&2&&(By.$$scope={dirty:_,ctx:i}),Qr.$set(By);const zy={};_&2&&(zy.$$scope={dirty:_,ctx:i}),Vr.$set(zy);const vt={};_&2&&(vt.$$scope={dirty:_,ctx:i}),Jr.$set(vt);const km={};_&2&&(km.$$scope={dirty:_,ctx:i}),Xr.$set(km);const My={};_&2&&(My.$$scope={dirty:_,ctx:i}),Yr.$set(My);const ym={};_&2&&(ym.$$scope={dirty:_,ctx:i}),ea.$set(ym);const Py={};_&2&&(Py.$$scope={dirty:_,ctx:i}),oa.$set(Py);const Tm={};_&2&&(Tm.$$scope={dirty:_,ctx:i}),na.$set(Tm);const jy={};_&2&&(jy.$$scope={dirty:_,ctx:i}),sa.$set(jy);const vm={};_&2&&(vm.$$scope={dirty:_,ctx:i}),ra.$set(vm);const qy={};_&2&&(qy.$$scope={dirty:_,ctx:i}),ia.$set(qy);const hn={};_&2&&(hn.$$scope={dirty:_,ctx:i}),la.$set(hn);const Cy={};_&2&&(Cy.$$scope={dirty:_,ctx:i}),da.$set(Cy);const Ay={};_&2&&(Ay.$$scope={dirty:_,ctx:i}),pa.$set(Ay);const Ny={};_&2&&(Ny.$$scope={dirty:_,ctx:i}),ha.$set(Ny);const mn={};_&2&&(mn.$$scope={dirty:_,ctx:i}),ma.$set(mn);const Oy={};_&2&&(Oy.$$scope={dirty:_,ctx:i}),fa.$set(Oy);const Iy={};_&2&&(Iy.$$scope={dirty:_,ctx:i}),ga.$set(Iy);const Ly={};_&2&&(Ly.$$scope={dirty:_,ctx:i}),_a.$set(Ly);const fn={};_&2&&(fn.$$scope={dirty:_,ctx:i}),ba.$set(fn);const Dy={};_&2&&(Dy.$$scope={dirty:_,ctx:i}),ya.$set(Dy);const Sy={};_&2&&(Sy.$$scope={dirty:_,ctx:i}),Ta.$set(Sy);const Uy={};_&2&&(Uy.$$scope={dirty:_,ctx:i}),va.$set(Uy);const Nt={};_&2&&(Nt.$$scope={dirty:_,ctx:i}),wa.$set(Nt);const wm={};_&2&&(wm.$$scope={dirty:_,ctx:i}),Fa.$set(wm);const Wy={};_&2&&(Wy.$$scope={dirty:_,ctx:i}),xa.$set(Wy);const er={};_&2&&(er.$$scope={dirty:_,ctx:i}),Ea.$set(er);const Hy={};_&2&&(Hy.$$scope={dirty:_,ctx:i}),Ba.$set(Hy);const Ry={};_&2&&(Ry.$$scope={dirty:_,ctx:i}),Ma.$set(Ry);const un={};_&2&&(un.$$scope={dirty:_,ctx:i}),Pa.$set(un);const Ky={};_&2&&(Ky.$$scope={dirty:_,ctx:i}),qa.$set(Ky);const Qy={};_&2&&(Qy.$$scope={dirty:_,ctx:i}),Ca.$set(Qy);const Vy={};_&2&&(Vy.$$scope={dirty:_,ctx:i}),Na.$set(Vy);const gn={};_&2&&(gn.$$scope={dirty:_,ctx:i}),Oa.$set(gn);const Gy={};_&2&&(Gy.$$scope={dirty:_,ctx:i}),La.$set(Gy);const Jy={};_&2&&(Jy.$$scope={dirty:_,ctx:i}),Da.$set(Jy);const Xy={};_&2&&(Xy.$$scope={dirty:_,ctx:i}),Ua.$set(Xy);const oi={};_&2&&(oi.$$scope={dirty:_,ctx:i}),Wa.$set(oi);const Yy={};_&2&&(Yy.$$scope={dirty:_,ctx:i}),Ra.$set(Yy);const Zy={};_&2&&(Zy.$$scope={dirty:_,ctx:i}),Ka.$set(Zy);const Zf={};_&2&&(Zf.$$scope={dirty:_,ctx:i}),Va.$set(Zf);const eT={};_&2&&(eT.$$scope={dirty:_,ctx:i}),Ga.$set(eT);const Vo={};_&2&&(Vo.$$scope={dirty:_,ctx:i}),Xa.$set(Vo);const _n={};_&2&&(_n.$$scope={dirty:_,ctx:i}),Ya.$set(_n);const tT={};_&2&&(tT.$$scope={dirty:_,ctx:i}),ei.$set(tT);const oT={};_&2&&(oT.$$scope={dirty:_,ctx:i}),ti.$set(oT)},i(i){Mv||($(l.$$.fragment,i),$(B.$$.fragment,i),$(he.$$.fragment,i),$(Ue.$$.fragment,i),$(Qi.$$.fragment,i),$(sl.$$.fragment,i),$(hl.$$.fragment,i),$(Hl.$$.fragment,i),$(Rl.$$.fragment,i),$(ar.$$.fragment,i),$(Ql.$$.fragment,i),$(Vl.$$.fragment,i),$(Jl.$$.fragment,i),$(Yl.$$.fragment,i),$(ed.$$.fragment,i),$(dr.$$.fragment,i),$(td.$$.fragment,i),$(od.$$.fragment,i),$(nd.$$.fragment,i),$(ad.$$.fragment,i),$(ld.$$.fragment,i),$(pr.$$.fragment,i),$(dd.$$.fragment,i),$(cd.$$.fragment,i),$(hd.$$.fragment,i),$(mr.$$.fragment,i),$(fd.$$.fragment,i),$(fr.$$.fragment,i),$(ud.$$.fragment,i),$(gd.$$.fragment,i),$(bd.$$.fragment,i),$(yd.$$.fragment,i),$(vd.$$.fragment,i),$(wd.$$.fragment,i),$($d.$$.fragment,i),$(Md.$$.fragment,i),$(br.$$.fragment,i),$(kr.$$.fragment,i),$(Pd.$$.fragment,i),$(jd.$$.fragment,i),$(Nd.$$.fragment,i),$(Tr.$$.fragment,i),$(vr.$$.fragment,i),$(Od.$$.fragment,i),$(Id.$$.fragment,i),$(Wd.$$.fragment,i),$($r.$$.fragment,i),$(Fr.$$.fragment,i),$(Hd.$$.fragment,i),$(Rd.$$.fragment,i),$(Jd.$$.fragment,i),$(Er.$$.fragment,i),$(Br.$$.fragment,i),$(Xd.$$.fragment,i),$(Yd.$$.fragment,i),$(nc.$$.fragment,i),$(Mr.$$.fragment,i),$(Pr.$$.fragment,i),$(sc.$$.fragment,i),$(rc.$$.fragment,i),$(dc.$$.fragment,i),$(qr.$$.fragment,i),$(Cr.$$.fragment,i),$(Ar.$$.fragment,i),$(cc.$$.fragment,i),$(pc.$$.fragment,i),$(uc.$$.fragment,i),$(Or.$$.fragment,i),$(Ir.$$.fragment,i),$(gc.$$.fragment,i),$(_c.$$.fragment,i),$(Tc.$$.fragment,i),$(Dr.$$.fragment,i),$(Sr.$$.fragment,i),$(vc.$$.fragment,i),$(wc.$$.fragment,i),$(Ec.$$.fragment,i),$(Wr.$$.fragment,i),$(Hr.$$.fragment,i),$(Bc.$$.fragment,i),$(zc.$$.fragment,i),$(Kr.$$.fragment,i),$(qc.$$.fragment,i),$(Qr.$$.fragment,i),$(Vr.$$.fragment,i),$(Cc.$$.fragment,i),$(Ac.$$.fragment,i),$(Jr.$$.fragment,i),$(Lc.$$.fragment,i),$(Xr.$$.fragment,i),$(Yr.$$.fragment,i),$(Dc.$$.fragment,i),$(Sc.$$.fragment,i),$(Uc.$$.fragment,i),$(ea.$$.fragment,i),$(Kc.$$.fragment,i),$(Qc.$$.fragment,i),$(oa.$$.fragment,i),$(Yc.$$.fragment,i),$(na.$$.fragment,i),$(sa.$$.fragment,i),$(ra.$$.fragment,i),$(Zc.$$.fragment,i),$(ep.$$.fragment,i),$(ia.$$.fragment,i),$(rp.$$.fragment,i),$(la.$$.fragment,i),$(da.$$.fragment,i),$(ap.$$.fragment,i),$(ip.$$.fragment,i),$(pa.$$.fragment,i),$(pp.$$.fragment,i),$(ha.$$.fragment,i),$(ma.$$.fragment,i),$(fa.$$.fragment,i),$(hp.$$.fragment,i),$(mp.$$.fragment,i),$(ga.$$.fragment,i),$(_p.$$.fragment,i),$(_a.$$.fragment,i),$(ba.$$.fragment,i),$(bp.$$.fragment,i),$(kp.$$.fragment,i),$(ya.$$.fragment,i),$(wp.$$.fragment,i),$(Ta.$$.fragment,i),$(va.$$.fragment,i),$(wa.$$.fragment,i),$($p.$$.fragment,i),$(Fp.$$.fragment,i),$(Fa.$$.fragment,i),$(zp.$$.fragment,i),$(xa.$$.fragment,i),$(Ea.$$.fragment,i),$(Ba.$$.fragment,i),$(Mp.$$.fragment,i),$(Pp.$$.fragment,i),$(Lp.$$.fragment,i),$(Ma.$$.fragment,i),$(Pa.$$.fragment,i),$(Dp.$$.fragment,i),$(Sp.$$.fragment,i),$(Gp.$$.fragment,i),$(qa.$$.fragment,i),$(Ca.$$.fragment,i),$(Jp.$$.fragment,i),$(Xp.$$.fragment,i),$(rh.$$.fragment,i),$(Na.$$.fragment,i),$(Oa.$$.fragment,i),$(ah.$$.fragment,i),$(ih.$$.fragment,i),$(gh.$$.fragment,i),$(La.$$.fragment,i),$(Da.$$.fragment,i),$(_h.$$.fragment,i),$(bh.$$.fragment,i),$(Eh.$$.fragment,i),$(Ua.$$.fragment,i),$(Wa.$$.fragment,i),$(Bh.$$.fragment,i),$(zh.$$.fragment,i),$(Oh.$$.fragment,i),$(Ra.$$.fragment,i),$(Ka.$$.fragment,i),$(Ih.$$.fragment,i),$(Lh.$$.fragment,i),$(Qh.$$.fragment,i),$(Va.$$.fragment,i),$(Ga.$$.fragment,i),$(Vh.$$.fragment,i),$(Gh.$$.fragment,i),$(nm.$$.fragment,i),$(Xa.$$.fragment,i),$(Ya.$$.fragment,i),$(sm.$$.fragment,i),$(rm.$$.fragment,i),$(mm.$$.fragment,i),$(ei.$$.fragment,i),$(ti.$$.fragment,i),Mv=!0)},o(i){F(l.$$.fragment,i),F(B.$$.fragment,i),F(he.$$.fragment,i),F(Ue.$$.fragment,i),F(Qi.$$.fragment,i),F(sl.$$.fragment,i),F(hl.$$.fragment,i),F(Hl.$$.fragment,i),F(Rl.$$.fragment,i),F(ar.$$.fragment,i),F(Ql.$$.fragment,i),F(Vl.$$.fragment,i),F(Jl.$$.fragment,i),F(Yl.$$.fragment,i),F(ed.$$.fragment,i),F(dr.$$.fragment,i),F(td.$$.fragment,i),F(od.$$.fragment,i),F(nd.$$.fragment,i),F(ad.$$.fragment,i),F(ld.$$.fragment,i),F(pr.$$.fragment,i),F(dd.$$.fragment,i),F(cd.$$.fragment,i),F(hd.$$.fragment,i),F(mr.$$.fragment,i),F(fd.$$.fragment,i),F(fr.$$.fragment,i),F(ud.$$.fragment,i),F(gd.$$.fragment,i),F(bd.$$.fragment,i),F(yd.$$.fragment,i),F(vd.$$.fragment,i),F(wd.$$.fragment,i),F($d.$$.fragment,i),F(Md.$$.fragment,i),F(br.$$.fragment,i),F(kr.$$.fragment,i),F(Pd.$$.fragment,i),F(jd.$$.fragment,i),F(Nd.$$.fragment,i),F(Tr.$$.fragment,i),F(vr.$$.fragment,i),F(Od.$$.fragment,i),F(Id.$$.fragment,i),F(Wd.$$.fragment,i),F($r.$$.fragment,i),F(Fr.$$.fragment,i),F(Hd.$$.fragment,i),F(Rd.$$.fragment,i),F(Jd.$$.fragment,i),F(Er.$$.fragment,i),F(Br.$$.fragment,i),F(Xd.$$.fragment,i),F(Yd.$$.fragment,i),F(nc.$$.fragment,i),F(Mr.$$.fragment,i),F(Pr.$$.fragment,i),F(sc.$$.fragment,i),F(rc.$$.fragment,i),F(dc.$$.fragment,i),F(qr.$$.fragment,i),F(Cr.$$.fragment,i),F(Ar.$$.fragment,i),F(cc.$$.fragment,i),F(pc.$$.fragment,i),F(uc.$$.fragment,i),F(Or.$$.fragment,i),F(Ir.$$.fragment,i),F(gc.$$.fragment,i),F(_c.$$.fragment,i),F(Tc.$$.fragment,i),F(Dr.$$.fragment,i),F(Sr.$$.fragment,i),F(vc.$$.fragment,i),F(wc.$$.fragment,i),F(Ec.$$.fragment,i),F(Wr.$$.fragment,i),F(Hr.$$.fragment,i),F(Bc.$$.fragment,i),F(zc.$$.fragment,i),F(Kr.$$.fragment,i),F(qc.$$.fragment,i),F(Qr.$$.fragment,i),F(Vr.$$.fragment,i),F(Cc.$$.fragment,i),F(Ac.$$.fragment,i),F(Jr.$$.fragment,i),F(Lc.$$.fragment,i),F(Xr.$$.fragment,i),F(Yr.$$.fragment,i),F(Dc.$$.fragment,i),F(Sc.$$.fragment,i),F(Uc.$$.fragment,i),F(ea.$$.fragment,i),F(Kc.$$.fragment,i),F(Qc.$$.fragment,i),F(oa.$$.fragment,i),F(Yc.$$.fragment,i),F(na.$$.fragment,i),F(sa.$$.fragment,i),F(ra.$$.fragment,i),F(Zc.$$.fragment,i),F(ep.$$.fragment,i),F(ia.$$.fragment,i),F(rp.$$.fragment,i),F(la.$$.fragment,i),F(da.$$.fragment,i),F(ap.$$.fragment,i),F(ip.$$.fragment,i),F(pa.$$.fragment,i),F(pp.$$.fragment,i),F(ha.$$.fragment,i),F(ma.$$.fragment,i),F(fa.$$.fragment,i),F(hp.$$.fragment,i),F(mp.$$.fragment,i),F(ga.$$.fragment,i),F(_p.$$.fragment,i),F(_a.$$.fragment,i),F(ba.$$.fragment,i),F(bp.$$.fragment,i),F(kp.$$.fragment,i),F(ya.$$.fragment,i),F(wp.$$.fragment,i),F(Ta.$$.fragment,i),F(va.$$.fragment,i),F(wa.$$.fragment,i),F($p.$$.fragment,i),F(Fp.$$.fragment,i),F(Fa.$$.fragment,i),F(zp.$$.fragment,i),F(xa.$$.fragment,i),F(Ea.$$.fragment,i),F(Ba.$$.fragment,i),F(Mp.$$.fragment,i),F(Pp.$$.fragment,i),F(Lp.$$.fragment,i),F(Ma.$$.fragment,i),F(Pa.$$.fragment,i),F(Dp.$$.fragment,i),F(Sp.$$.fragment,i),F(Gp.$$.fragment,i),F(qa.$$.fragment,i),F(Ca.$$.fragment,i),F(Jp.$$.fragment,i),F(Xp.$$.fragment,i),F(rh.$$.fragment,i),F(Na.$$.fragment,i),F(Oa.$$.fragment,i),F(ah.$$.fragment,i),F(ih.$$.fragment,i),F(gh.$$.fragment,i),F(La.$$.fragment,i),F(Da.$$.fragment,i),F(_h.$$.fragment,i),F(bh.$$.fragment,i),F(Eh.$$.fragment,i),F(Ua.$$.fragment,i),F(Wa.$$.fragment,i),F(Bh.$$.fragment,i),F(zh.$$.fragment,i),F(Oh.$$.fragment,i),F(Ra.$$.fragment,i),F(Ka.$$.fragment,i),F(Ih.$$.fragment,i),F(Lh.$$.fragment,i),F(Qh.$$.fragment,i),F(Va.$$.fragment,i),F(Ga.$$.fragment,i),F(Vh.$$.fragment,i),F(Gh.$$.fragment,i),F(nm.$$.fragment,i),F(Xa.$$.fragment,i),F(Ya.$$.fragment,i),F(sm.$$.fragment,i),F(rm.$$.fragment,i),F(mm.$$.fragment,i),F(ei.$$.fragment,i),F(ti.$$.fragment,i),Mv=!1},d(i){t(d),i&&t(k),i&&t(f),x(l),i&&t(ye),i&&t(S),x(B),i&&t(Te),i&&t(U),i&&t(ve),i&&t(R),i&&t(we),i&&t(K),i&&t(te),i&&t(j),i&&t(G),i&&t(me),i&&t(J),i&&t(de),i&&t($e),i&&t(D),i&&t(C),i&&t(ie),x(he),i&&t(oe),i&&t(Ke),i&&t(P),x(Ue,i),i&&t(Qe),i&&t(re),i&&t(sT),x(Qi,i),i&&t(rT),i&&t(wt),i&&t(aT),x(sl,i),i&&t(iT),i&&t(oo),i&&t(lT),x(hl,i),i&&t(dT),i&&t(no),i&&t(cT),i&&t(Rm),i&&t(pT),i&&t(nr),i&&t(hT),i&&t(wl),i&&t(mT),i&&t(sr),i&&t(fT),i&&t(Bl),i&&t(uT),i&&t(Vm),i&&t(gT),i&&t(Pl),i&&t(_T),i&&t($t),i&&t(bT),i&&t(An),x(Hl),i&&t(kT),i&&t(to),x(Rl),x(ar),i&&t(yT),i&&t(On),x(Ql),i&&t(TT),i&&t(tt),x(Vl),x(Jl),x(Yl),x(ed),x(dr),x(td),i&&t(vT),i&&t(Ln),x(od),i&&t(wT),i&&t(xt),x(nd),x(ad),x(ld),x(pr),i&&t($T),i&&t(Sn),x(dd),i&&t(FT),i&&t(Et),x(cd),x(hd),x(mr),x(fd),x(fr),i&&t(xT),i&&t(Hn),x(ud),i&&t(ET),i&&t(Rn),x(gd),i&&t(BT),i&&t(Kn),x(bd),i&&t(zT),i&&t(Io),x(yd),x(vd),i&&t(MT),i&&t(Qn),x(wd),i&&t(PT),i&&t(ot),x($d),x(Md),x(br),x(kr),i&&t(jT),i&&t(Gn),x(Pd),i&&t(qT),i&&t(Bt),x(jd),x(Nd),x(Tr),x(vr),i&&t(CT),i&&t(Yn),x(Od),i&&t(AT),i&&t(zt),x(Id),x(Wd),x($r),x(Fr),i&&t(NT),i&&t(es),x(Hd),i&&t(OT),i&&t(Mt),x(Rd),x(Jd),x(Er),x(Br),i&&t(IT),i&&t(os),x(Xd),i&&t(LT),i&&t(Pt),x(Yd),x(nc),x(Mr),x(Pr),i&&t(DT),i&&t(ss),x(sc),i&&t(ST),i&&t(jt),x(rc),x(dc),x(qr),x(Cr),x(Ar),i&&t(UT),i&&t(as),x(cc),i&&t(WT),i&&t(qt),x(pc),x(uc),x(Or),x(Ir),i&&t(HT),i&&t(ls),x(gc),i&&t(RT),i&&t(Ct),x(_c),x(Tc),x(Dr),x(Sr),i&&t(KT),i&&t(cs),x(vc),i&&t(QT),i&&t(At),x(wc),x(Ec),x(Wr),x(Hr),i&&t(VT),i&&t(ms),x(Bc),i&&t(GT),i&&t(ft),x(zc),x(Kr),x(qc),x(Qr),x(Vr),i&&t(JT),i&&t(us),x(Cc),i&&t(XT),i&&t(ut),x(Ac),x(Jr),x(Lc),x(Xr),x(Yr),i&&t(YT),i&&t(bs),x(Dc),i&&t(ZT),i&&t(ks),x(Sc),x(Uc),x(ea),i&&t(ev),i&&t(ys),x(Kc),i&&t(tv),i&&t(gt),x(Qc),x(oa),x(Yc),x(na),x(sa),x(ra),i&&t(ov),i&&t(vs),x(Zc),i&&t(nv),i&&t(_t),x(ep),x(ia),x(rp),x(la),x(da),i&&t(sv),i&&t($s),x(ap),i&&t(rv),i&&t(bt),x(ip),x(pa),x(pp),x(ha),x(ma),x(fa),i&&t(av),i&&t(xs),x(hp),i&&t(iv),i&&t(kt),x(mp),x(ga),x(_p),x(_a),x(ba),i&&t(lv),i&&t(Bs),x(bp),i&&t(dv),i&&t(yt),x(kp),x(ya),x(wp),x(Ta),x(va),x(wa),i&&t(cv),i&&t(Ms),x($p),i&&t(pv),i&&t(Tt),x(Fp),x(Fa),x(zp),x(xa),x(Ea),x(Ba),i&&t(hv),i&&t(qs),x(Mp),i&&t(mv),i&&t(st),x(Pp),x(Lp),x(Ma),x(Pa),i&&t(fv),i&&t(As),x(Dp),i&&t(uv),i&&t(rt),x(Sp),x(Gp),x(qa),x(Ca),i&&t(gv),i&&t(Is),x(Jp),i&&t(_v),i&&t(at),x(Xp),x(rh),x(Na),x(Oa),i&&t(bv),i&&t(Ds),x(ah),i&&t(kv),i&&t(it),x(ih),x(gh),x(La),x(Da),i&&t(yv),i&&t(Us),x(_h),i&&t(Tv),i&&t(lt),x(bh),x(Eh),x(Ua),x(Wa),i&&t(vv),i&&t(Hs),x(Bh),i&&t(wv),i&&t(dt),x(zh),x(Oh),x(Ra),x(Ka),i&&t($v),i&&t(Ks),x(Ih),i&&t(Fv),i&&t(ct),x(Lh),x(Qh),x(Va),x(Ga),i&&t(xv),i&&t(Vs),x(Vh),i&&t(Ev),i&&t(pt),x(Gh),x(nm),x(Xa),x(Ya),i&&t(Bv),i&&t(Js),x(sm),i&&t(zv),i&&t(ht),x(rm),x(mm),x(ei),x(ti)}}}const LW={local:"bert",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.BertConfig",title:"BertConfig"},{local:"transformers.BertTokenizer",title:"BertTokenizer"},{local:"transformers.BertTokenizerFast",title:"BertTokenizerFast"},{local:"transformers.TFBertTokenizer",title:"TFBertTokenizer"},{local:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput",title:"Bert specific outputs"},{local:"transformers.BertModel",title:"BertModel"},{local:"transformers.BertForPreTraining",title:"BertForPreTraining"},{local:"transformers.BertLMHeadModel",title:"BertLMHeadModel"},{local:"transformers.BertForMaskedLM",title:"BertForMaskedLM"},{local:"transformers.BertForNextSentencePrediction",title:"BertForNextSentencePrediction"},{local:"transformers.BertForSequenceClassification",title:"BertForSequenceClassification"},{local:"transformers.BertForMultipleChoice",title:"BertForMultipleChoice"},{local:"transformers.BertForTokenClassification",title:"BertForTokenClassification"},{local:"transformers.BertForQuestionAnswering",title:"BertForQuestionAnswering"},{local:"transformers.TFBertModel",title:"TFBertModel"},{local:"transformers.TFBertForPreTraining",title:"TFBertForPreTraining"},{local:"transformers.TFBertLMHeadModel",title:"TFBertModelLMHeadModel"},{local:"transformers.TFBertForMaskedLM",title:"TFBertForMaskedLM"},{local:"transformers.TFBertForNextSentencePrediction",title:"TFBertForNextSentencePrediction"},{local:"transformers.TFBertForSequenceClassification",title:"TFBertForSequenceClassification"},{local:"transformers.TFBertForMultipleChoice",title:"TFBertForMultipleChoice"},{local:"transformers.TFBertForTokenClassification",title:"TFBertForTokenClassification"},{local:"transformers.TFBertForQuestionAnswering",title:"TFBertForQuestionAnswering"},{local:"transformers.FlaxBertModel",title:"FlaxBertModel"},{local:"transformers.FlaxBertForPreTraining",title:"FlaxBertForPreTraining"},{local:"transformers.FlaxBertForCausalLM",title:"FlaxBertForCausalLM"},{local:"transformers.FlaxBertForMaskedLM",title:"FlaxBertForMaskedLM"},{local:"transformers.FlaxBertForNextSentencePrediction",title:"FlaxBertForNextSentencePrediction"},{local:"transformers.FlaxBertForSequenceClassification",title:"FlaxBertForSequenceClassification"},{local:"transformers.FlaxBertForMultipleChoice",title:"FlaxBertForMultipleChoice"},{local:"transformers.FlaxBertForTokenClassification",title:"FlaxBertForTokenClassification"},{local:"transformers.FlaxBertForQuestionAnswering",title:"FlaxBertForQuestionAnswering"}],title:"BERT"};function DW(E){return yU(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class VW extends gU{constructor(d){super();_U(this,d,DW,IW,bU,{})}}export{VW as default,LW as metadata};
