import{S as WN,i as HN,s as KN,e as s,k as c,w as T,t as o,M as RN,c as r,d as t,m as p,a,x as v,h as n,b as u,G as e,g as _,y as w,q as $,o as x,B as F,v as QN,L as ie}from"../../chunks/vendor-hf-doc-builder.js";import{T as Se}from"../../chunks/Tip-hf-doc-builder.js";import{D as A}from"../../chunks/Docstring-hf-doc-builder.js";import{C as le}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ue}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ae}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function VN(B){let d,g,f,m,b;return m=new le({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"),g=o("Examples:"),f=c(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var h=a(d);g=n(h,"Examples:"),h.forEach(t),f=p(l),v(m.$$.fragment,l)},m(l,h){_(l,d,h),e(d,g),_(l,f,h),w(m,l,h),b=!0},p:ie,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){x(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),F(m,l)}}}function JN(B){let d,g,f,m,b;return m=new le({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"),g=o("pair mask has the following format:"),f=c(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var h=a(d);g=n(h,"pair mask has the following format:"),h.forEach(t),f=p(l),v(m.$$.fragment,l)},m(l,h){_(l,d,h),e(d,g),_(l,f,h),w(m,l,h),b=!0},p:ie,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){x(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),F(m,l)}}}function GN(B){let d,g,f,m,b;return m=new le({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"),g=o("pair mask has the following format:"),f=c(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var h=a(d);g=n(h,"pair mask has the following format:"),h.forEach(t),f=p(l),v(m.$$.fragment,l)},m(l,h){_(l,d,h),e(d,g),_(l,f,h),w(m,l,h),b=!0},p:ie,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){x(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),F(m,l)}}}function XN(B){let d,g,f,m,b;return m=new le({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"),g=o("Examples:"),f=c(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var h=a(d);g=n(h,"Examples:"),h.forEach(t),f=p(l),v(m.$$.fragment,l)},m(l,h){_(l,d,h),e(d,g),_(l,f,h),w(m,l,h),b=!0},p:ie,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){x(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),F(m,l)}}}function YN(B){let d,g,f,m,b;return m=new le({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"),g=o("Examples:"),f=c(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var h=a(d);g=n(h,"Examples:"),h.forEach(t),f=p(l),v(m.$$.fragment,l)},m(l,h){_(l,d,h),e(d,g),_(l,f,h),w(m,l,h),b=!0},p:ie,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){x(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),F(m,l)}}}function ZN(B){let d,g,f,m,b;return{c(){d=s("p"),g=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=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 h=a(d);g=n(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(h,"CODE",{});var z=a(f);m=n(z,"Module"),z.forEach(t),b=n(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){_(l,d,h),e(d,g),e(d,f),e(f,m),e(d,b)},d(l){l&&t(d)}}}function e8(B){let d,g,f,m,b;return m=new le({props:{code:`from transformers import BertTokenizer, BertModel
import torch

tokenizer = BertTokenizer.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> BertTokenizer, 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 = BertTokenizer.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"),g=o("Example:"),f=c(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var h=a(d);g=n(h,"Example:"),h.forEach(t),f=p(l),v(m.$$.fragment,l)},m(l,h){_(l,d,h),e(d,g),_(l,f,h),w(m,l,h),b=!0},p:ie,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){x(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),F(m,l)}}}function t8(B){let d,g,f,m,b;return{c(){d=s("p"),g=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=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 h=a(d);g=n(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(h,"CODE",{});var z=a(f);m=n(z,"Module"),z.forEach(t),b=n(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){_(l,d,h),e(d,g),e(d,f),e(f,m),e(d,b)},d(l){l&&t(d)}}}function o8(B){let d,g,f,m,b;return m=new le({props:{code:`from transformers import BertTokenizer, BertForPreTraining
import torch

tokenizer = BertTokenizer.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> BertTokenizer, 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 = BertTokenizer.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"),g=o("Example:"),f=c(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var h=a(d);g=n(h,"Example:"),h.forEach(t),f=p(l),v(m.$$.fragment,l)},m(l,h){_(l,d,h),e(d,g),_(l,f,h),w(m,l,h),b=!0},p:ie,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){x(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),F(m,l)}}}function n8(B){let d,g,f,m,b;return{c(){d=s("p"),g=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=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 h=a(d);g=n(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(h,"CODE",{});var z=a(f);m=n(z,"Module"),z.forEach(t),b=n(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){_(l,d,h),e(d,g),e(d,f),e(f,m),e(d,b)},d(l){l&&t(d)}}}function s8(B){let d,g,f,m,b;return m=new le({props:{code:`import torch
from transformers import BertTokenizer, BertLMHeadModel

tokenizer = BertTokenizer.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> BertTokenizer, BertLMHeadModel

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

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

tokenizer = BertTokenizer.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> BertTokenizer, 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 = BertTokenizer.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"),g=o("Example:"),f=c(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var h=a(d);g=n(h,"Example:"),h.forEach(t),f=p(l),v(m.$$.fragment,l)},m(l,h){_(l,d,h),e(d,g),_(l,f,h),w(m,l,h),b=!0},p:ie,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){x(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),F(m,l)}}}function c8(B){let d,g,f,m,b;return{c(){d=s("p"),g=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=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 h=a(d);g=n(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(h,"CODE",{});var z=a(f);m=n(z,"Module"),z.forEach(t),b=n(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){_(l,d,h),e(d,g),e(d,f),e(f,m),e(d,b)},d(l){l&&t(d)}}}function p8(B){let d,g,f,m,b;return m=new le({props:{code:`import torch
from transformers import BertTokenizer, BertForSequenceClassification

tokenizer = BertTokenizer.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]`,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> BertTokenizer, BertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.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>`}}),{c(){d=s("p"),g=o("Example of single-label classification:"),f=c(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var h=a(d);g=n(h,"Example of single-label classification:"),h.forEach(t),f=p(l),v(m.$$.fragment,l)},m(l,h){_(l,d,h),e(d,g),_(l,f,h),w(m,l,h),b=!0},p:ie,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){x(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),F(m,l)}}}function h8(B){let d,g;return d=new le({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 = BertForSequenceClassification.from_pretrained("textattack/bert-base-uncased-yelp-polarity", num_labels=num_labels)\n\nlabels = torch.tensor([1])\nloss = model(**inputs, labels=labels).loss\nround(loss.item(), 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 = 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(){T(d.$$.fragment)},l(f){v(d.$$.fragment,f)},m(f,m){w(d,f,m),g=!0},p:ie,i(f){g||($(d.$$.fragment,f),g=!0)},o(f){x(d.$$.fragment,f),g=!1},d(f){F(d,f)}}}function f8(B){let d,g,f,m,b;return m=new le({props:{code:`import torch
from transformers import BertTokenizer, BertForSequenceClassification

tokenizer = BertTokenizer.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_id = logits.argmax().item()
model.config.id2label[predicted_class_id]`,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> BertTokenizer, BertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.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_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>`}}),{c(){d=s("p"),g=o("Example of multi-label classification:"),f=c(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var h=a(d);g=n(h,"Example of multi-label classification:"),h.forEach(t),f=p(l),v(m.$$.fragment,l)},m(l,h){_(l,d,h),e(d,g),_(l,f,h),w(m,l,h),b=!0},p:ie,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){x(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),F(m,l)}}}function m8(B){let d,g;return d=new le({props:{code:`# 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.nn.functional.one_hot(torch.tensor([predicted_class_id]), num_classes=num_labels).to(
    torch.float
)
loss = model(**inputs, labels=labels).loss
loss.backward()`,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 = 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.nn.functional.one_hot(torch.tensor([predicted_class_id]), num_classes=num_labels).to(
<span class="hljs-meta">... </span>    torch.<span class="hljs-built_in">float</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span>loss.backward()`}}),{c(){T(d.$$.fragment)},l(f){v(d.$$.fragment,f)},m(f,m){w(d,f,m),g=!0},p:ie,i(f){g||($(d.$$.fragment,f),g=!0)},o(f){x(d.$$.fragment,f),g=!1},d(f){F(d,f)}}}function u8(B){let d,g,f,m,b;return{c(){d=s("p"),g=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=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 h=a(d);g=n(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(h,"CODE",{});var z=a(f);m=n(z,"Module"),z.forEach(t),b=n(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){_(l,d,h),e(d,g),e(d,f),e(f,m),e(d,b)},d(l){l&&t(d)}}}function g8(B){let d,g,f,m,b;return m=new le({props:{code:`from transformers import BertTokenizer, BertForMultipleChoice
import torch

tokenizer = BertTokenizer.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> BertTokenizer, 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 = BertTokenizer.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"),g=o("Example:"),f=c(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var h=a(d);g=n(h,"Example:"),h.forEach(t),f=p(l),v(m.$$.fragment,l)},m(l,h){_(l,d,h),e(d,g),_(l,f,h),w(m,l,h),b=!0},p:ie,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){x(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),F(m,l)}}}function _8(B){let d,g,f,m,b;return{c(){d=s("p"),g=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=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 h=a(d);g=n(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(h,"CODE",{});var z=a(f);m=n(z,"Module"),z.forEach(t),b=n(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){_(l,d,h),e(d,g),e(d,f),e(f,m),e(d,b)},d(l){l&&t(d)}}}function b8(B){let d,g,f,m,b;return m=new le({props:{code:`from transformers import BertTokenizer, BertForTokenClassification
import torch

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

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

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

tokenizer = BertTokenizer.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> BertTokenizer, TFBertForPreTraining

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.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"),g=o("Examples:"),f=c(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var h=a(d);g=n(h,"Examples:"),h.forEach(t),f=p(l),v(m.$$.fragment,l)},m(l,h){_(l,d,h),e(d,g),_(l,f,h),w(m,l,h),b=!0},p:ie,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){x(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),F(m,l)}}}function z8(B){let d,g,f,m,b;return m=new le({props:{code:`from transformers import BertTokenizer, TFBertLMHeadModel
import tensorflow as tf

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

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

tokenizer = BertTokenizer.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> BertTokenizer, TFBertForNextSentencePrediction

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

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

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

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

tokenizer = BertTokenizer.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> BertTokenizer, 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 = BertTokenizer.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"),g=o("Example:"),f=c(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var h=a(d);g=n(h,"Example:"),h.forEach(t),f=p(l),v(m.$$.fragment,l)},m(l,h){_(l,d,h),e(d,g),_(l,f,h),w(m,l,h),b=!0},p:ie,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){x(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),F(m,l)}}}function X8(B){let d,g;return d=new le({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,m){w(d,f,m),g=!0},p:ie,i(f){g||($(d.$$.fragment,f),g=!0)},o(f){x(d.$$.fragment,f),g=!1},d(f){F(d,f)}}}function Y8(B){let d,g,f,m,b;return{c(){d=s("p"),g=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),m=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 h=a(d);g=n(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(h,"CODE",{});var z=a(f);m=n(z,"Module"),z.forEach(t),b=n(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){_(l,d,h),e(d,g),e(d,f),e(f,m),e(d,b)},d(l){l&&t(d)}}}function Z8(B){let d,g,f,m,b;return m=new le({props:{code:`from transformers import BertTokenizer, FlaxBertModel

tokenizer = BertTokenizer.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> BertTokenizer, FlaxBertModel

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

tokenizer = BertTokenizer.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> BertTokenizer, FlaxBertForPreTraining

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

tokenizer = BertTokenizer.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> BertTokenizer, FlaxBertForCausalLM

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

tokenizer = BertTokenizer.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> BertTokenizer, FlaxBertForMaskedLM

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

tokenizer = BertTokenizer.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> BertTokenizer, FlaxBertForNextSentencePrediction

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

tokenizer = BertTokenizer.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> BertTokenizer, FlaxBertForSequenceClassification

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

tokenizer = BertTokenizer.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> BertTokenizer, FlaxBertForMultipleChoice

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

tokenizer = BertTokenizer.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> BertTokenizer, FlaxBertForTokenClassification

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

tokenizer = BertTokenizer.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> BertTokenizer, FlaxBertForQuestionAnswering

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.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"),g=o("Example:"),f=c(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var h=a(d);g=n(h,"Example:"),h.forEach(t),f=p(l),v(m.$$.fragment,l)},m(l,h){_(l,d,h),e(d,g),_(l,f,h),w(m,l,h),b=!0},p:ie,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){x(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(f),F(m,l)}}}function gO(B){let d,g,f,m,b,l,h,z,Fe,Te,S,pe,ee,E,Be,R,Ee,ve,U,ze,fe,G,Me,we,H,Pe,$e,K,_e,je,oe,j,q,qe,V,ge,Ce,J,he,be,N,Ne,Q,Oe,xe,D,Ae,me,L,Ie,W,Le,se,C,de,O,ke,ue,y,M,Re,ne,ye,We,P,De,Qe,Ke,Ve,Je,I,X,Ge,He,Y,Xe,Ye,ce,Ze,Z,et,HT,Wp,KT,RT,QT,Cs,Db,fn,Ns,jf,li,VT,qf,JT,Sb,tt,di,GT,Cf,XT,YT,ci,ZT,Hp,ev,tv,ov,Ko,pi,nv,Nf,sv,rv,hi,Kp,av,Of,iv,lv,Rp,dv,Af,cv,pv,Os,fi,hv,mi,fv,If,mv,uv,gv,oo,ui,_v,Lf,bv,kv,As,yv,mn,Tv,Df,vv,wv,Sf,$v,xv,Fv,Qp,gi,Ub,un,Is,Uf,_i,Bv,Wf,Ev,Wb,xt,bi,zv,ki,Mv,Hf,Pv,jv,qv,yi,Cv,Vp,Nv,Ov,Av,Ro,Ti,Iv,Kf,Lv,Dv,vi,Jp,Sv,Rf,Uv,Wv,Gp,Hv,Qf,Kv,Rv,no,wi,Qv,Vf,Vv,Jv,Ls,Gv,gn,Xv,Jf,Yv,Zv,Gf,e1,t1,Hb,_n,Ds,Xf,$i,o1,Yf,n1,Kb,Ft,xi,s1,bn,r1,Zf,a1,i1,em,l1,d1,c1,Fi,p1,tm,h1,f1,m1,Qo,Bi,u1,Ei,g1,om,_1,b1,k1,Ss,y1,Vo,zi,T1,kn,v1,nm,w1,$1,sm,x1,F1,B1,Us,Rb,yn,Ws,rm,Mi,E1,am,z1,Qb,Tn,Pi,M1,ji,P1,Xp,j1,q1,Vb,vn,qi,C1,Ci,N1,Yp,O1,A1,Jb,Po,Ni,I1,Oi,L1,Zp,D1,S1,U1,Hs,Ai,W1,im,H1,Gb,wn,Ks,lm,Ii,K1,dm,R1,Xb,ot,Li,Q1,cm,V1,J1,Di,G1,eh,X1,Y1,Z1,Si,ew,Ui,tw,ow,nw,Wi,sw,Hi,rw,aw,iw,mt,lw,pm,dw,cw,hm,pw,hw,fm,fw,mw,mm,uw,gw,um,_w,bw,gm,kw,yw,Tw,so,Ki,vw,$n,ww,th,$w,xw,_m,Fw,Bw,Ew,Rs,zw,Qs,Yb,xn,Vs,bm,Ri,Mw,km,Pw,Zb,Bt,Qi,jw,Fn,qw,ym,Cw,Nw,Tm,Ow,Aw,Iw,Vi,Lw,oh,Dw,Sw,Uw,Ji,Ww,Gi,Hw,Kw,Rw,ro,Xi,Qw,Bn,Vw,nh,Jw,Gw,vm,Xw,Yw,Zw,Js,e$,Gs,ek,En,Xs,wm,Yi,t$,$m,o$,tk,Et,Zi,n$,el,s$,xm,r$,a$,i$,tl,l$,sh,d$,c$,p$,ol,h$,nl,f$,m$,u$,ao,sl,g$,zn,_$,rh,b$,k$,Fm,y$,T$,v$,Ys,w$,Zs,ok,Mn,er,Bm,rl,$$,Em,x$,nk,zt,al,F$,il,B$,zm,E$,z$,M$,ll,P$,ah,j$,q$,C$,dl,N$,cl,O$,A$,I$,Nt,pl,L$,Pn,D$,ih,S$,U$,Mm,W$,H$,K$,tr,R$,or,Q$,nr,sk,jn,sr,Pm,hl,V$,jm,J$,rk,Mt,fl,G$,ml,X$,qm,Y$,Z$,e0,ul,t0,lh,o0,n0,s0,gl,r0,_l,a0,i0,l0,io,bl,d0,qn,c0,dh,p0,h0,Cm,f0,m0,u0,rr,g0,ar,ak,Cn,ir,Nm,kl,_0,Om,b0,ik,Pt,yl,k0,Am,y0,T0,Tl,v0,ch,w0,$0,x0,vl,F0,wl,B0,E0,z0,ft,$l,M0,Nn,P0,ph,j0,q0,Im,C0,N0,O0,lr,A0,dr,I0,cr,L0,pr,D0,hr,lk,On,fr,Lm,xl,S0,Dm,U0,dk,jt,Fl,W0,Sm,H0,K0,Bl,R0,hh,Q0,V0,J0,El,G0,zl,X0,Y0,Z0,lo,Ml,e2,An,t2,fh,o2,n2,Um,s2,r2,a2,mr,i2,ur,ck,In,gr,Wm,Pl,l2,Hm,d2,pk,qt,jl,c2,Km,p2,h2,ql,f2,mh,m2,u2,g2,Cl,_2,Nl,b2,k2,y2,Ot,Ol,T2,Ln,v2,uh,w2,$2,Rm,x2,F2,B2,_r,E2,br,z2,kr,hk,Dn,yr,Qm,Al,M2,Vm,P2,fk,Ct,Il,j2,Sn,q2,Jm,C2,N2,Gm,O2,A2,I2,Ll,L2,gh,D2,S2,U2,Dl,W2,Sl,H2,K2,R2,At,Ul,Q2,Un,V2,_h,J2,G2,Xm,X2,Y2,Z2,Tr,ex,vr,tx,wr,mk,Wn,$r,Ym,Wl,ox,Zm,nx,uk,ut,Hl,sx,eu,rx,ax,Kl,ix,bh,lx,dx,cx,Rl,px,Ql,hx,fx,mx,xr,ux,co,Vl,gx,Hn,_x,kh,bx,kx,tu,yx,Tx,vx,Fr,wx,Br,gk,Kn,Er,ou,Jl,$x,nu,xx,_k,gt,Gl,Fx,Rn,Bx,su,Ex,zx,ru,Mx,Px,jx,Xl,qx,yh,Cx,Nx,Ox,Yl,Ax,Zl,Ix,Lx,Dx,zr,Sx,po,ed,Ux,Qn,Wx,Th,Hx,Kx,au,Rx,Qx,Vx,Mr,Jx,Pr,bk,Vn,jr,iu,td,Gx,lu,Xx,kk,Jn,od,Yx,It,nd,Zx,nt,eF,du,tF,oF,cu,nF,sF,pu,rF,aF,hu,iF,lF,fu,dF,cF,mu,pF,hF,uu,fF,mF,uF,sd,rd,gF,gu,_F,bF,kF,ad,yF,_u,TF,vF,wF,te,$F,bu,xF,FF,ku,BF,EF,yu,zF,MF,Tu,PF,jF,vu,qF,CF,wu,NF,OF,$u,AF,IF,xu,LF,DF,Fu,SF,UF,Bu,WF,HF,Eu,KF,RF,zu,QF,VF,Mu,JF,GF,Pu,XF,YF,ju,ZF,eB,qu,tB,oB,Cu,nB,sB,Nu,rB,aB,Ou,iB,lB,Au,dB,cB,pB,qr,yk,Gn,Cr,Iu,id,hB,Lu,fB,Tk,_t,ld,mB,dd,uB,Du,gB,_B,bB,cd,kB,vh,yB,TB,vB,pd,wB,hd,$B,xB,FB,Nr,BB,Lt,fd,EB,Xn,zB,wh,MB,PB,Su,jB,qB,CB,Or,NB,Ar,OB,Ir,vk,Yn,Lr,Uu,md,AB,Wu,IB,wk,bt,ud,LB,gd,DB,Hu,SB,UB,WB,_d,HB,$h,KB,RB,QB,bd,VB,kd,JB,GB,XB,Dr,YB,ho,yd,ZB,Zn,e9,xh,t9,o9,Ku,n9,s9,r9,Sr,a9,Ur,$k,es,Wr,Ru,Td,i9,Qu,l9,xk,kt,vd,d9,Vu,c9,p9,wd,h9,Fh,f9,m9,u9,$d,g9,xd,_9,b9,k9,Hr,y9,Dt,Fd,T9,ts,v9,Bh,w9,$9,Ju,x9,F9,B9,Kr,E9,Rr,z9,Qr,Fk,os,Vr,Gu,Bd,M9,Xu,P9,Bk,yt,Ed,j9,Yu,q9,C9,zd,N9,Eh,O9,A9,I9,Md,L9,Pd,D9,S9,U9,Jr,W9,fo,jd,H9,ns,K9,zh,R9,Q9,Zu,V9,J9,G9,Gr,X9,Xr,Ek,ss,Yr,eg,qd,Y9,tg,Z9,zk,Tt,Cd,eE,og,tE,oE,Nd,nE,Mh,sE,rE,aE,Od,iE,Ad,lE,dE,cE,Zr,pE,St,Id,hE,rs,fE,Ph,mE,uE,ng,gE,_E,bE,ea,kE,ta,yE,oa,Mk,as,na,sg,Ld,TE,rg,vE,Pk,vt,Dd,wE,is,$E,ag,xE,FE,ig,BE,EE,zE,Sd,ME,jh,PE,jE,qE,Ud,CE,Wd,NE,OE,AE,sa,IE,Ut,Hd,LE,ls,DE,qh,SE,UE,lg,WE,HE,KE,ra,RE,aa,QE,ia,jk,ds,la,dg,Kd,VE,cg,JE,qk,st,Rd,GE,pg,XE,YE,Qd,ZE,Ch,ez,tz,oz,Vd,nz,Jd,sz,rz,az,hg,iz,lz,jo,fg,Gd,dz,cz,mg,Xd,pz,hz,ug,Yd,fz,mz,gg,Zd,uz,gz,mo,ec,_z,cs,bz,_g,kz,yz,bg,Tz,vz,wz,da,$z,ca,Ck,ps,pa,kg,tc,xz,yg,Fz,Nk,rt,oc,Bz,hs,Ez,Tg,zz,Mz,vg,Pz,jz,qz,nc,Cz,Nh,Nz,Oz,Az,sc,Iz,rc,Lz,Dz,Sz,wg,Uz,Wz,qo,$g,ac,Hz,Kz,xg,ic,Rz,Qz,Fg,lc,Vz,Jz,Bg,dc,Gz,Xz,uo,cc,Yz,fs,Zz,Eg,eM,tM,zg,oM,nM,sM,ha,rM,fa,Ok,ms,ma,Mg,pc,aM,Pg,iM,Ak,at,hc,lM,jg,dM,cM,fc,pM,Oh,hM,fM,mM,mc,uM,uc,gM,_M,bM,qg,kM,yM,Co,Cg,gc,TM,vM,Ng,_c,wM,$M,Og,bc,xM,FM,Ag,kc,BM,EM,go,yc,zM,us,MM,Ig,PM,jM,Lg,qM,CM,NM,ua,OM,ga,Ik,gs,_a,Dg,Tc,AM,Sg,IM,Lk,it,vc,LM,wc,DM,Ug,SM,UM,WM,$c,HM,Ah,KM,RM,QM,xc,VM,Fc,JM,GM,XM,Wg,YM,ZM,No,Hg,Bc,e4,t4,Kg,Ec,o4,n4,Rg,zc,s4,r4,Qg,Mc,a4,i4,_o,Pc,l4,_s,d4,Vg,c4,p4,Jg,h4,f4,m4,ba,u4,ka,Dk,bs,ya,Gg,jc,g4,Xg,_4,Sk,lt,qc,b4,Cc,k4,Yg,y4,T4,v4,Nc,w4,Ih,$4,x4,F4,Oc,B4,Ac,E4,z4,M4,Zg,P4,j4,Oo,e_,Ic,q4,C4,t_,Lc,N4,O4,o_,Dc,A4,I4,n_,Sc,L4,D4,bo,Uc,S4,ks,U4,s_,W4,H4,r_,K4,R4,Q4,Ta,V4,va,Uk,ys,wa,a_,Wc,J4,i_,G4,Wk,dt,Hc,X4,l_,Y4,Z4,Kc,eP,Lh,tP,oP,nP,Rc,sP,Qc,rP,aP,iP,d_,lP,dP,Ao,c_,Vc,cP,pP,p_,Jc,hP,fP,h_,Gc,mP,uP,f_,Xc,gP,_P,ko,Yc,bP,Ts,kP,m_,yP,TP,u_,vP,wP,$P,$a,xP,xa,Hk,vs,Fa,g_,Zc,FP,__,BP,Kk,ct,ep,EP,b_,zP,MP,tp,PP,Dh,jP,qP,CP,op,NP,np,OP,AP,IP,k_,LP,DP,Io,y_,sp,SP,UP,T_,rp,WP,HP,v_,ap,KP,RP,w_,ip,QP,VP,yo,lp,JP,ws,GP,$_,XP,YP,x_,ZP,ej,tj,Ba,oj,Ea,Rk,$s,za,F_,dp,nj,B_,sj,Qk,pt,cp,rj,E_,aj,ij,pp,lj,Sh,dj,cj,pj,hp,hj,fp,fj,mj,uj,z_,gj,_j,Lo,M_,mp,bj,kj,P_,up,yj,Tj,j_,gp,vj,wj,q_,_p,$j,xj,To,bp,Fj,xs,Bj,C_,Ej,zj,N_,Mj,Pj,jj,Ma,qj,Pa,Vk,Fs,ja,O_,kp,Cj,A_,Nj,Jk,ht,yp,Oj,Bs,Aj,I_,Ij,Lj,L_,Dj,Sj,Uj,Tp,Wj,Uh,Hj,Kj,Rj,vp,Qj,wp,Vj,Jj,Gj,D_,Xj,Yj,Do,S_,$p,Zj,e7,U_,xp,t7,o7,W_,Fp,n7,s7,H_,Bp,r7,a7,vo,Ep,i7,Es,l7,K_,d7,c7,R_,p7,h7,f7,qa,m7,Ca,Gk;return l=new Ue({}),E=new Ue({}),ue=new Ue({}),We=new A({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/pr_19907/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/pr_19907/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/pr_19907/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/pr_19907/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.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/vr_19907/src/transformers/models/bert/configuration_bert.py#L72"}}),Cs=new ae({props:{anchor:"transformers.BertConfig.example",$$slots:{default:[VN]},$$scope:{ctx:B}}}),li=new Ue({}),di=new A({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/vr_19907/src/transformers/models/bert/tokenization_bert.py#L137"}}),pi=new A({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/vr_19907/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>
`}}),fi=new A({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/vr_19907/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>
`}}),ui=new A({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/vr_19907/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>
`}}),As=new ae({props:{anchor:"transformers.BertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[JN]},$$scope:{ctx:B}}}),gi=new A({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/vr_19907/src/transformers/models/bert/tokenization_bert.py#L350"}}),_i=new Ue({}),bi=new A({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/vr_19907/src/transformers/models/bert/tokenization_bert_fast.py#L161"}}),Ti=new A({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/vr_19907/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>
`}}),wi=new A({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/vr_19907/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>
`}}),Ls=new ae({props:{anchor:"transformers.BertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[GN]},$$scope:{ctx:B}}}),$i=new Ue({}),xi=new A({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/vr_19907/src/transformers/models/bert/tokenization_bert_tf.py#L12"}}),Bi=new A({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/vr_19907/src/transformers/models/bert/tokenization_bert_tf.py#L130"}}),Ss=new ae({props:{anchor:"transformers.TFBertTokenizer.from_pretrained.example",$$slots:{default:[XN]},$$scope:{ctx:B}}}),zi=new A({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/vr_19907/src/transformers/models/bert/tokenization_bert_tf.py#L100"}}),Us=new ae({props:{anchor:"transformers.TFBertTokenizer.from_tokenizer.example",$$slots:{default:[YN]},$$scope:{ctx:B}}}),Mi=new Ue({}),Pi=new A({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/vr_19907/src/transformers/models/bert/modeling_bert.py#L763"}}),qi=new A({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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L935"}}),Ni=new A({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/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L64"}}),Ai=new A({props:{name:"replace",anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/flax/struct.py#L108"}}),Ii=new Ue({}),Li=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L866"}}),Ki=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L905",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Rs=new Se({props:{$$slots:{default:[ZN]},$$scope:{ctx:B}}}),Qs=new ae({props:{anchor:"transformers.BertModel.forward.example",$$slots:{default:[e8]},$$scope:{ctx:B}}}),Ri=new Ue({}),Qi=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1049"}}),Xi=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1065",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/model_doc/bert#transformers.models.bert.modeling_bert.BertForPreTrainingOutput"
>transformers.models.bert.modeling_bert.BertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Js=new Se({props:{$$slots:{default:[t8]},$$scope:{ctx:B}}}),Gs=new ae({props:{anchor:"transformers.BertForPreTraining.forward.example",$$slots:{default:[o8]},$$scope:{ctx:B}}}),Yi=new Ue({}),Zi=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1153"}}),sl=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1176",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ys=new Se({props:{$$slots:{default:[n8]},$$scope:{ctx:B}}}),Zs=new ae({props:{anchor:"transformers.BertLMHeadModel.forward.example",$$slots:{default:[s8]},$$scope:{ctx:B}}}),rl=new Ue({}),al=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1288"}}),pl=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1314",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),tr=new Se({props:{$$slots:{default:[r8]},$$scope:{ctx:B}}}),or=new ae({props:{anchor:"transformers.BertForMaskedLM.forward.example",$$slots:{default:[a8]},$$scope:{ctx:B}}}),nr=new ae({props:{anchor:"transformers.BertForMaskedLM.forward.example-2",$$slots:{default:[i8]},$$scope:{ctx:B}}}),hl=new Ue({}),fl=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1401"}}),bl=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1411",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),rr=new Se({props:{$$slots:{default:[l8]},$$scope:{ctx:B}}}),ar=new ae({props:{anchor:"transformers.BertForNextSentencePrediction.forward.example",$$slots:{default:[d8]},$$scope:{ctx:B}}}),kl=new Ue({}),yl=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1506"}}),$l=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1522",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),lr=new Se({props:{$$slots:{default:[c8]},$$scope:{ctx:B}}}),dr=new ae({props:{anchor:"transformers.BertForSequenceClassification.forward.example",$$slots:{default:[p8]},$$scope:{ctx:B}}}),cr=new ae({props:{anchor:"transformers.BertForSequenceClassification.forward.example-2",$$slots:{default:[h8]},$$scope:{ctx:B}}}),pr=new ae({props:{anchor:"transformers.BertForSequenceClassification.forward.example-3",$$slots:{default:[f8]},$$scope:{ctx:B}}}),hr=new ae({props:{anchor:"transformers.BertForSequenceClassification.forward.example-4",$$slots:{default:[m8]},$$scope:{ctx:B}}}),xl=new Ue({}),Fl=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1610"}}),Ml=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1624",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),mr=new Se({props:{$$slots:{default:[u8]},$$scope:{ctx:B}}}),ur=new ae({props:{anchor:"transformers.BertForMultipleChoice.forward.example",$$slots:{default:[g8]},$$scope:{ctx:B}}}),Pl=new Ue({}),jl=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1705"}}),Ol=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1723",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_r=new Se({props:{$$slots:{default:[_8]},$$scope:{ctx:B}}}),br=new ae({props:{anchor:"transformers.BertForTokenClassification.forward.example",$$slots:{default:[b8]},$$scope:{ctx:B}}}),kr=new ae({props:{anchor:"transformers.BertForTokenClassification.forward.example-2",$$slots:{default:[k8]},$$scope:{ctx:B}}}),Al=new Ue({}),Il=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1792"}}),Ul=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_bert.py#L1806",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Tr=new Se({props:{$$slots:{default:[y8]},$$scope:{ctx:B}}}),vr=new ae({props:{anchor:"transformers.BertForQuestionAnswering.forward.example",$$slots:{default:[T8]},$$scope:{ctx:B}}}),wr=new ae({props:{anchor:"transformers.BertForQuestionAnswering.forward.example-2",$$slots:{default:[v8]},$$scope:{ctx:B}}}),Wl=new Ue({}),Hl=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1067"}}),xr=new Se({props:{$$slots:{default:[w8]},$$scope:{ctx:B}}}),Vl=new A({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[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1073",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Fr=new Se({props:{$$slots:{default:[$8]},$$scope:{ctx:B}}}),Br=new ae({props:{anchor:"transformers.TFBertModel.call.example",$$slots:{default:[x8]},$$scope:{ctx:B}}}),Jl=new Ue({}),Gl=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1164"}}),zr=new Se({props:{$$slots:{default:[F8]},$$scope:{ctx:B}}}),ed=new A({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[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1186",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/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>
`}}),Mr=new Se({props:{$$slots:{default:[B8]},$$scope:{ctx:B}}}),Pr=new ae({props:{anchor:"transformers.TFBertForPreTraining.call.example",$$slots:{default:[E8]},$$scope:{ctx:B}}}),td=new Ue({}),od=new A({props:{name:"class transformers.TFBertLMHeadModel",anchor:"transformers.TFBertLMHeadModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1373"}}),nd=new A({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[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1410",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),qr=new ae({props:{anchor:"transformers.TFBertLMHeadModel.call.example",$$slots:{default:[z8]},$$scope:{ctx:B}}}),id=new Ue({}),ld=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1281"}}),Nr=new Se({props:{$$slots:{default:[M8]},$$scope:{ctx:B}}}),fd=new A({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[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1309",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Or=new Se({props:{$$slots:{default:[P8]},$$scope:{ctx:B}}}),Ar=new ae({props:{anchor:"transformers.TFBertForMaskedLM.call.example",$$slots:{default:[j8]},$$scope:{ctx:B}}}),Ir=new ae({props:{anchor:"transformers.TFBertForMaskedLM.call.example-2",$$slots:{default:[q8]},$$scope:{ctx:B}}}),md=new Ue({}),ud=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1523"}}),Dr=new Se({props:{$$slots:{default:[C8]},$$scope:{ctx:B}}}),yd=new A({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[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1533",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFNextSentencePredictorOutput"
>transformers.modeling_tf_outputs.TFNextSentencePredictorOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Sr=new Se({props:{$$slots:{default:[N8]},$$scope:{ctx:B}}}),Ur=new ae({props:{anchor:"transformers.TFBertForNextSentencePrediction.call.example",$$slots:{default:[O8]},$$scope:{ctx:B}}}),Td=new Ue({}),vd=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1614"}}),Hr=new Se({props:{$$slots:{default:[A8]},$$scope:{ctx:B}}}),Fd=new A({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[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1635",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Kr=new Se({props:{$$slots:{default:[I8]},$$scope:{ctx:B}}}),Rr=new ae({props:{anchor:"transformers.TFBertForSequenceClassification.call.example",$$slots:{default:[L8]},$$scope:{ctx:B}}}),Qr=new ae({props:{anchor:"transformers.TFBertForSequenceClassification.call.example-2",$$slots:{default:[D8]},$$scope:{ctx:B}}}),Bd=new Ue({}),Ed=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1707"}}),Jr=new Se({props:{$$slots:{default:[S8]},$$scope:{ctx:B}}}),jd=new A({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[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1731",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Gr=new Se({props:{$$slots:{default:[U8]},$$scope:{ctx:B}}}),Xr=new ae({props:{anchor:"transformers.TFBertForMultipleChoice.call.example",$$slots:{default:[W8]},$$scope:{ctx:B}}}),qd=new Ue({}),Cd=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1837"}}),Zr=new Se({props:{$$slots:{default:[H8]},$$scope:{ctx:B}}}),Id=new A({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[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1864",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ea=new Se({props:{$$slots:{default:[K8]},$$scope:{ctx:B}}}),ta=new ae({props:{anchor:"transformers.TFBertForTokenClassification.call.example",$$slots:{default:[R8]},$$scope:{ctx:B}}}),oa=new ae({props:{anchor:"transformers.TFBertForTokenClassification.call.example-2",$$slots:{default:[Q8]},$$scope:{ctx:B}}}),Ld=new Ue({}),Dd=new A({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/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1934"}}),sa=new Se({props:{$$slots:{default:[V8]},$$scope:{ctx:B}}}),Hd=new A({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[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/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/vr_19907/src/transformers/models/bert/modeling_tf_bert.py#L1956",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ra=new Se({props:{$$slots:{default:[J8]},$$scope:{ctx:B}}}),aa=new ae({props:{anchor:"transformers.TFBertForQuestionAnswering.call.example",$$slots:{default:[G8]},$$scope:{ctx:B}}}),ia=new ae({props:{anchor:"transformers.TFBertForQuestionAnswering.call.example-2",$$slots:{default:[X8]},$$scope:{ctx:B}}}),Kd=new Ue({}),Rd=new A({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/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L1028"}}),ec=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L855",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),da=new Se({props:{$$slots:{default:[Y8]},$$scope:{ctx:B}}}),ca=new ae({props:{anchor:"transformers.FlaxBertModel.__call__.example",$$slots:{default:[Z8]},$$scope:{ctx:B}}}),tc=new Ue({}),oc=new A({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/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L1106"}}),cc=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L855",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/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>
`}}),ha=new Se({props:{$$slots:{default:[eO]},$$scope:{ctx:B}}}),fa=new ae({props:{anchor:"transformers.FlaxBertForPreTraining.__call__.example",$$slots:{default:[tO]},$$scope:{ctx:B}}}),pc=new Ue({}),hc=new A({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/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L1683"}}),yc=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L855",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ua=new Se({props:{$$slots:{default:[oO]},$$scope:{ctx:B}}}),ga=new ae({props:{anchor:"transformers.FlaxBertForCausalLM.__call__.example",$$slots:{default:[nO]},$$scope:{ctx:B}}}),Tc=new Ue({}),vc=new A({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/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L1197"}}),Pc=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L855",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ba=new Se({props:{$$slots:{default:[sO]},$$scope:{ctx:B}}}),ka=new ae({props:{anchor:"transformers.FlaxBertForMaskedLM.__call__.example",$$slots:{default:[rO]},$$scope:{ctx:B}}}),jc=new Ue({}),qc=new A({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/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L1263"}}),Uc=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L855",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput"
>transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ta=new Se({props:{$$slots:{default:[aO]},$$scope:{ctx:B}}}),va=new ae({props:{anchor:"transformers.FlaxBertForNextSentencePrediction.__call__.example",$$slots:{default:[iO]},$$scope:{ctx:B}}}),Wc=new Ue({}),Hc=new A({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/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L1366"}}),Yc=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L855",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$a=new Se({props:{$$slots:{default:[lO]},$$scope:{ctx:B}}}),xa=new ae({props:{anchor:"transformers.FlaxBertForSequenceClassification.__call__.example",$$slots:{default:[dO]},$$scope:{ctx:B}}}),Zc=new Ue({}),ep=new A({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/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L1447"}}),lp=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L855",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput"
>transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ba=new Se({props:{$$slots:{default:[cO]},$$scope:{ctx:B}}}),Ea=new ae({props:{anchor:"transformers.FlaxBertForMultipleChoice.__call__.example",$$slots:{default:[pO]},$$scope:{ctx:B}}}),dp=new Ue({}),cp=new A({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/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L1525"}}),bp=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L855",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_flax_outputs.FlaxTokenClassifierOutput"
>transformers.modeling_flax_outputs.FlaxTokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ma=new Se({props:{$$slots:{default:[hO]},$$scope:{ctx:B}}}),Pa=new ae({props:{anchor:"transformers.FlaxBertForTokenClassification.__call__.example",$$slots:{default:[fO]},$$scope:{ctx:B}}}),kp=new Ue({}),yp=new A({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/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L1598"}}),Ep=new A({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/pr_19907/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/bert/modeling_flax_bert.py#L855",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qa=new Se({props:{$$slots:{default:[mO]},$$scope:{ctx:B}}}),Ca=new ae({props:{anchor:"transformers.FlaxBertForQuestionAnswering.__call__.example",$$slots:{default:[uO]},$$scope:{ctx:B}}}),{c(){d=s("meta"),g=c(),f=s("h1"),m=s("a"),b=s("span"),T(l.$$.fragment),h=c(),z=s("span"),Fe=o("BERT"),Te=c(),S=s("h2"),pe=s("a"),ee=s("span"),T(E.$$.fragment),Be=c(),R=s("span"),Ee=o("Overview"),ve=c(),U=s("p"),ze=o("The BERT model was proposed in "),fe=s("a"),G=o("BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding"),Me=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.`),we=c(),H=s("p"),Pe=o("The abstract from the paper is the following:"),$e=c(),K=s("p"),_e=s("em"),je=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.`),oe=c(),j=s("p"),q=s("em"),qe=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).`),V=c(),ge=s("p"),Ce=o("Tips:"),J=c(),he=s("ul"),be=s("li"),N=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.`),Ne=c(),Q=s("li"),Oe=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.`),xe=c(),D=s("p"),Ae=o("This model was contributed by "),me=s("a"),L=o("thomwolf"),Ie=o(". The original code can be found "),W=s("a"),Le=o("here"),se=o("."),C=c(),de=s("h2"),O=s("a"),ke=s("span"),T(ue.$$.fragment),y=c(),M=s("span"),Re=o("BertConfig"),ne=c(),ye=s("div"),T(We.$$.fragment),P=c(),De=s("p"),Qe=o("This is the configuration class to store the configuration of a "),Ke=s("a"),Ve=o("BertModel"),Je=o(" or a "),I=s("a"),X=o("TFBertModel"),Ge=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
`),He=s("a"),Y=o("bert-base-uncased"),Xe=o(" architecture."),Ye=c(),ce=s("p"),Ze=o("Configuration objects inherit from "),Z=s("a"),et=o("PretrainedConfig"),HT=o(` and can be used to control the model outputs. Read the
documentation from `),Wp=s("a"),KT=o("PretrainedConfig"),RT=o(" for more information."),QT=c(),T(Cs.$$.fragment),Db=c(),fn=s("h2"),Ns=s("a"),jf=s("span"),T(li.$$.fragment),VT=c(),qf=s("span"),JT=o("BertTokenizer"),Sb=c(),tt=s("div"),T(di.$$.fragment),GT=c(),Cf=s("p"),XT=o("Construct a BERT tokenizer. Based on WordPiece."),YT=c(),ci=s("p"),ZT=o("This tokenizer inherits from "),Hp=s("a"),ev=o("PreTrainedTokenizer"),tv=o(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),ov=c(),Ko=s("div"),T(pi.$$.fragment),nv=c(),Nf=s("p"),sv=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:`),rv=c(),hi=s("ul"),Kp=s("li"),av=o("single sequence: "),Of=s("code"),iv=o("[CLS] X [SEP]"),lv=c(),Rp=s("li"),dv=o("pair of sequences: "),Af=s("code"),cv=o("[CLS] A [SEP] B [SEP]"),pv=c(),Os=s("div"),T(fi.$$.fragment),hv=c(),mi=s("p"),fv=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 `),If=s("code"),mv=o("prepare_for_model"),uv=o(" method."),gv=c(),oo=s("div"),T(ui.$$.fragment),_v=c(),Lf=s("p"),bv=o("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),kv=c(),T(As.$$.fragment),yv=c(),mn=s("p"),Tv=o("If "),Df=s("code"),vv=o("token_ids_1"),wv=o(" is "),Sf=s("code"),$v=o("None"),xv=o(", this method only returns the first portion of the mask (0s)."),Fv=c(),Qp=s("div"),T(gi.$$.fragment),Ub=c(),un=s("h2"),Is=s("a"),Uf=s("span"),T(_i.$$.fragment),Bv=c(),Wf=s("span"),Ev=o("BertTokenizerFast"),Wb=c(),xt=s("div"),T(bi.$$.fragment),zv=c(),ki=s("p"),Mv=o("Construct a \u201Cfast\u201D BERT tokenizer (backed by HuggingFace\u2019s "),Hf=s("em"),Pv=o("tokenizers"),jv=o(" library). Based on WordPiece."),qv=c(),yi=s("p"),Cv=o("This tokenizer inherits from "),Vp=s("a"),Nv=o("PreTrainedTokenizerFast"),Ov=o(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Av=c(),Ro=s("div"),T(Ti.$$.fragment),Iv=c(),Kf=s("p"),Lv=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:`),Dv=c(),vi=s("ul"),Jp=s("li"),Sv=o("single sequence: "),Rf=s("code"),Uv=o("[CLS] X [SEP]"),Wv=c(),Gp=s("li"),Hv=o("pair of sequences: "),Qf=s("code"),Kv=o("[CLS] A [SEP] B [SEP]"),Rv=c(),no=s("div"),T(wi.$$.fragment),Qv=c(),Vf=s("p"),Vv=o("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),Jv=c(),T(Ls.$$.fragment),Gv=c(),gn=s("p"),Xv=o("If "),Jf=s("code"),Yv=o("token_ids_1"),Zv=o(" is "),Gf=s("code"),e1=o("None"),t1=o(", this method only returns the first portion of the mask (0s)."),Hb=c(),_n=s("h2"),Ds=s("a"),Xf=s("span"),T($i.$$.fragment),o1=c(),Yf=s("span"),n1=o("TFBertTokenizer"),Kb=c(),Ft=s("div"),T(xi.$$.fragment),s1=c(),bn=s("p"),r1=o(`This is an in-graph tokenizer for BERT. It should be initialized similarly to other tokenizers, using the
`),Zf=s("code"),a1=o("from_pretrained()"),i1=o(" method. It can also be initialized with the "),em=s("code"),l1=o("from_tokenizer()"),d1=o(` method, which imports settings
from an existing standard tokenizer object.`),c1=c(),Fi=s("p"),p1=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 `),tm=s("code"),h1=o("tf.string"),f1=o(" inputs to outputs."),m1=c(),Qo=s("div"),T(Bi.$$.fragment),u1=c(),Ei=s("p"),g1=o("Instantiate a "),om=s("code"),_1=o("TFBertTokenizer"),b1=o(" from a pre-trained tokenizer."),k1=c(),T(Ss.$$.fragment),y1=c(),Vo=s("div"),T(zi.$$.fragment),T1=c(),kn=s("p"),v1=o("Initialize a "),nm=s("code"),w1=o("TFBertTokenizer"),$1=o(" from an existing "),sm=s("code"),x1=o("Tokenizer"),F1=o("."),B1=c(),T(Us.$$.fragment),Rb=c(),yn=s("h2"),Ws=s("a"),rm=s("span"),T(Mi.$$.fragment),E1=c(),am=s("span"),z1=o("Bert specific outputs"),Qb=c(),Tn=s("div"),T(Pi.$$.fragment),M1=c(),ji=s("p"),P1=o("Output type of "),Xp=s("a"),j1=o("BertForPreTraining"),q1=o("."),Vb=c(),vn=s("div"),T(qi.$$.fragment),C1=c(),Ci=s("p"),N1=o("Output type of "),Yp=s("a"),O1=o("TFBertForPreTraining"),A1=o("."),Jb=c(),Po=s("div"),T(Ni.$$.fragment),I1=c(),Oi=s("p"),L1=o("Output type of "),Zp=s("a"),D1=o("BertForPreTraining"),S1=o("."),U1=c(),Hs=s("div"),T(Ai.$$.fragment),W1=c(),im=s("p"),H1=o("\u201CReturns a new object replacing the specified fields with new values."),Gb=c(),wn=s("h2"),Ks=s("a"),lm=s("span"),T(Ii.$$.fragment),K1=c(),dm=s("span"),R1=o("BertModel"),Xb=c(),ot=s("div"),T(Li.$$.fragment),Q1=c(),cm=s("p"),V1=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),J1=c(),Di=s("p"),G1=o("This model inherits from "),eh=s("a"),X1=o("PreTrainedModel"),Y1=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.)`),Z1=c(),Si=s("p"),ew=o("This model is also a PyTorch "),Ui=s("a"),tw=o("torch.nn.Module"),ow=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),nw=c(),Wi=s("p"),sw=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 `),Hi=s("a"),rw=o(`Attention is
all you need`),aw=o(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),iw=c(),mt=s("p"),lw=o("To behave as an decoder the model needs to be initialized with the "),pm=s("code"),dw=o("is_decoder"),cw=o(` argument of the configuration set
to `),hm=s("code"),pw=o("True"),hw=o(". To be used in a Seq2Seq model, the model needs to initialized with both "),fm=s("code"),fw=o("is_decoder"),mw=o(` argument and
`),mm=s("code"),uw=o("add_cross_attention"),gw=o(" set to "),um=s("code"),_w=o("True"),bw=o("; an "),gm=s("code"),kw=o("encoder_hidden_states"),yw=o(" is then expected as an input to the forward pass."),Tw=c(),so=s("div"),T(Ki.$$.fragment),vw=c(),$n=s("p"),ww=o("The "),th=s("a"),$w=o("BertModel"),xw=o(" forward method, overrides the "),_m=s("code"),Fw=o("__call__"),Bw=o(" special method."),Ew=c(),T(Rs.$$.fragment),zw=c(),T(Qs.$$.fragment),Yb=c(),xn=s("h2"),Vs=s("a"),bm=s("span"),T(Ri.$$.fragment),Mw=c(),km=s("span"),Pw=o("BertForPreTraining"),Zb=c(),Bt=s("div"),T(Qi.$$.fragment),jw=c(),Fn=s("p"),qw=o("Bert Model with two heads on top as done during the pretraining: a "),ym=s("code"),Cw=o("masked language modeling"),Nw=o(" head and a "),Tm=s("code"),Ow=o("next sentence prediction (classification)"),Aw=o(" head."),Iw=c(),Vi=s("p"),Lw=o("This model inherits from "),oh=s("a"),Dw=o("PreTrainedModel"),Sw=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.)`),Uw=c(),Ji=s("p"),Ww=o("This model is also a PyTorch "),Gi=s("a"),Hw=o("torch.nn.Module"),Kw=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Rw=c(),ro=s("div"),T(Xi.$$.fragment),Qw=c(),Bn=s("p"),Vw=o("The "),nh=s("a"),Jw=o("BertForPreTraining"),Gw=o(" forward method, overrides the "),vm=s("code"),Xw=o("__call__"),Yw=o(" special method."),Zw=c(),T(Js.$$.fragment),e$=c(),T(Gs.$$.fragment),ek=c(),En=s("h2"),Xs=s("a"),wm=s("span"),T(Yi.$$.fragment),t$=c(),$m=s("span"),o$=o("BertLMHeadModel"),tk=c(),Et=s("div"),T(Zi.$$.fragment),n$=c(),el=s("p"),s$=o("Bert Model with a "),xm=s("code"),r$=o("language modeling"),a$=o(" head on top for CLM fine-tuning."),i$=c(),tl=s("p"),l$=o("This model inherits from "),sh=s("a"),d$=o("PreTrainedModel"),c$=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.)`),p$=c(),ol=s("p"),h$=o("This model is also a PyTorch "),nl=s("a"),f$=o("torch.nn.Module"),m$=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),u$=c(),ao=s("div"),T(sl.$$.fragment),g$=c(),zn=s("p"),_$=o("The "),rh=s("a"),b$=o("BertLMHeadModel"),k$=o(" forward method, overrides the "),Fm=s("code"),y$=o("__call__"),T$=o(" special method."),v$=c(),T(Ys.$$.fragment),w$=c(),T(Zs.$$.fragment),ok=c(),Mn=s("h2"),er=s("a"),Bm=s("span"),T(rl.$$.fragment),$$=c(),Em=s("span"),x$=o("BertForMaskedLM"),nk=c(),zt=s("div"),T(al.$$.fragment),F$=c(),il=s("p"),B$=o("Bert Model with a "),zm=s("code"),E$=o("language modeling"),z$=o(" head on top."),M$=c(),ll=s("p"),P$=o("This model inherits from "),ah=s("a"),j$=o("PreTrainedModel"),q$=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.)`),C$=c(),dl=s("p"),N$=o("This model is also a PyTorch "),cl=s("a"),O$=o("torch.nn.Module"),A$=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),I$=c(),Nt=s("div"),T(pl.$$.fragment),L$=c(),Pn=s("p"),D$=o("The "),ih=s("a"),S$=o("BertForMaskedLM"),U$=o(" forward method, overrides the "),Mm=s("code"),W$=o("__call__"),H$=o(" special method."),K$=c(),T(tr.$$.fragment),R$=c(),T(or.$$.fragment),Q$=c(),T(nr.$$.fragment),sk=c(),jn=s("h2"),sr=s("a"),Pm=s("span"),T(hl.$$.fragment),V$=c(),jm=s("span"),J$=o("BertForNextSentencePrediction"),rk=c(),Mt=s("div"),T(fl.$$.fragment),G$=c(),ml=s("p"),X$=o("Bert Model with a "),qm=s("code"),Y$=o("next sentence prediction (classification)"),Z$=o(" head on top."),e0=c(),ul=s("p"),t0=o("This model inherits from "),lh=s("a"),o0=o("PreTrainedModel"),n0=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.)`),s0=c(),gl=s("p"),r0=o("This model is also a PyTorch "),_l=s("a"),a0=o("torch.nn.Module"),i0=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),l0=c(),io=s("div"),T(bl.$$.fragment),d0=c(),qn=s("p"),c0=o("The "),dh=s("a"),p0=o("BertForNextSentencePrediction"),h0=o(" forward method, overrides the "),Cm=s("code"),f0=o("__call__"),m0=o(" special method."),u0=c(),T(rr.$$.fragment),g0=c(),T(ar.$$.fragment),ak=c(),Cn=s("h2"),ir=s("a"),Nm=s("span"),T(kl.$$.fragment),_0=c(),Om=s("span"),b0=o("BertForSequenceClassification"),ik=c(),Pt=s("div"),T(yl.$$.fragment),k0=c(),Am=s("p"),y0=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.`),T0=c(),Tl=s("p"),v0=o("This model inherits from "),ch=s("a"),w0=o("PreTrainedModel"),$0=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.)`),x0=c(),vl=s("p"),F0=o("This model is also a PyTorch "),wl=s("a"),B0=o("torch.nn.Module"),E0=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),z0=c(),ft=s("div"),T($l.$$.fragment),M0=c(),Nn=s("p"),P0=o("The "),ph=s("a"),j0=o("BertForSequenceClassification"),q0=o(" forward method, overrides the "),Im=s("code"),C0=o("__call__"),N0=o(" special method."),O0=c(),T(lr.$$.fragment),A0=c(),T(dr.$$.fragment),I0=c(),T(cr.$$.fragment),L0=c(),T(pr.$$.fragment),D0=c(),T(hr.$$.fragment),lk=c(),On=s("h2"),fr=s("a"),Lm=s("span"),T(xl.$$.fragment),S0=c(),Dm=s("span"),U0=o("BertForMultipleChoice"),dk=c(),jt=s("div"),T(Fl.$$.fragment),W0=c(),Sm=s("p"),H0=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.`),K0=c(),Bl=s("p"),R0=o("This model inherits from "),hh=s("a"),Q0=o("PreTrainedModel"),V0=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.)`),J0=c(),El=s("p"),G0=o("This model is also a PyTorch "),zl=s("a"),X0=o("torch.nn.Module"),Y0=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Z0=c(),lo=s("div"),T(Ml.$$.fragment),e2=c(),An=s("p"),t2=o("The "),fh=s("a"),o2=o("BertForMultipleChoice"),n2=o(" forward method, overrides the "),Um=s("code"),s2=o("__call__"),r2=o(" special method."),a2=c(),T(mr.$$.fragment),i2=c(),T(ur.$$.fragment),ck=c(),In=s("h2"),gr=s("a"),Wm=s("span"),T(Pl.$$.fragment),l2=c(),Hm=s("span"),d2=o("BertForTokenClassification"),pk=c(),qt=s("div"),T(jl.$$.fragment),c2=c(),Km=s("p"),p2=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.`),h2=c(),ql=s("p"),f2=o("This model inherits from "),mh=s("a"),m2=o("PreTrainedModel"),u2=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.)`),g2=c(),Cl=s("p"),_2=o("This model is also a PyTorch "),Nl=s("a"),b2=o("torch.nn.Module"),k2=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),y2=c(),Ot=s("div"),T(Ol.$$.fragment),T2=c(),Ln=s("p"),v2=o("The "),uh=s("a"),w2=o("BertForTokenClassification"),$2=o(" forward method, overrides the "),Rm=s("code"),x2=o("__call__"),F2=o(" special method."),B2=c(),T(_r.$$.fragment),E2=c(),T(br.$$.fragment),z2=c(),T(kr.$$.fragment),hk=c(),Dn=s("h2"),yr=s("a"),Qm=s("span"),T(Al.$$.fragment),M2=c(),Vm=s("span"),P2=o("BertForQuestionAnswering"),fk=c(),Ct=s("div"),T(Il.$$.fragment),j2=c(),Sn=s("p"),q2=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 `),Jm=s("code"),C2=o("span start logits"),N2=o(" and "),Gm=s("code"),O2=o("span end logits"),A2=o(")."),I2=c(),Ll=s("p"),L2=o("This model inherits from "),gh=s("a"),D2=o("PreTrainedModel"),S2=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.)`),U2=c(),Dl=s("p"),W2=o("This model is also a PyTorch "),Sl=s("a"),H2=o("torch.nn.Module"),K2=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),R2=c(),At=s("div"),T(Ul.$$.fragment),Q2=c(),Un=s("p"),V2=o("The "),_h=s("a"),J2=o("BertForQuestionAnswering"),G2=o(" forward method, overrides the "),Xm=s("code"),X2=o("__call__"),Y2=o(" special method."),Z2=c(),T(Tr.$$.fragment),ex=c(),T(vr.$$.fragment),tx=c(),T(wr.$$.fragment),mk=c(),Wn=s("h2"),$r=s("a"),Ym=s("span"),T(Wl.$$.fragment),ox=c(),Zm=s("span"),nx=o("TFBertModel"),uk=c(),ut=s("div"),T(Hl.$$.fragment),sx=c(),eu=s("p"),rx=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),ax=c(),Kl=s("p"),ix=o("This model inherits from "),bh=s("a"),lx=o("TFPreTrainedModel"),dx=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.)`),cx=c(),Rl=s("p"),px=o("This model is also a "),Ql=s("a"),hx=o("tf.keras.Model"),fx=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.`),mx=c(),T(xr.$$.fragment),ux=c(),co=s("div"),T(Vl.$$.fragment),gx=c(),Hn=s("p"),_x=o("The "),kh=s("a"),bx=o("TFBertModel"),kx=o(" forward method, overrides the "),tu=s("code"),yx=o("__call__"),Tx=o(" special method."),vx=c(),T(Fr.$$.fragment),wx=c(),T(Br.$$.fragment),gk=c(),Kn=s("h2"),Er=s("a"),ou=s("span"),T(Jl.$$.fragment),$x=c(),nu=s("span"),xx=o("TFBertForPreTraining"),_k=c(),gt=s("div"),T(Gl.$$.fragment),Fx=c(),Rn=s("p"),Bx=o(`Bert Model with two heads on top as done during the pretraining:
a `),su=s("code"),Ex=o("masked language modeling"),zx=o(" head and a "),ru=s("code"),Mx=o("next sentence prediction (classification)"),Px=o(" head."),jx=c(),Xl=s("p"),qx=o("This model inherits from "),yh=s("a"),Cx=o("TFPreTrainedModel"),Nx=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.)`),Ox=c(),Yl=s("p"),Ax=o("This model is also a "),Zl=s("a"),Ix=o("tf.keras.Model"),Lx=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.`),Dx=c(),T(zr.$$.fragment),Sx=c(),po=s("div"),T(ed.$$.fragment),Ux=c(),Qn=s("p"),Wx=o("The "),Th=s("a"),Hx=o("TFBertForPreTraining"),Kx=o(" forward method, overrides the "),au=s("code"),Rx=o("__call__"),Qx=o(" special method."),Vx=c(),T(Mr.$$.fragment),Jx=c(),T(Pr.$$.fragment),bk=c(),Vn=s("h2"),jr=s("a"),iu=s("span"),T(td.$$.fragment),Gx=c(),lu=s("span"),Xx=o("TFBertModelLMHeadModel"),kk=c(),Jn=s("div"),T(od.$$.fragment),Yx=c(),It=s("div"),T(nd.$$.fragment),Zx=c(),nt=s("p"),eF=o("encoder_hidden_states  ("),du=s("code"),tF=o("tf.Tensor"),oF=o(" of shape "),cu=s("code"),nF=o("(batch_size, sequence_length, hidden_size)"),sF=o(", "),pu=s("em"),rF=o("optional"),aF=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 (`),hu=s("code"),iF=o("tf.Tensor"),lF=o(" of shape "),fu=s("code"),dF=o("(batch_size, sequence_length)"),cF=o(", "),mu=s("em"),pF=o("optional"),hF=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 `),uu=s("code"),fF=o("[0, 1]"),mF=o(":"),uF=c(),sd=s("ul"),rd=s("li"),gF=o("1 for tokens that are "),gu=s("strong"),_F=o("not masked"),bF=o(","),kF=c(),ad=s("li"),yF=o("0 for tokens that are "),_u=s("strong"),TF=o("masked"),vF=o("."),wF=c(),te=s("p"),$F=o("past_key_values ("),bu=s("code"),xF=o("Tuple[Tuple[tf.Tensor]]"),FF=o(" of length "),ku=s("code"),BF=o("config.n_layers"),EF=o(`)
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),yu=s("code"),zF=o("past_key_values"),MF=o(" are used, the user can optionally input only the last "),Tu=s("code"),PF=o("decoder_input_ids"),jF=o(` (those that
don\u2019t have their past key value states given to this model) of shape `),vu=s("code"),qF=o("(batch_size, 1)"),CF=o(` instead of all
`),wu=s("code"),NF=o("decoder_input_ids"),OF=o(" of shape "),$u=s("code"),AF=o("(batch_size, sequence_length)"),IF=o(`.
use_cache (`),xu=s("code"),LF=o("bool"),DF=o(", "),Fu=s("em"),SF=o("optional"),UF=o(", defaults to "),Bu=s("code"),WF=o("True"),HF=o(`):
If set to `),Eu=s("code"),KF=o("True"),RF=o(", "),zu=s("code"),QF=o("past_key_values"),VF=o(` key value states are returned and can be used to speed up decoding (see
`),Mu=s("code"),JF=o("past_key_values"),GF=o("). Set to "),Pu=s("code"),XF=o("False"),YF=o(" during training, "),ju=s("code"),ZF=o("True"),eB=o(` during generation
labels (`),qu=s("code"),tB=o("tf.Tensor"),oB=o(" or "),Cu=s("code"),nB=o("np.ndarray"),sB=o(" of shape "),Nu=s("code"),rB=o("(batch_size, sequence_length)"),aB=o(", "),Ou=s("em"),iB=o("optional"),lB=o(`):
Labels for computing the cross entropy classification loss. Indices should be in `),Au=s("code"),dB=o("[0, ..., config.vocab_size - 1]"),cB=o("."),pB=c(),T(qr.$$.fragment),yk=c(),Gn=s("h2"),Cr=s("a"),Iu=s("span"),T(id.$$.fragment),hB=c(),Lu=s("span"),fB=o("TFBertForMaskedLM"),Tk=c(),_t=s("div"),T(ld.$$.fragment),mB=c(),dd=s("p"),uB=o("Bert Model with a "),Du=s("code"),gB=o("language modeling"),_B=o(" head on top."),bB=c(),cd=s("p"),kB=o("This model inherits from "),vh=s("a"),yB=o("TFPreTrainedModel"),TB=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.)`),vB=c(),pd=s("p"),wB=o("This model is also a "),hd=s("a"),$B=o("tf.keras.Model"),xB=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.`),FB=c(),T(Nr.$$.fragment),BB=c(),Lt=s("div"),T(fd.$$.fragment),EB=c(),Xn=s("p"),zB=o("The "),wh=s("a"),MB=o("TFBertForMaskedLM"),PB=o(" forward method, overrides the "),Su=s("code"),jB=o("__call__"),qB=o(" special method."),CB=c(),T(Or.$$.fragment),NB=c(),T(Ar.$$.fragment),OB=c(),T(Ir.$$.fragment),vk=c(),Yn=s("h2"),Lr=s("a"),Uu=s("span"),T(md.$$.fragment),AB=c(),Wu=s("span"),IB=o("TFBertForNextSentencePrediction"),wk=c(),bt=s("div"),T(ud.$$.fragment),LB=c(),gd=s("p"),DB=o("Bert Model with a "),Hu=s("code"),SB=o("next sentence prediction (classification)"),UB=o(" head on top."),WB=c(),_d=s("p"),HB=o("This model inherits from "),$h=s("a"),KB=o("TFPreTrainedModel"),RB=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.)`),QB=c(),bd=s("p"),VB=o("This model is also a "),kd=s("a"),JB=o("tf.keras.Model"),GB=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.`),XB=c(),T(Dr.$$.fragment),YB=c(),ho=s("div"),T(yd.$$.fragment),ZB=c(),Zn=s("p"),e9=o("The "),xh=s("a"),t9=o("TFBertForNextSentencePrediction"),o9=o(" forward method, overrides the "),Ku=s("code"),n9=o("__call__"),s9=o(" special method."),r9=c(),T(Sr.$$.fragment),a9=c(),T(Ur.$$.fragment),$k=c(),es=s("h2"),Wr=s("a"),Ru=s("span"),T(Td.$$.fragment),i9=c(),Qu=s("span"),l9=o("TFBertForSequenceClassification"),xk=c(),kt=s("div"),T(vd.$$.fragment),d9=c(),Vu=s("p"),c9=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.`),p9=c(),wd=s("p"),h9=o("This model inherits from "),Fh=s("a"),f9=o("TFPreTrainedModel"),m9=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.)`),u9=c(),$d=s("p"),g9=o("This model is also a "),xd=s("a"),_9=o("tf.keras.Model"),b9=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.`),k9=c(),T(Hr.$$.fragment),y9=c(),Dt=s("div"),T(Fd.$$.fragment),T9=c(),ts=s("p"),v9=o("The "),Bh=s("a"),w9=o("TFBertForSequenceClassification"),$9=o(" forward method, overrides the "),Ju=s("code"),x9=o("__call__"),F9=o(" special method."),B9=c(),T(Kr.$$.fragment),E9=c(),T(Rr.$$.fragment),z9=c(),T(Qr.$$.fragment),Fk=c(),os=s("h2"),Vr=s("a"),Gu=s("span"),T(Bd.$$.fragment),M9=c(),Xu=s("span"),P9=o("TFBertForMultipleChoice"),Bk=c(),yt=s("div"),T(Ed.$$.fragment),j9=c(),Yu=s("p"),q9=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.`),C9=c(),zd=s("p"),N9=o("This model inherits from "),Eh=s("a"),O9=o("TFPreTrainedModel"),A9=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.)`),I9=c(),Md=s("p"),L9=o("This model is also a "),Pd=s("a"),D9=o("tf.keras.Model"),S9=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.`),U9=c(),T(Jr.$$.fragment),W9=c(),fo=s("div"),T(jd.$$.fragment),H9=c(),ns=s("p"),K9=o("The "),zh=s("a"),R9=o("TFBertForMultipleChoice"),Q9=o(" forward method, overrides the "),Zu=s("code"),V9=o("__call__"),J9=o(" special method."),G9=c(),T(Gr.$$.fragment),X9=c(),T(Xr.$$.fragment),Ek=c(),ss=s("h2"),Yr=s("a"),eg=s("span"),T(qd.$$.fragment),Y9=c(),tg=s("span"),Z9=o("TFBertForTokenClassification"),zk=c(),Tt=s("div"),T(Cd.$$.fragment),eE=c(),og=s("p"),tE=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.`),oE=c(),Nd=s("p"),nE=o("This model inherits from "),Mh=s("a"),sE=o("TFPreTrainedModel"),rE=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.)`),aE=c(),Od=s("p"),iE=o("This model is also a "),Ad=s("a"),lE=o("tf.keras.Model"),dE=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.`),cE=c(),T(Zr.$$.fragment),pE=c(),St=s("div"),T(Id.$$.fragment),hE=c(),rs=s("p"),fE=o("The "),Ph=s("a"),mE=o("TFBertForTokenClassification"),uE=o(" forward method, overrides the "),ng=s("code"),gE=o("__call__"),_E=o(" special method."),bE=c(),T(ea.$$.fragment),kE=c(),T(ta.$$.fragment),yE=c(),T(oa.$$.fragment),Mk=c(),as=s("h2"),na=s("a"),sg=s("span"),T(Ld.$$.fragment),TE=c(),rg=s("span"),vE=o("TFBertForQuestionAnswering"),Pk=c(),vt=s("div"),T(Dd.$$.fragment),wE=c(),is=s("p"),$E=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 `),ag=s("code"),xE=o("span start logits"),FE=o(" and "),ig=s("code"),BE=o("span end logits"),EE=o(")."),zE=c(),Sd=s("p"),ME=o("This model inherits from "),jh=s("a"),PE=o("TFPreTrainedModel"),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.)`),qE=c(),Ud=s("p"),CE=o("This model is also a "),Wd=s("a"),NE=o("tf.keras.Model"),OE=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.`),AE=c(),T(sa.$$.fragment),IE=c(),Ut=s("div"),T(Hd.$$.fragment),LE=c(),ls=s("p"),DE=o("The "),qh=s("a"),SE=o("TFBertForQuestionAnswering"),UE=o(" forward method, overrides the "),lg=s("code"),WE=o("__call__"),HE=o(" special method."),KE=c(),T(ra.$$.fragment),RE=c(),T(aa.$$.fragment),QE=c(),T(ia.$$.fragment),jk=c(),ds=s("h2"),la=s("a"),dg=s("span"),T(Kd.$$.fragment),VE=c(),cg=s("span"),JE=o("FlaxBertModel"),qk=c(),st=s("div"),T(Rd.$$.fragment),GE=c(),pg=s("p"),XE=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),YE=c(),Qd=s("p"),ZE=o("This model inherits from "),Ch=s("a"),ez=o("FlaxPreTrainedModel"),tz=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)`),oz=c(),Vd=s("p"),nz=o("This model is also a Flax Linen "),Jd=s("a"),sz=o("flax.linen.Module"),rz=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.`),az=c(),hg=s("p"),iz=o("Finally, this model supports inherent JAX features such as:"),lz=c(),jo=s("ul"),fg=s("li"),Gd=s("a"),dz=o("Just-In-Time (JIT) compilation"),cz=c(),mg=s("li"),Xd=s("a"),pz=o("Automatic Differentiation"),hz=c(),ug=s("li"),Yd=s("a"),fz=o("Vectorization"),mz=c(),gg=s("li"),Zd=s("a"),uz=o("Parallelization"),gz=c(),mo=s("div"),T(ec.$$.fragment),_z=c(),cs=s("p"),bz=o("The "),_g=s("code"),kz=o("FlaxBertPreTrainedModel"),yz=o(" forward method, overrides the "),bg=s("code"),Tz=o("__call__"),vz=o(" special method."),wz=c(),T(da.$$.fragment),$z=c(),T(ca.$$.fragment),Ck=c(),ps=s("h2"),pa=s("a"),kg=s("span"),T(tc.$$.fragment),xz=c(),yg=s("span"),Fz=o("FlaxBertForPreTraining"),Nk=c(),rt=s("div"),T(oc.$$.fragment),Bz=c(),hs=s("p"),Ez=o("Bert Model with two heads on top as done during the pretraining: a "),Tg=s("code"),zz=o("masked language modeling"),Mz=o(" head and a "),vg=s("code"),Pz=o("next sentence prediction (classification)"),jz=o(" head."),qz=c(),nc=s("p"),Cz=o("This model inherits from "),Nh=s("a"),Nz=o("FlaxPreTrainedModel"),Oz=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)`),Az=c(),sc=s("p"),Iz=o("This model is also a Flax Linen "),rc=s("a"),Lz=o("flax.linen.Module"),Dz=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.`),Sz=c(),wg=s("p"),Uz=o("Finally, this model supports inherent JAX features such as:"),Wz=c(),qo=s("ul"),$g=s("li"),ac=s("a"),Hz=o("Just-In-Time (JIT) compilation"),Kz=c(),xg=s("li"),ic=s("a"),Rz=o("Automatic Differentiation"),Qz=c(),Fg=s("li"),lc=s("a"),Vz=o("Vectorization"),Jz=c(),Bg=s("li"),dc=s("a"),Gz=o("Parallelization"),Xz=c(),uo=s("div"),T(cc.$$.fragment),Yz=c(),fs=s("p"),Zz=o("The "),Eg=s("code"),eM=o("FlaxBertPreTrainedModel"),tM=o(" forward method, overrides the "),zg=s("code"),oM=o("__call__"),nM=o(" special method."),sM=c(),T(ha.$$.fragment),rM=c(),T(fa.$$.fragment),Ok=c(),ms=s("h2"),ma=s("a"),Mg=s("span"),T(pc.$$.fragment),aM=c(),Pg=s("span"),iM=o("FlaxBertForCausalLM"),Ak=c(),at=s("div"),T(hc.$$.fragment),lM=c(),jg=s("p"),dM=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.`),cM=c(),fc=s("p"),pM=o("This model inherits from "),Oh=s("a"),hM=o("FlaxPreTrainedModel"),fM=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)`),mM=c(),mc=s("p"),uM=o("This model is also a Flax Linen "),uc=s("a"),gM=o("flax.linen.Module"),_M=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.`),bM=c(),qg=s("p"),kM=o("Finally, this model supports inherent JAX features such as:"),yM=c(),Co=s("ul"),Cg=s("li"),gc=s("a"),TM=o("Just-In-Time (JIT) compilation"),vM=c(),Ng=s("li"),_c=s("a"),wM=o("Automatic Differentiation"),$M=c(),Og=s("li"),bc=s("a"),xM=o("Vectorization"),FM=c(),Ag=s("li"),kc=s("a"),BM=o("Parallelization"),EM=c(),go=s("div"),T(yc.$$.fragment),zM=c(),us=s("p"),MM=o("The "),Ig=s("code"),PM=o("FlaxBertPreTrainedModel"),jM=o(" forward method, overrides the "),Lg=s("code"),qM=o("__call__"),CM=o(" special method."),NM=c(),T(ua.$$.fragment),OM=c(),T(ga.$$.fragment),Ik=c(),gs=s("h2"),_a=s("a"),Dg=s("span"),T(Tc.$$.fragment),AM=c(),Sg=s("span"),IM=o("FlaxBertForMaskedLM"),Lk=c(),it=s("div"),T(vc.$$.fragment),LM=c(),wc=s("p"),DM=o("Bert Model with a "),Ug=s("code"),SM=o("language modeling"),UM=o(" head on top."),WM=c(),$c=s("p"),HM=o("This model inherits from "),Ah=s("a"),KM=o("FlaxPreTrainedModel"),RM=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)`),QM=c(),xc=s("p"),VM=o("This model is also a Flax Linen "),Fc=s("a"),JM=o("flax.linen.Module"),GM=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.`),XM=c(),Wg=s("p"),YM=o("Finally, this model supports inherent JAX features such as:"),ZM=c(),No=s("ul"),Hg=s("li"),Bc=s("a"),e4=o("Just-In-Time (JIT) compilation"),t4=c(),Kg=s("li"),Ec=s("a"),o4=o("Automatic Differentiation"),n4=c(),Rg=s("li"),zc=s("a"),s4=o("Vectorization"),r4=c(),Qg=s("li"),Mc=s("a"),a4=o("Parallelization"),i4=c(),_o=s("div"),T(Pc.$$.fragment),l4=c(),_s=s("p"),d4=o("The "),Vg=s("code"),c4=o("FlaxBertPreTrainedModel"),p4=o(" forward method, overrides the "),Jg=s("code"),h4=o("__call__"),f4=o(" special method."),m4=c(),T(ba.$$.fragment),u4=c(),T(ka.$$.fragment),Dk=c(),bs=s("h2"),ya=s("a"),Gg=s("span"),T(jc.$$.fragment),g4=c(),Xg=s("span"),_4=o("FlaxBertForNextSentencePrediction"),Sk=c(),lt=s("div"),T(qc.$$.fragment),b4=c(),Cc=s("p"),k4=o("Bert Model with a "),Yg=s("code"),y4=o("next sentence prediction (classification)"),T4=o(" head on top."),v4=c(),Nc=s("p"),w4=o("This model inherits from "),Ih=s("a"),$4=o("FlaxPreTrainedModel"),x4=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)`),F4=c(),Oc=s("p"),B4=o("This model is also a Flax Linen "),Ac=s("a"),E4=o("flax.linen.Module"),z4=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.`),M4=c(),Zg=s("p"),P4=o("Finally, this model supports inherent JAX features such as:"),j4=c(),Oo=s("ul"),e_=s("li"),Ic=s("a"),q4=o("Just-In-Time (JIT) compilation"),C4=c(),t_=s("li"),Lc=s("a"),N4=o("Automatic Differentiation"),O4=c(),o_=s("li"),Dc=s("a"),A4=o("Vectorization"),I4=c(),n_=s("li"),Sc=s("a"),L4=o("Parallelization"),D4=c(),bo=s("div"),T(Uc.$$.fragment),S4=c(),ks=s("p"),U4=o("The "),s_=s("code"),W4=o("FlaxBertPreTrainedModel"),H4=o(" forward method, overrides the "),r_=s("code"),K4=o("__call__"),R4=o(" special method."),Q4=c(),T(Ta.$$.fragment),V4=c(),T(va.$$.fragment),Uk=c(),ys=s("h2"),wa=s("a"),a_=s("span"),T(Wc.$$.fragment),J4=c(),i_=s("span"),G4=o("FlaxBertForSequenceClassification"),Wk=c(),dt=s("div"),T(Hc.$$.fragment),X4=c(),l_=s("p"),Y4=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.`),Z4=c(),Kc=s("p"),eP=o("This model inherits from "),Lh=s("a"),tP=o("FlaxPreTrainedModel"),oP=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)`),nP=c(),Rc=s("p"),sP=o("This model is also a Flax Linen "),Qc=s("a"),rP=o("flax.linen.Module"),aP=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.`),iP=c(),d_=s("p"),lP=o("Finally, this model supports inherent JAX features such as:"),dP=c(),Ao=s("ul"),c_=s("li"),Vc=s("a"),cP=o("Just-In-Time (JIT) compilation"),pP=c(),p_=s("li"),Jc=s("a"),hP=o("Automatic Differentiation"),fP=c(),h_=s("li"),Gc=s("a"),mP=o("Vectorization"),uP=c(),f_=s("li"),Xc=s("a"),gP=o("Parallelization"),_P=c(),ko=s("div"),T(Yc.$$.fragment),bP=c(),Ts=s("p"),kP=o("The "),m_=s("code"),yP=o("FlaxBertPreTrainedModel"),TP=o(" forward method, overrides the "),u_=s("code"),vP=o("__call__"),wP=o(" special method."),$P=c(),T($a.$$.fragment),xP=c(),T(xa.$$.fragment),Hk=c(),vs=s("h2"),Fa=s("a"),g_=s("span"),T(Zc.$$.fragment),FP=c(),__=s("span"),BP=o("FlaxBertForMultipleChoice"),Kk=c(),ct=s("div"),T(ep.$$.fragment),EP=c(),b_=s("p"),zP=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.`),MP=c(),tp=s("p"),PP=o("This model inherits from "),Dh=s("a"),jP=o("FlaxPreTrainedModel"),qP=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)`),CP=c(),op=s("p"),NP=o("This model is also a Flax Linen "),np=s("a"),OP=o("flax.linen.Module"),AP=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.`),IP=c(),k_=s("p"),LP=o("Finally, this model supports inherent JAX features such as:"),DP=c(),Io=s("ul"),y_=s("li"),sp=s("a"),SP=o("Just-In-Time (JIT) compilation"),UP=c(),T_=s("li"),rp=s("a"),WP=o("Automatic Differentiation"),HP=c(),v_=s("li"),ap=s("a"),KP=o("Vectorization"),RP=c(),w_=s("li"),ip=s("a"),QP=o("Parallelization"),VP=c(),yo=s("div"),T(lp.$$.fragment),JP=c(),ws=s("p"),GP=o("The "),$_=s("code"),XP=o("FlaxBertPreTrainedModel"),YP=o(" forward method, overrides the "),x_=s("code"),ZP=o("__call__"),ej=o(" special method."),tj=c(),T(Ba.$$.fragment),oj=c(),T(Ea.$$.fragment),Rk=c(),$s=s("h2"),za=s("a"),F_=s("span"),T(dp.$$.fragment),nj=c(),B_=s("span"),sj=o("FlaxBertForTokenClassification"),Qk=c(),pt=s("div"),T(cp.$$.fragment),rj=c(),E_=s("p"),aj=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.`),ij=c(),pp=s("p"),lj=o("This model inherits from "),Sh=s("a"),dj=o("FlaxPreTrainedModel"),cj=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)`),pj=c(),hp=s("p"),hj=o("This model is also a Flax Linen "),fp=s("a"),fj=o("flax.linen.Module"),mj=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.`),uj=c(),z_=s("p"),gj=o("Finally, this model supports inherent JAX features such as:"),_j=c(),Lo=s("ul"),M_=s("li"),mp=s("a"),bj=o("Just-In-Time (JIT) compilation"),kj=c(),P_=s("li"),up=s("a"),yj=o("Automatic Differentiation"),Tj=c(),j_=s("li"),gp=s("a"),vj=o("Vectorization"),wj=c(),q_=s("li"),_p=s("a"),$j=o("Parallelization"),xj=c(),To=s("div"),T(bp.$$.fragment),Fj=c(),xs=s("p"),Bj=o("The "),C_=s("code"),Ej=o("FlaxBertPreTrainedModel"),zj=o(" forward method, overrides the "),N_=s("code"),Mj=o("__call__"),Pj=o(" special method."),jj=c(),T(Ma.$$.fragment),qj=c(),T(Pa.$$.fragment),Vk=c(),Fs=s("h2"),ja=s("a"),O_=s("span"),T(kp.$$.fragment),Cj=c(),A_=s("span"),Nj=o("FlaxBertForQuestionAnswering"),Jk=c(),ht=s("div"),T(yp.$$.fragment),Oj=c(),Bs=s("p"),Aj=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 `),I_=s("code"),Ij=o("span start logits"),Lj=o(" and "),L_=s("code"),Dj=o("span end logits"),Sj=o(")."),Uj=c(),Tp=s("p"),Wj=o("This model inherits from "),Uh=s("a"),Hj=o("FlaxPreTrainedModel"),Kj=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)`),Rj=c(),vp=s("p"),Qj=o("This model is also a Flax Linen "),wp=s("a"),Vj=o("flax.linen.Module"),Jj=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.`),Gj=c(),D_=s("p"),Xj=o("Finally, this model supports inherent JAX features such as:"),Yj=c(),Do=s("ul"),S_=s("li"),$p=s("a"),Zj=o("Just-In-Time (JIT) compilation"),e7=c(),U_=s("li"),xp=s("a"),t7=o("Automatic Differentiation"),o7=c(),W_=s("li"),Fp=s("a"),n7=o("Vectorization"),s7=c(),H_=s("li"),Bp=s("a"),r7=o("Parallelization"),a7=c(),vo=s("div"),T(Ep.$$.fragment),i7=c(),Es=s("p"),l7=o("The "),K_=s("code"),d7=o("FlaxBertPreTrainedModel"),c7=o(" forward method, overrides the "),R_=s("code"),p7=o("__call__"),h7=o(" special method."),f7=c(),T(qa.$$.fragment),m7=c(),T(Ca.$$.fragment),this.h()},l(i){const k=RN('[data-svelte="svelte-1phssyn"]',document.head);d=r(k,"META",{name:!0,content:!0}),k.forEach(t),g=p(i),f=r(i,"H1",{class:!0});var zp=a(f);m=r(zp,"A",{id:!0,class:!0,href:!0});var Q_=a(m);b=r(Q_,"SPAN",{});var V_=a(b);v(l.$$.fragment,V_),V_.forEach(t),Q_.forEach(t),h=p(zp),z=r(zp,"SPAN",{});var J_=a(z);Fe=n(J_,"BERT"),J_.forEach(t),zp.forEach(t),Te=p(i),S=r(i,"H2",{class:!0});var Mp=a(S);pe=r(Mp,"A",{id:!0,class:!0,href:!0});var G_=a(pe);ee=r(G_,"SPAN",{});var X_=a(ee);v(E.$$.fragment,X_),X_.forEach(t),G_.forEach(t),Be=p(Mp),R=r(Mp,"SPAN",{});var Y_=a(R);Ee=n(Y_,"Overview"),Y_.forEach(t),Mp.forEach(t),ve=p(i),U=r(i,"P",{});var Pp=a(U);ze=n(Pp,"The BERT model was proposed in "),fe=r(Pp,"A",{href:!0,rel:!0});var Z_=a(fe);G=n(Z_,"BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding"),Z_.forEach(t),Me=n(Pp,` 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.`),Pp.forEach(t),we=p(i),H=r(i,"P",{});var eb=a(H);Pe=n(eb,"The abstract from the paper is the following:"),eb.forEach(t),$e=p(i),K=r(i,"P",{});var tb=a(K);_e=r(tb,"EM",{});var ob=a(_e);je=n(ob,`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.`),ob.forEach(t),tb.forEach(t),oe=p(i),j=r(i,"P",{});var nb=a(j);q=r(nb,"EM",{});var sb=a(q);qe=n(sb,`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).`),sb.forEach(t),nb.forEach(t),V=p(i),ge=r(i,"P",{});var rb=a(ge);Ce=n(rb,"Tips:"),rb.forEach(t),J=p(i),he=r(i,"UL",{});var jp=a(he);be=r(jp,"LI",{});var ab=a(be);N=n(ab,`BERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),ab.forEach(t),Ne=p(jp),Q=r(jp,"LI",{});var ib=a(Q);Oe=n(ib,`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.`),ib.forEach(t),jp.forEach(t),xe=p(i),D=r(i,"P",{});var zs=a(D);Ae=n(zs,"This model was contributed by "),me=r(zs,"A",{href:!0,rel:!0});var lb=a(me);L=n(lb,"thomwolf"),lb.forEach(t),Ie=n(zs,". The original code can be found "),W=r(zs,"A",{href:!0,rel:!0});var db=a(W);Le=n(db,"here"),db.forEach(t),se=n(zs,"."),zs.forEach(t),C=p(i),de=r(i,"H2",{class:!0});var qp=a(de);O=r(qp,"A",{id:!0,class:!0,href:!0});var cb=a(O);ke=r(cb,"SPAN",{});var pb=a(ke);v(ue.$$.fragment,pb),pb.forEach(t),cb.forEach(t),y=p(qp),M=r(qp,"SPAN",{});var hb=a(M);Re=n(hb,"BertConfig"),hb.forEach(t),qp.forEach(t),ne=p(i),ye=r(i,"DIV",{class:!0});var So=a(ye);v(We.$$.fragment,So),P=p(So),De=r(So,"P",{});var Uo=a(De);Qe=n(Uo,"This is the configuration class to store the configuration of a "),Ke=r(Uo,"A",{href:!0});var fb=a(Ke);Ve=n(fb,"BertModel"),fb.forEach(t),Je=n(Uo," or a "),I=r(Uo,"A",{href:!0});var mb=a(I);X=n(mb,"TFBertModel"),mb.forEach(t),Ge=n(Uo,`. 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
`),He=r(Uo,"A",{href:!0,rel:!0});var ub=a(He);Y=n(ub,"bert-base-uncased"),ub.forEach(t),Xe=n(Uo," architecture."),Uo.forEach(t),Ye=p(So),ce=r(So,"P",{});var Ms=a(ce);Ze=n(Ms,"Configuration objects inherit from "),Z=r(Ms,"A",{href:!0});var gb=a(Z);et=n(gb,"PretrainedConfig"),gb.forEach(t),HT=n(Ms,` and can be used to control the model outputs. Read the
documentation from `),Wp=r(Ms,"A",{href:!0});var _b=a(Wp);KT=n(_b,"PretrainedConfig"),_b.forEach(t),RT=n(Ms," for more information."),Ms.forEach(t),QT=p(So),v(Cs.$$.fragment,So),So.forEach(t),Db=p(i),fn=r(i,"H2",{class:!0});var Cp=a(fn);Ns=r(Cp,"A",{id:!0,class:!0,href:!0});var bb=a(Ns);jf=r(bb,"SPAN",{});var kb=a(jf);v(li.$$.fragment,kb),kb.forEach(t),bb.forEach(t),VT=p(Cp),qf=r(Cp,"SPAN",{});var yb=a(qf);JT=n(yb,"BertTokenizer"),yb.forEach(t),Cp.forEach(t),Sb=p(i),tt=r(i,"DIV",{class:!0});var wt=a(tt);v(di.$$.fragment,wt),GT=p(wt),Cf=r(wt,"P",{});var Tb=a(Cf);XT=n(Tb,"Construct a BERT tokenizer. Based on WordPiece."),Tb.forEach(t),YT=p(wt),ci=r(wt,"P",{});var Np=a(ci);ZT=n(Np,"This tokenizer inherits from "),Hp=r(Np,"A",{href:!0});var vb=a(Hp);ev=n(vb,"PreTrainedTokenizer"),vb.forEach(t),tv=n(Np,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Np.forEach(t),ov=p(wt),Ko=r(wt,"DIV",{class:!0});var Ps=a(Ko);v(pi.$$.fragment,Ps),nv=p(Ps),Nf=r(Ps,"P",{});var wb=a(Nf);sv=n(wb,`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:`),wb.forEach(t),rv=p(Ps),hi=r(Ps,"UL",{});var Op=a(hi);Kp=r(Op,"LI",{});var Wh=a(Kp);av=n(Wh,"single sequence: "),Of=r(Wh,"CODE",{});var $b=a(Of);iv=n($b,"[CLS] X [SEP]"),$b.forEach(t),Wh.forEach(t),lv=p(Op),Rp=r(Op,"LI",{});var Hh=a(Rp);dv=n(Hh,"pair of sequences: "),Af=r(Hh,"CODE",{});var xb=a(Af);cv=n(xb,"[CLS] A [SEP] B [SEP]"),xb.forEach(t),Hh.forEach(t),Op.forEach(t),Ps.forEach(t),pv=p(wt),Os=r(wt,"DIV",{class:!0});var Ap=a(Os);v(fi.$$.fragment,Ap),hv=p(Ap),mi=r(Ap,"P",{});var Ip=a(mi);fv=n(Ip,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),If=r(Ip,"CODE",{});var Fb=a(If);mv=n(Fb,"prepare_for_model"),Fb.forEach(t),uv=n(Ip," method."),Ip.forEach(t),Ap.forEach(t),gv=p(wt),oo=r(wt,"DIV",{class:!0});var Wo=a(oo);v(ui.$$.fragment,Wo),_v=p(Wo),Lf=r(Wo,"P",{});var Bb=a(Lf);bv=n(Bb,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),Bb.forEach(t),kv=p(Wo),v(As.$$.fragment,Wo),yv=p(Wo),mn=r(Wo,"P",{});var js=a(mn);Tv=n(js,"If "),Df=r(js,"CODE",{});var Eb=a(Df);vv=n(Eb,"token_ids_1"),Eb.forEach(t),wv=n(js," is "),Sf=r(js,"CODE",{});var zb=a(Sf);$v=n(zb,"None"),zb.forEach(t),xv=n(js,", this method only returns the first portion of the mask (0s)."),js.forEach(t),Wo.forEach(t),Fv=p(wt),Qp=r(wt,"DIV",{class:!0});var Mb=a(Qp);v(gi.$$.fragment,Mb),Mb.forEach(t),wt.forEach(t),Ub=p(i),un=r(i,"H2",{class:!0});var Lp=a(un);Is=r(Lp,"A",{id:!0,class:!0,href:!0});var Pb=a(Is);Uf=r(Pb,"SPAN",{});var jb=a(Uf);v(_i.$$.fragment,jb),jb.forEach(t),Pb.forEach(t),Bv=p(Lp),Wf=r(Lp,"SPAN",{});var qb=a(Wf);Ev=n(qb,"BertTokenizerFast"),qb.forEach(t),Lp.forEach(t),Wb=p(i),xt=r(i,"DIV",{class:!0});var to=a(xt);v(bi.$$.fragment,to),zv=p(to),ki=r(to,"P",{});var Dp=a(ki);Mv=n(Dp,"Construct a \u201Cfast\u201D BERT tokenizer (backed by HuggingFace\u2019s "),Hf=r(Dp,"EM",{});var Cb=a(Hf);Pv=n(Cb,"tokenizers"),Cb.forEach(t),jv=n(Dp," library). Based on WordPiece."),Dp.forEach(t),qv=p(to),yi=r(to,"P",{});var Sp=a(yi);Cv=n(Sp,"This tokenizer inherits from "),Vp=r(Sp,"A",{href:!0});var Nb=a(Vp);Nv=n(Nb,"PreTrainedTokenizerFast"),Nb.forEach(t),Ov=n(Sp,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Sp.forEach(t),Av=p(to),Ro=r(to,"DIV",{class:!0});var qs=a(Ro);v(Ti.$$.fragment,qs),Iv=p(qs),Kf=r(qs,"P",{});var Ob=a(Kf);Lv=n(Ob,`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:`),Ob.forEach(t),Dv=p(qs),vi=r(qs,"UL",{});var Up=a(vi);Jp=r(Up,"LI",{});var Kh=a(Jp);Sv=n(Kh,"single sequence: "),Rf=r(Kh,"CODE",{});var Ab=a(Rf);Uv=n(Ab,"[CLS] X [SEP]"),Ab.forEach(t),Kh.forEach(t),Wv=p(Up),Gp=r(Up,"LI",{});var Rh=a(Gp);Hv=n(Rh,"pair of sequences: "),Qf=r(Rh,"CODE",{});var Ib=a(Qf);Kv=n(Ib,"[CLS] A [SEP] B [SEP]"),Ib.forEach(t),Rh.forEach(t),Up.forEach(t),qs.forEach(t),Rv=p(to),no=r(to,"DIV",{class:!0});var Ho=a(no);v(wi.$$.fragment,Ho),Qv=p(Ho),Vf=r(Ho,"P",{});var Lb=a(Vf);Vv=n(Lb,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),Lb.forEach(t),Jv=p(Ho),v(Ls.$$.fragment,Ho),Gv=p(Ho),gn=r(Ho,"P",{});var Qh=a(gn);Xv=n(Qh,"If "),Jf=r(Qh,"CODE",{});var u7=a(Jf);Yv=n(u7,"token_ids_1"),u7.forEach(t),Zv=n(Qh," is "),Gf=r(Qh,"CODE",{});var g7=a(Gf);e1=n(g7,"None"),g7.forEach(t),t1=n(Qh,", this method only returns the first portion of the mask (0s)."),Qh.forEach(t),Ho.forEach(t),to.forEach(t),Hb=p(i),_n=r(i,"H2",{class:!0});var Xk=a(_n);Ds=r(Xk,"A",{id:!0,class:!0,href:!0});var _7=a(Ds);Xf=r(_7,"SPAN",{});var b7=a(Xf);v($i.$$.fragment,b7),b7.forEach(t),_7.forEach(t),o1=p(Xk),Yf=r(Xk,"SPAN",{});var k7=a(Yf);n1=n(k7,"TFBertTokenizer"),k7.forEach(t),Xk.forEach(t),Kb=p(i),Ft=r(i,"DIV",{class:!0});var Jo=a(Ft);v(xi.$$.fragment,Jo),s1=p(Jo),bn=r(Jo,"P",{});var Vh=a(bn);r1=n(Vh,`This is an in-graph tokenizer for BERT. It should be initialized similarly to other tokenizers, using the
`),Zf=r(Vh,"CODE",{});var y7=a(Zf);a1=n(y7,"from_pretrained()"),y7.forEach(t),i1=n(Vh," method. It can also be initialized with the "),em=r(Vh,"CODE",{});var T7=a(em);l1=n(T7,"from_tokenizer()"),T7.forEach(t),d1=n(Vh,` method, which imports settings
from an existing standard tokenizer object.`),Vh.forEach(t),c1=p(Jo),Fi=r(Jo,"P",{});var Yk=a(Fi);p1=n(Yk,`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 `),tm=r(Yk,"CODE",{});var v7=a(tm);h1=n(v7,"tf.string"),v7.forEach(t),f1=n(Yk," inputs to outputs."),Yk.forEach(t),m1=p(Jo),Qo=r(Jo,"DIV",{class:!0});var Jh=a(Qo);v(Bi.$$.fragment,Jh),u1=p(Jh),Ei=r(Jh,"P",{});var Zk=a(Ei);g1=n(Zk,"Instantiate a "),om=r(Zk,"CODE",{});var w7=a(om);_1=n(w7,"TFBertTokenizer"),w7.forEach(t),b1=n(Zk," from a pre-trained tokenizer."),Zk.forEach(t),k1=p(Jh),v(Ss.$$.fragment,Jh),Jh.forEach(t),y1=p(Jo),Vo=r(Jo,"DIV",{class:!0});var Gh=a(Vo);v(zi.$$.fragment,Gh),T1=p(Gh),kn=r(Gh,"P",{});var Xh=a(kn);v1=n(Xh,"Initialize a "),nm=r(Xh,"CODE",{});var $7=a(nm);w1=n($7,"TFBertTokenizer"),$7.forEach(t),$1=n(Xh," from an existing "),sm=r(Xh,"CODE",{});var x7=a(sm);x1=n(x7,"Tokenizer"),x7.forEach(t),F1=n(Xh,"."),Xh.forEach(t),B1=p(Gh),v(Us.$$.fragment,Gh),Gh.forEach(t),Jo.forEach(t),Rb=p(i),yn=r(i,"H2",{class:!0});var ey=a(yn);Ws=r(ey,"A",{id:!0,class:!0,href:!0});var F7=a(Ws);rm=r(F7,"SPAN",{});var B7=a(rm);v(Mi.$$.fragment,B7),B7.forEach(t),F7.forEach(t),E1=p(ey),am=r(ey,"SPAN",{});var E7=a(am);z1=n(E7,"Bert specific outputs"),E7.forEach(t),ey.forEach(t),Qb=p(i),Tn=r(i,"DIV",{class:!0});var ty=a(Tn);v(Pi.$$.fragment,ty),M1=p(ty),ji=r(ty,"P",{});var oy=a(ji);P1=n(oy,"Output type of "),Xp=r(oy,"A",{href:!0});var z7=a(Xp);j1=n(z7,"BertForPreTraining"),z7.forEach(t),q1=n(oy,"."),oy.forEach(t),ty.forEach(t),Vb=p(i),vn=r(i,"DIV",{class:!0});var ny=a(vn);v(qi.$$.fragment,ny),C1=p(ny),Ci=r(ny,"P",{});var sy=a(Ci);N1=n(sy,"Output type of "),Yp=r(sy,"A",{href:!0});var M7=a(Yp);O1=n(M7,"TFBertForPreTraining"),M7.forEach(t),A1=n(sy,"."),sy.forEach(t),ny.forEach(t),Jb=p(i),Po=r(i,"DIV",{class:!0});var Yh=a(Po);v(Ni.$$.fragment,Yh),I1=p(Yh),Oi=r(Yh,"P",{});var ry=a(Oi);L1=n(ry,"Output type of "),Zp=r(ry,"A",{href:!0});var P7=a(Zp);D1=n(P7,"BertForPreTraining"),P7.forEach(t),S1=n(ry,"."),ry.forEach(t),U1=p(Yh),Hs=r(Yh,"DIV",{class:!0});var ay=a(Hs);v(Ai.$$.fragment,ay),W1=p(ay),im=r(ay,"P",{});var j7=a(im);H1=n(j7,"\u201CReturns a new object replacing the specified fields with new values."),j7.forEach(t),ay.forEach(t),Yh.forEach(t),Gb=p(i),wn=r(i,"H2",{class:!0});var iy=a(wn);Ks=r(iy,"A",{id:!0,class:!0,href:!0});var q7=a(Ks);lm=r(q7,"SPAN",{});var C7=a(lm);v(Ii.$$.fragment,C7),C7.forEach(t),q7.forEach(t),K1=p(iy),dm=r(iy,"SPAN",{});var N7=a(dm);R1=n(N7,"BertModel"),N7.forEach(t),iy.forEach(t),Xb=p(i),ot=r(i,"DIV",{class:!0});var Wt=a(ot);v(Li.$$.fragment,Wt),Q1=p(Wt),cm=r(Wt,"P",{});var O7=a(cm);V1=n(O7,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),O7.forEach(t),J1=p(Wt),Di=r(Wt,"P",{});var ly=a(Di);G1=n(ly,"This model inherits from "),eh=r(ly,"A",{href:!0});var A7=a(eh);X1=n(A7,"PreTrainedModel"),A7.forEach(t),Y1=n(ly,`. 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.)`),ly.forEach(t),Z1=p(Wt),Si=r(Wt,"P",{});var dy=a(Si);ew=n(dy,"This model is also a PyTorch "),Ui=r(dy,"A",{href:!0,rel:!0});var I7=a(Ui);tw=n(I7,"torch.nn.Module"),I7.forEach(t),ow=n(dy,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),dy.forEach(t),nw=p(Wt),Wi=r(Wt,"P",{});var cy=a(Wi);sw=n(cy,`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 `),Hi=r(cy,"A",{href:!0,rel:!0});var L7=a(Hi);rw=n(L7,`Attention is
all you need`),L7.forEach(t),aw=n(cy,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),cy.forEach(t),iw=p(Wt),mt=r(Wt,"P",{});var Ht=a(mt);lw=n(Ht,"To behave as an decoder the model needs to be initialized with the "),pm=r(Ht,"CODE",{});var D7=a(pm);dw=n(D7,"is_decoder"),D7.forEach(t),cw=n(Ht,` argument of the configuration set
to `),hm=r(Ht,"CODE",{});var S7=a(hm);pw=n(S7,"True"),S7.forEach(t),hw=n(Ht,". To be used in a Seq2Seq model, the model needs to initialized with both "),fm=r(Ht,"CODE",{});var U7=a(fm);fw=n(U7,"is_decoder"),U7.forEach(t),mw=n(Ht,` argument and
`),mm=r(Ht,"CODE",{});var W7=a(mm);uw=n(W7,"add_cross_attention"),W7.forEach(t),gw=n(Ht," set to "),um=r(Ht,"CODE",{});var H7=a(um);_w=n(H7,"True"),H7.forEach(t),bw=n(Ht,"; an "),gm=r(Ht,"CODE",{});var K7=a(gm);kw=n(K7,"encoder_hidden_states"),K7.forEach(t),yw=n(Ht," is then expected as an input to the forward pass."),Ht.forEach(t),Tw=p(Wt),so=r(Wt,"DIV",{class:!0});var Na=a(so);v(Ki.$$.fragment,Na),vw=p(Na),$n=r(Na,"P",{});var Zh=a($n);ww=n(Zh,"The "),th=r(Zh,"A",{href:!0});var R7=a(th);$w=n(R7,"BertModel"),R7.forEach(t),xw=n(Zh," forward method, overrides the "),_m=r(Zh,"CODE",{});var Q7=a(_m);Fw=n(Q7,"__call__"),Q7.forEach(t),Bw=n(Zh," special method."),Zh.forEach(t),Ew=p(Na),v(Rs.$$.fragment,Na),zw=p(Na),v(Qs.$$.fragment,Na),Na.forEach(t),Wt.forEach(t),Yb=p(i),xn=r(i,"H2",{class:!0});var py=a(xn);Vs=r(py,"A",{id:!0,class:!0,href:!0});var V7=a(Vs);bm=r(V7,"SPAN",{});var J7=a(bm);v(Ri.$$.fragment,J7),J7.forEach(t),V7.forEach(t),Mw=p(py),km=r(py,"SPAN",{});var G7=a(km);Pw=n(G7,"BertForPreTraining"),G7.forEach(t),py.forEach(t),Zb=p(i),Bt=r(i,"DIV",{class:!0});var Go=a(Bt);v(Qi.$$.fragment,Go),jw=p(Go),Fn=r(Go,"P",{});var ef=a(Fn);qw=n(ef,"Bert Model with two heads on top as done during the pretraining: a "),ym=r(ef,"CODE",{});var X7=a(ym);Cw=n(X7,"masked language modeling"),X7.forEach(t),Nw=n(ef," head and a "),Tm=r(ef,"CODE",{});var Y7=a(Tm);Ow=n(Y7,"next sentence prediction (classification)"),Y7.forEach(t),Aw=n(ef," head."),ef.forEach(t),Iw=p(Go),Vi=r(Go,"P",{});var hy=a(Vi);Lw=n(hy,"This model inherits from "),oh=r(hy,"A",{href:!0});var Z7=a(oh);Dw=n(Z7,"PreTrainedModel"),Z7.forEach(t),Sw=n(hy,`. 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.)`),hy.forEach(t),Uw=p(Go),Ji=r(Go,"P",{});var fy=a(Ji);Ww=n(fy,"This model is also a PyTorch "),Gi=r(fy,"A",{href:!0,rel:!0});var eq=a(Gi);Hw=n(eq,"torch.nn.Module"),eq.forEach(t),Kw=n(fy,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),fy.forEach(t),Rw=p(Go),ro=r(Go,"DIV",{class:!0});var Oa=a(ro);v(Xi.$$.fragment,Oa),Qw=p(Oa),Bn=r(Oa,"P",{});var tf=a(Bn);Vw=n(tf,"The "),nh=r(tf,"A",{href:!0});var tq=a(nh);Jw=n(tq,"BertForPreTraining"),tq.forEach(t),Gw=n(tf," forward method, overrides the "),vm=r(tf,"CODE",{});var oq=a(vm);Xw=n(oq,"__call__"),oq.forEach(t),Yw=n(tf," special method."),tf.forEach(t),Zw=p(Oa),v(Js.$$.fragment,Oa),e$=p(Oa),v(Gs.$$.fragment,Oa),Oa.forEach(t),Go.forEach(t),ek=p(i),En=r(i,"H2",{class:!0});var my=a(En);Xs=r(my,"A",{id:!0,class:!0,href:!0});var nq=a(Xs);wm=r(nq,"SPAN",{});var sq=a(wm);v(Yi.$$.fragment,sq),sq.forEach(t),nq.forEach(t),t$=p(my),$m=r(my,"SPAN",{});var rq=a($m);o$=n(rq,"BertLMHeadModel"),rq.forEach(t),my.forEach(t),tk=p(i),Et=r(i,"DIV",{class:!0});var Xo=a(Et);v(Zi.$$.fragment,Xo),n$=p(Xo),el=r(Xo,"P",{});var uy=a(el);s$=n(uy,"Bert Model with a "),xm=r(uy,"CODE",{});var aq=a(xm);r$=n(aq,"language modeling"),aq.forEach(t),a$=n(uy," head on top for CLM fine-tuning."),uy.forEach(t),i$=p(Xo),tl=r(Xo,"P",{});var gy=a(tl);l$=n(gy,"This model inherits from "),sh=r(gy,"A",{href:!0});var iq=a(sh);d$=n(iq,"PreTrainedModel"),iq.forEach(t),c$=n(gy,`. 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.)`),gy.forEach(t),p$=p(Xo),ol=r(Xo,"P",{});var _y=a(ol);h$=n(_y,"This model is also a PyTorch "),nl=r(_y,"A",{href:!0,rel:!0});var lq=a(nl);f$=n(lq,"torch.nn.Module"),lq.forEach(t),m$=n(_y,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_y.forEach(t),u$=p(Xo),ao=r(Xo,"DIV",{class:!0});var Aa=a(ao);v(sl.$$.fragment,Aa),g$=p(Aa),zn=r(Aa,"P",{});var of=a(zn);_$=n(of,"The "),rh=r(of,"A",{href:!0});var dq=a(rh);b$=n(dq,"BertLMHeadModel"),dq.forEach(t),k$=n(of," forward method, overrides the "),Fm=r(of,"CODE",{});var cq=a(Fm);y$=n(cq,"__call__"),cq.forEach(t),T$=n(of," special method."),of.forEach(t),v$=p(Aa),v(Ys.$$.fragment,Aa),w$=p(Aa),v(Zs.$$.fragment,Aa),Aa.forEach(t),Xo.forEach(t),ok=p(i),Mn=r(i,"H2",{class:!0});var by=a(Mn);er=r(by,"A",{id:!0,class:!0,href:!0});var pq=a(er);Bm=r(pq,"SPAN",{});var hq=a(Bm);v(rl.$$.fragment,hq),hq.forEach(t),pq.forEach(t),$$=p(by),Em=r(by,"SPAN",{});var fq=a(Em);x$=n(fq,"BertForMaskedLM"),fq.forEach(t),by.forEach(t),nk=p(i),zt=r(i,"DIV",{class:!0});var Yo=a(zt);v(al.$$.fragment,Yo),F$=p(Yo),il=r(Yo,"P",{});var ky=a(il);B$=n(ky,"Bert Model with a "),zm=r(ky,"CODE",{});var mq=a(zm);E$=n(mq,"language modeling"),mq.forEach(t),z$=n(ky," head on top."),ky.forEach(t),M$=p(Yo),ll=r(Yo,"P",{});var yy=a(ll);P$=n(yy,"This model inherits from "),ah=r(yy,"A",{href:!0});var uq=a(ah);j$=n(uq,"PreTrainedModel"),uq.forEach(t),q$=n(yy,`. 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.)`),yy.forEach(t),C$=p(Yo),dl=r(Yo,"P",{});var Ty=a(dl);N$=n(Ty,"This model is also a PyTorch "),cl=r(Ty,"A",{href:!0,rel:!0});var gq=a(cl);O$=n(gq,"torch.nn.Module"),gq.forEach(t),A$=n(Ty,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ty.forEach(t),I$=p(Yo),Nt=r(Yo,"DIV",{class:!0});var Zo=a(Nt);v(pl.$$.fragment,Zo),L$=p(Zo),Pn=r(Zo,"P",{});var nf=a(Pn);D$=n(nf,"The "),ih=r(nf,"A",{href:!0});var _q=a(ih);S$=n(_q,"BertForMaskedLM"),_q.forEach(t),U$=n(nf," forward method, overrides the "),Mm=r(nf,"CODE",{});var bq=a(Mm);W$=n(bq,"__call__"),bq.forEach(t),H$=n(nf," special method."),nf.forEach(t),K$=p(Zo),v(tr.$$.fragment,Zo),R$=p(Zo),v(or.$$.fragment,Zo),Q$=p(Zo),v(nr.$$.fragment,Zo),Zo.forEach(t),Yo.forEach(t),sk=p(i),jn=r(i,"H2",{class:!0});var vy=a(jn);sr=r(vy,"A",{id:!0,class:!0,href:!0});var kq=a(sr);Pm=r(kq,"SPAN",{});var yq=a(Pm);v(hl.$$.fragment,yq),yq.forEach(t),kq.forEach(t),V$=p(vy),jm=r(vy,"SPAN",{});var Tq=a(jm);J$=n(Tq,"BertForNextSentencePrediction"),Tq.forEach(t),vy.forEach(t),rk=p(i),Mt=r(i,"DIV",{class:!0});var en=a(Mt);v(fl.$$.fragment,en),G$=p(en),ml=r(en,"P",{});var wy=a(ml);X$=n(wy,"Bert Model with a "),qm=r(wy,"CODE",{});var vq=a(qm);Y$=n(vq,"next sentence prediction (classification)"),vq.forEach(t),Z$=n(wy," head on top."),wy.forEach(t),e0=p(en),ul=r(en,"P",{});var $y=a(ul);t0=n($y,"This model inherits from "),lh=r($y,"A",{href:!0});var wq=a(lh);o0=n(wq,"PreTrainedModel"),wq.forEach(t),n0=n($y,`. 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.)`),$y.forEach(t),s0=p(en),gl=r(en,"P",{});var xy=a(gl);r0=n(xy,"This model is also a PyTorch "),_l=r(xy,"A",{href:!0,rel:!0});var $q=a(_l);a0=n($q,"torch.nn.Module"),$q.forEach(t),i0=n(xy,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xy.forEach(t),l0=p(en),io=r(en,"DIV",{class:!0});var Ia=a(io);v(bl.$$.fragment,Ia),d0=p(Ia),qn=r(Ia,"P",{});var sf=a(qn);c0=n(sf,"The "),dh=r(sf,"A",{href:!0});var xq=a(dh);p0=n(xq,"BertForNextSentencePrediction"),xq.forEach(t),h0=n(sf," forward method, overrides the "),Cm=r(sf,"CODE",{});var Fq=a(Cm);f0=n(Fq,"__call__"),Fq.forEach(t),m0=n(sf," special method."),sf.forEach(t),u0=p(Ia),v(rr.$$.fragment,Ia),g0=p(Ia),v(ar.$$.fragment,Ia),Ia.forEach(t),en.forEach(t),ak=p(i),Cn=r(i,"H2",{class:!0});var Fy=a(Cn);ir=r(Fy,"A",{id:!0,class:!0,href:!0});var Bq=a(ir);Nm=r(Bq,"SPAN",{});var Eq=a(Nm);v(kl.$$.fragment,Eq),Eq.forEach(t),Bq.forEach(t),_0=p(Fy),Om=r(Fy,"SPAN",{});var zq=a(Om);b0=n(zq,"BertForSequenceClassification"),zq.forEach(t),Fy.forEach(t),ik=p(i),Pt=r(i,"DIV",{class:!0});var tn=a(Pt);v(yl.$$.fragment,tn),k0=p(tn),Am=r(tn,"P",{});var Mq=a(Am);y0=n(Mq,`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.`),Mq.forEach(t),T0=p(tn),Tl=r(tn,"P",{});var By=a(Tl);v0=n(By,"This model inherits from "),ch=r(By,"A",{href:!0});var Pq=a(ch);w0=n(Pq,"PreTrainedModel"),Pq.forEach(t),$0=n(By,`. 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.)`),By.forEach(t),x0=p(tn),vl=r(tn,"P",{});var Ey=a(vl);F0=n(Ey,"This model is also a PyTorch "),wl=r(Ey,"A",{href:!0,rel:!0});var jq=a(wl);B0=n(jq,"torch.nn.Module"),jq.forEach(t),E0=n(Ey,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ey.forEach(t),z0=p(tn),ft=r(tn,"DIV",{class:!0});var Kt=a(ft);v($l.$$.fragment,Kt),M0=p(Kt),Nn=r(Kt,"P",{});var rf=a(Nn);P0=n(rf,"The "),ph=r(rf,"A",{href:!0});var qq=a(ph);j0=n(qq,"BertForSequenceClassification"),qq.forEach(t),q0=n(rf," forward method, overrides the "),Im=r(rf,"CODE",{});var Cq=a(Im);C0=n(Cq,"__call__"),Cq.forEach(t),N0=n(rf," special method."),rf.forEach(t),O0=p(Kt),v(lr.$$.fragment,Kt),A0=p(Kt),v(dr.$$.fragment,Kt),I0=p(Kt),v(cr.$$.fragment,Kt),L0=p(Kt),v(pr.$$.fragment,Kt),D0=p(Kt),v(hr.$$.fragment,Kt),Kt.forEach(t),tn.forEach(t),lk=p(i),On=r(i,"H2",{class:!0});var zy=a(On);fr=r(zy,"A",{id:!0,class:!0,href:!0});var Nq=a(fr);Lm=r(Nq,"SPAN",{});var Oq=a(Lm);v(xl.$$.fragment,Oq),Oq.forEach(t),Nq.forEach(t),S0=p(zy),Dm=r(zy,"SPAN",{});var Aq=a(Dm);U0=n(Aq,"BertForMultipleChoice"),Aq.forEach(t),zy.forEach(t),dk=p(i),jt=r(i,"DIV",{class:!0});var on=a(jt);v(Fl.$$.fragment,on),W0=p(on),Sm=r(on,"P",{});var Iq=a(Sm);H0=n(Iq,`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.forEach(t),K0=p(on),Bl=r(on,"P",{});var My=a(Bl);R0=n(My,"This model inherits from "),hh=r(My,"A",{href:!0});var Lq=a(hh);Q0=n(Lq,"PreTrainedModel"),Lq.forEach(t),V0=n(My,`. 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.)`),My.forEach(t),J0=p(on),El=r(on,"P",{});var Py=a(El);G0=n(Py,"This model is also a PyTorch "),zl=r(Py,"A",{href:!0,rel:!0});var Dq=a(zl);X0=n(Dq,"torch.nn.Module"),Dq.forEach(t),Y0=n(Py,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Py.forEach(t),Z0=p(on),lo=r(on,"DIV",{class:!0});var La=a(lo);v(Ml.$$.fragment,La),e2=p(La),An=r(La,"P",{});var af=a(An);t2=n(af,"The "),fh=r(af,"A",{href:!0});var Sq=a(fh);o2=n(Sq,"BertForMultipleChoice"),Sq.forEach(t),n2=n(af," forward method, overrides the "),Um=r(af,"CODE",{});var Uq=a(Um);s2=n(Uq,"__call__"),Uq.forEach(t),r2=n(af," special method."),af.forEach(t),a2=p(La),v(mr.$$.fragment,La),i2=p(La),v(ur.$$.fragment,La),La.forEach(t),on.forEach(t),ck=p(i),In=r(i,"H2",{class:!0});var jy=a(In);gr=r(jy,"A",{id:!0,class:!0,href:!0});var Wq=a(gr);Wm=r(Wq,"SPAN",{});var Hq=a(Wm);v(Pl.$$.fragment,Hq),Hq.forEach(t),Wq.forEach(t),l2=p(jy),Hm=r(jy,"SPAN",{});var Kq=a(Hm);d2=n(Kq,"BertForTokenClassification"),Kq.forEach(t),jy.forEach(t),pk=p(i),qt=r(i,"DIV",{class:!0});var nn=a(qt);v(jl.$$.fragment,nn),c2=p(nn),Km=r(nn,"P",{});var Rq=a(Km);p2=n(Rq,`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.`),Rq.forEach(t),h2=p(nn),ql=r(nn,"P",{});var qy=a(ql);f2=n(qy,"This model inherits from "),mh=r(qy,"A",{href:!0});var Qq=a(mh);m2=n(Qq,"PreTrainedModel"),Qq.forEach(t),u2=n(qy,`. 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.)`),qy.forEach(t),g2=p(nn),Cl=r(nn,"P",{});var Cy=a(Cl);_2=n(Cy,"This model is also a PyTorch "),Nl=r(Cy,"A",{href:!0,rel:!0});var Vq=a(Nl);b2=n(Vq,"torch.nn.Module"),Vq.forEach(t),k2=n(Cy,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Cy.forEach(t),y2=p(nn),Ot=r(nn,"DIV",{class:!0});var sn=a(Ot);v(Ol.$$.fragment,sn),T2=p(sn),Ln=r(sn,"P",{});var lf=a(Ln);v2=n(lf,"The "),uh=r(lf,"A",{href:!0});var Jq=a(uh);w2=n(Jq,"BertForTokenClassification"),Jq.forEach(t),$2=n(lf," forward method, overrides the "),Rm=r(lf,"CODE",{});var Gq=a(Rm);x2=n(Gq,"__call__"),Gq.forEach(t),F2=n(lf," special method."),lf.forEach(t),B2=p(sn),v(_r.$$.fragment,sn),E2=p(sn),v(br.$$.fragment,sn),z2=p(sn),v(kr.$$.fragment,sn),sn.forEach(t),nn.forEach(t),hk=p(i),Dn=r(i,"H2",{class:!0});var Ny=a(Dn);yr=r(Ny,"A",{id:!0,class:!0,href:!0});var Xq=a(yr);Qm=r(Xq,"SPAN",{});var Yq=a(Qm);v(Al.$$.fragment,Yq),Yq.forEach(t),Xq.forEach(t),M2=p(Ny),Vm=r(Ny,"SPAN",{});var Zq=a(Vm);P2=n(Zq,"BertForQuestionAnswering"),Zq.forEach(t),Ny.forEach(t),fk=p(i),Ct=r(i,"DIV",{class:!0});var rn=a(Ct);v(Il.$$.fragment,rn),j2=p(rn),Sn=r(rn,"P",{});var df=a(Sn);q2=n(df,`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 `),Jm=r(df,"CODE",{});var e3=a(Jm);C2=n(e3,"span start logits"),e3.forEach(t),N2=n(df," and "),Gm=r(df,"CODE",{});var t3=a(Gm);O2=n(t3,"span end logits"),t3.forEach(t),A2=n(df,")."),df.forEach(t),I2=p(rn),Ll=r(rn,"P",{});var Oy=a(Ll);L2=n(Oy,"This model inherits from "),gh=r(Oy,"A",{href:!0});var o3=a(gh);D2=n(o3,"PreTrainedModel"),o3.forEach(t),S2=n(Oy,`. 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.)`),Oy.forEach(t),U2=p(rn),Dl=r(rn,"P",{});var Ay=a(Dl);W2=n(Ay,"This model is also a PyTorch "),Sl=r(Ay,"A",{href:!0,rel:!0});var n3=a(Sl);H2=n(n3,"torch.nn.Module"),n3.forEach(t),K2=n(Ay,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ay.forEach(t),R2=p(rn),At=r(rn,"DIV",{class:!0});var an=a(At);v(Ul.$$.fragment,an),Q2=p(an),Un=r(an,"P",{});var cf=a(Un);V2=n(cf,"The "),_h=r(cf,"A",{href:!0});var s3=a(_h);J2=n(s3,"BertForQuestionAnswering"),s3.forEach(t),G2=n(cf," forward method, overrides the "),Xm=r(cf,"CODE",{});var r3=a(Xm);X2=n(r3,"__call__"),r3.forEach(t),Y2=n(cf," special method."),cf.forEach(t),Z2=p(an),v(Tr.$$.fragment,an),ex=p(an),v(vr.$$.fragment,an),tx=p(an),v(wr.$$.fragment,an),an.forEach(t),rn.forEach(t),mk=p(i),Wn=r(i,"H2",{class:!0});var Iy=a(Wn);$r=r(Iy,"A",{id:!0,class:!0,href:!0});var a3=a($r);Ym=r(a3,"SPAN",{});var i3=a(Ym);v(Wl.$$.fragment,i3),i3.forEach(t),a3.forEach(t),ox=p(Iy),Zm=r(Iy,"SPAN",{});var l3=a(Zm);nx=n(l3,"TFBertModel"),l3.forEach(t),Iy.forEach(t),uk=p(i),ut=r(i,"DIV",{class:!0});var wo=a(ut);v(Hl.$$.fragment,wo),sx=p(wo),eu=r(wo,"P",{});var d3=a(eu);rx=n(d3,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),d3.forEach(t),ax=p(wo),Kl=r(wo,"P",{});var Ly=a(Kl);ix=n(Ly,"This model inherits from "),bh=r(Ly,"A",{href:!0});var c3=a(bh);lx=n(c3,"TFPreTrainedModel"),c3.forEach(t),dx=n(Ly,`. 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.)`),Ly.forEach(t),cx=p(wo),Rl=r(wo,"P",{});var Dy=a(Rl);px=n(Dy,"This model is also a "),Ql=r(Dy,"A",{href:!0,rel:!0});var p3=a(Ql);hx=n(p3,"tf.keras.Model"),p3.forEach(t),fx=n(Dy,` 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.`),Dy.forEach(t),mx=p(wo),v(xr.$$.fragment,wo),ux=p(wo),co=r(wo,"DIV",{class:!0});var Da=a(co);v(Vl.$$.fragment,Da),gx=p(Da),Hn=r(Da,"P",{});var pf=a(Hn);_x=n(pf,"The "),kh=r(pf,"A",{href:!0});var h3=a(kh);bx=n(h3,"TFBertModel"),h3.forEach(t),kx=n(pf," forward method, overrides the "),tu=r(pf,"CODE",{});var f3=a(tu);yx=n(f3,"__call__"),f3.forEach(t),Tx=n(pf," special method."),pf.forEach(t),vx=p(Da),v(Fr.$$.fragment,Da),wx=p(Da),v(Br.$$.fragment,Da),Da.forEach(t),wo.forEach(t),gk=p(i),Kn=r(i,"H2",{class:!0});var Sy=a(Kn);Er=r(Sy,"A",{id:!0,class:!0,href:!0});var m3=a(Er);ou=r(m3,"SPAN",{});var u3=a(ou);v(Jl.$$.fragment,u3),u3.forEach(t),m3.forEach(t),$x=p(Sy),nu=r(Sy,"SPAN",{});var g3=a(nu);xx=n(g3,"TFBertForPreTraining"),g3.forEach(t),Sy.forEach(t),_k=p(i),gt=r(i,"DIV",{class:!0});var $o=a(gt);v(Gl.$$.fragment,$o),Fx=p($o),Rn=r($o,"P",{});var hf=a(Rn);Bx=n(hf,`Bert Model with two heads on top as done during the pretraining:
a `),su=r(hf,"CODE",{});var _3=a(su);Ex=n(_3,"masked language modeling"),_3.forEach(t),zx=n(hf," head and a "),ru=r(hf,"CODE",{});var b3=a(ru);Mx=n(b3,"next sentence prediction (classification)"),b3.forEach(t),Px=n(hf," head."),hf.forEach(t),jx=p($o),Xl=r($o,"P",{});var Uy=a(Xl);qx=n(Uy,"This model inherits from "),yh=r(Uy,"A",{href:!0});var k3=a(yh);Cx=n(k3,"TFPreTrainedModel"),k3.forEach(t),Nx=n(Uy,`. 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.)`),Uy.forEach(t),Ox=p($o),Yl=r($o,"P",{});var Wy=a(Yl);Ax=n(Wy,"This model is also a "),Zl=r(Wy,"A",{href:!0,rel:!0});var y3=a(Zl);Ix=n(y3,"tf.keras.Model"),y3.forEach(t),Lx=n(Wy,` 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.`),Wy.forEach(t),Dx=p($o),v(zr.$$.fragment,$o),Sx=p($o),po=r($o,"DIV",{class:!0});var Sa=a(po);v(ed.$$.fragment,Sa),Ux=p(Sa),Qn=r(Sa,"P",{});var ff=a(Qn);Wx=n(ff,"The "),Th=r(ff,"A",{href:!0});var T3=a(Th);Hx=n(T3,"TFBertForPreTraining"),T3.forEach(t),Kx=n(ff," forward method, overrides the "),au=r(ff,"CODE",{});var v3=a(au);Rx=n(v3,"__call__"),v3.forEach(t),Qx=n(ff," special method."),ff.forEach(t),Vx=p(Sa),v(Mr.$$.fragment,Sa),Jx=p(Sa),v(Pr.$$.fragment,Sa),Sa.forEach(t),$o.forEach(t),bk=p(i),Vn=r(i,"H2",{class:!0});var Hy=a(Vn);jr=r(Hy,"A",{id:!0,class:!0,href:!0});var w3=a(jr);iu=r(w3,"SPAN",{});var $3=a(iu);v(td.$$.fragment,$3),$3.forEach(t),w3.forEach(t),Gx=p(Hy),lu=r(Hy,"SPAN",{});var x3=a(lu);Xx=n(x3,"TFBertModelLMHeadModel"),x3.forEach(t),Hy.forEach(t),kk=p(i),Jn=r(i,"DIV",{class:!0});var Ky=a(Jn);v(od.$$.fragment,Ky),Yx=p(Ky),It=r(Ky,"DIV",{class:!0});var ln=a(It);v(nd.$$.fragment,ln),Zx=p(ln),nt=r(ln,"P",{});var $t=a(nt);eF=n($t,"encoder_hidden_states  ("),du=r($t,"CODE",{});var F3=a(du);tF=n(F3,"tf.Tensor"),F3.forEach(t),oF=n($t," of shape "),cu=r($t,"CODE",{});var B3=a(cu);nF=n(B3,"(batch_size, sequence_length, hidden_size)"),B3.forEach(t),sF=n($t,", "),pu=r($t,"EM",{});var E3=a(pu);rF=n(E3,"optional"),E3.forEach(t),aF=n($t,`):
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 (`),hu=r($t,"CODE",{});var z3=a(hu);iF=n(z3,"tf.Tensor"),z3.forEach(t),lF=n($t," of shape "),fu=r($t,"CODE",{});var M3=a(fu);dF=n(M3,"(batch_size, sequence_length)"),M3.forEach(t),cF=n($t,", "),mu=r($t,"EM",{});var P3=a(mu);pF=n(P3,"optional"),P3.forEach(t),hF=n($t,`):
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 `),uu=r($t,"CODE",{});var j3=a(uu);fF=n(j3,"[0, 1]"),j3.forEach(t),mF=n($t,":"),$t.forEach(t),uF=p(ln),sd=r(ln,"UL",{});var Ry=a(sd);rd=r(Ry,"LI",{});var Qy=a(rd);gF=n(Qy,"1 for tokens that are "),gu=r(Qy,"STRONG",{});var q3=a(gu);_F=n(q3,"not masked"),q3.forEach(t),bF=n(Qy,","),Qy.forEach(t),kF=p(Ry),ad=r(Ry,"LI",{});var Vy=a(ad);yF=n(Vy,"0 for tokens that are "),_u=r(Vy,"STRONG",{});var C3=a(_u);TF=n(C3,"masked"),C3.forEach(t),vF=n(Vy,"."),Vy.forEach(t),Ry.forEach(t),wF=p(ln),te=r(ln,"P",{});var re=a(te);$F=n(re,"past_key_values ("),bu=r(re,"CODE",{});var N3=a(bu);xF=n(N3,"Tuple[Tuple[tf.Tensor]]"),N3.forEach(t),FF=n(re," of length "),ku=r(re,"CODE",{});var O3=a(ku);BF=n(O3,"config.n_layers"),O3.forEach(t),EF=n(re,`)
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),yu=r(re,"CODE",{});var A3=a(yu);zF=n(A3,"past_key_values"),A3.forEach(t),MF=n(re," are used, the user can optionally input only the last "),Tu=r(re,"CODE",{});var I3=a(Tu);PF=n(I3,"decoder_input_ids"),I3.forEach(t),jF=n(re,` (those that
don\u2019t have their past key value states given to this model) of shape `),vu=r(re,"CODE",{});var L3=a(vu);qF=n(L3,"(batch_size, 1)"),L3.forEach(t),CF=n(re,` instead of all
`),wu=r(re,"CODE",{});var D3=a(wu);NF=n(D3,"decoder_input_ids"),D3.forEach(t),OF=n(re," of shape "),$u=r(re,"CODE",{});var S3=a($u);AF=n(S3,"(batch_size, sequence_length)"),S3.forEach(t),IF=n(re,`.
use_cache (`),xu=r(re,"CODE",{});var U3=a(xu);LF=n(U3,"bool"),U3.forEach(t),DF=n(re,", "),Fu=r(re,"EM",{});var W3=a(Fu);SF=n(W3,"optional"),W3.forEach(t),UF=n(re,", defaults to "),Bu=r(re,"CODE",{});var H3=a(Bu);WF=n(H3,"True"),H3.forEach(t),HF=n(re,`):
If set to `),Eu=r(re,"CODE",{});var K3=a(Eu);KF=n(K3,"True"),K3.forEach(t),RF=n(re,", "),zu=r(re,"CODE",{});var R3=a(zu);QF=n(R3,"past_key_values"),R3.forEach(t),VF=n(re,` key value states are returned and can be used to speed up decoding (see
`),Mu=r(re,"CODE",{});var Q3=a(Mu);JF=n(Q3,"past_key_values"),Q3.forEach(t),GF=n(re,"). Set to "),Pu=r(re,"CODE",{});var V3=a(Pu);XF=n(V3,"False"),V3.forEach(t),YF=n(re," during training, "),ju=r(re,"CODE",{});var J3=a(ju);ZF=n(J3,"True"),J3.forEach(t),eB=n(re,` during generation
labels (`),qu=r(re,"CODE",{});var G3=a(qu);tB=n(G3,"tf.Tensor"),G3.forEach(t),oB=n(re," or "),Cu=r(re,"CODE",{});var X3=a(Cu);nB=n(X3,"np.ndarray"),X3.forEach(t),sB=n(re," of shape "),Nu=r(re,"CODE",{});var Y3=a(Nu);rB=n(Y3,"(batch_size, sequence_length)"),Y3.forEach(t),aB=n(re,", "),Ou=r(re,"EM",{});var Z3=a(Ou);iB=n(Z3,"optional"),Z3.forEach(t),lB=n(re,`):
Labels for computing the cross entropy classification loss. Indices should be in `),Au=r(re,"CODE",{});var eC=a(Au);dB=n(eC,"[0, ..., config.vocab_size - 1]"),eC.forEach(t),cB=n(re,"."),re.forEach(t),pB=p(ln),v(qr.$$.fragment,ln),ln.forEach(t),Ky.forEach(t),yk=p(i),Gn=r(i,"H2",{class:!0});var Jy=a(Gn);Cr=r(Jy,"A",{id:!0,class:!0,href:!0});var tC=a(Cr);Iu=r(tC,"SPAN",{});var oC=a(Iu);v(id.$$.fragment,oC),oC.forEach(t),tC.forEach(t),hB=p(Jy),Lu=r(Jy,"SPAN",{});var nC=a(Lu);fB=n(nC,"TFBertForMaskedLM"),nC.forEach(t),Jy.forEach(t),Tk=p(i),_t=r(i,"DIV",{class:!0});var xo=a(_t);v(ld.$$.fragment,xo),mB=p(xo),dd=r(xo,"P",{});var Gy=a(dd);uB=n(Gy,"Bert Model with a "),Du=r(Gy,"CODE",{});var sC=a(Du);gB=n(sC,"language modeling"),sC.forEach(t),_B=n(Gy," head on top."),Gy.forEach(t),bB=p(xo),cd=r(xo,"P",{});var Xy=a(cd);kB=n(Xy,"This model inherits from "),vh=r(Xy,"A",{href:!0});var rC=a(vh);yB=n(rC,"TFPreTrainedModel"),rC.forEach(t),TB=n(Xy,`. 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.)`),Xy.forEach(t),vB=p(xo),pd=r(xo,"P",{});var Yy=a(pd);wB=n(Yy,"This model is also a "),hd=r(Yy,"A",{href:!0,rel:!0});var aC=a(hd);$B=n(aC,"tf.keras.Model"),aC.forEach(t),xB=n(Yy,` 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.`),Yy.forEach(t),FB=p(xo),v(Nr.$$.fragment,xo),BB=p(xo),Lt=r(xo,"DIV",{class:!0});var dn=a(Lt);v(fd.$$.fragment,dn),EB=p(dn),Xn=r(dn,"P",{});var mf=a(Xn);zB=n(mf,"The "),wh=r(mf,"A",{href:!0});var iC=a(wh);MB=n(iC,"TFBertForMaskedLM"),iC.forEach(t),PB=n(mf," forward method, overrides the "),Su=r(mf,"CODE",{});var lC=a(Su);jB=n(lC,"__call__"),lC.forEach(t),qB=n(mf," special method."),mf.forEach(t),CB=p(dn),v(Or.$$.fragment,dn),NB=p(dn),v(Ar.$$.fragment,dn),OB=p(dn),v(Ir.$$.fragment,dn),dn.forEach(t),xo.forEach(t),vk=p(i),Yn=r(i,"H2",{class:!0});var Zy=a(Yn);Lr=r(Zy,"A",{id:!0,class:!0,href:!0});var dC=a(Lr);Uu=r(dC,"SPAN",{});var cC=a(Uu);v(md.$$.fragment,cC),cC.forEach(t),dC.forEach(t),AB=p(Zy),Wu=r(Zy,"SPAN",{});var pC=a(Wu);IB=n(pC,"TFBertForNextSentencePrediction"),pC.forEach(t),Zy.forEach(t),wk=p(i),bt=r(i,"DIV",{class:!0});var Fo=a(bt);v(ud.$$.fragment,Fo),LB=p(Fo),gd=r(Fo,"P",{});var eT=a(gd);DB=n(eT,"Bert Model with a "),Hu=r(eT,"CODE",{});var hC=a(Hu);SB=n(hC,"next sentence prediction (classification)"),hC.forEach(t),UB=n(eT," head on top."),eT.forEach(t),WB=p(Fo),_d=r(Fo,"P",{});var tT=a(_d);HB=n(tT,"This model inherits from "),$h=r(tT,"A",{href:!0});var fC=a($h);KB=n(fC,"TFPreTrainedModel"),fC.forEach(t),RB=n(tT,`. 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.)`),tT.forEach(t),QB=p(Fo),bd=r(Fo,"P",{});var oT=a(bd);VB=n(oT,"This model is also a "),kd=r(oT,"A",{href:!0,rel:!0});var mC=a(kd);JB=n(mC,"tf.keras.Model"),mC.forEach(t),GB=n(oT,` 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.`),oT.forEach(t),XB=p(Fo),v(Dr.$$.fragment,Fo),YB=p(Fo),ho=r(Fo,"DIV",{class:!0});var Ua=a(ho);v(yd.$$.fragment,Ua),ZB=p(Ua),Zn=r(Ua,"P",{});var uf=a(Zn);e9=n(uf,"The "),xh=r(uf,"A",{href:!0});var uC=a(xh);t9=n(uC,"TFBertForNextSentencePrediction"),uC.forEach(t),o9=n(uf," forward method, overrides the "),Ku=r(uf,"CODE",{});var gC=a(Ku);n9=n(gC,"__call__"),gC.forEach(t),s9=n(uf," special method."),uf.forEach(t),r9=p(Ua),v(Sr.$$.fragment,Ua),a9=p(Ua),v(Ur.$$.fragment,Ua),Ua.forEach(t),Fo.forEach(t),$k=p(i),es=r(i,"H2",{class:!0});var nT=a(es);Wr=r(nT,"A",{id:!0,class:!0,href:!0});var _C=a(Wr);Ru=r(_C,"SPAN",{});var bC=a(Ru);v(Td.$$.fragment,bC),bC.forEach(t),_C.forEach(t),i9=p(nT),Qu=r(nT,"SPAN",{});var kC=a(Qu);l9=n(kC,"TFBertForSequenceClassification"),kC.forEach(t),nT.forEach(t),xk=p(i),kt=r(i,"DIV",{class:!0});var Bo=a(kt);v(vd.$$.fragment,Bo),d9=p(Bo),Vu=r(Bo,"P",{});var yC=a(Vu);c9=n(yC,`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.`),yC.forEach(t),p9=p(Bo),wd=r(Bo,"P",{});var sT=a(wd);h9=n(sT,"This model inherits from "),Fh=r(sT,"A",{href:!0});var TC=a(Fh);f9=n(TC,"TFPreTrainedModel"),TC.forEach(t),m9=n(sT,`. 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.)`),sT.forEach(t),u9=p(Bo),$d=r(Bo,"P",{});var rT=a($d);g9=n(rT,"This model is also a "),xd=r(rT,"A",{href:!0,rel:!0});var vC=a(xd);_9=n(vC,"tf.keras.Model"),vC.forEach(t),b9=n(rT,` 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.`),rT.forEach(t),k9=p(Bo),v(Hr.$$.fragment,Bo),y9=p(Bo),Dt=r(Bo,"DIV",{class:!0});var cn=a(Dt);v(Fd.$$.fragment,cn),T9=p(cn),ts=r(cn,"P",{});var gf=a(ts);v9=n(gf,"The "),Bh=r(gf,"A",{href:!0});var wC=a(Bh);w9=n(wC,"TFBertForSequenceClassification"),wC.forEach(t),$9=n(gf," forward method, overrides the "),Ju=r(gf,"CODE",{});var $C=a(Ju);x9=n($C,"__call__"),$C.forEach(t),F9=n(gf," special method."),gf.forEach(t),B9=p(cn),v(Kr.$$.fragment,cn),E9=p(cn),v(Rr.$$.fragment,cn),z9=p(cn),v(Qr.$$.fragment,cn),cn.forEach(t),Bo.forEach(t),Fk=p(i),os=r(i,"H2",{class:!0});var aT=a(os);Vr=r(aT,"A",{id:!0,class:!0,href:!0});var xC=a(Vr);Gu=r(xC,"SPAN",{});var FC=a(Gu);v(Bd.$$.fragment,FC),FC.forEach(t),xC.forEach(t),M9=p(aT),Xu=r(aT,"SPAN",{});var BC=a(Xu);P9=n(BC,"TFBertForMultipleChoice"),BC.forEach(t),aT.forEach(t),Bk=p(i),yt=r(i,"DIV",{class:!0});var Eo=a(yt);v(Ed.$$.fragment,Eo),j9=p(Eo),Yu=r(Eo,"P",{});var EC=a(Yu);q9=n(EC,`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.`),EC.forEach(t),C9=p(Eo),zd=r(Eo,"P",{});var iT=a(zd);N9=n(iT,"This model inherits from "),Eh=r(iT,"A",{href:!0});var zC=a(Eh);O9=n(zC,"TFPreTrainedModel"),zC.forEach(t),A9=n(iT,`. 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.)`),iT.forEach(t),I9=p(Eo),Md=r(Eo,"P",{});var lT=a(Md);L9=n(lT,"This model is also a "),Pd=r(lT,"A",{href:!0,rel:!0});var MC=a(Pd);D9=n(MC,"tf.keras.Model"),MC.forEach(t),S9=n(lT,` 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.`),lT.forEach(t),U9=p(Eo),v(Jr.$$.fragment,Eo),W9=p(Eo),fo=r(Eo,"DIV",{class:!0});var Wa=a(fo);v(jd.$$.fragment,Wa),H9=p(Wa),ns=r(Wa,"P",{});var _f=a(ns);K9=n(_f,"The "),zh=r(_f,"A",{href:!0});var PC=a(zh);R9=n(PC,"TFBertForMultipleChoice"),PC.forEach(t),Q9=n(_f," forward method, overrides the "),Zu=r(_f,"CODE",{});var jC=a(Zu);V9=n(jC,"__call__"),jC.forEach(t),J9=n(_f," special method."),_f.forEach(t),G9=p(Wa),v(Gr.$$.fragment,Wa),X9=p(Wa),v(Xr.$$.fragment,Wa),Wa.forEach(t),Eo.forEach(t),Ek=p(i),ss=r(i,"H2",{class:!0});var dT=a(ss);Yr=r(dT,"A",{id:!0,class:!0,href:!0});var qC=a(Yr);eg=r(qC,"SPAN",{});var CC=a(eg);v(qd.$$.fragment,CC),CC.forEach(t),qC.forEach(t),Y9=p(dT),tg=r(dT,"SPAN",{});var NC=a(tg);Z9=n(NC,"TFBertForTokenClassification"),NC.forEach(t),dT.forEach(t),zk=p(i),Tt=r(i,"DIV",{class:!0});var zo=a(Tt);v(Cd.$$.fragment,zo),eE=p(zo),og=r(zo,"P",{});var OC=a(og);tE=n(OC,`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.`),OC.forEach(t),oE=p(zo),Nd=r(zo,"P",{});var cT=a(Nd);nE=n(cT,"This model inherits from "),Mh=r(cT,"A",{href:!0});var AC=a(Mh);sE=n(AC,"TFPreTrainedModel"),AC.forEach(t),rE=n(cT,`. 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.)`),cT.forEach(t),aE=p(zo),Od=r(zo,"P",{});var pT=a(Od);iE=n(pT,"This model is also a "),Ad=r(pT,"A",{href:!0,rel:!0});var IC=a(Ad);lE=n(IC,"tf.keras.Model"),IC.forEach(t),dE=n(pT,` 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.`),pT.forEach(t),cE=p(zo),v(Zr.$$.fragment,zo),pE=p(zo),St=r(zo,"DIV",{class:!0});var pn=a(St);v(Id.$$.fragment,pn),hE=p(pn),rs=r(pn,"P",{});var bf=a(rs);fE=n(bf,"The "),Ph=r(bf,"A",{href:!0});var LC=a(Ph);mE=n(LC,"TFBertForTokenClassification"),LC.forEach(t),uE=n(bf," forward method, overrides the "),ng=r(bf,"CODE",{});var DC=a(ng);gE=n(DC,"__call__"),DC.forEach(t),_E=n(bf," special method."),bf.forEach(t),bE=p(pn),v(ea.$$.fragment,pn),kE=p(pn),v(ta.$$.fragment,pn),yE=p(pn),v(oa.$$.fragment,pn),pn.forEach(t),zo.forEach(t),Mk=p(i),as=r(i,"H2",{class:!0});var hT=a(as);na=r(hT,"A",{id:!0,class:!0,href:!0});var SC=a(na);sg=r(SC,"SPAN",{});var UC=a(sg);v(Ld.$$.fragment,UC),UC.forEach(t),SC.forEach(t),TE=p(hT),rg=r(hT,"SPAN",{});var WC=a(rg);vE=n(WC,"TFBertForQuestionAnswering"),WC.forEach(t),hT.forEach(t),Pk=p(i),vt=r(i,"DIV",{class:!0});var Mo=a(vt);v(Dd.$$.fragment,Mo),wE=p(Mo),is=r(Mo,"P",{});var kf=a(is);$E=n(kf,`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 `),ag=r(kf,"CODE",{});var HC=a(ag);xE=n(HC,"span start logits"),HC.forEach(t),FE=n(kf," and "),ig=r(kf,"CODE",{});var KC=a(ig);BE=n(KC,"span end logits"),KC.forEach(t),EE=n(kf,")."),kf.forEach(t),zE=p(Mo),Sd=r(Mo,"P",{});var fT=a(Sd);ME=n(fT,"This model inherits from "),jh=r(fT,"A",{href:!0});var RC=a(jh);PE=n(RC,"TFPreTrainedModel"),RC.forEach(t),jE=n(fT,`. 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.)`),fT.forEach(t),qE=p(Mo),Ud=r(Mo,"P",{});var mT=a(Ud);CE=n(mT,"This model is also a "),Wd=r(mT,"A",{href:!0,rel:!0});var QC=a(Wd);NE=n(QC,"tf.keras.Model"),QC.forEach(t),OE=n(mT,` 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.`),mT.forEach(t),AE=p(Mo),v(sa.$$.fragment,Mo),IE=p(Mo),Ut=r(Mo,"DIV",{class:!0});var hn=a(Ut);v(Hd.$$.fragment,hn),LE=p(hn),ls=r(hn,"P",{});var yf=a(ls);DE=n(yf,"The "),qh=r(yf,"A",{href:!0});var VC=a(qh);SE=n(VC,"TFBertForQuestionAnswering"),VC.forEach(t),UE=n(yf," forward method, overrides the "),lg=r(yf,"CODE",{});var JC=a(lg);WE=n(JC,"__call__"),JC.forEach(t),HE=n(yf," special method."),yf.forEach(t),KE=p(hn),v(ra.$$.fragment,hn),RE=p(hn),v(aa.$$.fragment,hn),QE=p(hn),v(ia.$$.fragment,hn),hn.forEach(t),Mo.forEach(t),jk=p(i),ds=r(i,"H2",{class:!0});var uT=a(ds);la=r(uT,"A",{id:!0,class:!0,href:!0});var GC=a(la);dg=r(GC,"SPAN",{});var XC=a(dg);v(Kd.$$.fragment,XC),XC.forEach(t),GC.forEach(t),VE=p(uT),cg=r(uT,"SPAN",{});var YC=a(cg);JE=n(YC,"FlaxBertModel"),YC.forEach(t),uT.forEach(t),qk=p(i),st=r(i,"DIV",{class:!0});var Rt=a(st);v(Rd.$$.fragment,Rt),GE=p(Rt),pg=r(Rt,"P",{});var ZC=a(pg);XE=n(ZC,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),ZC.forEach(t),YE=p(Rt),Qd=r(Rt,"P",{});var gT=a(Qd);ZE=n(gT,"This model inherits from "),Ch=r(gT,"A",{href:!0});var e5=a(Ch);ez=n(e5,"FlaxPreTrainedModel"),e5.forEach(t),tz=n(gT,`. 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)`),gT.forEach(t),oz=p(Rt),Vd=r(Rt,"P",{});var _T=a(Vd);nz=n(_T,"This model is also a Flax Linen "),Jd=r(_T,"A",{href:!0,rel:!0});var t5=a(Jd);sz=n(t5,"flax.linen.Module"),t5.forEach(t),rz=n(_T,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),_T.forEach(t),az=p(Rt),hg=r(Rt,"P",{});var o5=a(hg);iz=n(o5,"Finally, this model supports inherent JAX features such as:"),o5.forEach(t),lz=p(Rt),jo=r(Rt,"UL",{});var Ha=a(jo);fg=r(Ha,"LI",{});var n5=a(fg);Gd=r(n5,"A",{href:!0,rel:!0});var s5=a(Gd);dz=n(s5,"Just-In-Time (JIT) compilation"),s5.forEach(t),n5.forEach(t),cz=p(Ha),mg=r(Ha,"LI",{});var r5=a(mg);Xd=r(r5,"A",{href:!0,rel:!0});var a5=a(Xd);pz=n(a5,"Automatic Differentiation"),a5.forEach(t),r5.forEach(t),hz=p(Ha),ug=r(Ha,"LI",{});var i5=a(ug);Yd=r(i5,"A",{href:!0,rel:!0});var l5=a(Yd);fz=n(l5,"Vectorization"),l5.forEach(t),i5.forEach(t),mz=p(Ha),gg=r(Ha,"LI",{});var d5=a(gg);Zd=r(d5,"A",{href:!0,rel:!0});var c5=a(Zd);uz=n(c5,"Parallelization"),c5.forEach(t),d5.forEach(t),Ha.forEach(t),gz=p(Rt),mo=r(Rt,"DIV",{class:!0});var Ka=a(mo);v(ec.$$.fragment,Ka),_z=p(Ka),cs=r(Ka,"P",{});var Tf=a(cs);bz=n(Tf,"The "),_g=r(Tf,"CODE",{});var p5=a(_g);kz=n(p5,"FlaxBertPreTrainedModel"),p5.forEach(t),yz=n(Tf," forward method, overrides the "),bg=r(Tf,"CODE",{});var h5=a(bg);Tz=n(h5,"__call__"),h5.forEach(t),vz=n(Tf," special method."),Tf.forEach(t),wz=p(Ka),v(da.$$.fragment,Ka),$z=p(Ka),v(ca.$$.fragment,Ka),Ka.forEach(t),Rt.forEach(t),Ck=p(i),ps=r(i,"H2",{class:!0});var bT=a(ps);pa=r(bT,"A",{id:!0,class:!0,href:!0});var f5=a(pa);kg=r(f5,"SPAN",{});var m5=a(kg);v(tc.$$.fragment,m5),m5.forEach(t),f5.forEach(t),xz=p(bT),yg=r(bT,"SPAN",{});var u5=a(yg);Fz=n(u5,"FlaxBertForPreTraining"),u5.forEach(t),bT.forEach(t),Nk=p(i),rt=r(i,"DIV",{class:!0});var Qt=a(rt);v(oc.$$.fragment,Qt),Bz=p(Qt),hs=r(Qt,"P",{});var vf=a(hs);Ez=n(vf,"Bert Model with two heads on top as done during the pretraining: a "),Tg=r(vf,"CODE",{});var g5=a(Tg);zz=n(g5,"masked language modeling"),g5.forEach(t),Mz=n(vf," head and a "),vg=r(vf,"CODE",{});var _5=a(vg);Pz=n(_5,"next sentence prediction (classification)"),_5.forEach(t),jz=n(vf," head."),vf.forEach(t),qz=p(Qt),nc=r(Qt,"P",{});var kT=a(nc);Cz=n(kT,"This model inherits from "),Nh=r(kT,"A",{href:!0});var b5=a(Nh);Nz=n(b5,"FlaxPreTrainedModel"),b5.forEach(t),Oz=n(kT,`. 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)`),kT.forEach(t),Az=p(Qt),sc=r(Qt,"P",{});var yT=a(sc);Iz=n(yT,"This model is also a Flax Linen "),rc=r(yT,"A",{href:!0,rel:!0});var k5=a(rc);Lz=n(k5,"flax.linen.Module"),k5.forEach(t),Dz=n(yT,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),yT.forEach(t),Sz=p(Qt),wg=r(Qt,"P",{});var y5=a(wg);Uz=n(y5,"Finally, this model supports inherent JAX features such as:"),y5.forEach(t),Wz=p(Qt),qo=r(Qt,"UL",{});var Ra=a(qo);$g=r(Ra,"LI",{});var T5=a($g);ac=r(T5,"A",{href:!0,rel:!0});var v5=a(ac);Hz=n(v5,"Just-In-Time (JIT) compilation"),v5.forEach(t),T5.forEach(t),Kz=p(Ra),xg=r(Ra,"LI",{});var w5=a(xg);ic=r(w5,"A",{href:!0,rel:!0});var $5=a(ic);Rz=n($5,"Automatic Differentiation"),$5.forEach(t),w5.forEach(t),Qz=p(Ra),Fg=r(Ra,"LI",{});var x5=a(Fg);lc=r(x5,"A",{href:!0,rel:!0});var F5=a(lc);Vz=n(F5,"Vectorization"),F5.forEach(t),x5.forEach(t),Jz=p(Ra),Bg=r(Ra,"LI",{});var B5=a(Bg);dc=r(B5,"A",{href:!0,rel:!0});var E5=a(dc);Gz=n(E5,"Parallelization"),E5.forEach(t),B5.forEach(t),Ra.forEach(t),Xz=p(Qt),uo=r(Qt,"DIV",{class:!0});var Qa=a(uo);v(cc.$$.fragment,Qa),Yz=p(Qa),fs=r(Qa,"P",{});var wf=a(fs);Zz=n(wf,"The "),Eg=r(wf,"CODE",{});var z5=a(Eg);eM=n(z5,"FlaxBertPreTrainedModel"),z5.forEach(t),tM=n(wf," forward method, overrides the "),zg=r(wf,"CODE",{});var M5=a(zg);oM=n(M5,"__call__"),M5.forEach(t),nM=n(wf," special method."),wf.forEach(t),sM=p(Qa),v(ha.$$.fragment,Qa),rM=p(Qa),v(fa.$$.fragment,Qa),Qa.forEach(t),Qt.forEach(t),Ok=p(i),ms=r(i,"H2",{class:!0});var TT=a(ms);ma=r(TT,"A",{id:!0,class:!0,href:!0});var P5=a(ma);Mg=r(P5,"SPAN",{});var j5=a(Mg);v(pc.$$.fragment,j5),j5.forEach(t),P5.forEach(t),aM=p(TT),Pg=r(TT,"SPAN",{});var q5=a(Pg);iM=n(q5,"FlaxBertForCausalLM"),q5.forEach(t),TT.forEach(t),Ak=p(i),at=r(i,"DIV",{class:!0});var Vt=a(at);v(hc.$$.fragment,Vt),lM=p(Vt),jg=r(Vt,"P",{});var C5=a(jg);dM=n(C5,`Bert Model with a language modeling head on top (a linear layer on top of the hidden-states output) e.g for
autoregressive tasks.`),C5.forEach(t),cM=p(Vt),fc=r(Vt,"P",{});var vT=a(fc);pM=n(vT,"This model inherits from "),Oh=r(vT,"A",{href:!0});var N5=a(Oh);hM=n(N5,"FlaxPreTrainedModel"),N5.forEach(t),fM=n(vT,`. 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)`),vT.forEach(t),mM=p(Vt),mc=r(Vt,"P",{});var wT=a(mc);uM=n(wT,"This model is also a Flax Linen "),uc=r(wT,"A",{href:!0,rel:!0});var O5=a(uc);gM=n(O5,"flax.linen.Module"),O5.forEach(t),_M=n(wT,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),wT.forEach(t),bM=p(Vt),qg=r(Vt,"P",{});var A5=a(qg);kM=n(A5,"Finally, this model supports inherent JAX features such as:"),A5.forEach(t),yM=p(Vt),Co=r(Vt,"UL",{});var Va=a(Co);Cg=r(Va,"LI",{});var I5=a(Cg);gc=r(I5,"A",{href:!0,rel:!0});var L5=a(gc);TM=n(L5,"Just-In-Time (JIT) compilation"),L5.forEach(t),I5.forEach(t),vM=p(Va),Ng=r(Va,"LI",{});var D5=a(Ng);_c=r(D5,"A",{href:!0,rel:!0});var S5=a(_c);wM=n(S5,"Automatic Differentiation"),S5.forEach(t),D5.forEach(t),$M=p(Va),Og=r(Va,"LI",{});var U5=a(Og);bc=r(U5,"A",{href:!0,rel:!0});var W5=a(bc);xM=n(W5,"Vectorization"),W5.forEach(t),U5.forEach(t),FM=p(Va),Ag=r(Va,"LI",{});var H5=a(Ag);kc=r(H5,"A",{href:!0,rel:!0});var K5=a(kc);BM=n(K5,"Parallelization"),K5.forEach(t),H5.forEach(t),Va.forEach(t),EM=p(Vt),go=r(Vt,"DIV",{class:!0});var Ja=a(go);v(yc.$$.fragment,Ja),zM=p(Ja),us=r(Ja,"P",{});var $f=a(us);MM=n($f,"The "),Ig=r($f,"CODE",{});var R5=a(Ig);PM=n(R5,"FlaxBertPreTrainedModel"),R5.forEach(t),jM=n($f," forward method, overrides the "),Lg=r($f,"CODE",{});var Q5=a(Lg);qM=n(Q5,"__call__"),Q5.forEach(t),CM=n($f," special method."),$f.forEach(t),NM=p(Ja),v(ua.$$.fragment,Ja),OM=p(Ja),v(ga.$$.fragment,Ja),Ja.forEach(t),Vt.forEach(t),Ik=p(i),gs=r(i,"H2",{class:!0});var $T=a(gs);_a=r($T,"A",{id:!0,class:!0,href:!0});var V5=a(_a);Dg=r(V5,"SPAN",{});var J5=a(Dg);v(Tc.$$.fragment,J5),J5.forEach(t),V5.forEach(t),AM=p($T),Sg=r($T,"SPAN",{});var G5=a(Sg);IM=n(G5,"FlaxBertForMaskedLM"),G5.forEach(t),$T.forEach(t),Lk=p(i),it=r(i,"DIV",{class:!0});var Jt=a(it);v(vc.$$.fragment,Jt),LM=p(Jt),wc=r(Jt,"P",{});var xT=a(wc);DM=n(xT,"Bert Model with a "),Ug=r(xT,"CODE",{});var X5=a(Ug);SM=n(X5,"language modeling"),X5.forEach(t),UM=n(xT," head on top."),xT.forEach(t),WM=p(Jt),$c=r(Jt,"P",{});var FT=a($c);HM=n(FT,"This model inherits from "),Ah=r(FT,"A",{href:!0});var Y5=a(Ah);KM=n(Y5,"FlaxPreTrainedModel"),Y5.forEach(t),RM=n(FT,`. 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)`),FT.forEach(t),QM=p(Jt),xc=r(Jt,"P",{});var BT=a(xc);VM=n(BT,"This model is also a Flax Linen "),Fc=r(BT,"A",{href:!0,rel:!0});var Z5=a(Fc);JM=n(Z5,"flax.linen.Module"),Z5.forEach(t),GM=n(BT,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),BT.forEach(t),XM=p(Jt),Wg=r(Jt,"P",{});var e6=a(Wg);YM=n(e6,"Finally, this model supports inherent JAX features such as:"),e6.forEach(t),ZM=p(Jt),No=r(Jt,"UL",{});var Ga=a(No);Hg=r(Ga,"LI",{});var t6=a(Hg);Bc=r(t6,"A",{href:!0,rel:!0});var o6=a(Bc);e4=n(o6,"Just-In-Time (JIT) compilation"),o6.forEach(t),t6.forEach(t),t4=p(Ga),Kg=r(Ga,"LI",{});var n6=a(Kg);Ec=r(n6,"A",{href:!0,rel:!0});var s6=a(Ec);o4=n(s6,"Automatic Differentiation"),s6.forEach(t),n6.forEach(t),n4=p(Ga),Rg=r(Ga,"LI",{});var r6=a(Rg);zc=r(r6,"A",{href:!0,rel:!0});var a6=a(zc);s4=n(a6,"Vectorization"),a6.forEach(t),r6.forEach(t),r4=p(Ga),Qg=r(Ga,"LI",{});var i6=a(Qg);Mc=r(i6,"A",{href:!0,rel:!0});var l6=a(Mc);a4=n(l6,"Parallelization"),l6.forEach(t),i6.forEach(t),Ga.forEach(t),i4=p(Jt),_o=r(Jt,"DIV",{class:!0});var Xa=a(_o);v(Pc.$$.fragment,Xa),l4=p(Xa),_s=r(Xa,"P",{});var xf=a(_s);d4=n(xf,"The "),Vg=r(xf,"CODE",{});var d6=a(Vg);c4=n(d6,"FlaxBertPreTrainedModel"),d6.forEach(t),p4=n(xf," forward method, overrides the "),Jg=r(xf,"CODE",{});var c6=a(Jg);h4=n(c6,"__call__"),c6.forEach(t),f4=n(xf," special method."),xf.forEach(t),m4=p(Xa),v(ba.$$.fragment,Xa),u4=p(Xa),v(ka.$$.fragment,Xa),Xa.forEach(t),Jt.forEach(t),Dk=p(i),bs=r(i,"H2",{class:!0});var ET=a(bs);ya=r(ET,"A",{id:!0,class:!0,href:!0});var p6=a(ya);Gg=r(p6,"SPAN",{});var h6=a(Gg);v(jc.$$.fragment,h6),h6.forEach(t),p6.forEach(t),g4=p(ET),Xg=r(ET,"SPAN",{});var f6=a(Xg);_4=n(f6,"FlaxBertForNextSentencePrediction"),f6.forEach(t),ET.forEach(t),Sk=p(i),lt=r(i,"DIV",{class:!0});var Gt=a(lt);v(qc.$$.fragment,Gt),b4=p(Gt),Cc=r(Gt,"P",{});var zT=a(Cc);k4=n(zT,"Bert Model with a "),Yg=r(zT,"CODE",{});var m6=a(Yg);y4=n(m6,"next sentence prediction (classification)"),m6.forEach(t),T4=n(zT," head on top."),zT.forEach(t),v4=p(Gt),Nc=r(Gt,"P",{});var MT=a(Nc);w4=n(MT,"This model inherits from "),Ih=r(MT,"A",{href:!0});var u6=a(Ih);$4=n(u6,"FlaxPreTrainedModel"),u6.forEach(t),x4=n(MT,`. 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)`),MT.forEach(t),F4=p(Gt),Oc=r(Gt,"P",{});var PT=a(Oc);B4=n(PT,"This model is also a Flax Linen "),Ac=r(PT,"A",{href:!0,rel:!0});var g6=a(Ac);E4=n(g6,"flax.linen.Module"),g6.forEach(t),z4=n(PT,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),PT.forEach(t),M4=p(Gt),Zg=r(Gt,"P",{});var _6=a(Zg);P4=n(_6,"Finally, this model supports inherent JAX features such as:"),_6.forEach(t),j4=p(Gt),Oo=r(Gt,"UL",{});var Ya=a(Oo);e_=r(Ya,"LI",{});var b6=a(e_);Ic=r(b6,"A",{href:!0,rel:!0});var k6=a(Ic);q4=n(k6,"Just-In-Time (JIT) compilation"),k6.forEach(t),b6.forEach(t),C4=p(Ya),t_=r(Ya,"LI",{});var y6=a(t_);Lc=r(y6,"A",{href:!0,rel:!0});var T6=a(Lc);N4=n(T6,"Automatic Differentiation"),T6.forEach(t),y6.forEach(t),O4=p(Ya),o_=r(Ya,"LI",{});var v6=a(o_);Dc=r(v6,"A",{href:!0,rel:!0});var w6=a(Dc);A4=n(w6,"Vectorization"),w6.forEach(t),v6.forEach(t),I4=p(Ya),n_=r(Ya,"LI",{});var $6=a(n_);Sc=r($6,"A",{href:!0,rel:!0});var x6=a(Sc);L4=n(x6,"Parallelization"),x6.forEach(t),$6.forEach(t),Ya.forEach(t),D4=p(Gt),bo=r(Gt,"DIV",{class:!0});var Za=a(bo);v(Uc.$$.fragment,Za),S4=p(Za),ks=r(Za,"P",{});var Ff=a(ks);U4=n(Ff,"The "),s_=r(Ff,"CODE",{});var F6=a(s_);W4=n(F6,"FlaxBertPreTrainedModel"),F6.forEach(t),H4=n(Ff," forward method, overrides the "),r_=r(Ff,"CODE",{});var B6=a(r_);K4=n(B6,"__call__"),B6.forEach(t),R4=n(Ff," special method."),Ff.forEach(t),Q4=p(Za),v(Ta.$$.fragment,Za),V4=p(Za),v(va.$$.fragment,Za),Za.forEach(t),Gt.forEach(t),Uk=p(i),ys=r(i,"H2",{class:!0});var jT=a(ys);wa=r(jT,"A",{id:!0,class:!0,href:!0});var E6=a(wa);a_=r(E6,"SPAN",{});var z6=a(a_);v(Wc.$$.fragment,z6),z6.forEach(t),E6.forEach(t),J4=p(jT),i_=r(jT,"SPAN",{});var M6=a(i_);G4=n(M6,"FlaxBertForSequenceClassification"),M6.forEach(t),jT.forEach(t),Wk=p(i),dt=r(i,"DIV",{class:!0});var Xt=a(dt);v(Hc.$$.fragment,Xt),X4=p(Xt),l_=r(Xt,"P",{});var P6=a(l_);Y4=n(P6,`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.`),P6.forEach(t),Z4=p(Xt),Kc=r(Xt,"P",{});var qT=a(Kc);eP=n(qT,"This model inherits from "),Lh=r(qT,"A",{href:!0});var j6=a(Lh);tP=n(j6,"FlaxPreTrainedModel"),j6.forEach(t),oP=n(qT,`. 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)`),qT.forEach(t),nP=p(Xt),Rc=r(Xt,"P",{});var CT=a(Rc);sP=n(CT,"This model is also a Flax Linen "),Qc=r(CT,"A",{href:!0,rel:!0});var q6=a(Qc);rP=n(q6,"flax.linen.Module"),q6.forEach(t),aP=n(CT,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),CT.forEach(t),iP=p(Xt),d_=r(Xt,"P",{});var C6=a(d_);lP=n(C6,"Finally, this model supports inherent JAX features such as:"),C6.forEach(t),dP=p(Xt),Ao=r(Xt,"UL",{});var ei=a(Ao);c_=r(ei,"LI",{});var N6=a(c_);Vc=r(N6,"A",{href:!0,rel:!0});var O6=a(Vc);cP=n(O6,"Just-In-Time (JIT) compilation"),O6.forEach(t),N6.forEach(t),pP=p(ei),p_=r(ei,"LI",{});var A6=a(p_);Jc=r(A6,"A",{href:!0,rel:!0});var I6=a(Jc);hP=n(I6,"Automatic Differentiation"),I6.forEach(t),A6.forEach(t),fP=p(ei),h_=r(ei,"LI",{});var L6=a(h_);Gc=r(L6,"A",{href:!0,rel:!0});var D6=a(Gc);mP=n(D6,"Vectorization"),D6.forEach(t),L6.forEach(t),uP=p(ei),f_=r(ei,"LI",{});var S6=a(f_);Xc=r(S6,"A",{href:!0,rel:!0});var U6=a(Xc);gP=n(U6,"Parallelization"),U6.forEach(t),S6.forEach(t),ei.forEach(t),_P=p(Xt),ko=r(Xt,"DIV",{class:!0});var ti=a(ko);v(Yc.$$.fragment,ti),bP=p(ti),Ts=r(ti,"P",{});var Bf=a(Ts);kP=n(Bf,"The "),m_=r(Bf,"CODE",{});var W6=a(m_);yP=n(W6,"FlaxBertPreTrainedModel"),W6.forEach(t),TP=n(Bf," forward method, overrides the "),u_=r(Bf,"CODE",{});var H6=a(u_);vP=n(H6,"__call__"),H6.forEach(t),wP=n(Bf," special method."),Bf.forEach(t),$P=p(ti),v($a.$$.fragment,ti),xP=p(ti),v(xa.$$.fragment,ti),ti.forEach(t),Xt.forEach(t),Hk=p(i),vs=r(i,"H2",{class:!0});var NT=a(vs);Fa=r(NT,"A",{id:!0,class:!0,href:!0});var K6=a(Fa);g_=r(K6,"SPAN",{});var R6=a(g_);v(Zc.$$.fragment,R6),R6.forEach(t),K6.forEach(t),FP=p(NT),__=r(NT,"SPAN",{});var Q6=a(__);BP=n(Q6,"FlaxBertForMultipleChoice"),Q6.forEach(t),NT.forEach(t),Kk=p(i),ct=r(i,"DIV",{class:!0});var Yt=a(ct);v(ep.$$.fragment,Yt),EP=p(Yt),b_=r(Yt,"P",{});var V6=a(b_);zP=n(V6,`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.`),V6.forEach(t),MP=p(Yt),tp=r(Yt,"P",{});var OT=a(tp);PP=n(OT,"This model inherits from "),Dh=r(OT,"A",{href:!0});var J6=a(Dh);jP=n(J6,"FlaxPreTrainedModel"),J6.forEach(t),qP=n(OT,`. 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)`),OT.forEach(t),CP=p(Yt),op=r(Yt,"P",{});var AT=a(op);NP=n(AT,"This model is also a Flax Linen "),np=r(AT,"A",{href:!0,rel:!0});var G6=a(np);OP=n(G6,"flax.linen.Module"),G6.forEach(t),AP=n(AT,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),AT.forEach(t),IP=p(Yt),k_=r(Yt,"P",{});var X6=a(k_);LP=n(X6,"Finally, this model supports inherent JAX features such as:"),X6.forEach(t),DP=p(Yt),Io=r(Yt,"UL",{});var oi=a(Io);y_=r(oi,"LI",{});var Y6=a(y_);sp=r(Y6,"A",{href:!0,rel:!0});var Z6=a(sp);SP=n(Z6,"Just-In-Time (JIT) compilation"),Z6.forEach(t),Y6.forEach(t),UP=p(oi),T_=r(oi,"LI",{});var eN=a(T_);rp=r(eN,"A",{href:!0,rel:!0});var tN=a(rp);WP=n(tN,"Automatic Differentiation"),tN.forEach(t),eN.forEach(t),HP=p(oi),v_=r(oi,"LI",{});var oN=a(v_);ap=r(oN,"A",{href:!0,rel:!0});var nN=a(ap);KP=n(nN,"Vectorization"),nN.forEach(t),oN.forEach(t),RP=p(oi),w_=r(oi,"LI",{});var sN=a(w_);ip=r(sN,"A",{href:!0,rel:!0});var rN=a(ip);QP=n(rN,"Parallelization"),rN.forEach(t),sN.forEach(t),oi.forEach(t),VP=p(Yt),yo=r(Yt,"DIV",{class:!0});var ni=a(yo);v(lp.$$.fragment,ni),JP=p(ni),ws=r(ni,"P",{});var Ef=a(ws);GP=n(Ef,"The "),$_=r(Ef,"CODE",{});var aN=a($_);XP=n(aN,"FlaxBertPreTrainedModel"),aN.forEach(t),YP=n(Ef," forward method, overrides the "),x_=r(Ef,"CODE",{});var iN=a(x_);ZP=n(iN,"__call__"),iN.forEach(t),ej=n(Ef," special method."),Ef.forEach(t),tj=p(ni),v(Ba.$$.fragment,ni),oj=p(ni),v(Ea.$$.fragment,ni),ni.forEach(t),Yt.forEach(t),Rk=p(i),$s=r(i,"H2",{class:!0});var IT=a($s);za=r(IT,"A",{id:!0,class:!0,href:!0});var lN=a(za);F_=r(lN,"SPAN",{});var dN=a(F_);v(dp.$$.fragment,dN),dN.forEach(t),lN.forEach(t),nj=p(IT),B_=r(IT,"SPAN",{});var cN=a(B_);sj=n(cN,"FlaxBertForTokenClassification"),cN.forEach(t),IT.forEach(t),Qk=p(i),pt=r(i,"DIV",{class:!0});var Zt=a(pt);v(cp.$$.fragment,Zt),rj=p(Zt),E_=r(Zt,"P",{});var pN=a(E_);aj=n(pN,`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.`),pN.forEach(t),ij=p(Zt),pp=r(Zt,"P",{});var LT=a(pp);lj=n(LT,"This model inherits from "),Sh=r(LT,"A",{href:!0});var hN=a(Sh);dj=n(hN,"FlaxPreTrainedModel"),hN.forEach(t),cj=n(LT,`. 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)`),LT.forEach(t),pj=p(Zt),hp=r(Zt,"P",{});var DT=a(hp);hj=n(DT,"This model is also a Flax Linen "),fp=r(DT,"A",{href:!0,rel:!0});var fN=a(fp);fj=n(fN,"flax.linen.Module"),fN.forEach(t),mj=n(DT,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),DT.forEach(t),uj=p(Zt),z_=r(Zt,"P",{});var mN=a(z_);gj=n(mN,"Finally, this model supports inherent JAX features such as:"),mN.forEach(t),_j=p(Zt),Lo=r(Zt,"UL",{});var si=a(Lo);M_=r(si,"LI",{});var uN=a(M_);mp=r(uN,"A",{href:!0,rel:!0});var gN=a(mp);bj=n(gN,"Just-In-Time (JIT) compilation"),gN.forEach(t),uN.forEach(t),kj=p(si),P_=r(si,"LI",{});var _N=a(P_);up=r(_N,"A",{href:!0,rel:!0});var bN=a(up);yj=n(bN,"Automatic Differentiation"),bN.forEach(t),_N.forEach(t),Tj=p(si),j_=r(si,"LI",{});var kN=a(j_);gp=r(kN,"A",{href:!0,rel:!0});var yN=a(gp);vj=n(yN,"Vectorization"),yN.forEach(t),kN.forEach(t),wj=p(si),q_=r(si,"LI",{});var TN=a(q_);_p=r(TN,"A",{href:!0,rel:!0});var vN=a(_p);$j=n(vN,"Parallelization"),vN.forEach(t),TN.forEach(t),si.forEach(t),xj=p(Zt),To=r(Zt,"DIV",{class:!0});var ri=a(To);v(bp.$$.fragment,ri),Fj=p(ri),xs=r(ri,"P",{});var zf=a(xs);Bj=n(zf,"The "),C_=r(zf,"CODE",{});var wN=a(C_);Ej=n(wN,"FlaxBertPreTrainedModel"),wN.forEach(t),zj=n(zf," forward method, overrides the "),N_=r(zf,"CODE",{});var $N=a(N_);Mj=n($N,"__call__"),$N.forEach(t),Pj=n(zf," special method."),zf.forEach(t),jj=p(ri),v(Ma.$$.fragment,ri),qj=p(ri),v(Pa.$$.fragment,ri),ri.forEach(t),Zt.forEach(t),Vk=p(i),Fs=r(i,"H2",{class:!0});var ST=a(Fs);ja=r(ST,"A",{id:!0,class:!0,href:!0});var xN=a(ja);O_=r(xN,"SPAN",{});var FN=a(O_);v(kp.$$.fragment,FN),FN.forEach(t),xN.forEach(t),Cj=p(ST),A_=r(ST,"SPAN",{});var BN=a(A_);Nj=n(BN,"FlaxBertForQuestionAnswering"),BN.forEach(t),ST.forEach(t),Jk=p(i),ht=r(i,"DIV",{class:!0});var eo=a(ht);v(yp.$$.fragment,eo),Oj=p(eo),Bs=r(eo,"P",{});var Mf=a(Bs);Aj=n(Mf,`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 `),I_=r(Mf,"CODE",{});var EN=a(I_);Ij=n(EN,"span start logits"),EN.forEach(t),Lj=n(Mf," and "),L_=r(Mf,"CODE",{});var zN=a(L_);Dj=n(zN,"span end logits"),zN.forEach(t),Sj=n(Mf,")."),Mf.forEach(t),Uj=p(eo),Tp=r(eo,"P",{});var UT=a(Tp);Wj=n(UT,"This model inherits from "),Uh=r(UT,"A",{href:!0});var MN=a(Uh);Hj=n(MN,"FlaxPreTrainedModel"),MN.forEach(t),Kj=n(UT,`. 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)`),UT.forEach(t),Rj=p(eo),vp=r(eo,"P",{});var WT=a(vp);Qj=n(WT,"This model is also a Flax Linen "),wp=r(WT,"A",{href:!0,rel:!0});var PN=a(wp);Vj=n(PN,"flax.linen.Module"),PN.forEach(t),Jj=n(WT,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),WT.forEach(t),Gj=p(eo),D_=r(eo,"P",{});var jN=a(D_);Xj=n(jN,"Finally, this model supports inherent JAX features such as:"),jN.forEach(t),Yj=p(eo),Do=r(eo,"UL",{});var ai=a(Do);S_=r(ai,"LI",{});var qN=a(S_);$p=r(qN,"A",{href:!0,rel:!0});var CN=a($p);Zj=n(CN,"Just-In-Time (JIT) compilation"),CN.forEach(t),qN.forEach(t),e7=p(ai),U_=r(ai,"LI",{});var NN=a(U_);xp=r(NN,"A",{href:!0,rel:!0});var ON=a(xp);t7=n(ON,"Automatic Differentiation"),ON.forEach(t),NN.forEach(t),o7=p(ai),W_=r(ai,"LI",{});var AN=a(W_);Fp=r(AN,"A",{href:!0,rel:!0});var IN=a(Fp);n7=n(IN,"Vectorization"),IN.forEach(t),AN.forEach(t),s7=p(ai),H_=r(ai,"LI",{});var LN=a(H_);Bp=r(LN,"A",{href:!0,rel:!0});var DN=a(Bp);r7=n(DN,"Parallelization"),DN.forEach(t),LN.forEach(t),ai.forEach(t),a7=p(eo),vo=r(eo,"DIV",{class:!0});var ii=a(vo);v(Ep.$$.fragment,ii),i7=p(ii),Es=r(ii,"P",{});var Pf=a(Es);l7=n(Pf,"The "),K_=r(Pf,"CODE",{});var SN=a(K_);d7=n(SN,"FlaxBertPreTrainedModel"),SN.forEach(t),c7=n(Pf," forward method, overrides the "),R_=r(Pf,"CODE",{});var UN=a(R_);p7=n(UN,"__call__"),UN.forEach(t),h7=n(Pf," special method."),Pf.forEach(t),f7=p(ii),v(qa.$$.fragment,ii),m7=p(ii),v(Ca.$$.fragment,ii),ii.forEach(t),eo.forEach(t),this.h()},h(){u(d,"name","hf:doc:metadata"),u(d,"content",JSON.stringify(_O)),u(m,"id","bert"),u(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(m,"href","#bert"),u(f,"class","relative group"),u(pe,"id","overview"),u(pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(pe,"href","#overview"),u(S,"class","relative group"),u(fe,"href","https://arxiv.org/abs/1810.04805"),u(fe,"rel","nofollow"),u(me,"href","https://huggingface.co/thomwolf"),u(me,"rel","nofollow"),u(W,"href","https://github.com/google-research/bert"),u(W,"rel","nofollow"),u(O,"id","transformers.BertConfig"),u(O,"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"),u(O,"href","#transformers.BertConfig"),u(de,"class","relative group"),u(Ke,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.BertModel"),u(I,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.TFBertModel"),u(He,"href","https://huggingface.co/bert-base-uncased"),u(He,"rel","nofollow"),u(Z,"href","/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig"),u(Wp,"href","/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig"),u(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Ns,"id","transformers.BertTokenizer"),u(Ns,"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"),u(Ns,"href","#transformers.BertTokenizer"),u(fn,"class","relative group"),u(Hp,"href","/docs/transformers/pr_19907/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),u(Ko,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Os,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(oo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Qp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Is,"id","transformers.BertTokenizerFast"),u(Is,"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"),u(Is,"href","#transformers.BertTokenizerFast"),u(un,"class","relative group"),u(Vp,"href","/docs/transformers/pr_19907/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),u(Ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(no,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Ds,"id","transformers.TFBertTokenizer"),u(Ds,"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"),u(Ds,"href","#transformers.TFBertTokenizer"),u(_n,"class","relative group"),u(Qo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Ws,"id","transformers.models.bert.modeling_bert.BertForPreTrainingOutput"),u(Ws,"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"),u(Ws,"href","#transformers.models.bert.modeling_bert.BertForPreTrainingOutput"),u(yn,"class","relative group"),u(Xp,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.BertForPreTraining"),u(Tn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Yp,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.TFBertForPreTraining"),u(vn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Zp,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.BertForPreTraining"),u(Hs,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Po,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Ks,"id","transformers.BertModel"),u(Ks,"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"),u(Ks,"href","#transformers.BertModel"),u(wn,"class","relative group"),u(eh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel"),u(Ui,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(Ui,"rel","nofollow"),u(Hi,"href","https://arxiv.org/abs/1706.03762"),u(Hi,"rel","nofollow"),u(th,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.BertModel"),u(so,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Vs,"id","transformers.BertForPreTraining"),u(Vs,"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"),u(Vs,"href","#transformers.BertForPreTraining"),u(xn,"class","relative group"),u(oh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel"),u(Gi,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(Gi,"rel","nofollow"),u(nh,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.BertForPreTraining"),u(ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Xs,"id","transformers.BertLMHeadModel"),u(Xs,"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"),u(Xs,"href","#transformers.BertLMHeadModel"),u(En,"class","relative group"),u(sh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel"),u(nl,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(nl,"rel","nofollow"),u(rh,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.BertLMHeadModel"),u(ao,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(er,"id","transformers.BertForMaskedLM"),u(er,"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"),u(er,"href","#transformers.BertForMaskedLM"),u(Mn,"class","relative group"),u(ah,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel"),u(cl,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(cl,"rel","nofollow"),u(ih,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.BertForMaskedLM"),u(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(sr,"id","transformers.BertForNextSentencePrediction"),u(sr,"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"),u(sr,"href","#transformers.BertForNextSentencePrediction"),u(jn,"class","relative group"),u(lh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel"),u(_l,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(_l,"rel","nofollow"),u(dh,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.BertForNextSentencePrediction"),u(io,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ir,"id","transformers.BertForSequenceClassification"),u(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"),u(ir,"href","#transformers.BertForSequenceClassification"),u(Cn,"class","relative group"),u(ch,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel"),u(wl,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(wl,"rel","nofollow"),u(ph,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.BertForSequenceClassification"),u(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(fr,"id","transformers.BertForMultipleChoice"),u(fr,"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"),u(fr,"href","#transformers.BertForMultipleChoice"),u(On,"class","relative group"),u(hh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel"),u(zl,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(zl,"rel","nofollow"),u(fh,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.BertForMultipleChoice"),u(lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(gr,"id","transformers.BertForTokenClassification"),u(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"),u(gr,"href","#transformers.BertForTokenClassification"),u(In,"class","relative group"),u(mh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel"),u(Nl,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(Nl,"rel","nofollow"),u(uh,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.BertForTokenClassification"),u(Ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(yr,"id","transformers.BertForQuestionAnswering"),u(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"),u(yr,"href","#transformers.BertForQuestionAnswering"),u(Dn,"class","relative group"),u(gh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel"),u(Sl,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(Sl,"rel","nofollow"),u(_h,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.BertForQuestionAnswering"),u(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u($r,"id","transformers.TFBertModel"),u($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"),u($r,"href","#transformers.TFBertModel"),u(Wn,"class","relative group"),u(bh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),u(Ql,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),u(Ql,"rel","nofollow"),u(kh,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.TFBertModel"),u(co,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Er,"id","transformers.TFBertForPreTraining"),u(Er,"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"),u(Er,"href","#transformers.TFBertForPreTraining"),u(Kn,"class","relative group"),u(yh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),u(Zl,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),u(Zl,"rel","nofollow"),u(Th,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.TFBertForPreTraining"),u(po,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(jr,"id","transformers.TFBertLMHeadModel"),u(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"),u(jr,"href","#transformers.TFBertLMHeadModel"),u(Vn,"class","relative group"),u(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Jn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Cr,"id","transformers.TFBertForMaskedLM"),u(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"),u(Cr,"href","#transformers.TFBertForMaskedLM"),u(Gn,"class","relative group"),u(vh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),u(hd,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),u(hd,"rel","nofollow"),u(wh,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.TFBertForMaskedLM"),u(Lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Lr,"id","transformers.TFBertForNextSentencePrediction"),u(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"),u(Lr,"href","#transformers.TFBertForNextSentencePrediction"),u(Yn,"class","relative group"),u($h,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),u(kd,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),u(kd,"rel","nofollow"),u(xh,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.TFBertForNextSentencePrediction"),u(ho,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Wr,"id","transformers.TFBertForSequenceClassification"),u(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"),u(Wr,"href","#transformers.TFBertForSequenceClassification"),u(es,"class","relative group"),u(Fh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),u(xd,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),u(xd,"rel","nofollow"),u(Bh,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.TFBertForSequenceClassification"),u(Dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Vr,"id","transformers.TFBertForMultipleChoice"),u(Vr,"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"),u(Vr,"href","#transformers.TFBertForMultipleChoice"),u(os,"class","relative group"),u(Eh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),u(Pd,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),u(Pd,"rel","nofollow"),u(zh,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.TFBertForMultipleChoice"),u(fo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Yr,"id","transformers.TFBertForTokenClassification"),u(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"),u(Yr,"href","#transformers.TFBertForTokenClassification"),u(ss,"class","relative group"),u(Mh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),u(Ad,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),u(Ad,"rel","nofollow"),u(Ph,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.TFBertForTokenClassification"),u(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(na,"id","transformers.TFBertForQuestionAnswering"),u(na,"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"),u(na,"href","#transformers.TFBertForQuestionAnswering"),u(as,"class","relative group"),u(jh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),u(Wd,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),u(Wd,"rel","nofollow"),u(qh,"href","/docs/transformers/pr_19907/en/model_doc/bert#transformers.TFBertForQuestionAnswering"),u(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(la,"id","transformers.FlaxBertModel"),u(la,"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"),u(la,"href","#transformers.FlaxBertModel"),u(ds,"class","relative group"),u(Ch,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(Jd,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),u(Jd,"rel","nofollow"),u(Gd,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(Gd,"rel","nofollow"),u(Xd,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(Xd,"rel","nofollow"),u(Yd,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(Yd,"rel","nofollow"),u(Zd,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(Zd,"rel","nofollow"),u(mo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(pa,"id","transformers.FlaxBertForPreTraining"),u(pa,"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"),u(pa,"href","#transformers.FlaxBertForPreTraining"),u(ps,"class","relative group"),u(Nh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(rc,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),u(rc,"rel","nofollow"),u(ac,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(ac,"rel","nofollow"),u(ic,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(ic,"rel","nofollow"),u(lc,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(lc,"rel","nofollow"),u(dc,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(dc,"rel","nofollow"),u(uo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ma,"id","transformers.FlaxBertForCausalLM"),u(ma,"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"),u(ma,"href","#transformers.FlaxBertForCausalLM"),u(ms,"class","relative group"),u(Oh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(uc,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),u(uc,"rel","nofollow"),u(gc,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(gc,"rel","nofollow"),u(_c,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(_c,"rel","nofollow"),u(bc,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(bc,"rel","nofollow"),u(kc,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(kc,"rel","nofollow"),u(go,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(_a,"id","transformers.FlaxBertForMaskedLM"),u(_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"),u(_a,"href","#transformers.FlaxBertForMaskedLM"),u(gs,"class","relative group"),u(Ah,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(Fc,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),u(Fc,"rel","nofollow"),u(Bc,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(Bc,"rel","nofollow"),u(Ec,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(Ec,"rel","nofollow"),u(zc,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(zc,"rel","nofollow"),u(Mc,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(Mc,"rel","nofollow"),u(_o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ya,"id","transformers.FlaxBertForNextSentencePrediction"),u(ya,"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"),u(ya,"href","#transformers.FlaxBertForNextSentencePrediction"),u(bs,"class","relative group"),u(Ih,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(Ac,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),u(Ac,"rel","nofollow"),u(Ic,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(Ic,"rel","nofollow"),u(Lc,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(Lc,"rel","nofollow"),u(Dc,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(Dc,"rel","nofollow"),u(Sc,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(Sc,"rel","nofollow"),u(bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(wa,"id","transformers.FlaxBertForSequenceClassification"),u(wa,"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"),u(wa,"href","#transformers.FlaxBertForSequenceClassification"),u(ys,"class","relative group"),u(Lh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(Qc,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),u(Qc,"rel","nofollow"),u(Vc,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(Vc,"rel","nofollow"),u(Jc,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(Jc,"rel","nofollow"),u(Gc,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(Gc,"rel","nofollow"),u(Xc,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(Xc,"rel","nofollow"),u(ko,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Fa,"id","transformers.FlaxBertForMultipleChoice"),u(Fa,"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"),u(Fa,"href","#transformers.FlaxBertForMultipleChoice"),u(vs,"class","relative group"),u(Dh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(np,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),u(np,"rel","nofollow"),u(sp,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(sp,"rel","nofollow"),u(rp,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(rp,"rel","nofollow"),u(ap,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(ap,"rel","nofollow"),u(ip,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(ip,"rel","nofollow"),u(yo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(za,"id","transformers.FlaxBertForTokenClassification"),u(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"),u(za,"href","#transformers.FlaxBertForTokenClassification"),u($s,"class","relative group"),u(Sh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(fp,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),u(fp,"rel","nofollow"),u(mp,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(mp,"rel","nofollow"),u(up,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(up,"rel","nofollow"),u(gp,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(gp,"rel","nofollow"),u(_p,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(_p,"rel","nofollow"),u(To,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ja,"id","transformers.FlaxBertForQuestionAnswering"),u(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"),u(ja,"href","#transformers.FlaxBertForQuestionAnswering"),u(Fs,"class","relative group"),u(Uh,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(wp,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),u(wp,"rel","nofollow"),u($p,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u($p,"rel","nofollow"),u(xp,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(xp,"rel","nofollow"),u(Fp,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(Fp,"rel","nofollow"),u(Bp,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(Bp,"rel","nofollow"),u(vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(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,k){e(document.head,d),_(i,g,k),_(i,f,k),e(f,m),e(m,b),w(l,b,null),e(f,h),e(f,z),e(z,Fe),_(i,Te,k),_(i,S,k),e(S,pe),e(pe,ee),w(E,ee,null),e(S,Be),e(S,R),e(R,Ee),_(i,ve,k),_(i,U,k),e(U,ze),e(U,fe),e(fe,G),e(U,Me),_(i,we,k),_(i,H,k),e(H,Pe),_(i,$e,k),_(i,K,k),e(K,_e),e(_e,je),_(i,oe,k),_(i,j,k),e(j,q),e(q,qe),_(i,V,k),_(i,ge,k),e(ge,Ce),_(i,J,k),_(i,he,k),e(he,be),e(be,N),e(he,Ne),e(he,Q),e(Q,Oe),_(i,xe,k),_(i,D,k),e(D,Ae),e(D,me),e(me,L),e(D,Ie),e(D,W),e(W,Le),e(D,se),_(i,C,k),_(i,de,k),e(de,O),e(O,ke),w(ue,ke,null),e(de,y),e(de,M),e(M,Re),_(i,ne,k),_(i,ye,k),w(We,ye,null),e(ye,P),e(ye,De),e(De,Qe),e(De,Ke),e(Ke,Ve),e(De,Je),e(De,I),e(I,X),e(De,Ge),e(De,He),e(He,Y),e(De,Xe),e(ye,Ye),e(ye,ce),e(ce,Ze),e(ce,Z),e(Z,et),e(ce,HT),e(ce,Wp),e(Wp,KT),e(ce,RT),e(ye,QT),w(Cs,ye,null),_(i,Db,k),_(i,fn,k),e(fn,Ns),e(Ns,jf),w(li,jf,null),e(fn,VT),e(fn,qf),e(qf,JT),_(i,Sb,k),_(i,tt,k),w(di,tt,null),e(tt,GT),e(tt,Cf),e(Cf,XT),e(tt,YT),e(tt,ci),e(ci,ZT),e(ci,Hp),e(Hp,ev),e(ci,tv),e(tt,ov),e(tt,Ko),w(pi,Ko,null),e(Ko,nv),e(Ko,Nf),e(Nf,sv),e(Ko,rv),e(Ko,hi),e(hi,Kp),e(Kp,av),e(Kp,Of),e(Of,iv),e(hi,lv),e(hi,Rp),e(Rp,dv),e(Rp,Af),e(Af,cv),e(tt,pv),e(tt,Os),w(fi,Os,null),e(Os,hv),e(Os,mi),e(mi,fv),e(mi,If),e(If,mv),e(mi,uv),e(tt,gv),e(tt,oo),w(ui,oo,null),e(oo,_v),e(oo,Lf),e(Lf,bv),e(oo,kv),w(As,oo,null),e(oo,yv),e(oo,mn),e(mn,Tv),e(mn,Df),e(Df,vv),e(mn,wv),e(mn,Sf),e(Sf,$v),e(mn,xv),e(tt,Fv),e(tt,Qp),w(gi,Qp,null),_(i,Ub,k),_(i,un,k),e(un,Is),e(Is,Uf),w(_i,Uf,null),e(un,Bv),e(un,Wf),e(Wf,Ev),_(i,Wb,k),_(i,xt,k),w(bi,xt,null),e(xt,zv),e(xt,ki),e(ki,Mv),e(ki,Hf),e(Hf,Pv),e(ki,jv),e(xt,qv),e(xt,yi),e(yi,Cv),e(yi,Vp),e(Vp,Nv),e(yi,Ov),e(xt,Av),e(xt,Ro),w(Ti,Ro,null),e(Ro,Iv),e(Ro,Kf),e(Kf,Lv),e(Ro,Dv),e(Ro,vi),e(vi,Jp),e(Jp,Sv),e(Jp,Rf),e(Rf,Uv),e(vi,Wv),e(vi,Gp),e(Gp,Hv),e(Gp,Qf),e(Qf,Kv),e(xt,Rv),e(xt,no),w(wi,no,null),e(no,Qv),e(no,Vf),e(Vf,Vv),e(no,Jv),w(Ls,no,null),e(no,Gv),e(no,gn),e(gn,Xv),e(gn,Jf),e(Jf,Yv),e(gn,Zv),e(gn,Gf),e(Gf,e1),e(gn,t1),_(i,Hb,k),_(i,_n,k),e(_n,Ds),e(Ds,Xf),w($i,Xf,null),e(_n,o1),e(_n,Yf),e(Yf,n1),_(i,Kb,k),_(i,Ft,k),w(xi,Ft,null),e(Ft,s1),e(Ft,bn),e(bn,r1),e(bn,Zf),e(Zf,a1),e(bn,i1),e(bn,em),e(em,l1),e(bn,d1),e(Ft,c1),e(Ft,Fi),e(Fi,p1),e(Fi,tm),e(tm,h1),e(Fi,f1),e(Ft,m1),e(Ft,Qo),w(Bi,Qo,null),e(Qo,u1),e(Qo,Ei),e(Ei,g1),e(Ei,om),e(om,_1),e(Ei,b1),e(Qo,k1),w(Ss,Qo,null),e(Ft,y1),e(Ft,Vo),w(zi,Vo,null),e(Vo,T1),e(Vo,kn),e(kn,v1),e(kn,nm),e(nm,w1),e(kn,$1),e(kn,sm),e(sm,x1),e(kn,F1),e(Vo,B1),w(Us,Vo,null),_(i,Rb,k),_(i,yn,k),e(yn,Ws),e(Ws,rm),w(Mi,rm,null),e(yn,E1),e(yn,am),e(am,z1),_(i,Qb,k),_(i,Tn,k),w(Pi,Tn,null),e(Tn,M1),e(Tn,ji),e(ji,P1),e(ji,Xp),e(Xp,j1),e(ji,q1),_(i,Vb,k),_(i,vn,k),w(qi,vn,null),e(vn,C1),e(vn,Ci),e(Ci,N1),e(Ci,Yp),e(Yp,O1),e(Ci,A1),_(i,Jb,k),_(i,Po,k),w(Ni,Po,null),e(Po,I1),e(Po,Oi),e(Oi,L1),e(Oi,Zp),e(Zp,D1),e(Oi,S1),e(Po,U1),e(Po,Hs),w(Ai,Hs,null),e(Hs,W1),e(Hs,im),e(im,H1),_(i,Gb,k),_(i,wn,k),e(wn,Ks),e(Ks,lm),w(Ii,lm,null),e(wn,K1),e(wn,dm),e(dm,R1),_(i,Xb,k),_(i,ot,k),w(Li,ot,null),e(ot,Q1),e(ot,cm),e(cm,V1),e(ot,J1),e(ot,Di),e(Di,G1),e(Di,eh),e(eh,X1),e(Di,Y1),e(ot,Z1),e(ot,Si),e(Si,ew),e(Si,Ui),e(Ui,tw),e(Si,ow),e(ot,nw),e(ot,Wi),e(Wi,sw),e(Wi,Hi),e(Hi,rw),e(Wi,aw),e(ot,iw),e(ot,mt),e(mt,lw),e(mt,pm),e(pm,dw),e(mt,cw),e(mt,hm),e(hm,pw),e(mt,hw),e(mt,fm),e(fm,fw),e(mt,mw),e(mt,mm),e(mm,uw),e(mt,gw),e(mt,um),e(um,_w),e(mt,bw),e(mt,gm),e(gm,kw),e(mt,yw),e(ot,Tw),e(ot,so),w(Ki,so,null),e(so,vw),e(so,$n),e($n,ww),e($n,th),e(th,$w),e($n,xw),e($n,_m),e(_m,Fw),e($n,Bw),e(so,Ew),w(Rs,so,null),e(so,zw),w(Qs,so,null),_(i,Yb,k),_(i,xn,k),e(xn,Vs),e(Vs,bm),w(Ri,bm,null),e(xn,Mw),e(xn,km),e(km,Pw),_(i,Zb,k),_(i,Bt,k),w(Qi,Bt,null),e(Bt,jw),e(Bt,Fn),e(Fn,qw),e(Fn,ym),e(ym,Cw),e(Fn,Nw),e(Fn,Tm),e(Tm,Ow),e(Fn,Aw),e(Bt,Iw),e(Bt,Vi),e(Vi,Lw),e(Vi,oh),e(oh,Dw),e(Vi,Sw),e(Bt,Uw),e(Bt,Ji),e(Ji,Ww),e(Ji,Gi),e(Gi,Hw),e(Ji,Kw),e(Bt,Rw),e(Bt,ro),w(Xi,ro,null),e(ro,Qw),e(ro,Bn),e(Bn,Vw),e(Bn,nh),e(nh,Jw),e(Bn,Gw),e(Bn,vm),e(vm,Xw),e(Bn,Yw),e(ro,Zw),w(Js,ro,null),e(ro,e$),w(Gs,ro,null),_(i,ek,k),_(i,En,k),e(En,Xs),e(Xs,wm),w(Yi,wm,null),e(En,t$),e(En,$m),e($m,o$),_(i,tk,k),_(i,Et,k),w(Zi,Et,null),e(Et,n$),e(Et,el),e(el,s$),e(el,xm),e(xm,r$),e(el,a$),e(Et,i$),e(Et,tl),e(tl,l$),e(tl,sh),e(sh,d$),e(tl,c$),e(Et,p$),e(Et,ol),e(ol,h$),e(ol,nl),e(nl,f$),e(ol,m$),e(Et,u$),e(Et,ao),w(sl,ao,null),e(ao,g$),e(ao,zn),e(zn,_$),e(zn,rh),e(rh,b$),e(zn,k$),e(zn,Fm),e(Fm,y$),e(zn,T$),e(ao,v$),w(Ys,ao,null),e(ao,w$),w(Zs,ao,null),_(i,ok,k),_(i,Mn,k),e(Mn,er),e(er,Bm),w(rl,Bm,null),e(Mn,$$),e(Mn,Em),e(Em,x$),_(i,nk,k),_(i,zt,k),w(al,zt,null),e(zt,F$),e(zt,il),e(il,B$),e(il,zm),e(zm,E$),e(il,z$),e(zt,M$),e(zt,ll),e(ll,P$),e(ll,ah),e(ah,j$),e(ll,q$),e(zt,C$),e(zt,dl),e(dl,N$),e(dl,cl),e(cl,O$),e(dl,A$),e(zt,I$),e(zt,Nt),w(pl,Nt,null),e(Nt,L$),e(Nt,Pn),e(Pn,D$),e(Pn,ih),e(ih,S$),e(Pn,U$),e(Pn,Mm),e(Mm,W$),e(Pn,H$),e(Nt,K$),w(tr,Nt,null),e(Nt,R$),w(or,Nt,null),e(Nt,Q$),w(nr,Nt,null),_(i,sk,k),_(i,jn,k),e(jn,sr),e(sr,Pm),w(hl,Pm,null),e(jn,V$),e(jn,jm),e(jm,J$),_(i,rk,k),_(i,Mt,k),w(fl,Mt,null),e(Mt,G$),e(Mt,ml),e(ml,X$),e(ml,qm),e(qm,Y$),e(ml,Z$),e(Mt,e0),e(Mt,ul),e(ul,t0),e(ul,lh),e(lh,o0),e(ul,n0),e(Mt,s0),e(Mt,gl),e(gl,r0),e(gl,_l),e(_l,a0),e(gl,i0),e(Mt,l0),e(Mt,io),w(bl,io,null),e(io,d0),e(io,qn),e(qn,c0),e(qn,dh),e(dh,p0),e(qn,h0),e(qn,Cm),e(Cm,f0),e(qn,m0),e(io,u0),w(rr,io,null),e(io,g0),w(ar,io,null),_(i,ak,k),_(i,Cn,k),e(Cn,ir),e(ir,Nm),w(kl,Nm,null),e(Cn,_0),e(Cn,Om),e(Om,b0),_(i,ik,k),_(i,Pt,k),w(yl,Pt,null),e(Pt,k0),e(Pt,Am),e(Am,y0),e(Pt,T0),e(Pt,Tl),e(Tl,v0),e(Tl,ch),e(ch,w0),e(Tl,$0),e(Pt,x0),e(Pt,vl),e(vl,F0),e(vl,wl),e(wl,B0),e(vl,E0),e(Pt,z0),e(Pt,ft),w($l,ft,null),e(ft,M0),e(ft,Nn),e(Nn,P0),e(Nn,ph),e(ph,j0),e(Nn,q0),e(Nn,Im),e(Im,C0),e(Nn,N0),e(ft,O0),w(lr,ft,null),e(ft,A0),w(dr,ft,null),e(ft,I0),w(cr,ft,null),e(ft,L0),w(pr,ft,null),e(ft,D0),w(hr,ft,null),_(i,lk,k),_(i,On,k),e(On,fr),e(fr,Lm),w(xl,Lm,null),e(On,S0),e(On,Dm),e(Dm,U0),_(i,dk,k),_(i,jt,k),w(Fl,jt,null),e(jt,W0),e(jt,Sm),e(Sm,H0),e(jt,K0),e(jt,Bl),e(Bl,R0),e(Bl,hh),e(hh,Q0),e(Bl,V0),e(jt,J0),e(jt,El),e(El,G0),e(El,zl),e(zl,X0),e(El,Y0),e(jt,Z0),e(jt,lo),w(Ml,lo,null),e(lo,e2),e(lo,An),e(An,t2),e(An,fh),e(fh,o2),e(An,n2),e(An,Um),e(Um,s2),e(An,r2),e(lo,a2),w(mr,lo,null),e(lo,i2),w(ur,lo,null),_(i,ck,k),_(i,In,k),e(In,gr),e(gr,Wm),w(Pl,Wm,null),e(In,l2),e(In,Hm),e(Hm,d2),_(i,pk,k),_(i,qt,k),w(jl,qt,null),e(qt,c2),e(qt,Km),e(Km,p2),e(qt,h2),e(qt,ql),e(ql,f2),e(ql,mh),e(mh,m2),e(ql,u2),e(qt,g2),e(qt,Cl),e(Cl,_2),e(Cl,Nl),e(Nl,b2),e(Cl,k2),e(qt,y2),e(qt,Ot),w(Ol,Ot,null),e(Ot,T2),e(Ot,Ln),e(Ln,v2),e(Ln,uh),e(uh,w2),e(Ln,$2),e(Ln,Rm),e(Rm,x2),e(Ln,F2),e(Ot,B2),w(_r,Ot,null),e(Ot,E2),w(br,Ot,null),e(Ot,z2),w(kr,Ot,null),_(i,hk,k),_(i,Dn,k),e(Dn,yr),e(yr,Qm),w(Al,Qm,null),e(Dn,M2),e(Dn,Vm),e(Vm,P2),_(i,fk,k),_(i,Ct,k),w(Il,Ct,null),e(Ct,j2),e(Ct,Sn),e(Sn,q2),e(Sn,Jm),e(Jm,C2),e(Sn,N2),e(Sn,Gm),e(Gm,O2),e(Sn,A2),e(Ct,I2),e(Ct,Ll),e(Ll,L2),e(Ll,gh),e(gh,D2),e(Ll,S2),e(Ct,U2),e(Ct,Dl),e(Dl,W2),e(Dl,Sl),e(Sl,H2),e(Dl,K2),e(Ct,R2),e(Ct,At),w(Ul,At,null),e(At,Q2),e(At,Un),e(Un,V2),e(Un,_h),e(_h,J2),e(Un,G2),e(Un,Xm),e(Xm,X2),e(Un,Y2),e(At,Z2),w(Tr,At,null),e(At,ex),w(vr,At,null),e(At,tx),w(wr,At,null),_(i,mk,k),_(i,Wn,k),e(Wn,$r),e($r,Ym),w(Wl,Ym,null),e(Wn,ox),e(Wn,Zm),e(Zm,nx),_(i,uk,k),_(i,ut,k),w(Hl,ut,null),e(ut,sx),e(ut,eu),e(eu,rx),e(ut,ax),e(ut,Kl),e(Kl,ix),e(Kl,bh),e(bh,lx),e(Kl,dx),e(ut,cx),e(ut,Rl),e(Rl,px),e(Rl,Ql),e(Ql,hx),e(Rl,fx),e(ut,mx),w(xr,ut,null),e(ut,ux),e(ut,co),w(Vl,co,null),e(co,gx),e(co,Hn),e(Hn,_x),e(Hn,kh),e(kh,bx),e(Hn,kx),e(Hn,tu),e(tu,yx),e(Hn,Tx),e(co,vx),w(Fr,co,null),e(co,wx),w(Br,co,null),_(i,gk,k),_(i,Kn,k),e(Kn,Er),e(Er,ou),w(Jl,ou,null),e(Kn,$x),e(Kn,nu),e(nu,xx),_(i,_k,k),_(i,gt,k),w(Gl,gt,null),e(gt,Fx),e(gt,Rn),e(Rn,Bx),e(Rn,su),e(su,Ex),e(Rn,zx),e(Rn,ru),e(ru,Mx),e(Rn,Px),e(gt,jx),e(gt,Xl),e(Xl,qx),e(Xl,yh),e(yh,Cx),e(Xl,Nx),e(gt,Ox),e(gt,Yl),e(Yl,Ax),e(Yl,Zl),e(Zl,Ix),e(Yl,Lx),e(gt,Dx),w(zr,gt,null),e(gt,Sx),e(gt,po),w(ed,po,null),e(po,Ux),e(po,Qn),e(Qn,Wx),e(Qn,Th),e(Th,Hx),e(Qn,Kx),e(Qn,au),e(au,Rx),e(Qn,Qx),e(po,Vx),w(Mr,po,null),e(po,Jx),w(Pr,po,null),_(i,bk,k),_(i,Vn,k),e(Vn,jr),e(jr,iu),w(td,iu,null),e(Vn,Gx),e(Vn,lu),e(lu,Xx),_(i,kk,k),_(i,Jn,k),w(od,Jn,null),e(Jn,Yx),e(Jn,It),w(nd,It,null),e(It,Zx),e(It,nt),e(nt,eF),e(nt,du),e(du,tF),e(nt,oF),e(nt,cu),e(cu,nF),e(nt,sF),e(nt,pu),e(pu,rF),e(nt,aF),e(nt,hu),e(hu,iF),e(nt,lF),e(nt,fu),e(fu,dF),e(nt,cF),e(nt,mu),e(mu,pF),e(nt,hF),e(nt,uu),e(uu,fF),e(nt,mF),e(It,uF),e(It,sd),e(sd,rd),e(rd,gF),e(rd,gu),e(gu,_F),e(rd,bF),e(sd,kF),e(sd,ad),e(ad,yF),e(ad,_u),e(_u,TF),e(ad,vF),e(It,wF),e(It,te),e(te,$F),e(te,bu),e(bu,xF),e(te,FF),e(te,ku),e(ku,BF),e(te,EF),e(te,yu),e(yu,zF),e(te,MF),e(te,Tu),e(Tu,PF),e(te,jF),e(te,vu),e(vu,qF),e(te,CF),e(te,wu),e(wu,NF),e(te,OF),e(te,$u),e($u,AF),e(te,IF),e(te,xu),e(xu,LF),e(te,DF),e(te,Fu),e(Fu,SF),e(te,UF),e(te,Bu),e(Bu,WF),e(te,HF),e(te,Eu),e(Eu,KF),e(te,RF),e(te,zu),e(zu,QF),e(te,VF),e(te,Mu),e(Mu,JF),e(te,GF),e(te,Pu),e(Pu,XF),e(te,YF),e(te,ju),e(ju,ZF),e(te,eB),e(te,qu),e(qu,tB),e(te,oB),e(te,Cu),e(Cu,nB),e(te,sB),e(te,Nu),e(Nu,rB),e(te,aB),e(te,Ou),e(Ou,iB),e(te,lB),e(te,Au),e(Au,dB),e(te,cB),e(It,pB),w(qr,It,null),_(i,yk,k),_(i,Gn,k),e(Gn,Cr),e(Cr,Iu),w(id,Iu,null),e(Gn,hB),e(Gn,Lu),e(Lu,fB),_(i,Tk,k),_(i,_t,k),w(ld,_t,null),e(_t,mB),e(_t,dd),e(dd,uB),e(dd,Du),e(Du,gB),e(dd,_B),e(_t,bB),e(_t,cd),e(cd,kB),e(cd,vh),e(vh,yB),e(cd,TB),e(_t,vB),e(_t,pd),e(pd,wB),e(pd,hd),e(hd,$B),e(pd,xB),e(_t,FB),w(Nr,_t,null),e(_t,BB),e(_t,Lt),w(fd,Lt,null),e(Lt,EB),e(Lt,Xn),e(Xn,zB),e(Xn,wh),e(wh,MB),e(Xn,PB),e(Xn,Su),e(Su,jB),e(Xn,qB),e(Lt,CB),w(Or,Lt,null),e(Lt,NB),w(Ar,Lt,null),e(Lt,OB),w(Ir,Lt,null),_(i,vk,k),_(i,Yn,k),e(Yn,Lr),e(Lr,Uu),w(md,Uu,null),e(Yn,AB),e(Yn,Wu),e(Wu,IB),_(i,wk,k),_(i,bt,k),w(ud,bt,null),e(bt,LB),e(bt,gd),e(gd,DB),e(gd,Hu),e(Hu,SB),e(gd,UB),e(bt,WB),e(bt,_d),e(_d,HB),e(_d,$h),e($h,KB),e(_d,RB),e(bt,QB),e(bt,bd),e(bd,VB),e(bd,kd),e(kd,JB),e(bd,GB),e(bt,XB),w(Dr,bt,null),e(bt,YB),e(bt,ho),w(yd,ho,null),e(ho,ZB),e(ho,Zn),e(Zn,e9),e(Zn,xh),e(xh,t9),e(Zn,o9),e(Zn,Ku),e(Ku,n9),e(Zn,s9),e(ho,r9),w(Sr,ho,null),e(ho,a9),w(Ur,ho,null),_(i,$k,k),_(i,es,k),e(es,Wr),e(Wr,Ru),w(Td,Ru,null),e(es,i9),e(es,Qu),e(Qu,l9),_(i,xk,k),_(i,kt,k),w(vd,kt,null),e(kt,d9),e(kt,Vu),e(Vu,c9),e(kt,p9),e(kt,wd),e(wd,h9),e(wd,Fh),e(Fh,f9),e(wd,m9),e(kt,u9),e(kt,$d),e($d,g9),e($d,xd),e(xd,_9),e($d,b9),e(kt,k9),w(Hr,kt,null),e(kt,y9),e(kt,Dt),w(Fd,Dt,null),e(Dt,T9),e(Dt,ts),e(ts,v9),e(ts,Bh),e(Bh,w9),e(ts,$9),e(ts,Ju),e(Ju,x9),e(ts,F9),e(Dt,B9),w(Kr,Dt,null),e(Dt,E9),w(Rr,Dt,null),e(Dt,z9),w(Qr,Dt,null),_(i,Fk,k),_(i,os,k),e(os,Vr),e(Vr,Gu),w(Bd,Gu,null),e(os,M9),e(os,Xu),e(Xu,P9),_(i,Bk,k),_(i,yt,k),w(Ed,yt,null),e(yt,j9),e(yt,Yu),e(Yu,q9),e(yt,C9),e(yt,zd),e(zd,N9),e(zd,Eh),e(Eh,O9),e(zd,A9),e(yt,I9),e(yt,Md),e(Md,L9),e(Md,Pd),e(Pd,D9),e(Md,S9),e(yt,U9),w(Jr,yt,null),e(yt,W9),e(yt,fo),w(jd,fo,null),e(fo,H9),e(fo,ns),e(ns,K9),e(ns,zh),e(zh,R9),e(ns,Q9),e(ns,Zu),e(Zu,V9),e(ns,J9),e(fo,G9),w(Gr,fo,null),e(fo,X9),w(Xr,fo,null),_(i,Ek,k),_(i,ss,k),e(ss,Yr),e(Yr,eg),w(qd,eg,null),e(ss,Y9),e(ss,tg),e(tg,Z9),_(i,zk,k),_(i,Tt,k),w(Cd,Tt,null),e(Tt,eE),e(Tt,og),e(og,tE),e(Tt,oE),e(Tt,Nd),e(Nd,nE),e(Nd,Mh),e(Mh,sE),e(Nd,rE),e(Tt,aE),e(Tt,Od),e(Od,iE),e(Od,Ad),e(Ad,lE),e(Od,dE),e(Tt,cE),w(Zr,Tt,null),e(Tt,pE),e(Tt,St),w(Id,St,null),e(St,hE),e(St,rs),e(rs,fE),e(rs,Ph),e(Ph,mE),e(rs,uE),e(rs,ng),e(ng,gE),e(rs,_E),e(St,bE),w(ea,St,null),e(St,kE),w(ta,St,null),e(St,yE),w(oa,St,null),_(i,Mk,k),_(i,as,k),e(as,na),e(na,sg),w(Ld,sg,null),e(as,TE),e(as,rg),e(rg,vE),_(i,Pk,k),_(i,vt,k),w(Dd,vt,null),e(vt,wE),e(vt,is),e(is,$E),e(is,ag),e(ag,xE),e(is,FE),e(is,ig),e(ig,BE),e(is,EE),e(vt,zE),e(vt,Sd),e(Sd,ME),e(Sd,jh),e(jh,PE),e(Sd,jE),e(vt,qE),e(vt,Ud),e(Ud,CE),e(Ud,Wd),e(Wd,NE),e(Ud,OE),e(vt,AE),w(sa,vt,null),e(vt,IE),e(vt,Ut),w(Hd,Ut,null),e(Ut,LE),e(Ut,ls),e(ls,DE),e(ls,qh),e(qh,SE),e(ls,UE),e(ls,lg),e(lg,WE),e(ls,HE),e(Ut,KE),w(ra,Ut,null),e(Ut,RE),w(aa,Ut,null),e(Ut,QE),w(ia,Ut,null),_(i,jk,k),_(i,ds,k),e(ds,la),e(la,dg),w(Kd,dg,null),e(ds,VE),e(ds,cg),e(cg,JE),_(i,qk,k),_(i,st,k),w(Rd,st,null),e(st,GE),e(st,pg),e(pg,XE),e(st,YE),e(st,Qd),e(Qd,ZE),e(Qd,Ch),e(Ch,ez),e(Qd,tz),e(st,oz),e(st,Vd),e(Vd,nz),e(Vd,Jd),e(Jd,sz),e(Vd,rz),e(st,az),e(st,hg),e(hg,iz),e(st,lz),e(st,jo),e(jo,fg),e(fg,Gd),e(Gd,dz),e(jo,cz),e(jo,mg),e(mg,Xd),e(Xd,pz),e(jo,hz),e(jo,ug),e(ug,Yd),e(Yd,fz),e(jo,mz),e(jo,gg),e(gg,Zd),e(Zd,uz),e(st,gz),e(st,mo),w(ec,mo,null),e(mo,_z),e(mo,cs),e(cs,bz),e(cs,_g),e(_g,kz),e(cs,yz),e(cs,bg),e(bg,Tz),e(cs,vz),e(mo,wz),w(da,mo,null),e(mo,$z),w(ca,mo,null),_(i,Ck,k),_(i,ps,k),e(ps,pa),e(pa,kg),w(tc,kg,null),e(ps,xz),e(ps,yg),e(yg,Fz),_(i,Nk,k),_(i,rt,k),w(oc,rt,null),e(rt,Bz),e(rt,hs),e(hs,Ez),e(hs,Tg),e(Tg,zz),e(hs,Mz),e(hs,vg),e(vg,Pz),e(hs,jz),e(rt,qz),e(rt,nc),e(nc,Cz),e(nc,Nh),e(Nh,Nz),e(nc,Oz),e(rt,Az),e(rt,sc),e(sc,Iz),e(sc,rc),e(rc,Lz),e(sc,Dz),e(rt,Sz),e(rt,wg),e(wg,Uz),e(rt,Wz),e(rt,qo),e(qo,$g),e($g,ac),e(ac,Hz),e(qo,Kz),e(qo,xg),e(xg,ic),e(ic,Rz),e(qo,Qz),e(qo,Fg),e(Fg,lc),e(lc,Vz),e(qo,Jz),e(qo,Bg),e(Bg,dc),e(dc,Gz),e(rt,Xz),e(rt,uo),w(cc,uo,null),e(uo,Yz),e(uo,fs),e(fs,Zz),e(fs,Eg),e(Eg,eM),e(fs,tM),e(fs,zg),e(zg,oM),e(fs,nM),e(uo,sM),w(ha,uo,null),e(uo,rM),w(fa,uo,null),_(i,Ok,k),_(i,ms,k),e(ms,ma),e(ma,Mg),w(pc,Mg,null),e(ms,aM),e(ms,Pg),e(Pg,iM),_(i,Ak,k),_(i,at,k),w(hc,at,null),e(at,lM),e(at,jg),e(jg,dM),e(at,cM),e(at,fc),e(fc,pM),e(fc,Oh),e(Oh,hM),e(fc,fM),e(at,mM),e(at,mc),e(mc,uM),e(mc,uc),e(uc,gM),e(mc,_M),e(at,bM),e(at,qg),e(qg,kM),e(at,yM),e(at,Co),e(Co,Cg),e(Cg,gc),e(gc,TM),e(Co,vM),e(Co,Ng),e(Ng,_c),e(_c,wM),e(Co,$M),e(Co,Og),e(Og,bc),e(bc,xM),e(Co,FM),e(Co,Ag),e(Ag,kc),e(kc,BM),e(at,EM),e(at,go),w(yc,go,null),e(go,zM),e(go,us),e(us,MM),e(us,Ig),e(Ig,PM),e(us,jM),e(us,Lg),e(Lg,qM),e(us,CM),e(go,NM),w(ua,go,null),e(go,OM),w(ga,go,null),_(i,Ik,k),_(i,gs,k),e(gs,_a),e(_a,Dg),w(Tc,Dg,null),e(gs,AM),e(gs,Sg),e(Sg,IM),_(i,Lk,k),_(i,it,k),w(vc,it,null),e(it,LM),e(it,wc),e(wc,DM),e(wc,Ug),e(Ug,SM),e(wc,UM),e(it,WM),e(it,$c),e($c,HM),e($c,Ah),e(Ah,KM),e($c,RM),e(it,QM),e(it,xc),e(xc,VM),e(xc,Fc),e(Fc,JM),e(xc,GM),e(it,XM),e(it,Wg),e(Wg,YM),e(it,ZM),e(it,No),e(No,Hg),e(Hg,Bc),e(Bc,e4),e(No,t4),e(No,Kg),e(Kg,Ec),e(Ec,o4),e(No,n4),e(No,Rg),e(Rg,zc),e(zc,s4),e(No,r4),e(No,Qg),e(Qg,Mc),e(Mc,a4),e(it,i4),e(it,_o),w(Pc,_o,null),e(_o,l4),e(_o,_s),e(_s,d4),e(_s,Vg),e(Vg,c4),e(_s,p4),e(_s,Jg),e(Jg,h4),e(_s,f4),e(_o,m4),w(ba,_o,null),e(_o,u4),w(ka,_o,null),_(i,Dk,k),_(i,bs,k),e(bs,ya),e(ya,Gg),w(jc,Gg,null),e(bs,g4),e(bs,Xg),e(Xg,_4),_(i,Sk,k),_(i,lt,k),w(qc,lt,null),e(lt,b4),e(lt,Cc),e(Cc,k4),e(Cc,Yg),e(Yg,y4),e(Cc,T4),e(lt,v4),e(lt,Nc),e(Nc,w4),e(Nc,Ih),e(Ih,$4),e(Nc,x4),e(lt,F4),e(lt,Oc),e(Oc,B4),e(Oc,Ac),e(Ac,E4),e(Oc,z4),e(lt,M4),e(lt,Zg),e(Zg,P4),e(lt,j4),e(lt,Oo),e(Oo,e_),e(e_,Ic),e(Ic,q4),e(Oo,C4),e(Oo,t_),e(t_,Lc),e(Lc,N4),e(Oo,O4),e(Oo,o_),e(o_,Dc),e(Dc,A4),e(Oo,I4),e(Oo,n_),e(n_,Sc),e(Sc,L4),e(lt,D4),e(lt,bo),w(Uc,bo,null),e(bo,S4),e(bo,ks),e(ks,U4),e(ks,s_),e(s_,W4),e(ks,H4),e(ks,r_),e(r_,K4),e(ks,R4),e(bo,Q4),w(Ta,bo,null),e(bo,V4),w(va,bo,null),_(i,Uk,k),_(i,ys,k),e(ys,wa),e(wa,a_),w(Wc,a_,null),e(ys,J4),e(ys,i_),e(i_,G4),_(i,Wk,k),_(i,dt,k),w(Hc,dt,null),e(dt,X4),e(dt,l_),e(l_,Y4),e(dt,Z4),e(dt,Kc),e(Kc,eP),e(Kc,Lh),e(Lh,tP),e(Kc,oP),e(dt,nP),e(dt,Rc),e(Rc,sP),e(Rc,Qc),e(Qc,rP),e(Rc,aP),e(dt,iP),e(dt,d_),e(d_,lP),e(dt,dP),e(dt,Ao),e(Ao,c_),e(c_,Vc),e(Vc,cP),e(Ao,pP),e(Ao,p_),e(p_,Jc),e(Jc,hP),e(Ao,fP),e(Ao,h_),e(h_,Gc),e(Gc,mP),e(Ao,uP),e(Ao,f_),e(f_,Xc),e(Xc,gP),e(dt,_P),e(dt,ko),w(Yc,ko,null),e(ko,bP),e(ko,Ts),e(Ts,kP),e(Ts,m_),e(m_,yP),e(Ts,TP),e(Ts,u_),e(u_,vP),e(Ts,wP),e(ko,$P),w($a,ko,null),e(ko,xP),w(xa,ko,null),_(i,Hk,k),_(i,vs,k),e(vs,Fa),e(Fa,g_),w(Zc,g_,null),e(vs,FP),e(vs,__),e(__,BP),_(i,Kk,k),_(i,ct,k),w(ep,ct,null),e(ct,EP),e(ct,b_),e(b_,zP),e(ct,MP),e(ct,tp),e(tp,PP),e(tp,Dh),e(Dh,jP),e(tp,qP),e(ct,CP),e(ct,op),e(op,NP),e(op,np),e(np,OP),e(op,AP),e(ct,IP),e(ct,k_),e(k_,LP),e(ct,DP),e(ct,Io),e(Io,y_),e(y_,sp),e(sp,SP),e(Io,UP),e(Io,T_),e(T_,rp),e(rp,WP),e(Io,HP),e(Io,v_),e(v_,ap),e(ap,KP),e(Io,RP),e(Io,w_),e(w_,ip),e(ip,QP),e(ct,VP),e(ct,yo),w(lp,yo,null),e(yo,JP),e(yo,ws),e(ws,GP),e(ws,$_),e($_,XP),e(ws,YP),e(ws,x_),e(x_,ZP),e(ws,ej),e(yo,tj),w(Ba,yo,null),e(yo,oj),w(Ea,yo,null),_(i,Rk,k),_(i,$s,k),e($s,za),e(za,F_),w(dp,F_,null),e($s,nj),e($s,B_),e(B_,sj),_(i,Qk,k),_(i,pt,k),w(cp,pt,null),e(pt,rj),e(pt,E_),e(E_,aj),e(pt,ij),e(pt,pp),e(pp,lj),e(pp,Sh),e(Sh,dj),e(pp,cj),e(pt,pj),e(pt,hp),e(hp,hj),e(hp,fp),e(fp,fj),e(hp,mj),e(pt,uj),e(pt,z_),e(z_,gj),e(pt,_j),e(pt,Lo),e(Lo,M_),e(M_,mp),e(mp,bj),e(Lo,kj),e(Lo,P_),e(P_,up),e(up,yj),e(Lo,Tj),e(Lo,j_),e(j_,gp),e(gp,vj),e(Lo,wj),e(Lo,q_),e(q_,_p),e(_p,$j),e(pt,xj),e(pt,To),w(bp,To,null),e(To,Fj),e(To,xs),e(xs,Bj),e(xs,C_),e(C_,Ej),e(xs,zj),e(xs,N_),e(N_,Mj),e(xs,Pj),e(To,jj),w(Ma,To,null),e(To,qj),w(Pa,To,null),_(i,Vk,k),_(i,Fs,k),e(Fs,ja),e(ja,O_),w(kp,O_,null),e(Fs,Cj),e(Fs,A_),e(A_,Nj),_(i,Jk,k),_(i,ht,k),w(yp,ht,null),e(ht,Oj),e(ht,Bs),e(Bs,Aj),e(Bs,I_),e(I_,Ij),e(Bs,Lj),e(Bs,L_),e(L_,Dj),e(Bs,Sj),e(ht,Uj),e(ht,Tp),e(Tp,Wj),e(Tp,Uh),e(Uh,Hj),e(Tp,Kj),e(ht,Rj),e(ht,vp),e(vp,Qj),e(vp,wp),e(wp,Vj),e(vp,Jj),e(ht,Gj),e(ht,D_),e(D_,Xj),e(ht,Yj),e(ht,Do),e(Do,S_),e(S_,$p),e($p,Zj),e(Do,e7),e(Do,U_),e(U_,xp),e(xp,t7),e(Do,o7),e(Do,W_),e(W_,Fp),e(Fp,n7),e(Do,s7),e(Do,H_),e(H_,Bp),e(Bp,r7),e(ht,a7),e(ht,vo),w(Ep,vo,null),e(vo,i7),e(vo,Es),e(Es,l7),e(Es,K_),e(K_,d7),e(Es,c7),e(Es,R_),e(R_,p7),e(Es,h7),e(vo,f7),w(qa,vo,null),e(vo,m7),w(Ca,vo,null),Gk=!0},p(i,[k]){const zp={};k&2&&(zp.$$scope={dirty:k,ctx:i}),Cs.$set(zp);const Q_={};k&2&&(Q_.$$scope={dirty:k,ctx:i}),As.$set(Q_);const V_={};k&2&&(V_.$$scope={dirty:k,ctx:i}),Ls.$set(V_);const J_={};k&2&&(J_.$$scope={dirty:k,ctx:i}),Ss.$set(J_);const Mp={};k&2&&(Mp.$$scope={dirty:k,ctx:i}),Us.$set(Mp);const G_={};k&2&&(G_.$$scope={dirty:k,ctx:i}),Rs.$set(G_);const X_={};k&2&&(X_.$$scope={dirty:k,ctx:i}),Qs.$set(X_);const Y_={};k&2&&(Y_.$$scope={dirty:k,ctx:i}),Js.$set(Y_);const Pp={};k&2&&(Pp.$$scope={dirty:k,ctx:i}),Gs.$set(Pp);const Z_={};k&2&&(Z_.$$scope={dirty:k,ctx:i}),Ys.$set(Z_);const eb={};k&2&&(eb.$$scope={dirty:k,ctx:i}),Zs.$set(eb);const tb={};k&2&&(tb.$$scope={dirty:k,ctx:i}),tr.$set(tb);const ob={};k&2&&(ob.$$scope={dirty:k,ctx:i}),or.$set(ob);const nb={};k&2&&(nb.$$scope={dirty:k,ctx:i}),nr.$set(nb);const sb={};k&2&&(sb.$$scope={dirty:k,ctx:i}),rr.$set(sb);const rb={};k&2&&(rb.$$scope={dirty:k,ctx:i}),ar.$set(rb);const jp={};k&2&&(jp.$$scope={dirty:k,ctx:i}),lr.$set(jp);const ab={};k&2&&(ab.$$scope={dirty:k,ctx:i}),dr.$set(ab);const ib={};k&2&&(ib.$$scope={dirty:k,ctx:i}),cr.$set(ib);const zs={};k&2&&(zs.$$scope={dirty:k,ctx:i}),pr.$set(zs);const lb={};k&2&&(lb.$$scope={dirty:k,ctx:i}),hr.$set(lb);const db={};k&2&&(db.$$scope={dirty:k,ctx:i}),mr.$set(db);const qp={};k&2&&(qp.$$scope={dirty:k,ctx:i}),ur.$set(qp);const cb={};k&2&&(cb.$$scope={dirty:k,ctx:i}),_r.$set(cb);const pb={};k&2&&(pb.$$scope={dirty:k,ctx:i}),br.$set(pb);const hb={};k&2&&(hb.$$scope={dirty:k,ctx:i}),kr.$set(hb);const So={};k&2&&(So.$$scope={dirty:k,ctx:i}),Tr.$set(So);const Uo={};k&2&&(Uo.$$scope={dirty:k,ctx:i}),vr.$set(Uo);const fb={};k&2&&(fb.$$scope={dirty:k,ctx:i}),wr.$set(fb);const mb={};k&2&&(mb.$$scope={dirty:k,ctx:i}),xr.$set(mb);const ub={};k&2&&(ub.$$scope={dirty:k,ctx:i}),Fr.$set(ub);const Ms={};k&2&&(Ms.$$scope={dirty:k,ctx:i}),Br.$set(Ms);const gb={};k&2&&(gb.$$scope={dirty:k,ctx:i}),zr.$set(gb);const _b={};k&2&&(_b.$$scope={dirty:k,ctx:i}),Mr.$set(_b);const Cp={};k&2&&(Cp.$$scope={dirty:k,ctx:i}),Pr.$set(Cp);const bb={};k&2&&(bb.$$scope={dirty:k,ctx:i}),qr.$set(bb);const kb={};k&2&&(kb.$$scope={dirty:k,ctx:i}),Nr.$set(kb);const yb={};k&2&&(yb.$$scope={dirty:k,ctx:i}),Or.$set(yb);const wt={};k&2&&(wt.$$scope={dirty:k,ctx:i}),Ar.$set(wt);const Tb={};k&2&&(Tb.$$scope={dirty:k,ctx:i}),Ir.$set(Tb);const Np={};k&2&&(Np.$$scope={dirty:k,ctx:i}),Dr.$set(Np);const vb={};k&2&&(vb.$$scope={dirty:k,ctx:i}),Sr.$set(vb);const Ps={};k&2&&(Ps.$$scope={dirty:k,ctx:i}),Ur.$set(Ps);const wb={};k&2&&(wb.$$scope={dirty:k,ctx:i}),Hr.$set(wb);const Op={};k&2&&(Op.$$scope={dirty:k,ctx:i}),Kr.$set(Op);const Wh={};k&2&&(Wh.$$scope={dirty:k,ctx:i}),Rr.$set(Wh);const $b={};k&2&&($b.$$scope={dirty:k,ctx:i}),Qr.$set($b);const Hh={};k&2&&(Hh.$$scope={dirty:k,ctx:i}),Jr.$set(Hh);const xb={};k&2&&(xb.$$scope={dirty:k,ctx:i}),Gr.$set(xb);const Ap={};k&2&&(Ap.$$scope={dirty:k,ctx:i}),Xr.$set(Ap);const Ip={};k&2&&(Ip.$$scope={dirty:k,ctx:i}),Zr.$set(Ip);const Fb={};k&2&&(Fb.$$scope={dirty:k,ctx:i}),ea.$set(Fb);const Wo={};k&2&&(Wo.$$scope={dirty:k,ctx:i}),ta.$set(Wo);const Bb={};k&2&&(Bb.$$scope={dirty:k,ctx:i}),oa.$set(Bb);const js={};k&2&&(js.$$scope={dirty:k,ctx:i}),sa.$set(js);const Eb={};k&2&&(Eb.$$scope={dirty:k,ctx:i}),ra.$set(Eb);const zb={};k&2&&(zb.$$scope={dirty:k,ctx:i}),aa.$set(zb);const Mb={};k&2&&(Mb.$$scope={dirty:k,ctx:i}),ia.$set(Mb);const Lp={};k&2&&(Lp.$$scope={dirty:k,ctx:i}),da.$set(Lp);const Pb={};k&2&&(Pb.$$scope={dirty:k,ctx:i}),ca.$set(Pb);const jb={};k&2&&(jb.$$scope={dirty:k,ctx:i}),ha.$set(jb);const qb={};k&2&&(qb.$$scope={dirty:k,ctx:i}),fa.$set(qb);const to={};k&2&&(to.$$scope={dirty:k,ctx:i}),ua.$set(to);const Dp={};k&2&&(Dp.$$scope={dirty:k,ctx:i}),ga.$set(Dp);const Cb={};k&2&&(Cb.$$scope={dirty:k,ctx:i}),ba.$set(Cb);const Sp={};k&2&&(Sp.$$scope={dirty:k,ctx:i}),ka.$set(Sp);const Nb={};k&2&&(Nb.$$scope={dirty:k,ctx:i}),Ta.$set(Nb);const qs={};k&2&&(qs.$$scope={dirty:k,ctx:i}),va.$set(qs);const Ob={};k&2&&(Ob.$$scope={dirty:k,ctx:i}),$a.$set(Ob);const Up={};k&2&&(Up.$$scope={dirty:k,ctx:i}),xa.$set(Up);const Kh={};k&2&&(Kh.$$scope={dirty:k,ctx:i}),Ba.$set(Kh);const Ab={};k&2&&(Ab.$$scope={dirty:k,ctx:i}),Ea.$set(Ab);const Rh={};k&2&&(Rh.$$scope={dirty:k,ctx:i}),Ma.$set(Rh);const Ib={};k&2&&(Ib.$$scope={dirty:k,ctx:i}),Pa.$set(Ib);const Ho={};k&2&&(Ho.$$scope={dirty:k,ctx:i}),qa.$set(Ho);const Lb={};k&2&&(Lb.$$scope={dirty:k,ctx:i}),Ca.$set(Lb)},i(i){Gk||($(l.$$.fragment,i),$(E.$$.fragment,i),$(ue.$$.fragment,i),$(We.$$.fragment,i),$(Cs.$$.fragment,i),$(li.$$.fragment,i),$(di.$$.fragment,i),$(pi.$$.fragment,i),$(fi.$$.fragment,i),$(ui.$$.fragment,i),$(As.$$.fragment,i),$(gi.$$.fragment,i),$(_i.$$.fragment,i),$(bi.$$.fragment,i),$(Ti.$$.fragment,i),$(wi.$$.fragment,i),$(Ls.$$.fragment,i),$($i.$$.fragment,i),$(xi.$$.fragment,i),$(Bi.$$.fragment,i),$(Ss.$$.fragment,i),$(zi.$$.fragment,i),$(Us.$$.fragment,i),$(Mi.$$.fragment,i),$(Pi.$$.fragment,i),$(qi.$$.fragment,i),$(Ni.$$.fragment,i),$(Ai.$$.fragment,i),$(Ii.$$.fragment,i),$(Li.$$.fragment,i),$(Ki.$$.fragment,i),$(Rs.$$.fragment,i),$(Qs.$$.fragment,i),$(Ri.$$.fragment,i),$(Qi.$$.fragment,i),$(Xi.$$.fragment,i),$(Js.$$.fragment,i),$(Gs.$$.fragment,i),$(Yi.$$.fragment,i),$(Zi.$$.fragment,i),$(sl.$$.fragment,i),$(Ys.$$.fragment,i),$(Zs.$$.fragment,i),$(rl.$$.fragment,i),$(al.$$.fragment,i),$(pl.$$.fragment,i),$(tr.$$.fragment,i),$(or.$$.fragment,i),$(nr.$$.fragment,i),$(hl.$$.fragment,i),$(fl.$$.fragment,i),$(bl.$$.fragment,i),$(rr.$$.fragment,i),$(ar.$$.fragment,i),$(kl.$$.fragment,i),$(yl.$$.fragment,i),$($l.$$.fragment,i),$(lr.$$.fragment,i),$(dr.$$.fragment,i),$(cr.$$.fragment,i),$(pr.$$.fragment,i),$(hr.$$.fragment,i),$(xl.$$.fragment,i),$(Fl.$$.fragment,i),$(Ml.$$.fragment,i),$(mr.$$.fragment,i),$(ur.$$.fragment,i),$(Pl.$$.fragment,i),$(jl.$$.fragment,i),$(Ol.$$.fragment,i),$(_r.$$.fragment,i),$(br.$$.fragment,i),$(kr.$$.fragment,i),$(Al.$$.fragment,i),$(Il.$$.fragment,i),$(Ul.$$.fragment,i),$(Tr.$$.fragment,i),$(vr.$$.fragment,i),$(wr.$$.fragment,i),$(Wl.$$.fragment,i),$(Hl.$$.fragment,i),$(xr.$$.fragment,i),$(Vl.$$.fragment,i),$(Fr.$$.fragment,i),$(Br.$$.fragment,i),$(Jl.$$.fragment,i),$(Gl.$$.fragment,i),$(zr.$$.fragment,i),$(ed.$$.fragment,i),$(Mr.$$.fragment,i),$(Pr.$$.fragment,i),$(td.$$.fragment,i),$(od.$$.fragment,i),$(nd.$$.fragment,i),$(qr.$$.fragment,i),$(id.$$.fragment,i),$(ld.$$.fragment,i),$(Nr.$$.fragment,i),$(fd.$$.fragment,i),$(Or.$$.fragment,i),$(Ar.$$.fragment,i),$(Ir.$$.fragment,i),$(md.$$.fragment,i),$(ud.$$.fragment,i),$(Dr.$$.fragment,i),$(yd.$$.fragment,i),$(Sr.$$.fragment,i),$(Ur.$$.fragment,i),$(Td.$$.fragment,i),$(vd.$$.fragment,i),$(Hr.$$.fragment,i),$(Fd.$$.fragment,i),$(Kr.$$.fragment,i),$(Rr.$$.fragment,i),$(Qr.$$.fragment,i),$(Bd.$$.fragment,i),$(Ed.$$.fragment,i),$(Jr.$$.fragment,i),$(jd.$$.fragment,i),$(Gr.$$.fragment,i),$(Xr.$$.fragment,i),$(qd.$$.fragment,i),$(Cd.$$.fragment,i),$(Zr.$$.fragment,i),$(Id.$$.fragment,i),$(ea.$$.fragment,i),$(ta.$$.fragment,i),$(oa.$$.fragment,i),$(Ld.$$.fragment,i),$(Dd.$$.fragment,i),$(sa.$$.fragment,i),$(Hd.$$.fragment,i),$(ra.$$.fragment,i),$(aa.$$.fragment,i),$(ia.$$.fragment,i),$(Kd.$$.fragment,i),$(Rd.$$.fragment,i),$(ec.$$.fragment,i),$(da.$$.fragment,i),$(ca.$$.fragment,i),$(tc.$$.fragment,i),$(oc.$$.fragment,i),$(cc.$$.fragment,i),$(ha.$$.fragment,i),$(fa.$$.fragment,i),$(pc.$$.fragment,i),$(hc.$$.fragment,i),$(yc.$$.fragment,i),$(ua.$$.fragment,i),$(ga.$$.fragment,i),$(Tc.$$.fragment,i),$(vc.$$.fragment,i),$(Pc.$$.fragment,i),$(ba.$$.fragment,i),$(ka.$$.fragment,i),$(jc.$$.fragment,i),$(qc.$$.fragment,i),$(Uc.$$.fragment,i),$(Ta.$$.fragment,i),$(va.$$.fragment,i),$(Wc.$$.fragment,i),$(Hc.$$.fragment,i),$(Yc.$$.fragment,i),$($a.$$.fragment,i),$(xa.$$.fragment,i),$(Zc.$$.fragment,i),$(ep.$$.fragment,i),$(lp.$$.fragment,i),$(Ba.$$.fragment,i),$(Ea.$$.fragment,i),$(dp.$$.fragment,i),$(cp.$$.fragment,i),$(bp.$$.fragment,i),$(Ma.$$.fragment,i),$(Pa.$$.fragment,i),$(kp.$$.fragment,i),$(yp.$$.fragment,i),$(Ep.$$.fragment,i),$(qa.$$.fragment,i),$(Ca.$$.fragment,i),Gk=!0)},o(i){x(l.$$.fragment,i),x(E.$$.fragment,i),x(ue.$$.fragment,i),x(We.$$.fragment,i),x(Cs.$$.fragment,i),x(li.$$.fragment,i),x(di.$$.fragment,i),x(pi.$$.fragment,i),x(fi.$$.fragment,i),x(ui.$$.fragment,i),x(As.$$.fragment,i),x(gi.$$.fragment,i),x(_i.$$.fragment,i),x(bi.$$.fragment,i),x(Ti.$$.fragment,i),x(wi.$$.fragment,i),x(Ls.$$.fragment,i),x($i.$$.fragment,i),x(xi.$$.fragment,i),x(Bi.$$.fragment,i),x(Ss.$$.fragment,i),x(zi.$$.fragment,i),x(Us.$$.fragment,i),x(Mi.$$.fragment,i),x(Pi.$$.fragment,i),x(qi.$$.fragment,i),x(Ni.$$.fragment,i),x(Ai.$$.fragment,i),x(Ii.$$.fragment,i),x(Li.$$.fragment,i),x(Ki.$$.fragment,i),x(Rs.$$.fragment,i),x(Qs.$$.fragment,i),x(Ri.$$.fragment,i),x(Qi.$$.fragment,i),x(Xi.$$.fragment,i),x(Js.$$.fragment,i),x(Gs.$$.fragment,i),x(Yi.$$.fragment,i),x(Zi.$$.fragment,i),x(sl.$$.fragment,i),x(Ys.$$.fragment,i),x(Zs.$$.fragment,i),x(rl.$$.fragment,i),x(al.$$.fragment,i),x(pl.$$.fragment,i),x(tr.$$.fragment,i),x(or.$$.fragment,i),x(nr.$$.fragment,i),x(hl.$$.fragment,i),x(fl.$$.fragment,i),x(bl.$$.fragment,i),x(rr.$$.fragment,i),x(ar.$$.fragment,i),x(kl.$$.fragment,i),x(yl.$$.fragment,i),x($l.$$.fragment,i),x(lr.$$.fragment,i),x(dr.$$.fragment,i),x(cr.$$.fragment,i),x(pr.$$.fragment,i),x(hr.$$.fragment,i),x(xl.$$.fragment,i),x(Fl.$$.fragment,i),x(Ml.$$.fragment,i),x(mr.$$.fragment,i),x(ur.$$.fragment,i),x(Pl.$$.fragment,i),x(jl.$$.fragment,i),x(Ol.$$.fragment,i),x(_r.$$.fragment,i),x(br.$$.fragment,i),x(kr.$$.fragment,i),x(Al.$$.fragment,i),x(Il.$$.fragment,i),x(Ul.$$.fragment,i),x(Tr.$$.fragment,i),x(vr.$$.fragment,i),x(wr.$$.fragment,i),x(Wl.$$.fragment,i),x(Hl.$$.fragment,i),x(xr.$$.fragment,i),x(Vl.$$.fragment,i),x(Fr.$$.fragment,i),x(Br.$$.fragment,i),x(Jl.$$.fragment,i),x(Gl.$$.fragment,i),x(zr.$$.fragment,i),x(ed.$$.fragment,i),x(Mr.$$.fragment,i),x(Pr.$$.fragment,i),x(td.$$.fragment,i),x(od.$$.fragment,i),x(nd.$$.fragment,i),x(qr.$$.fragment,i),x(id.$$.fragment,i),x(ld.$$.fragment,i),x(Nr.$$.fragment,i),x(fd.$$.fragment,i),x(Or.$$.fragment,i),x(Ar.$$.fragment,i),x(Ir.$$.fragment,i),x(md.$$.fragment,i),x(ud.$$.fragment,i),x(Dr.$$.fragment,i),x(yd.$$.fragment,i),x(Sr.$$.fragment,i),x(Ur.$$.fragment,i),x(Td.$$.fragment,i),x(vd.$$.fragment,i),x(Hr.$$.fragment,i),x(Fd.$$.fragment,i),x(Kr.$$.fragment,i),x(Rr.$$.fragment,i),x(Qr.$$.fragment,i),x(Bd.$$.fragment,i),x(Ed.$$.fragment,i),x(Jr.$$.fragment,i),x(jd.$$.fragment,i),x(Gr.$$.fragment,i),x(Xr.$$.fragment,i),x(qd.$$.fragment,i),x(Cd.$$.fragment,i),x(Zr.$$.fragment,i),x(Id.$$.fragment,i),x(ea.$$.fragment,i),x(ta.$$.fragment,i),x(oa.$$.fragment,i),x(Ld.$$.fragment,i),x(Dd.$$.fragment,i),x(sa.$$.fragment,i),x(Hd.$$.fragment,i),x(ra.$$.fragment,i),x(aa.$$.fragment,i),x(ia.$$.fragment,i),x(Kd.$$.fragment,i),x(Rd.$$.fragment,i),x(ec.$$.fragment,i),x(da.$$.fragment,i),x(ca.$$.fragment,i),x(tc.$$.fragment,i),x(oc.$$.fragment,i),x(cc.$$.fragment,i),x(ha.$$.fragment,i),x(fa.$$.fragment,i),x(pc.$$.fragment,i),x(hc.$$.fragment,i),x(yc.$$.fragment,i),x(ua.$$.fragment,i),x(ga.$$.fragment,i),x(Tc.$$.fragment,i),x(vc.$$.fragment,i),x(Pc.$$.fragment,i),x(ba.$$.fragment,i),x(ka.$$.fragment,i),x(jc.$$.fragment,i),x(qc.$$.fragment,i),x(Uc.$$.fragment,i),x(Ta.$$.fragment,i),x(va.$$.fragment,i),x(Wc.$$.fragment,i),x(Hc.$$.fragment,i),x(Yc.$$.fragment,i),x($a.$$.fragment,i),x(xa.$$.fragment,i),x(Zc.$$.fragment,i),x(ep.$$.fragment,i),x(lp.$$.fragment,i),x(Ba.$$.fragment,i),x(Ea.$$.fragment,i),x(dp.$$.fragment,i),x(cp.$$.fragment,i),x(bp.$$.fragment,i),x(Ma.$$.fragment,i),x(Pa.$$.fragment,i),x(kp.$$.fragment,i),x(yp.$$.fragment,i),x(Ep.$$.fragment,i),x(qa.$$.fragment,i),x(Ca.$$.fragment,i),Gk=!1},d(i){t(d),i&&t(g),i&&t(f),F(l),i&&t(Te),i&&t(S),F(E),i&&t(ve),i&&t(U),i&&t(we),i&&t(H),i&&t($e),i&&t(K),i&&t(oe),i&&t(j),i&&t(V),i&&t(ge),i&&t(J),i&&t(he),i&&t(xe),i&&t(D),i&&t(C),i&&t(de),F(ue),i&&t(ne),i&&t(ye),F(We),F(Cs),i&&t(Db),i&&t(fn),F(li),i&&t(Sb),i&&t(tt),F(di),F(pi),F(fi),F(ui),F(As),F(gi),i&&t(Ub),i&&t(un),F(_i),i&&t(Wb),i&&t(xt),F(bi),F(Ti),F(wi),F(Ls),i&&t(Hb),i&&t(_n),F($i),i&&t(Kb),i&&t(Ft),F(xi),F(Bi),F(Ss),F(zi),F(Us),i&&t(Rb),i&&t(yn),F(Mi),i&&t(Qb),i&&t(Tn),F(Pi),i&&t(Vb),i&&t(vn),F(qi),i&&t(Jb),i&&t(Po),F(Ni),F(Ai),i&&t(Gb),i&&t(wn),F(Ii),i&&t(Xb),i&&t(ot),F(Li),F(Ki),F(Rs),F(Qs),i&&t(Yb),i&&t(xn),F(Ri),i&&t(Zb),i&&t(Bt),F(Qi),F(Xi),F(Js),F(Gs),i&&t(ek),i&&t(En),F(Yi),i&&t(tk),i&&t(Et),F(Zi),F(sl),F(Ys),F(Zs),i&&t(ok),i&&t(Mn),F(rl),i&&t(nk),i&&t(zt),F(al),F(pl),F(tr),F(or),F(nr),i&&t(sk),i&&t(jn),F(hl),i&&t(rk),i&&t(Mt),F(fl),F(bl),F(rr),F(ar),i&&t(ak),i&&t(Cn),F(kl),i&&t(ik),i&&t(Pt),F(yl),F($l),F(lr),F(dr),F(cr),F(pr),F(hr),i&&t(lk),i&&t(On),F(xl),i&&t(dk),i&&t(jt),F(Fl),F(Ml),F(mr),F(ur),i&&t(ck),i&&t(In),F(Pl),i&&t(pk),i&&t(qt),F(jl),F(Ol),F(_r),F(br),F(kr),i&&t(hk),i&&t(Dn),F(Al),i&&t(fk),i&&t(Ct),F(Il),F(Ul),F(Tr),F(vr),F(wr),i&&t(mk),i&&t(Wn),F(Wl),i&&t(uk),i&&t(ut),F(Hl),F(xr),F(Vl),F(Fr),F(Br),i&&t(gk),i&&t(Kn),F(Jl),i&&t(_k),i&&t(gt),F(Gl),F(zr),F(ed),F(Mr),F(Pr),i&&t(bk),i&&t(Vn),F(td),i&&t(kk),i&&t(Jn),F(od),F(nd),F(qr),i&&t(yk),i&&t(Gn),F(id),i&&t(Tk),i&&t(_t),F(ld),F(Nr),F(fd),F(Or),F(Ar),F(Ir),i&&t(vk),i&&t(Yn),F(md),i&&t(wk),i&&t(bt),F(ud),F(Dr),F(yd),F(Sr),F(Ur),i&&t($k),i&&t(es),F(Td),i&&t(xk),i&&t(kt),F(vd),F(Hr),F(Fd),F(Kr),F(Rr),F(Qr),i&&t(Fk),i&&t(os),F(Bd),i&&t(Bk),i&&t(yt),F(Ed),F(Jr),F(jd),F(Gr),F(Xr),i&&t(Ek),i&&t(ss),F(qd),i&&t(zk),i&&t(Tt),F(Cd),F(Zr),F(Id),F(ea),F(ta),F(oa),i&&t(Mk),i&&t(as),F(Ld),i&&t(Pk),i&&t(vt),F(Dd),F(sa),F(Hd),F(ra),F(aa),F(ia),i&&t(jk),i&&t(ds),F(Kd),i&&t(qk),i&&t(st),F(Rd),F(ec),F(da),F(ca),i&&t(Ck),i&&t(ps),F(tc),i&&t(Nk),i&&t(rt),F(oc),F(cc),F(ha),F(fa),i&&t(Ok),i&&t(ms),F(pc),i&&t(Ak),i&&t(at),F(hc),F(yc),F(ua),F(ga),i&&t(Ik),i&&t(gs),F(Tc),i&&t(Lk),i&&t(it),F(vc),F(Pc),F(ba),F(ka),i&&t(Dk),i&&t(bs),F(jc),i&&t(Sk),i&&t(lt),F(qc),F(Uc),F(Ta),F(va),i&&t(Uk),i&&t(ys),F(Wc),i&&t(Wk),i&&t(dt),F(Hc),F(Yc),F($a),F(xa),i&&t(Hk),i&&t(vs),F(Zc),i&&t(Kk),i&&t(ct),F(ep),F(lp),F(Ba),F(Ea),i&&t(Rk),i&&t($s),F(dp),i&&t(Qk),i&&t(pt),F(cp),F(bp),F(Ma),F(Pa),i&&t(Vk),i&&t(Fs),F(kp),i&&t(Jk),i&&t(ht),F(yp),F(Ep),F(qa),F(Ca)}}}const _O={local:"bert",sections:[{local:"overview",title:"Overview"},{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 bO(B){return QN(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xO extends WN{constructor(d){super();HN(this,d,bO,gO,KN,{})}}export{xO as default,_O as metadata};
