import{S as xU,i as BU,s as EU,e as r,k as c,w as y,t as o,M as MU,c as a,d as t,m as p,a as i,x as T,h as n,b as h,G as e,g,y as w,q as $,o as F,B as x,v as zU,L as le}from"../../chunks/vendor-hf-doc-builder.js";import{T as Se}from"../../chunks/Tip-hf-doc-builder.js";import{D as O}from"../../chunks/Docstring-hf-doc-builder.js";import{C as de}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as De}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ie}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as e2}from"../../chunks/PipelineTag-hf-doc-builder.js";function PU(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Examples:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Examples:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function jU(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("pair mask has the following format:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"pair mask has the following format:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function qU(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("pair mask has the following format:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"pair mask has the following format:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function CU(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Examples:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Examples:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function AU(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Examples:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Examples:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function NU(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function OU(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function IU(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function LU(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function DU(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function SU(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function UU(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function WU(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function HU(B){let d,b;return d=new de({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(){y(d.$$.fragment)},l(m){T(d.$$.fragment,m)},m(m,u){w(d,m,u),b=!0},p:le,i(m){b||($(d.$$.fragment,m),b=!0)},o(m){F(d.$$.fragment,m),b=!1},d(m){x(d,m)}}}function RU(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function KU(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function QU(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function VU(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example of single-label classification:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example of single-label classification:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function GU(B){let d,b;return d=new de({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(){y(d.$$.fragment)},l(m){T(d.$$.fragment,m)},m(m,u){w(d,m,u),b=!0},p:le,i(m){b||($(d.$$.fragment,m),b=!0)},o(m){F(d.$$.fragment,m),b=!1},d(m){x(d,m)}}}function JU(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example of multi-label classification:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example of multi-label classification:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function XU(B){let d,b;return d=new de({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(){y(d.$$.fragment)},l(m){T(d.$$.fragment,m)},m(m,u){w(d,m,u),b=!0},p:le,i(m){b||($(d.$$.fragment,m),b=!0)},o(m){F(d.$$.fragment,m),b=!1},d(m){x(d,m)}}}function YU(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function ZU(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function eW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function tW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function oW(B){let d,b;return d=new de({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(){y(d.$$.fragment)},l(m){T(d.$$.fragment,m)},m(m,u){w(d,m,u),b=!0},p:le,i(m){b||($(d.$$.fragment,m),b=!0)},o(m){F(d.$$.fragment,m),b=!1},d(m){x(d,m)}}}function nW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function sW(B){let d,b,m,u,v;return u=new de({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, skip_special_tokens=True)`,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, skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-string">&#x27;a nice puppet&#x27;</span>`}}),{c(){d=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function rW(B){let d,b;return d=new de({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(){y(d.$$.fragment)},l(m){T(d.$$.fragment,m)},m(m,u){w(d,m,u),b=!0},p:le,i(m){b||($(d.$$.fragment,m),b=!0)},o(m){F(d.$$.fragment,m),b=!1},d(m){x(d,m)}}}function aW(B){let d,b,m,u,v,l,f,M,Fe,ke,S,pe,Z,E,xe,Q,Be,ye,U,Ee,fe,X,Me,Te,R,ze,we,K,_e,Pe,te,j,q,je,G,ge,qe,J,he,be,A,Ce,V,Ae,$e,D,Ne,me,L,Oe,W,Ie,ne,C,ce,N,ve,ue;return{c(){d=r("p"),b=o("TensorFlow models and layers in "),m=r("code"),u=o("transformers"),v=o(" accept two formats as input:"),l=c(),f=r("ul"),M=r("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ke=c(),S=r("li"),pe=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),E=r("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r("code"),Be=o("model.fit()"),ye=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r("code"),Ee=o("model.fit()"),fe=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r("code"),Me=o("fit()"),Te=o(" and "),R=r("code"),ze=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=r("code"),_e=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=r("ul"),q=r("li"),je=o("a single Tensor with "),G=r("code"),ge=o("input_ids"),qe=o(" only and nothing else: "),J=r("code"),he=o("model(input_ids)"),be=c(),A=r("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=r("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),me=c(),L=r("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=r("p"),ce=o(`Note that when creating models and layers with
`),N=r("a"),ve=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(k){d=a(k,"P",{});var z=i(d);b=n(z,"TensorFlow models and layers in "),m=a(z,"CODE",{});var Ve=i(m);u=n(Ve,"transformers"),Ve.forEach(t),v=n(z," accept two formats as input:"),z.forEach(t),l=p(k),f=a(k,"UL",{});var oe=i(f);M=a(oe,"LI",{});var Ke=i(M);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ke=p(oe),S=a(oe,"LI",{});var Ge=i(S);pe=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(k),E=a(k,"P",{});var P=i(E);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=a(P,"CODE",{});var Ue=i(Q);Be=n(Ue,"model.fit()"),Ue.forEach(t),ye=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=a(P,"CODE",{});var Qe=i(U);Ee=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 `),X=a(P,"CODE",{});var re=i(X);Me=n(re,"fit()"),re.forEach(t),Te=n(P," and "),R=a(P,"CODE",{});var We=i(R);ze=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=a(P,"CODE",{});var Je=i(K);_e=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(k),j=a(k,"UL",{});var I=i(j);q=a(I,"LI",{});var Y=i(q);je=n(Y,"a single Tensor with "),G=a(Y,"CODE",{});var Xe=i(G);ge=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=a(Y,"CODE",{});var Ye=i(J);he=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),be=p(I),A=a(I,"LI",{});var H=i(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=a(H,"CODE",{});var Ze=i(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=a(H,"CODE",{});var He=i(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),me=p(I),L=a(I,"LI",{});var Le=i(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=a(Le,"CODE",{});var et=i(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(k),C=a(k,"P",{});var se=i(C);ce=n(se,`Note that when creating models and layers with
`),N=a(se,"A",{href:!0,rel:!0});var Re=i(N);ve=n(Re,"subclassing"),Re.forEach(t),ue=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(k,z){g(k,d,z),e(d,b),e(d,m),e(m,u),e(d,v),g(k,l,z),g(k,f,z),e(f,M),e(M,Fe),e(f,ke),e(f,S),e(S,pe),g(k,Z,z),g(k,E,z),e(E,xe),e(E,Q),e(Q,Be),e(E,ye),e(E,U),e(U,Ee),e(E,fe),e(E,X),e(X,Me),e(E,Te),e(E,R),e(R,ze),e(E,we),e(E,K),e(K,_e),e(E,Pe),g(k,te,z),g(k,j,z),e(j,q),e(q,je),e(q,G),e(G,ge),e(q,qe),e(q,J),e(J,he),e(j,be),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,me),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(k,ne,z),g(k,C,z),e(C,ce),e(C,N),e(N,ve),e(C,ue)},d(k){k&&t(d),k&&t(l),k&&t(f),k&&t(Z),k&&t(E),k&&t(te),k&&t(j),k&&t(ne),k&&t(C)}}}function iW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function lW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function dW(B){let d,b,m,u,v,l,f,M,Fe,ke,S,pe,Z,E,xe,Q,Be,ye,U,Ee,fe,X,Me,Te,R,ze,we,K,_e,Pe,te,j,q,je,G,ge,qe,J,he,be,A,Ce,V,Ae,$e,D,Ne,me,L,Oe,W,Ie,ne,C,ce,N,ve,ue;return{c(){d=r("p"),b=o("TensorFlow models and layers in "),m=r("code"),u=o("transformers"),v=o(" accept two formats as input:"),l=c(),f=r("ul"),M=r("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ke=c(),S=r("li"),pe=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),E=r("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r("code"),Be=o("model.fit()"),ye=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r("code"),Ee=o("model.fit()"),fe=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r("code"),Me=o("fit()"),Te=o(" and "),R=r("code"),ze=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=r("code"),_e=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=r("ul"),q=r("li"),je=o("a single Tensor with "),G=r("code"),ge=o("input_ids"),qe=o(" only and nothing else: "),J=r("code"),he=o("model(input_ids)"),be=c(),A=r("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=r("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),me=c(),L=r("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=r("p"),ce=o(`Note that when creating models and layers with
`),N=r("a"),ve=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(k){d=a(k,"P",{});var z=i(d);b=n(z,"TensorFlow models and layers in "),m=a(z,"CODE",{});var Ve=i(m);u=n(Ve,"transformers"),Ve.forEach(t),v=n(z," accept two formats as input:"),z.forEach(t),l=p(k),f=a(k,"UL",{});var oe=i(f);M=a(oe,"LI",{});var Ke=i(M);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ke=p(oe),S=a(oe,"LI",{});var Ge=i(S);pe=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(k),E=a(k,"P",{});var P=i(E);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=a(P,"CODE",{});var Ue=i(Q);Be=n(Ue,"model.fit()"),Ue.forEach(t),ye=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=a(P,"CODE",{});var Qe=i(U);Ee=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 `),X=a(P,"CODE",{});var re=i(X);Me=n(re,"fit()"),re.forEach(t),Te=n(P," and "),R=a(P,"CODE",{});var We=i(R);ze=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=a(P,"CODE",{});var Je=i(K);_e=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(k),j=a(k,"UL",{});var I=i(j);q=a(I,"LI",{});var Y=i(q);je=n(Y,"a single Tensor with "),G=a(Y,"CODE",{});var Xe=i(G);ge=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=a(Y,"CODE",{});var Ye=i(J);he=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),be=p(I),A=a(I,"LI",{});var H=i(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=a(H,"CODE",{});var Ze=i(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=a(H,"CODE",{});var He=i(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),me=p(I),L=a(I,"LI",{});var Le=i(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=a(Le,"CODE",{});var et=i(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(k),C=a(k,"P",{});var se=i(C);ce=n(se,`Note that when creating models and layers with
`),N=a(se,"A",{href:!0,rel:!0});var Re=i(N);ve=n(Re,"subclassing"),Re.forEach(t),ue=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(k,z){g(k,d,z),e(d,b),e(d,m),e(m,u),e(d,v),g(k,l,z),g(k,f,z),e(f,M),e(M,Fe),e(f,ke),e(f,S),e(S,pe),g(k,Z,z),g(k,E,z),e(E,xe),e(E,Q),e(Q,Be),e(E,ye),e(E,U),e(U,Ee),e(E,fe),e(E,X),e(X,Me),e(E,Te),e(E,R),e(R,ze),e(E,we),e(E,K),e(K,_e),e(E,Pe),g(k,te,z),g(k,j,z),e(j,q),e(q,je),e(q,G),e(G,ge),e(q,qe),e(q,J),e(J,he),e(j,be),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,me),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(k,ne,z),g(k,C,z),e(C,ce),e(C,N),e(N,ve),e(C,ue)},d(k){k&&t(d),k&&t(l),k&&t(f),k&&t(Z),k&&t(E),k&&t(te),k&&t(j),k&&t(ne),k&&t(C)}}}function cW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function pW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Examples:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Examples:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function hW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function fW(B){let d,b,m,u,v,l,f,M,Fe,ke,S,pe,Z,E,xe,Q,Be,ye,U,Ee,fe,X,Me,Te,R,ze,we,K,_e,Pe,te,j,q,je,G,ge,qe,J,he,be,A,Ce,V,Ae,$e,D,Ne,me,L,Oe,W,Ie,ne,C,ce,N,ve,ue;return{c(){d=r("p"),b=o("TensorFlow models and layers in "),m=r("code"),u=o("transformers"),v=o(" accept two formats as input:"),l=c(),f=r("ul"),M=r("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ke=c(),S=r("li"),pe=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),E=r("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r("code"),Be=o("model.fit()"),ye=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r("code"),Ee=o("model.fit()"),fe=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r("code"),Me=o("fit()"),Te=o(" and "),R=r("code"),ze=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=r("code"),_e=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=r("ul"),q=r("li"),je=o("a single Tensor with "),G=r("code"),ge=o("input_ids"),qe=o(" only and nothing else: "),J=r("code"),he=o("model(input_ids)"),be=c(),A=r("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=r("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),me=c(),L=r("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=r("p"),ce=o(`Note that when creating models and layers with
`),N=r("a"),ve=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(k){d=a(k,"P",{});var z=i(d);b=n(z,"TensorFlow models and layers in "),m=a(z,"CODE",{});var Ve=i(m);u=n(Ve,"transformers"),Ve.forEach(t),v=n(z," accept two formats as input:"),z.forEach(t),l=p(k),f=a(k,"UL",{});var oe=i(f);M=a(oe,"LI",{});var Ke=i(M);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ke=p(oe),S=a(oe,"LI",{});var Ge=i(S);pe=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(k),E=a(k,"P",{});var P=i(E);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=a(P,"CODE",{});var Ue=i(Q);Be=n(Ue,"model.fit()"),Ue.forEach(t),ye=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=a(P,"CODE",{});var Qe=i(U);Ee=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 `),X=a(P,"CODE",{});var re=i(X);Me=n(re,"fit()"),re.forEach(t),Te=n(P," and "),R=a(P,"CODE",{});var We=i(R);ze=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=a(P,"CODE",{});var Je=i(K);_e=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(k),j=a(k,"UL",{});var I=i(j);q=a(I,"LI",{});var Y=i(q);je=n(Y,"a single Tensor with "),G=a(Y,"CODE",{});var Xe=i(G);ge=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=a(Y,"CODE",{});var Ye=i(J);he=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),be=p(I),A=a(I,"LI",{});var H=i(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=a(H,"CODE",{});var Ze=i(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=a(H,"CODE",{});var He=i(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),me=p(I),L=a(I,"LI",{});var Le=i(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=a(Le,"CODE",{});var et=i(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(k),C=a(k,"P",{});var se=i(C);ce=n(se,`Note that when creating models and layers with
`),N=a(se,"A",{href:!0,rel:!0});var Re=i(N);ve=n(Re,"subclassing"),Re.forEach(t),ue=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(k,z){g(k,d,z),e(d,b),e(d,m),e(m,u),e(d,v),g(k,l,z),g(k,f,z),e(f,M),e(M,Fe),e(f,ke),e(f,S),e(S,pe),g(k,Z,z),g(k,E,z),e(E,xe),e(E,Q),e(Q,Be),e(E,ye),e(E,U),e(U,Ee),e(E,fe),e(E,X),e(X,Me),e(E,Te),e(E,R),e(R,ze),e(E,we),e(E,K),e(K,_e),e(E,Pe),g(k,te,z),g(k,j,z),e(j,q),e(q,je),e(q,G),e(G,ge),e(q,qe),e(q,J),e(J,he),e(j,be),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,me),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(k,ne,z),g(k,C,z),e(C,ce),e(C,N),e(N,ve),e(C,ue)},d(k){k&&t(d),k&&t(l),k&&t(f),k&&t(Z),k&&t(E),k&&t(te),k&&t(j),k&&t(ne),k&&t(C)}}}function mW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function uW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function gW(B){let d,b;return d=new de({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(){y(d.$$.fragment)},l(m){T(d.$$.fragment,m)},m(m,u){w(d,m,u),b=!0},p:le,i(m){b||($(d.$$.fragment,m),b=!0)},o(m){F(d.$$.fragment,m),b=!1},d(m){x(d,m)}}}function _W(B){let d,b,m,u,v,l,f,M,Fe,ke,S,pe,Z,E,xe,Q,Be,ye,U,Ee,fe,X,Me,Te,R,ze,we,K,_e,Pe,te,j,q,je,G,ge,qe,J,he,be,A,Ce,V,Ae,$e,D,Ne,me,L,Oe,W,Ie,ne,C,ce,N,ve,ue;return{c(){d=r("p"),b=o("TensorFlow models and layers in "),m=r("code"),u=o("transformers"),v=o(" accept two formats as input:"),l=c(),f=r("ul"),M=r("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ke=c(),S=r("li"),pe=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),E=r("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r("code"),Be=o("model.fit()"),ye=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r("code"),Ee=o("model.fit()"),fe=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r("code"),Me=o("fit()"),Te=o(" and "),R=r("code"),ze=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=r("code"),_e=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=r("ul"),q=r("li"),je=o("a single Tensor with "),G=r("code"),ge=o("input_ids"),qe=o(" only and nothing else: "),J=r("code"),he=o("model(input_ids)"),be=c(),A=r("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=r("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),me=c(),L=r("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=r("p"),ce=o(`Note that when creating models and layers with
`),N=r("a"),ve=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(k){d=a(k,"P",{});var z=i(d);b=n(z,"TensorFlow models and layers in "),m=a(z,"CODE",{});var Ve=i(m);u=n(Ve,"transformers"),Ve.forEach(t),v=n(z," accept two formats as input:"),z.forEach(t),l=p(k),f=a(k,"UL",{});var oe=i(f);M=a(oe,"LI",{});var Ke=i(M);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ke=p(oe),S=a(oe,"LI",{});var Ge=i(S);pe=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(k),E=a(k,"P",{});var P=i(E);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=a(P,"CODE",{});var Ue=i(Q);Be=n(Ue,"model.fit()"),Ue.forEach(t),ye=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=a(P,"CODE",{});var Qe=i(U);Ee=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 `),X=a(P,"CODE",{});var re=i(X);Me=n(re,"fit()"),re.forEach(t),Te=n(P," and "),R=a(P,"CODE",{});var We=i(R);ze=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=a(P,"CODE",{});var Je=i(K);_e=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(k),j=a(k,"UL",{});var I=i(j);q=a(I,"LI",{});var Y=i(q);je=n(Y,"a single Tensor with "),G=a(Y,"CODE",{});var Xe=i(G);ge=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=a(Y,"CODE",{});var Ye=i(J);he=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),be=p(I),A=a(I,"LI",{});var H=i(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=a(H,"CODE",{});var Ze=i(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=a(H,"CODE",{});var He=i(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),me=p(I),L=a(I,"LI",{});var Le=i(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=a(Le,"CODE",{});var et=i(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(k),C=a(k,"P",{});var se=i(C);ce=n(se,`Note that when creating models and layers with
`),N=a(se,"A",{href:!0,rel:!0});var Re=i(N);ve=n(Re,"subclassing"),Re.forEach(t),ue=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(k,z){g(k,d,z),e(d,b),e(d,m),e(m,u),e(d,v),g(k,l,z),g(k,f,z),e(f,M),e(M,Fe),e(f,ke),e(f,S),e(S,pe),g(k,Z,z),g(k,E,z),e(E,xe),e(E,Q),e(Q,Be),e(E,ye),e(E,U),e(U,Ee),e(E,fe),e(E,X),e(X,Me),e(E,Te),e(E,R),e(R,ze),e(E,we),e(E,K),e(K,_e),e(E,Pe),g(k,te,z),g(k,j,z),e(j,q),e(q,je),e(q,G),e(G,ge),e(q,qe),e(q,J),e(J,he),e(j,be),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,me),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(k,ne,z),g(k,C,z),e(C,ce),e(C,N),e(N,ve),e(C,ue)},d(k){k&&t(d),k&&t(l),k&&t(f),k&&t(Z),k&&t(E),k&&t(te),k&&t(j),k&&t(ne),k&&t(C)}}}function bW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function vW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Examples:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Examples:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function kW(B){let d,b,m,u,v,l,f,M,Fe,ke,S,pe,Z,E,xe,Q,Be,ye,U,Ee,fe,X,Me,Te,R,ze,we,K,_e,Pe,te,j,q,je,G,ge,qe,J,he,be,A,Ce,V,Ae,$e,D,Ne,me,L,Oe,W,Ie,ne,C,ce,N,ve,ue;return{c(){d=r("p"),b=o("TensorFlow models and layers in "),m=r("code"),u=o("transformers"),v=o(" accept two formats as input:"),l=c(),f=r("ul"),M=r("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ke=c(),S=r("li"),pe=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),E=r("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r("code"),Be=o("model.fit()"),ye=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r("code"),Ee=o("model.fit()"),fe=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r("code"),Me=o("fit()"),Te=o(" and "),R=r("code"),ze=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=r("code"),_e=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=r("ul"),q=r("li"),je=o("a single Tensor with "),G=r("code"),ge=o("input_ids"),qe=o(" only and nothing else: "),J=r("code"),he=o("model(input_ids)"),be=c(),A=r("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=r("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),me=c(),L=r("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=r("p"),ce=o(`Note that when creating models and layers with
`),N=r("a"),ve=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(k){d=a(k,"P",{});var z=i(d);b=n(z,"TensorFlow models and layers in "),m=a(z,"CODE",{});var Ve=i(m);u=n(Ve,"transformers"),Ve.forEach(t),v=n(z," accept two formats as input:"),z.forEach(t),l=p(k),f=a(k,"UL",{});var oe=i(f);M=a(oe,"LI",{});var Ke=i(M);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ke=p(oe),S=a(oe,"LI",{});var Ge=i(S);pe=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(k),E=a(k,"P",{});var P=i(E);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=a(P,"CODE",{});var Ue=i(Q);Be=n(Ue,"model.fit()"),Ue.forEach(t),ye=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=a(P,"CODE",{});var Qe=i(U);Ee=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 `),X=a(P,"CODE",{});var re=i(X);Me=n(re,"fit()"),re.forEach(t),Te=n(P," and "),R=a(P,"CODE",{});var We=i(R);ze=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=a(P,"CODE",{});var Je=i(K);_e=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(k),j=a(k,"UL",{});var I=i(j);q=a(I,"LI",{});var Y=i(q);je=n(Y,"a single Tensor with "),G=a(Y,"CODE",{});var Xe=i(G);ge=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=a(Y,"CODE",{});var Ye=i(J);he=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),be=p(I),A=a(I,"LI",{});var H=i(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=a(H,"CODE",{});var Ze=i(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=a(H,"CODE",{});var He=i(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),me=p(I),L=a(I,"LI",{});var Le=i(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=a(Le,"CODE",{});var et=i(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(k),C=a(k,"P",{});var se=i(C);ce=n(se,`Note that when creating models and layers with
`),N=a(se,"A",{href:!0,rel:!0});var Re=i(N);ve=n(Re,"subclassing"),Re.forEach(t),ue=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(k,z){g(k,d,z),e(d,b),e(d,m),e(m,u),e(d,v),g(k,l,z),g(k,f,z),e(f,M),e(M,Fe),e(f,ke),e(f,S),e(S,pe),g(k,Z,z),g(k,E,z),e(E,xe),e(E,Q),e(Q,Be),e(E,ye),e(E,U),e(U,Ee),e(E,fe),e(E,X),e(X,Me),e(E,Te),e(E,R),e(R,ze),e(E,we),e(E,K),e(K,_e),e(E,Pe),g(k,te,z),g(k,j,z),e(j,q),e(q,je),e(q,G),e(G,ge),e(q,qe),e(q,J),e(J,he),e(j,be),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,me),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(k,ne,z),g(k,C,z),e(C,ce),e(C,N),e(N,ve),e(C,ue)},d(k){k&&t(d),k&&t(l),k&&t(f),k&&t(Z),k&&t(E),k&&t(te),k&&t(j),k&&t(ne),k&&t(C)}}}function yW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function TW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function wW(B){let d,b;return d=new de({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(){y(d.$$.fragment)},l(m){T(d.$$.fragment,m)},m(m,u){w(d,m,u),b=!0},p:le,i(m){b||($(d.$$.fragment,m),b=!0)},o(m){F(d.$$.fragment,m),b=!1},d(m){x(d,m)}}}function $W(B){let d,b,m,u,v,l,f,M,Fe,ke,S,pe,Z,E,xe,Q,Be,ye,U,Ee,fe,X,Me,Te,R,ze,we,K,_e,Pe,te,j,q,je,G,ge,qe,J,he,be,A,Ce,V,Ae,$e,D,Ne,me,L,Oe,W,Ie,ne,C,ce,N,ve,ue;return{c(){d=r("p"),b=o("TensorFlow models and layers in "),m=r("code"),u=o("transformers"),v=o(" accept two formats as input:"),l=c(),f=r("ul"),M=r("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ke=c(),S=r("li"),pe=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),E=r("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r("code"),Be=o("model.fit()"),ye=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r("code"),Ee=o("model.fit()"),fe=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r("code"),Me=o("fit()"),Te=o(" and "),R=r("code"),ze=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=r("code"),_e=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=r("ul"),q=r("li"),je=o("a single Tensor with "),G=r("code"),ge=o("input_ids"),qe=o(" only and nothing else: "),J=r("code"),he=o("model(input_ids)"),be=c(),A=r("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=r("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),me=c(),L=r("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=r("p"),ce=o(`Note that when creating models and layers with
`),N=r("a"),ve=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(k){d=a(k,"P",{});var z=i(d);b=n(z,"TensorFlow models and layers in "),m=a(z,"CODE",{});var Ve=i(m);u=n(Ve,"transformers"),Ve.forEach(t),v=n(z," accept two formats as input:"),z.forEach(t),l=p(k),f=a(k,"UL",{});var oe=i(f);M=a(oe,"LI",{});var Ke=i(M);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ke=p(oe),S=a(oe,"LI",{});var Ge=i(S);pe=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(k),E=a(k,"P",{});var P=i(E);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=a(P,"CODE",{});var Ue=i(Q);Be=n(Ue,"model.fit()"),Ue.forEach(t),ye=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=a(P,"CODE",{});var Qe=i(U);Ee=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 `),X=a(P,"CODE",{});var re=i(X);Me=n(re,"fit()"),re.forEach(t),Te=n(P," and "),R=a(P,"CODE",{});var We=i(R);ze=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=a(P,"CODE",{});var Je=i(K);_e=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(k),j=a(k,"UL",{});var I=i(j);q=a(I,"LI",{});var Y=i(q);je=n(Y,"a single Tensor with "),G=a(Y,"CODE",{});var Xe=i(G);ge=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=a(Y,"CODE",{});var Ye=i(J);he=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),be=p(I),A=a(I,"LI",{});var H=i(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=a(H,"CODE",{});var Ze=i(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=a(H,"CODE",{});var He=i(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),me=p(I),L=a(I,"LI",{});var Le=i(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=a(Le,"CODE",{});var et=i(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(k),C=a(k,"P",{});var se=i(C);ce=n(se,`Note that when creating models and layers with
`),N=a(se,"A",{href:!0,rel:!0});var Re=i(N);ve=n(Re,"subclassing"),Re.forEach(t),ue=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(k,z){g(k,d,z),e(d,b),e(d,m),e(m,u),e(d,v),g(k,l,z),g(k,f,z),e(f,M),e(M,Fe),e(f,ke),e(f,S),e(S,pe),g(k,Z,z),g(k,E,z),e(E,xe),e(E,Q),e(Q,Be),e(E,ye),e(E,U),e(U,Ee),e(E,fe),e(E,X),e(X,Me),e(E,Te),e(E,R),e(R,ze),e(E,we),e(E,K),e(K,_e),e(E,Pe),g(k,te,z),g(k,j,z),e(j,q),e(q,je),e(q,G),e(G,ge),e(q,qe),e(q,J),e(J,he),e(j,be),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,me),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(k,ne,z),g(k,C,z),e(C,ce),e(C,N),e(N,ve),e(C,ue)},d(k){k&&t(d),k&&t(l),k&&t(f),k&&t(Z),k&&t(E),k&&t(te),k&&t(j),k&&t(ne),k&&t(C)}}}function FW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function xW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function BW(B){let d,b,m,u,v,l,f,M,Fe,ke,S,pe,Z,E,xe,Q,Be,ye,U,Ee,fe,X,Me,Te,R,ze,we,K,_e,Pe,te,j,q,je,G,ge,qe,J,he,be,A,Ce,V,Ae,$e,D,Ne,me,L,Oe,W,Ie,ne,C,ce,N,ve,ue;return{c(){d=r("p"),b=o("TensorFlow models and layers in "),m=r("code"),u=o("transformers"),v=o(" accept two formats as input:"),l=c(),f=r("ul"),M=r("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ke=c(),S=r("li"),pe=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),E=r("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r("code"),Be=o("model.fit()"),ye=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r("code"),Ee=o("model.fit()"),fe=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r("code"),Me=o("fit()"),Te=o(" and "),R=r("code"),ze=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=r("code"),_e=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=r("ul"),q=r("li"),je=o("a single Tensor with "),G=r("code"),ge=o("input_ids"),qe=o(" only and nothing else: "),J=r("code"),he=o("model(input_ids)"),be=c(),A=r("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=r("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),me=c(),L=r("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=r("p"),ce=o(`Note that when creating models and layers with
`),N=r("a"),ve=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(k){d=a(k,"P",{});var z=i(d);b=n(z,"TensorFlow models and layers in "),m=a(z,"CODE",{});var Ve=i(m);u=n(Ve,"transformers"),Ve.forEach(t),v=n(z," accept two formats as input:"),z.forEach(t),l=p(k),f=a(k,"UL",{});var oe=i(f);M=a(oe,"LI",{});var Ke=i(M);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ke=p(oe),S=a(oe,"LI",{});var Ge=i(S);pe=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(k),E=a(k,"P",{});var P=i(E);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=a(P,"CODE",{});var Ue=i(Q);Be=n(Ue,"model.fit()"),Ue.forEach(t),ye=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=a(P,"CODE",{});var Qe=i(U);Ee=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 `),X=a(P,"CODE",{});var re=i(X);Me=n(re,"fit()"),re.forEach(t),Te=n(P," and "),R=a(P,"CODE",{});var We=i(R);ze=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=a(P,"CODE",{});var Je=i(K);_e=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(k),j=a(k,"UL",{});var I=i(j);q=a(I,"LI",{});var Y=i(q);je=n(Y,"a single Tensor with "),G=a(Y,"CODE",{});var Xe=i(G);ge=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=a(Y,"CODE",{});var Ye=i(J);he=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),be=p(I),A=a(I,"LI",{});var H=i(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=a(H,"CODE",{});var Ze=i(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=a(H,"CODE",{});var He=i(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),me=p(I),L=a(I,"LI",{});var Le=i(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=a(Le,"CODE",{});var et=i(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(k),C=a(k,"P",{});var se=i(C);ce=n(se,`Note that when creating models and layers with
`),N=a(se,"A",{href:!0,rel:!0});var Re=i(N);ve=n(Re,"subclassing"),Re.forEach(t),ue=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(k,z){g(k,d,z),e(d,b),e(d,m),e(m,u),e(d,v),g(k,l,z),g(k,f,z),e(f,M),e(M,Fe),e(f,ke),e(f,S),e(S,pe),g(k,Z,z),g(k,E,z),e(E,xe),e(E,Q),e(Q,Be),e(E,ye),e(E,U),e(U,Ee),e(E,fe),e(E,X),e(X,Me),e(E,Te),e(E,R),e(R,ze),e(E,we),e(E,K),e(K,_e),e(E,Pe),g(k,te,z),g(k,j,z),e(j,q),e(q,je),e(q,G),e(G,ge),e(q,qe),e(q,J),e(J,he),e(j,be),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,me),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(k,ne,z),g(k,C,z),e(C,ce),e(C,N),e(N,ve),e(C,ue)},d(k){k&&t(d),k&&t(l),k&&t(f),k&&t(Z),k&&t(E),k&&t(te),k&&t(j),k&&t(ne),k&&t(C)}}}function EW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function MW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function zW(B){let d,b;return d=new de({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(){y(d.$$.fragment)},l(m){T(d.$$.fragment,m)},m(m,u){w(d,m,u),b=!0},p:le,i(m){b||($(d.$$.fragment,m),b=!0)},o(m){F(d.$$.fragment,m),b=!1},d(m){x(d,m)}}}function PW(B){let d,b,m,u,v,l,f,M,Fe,ke,S,pe,Z,E,xe,Q,Be,ye,U,Ee,fe,X,Me,Te,R,ze,we,K,_e,Pe,te,j,q,je,G,ge,qe,J,he,be,A,Ce,V,Ae,$e,D,Ne,me,L,Oe,W,Ie,ne,C,ce,N,ve,ue;return{c(){d=r("p"),b=o("TensorFlow models and layers in "),m=r("code"),u=o("transformers"),v=o(" accept two formats as input:"),l=c(),f=r("ul"),M=r("li"),Fe=o("having all inputs as keyword arguments (like PyTorch models), or"),ke=c(),S=r("li"),pe=o("having all inputs as a list, tuple or dict in the first positional argument."),Z=c(),E=r("p"),xe=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r("code"),Be=o("model.fit()"),ye=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=r("code"),Ee=o("model.fit()"),fe=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=r("code"),Me=o("fit()"),Te=o(" and "),R=r("code"),ze=o("predict()"),we=o(`, such as when creating your own layers or models with
the Keras `),K=r("code"),_e=o("Functional"),Pe=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=c(),j=r("ul"),q=r("li"),je=o("a single Tensor with "),G=r("code"),ge=o("input_ids"),qe=o(" only and nothing else: "),J=r("code"),he=o("model(input_ids)"),be=c(),A=r("li"),Ce=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=r("code"),Ae=o("model([input_ids, attention_mask])"),$e=o(" or "),D=r("code"),Ne=o("model([input_ids, attention_mask, token_type_ids])"),me=c(),L=r("li"),Oe=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r("code"),Ie=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ne=c(),C=r("p"),ce=o(`Note that when creating models and layers with
`),N=r("a"),ve=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(k){d=a(k,"P",{});var z=i(d);b=n(z,"TensorFlow models and layers in "),m=a(z,"CODE",{});var Ve=i(m);u=n(Ve,"transformers"),Ve.forEach(t),v=n(z," accept two formats as input:"),z.forEach(t),l=p(k),f=a(k,"UL",{});var oe=i(f);M=a(oe,"LI",{});var Ke=i(M);Fe=n(Ke,"having all inputs as keyword arguments (like PyTorch models), or"),Ke.forEach(t),ke=p(oe),S=a(oe,"LI",{});var Ge=i(S);pe=n(Ge,"having all inputs as a list, tuple or dict in the first positional argument."),Ge.forEach(t),oe.forEach(t),Z=p(k),E=a(k,"P",{});var P=i(E);xe=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=a(P,"CODE",{});var Ue=i(Q);Be=n(Ue,"model.fit()"),Ue.forEach(t),ye=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),U=a(P,"CODE",{});var Qe=i(U);Ee=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 `),X=a(P,"CODE",{});var re=i(X);Me=n(re,"fit()"),re.forEach(t),Te=n(P," and "),R=a(P,"CODE",{});var We=i(R);ze=n(We,"predict()"),We.forEach(t),we=n(P,`, such as when creating your own layers or models with
the Keras `),K=a(P,"CODE",{});var Je=i(K);_e=n(Je,"Functional"),Je.forEach(t),Pe=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),te=p(k),j=a(k,"UL",{});var I=i(j);q=a(I,"LI",{});var Y=i(q);je=n(Y,"a single Tensor with "),G=a(Y,"CODE",{});var Xe=i(G);ge=n(Xe,"input_ids"),Xe.forEach(t),qe=n(Y," only and nothing else: "),J=a(Y,"CODE",{});var Ye=i(J);he=n(Ye,"model(input_ids)"),Ye.forEach(t),Y.forEach(t),be=p(I),A=a(I,"LI",{});var H=i(A);Ce=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=a(H,"CODE",{});var Ze=i(V);Ae=n(Ze,"model([input_ids, attention_mask])"),Ze.forEach(t),$e=n(H," or "),D=a(H,"CODE",{});var He=i(D);Ne=n(He,"model([input_ids, attention_mask, token_type_ids])"),He.forEach(t),H.forEach(t),me=p(I),L=a(I,"LI",{});var Le=i(L);Oe=n(Le,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=a(Le,"CODE",{});var et=i(W);Ie=n(et,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),et.forEach(t),Le.forEach(t),I.forEach(t),ne=p(k),C=a(k,"P",{});var se=i(C);ce=n(se,`Note that when creating models and layers with
`),N=a(se,"A",{href:!0,rel:!0});var Re=i(N);ve=n(Re,"subclassing"),Re.forEach(t),ue=n(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){h(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(N,"rel","nofollow")},m(k,z){g(k,d,z),e(d,b),e(d,m),e(m,u),e(d,v),g(k,l,z),g(k,f,z),e(f,M),e(M,Fe),e(f,ke),e(f,S),e(S,pe),g(k,Z,z),g(k,E,z),e(E,xe),e(E,Q),e(Q,Be),e(E,ye),e(E,U),e(U,Ee),e(E,fe),e(E,X),e(X,Me),e(E,Te),e(E,R),e(R,ze),e(E,we),e(E,K),e(K,_e),e(E,Pe),g(k,te,z),g(k,j,z),e(j,q),e(q,je),e(q,G),e(G,ge),e(q,qe),e(q,J),e(J,he),e(j,be),e(j,A),e(A,Ce),e(A,V),e(V,Ae),e(A,$e),e(A,D),e(D,Ne),e(j,me),e(j,L),e(L,Oe),e(L,W),e(W,Ie),g(k,ne,z),g(k,C,z),e(C,ce),e(C,N),e(N,ve),e(C,ue)},d(k){k&&t(d),k&&t(l),k&&t(f),k&&t(Z),k&&t(E),k&&t(te),k&&t(j),k&&t(ne),k&&t(C)}}}function jW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function qW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function CW(B){let d,b;return d=new de({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(){y(d.$$.fragment)},l(m){T(d.$$.fragment,m)},m(m,u){w(d,m,u),b=!0},p:le,i(m){b||($(d.$$.fragment,m),b=!0)},o(m){F(d.$$.fragment,m),b=!1},d(m){x(d,m)}}}function AW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function NW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function OW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function IW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function LW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function DW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function SW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function UW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function WW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function HW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function RW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function KW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function QW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function VW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function GW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function JW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function XW(B){let d,b,m,u,v;return{c(){d=r("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),v=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=a(l,"P",{});var f=i(d);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(f,"CODE",{});var M=i(m);u=n(M,"Module"),M.forEach(t),v=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){g(l,d,f),e(d,b),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function YW(B){let d,b,m,u,v;return u=new de({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=r("p"),b=o("Example:"),m=c(),y(u.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=n(f,"Example:"),f.forEach(t),m=p(l),T(u.$$.fragment,l)},m(l,f){g(l,d,f),e(d,b),g(l,m,f),w(u,l,f),v=!0},p:le,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){F(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),x(u,l)}}}function ZW(B){let d,b,m,u,v,l,f,M,Fe,ke,S,pe,Z,E,xe,Q,Be,ye,U,Ee,fe,X,Me,Te,R,ze,we,K,_e,Pe,te,j,q,je,G,ge,qe,J,he,be,A,Ce,V,Ae,$e,D,Ne,me,L,Oe,W,Ie,ne,C,ce,N,ve,ue,k,z,Ve,oe,Ke,Ge,P,Ue,Qe,re,We,Je,I,Y,Xe,Ye,H,Ze,He,Le,et,se,Re,t2,Hi,o2,n2,s2,Ri,r2,Ki,a2,i2,l2,Jo,Nf,d2,c2,Qi,p2,h2,Vi,f2,m2,u2,Xo,Of,g2,_2,Gi,b2,v2,Ji,k2,y2,T2,Yo,If,w2,$2,Xi,F2,x2,Yi,B2,E2,fy,Zi,my,$t,el,M2,tl,z2,P2,j2,In,q2,ol,C2,A2,nl,N2,O2,I2,Zo,Lf,L2,D2,sl,S2,U2,rl,W2,H2,R2,en,Df,K2,Q2,al,V2,G2,il,J2,X2,Y2,rr,Sf,Z2,e$,ll,t$,o$,n$,Uf,dl,s$,r$,uy,cl,gy,ao,tn,Wf,a$,i$,pl,l$,d$,hl,c$,p$,h$,on,Hf,f$,m$,fl,u$,g$,ml,_$,b$,v$,nn,Rf,k$,y$,ul,T$,w$,gl,$$,F$,x$,Kf,_l,B$,E$,_y,bl,by,io,sn,Qf,M$,z$,vl,P$,j$,kl,q$,C$,A$,rn,Vf,N$,O$,yl,I$,L$,Tl,D$,S$,U$,ar,Gf,W$,H$,wl,R$,K$,Q$,Jf,$l,V$,G$,vy,Xf,Qu,J$,ky,ir,an,Yf,X$,Y$,Fl,Z$,eF,xl,tF,oF,nF,ln,Zf,sF,rF,Bl,aF,iF,El,lF,dF,yy,Ml,cF,Vu,pF,Ty,lr,zl,hF,Pl,fF,mF,uF,jl,gF,ql,_F,bF,wy,Cl,vF,Gu,kF,$y,em,Al,yF,Nl,TF,wF,Fy,Ol,$F,Ju,FF,xy,Ft,Il,xF,Ll,BF,EF,MF,Dl,zF,Sl,PF,jF,qF,Ul,CF,Wl,AF,NF,OF,Hl,IF,Rl,LF,DF,SF,Kl,UF,Ql,WF,HF,RF,Vl,KF,Gl,QF,VF,By,Ln,dr,Xu,Jl,GF,Yu,JF,Ey,ro,Xl,XF,Io,YF,tm,ZF,ex,om,tx,ox,Yl,nx,sx,rx,Dn,ax,nm,ix,lx,sm,dx,cx,px,cr,My,Sn,pr,Zu,Zl,hx,eg,fx,zy,tt,ed,mx,tg,ux,gx,td,_x,rm,bx,vx,kx,dn,od,yx,og,Tx,wx,nd,am,$x,ng,Fx,xx,im,Bx,sg,Ex,Mx,hr,sd,zx,rd,Px,rg,jx,qx,Cx,lo,ad,Ax,ag,Nx,Ox,fr,Ix,Un,Lx,ig,Dx,Sx,lg,Ux,Wx,Hx,lm,id,Py,Wn,mr,dg,ld,Rx,cg,Kx,jy,Bt,dd,Qx,cd,Vx,pg,Gx,Jx,Xx,pd,Yx,dm,Zx,e0,t0,cn,hd,o0,hg,n0,s0,fd,cm,r0,fg,a0,i0,pm,l0,mg,d0,c0,co,md,p0,ug,h0,f0,ur,m0,Hn,u0,gg,g0,_0,_g,b0,v0,qy,Rn,gr,bg,ud,k0,vg,y0,Cy,Et,gd,T0,Kn,w0,kg,$0,F0,yg,x0,B0,E0,_d,M0,Tg,z0,P0,j0,pn,bd,q0,vd,C0,wg,A0,N0,O0,_r,I0,hn,kd,L0,Qn,D0,$g,S0,U0,Fg,W0,H0,R0,br,Ay,Vn,vr,xg,yd,K0,Bg,Q0,Ny,Gn,Td,V0,wd,G0,hm,J0,X0,Oy,Jn,$d,Y0,Fd,Z0,fm,e4,t4,Iy,Lo,xd,o4,Bd,n4,mm,s4,r4,a4,kr,Ed,i4,Eg,l4,Ly,Xn,yr,Mg,Md,d4,zg,c4,Dy,ot,zd,p4,Pg,h4,f4,Pd,m4,um,u4,g4,_4,jd,b4,qd,v4,k4,y4,Cd,T4,Ad,w4,$4,F4,mt,x4,jg,B4,E4,qg,M4,z4,Cg,P4,j4,Ag,q4,C4,Ng,A4,N4,Og,O4,I4,L4,po,Nd,D4,Yn,S4,gm,U4,W4,Ig,H4,R4,K4,Tr,Q4,wr,Sy,Zn,$r,Lg,Od,V4,Dg,G4,Uy,Mt,Id,J4,es,X4,Sg,Y4,Z4,Ug,eB,tB,oB,Ld,nB,_m,sB,rB,aB,Dd,iB,Sd,lB,dB,cB,ho,Ud,pB,ts,hB,bm,fB,mB,Wg,uB,gB,_B,Fr,bB,xr,Wy,os,Br,Hg,Wd,vB,Rg,kB,Hy,zt,Hd,yB,Rd,TB,Kg,wB,$B,FB,Kd,xB,vm,BB,EB,MB,Qd,zB,Vd,PB,jB,qB,fo,Gd,CB,ns,AB,km,NB,OB,Qg,IB,LB,DB,Er,SB,Mr,Ry,ss,zr,Vg,Jd,UB,Gg,WB,Ky,Pt,Xd,HB,Yd,RB,Jg,KB,QB,VB,Zd,GB,ym,JB,XB,YB,ec,ZB,tc,eE,tE,oE,It,oc,nE,rs,sE,Tm,rE,aE,Xg,iE,lE,dE,Pr,cE,jr,pE,qr,Qy,as,Cr,Yg,nc,hE,Zg,fE,Vy,jt,sc,mE,rc,uE,e_,gE,_E,bE,ac,vE,wm,kE,yE,TE,ic,wE,lc,$E,FE,xE,mo,dc,BE,is,EE,$m,ME,zE,t_,PE,jE,qE,Ar,CE,Nr,Gy,ls,Or,o_,cc,AE,n_,NE,Jy,qt,pc,OE,s_,IE,LE,hc,DE,Fm,SE,UE,WE,fc,HE,mc,RE,KE,QE,ft,uc,VE,ds,GE,xm,JE,XE,r_,YE,ZE,e5,Ir,t5,Lr,o5,Dr,n5,Sr,s5,Ur,Xy,cs,Wr,a_,gc,r5,i_,a5,Yy,Ct,_c,i5,l_,l5,d5,bc,c5,Bm,p5,h5,f5,vc,m5,kc,u5,g5,_5,uo,yc,b5,ps,v5,Em,k5,y5,d_,T5,w5,$5,Hr,F5,Rr,Zy,hs,Kr,c_,Tc,x5,p_,B5,e1,At,wc,E5,h_,M5,z5,$c,P5,Mm,j5,q5,C5,Fc,A5,xc,N5,O5,I5,Lt,Bc,L5,fs,D5,zm,S5,U5,f_,W5,H5,R5,Qr,K5,Vr,Q5,Gr,t1,ms,Jr,m_,Ec,V5,u_,G5,o1,Nt,Mc,J5,us,X5,g_,Y5,Z5,__,eM,tM,oM,zc,nM,Pm,sM,rM,aM,Pc,iM,jc,lM,dM,cM,Dt,qc,pM,gs,hM,jm,fM,mM,b_,uM,gM,_M,Xr,bM,Yr,vM,Zr,n1,_s,ea,v_,Cc,kM,k_,yM,s1,ut,Ac,TM,y_,wM,$M,Nc,FM,qm,xM,BM,EM,Oc,MM,Ic,zM,PM,jM,ta,qM,go,Lc,CM,bs,AM,Cm,NM,OM,T_,IM,LM,DM,oa,SM,na,r1,vs,sa,w_,Dc,UM,$_,WM,a1,gt,Sc,HM,ks,RM,F_,KM,QM,x_,VM,GM,JM,Uc,XM,Am,YM,ZM,ez,Wc,tz,Hc,oz,nz,sz,ra,rz,_o,Rc,az,ys,iz,Nm,lz,dz,B_,cz,pz,hz,aa,fz,ia,i1,Ts,la,E_,Kc,mz,M_,uz,l1,ws,Qc,gz,St,Vc,_z,nt,bz,z_,vz,kz,P_,yz,Tz,j_,wz,$z,q_,Fz,xz,C_,Bz,Ez,A_,Mz,zz,N_,Pz,jz,qz,Gc,Jc,Cz,O_,Az,Nz,Oz,Xc,Iz,I_,Lz,Dz,Sz,ee,Uz,L_,Wz,Hz,D_,Rz,Kz,S_,Qz,Vz,U_,Gz,Jz,W_,Xz,Yz,H_,Zz,eP,R_,tP,oP,K_,nP,sP,Q_,rP,aP,V_,iP,lP,G_,dP,cP,J_,pP,hP,X_,fP,mP,Y_,uP,gP,Z_,_P,bP,eb,vP,kP,tb,yP,TP,ob,wP,$P,nb,FP,xP,sb,BP,EP,MP,da,d1,$s,ca,rb,Yc,zP,ab,PP,c1,_t,Zc,jP,ep,qP,ib,CP,AP,NP,tp,OP,Om,IP,LP,DP,op,SP,np,UP,WP,HP,pa,RP,Ut,sp,KP,Fs,QP,Im,VP,GP,lb,JP,XP,YP,ha,ZP,fa,ej,ma,p1,xs,ua,db,rp,tj,cb,oj,h1,bt,ap,nj,ip,sj,pb,rj,aj,ij,lp,lj,Lm,dj,cj,pj,dp,hj,cp,fj,mj,uj,ga,gj,bo,pp,_j,Bs,bj,Dm,vj,kj,hb,yj,Tj,wj,_a,$j,ba,f1,Es,va,fb,hp,Fj,mb,xj,m1,vt,fp,Bj,ub,Ej,Mj,mp,zj,Sm,Pj,jj,qj,up,Cj,gp,Aj,Nj,Oj,ka,Ij,Wt,_p,Lj,Ms,Dj,Um,Sj,Uj,gb,Wj,Hj,Rj,ya,Kj,Ta,Qj,wa,u1,zs,$a,_b,bp,Vj,bb,Gj,g1,kt,vp,Jj,vb,Xj,Yj,kp,Zj,Wm,eq,tq,oq,yp,nq,Tp,sq,rq,aq,Fa,iq,vo,wp,lq,Ps,dq,Hm,cq,pq,kb,hq,fq,mq,xa,uq,Ba,_1,js,Ea,yb,$p,gq,Tb,_q,b1,yt,Fp,bq,wb,vq,kq,xp,yq,Rm,Tq,wq,$q,Bp,Fq,Ep,xq,Bq,Eq,Ma,Mq,Ht,Mp,zq,qs,Pq,Km,jq,qq,$b,Cq,Aq,Nq,za,Oq,Pa,Iq,ja,v1,Cs,qa,Fb,zp,Lq,xb,Dq,k1,Tt,Pp,Sq,As,Uq,Bb,Wq,Hq,Eb,Rq,Kq,Qq,jp,Vq,Qm,Gq,Jq,Xq,qp,Yq,Cp,Zq,e3,t3,Ca,o3,Rt,Ap,n3,Ns,s3,Vm,r3,a3,Mb,i3,l3,d3,Aa,c3,Na,p3,Oa,y1,Os,Ia,zb,Np,h3,Pb,f3,T1,st,Op,m3,jb,u3,g3,Ip,_3,Gm,b3,v3,k3,Lp,y3,Dp,T3,w3,$3,qb,F3,x3,Do,Cb,Sp,B3,E3,Ab,Up,M3,z3,Nb,Wp,P3,j3,Ob,Hp,q3,C3,ko,Rp,A3,Is,N3,Ib,O3,I3,Lb,L3,D3,S3,La,U3,Da,w1,Ls,Sa,Db,Kp,W3,Sb,H3,$1,rt,Qp,R3,Ds,K3,Ub,Q3,V3,Wb,G3,J3,X3,Vp,Y3,Jm,Z3,eC,tC,Gp,oC,Jp,nC,sC,rC,Hb,aC,iC,So,Rb,Xp,lC,dC,Kb,Yp,cC,pC,Qb,Zp,hC,fC,Vb,eh,mC,uC,yo,th,gC,Ss,_C,Gb,bC,vC,Jb,kC,yC,TC,Ua,wC,Wa,F1,Us,Ha,Xb,oh,$C,Yb,FC,x1,at,nh,xC,Zb,BC,EC,sh,MC,Xm,zC,PC,jC,rh,qC,ah,CC,AC,NC,ev,OC,IC,Uo,tv,ih,LC,DC,ov,lh,SC,UC,nv,dh,WC,HC,sv,ch,RC,KC,To,ph,QC,Ws,VC,rv,GC,JC,av,XC,YC,ZC,Ra,e6,Ka,B1,Hs,Qa,iv,hh,t6,lv,o6,E1,it,fh,n6,mh,s6,dv,r6,a6,i6,uh,l6,Ym,d6,c6,p6,gh,h6,_h,f6,m6,u6,cv,g6,_6,Wo,pv,bh,b6,v6,hv,vh,k6,y6,fv,kh,T6,w6,mv,yh,$6,F6,wo,Th,x6,Rs,B6,uv,E6,M6,gv,z6,P6,j6,Va,q6,Ga,M1,Ks,Ja,_v,wh,C6,bv,A6,z1,lt,$h,N6,Fh,O6,vv,I6,L6,D6,xh,S6,Zm,U6,W6,H6,Bh,R6,Eh,K6,Q6,V6,kv,G6,J6,Ho,yv,Mh,X6,Y6,Tv,zh,Z6,e7,wv,Ph,t7,o7,$v,jh,n7,s7,$o,qh,r7,Qs,a7,Fv,i7,l7,xv,d7,c7,p7,Xa,h7,Ya,P1,Vs,Za,Bv,Ch,f7,Ev,m7,j1,dt,Ah,u7,Mv,g7,_7,Nh,b7,eu,v7,k7,y7,Oh,T7,Ih,w7,$7,F7,zv,x7,B7,Ro,Pv,Lh,E7,M7,jv,Dh,z7,P7,qv,Sh,j7,q7,Cv,Uh,C7,A7,Fo,Wh,N7,Gs,O7,Av,I7,L7,Nv,D7,S7,U7,ei,W7,ti,q1,Js,oi,Ov,Hh,H7,Iv,R7,C1,ct,Rh,K7,Lv,Q7,V7,Kh,G7,tu,J7,X7,Y7,Qh,Z7,Vh,e8,t8,o8,Dv,n8,s8,Ko,Sv,Gh,r8,a8,Uv,Jh,i8,l8,Wv,Xh,d8,c8,Hv,Yh,p8,h8,xo,Zh,f8,Xs,m8,Rv,u8,g8,Kv,_8,b8,v8,ni,k8,si,A1,Ys,ri,Qv,ef,y8,Vv,T8,N1,pt,tf,w8,Gv,$8,F8,of,x8,ou,B8,E8,M8,nf,z8,sf,P8,j8,q8,Jv,C8,A8,Qo,Xv,rf,N8,O8,Yv,af,I8,L8,Zv,lf,D8,S8,ek,df,U8,W8,Bo,cf,H8,Zs,R8,tk,K8,Q8,ok,V8,G8,J8,ai,X8,ii,O1,er,li,nk,pf,Y8,sk,Z8,I1,ht,hf,eA,tr,tA,rk,oA,nA,ak,sA,rA,aA,ff,iA,nu,lA,dA,cA,mf,pA,uf,hA,fA,mA,ik,uA,gA,Vo,lk,gf,_A,bA,dk,_f,vA,kA,ck,bf,yA,TA,pk,vf,wA,$A,Eo,kf,FA,or,xA,hk,BA,EA,fk,MA,zA,PA,di,jA,ci,L1;return l=new De({}),E=new De({}),ue=new De({}),Ue=new e2({props:{pipeline:"text-classification"}}),Zi=new e2({props:{pipeline:"token-classification"}}),cl=new e2({props:{pipeline:"fill-mask"}}),bl=new e2({props:{pipeline:"question-answering"}}),Jl=new De({}),Xl=new O({props:{name:"class transformers.BertConfig",anchor:"transformers.BertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 0"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the BERT model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/v4.25.1/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/v4.25.1/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/v4.25.1/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/v4.25.1/src/transformers/models/bert/configuration_bert.py#L72"}}),cr=new ie({props:{anchor:"transformers.BertConfig.example",$$slots:{default:[PU]},$$scope:{ctx:B}}}),Zl=new De({}),ed=new O({props:{name:"class transformers.BertTokenizer",anchor:"transformers.BertTokenizer",parameters:[{name:"vocab_file",val:""},{name:"do_lower_case",val:" = True"},{name:"do_basic_tokenize",val:" = True"},{name:"never_split",val:" = None"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BertTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.BertTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.BertTokenizer.do_basic_tokenize",description:`<strong>do_basic_tokenize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to do basic tokenization before WordPiece.`,name:"do_basic_tokenize"},{anchor:"transformers.BertTokenizer.never_split",description:`<strong>never_split</strong> (<code>Iterable</code>, <em>optional</em>) &#x2014;
Collection of tokens which will never be split during tokenization. Only has an effect when
<code>do_basic_tokenize=True</code>`,name:"never_split"},{anchor:"transformers.BertTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.BertTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.BertTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.BertTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.BertTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.BertTokenizer.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters.</p>
<p>This should likely be deactivated for Japanese (see this
<a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.BertTokenizer.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original BERT).`,name:"strip_accents"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/tokenization_bert.py#L137"}}),od=new O({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.BertTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.BertTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.BertTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/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>
`}}),sd=new O({props:{name:"get_special_tokens_mask",anchor:"transformers.BertTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.BertTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.BertTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.BertTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/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>
`}}),ad=new O({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.BertTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.BertTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.BertTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/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>
`}}),fr=new ie({props:{anchor:"transformers.BertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[jU]},$$scope:{ctx:B}}}),id=new O({props:{name:"save_vocabulary",anchor:"transformers.BertTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/tokenization_bert.py#L350"}}),ld=new De({}),dd=new O({props:{name:"class transformers.BertTokenizerFast",anchor:"transformers.BertTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"do_lower_case",val:" = True"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BertTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.BertTokenizerFast.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.BertTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.BertTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.BertTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.BertTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.BertTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.BertTokenizerFast.clean_text",description:`<strong>clean_text</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the text before tokenization by removing any control characters and replacing all
whitespaces by the classic one.`,name:"clean_text"},{anchor:"transformers.BertTokenizerFast.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters. This should likely be deactivated for Japanese (see <a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">this
issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.BertTokenizerFast.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original BERT).`,name:"strip_accents"},{anchor:"transformers.BertTokenizerFast.wordpieces_prefix",description:`<strong>wordpieces_prefix</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;##&quot;</code>) &#x2014;
The prefix for subwords.`,name:"wordpieces_prefix"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/tokenization_bert_fast.py#L161"}}),hd=new O({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.BertTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],parametersDescription:[{anchor:"transformers.BertTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.BertTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/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>
`}}),md=new O({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.BertTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.BertTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.BertTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/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>
`}}),ur=new ie({props:{anchor:"transformers.BertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[qU]},$$scope:{ctx:B}}}),ud=new De({}),gd=new O({props:{name:"class transformers.TFBertTokenizer",anchor:"transformers.TFBertTokenizer",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertTokenizer.vocab_list",description:`<strong>vocab_list</strong> (<code>list</code>) &#x2014;
List containing the vocabulary.`,name:"vocab_list"},{anchor:"transformers.TFBertTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.TFBertTokenizer.cls_token_id",description:`<strong>cls_token_id</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token_id"},{anchor:"transformers.TFBertTokenizer.sep_token_id",description:`<strong>sep_token_id</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token_id"},{anchor:"transformers.TFBertTokenizer.pad_token_id",description:`<strong>pad_token_id</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token_id"},{anchor:"transformers.TFBertTokenizer.padding",description:`<strong>padding</strong> (<code>str</code>, defaults to <code>&quot;longest&quot;</code>) &#x2014;
The type of padding to use. Can be either <code>&quot;longest&quot;</code>, to pad only up to the longest sample in the batch,
or \`&#x201C;max_length&#x201D;, to pad all inputs to the maximum length supported by the tokenizer.`,name:"padding"},{anchor:"transformers.TFBertTokenizer.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to truncate the sequence to the maximum length.`,name:"truncation"},{anchor:"transformers.TFBertTokenizer.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>, defaults to <code>512</code>) &#x2014;
The maximum length of the sequence, used for padding (if <code>padding</code> is &#x201C;max_length&#x201D;) and/or truncation (if
<code>truncation</code> is <code>True</code>).`,name:"max_length"},{anchor:"transformers.TFBertTokenizer.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set, the sequence will be padded to a multiple of this value.`,name:"pad_to_multiple_of"},{anchor:"transformers.TFBertTokenizer.return_token_type_ids",description:`<strong>return_token_type_ids</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to return token_type_ids.`,name:"return_token_type_ids"},{anchor:"transformers.TFBertTokenizer.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to return the attention_mask.`,name:"return_attention_mask"},{anchor:"transformers.TFBertTokenizer.use_fast_bert_tokenizer",description:`<strong>use_fast_bert_tokenizer</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to false will use standard TF Text BertTokenizer, making it servable by TF Serving.`,name:"use_fast_bert_tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/tokenization_bert_tf.py#L12"}}),bd=new O({props:{name:"from_pretrained",anchor:"transformers.TFBertTokenizer.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike]"},{name:"*init_inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertTokenizer.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
The name or path to the pre-trained tokenizer.`,name:"pretrained_model_name_or_path"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/tokenization_bert_tf.py#L130"}}),_r=new ie({props:{anchor:"transformers.TFBertTokenizer.from_pretrained.example",$$slots:{default:[CU]},$$scope:{ctx:B}}}),kd=new O({props:{name:"from_tokenizer",anchor:"transformers.TFBertTokenizer.from_tokenizer",parameters:[{name:"tokenizer",val:": PreTrainedTokenizerBase"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertTokenizer.from_tokenizer.tokenizer",description:`<strong>tokenizer</strong> (<code>PreTrainedTokenizerBase</code>) &#x2014;
The tokenizer to use to initialize the <code>TFBertTokenizer</code>.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/tokenization_bert_tf.py#L100"}}),br=new ie({props:{anchor:"transformers.TFBertTokenizer.from_tokenizer.example",$$slots:{default:[AU]},$$scope:{ctx:B}}}),yd=new De({}),Td=new O({props:{name:"class transformers.models.bert.modeling_bert.BertForPreTrainingOutput",anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prediction_logits",val:": FloatTensor = None"},{name:"seq_relationship_logits",val:": FloatTensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.`,name:"loss"},{anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"prediction_logits"},{anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput.seq_relationship_logits",description:`<strong>seq_relationship_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).`,name:"seq_relationship_logits"},{anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_bert.py#L770"}}),$d=new O({props:{name:"class transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput",anchor:"transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput",parameters:[{name:"loss",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"prediction_logits",val:": Tensor = None"},{name:"seq_relationship_logits",val:": Tensor = None"},{name:"hidden_states",val:": typing.Union[typing.Tuple[tensorflow.python.framework.ops.Tensor], tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"attentions",val:": typing.Union[typing.Tuple[tensorflow.python.framework.ops.Tensor], tensorflow.python.framework.ops.Tensor, NoneType] = None"}],parametersDescription:[{anchor:"transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"prediction_logits"},{anchor:"transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput.seq_relationship_logits",description:`<strong>seq_relationship_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).`,name:"seq_relationship_logits"},{anchor:"transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L935"}}),xd=new O({props:{name:"class transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput",anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput",parameters:[{name:"prediction_logits",val:": ndarray = None"},{name:"seq_relationship_logits",val:": ndarray = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[jax._src.numpy.ndarray.ndarray]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[jax._src.numpy.ndarray.ndarray]] = None"}],parametersDescription:[{anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"prediction_logits"},{anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.seq_relationship_logits",description:`<strong>seq_relationship_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).`,name:"seq_relationship_logits"},{anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L64"}}),Ed=new O({props:{name:"replace",anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/flax/struct.py#L108"}}),Md=new De({}),zd=new O({props:{name:"class transformers.BertModel",anchor:"transformers.BertModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.BertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_bert.py#L873"}}),Nd=new O({props:{name:"forward",anchor:"transformers.BertModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_bert.py#L912",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Tr=new Se({props:{$$slots:{default:[NU]},$$scope:{ctx:B}}}),wr=new ie({props:{anchor:"transformers.BertModel.forward.example",$$slots:{default:[OU]},$$scope:{ctx:B}}}),Od=new De({}),Id=new O({props:{name:"class transformers.BertForPreTraining",anchor:"transformers.BertForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1056"}}),Ud=new O({props:{name:"forward",anchor:"transformers.BertForPreTraining.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"next_sentence_label",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertForPreTraining.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1074",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/model_doc/bert#transformers.models.bert.modeling_bert.BertForPreTrainingOutput"
>transformers.models.bert.modeling_bert.BertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fr=new Se({props:{$$slots:{default:[IU]},$$scope:{ctx:B}}}),xr=new ie({props:{anchor:"transformers.BertForPreTraining.forward.example",$$slots:{default:[LU]},$$scope:{ctx:B}}}),Wd=new De({}),Hd=new O({props:{name:"class transformers.BertLMHeadModel",anchor:"transformers.BertLMHeadModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1162"}}),Gd=new O({props:{name:"forward",anchor:"transformers.BertLMHeadModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertLMHeadModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1185",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Er=new Se({props:{$$slots:{default:[DU]},$$scope:{ctx:B}}}),Mr=new ie({props:{anchor:"transformers.BertLMHeadModel.forward.example",$$slots:{default:[SU]},$$scope:{ctx:B}}}),Jd=new De({}),Xd=new O({props:{name:"class transformers.BertForMaskedLM",anchor:"transformers.BertForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1302"}}),oc=new O({props:{name:"forward",anchor:"transformers.BertForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1328",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Pr=new Se({props:{$$slots:{default:[UU]},$$scope:{ctx:B}}}),jr=new ie({props:{anchor:"transformers.BertForMaskedLM.forward.example",$$slots:{default:[WU]},$$scope:{ctx:B}}}),qr=new ie({props:{anchor:"transformers.BertForMaskedLM.forward.example-2",$$slots:{default:[HU]},$$scope:{ctx:B}}}),nc=new De({}),sc=new O({props:{name:"class transformers.BertForNextSentencePrediction",anchor:"transformers.BertForNextSentencePrediction",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1415"}}),dc=new O({props:{name:"forward",anchor:"transformers.BertForNextSentencePrediction.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BertForNextSentencePrediction.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1425",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ar=new Se({props:{$$slots:{default:[RU]},$$scope:{ctx:B}}}),Nr=new ie({props:{anchor:"transformers.BertForNextSentencePrediction.forward.example",$$slots:{default:[KU]},$$scope:{ctx:B}}}),cc=new De({}),pc=new O({props:{name:"class transformers.BertForSequenceClassification",anchor:"transformers.BertForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1520"}}),uc=new O({props:{name:"forward",anchor:"transformers.BertForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1536",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ir=new Se({props:{$$slots:{default:[QU]},$$scope:{ctx:B}}}),Lr=new ie({props:{anchor:"transformers.BertForSequenceClassification.forward.example",$$slots:{default:[VU]},$$scope:{ctx:B}}}),Dr=new ie({props:{anchor:"transformers.BertForSequenceClassification.forward.example-2",$$slots:{default:[GU]},$$scope:{ctx:B}}}),Sr=new ie({props:{anchor:"transformers.BertForSequenceClassification.forward.example-3",$$slots:{default:[JU]},$$scope:{ctx:B}}}),Ur=new ie({props:{anchor:"transformers.BertForSequenceClassification.forward.example-4",$$slots:{default:[XU]},$$scope:{ctx:B}}}),gc=new De({}),_c=new O({props:{name:"class transformers.BertForMultipleChoice",anchor:"transformers.BertForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1624"}}),yc=new O({props:{name:"forward",anchor:"transformers.BertForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1638",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Hr=new Se({props:{$$slots:{default:[YU]},$$scope:{ctx:B}}}),Rr=new ie({props:{anchor:"transformers.BertForMultipleChoice.forward.example",$$slots:{default:[ZU]},$$scope:{ctx:B}}}),Tc=new De({}),wc=new O({props:{name:"class transformers.BertForTokenClassification",anchor:"transformers.BertForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1719"}}),Bc=new O({props:{name:"forward",anchor:"transformers.BertForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1737",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qr=new Se({props:{$$slots:{default:[eW]},$$scope:{ctx:B}}}),Vr=new ie({props:{anchor:"transformers.BertForTokenClassification.forward.example",$$slots:{default:[tW]},$$scope:{ctx:B}}}),Gr=new ie({props:{anchor:"transformers.BertForTokenClassification.forward.example-2",$$slots:{default:[oW]},$$scope:{ctx:B}}}),Ec=new De({}),Mc=new O({props:{name:"class transformers.BertForQuestionAnswering",anchor:"transformers.BertForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1806"}}),qc=new O({props:{name:"forward",anchor:"transformers.BertForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"end_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_bert.py#L1820",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Xr=new Se({props:{$$slots:{default:[nW]},$$scope:{ctx:B}}}),Yr=new ie({props:{anchor:"transformers.BertForQuestionAnswering.forward.example",$$slots:{default:[sW]},$$scope:{ctx:B}}}),Zr=new ie({props:{anchor:"transformers.BertForQuestionAnswering.forward.example-2",$$slots:{default:[rW]},$$scope:{ctx:B}}}),Cc=new De({}),Ac=new O({props:{name:"class transformers.TFBertModel",anchor:"transformers.TFBertModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1067"}}),ta=new Se({props:{$$slots:{default:[aW]},$$scope:{ctx:B}}}),Lc=new O({props:{name:"call",anchor:"transformers.TFBertModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[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/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1073",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),oa=new Se({props:{$$slots:{default:[iW]},$$scope:{ctx:B}}}),na=new ie({props:{anchor:"transformers.TFBertModel.call.example",$$slots:{default:[lW]},$$scope:{ctx:B}}}),Dc=new De({}),Sc=new O({props:{name:"class transformers.TFBertForPreTraining",anchor:"transformers.TFBertForPreTraining",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1164"}}),ra=new Se({props:{$$slots:{default:[dW]},$$scope:{ctx:B}}}),Rc=new O({props:{name:"call",anchor:"transformers.TFBertForPreTraining.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[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/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1186",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/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>
`}}),aa=new Se({props:{$$slots:{default:[cW]},$$scope:{ctx:B}}}),ia=new ie({props:{anchor:"transformers.TFBertForPreTraining.call.example",$$slots:{default:[pW]},$$scope:{ctx:B}}}),Kc=new De({}),Qc=new O({props:{name:"class transformers.TFBertLMHeadModel",anchor:"transformers.TFBertLMHeadModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1373"}}),Vc=new O({props:{name:"call",anchor:"transformers.TFBertLMHeadModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1410",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),da=new ie({props:{anchor:"transformers.TFBertLMHeadModel.call.example",$$slots:{default:[hW]},$$scope:{ctx:B}}}),Yc=new De({}),Zc=new O({props:{name:"class transformers.TFBertForMaskedLM",anchor:"transformers.TFBertForMaskedLM",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1281"}}),pa=new Se({props:{$$slots:{default:[fW]},$$scope:{ctx:B}}}),sp=new O({props:{name:"call",anchor:"transformers.TFBertForMaskedLM.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[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/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1309",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ha=new Se({props:{$$slots:{default:[mW]},$$scope:{ctx:B}}}),fa=new ie({props:{anchor:"transformers.TFBertForMaskedLM.call.example",$$slots:{default:[uW]},$$scope:{ctx:B}}}),ma=new ie({props:{anchor:"transformers.TFBertForMaskedLM.call.example-2",$$slots:{default:[gW]},$$scope:{ctx:B}}}),rp=new De({}),ap=new O({props:{name:"class transformers.TFBertForNextSentencePrediction",anchor:"transformers.TFBertForNextSentencePrediction",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1523"}}),ga=new Se({props:{$$slots:{default:[_W]},$$scope:{ctx:B}}}),pp=new O({props:{name:"call",anchor:"transformers.TFBertForNextSentencePrediction.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[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/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1533",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_tf_outputs.TFNextSentencePredictorOutput"
>transformers.modeling_tf_outputs.TFNextSentencePredictorOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),_a=new Se({props:{$$slots:{default:[bW]},$$scope:{ctx:B}}}),ba=new ie({props:{anchor:"transformers.TFBertForNextSentencePrediction.call.example",$$slots:{default:[vW]},$$scope:{ctx:B}}}),hp=new De({}),fp=new O({props:{name:"class transformers.TFBertForSequenceClassification",anchor:"transformers.TFBertForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1614"}}),ka=new Se({props:{$$slots:{default:[kW]},$$scope:{ctx:B}}}),_p=new O({props:{name:"call",anchor:"transformers.TFBertForSequenceClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[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/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1635",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ya=new Se({props:{$$slots:{default:[yW]},$$scope:{ctx:B}}}),Ta=new ie({props:{anchor:"transformers.TFBertForSequenceClassification.call.example",$$slots:{default:[TW]},$$scope:{ctx:B}}}),wa=new ie({props:{anchor:"transformers.TFBertForSequenceClassification.call.example-2",$$slots:{default:[wW]},$$scope:{ctx:B}}}),bp=new De({}),vp=new O({props:{name:"class transformers.TFBertForMultipleChoice",anchor:"transformers.TFBertForMultipleChoice",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1707"}}),Fa=new Se({props:{$$slots:{default:[$W]},$$scope:{ctx:B}}}),wp=new O({props:{name:"call",anchor:"transformers.TFBertForMultipleChoice.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[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/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1731",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),xa=new Se({props:{$$slots:{default:[FW]},$$scope:{ctx:B}}}),Ba=new ie({props:{anchor:"transformers.TFBertForMultipleChoice.call.example",$$slots:{default:[xW]},$$scope:{ctx:B}}}),$p=new De({}),Fp=new O({props:{name:"class transformers.TFBertForTokenClassification",anchor:"transformers.TFBertForTokenClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1837"}}),Ma=new Se({props:{$$slots:{default:[BW]},$$scope:{ctx:B}}}),Mp=new O({props:{name:"call",anchor:"transformers.TFBertForTokenClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[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/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1864",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),za=new Se({props:{$$slots:{default:[EW]},$$scope:{ctx:B}}}),Pa=new ie({props:{anchor:"transformers.TFBertForTokenClassification.call.example",$$slots:{default:[MW]},$$scope:{ctx:B}}}),ja=new ie({props:{anchor:"transformers.TFBertForTokenClassification.call.example-2",$$slots:{default:[zW]},$$scope:{ctx:B}}}),zp=new De({}),Pp=new O({props:{name:"class transformers.TFBertForQuestionAnswering",anchor:"transformers.TFBertForQuestionAnswering",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1934"}}),Ca=new Se({props:{$$slots:{default:[PW]},$$scope:{ctx:B}}}),Ap=new O({props:{name:"call",anchor:"transformers.TFBertForQuestionAnswering.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[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/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/src/transformers/models/bert/modeling_tf_bert.py#L1956",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Aa=new Se({props:{$$slots:{default:[jW]},$$scope:{ctx:B}}}),Na=new ie({props:{anchor:"transformers.TFBertForQuestionAnswering.call.example",$$slots:{default:[qW]},$$scope:{ctx:B}}}),Oa=new ie({props:{anchor:"transformers.TFBertForQuestionAnswering.call.example-2",$$slots:{default:[CW]},$$scope:{ctx:B}}}),Np=new De({}),Op=new O({props:{name:"class transformers.FlaxBertModel",anchor:"transformers.FlaxBertModel",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L1031"}}),Rp=new O({props:{name:"__call__",anchor:"transformers.FlaxBertModel.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L858",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),La=new Se({props:{$$slots:{default:[AW]},$$scope:{ctx:B}}}),Da=new ie({props:{anchor:"transformers.FlaxBertModel.__call__.example",$$slots:{default:[NW]},$$scope:{ctx:B}}}),Kp=new De({}),Qp=new O({props:{name:"class transformers.FlaxBertForPreTraining",anchor:"transformers.FlaxBertForPreTraining",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L1109"}}),th=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForPreTraining.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForPreTraining.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L858",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/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>
`}}),Ua=new Se({props:{$$slots:{default:[OW]},$$scope:{ctx:B}}}),Wa=new ie({props:{anchor:"transformers.FlaxBertForPreTraining.__call__.example",$$slots:{default:[IW]},$$scope:{ctx:B}}}),oh=new De({}),nh=new O({props:{name:"class transformers.FlaxBertForCausalLM",anchor:"transformers.FlaxBertForCausalLM",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L1686"}}),ph=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForCausalLM.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForCausalLM.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L858",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ra=new Se({props:{$$slots:{default:[LW]},$$scope:{ctx:B}}}),Ka=new ie({props:{anchor:"transformers.FlaxBertForCausalLM.__call__.example",$$slots:{default:[DW]},$$scope:{ctx:B}}}),hh=new De({}),fh=new O({props:{name:"class transformers.FlaxBertForMaskedLM",anchor:"transformers.FlaxBertForMaskedLM",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L1200"}}),Th=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForMaskedLM.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForMaskedLM.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L858",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Va=new Se({props:{$$slots:{default:[SW]},$$scope:{ctx:B}}}),Ga=new ie({props:{anchor:"transformers.FlaxBertForMaskedLM.__call__.example",$$slots:{default:[UW]},$$scope:{ctx:B}}}),wh=new De({}),$h=new O({props:{name:"class transformers.FlaxBertForNextSentencePrediction",anchor:"transformers.FlaxBertForNextSentencePrediction",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L1266"}}),qh=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForNextSentencePrediction.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForNextSentencePrediction.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L858",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput"
>transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Xa=new Se({props:{$$slots:{default:[WW]},$$scope:{ctx:B}}}),Ya=new ie({props:{anchor:"transformers.FlaxBertForNextSentencePrediction.__call__.example",$$slots:{default:[HW]},$$scope:{ctx:B}}}),Ch=new De({}),Ah=new O({props:{name:"class transformers.FlaxBertForSequenceClassification",anchor:"transformers.FlaxBertForSequenceClassification",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L1369"}}),Wh=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForSequenceClassification.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForSequenceClassification.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L858",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ei=new Se({props:{$$slots:{default:[RW]},$$scope:{ctx:B}}}),ti=new ie({props:{anchor:"transformers.FlaxBertForSequenceClassification.__call__.example",$$slots:{default:[KW]},$$scope:{ctx:B}}}),Hh=new De({}),Rh=new O({props:{name:"class transformers.FlaxBertForMultipleChoice",anchor:"transformers.FlaxBertForMultipleChoice",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L1450"}}),Zh=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForMultipleChoice.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForMultipleChoice.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L858",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput"
>transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ni=new Se({props:{$$slots:{default:[QW]},$$scope:{ctx:B}}}),si=new ie({props:{anchor:"transformers.FlaxBertForMultipleChoice.__call__.example",$$slots:{default:[VW]},$$scope:{ctx:B}}}),ef=new De({}),tf=new O({props:{name:"class transformers.FlaxBertForTokenClassification",anchor:"transformers.FlaxBertForTokenClassification",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L1528"}}),cf=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForTokenClassification.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForTokenClassification.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L858",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxTokenClassifierOutput"
>transformers.modeling_flax_outputs.FlaxTokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ai=new Se({props:{$$slots:{default:[GW]},$$scope:{ctx:B}}}),ii=new ie({props:{anchor:"transformers.FlaxBertForTokenClassification.__call__.example",$$slots:{default:[JW]},$$scope:{ctx:B}}}),pf=new De({}),hf=new O({props:{name:"class transformers.FlaxBertForQuestionAnswering",anchor:"transformers.FlaxBertForQuestionAnswering",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L1601"}}),kf=new O({props:{name:"__call__",anchor:"transformers.FlaxBertForQuestionAnswering.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForQuestionAnswering.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/bert/modeling_flax_bert.py#L858",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),di=new Se({props:{$$slots:{default:[XW]},$$scope:{ctx:B}}}),ci=new ie({props:{anchor:"transformers.FlaxBertForQuestionAnswering.__call__.example",$$slots:{default:[YW]},$$scope:{ctx:B}}}),{c(){d=r("meta"),b=c(),m=r("h1"),u=r("a"),v=r("span"),y(l.$$.fragment),f=c(),M=r("span"),Fe=o("BERT"),ke=c(),S=r("h2"),pe=r("a"),Z=r("span"),y(E.$$.fragment),xe=c(),Q=r("span"),Be=o("Overview"),ye=c(),U=r("p"),Ee=o("The BERT model was proposed in "),fe=r("a"),X=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.`),Te=c(),R=r("p"),ze=o("The abstract from the paper is the following:"),we=c(),K=r("p"),_e=r("em"),Pe=o(`We introduce a new language representation model called BERT, which stands for Bidirectional Encoder Representations
from Transformers. Unlike recent language representation models, BERT is designed to pre-train deep bidirectional
representations from unlabeled text by jointly conditioning on both left and right context in all layers. As a result,
the pre-trained BERT model can be fine-tuned with just one additional output layer to create state-of-the-art models
for a wide range of tasks, such as question answering and language inference, without substantial task-specific
architecture modifications.`),te=c(),j=r("p"),q=r("em"),je=o(`BERT is conceptually simple and empirically powerful. It obtains new state-of-the-art results on eleven natural
language processing tasks, including pushing the GLUE score to 80.5% (7.7% point absolute improvement), MultiNLI
accuracy to 86.7% (4.6% absolute improvement), SQuAD v1.1 question answering Test F1 to 93.2 (1.5 point absolute
improvement) and SQuAD v2.0 Test F1 to 83.1 (5.1 point absolute improvement).`),G=c(),ge=r("p"),qe=o("Tips:"),J=c(),he=r("ul"),be=r("li"),A=o(`BERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),Ce=c(),V=r("li"),Ae=o(`BERT was trained with the masked language modeling (MLM) and next sentence prediction (NSP) objectives. It is
efficient at predicting masked tokens and at NLU in general, but is not optimal for text generation.`),$e=c(),D=r("p"),Ne=o("This model was contributed by "),me=r("a"),L=o("thomwolf"),Oe=o(". The original code can be found "),W=r("a"),Ie=o("here"),ne=o("."),C=c(),ce=r("h2"),N=r("a"),ve=r("span"),y(ue.$$.fragment),k=c(),z=r("span"),Ve=o("Resources"),oe=c(),Ke=r("p"),Ge=o("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with BERT. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),P=c(),y(Ue.$$.fragment),Qe=c(),re=r("ul"),We=r("li"),Je=o("A blog post on "),I=r("a"),Y=o("BERT Text Classification in a different language"),Xe=o("."),Ye=c(),H=r("li"),Ze=o("A notebook for "),He=r("a"),Le=o("Finetuning BERT (and friends) for multi-label text classification"),et=o("."),se=c(),Re=r("li"),t2=o("A notebook on how to "),Hi=r("a"),o2=o("Finetune BERT for multi-label classification using PyTorch"),n2=o(". \u{1F30E}"),s2=c(),Ri=r("li"),r2=o("A notebook on how to "),Ki=r("a"),a2=o("warm-start an EncoderDecoder model with BERT for summarization"),i2=o("."),l2=c(),Jo=r("li"),Nf=r("a"),d2=o("BertForSequenceClassification"),c2=o(" is supported by this "),Qi=r("a"),p2=o("example script"),h2=o(" and "),Vi=r("a"),f2=o("notebook"),m2=o("."),u2=c(),Xo=r("li"),Of=r("a"),g2=o("TFBertForSequenceClassification"),_2=o(" is supported by this "),Gi=r("a"),b2=o("example script"),v2=o(" and "),Ji=r("a"),k2=o("notebook"),y2=o("."),T2=c(),Yo=r("li"),If=r("a"),w2=o("FlaxBertForSequenceClassification"),$2=o(" is supported by this "),Xi=r("a"),F2=o("example script"),x2=o(" and "),Yi=r("a"),B2=o("notebook"),E2=o("."),fy=c(),y(Zi.$$.fragment),my=c(),$t=r("ul"),el=r("li"),M2=o("A blog post on how to use "),tl=r("a"),z2=o("Hugging Face Transformers with Keras: Fine-tune a non-English BERT for Named Entity Recognition"),P2=o("."),j2=c(),In=r("li"),q2=o("A notebook for "),ol=r("a"),C2=o("Finetuning BERT for named-entity recognition"),A2=o(" using only the first wordpiece of each word in the word label during tokenization. To propagate the label of the word to all wordpieces, see this "),nl=r("a"),N2=o("version"),O2=o(" of the notebook instead."),I2=c(),Zo=r("li"),Lf=r("a"),L2=o("BertForTokenClassification"),D2=o(" is supported by this "),sl=r("a"),S2=o("example script"),U2=o(" and "),rl=r("a"),W2=o("notebook"),H2=o("."),R2=c(),en=r("li"),Df=r("a"),K2=o("TFBertForTokenClassification"),Q2=o(" is supported by this "),al=r("a"),V2=o("example script"),G2=o(" and "),il=r("a"),J2=o("notebook"),X2=o("."),Y2=c(),rr=r("li"),Sf=r("a"),Z2=o("FlaxBertForTokenClassification"),e$=o(" is supported by this "),ll=r("a"),t$=o("example script"),o$=o("."),n$=c(),Uf=r("li"),dl=r("a"),s$=o("Token classification"),r$=o(" chapter of the \u{1F917} Hugging Face Course."),uy=c(),y(cl.$$.fragment),gy=c(),ao=r("ul"),tn=r("li"),Wf=r("a"),a$=o("BertForMaskedLM"),i$=o(" is supported by this "),pl=r("a"),l$=o("example script"),d$=o(" and "),hl=r("a"),c$=o("notebook"),p$=o("."),h$=c(),on=r("li"),Hf=r("a"),f$=o("TFBertForMaskedLM"),m$=o(" is supported by this "),fl=r("a"),u$=o("example script"),g$=o(" and "),ml=r("a"),_$=o("notebook"),b$=o("."),v$=c(),nn=r("li"),Rf=r("a"),k$=o("FlaxBertForMaskedLM"),y$=o(" is supported by this "),ul=r("a"),T$=o("example script"),w$=o(" and "),gl=r("a"),$$=o("notebook"),F$=o("."),x$=c(),Kf=r("li"),_l=r("a"),B$=o("Masked language modeling"),E$=o(" chapter of the \u{1F917} Hugging Face Course."),_y=c(),y(bl.$$.fragment),by=c(),io=r("ul"),sn=r("li"),Qf=r("a"),M$=o("BertForQuestionAnswering"),z$=o(" is supported by this "),vl=r("a"),P$=o("example script"),j$=o(" and "),kl=r("a"),q$=o("notebook"),C$=o("."),A$=c(),rn=r("li"),Vf=r("a"),N$=o("TFBertForQuestionAnswering"),O$=o(" is supported by this "),yl=r("a"),I$=o("example script"),L$=o(" and "),Tl=r("a"),D$=o("notebook"),S$=o("."),U$=c(),ar=r("li"),Gf=r("a"),W$=o("FlaxBertForQuestionAnswering"),H$=o(" is supported by this "),wl=r("a"),R$=o("example script"),K$=o("."),Q$=c(),Jf=r("li"),$l=r("a"),V$=o("Question answering"),G$=o(" chapter of the \u{1F917} Hugging Face Course."),vy=c(),Xf=r("p"),Qu=r("strong"),J$=o("Multiple choice"),ky=c(),ir=r("ul"),an=r("li"),Yf=r("a"),X$=o("BertForMultipleChoice"),Y$=o(" is supported by this "),Fl=r("a"),Z$=o("example script"),eF=o(" and "),xl=r("a"),tF=o("notebook"),oF=o("."),nF=c(),ln=r("li"),Zf=r("a"),sF=o("TFBertForMultipleChoice"),rF=o(" is supported by this "),Bl=r("a"),aF=o("example script"),iF=o(" and "),El=r("a"),lF=o("notebook"),dF=o("."),yy=c(),Ml=r("p"),cF=o("\u26A1\uFE0F "),Vu=r("strong"),pF=o("Inference"),Ty=c(),lr=r("ul"),zl=r("li"),hF=o("A blog post on how to "),Pl=r("a"),fF=o("Accelerate BERT inference with Hugging Face Transformers and AWS Inferentia"),mF=o("."),uF=c(),jl=r("li"),gF=o("A blog post on how to "),ql=r("a"),_F=o("Accelerate BERT inference with DeepSpeed-Inference on GPUs"),bF=o("."),wy=c(),Cl=r("p"),vF=o("\u2699\uFE0F "),Gu=r("strong"),kF=o("Pretraining"),$y=c(),em=r("ul"),Al=r("li"),yF=o("A blog post on "),Nl=r("a"),TF=o("Pre-Training BERT with Hugging Face Transformers and Habana Gaudi"),wF=o("."),Fy=c(),Ol=r("p"),$F=o("\u{1F680} "),Ju=r("strong"),FF=o("Deploy"),xy=c(),Ft=r("ul"),Il=r("li"),xF=o("A blog post on how to "),Ll=r("a"),BF=o("Convert Transformers to ONNX with Hugging Face Optimum"),EF=o("."),MF=c(),Dl=r("li"),zF=o("A blog post on how to "),Sl=r("a"),PF=o("Setup Deep Learning environment for Hugging Face Transformers with Habana Gaudi on AWS"),jF=o("."),qF=c(),Ul=r("li"),CF=o("A blog post on "),Wl=r("a"),AF=o("Autoscaling BERT with Hugging Face Transformers, Amazon SageMaker and Terraform module"),NF=o("."),OF=c(),Hl=r("li"),IF=o("A blog post on "),Rl=r("a"),LF=o("Serverless BERT with HuggingFace, AWS Lambda, and Docker"),DF=o("."),SF=c(),Kl=r("li"),UF=o("A blog post on "),Ql=r("a"),WF=o("Hugging Face Transformers BERT fine-tuning using Amazon SageMaker and Training Compiler"),HF=o("."),RF=c(),Vl=r("li"),KF=o("A blog post on "),Gl=r("a"),QF=o("Task-specific knowledge distillation for BERT using Transformers & Amazon SageMaker"),VF=o("."),By=c(),Ln=r("h2"),dr=r("a"),Xu=r("span"),y(Jl.$$.fragment),GF=c(),Yu=r("span"),JF=o("BertConfig"),Ey=c(),ro=r("div"),y(Xl.$$.fragment),XF=c(),Io=r("p"),YF=o("This is the configuration class to store the configuration of a "),tm=r("a"),ZF=o("BertModel"),ex=o(" or a "),om=r("a"),tx=o("TFBertModel"),ox=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
`),Yl=r("a"),nx=o("bert-base-uncased"),sx=o(" architecture."),rx=c(),Dn=r("p"),ax=o("Configuration objects inherit from "),nm=r("a"),ix=o("PretrainedConfig"),lx=o(` and can be used to control the model outputs. Read the
documentation from `),sm=r("a"),dx=o("PretrainedConfig"),cx=o(" for more information."),px=c(),y(cr.$$.fragment),My=c(),Sn=r("h2"),pr=r("a"),Zu=r("span"),y(Zl.$$.fragment),hx=c(),eg=r("span"),fx=o("BertTokenizer"),zy=c(),tt=r("div"),y(ed.$$.fragment),mx=c(),tg=r("p"),ux=o("Construct a BERT tokenizer. Based on WordPiece."),gx=c(),td=r("p"),_x=o("This tokenizer inherits from "),rm=r("a"),bx=o("PreTrainedTokenizer"),vx=o(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),kx=c(),dn=r("div"),y(od.$$.fragment),yx=c(),og=r("p"),Tx=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:`),wx=c(),nd=r("ul"),am=r("li"),$x=o("single sequence: "),ng=r("code"),Fx=o("[CLS] X [SEP]"),xx=c(),im=r("li"),Bx=o("pair of sequences: "),sg=r("code"),Ex=o("[CLS] A [SEP] B [SEP]"),Mx=c(),hr=r("div"),y(sd.$$.fragment),zx=c(),rd=r("p"),Px=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 `),rg=r("code"),jx=o("prepare_for_model"),qx=o(" method."),Cx=c(),lo=r("div"),y(ad.$$.fragment),Ax=c(),ag=r("p"),Nx=o("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),Ox=c(),y(fr.$$.fragment),Ix=c(),Un=r("p"),Lx=o("If "),ig=r("code"),Dx=o("token_ids_1"),Sx=o(" is "),lg=r("code"),Ux=o("None"),Wx=o(", this method only returns the first portion of the mask (0s)."),Hx=c(),lm=r("div"),y(id.$$.fragment),Py=c(),Wn=r("h2"),mr=r("a"),dg=r("span"),y(ld.$$.fragment),Rx=c(),cg=r("span"),Kx=o("BertTokenizerFast"),jy=c(),Bt=r("div"),y(dd.$$.fragment),Qx=c(),cd=r("p"),Vx=o("Construct a \u201Cfast\u201D BERT tokenizer (backed by HuggingFace\u2019s "),pg=r("em"),Gx=o("tokenizers"),Jx=o(" library). Based on WordPiece."),Xx=c(),pd=r("p"),Yx=o("This tokenizer inherits from "),dm=r("a"),Zx=o("PreTrainedTokenizerFast"),e0=o(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),t0=c(),cn=r("div"),y(hd.$$.fragment),o0=c(),hg=r("p"),n0=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:`),s0=c(),fd=r("ul"),cm=r("li"),r0=o("single sequence: "),fg=r("code"),a0=o("[CLS] X [SEP]"),i0=c(),pm=r("li"),l0=o("pair of sequences: "),mg=r("code"),d0=o("[CLS] A [SEP] B [SEP]"),c0=c(),co=r("div"),y(md.$$.fragment),p0=c(),ug=r("p"),h0=o("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),f0=c(),y(ur.$$.fragment),m0=c(),Hn=r("p"),u0=o("If "),gg=r("code"),g0=o("token_ids_1"),_0=o(" is "),_g=r("code"),b0=o("None"),v0=o(", this method only returns the first portion of the mask (0s)."),qy=c(),Rn=r("h2"),gr=r("a"),bg=r("span"),y(ud.$$.fragment),k0=c(),vg=r("span"),y0=o("TFBertTokenizer"),Cy=c(),Et=r("div"),y(gd.$$.fragment),T0=c(),Kn=r("p"),w0=o(`This is an in-graph tokenizer for BERT. It should be initialized similarly to other tokenizers, using the
`),kg=r("code"),$0=o("from_pretrained()"),F0=o(" method. It can also be initialized with the "),yg=r("code"),x0=o("from_tokenizer()"),B0=o(` method, which imports settings
from an existing standard tokenizer object.`),E0=c(),_d=r("p"),M0=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 `),Tg=r("code"),z0=o("tf.string"),P0=o(" inputs to outputs."),j0=c(),pn=r("div"),y(bd.$$.fragment),q0=c(),vd=r("p"),C0=o("Instantiate a "),wg=r("code"),A0=o("TFBertTokenizer"),N0=o(" from a pre-trained tokenizer."),O0=c(),y(_r.$$.fragment),I0=c(),hn=r("div"),y(kd.$$.fragment),L0=c(),Qn=r("p"),D0=o("Initialize a "),$g=r("code"),S0=o("TFBertTokenizer"),U0=o(" from an existing "),Fg=r("code"),W0=o("Tokenizer"),H0=o("."),R0=c(),y(br.$$.fragment),Ay=c(),Vn=r("h2"),vr=r("a"),xg=r("span"),y(yd.$$.fragment),K0=c(),Bg=r("span"),Q0=o("Bert specific outputs"),Ny=c(),Gn=r("div"),y(Td.$$.fragment),V0=c(),wd=r("p"),G0=o("Output type of "),hm=r("a"),J0=o("BertForPreTraining"),X0=o("."),Oy=c(),Jn=r("div"),y($d.$$.fragment),Y0=c(),Fd=r("p"),Z0=o("Output type of "),fm=r("a"),e4=o("TFBertForPreTraining"),t4=o("."),Iy=c(),Lo=r("div"),y(xd.$$.fragment),o4=c(),Bd=r("p"),n4=o("Output type of "),mm=r("a"),s4=o("BertForPreTraining"),r4=o("."),a4=c(),kr=r("div"),y(Ed.$$.fragment),i4=c(),Eg=r("p"),l4=o("\u201CReturns a new object replacing the specified fields with new values."),Ly=c(),Xn=r("h2"),yr=r("a"),Mg=r("span"),y(Md.$$.fragment),d4=c(),zg=r("span"),c4=o("BertModel"),Dy=c(),ot=r("div"),y(zd.$$.fragment),p4=c(),Pg=r("p"),h4=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),f4=c(),Pd=r("p"),m4=o("This model inherits from "),um=r("a"),u4=o("PreTrainedModel"),g4=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.)`),_4=c(),jd=r("p"),b4=o("This model is also a PyTorch "),qd=r("a"),v4=o("torch.nn.Module"),k4=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),y4=c(),Cd=r("p"),T4=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 `),Ad=r("a"),w4=o(`Attention is
all you need`),$4=o(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),F4=c(),mt=r("p"),x4=o("To behave as an decoder the model needs to be initialized with the "),jg=r("code"),B4=o("is_decoder"),E4=o(` argument of the configuration set
to `),qg=r("code"),M4=o("True"),z4=o(". To be used in a Seq2Seq model, the model needs to initialized with both "),Cg=r("code"),P4=o("is_decoder"),j4=o(` argument and
`),Ag=r("code"),q4=o("add_cross_attention"),C4=o(" set to "),Ng=r("code"),A4=o("True"),N4=o("; an "),Og=r("code"),O4=o("encoder_hidden_states"),I4=o(" is then expected as an input to the forward pass."),L4=c(),po=r("div"),y(Nd.$$.fragment),D4=c(),Yn=r("p"),S4=o("The "),gm=r("a"),U4=o("BertModel"),W4=o(" forward method, overrides the "),Ig=r("code"),H4=o("__call__"),R4=o(" special method."),K4=c(),y(Tr.$$.fragment),Q4=c(),y(wr.$$.fragment),Sy=c(),Zn=r("h2"),$r=r("a"),Lg=r("span"),y(Od.$$.fragment),V4=c(),Dg=r("span"),G4=o("BertForPreTraining"),Uy=c(),Mt=r("div"),y(Id.$$.fragment),J4=c(),es=r("p"),X4=o("Bert Model with two heads on top as done during the pretraining: a "),Sg=r("code"),Y4=o("masked language modeling"),Z4=o(" head and a "),Ug=r("code"),eB=o("next sentence prediction (classification)"),tB=o(" head."),oB=c(),Ld=r("p"),nB=o("This model inherits from "),_m=r("a"),sB=o("PreTrainedModel"),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.)`),aB=c(),Dd=r("p"),iB=o("This model is also a PyTorch "),Sd=r("a"),lB=o("torch.nn.Module"),dB=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),cB=c(),ho=r("div"),y(Ud.$$.fragment),pB=c(),ts=r("p"),hB=o("The "),bm=r("a"),fB=o("BertForPreTraining"),mB=o(" forward method, overrides the "),Wg=r("code"),uB=o("__call__"),gB=o(" special method."),_B=c(),y(Fr.$$.fragment),bB=c(),y(xr.$$.fragment),Wy=c(),os=r("h2"),Br=r("a"),Hg=r("span"),y(Wd.$$.fragment),vB=c(),Rg=r("span"),kB=o("BertLMHeadModel"),Hy=c(),zt=r("div"),y(Hd.$$.fragment),yB=c(),Rd=r("p"),TB=o("Bert Model with a "),Kg=r("code"),wB=o("language modeling"),$B=o(" head on top for CLM fine-tuning."),FB=c(),Kd=r("p"),xB=o("This model inherits from "),vm=r("a"),BB=o("PreTrainedModel"),EB=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.)`),MB=c(),Qd=r("p"),zB=o("This model is also a PyTorch "),Vd=r("a"),PB=o("torch.nn.Module"),jB=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),qB=c(),fo=r("div"),y(Gd.$$.fragment),CB=c(),ns=r("p"),AB=o("The "),km=r("a"),NB=o("BertLMHeadModel"),OB=o(" forward method, overrides the "),Qg=r("code"),IB=o("__call__"),LB=o(" special method."),DB=c(),y(Er.$$.fragment),SB=c(),y(Mr.$$.fragment),Ry=c(),ss=r("h2"),zr=r("a"),Vg=r("span"),y(Jd.$$.fragment),UB=c(),Gg=r("span"),WB=o("BertForMaskedLM"),Ky=c(),Pt=r("div"),y(Xd.$$.fragment),HB=c(),Yd=r("p"),RB=o("Bert Model with a "),Jg=r("code"),KB=o("language modeling"),QB=o(" head on top."),VB=c(),Zd=r("p"),GB=o("This model inherits from "),ym=r("a"),JB=o("PreTrainedModel"),XB=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),YB=c(),ec=r("p"),ZB=o("This model is also a PyTorch "),tc=r("a"),eE=o("torch.nn.Module"),tE=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),oE=c(),It=r("div"),y(oc.$$.fragment),nE=c(),rs=r("p"),sE=o("The "),Tm=r("a"),rE=o("BertForMaskedLM"),aE=o(" forward method, overrides the "),Xg=r("code"),iE=o("__call__"),lE=o(" special method."),dE=c(),y(Pr.$$.fragment),cE=c(),y(jr.$$.fragment),pE=c(),y(qr.$$.fragment),Qy=c(),as=r("h2"),Cr=r("a"),Yg=r("span"),y(nc.$$.fragment),hE=c(),Zg=r("span"),fE=o("BertForNextSentencePrediction"),Vy=c(),jt=r("div"),y(sc.$$.fragment),mE=c(),rc=r("p"),uE=o("Bert Model with a "),e_=r("code"),gE=o("next sentence prediction (classification)"),_E=o(" head on top."),bE=c(),ac=r("p"),vE=o("This model inherits from "),wm=r("a"),kE=o("PreTrainedModel"),yE=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.)`),TE=c(),ic=r("p"),wE=o("This model is also a PyTorch "),lc=r("a"),$E=o("torch.nn.Module"),FE=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xE=c(),mo=r("div"),y(dc.$$.fragment),BE=c(),is=r("p"),EE=o("The "),$m=r("a"),ME=o("BertForNextSentencePrediction"),zE=o(" forward method, overrides the "),t_=r("code"),PE=o("__call__"),jE=o(" special method."),qE=c(),y(Ar.$$.fragment),CE=c(),y(Nr.$$.fragment),Gy=c(),ls=r("h2"),Or=r("a"),o_=r("span"),y(cc.$$.fragment),AE=c(),n_=r("span"),NE=o("BertForSequenceClassification"),Jy=c(),qt=r("div"),y(pc.$$.fragment),OE=c(),s_=r("p"),IE=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.`),LE=c(),hc=r("p"),DE=o("This model inherits from "),Fm=r("a"),SE=o("PreTrainedModel"),UE=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.)`),WE=c(),fc=r("p"),HE=o("This model is also a PyTorch "),mc=r("a"),RE=o("torch.nn.Module"),KE=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),QE=c(),ft=r("div"),y(uc.$$.fragment),VE=c(),ds=r("p"),GE=o("The "),xm=r("a"),JE=o("BertForSequenceClassification"),XE=o(" forward method, overrides the "),r_=r("code"),YE=o("__call__"),ZE=o(" special method."),e5=c(),y(Ir.$$.fragment),t5=c(),y(Lr.$$.fragment),o5=c(),y(Dr.$$.fragment),n5=c(),y(Sr.$$.fragment),s5=c(),y(Ur.$$.fragment),Xy=c(),cs=r("h2"),Wr=r("a"),a_=r("span"),y(gc.$$.fragment),r5=c(),i_=r("span"),a5=o("BertForMultipleChoice"),Yy=c(),Ct=r("div"),y(_c.$$.fragment),i5=c(),l_=r("p"),l5=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.`),d5=c(),bc=r("p"),c5=o("This model inherits from "),Bm=r("a"),p5=o("PreTrainedModel"),h5=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.)`),f5=c(),vc=r("p"),m5=o("This model is also a PyTorch "),kc=r("a"),u5=o("torch.nn.Module"),g5=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_5=c(),uo=r("div"),y(yc.$$.fragment),b5=c(),ps=r("p"),v5=o("The "),Em=r("a"),k5=o("BertForMultipleChoice"),y5=o(" forward method, overrides the "),d_=r("code"),T5=o("__call__"),w5=o(" special method."),$5=c(),y(Hr.$$.fragment),F5=c(),y(Rr.$$.fragment),Zy=c(),hs=r("h2"),Kr=r("a"),c_=r("span"),y(Tc.$$.fragment),x5=c(),p_=r("span"),B5=o("BertForTokenClassification"),e1=c(),At=r("div"),y(wc.$$.fragment),E5=c(),h_=r("p"),M5=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.`),z5=c(),$c=r("p"),P5=o("This model inherits from "),Mm=r("a"),j5=o("PreTrainedModel"),q5=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.)`),C5=c(),Fc=r("p"),A5=o("This model is also a PyTorch "),xc=r("a"),N5=o("torch.nn.Module"),O5=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),I5=c(),Lt=r("div"),y(Bc.$$.fragment),L5=c(),fs=r("p"),D5=o("The "),zm=r("a"),S5=o("BertForTokenClassification"),U5=o(" forward method, overrides the "),f_=r("code"),W5=o("__call__"),H5=o(" special method."),R5=c(),y(Qr.$$.fragment),K5=c(),y(Vr.$$.fragment),Q5=c(),y(Gr.$$.fragment),t1=c(),ms=r("h2"),Jr=r("a"),m_=r("span"),y(Ec.$$.fragment),V5=c(),u_=r("span"),G5=o("BertForQuestionAnswering"),o1=c(),Nt=r("div"),y(Mc.$$.fragment),J5=c(),us=r("p"),X5=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 `),g_=r("code"),Y5=o("span start logits"),Z5=o(" and "),__=r("code"),eM=o("span end logits"),tM=o(")."),oM=c(),zc=r("p"),nM=o("This model inherits from "),Pm=r("a"),sM=o("PreTrainedModel"),rM=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.)`),aM=c(),Pc=r("p"),iM=o("This model is also a PyTorch "),jc=r("a"),lM=o("torch.nn.Module"),dM=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),cM=c(),Dt=r("div"),y(qc.$$.fragment),pM=c(),gs=r("p"),hM=o("The "),jm=r("a"),fM=o("BertForQuestionAnswering"),mM=o(" forward method, overrides the "),b_=r("code"),uM=o("__call__"),gM=o(" special method."),_M=c(),y(Xr.$$.fragment),bM=c(),y(Yr.$$.fragment),vM=c(),y(Zr.$$.fragment),n1=c(),_s=r("h2"),ea=r("a"),v_=r("span"),y(Cc.$$.fragment),kM=c(),k_=r("span"),yM=o("TFBertModel"),s1=c(),ut=r("div"),y(Ac.$$.fragment),TM=c(),y_=r("p"),wM=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),$M=c(),Nc=r("p"),FM=o("This model inherits from "),qm=r("a"),xM=o("TFPreTrainedModel"),BM=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.)`),EM=c(),Oc=r("p"),MM=o("This model is also a "),Ic=r("a"),zM=o("tf.keras.Model"),PM=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.`),jM=c(),y(ta.$$.fragment),qM=c(),go=r("div"),y(Lc.$$.fragment),CM=c(),bs=r("p"),AM=o("The "),Cm=r("a"),NM=o("TFBertModel"),OM=o(" forward method, overrides the "),T_=r("code"),IM=o("__call__"),LM=o(" special method."),DM=c(),y(oa.$$.fragment),SM=c(),y(na.$$.fragment),r1=c(),vs=r("h2"),sa=r("a"),w_=r("span"),y(Dc.$$.fragment),UM=c(),$_=r("span"),WM=o("TFBertForPreTraining"),a1=c(),gt=r("div"),y(Sc.$$.fragment),HM=c(),ks=r("p"),RM=o(`Bert Model with two heads on top as done during the pretraining:
a `),F_=r("code"),KM=o("masked language modeling"),QM=o(" head and a "),x_=r("code"),VM=o("next sentence prediction (classification)"),GM=o(" head."),JM=c(),Uc=r("p"),XM=o("This model inherits from "),Am=r("a"),YM=o("TFPreTrainedModel"),ZM=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.)`),ez=c(),Wc=r("p"),tz=o("This model is also a "),Hc=r("a"),oz=o("tf.keras.Model"),nz=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.`),sz=c(),y(ra.$$.fragment),rz=c(),_o=r("div"),y(Rc.$$.fragment),az=c(),ys=r("p"),iz=o("The "),Nm=r("a"),lz=o("TFBertForPreTraining"),dz=o(" forward method, overrides the "),B_=r("code"),cz=o("__call__"),pz=o(" special method."),hz=c(),y(aa.$$.fragment),fz=c(),y(ia.$$.fragment),i1=c(),Ts=r("h2"),la=r("a"),E_=r("span"),y(Kc.$$.fragment),mz=c(),M_=r("span"),uz=o("TFBertModelLMHeadModel"),l1=c(),ws=r("div"),y(Qc.$$.fragment),gz=c(),St=r("div"),y(Vc.$$.fragment),_z=c(),nt=r("p"),bz=o("encoder_hidden_states  ("),z_=r("code"),vz=o("tf.Tensor"),kz=o(" of shape "),P_=r("code"),yz=o("(batch_size, sequence_length, hidden_size)"),Tz=o(", "),j_=r("em"),wz=o("optional"),$z=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 (`),q_=r("code"),Fz=o("tf.Tensor"),xz=o(" of shape "),C_=r("code"),Bz=o("(batch_size, sequence_length)"),Ez=o(", "),A_=r("em"),Mz=o("optional"),zz=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 `),N_=r("code"),Pz=o("[0, 1]"),jz=o(":"),qz=c(),Gc=r("ul"),Jc=r("li"),Cz=o("1 for tokens that are "),O_=r("strong"),Az=o("not masked"),Nz=o(","),Oz=c(),Xc=r("li"),Iz=o("0 for tokens that are "),I_=r("strong"),Lz=o("masked"),Dz=o("."),Sz=c(),ee=r("p"),Uz=o("past_key_values ("),L_=r("code"),Wz=o("Tuple[Tuple[tf.Tensor]]"),Hz=o(" of length "),D_=r("code"),Rz=o("config.n_layers"),Kz=o(`)
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),S_=r("code"),Qz=o("past_key_values"),Vz=o(" are used, the user can optionally input only the last "),U_=r("code"),Gz=o("decoder_input_ids"),Jz=o(` (those that
don\u2019t have their past key value states given to this model) of shape `),W_=r("code"),Xz=o("(batch_size, 1)"),Yz=o(` instead of all
`),H_=r("code"),Zz=o("decoder_input_ids"),eP=o(" of shape "),R_=r("code"),tP=o("(batch_size, sequence_length)"),oP=o(`.
use_cache (`),K_=r("code"),nP=o("bool"),sP=o(", "),Q_=r("em"),rP=o("optional"),aP=o(", defaults to "),V_=r("code"),iP=o("True"),lP=o(`):
If set to `),G_=r("code"),dP=o("True"),cP=o(", "),J_=r("code"),pP=o("past_key_values"),hP=o(` key value states are returned and can be used to speed up decoding (see
`),X_=r("code"),fP=o("past_key_values"),mP=o("). Set to "),Y_=r("code"),uP=o("False"),gP=o(" during training, "),Z_=r("code"),_P=o("True"),bP=o(` during generation
labels (`),eb=r("code"),vP=o("tf.Tensor"),kP=o(" or "),tb=r("code"),yP=o("np.ndarray"),TP=o(" of shape "),ob=r("code"),wP=o("(batch_size, sequence_length)"),$P=o(", "),nb=r("em"),FP=o("optional"),xP=o(`):
Labels for computing the cross entropy classification loss. Indices should be in `),sb=r("code"),BP=o("[0, ..., config.vocab_size - 1]"),EP=o("."),MP=c(),y(da.$$.fragment),d1=c(),$s=r("h2"),ca=r("a"),rb=r("span"),y(Yc.$$.fragment),zP=c(),ab=r("span"),PP=o("TFBertForMaskedLM"),c1=c(),_t=r("div"),y(Zc.$$.fragment),jP=c(),ep=r("p"),qP=o("Bert Model with a "),ib=r("code"),CP=o("language modeling"),AP=o(" head on top."),NP=c(),tp=r("p"),OP=o("This model inherits from "),Om=r("a"),IP=o("TFPreTrainedModel"),LP=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.)`),DP=c(),op=r("p"),SP=o("This model is also a "),np=r("a"),UP=o("tf.keras.Model"),WP=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.`),HP=c(),y(pa.$$.fragment),RP=c(),Ut=r("div"),y(sp.$$.fragment),KP=c(),Fs=r("p"),QP=o("The "),Im=r("a"),VP=o("TFBertForMaskedLM"),GP=o(" forward method, overrides the "),lb=r("code"),JP=o("__call__"),XP=o(" special method."),YP=c(),y(ha.$$.fragment),ZP=c(),y(fa.$$.fragment),ej=c(),y(ma.$$.fragment),p1=c(),xs=r("h2"),ua=r("a"),db=r("span"),y(rp.$$.fragment),tj=c(),cb=r("span"),oj=o("TFBertForNextSentencePrediction"),h1=c(),bt=r("div"),y(ap.$$.fragment),nj=c(),ip=r("p"),sj=o("Bert Model with a "),pb=r("code"),rj=o("next sentence prediction (classification)"),aj=o(" head on top."),ij=c(),lp=r("p"),lj=o("This model inherits from "),Lm=r("a"),dj=o("TFPreTrainedModel"),cj=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.)`),pj=c(),dp=r("p"),hj=o("This model is also a "),cp=r("a"),fj=o("tf.keras.Model"),mj=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.`),uj=c(),y(ga.$$.fragment),gj=c(),bo=r("div"),y(pp.$$.fragment),_j=c(),Bs=r("p"),bj=o("The "),Dm=r("a"),vj=o("TFBertForNextSentencePrediction"),kj=o(" forward method, overrides the "),hb=r("code"),yj=o("__call__"),Tj=o(" special method."),wj=c(),y(_a.$$.fragment),$j=c(),y(ba.$$.fragment),f1=c(),Es=r("h2"),va=r("a"),fb=r("span"),y(hp.$$.fragment),Fj=c(),mb=r("span"),xj=o("TFBertForSequenceClassification"),m1=c(),vt=r("div"),y(fp.$$.fragment),Bj=c(),ub=r("p"),Ej=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.`),Mj=c(),mp=r("p"),zj=o("This model inherits from "),Sm=r("a"),Pj=o("TFPreTrainedModel"),jj=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),qj=c(),up=r("p"),Cj=o("This model is also a "),gp=r("a"),Aj=o("tf.keras.Model"),Nj=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.`),Oj=c(),y(ka.$$.fragment),Ij=c(),Wt=r("div"),y(_p.$$.fragment),Lj=c(),Ms=r("p"),Dj=o("The "),Um=r("a"),Sj=o("TFBertForSequenceClassification"),Uj=o(" forward method, overrides the "),gb=r("code"),Wj=o("__call__"),Hj=o(" special method."),Rj=c(),y(ya.$$.fragment),Kj=c(),y(Ta.$$.fragment),Qj=c(),y(wa.$$.fragment),u1=c(),zs=r("h2"),$a=r("a"),_b=r("span"),y(bp.$$.fragment),Vj=c(),bb=r("span"),Gj=o("TFBertForMultipleChoice"),g1=c(),kt=r("div"),y(vp.$$.fragment),Jj=c(),vb=r("p"),Xj=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.`),Yj=c(),kp=r("p"),Zj=o("This model inherits from "),Wm=r("a"),eq=o("TFPreTrainedModel"),tq=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.)`),oq=c(),yp=r("p"),nq=o("This model is also a "),Tp=r("a"),sq=o("tf.keras.Model"),rq=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),aq=c(),y(Fa.$$.fragment),iq=c(),vo=r("div"),y(wp.$$.fragment),lq=c(),Ps=r("p"),dq=o("The "),Hm=r("a"),cq=o("TFBertForMultipleChoice"),pq=o(" forward method, overrides the "),kb=r("code"),hq=o("__call__"),fq=o(" special method."),mq=c(),y(xa.$$.fragment),uq=c(),y(Ba.$$.fragment),_1=c(),js=r("h2"),Ea=r("a"),yb=r("span"),y($p.$$.fragment),gq=c(),Tb=r("span"),_q=o("TFBertForTokenClassification"),b1=c(),yt=r("div"),y(Fp.$$.fragment),bq=c(),wb=r("p"),vq=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.`),kq=c(),xp=r("p"),yq=o("This model inherits from "),Rm=r("a"),Tq=o("TFPreTrainedModel"),wq=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.)`),$q=c(),Bp=r("p"),Fq=o("This model is also a "),Ep=r("a"),xq=o("tf.keras.Model"),Bq=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.`),Eq=c(),y(Ma.$$.fragment),Mq=c(),Ht=r("div"),y(Mp.$$.fragment),zq=c(),qs=r("p"),Pq=o("The "),Km=r("a"),jq=o("TFBertForTokenClassification"),qq=o(" forward method, overrides the "),$b=r("code"),Cq=o("__call__"),Aq=o(" special method."),Nq=c(),y(za.$$.fragment),Oq=c(),y(Pa.$$.fragment),Iq=c(),y(ja.$$.fragment),v1=c(),Cs=r("h2"),qa=r("a"),Fb=r("span"),y(zp.$$.fragment),Lq=c(),xb=r("span"),Dq=o("TFBertForQuestionAnswering"),k1=c(),Tt=r("div"),y(Pp.$$.fragment),Sq=c(),As=r("p"),Uq=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 `),Bb=r("code"),Wq=o("span start logits"),Hq=o(" and "),Eb=r("code"),Rq=o("span end logits"),Kq=o(")."),Qq=c(),jp=r("p"),Vq=o("This model inherits from "),Qm=r("a"),Gq=o("TFPreTrainedModel"),Jq=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.)`),Xq=c(),qp=r("p"),Yq=o("This model is also a "),Cp=r("a"),Zq=o("tf.keras.Model"),e3=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.`),t3=c(),y(Ca.$$.fragment),o3=c(),Rt=r("div"),y(Ap.$$.fragment),n3=c(),Ns=r("p"),s3=o("The "),Vm=r("a"),r3=o("TFBertForQuestionAnswering"),a3=o(" forward method, overrides the "),Mb=r("code"),i3=o("__call__"),l3=o(" special method."),d3=c(),y(Aa.$$.fragment),c3=c(),y(Na.$$.fragment),p3=c(),y(Oa.$$.fragment),y1=c(),Os=r("h2"),Ia=r("a"),zb=r("span"),y(Np.$$.fragment),h3=c(),Pb=r("span"),f3=o("FlaxBertModel"),T1=c(),st=r("div"),y(Op.$$.fragment),m3=c(),jb=r("p"),u3=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),g3=c(),Ip=r("p"),_3=o("This model inherits from "),Gm=r("a"),b3=o("FlaxPreTrainedModel"),v3=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)`),k3=c(),Lp=r("p"),y3=o("This model is also a Flax Linen "),Dp=r("a"),T3=o("flax.linen.Module"),w3=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.`),$3=c(),qb=r("p"),F3=o("Finally, this model supports inherent JAX features such as:"),x3=c(),Do=r("ul"),Cb=r("li"),Sp=r("a"),B3=o("Just-In-Time (JIT) compilation"),E3=c(),Ab=r("li"),Up=r("a"),M3=o("Automatic Differentiation"),z3=c(),Nb=r("li"),Wp=r("a"),P3=o("Vectorization"),j3=c(),Ob=r("li"),Hp=r("a"),q3=o("Parallelization"),C3=c(),ko=r("div"),y(Rp.$$.fragment),A3=c(),Is=r("p"),N3=o("The "),Ib=r("code"),O3=o("FlaxBertPreTrainedModel"),I3=o(" forward method, overrides the "),Lb=r("code"),L3=o("__call__"),D3=o(" special method."),S3=c(),y(La.$$.fragment),U3=c(),y(Da.$$.fragment),w1=c(),Ls=r("h2"),Sa=r("a"),Db=r("span"),y(Kp.$$.fragment),W3=c(),Sb=r("span"),H3=o("FlaxBertForPreTraining"),$1=c(),rt=r("div"),y(Qp.$$.fragment),R3=c(),Ds=r("p"),K3=o("Bert Model with two heads on top as done during the pretraining: a "),Ub=r("code"),Q3=o("masked language modeling"),V3=o(" head and a "),Wb=r("code"),G3=o("next sentence prediction (classification)"),J3=o(" head."),X3=c(),Vp=r("p"),Y3=o("This model inherits from "),Jm=r("a"),Z3=o("FlaxPreTrainedModel"),eC=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)`),tC=c(),Gp=r("p"),oC=o("This model is also a Flax Linen "),Jp=r("a"),nC=o("flax.linen.Module"),sC=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),rC=c(),Hb=r("p"),aC=o("Finally, this model supports inherent JAX features such as:"),iC=c(),So=r("ul"),Rb=r("li"),Xp=r("a"),lC=o("Just-In-Time (JIT) compilation"),dC=c(),Kb=r("li"),Yp=r("a"),cC=o("Automatic Differentiation"),pC=c(),Qb=r("li"),Zp=r("a"),hC=o("Vectorization"),fC=c(),Vb=r("li"),eh=r("a"),mC=o("Parallelization"),uC=c(),yo=r("div"),y(th.$$.fragment),gC=c(),Ss=r("p"),_C=o("The "),Gb=r("code"),bC=o("FlaxBertPreTrainedModel"),vC=o(" forward method, overrides the "),Jb=r("code"),kC=o("__call__"),yC=o(" special method."),TC=c(),y(Ua.$$.fragment),wC=c(),y(Wa.$$.fragment),F1=c(),Us=r("h2"),Ha=r("a"),Xb=r("span"),y(oh.$$.fragment),$C=c(),Yb=r("span"),FC=o("FlaxBertForCausalLM"),x1=c(),at=r("div"),y(nh.$$.fragment),xC=c(),Zb=r("p"),BC=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.`),EC=c(),sh=r("p"),MC=o("This model inherits from "),Xm=r("a"),zC=o("FlaxPreTrainedModel"),PC=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)`),jC=c(),rh=r("p"),qC=o("This model is also a Flax Linen "),ah=r("a"),CC=o("flax.linen.Module"),AC=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.`),NC=c(),ev=r("p"),OC=o("Finally, this model supports inherent JAX features such as:"),IC=c(),Uo=r("ul"),tv=r("li"),ih=r("a"),LC=o("Just-In-Time (JIT) compilation"),DC=c(),ov=r("li"),lh=r("a"),SC=o("Automatic Differentiation"),UC=c(),nv=r("li"),dh=r("a"),WC=o("Vectorization"),HC=c(),sv=r("li"),ch=r("a"),RC=o("Parallelization"),KC=c(),To=r("div"),y(ph.$$.fragment),QC=c(),Ws=r("p"),VC=o("The "),rv=r("code"),GC=o("FlaxBertPreTrainedModel"),JC=o(" forward method, overrides the "),av=r("code"),XC=o("__call__"),YC=o(" special method."),ZC=c(),y(Ra.$$.fragment),e6=c(),y(Ka.$$.fragment),B1=c(),Hs=r("h2"),Qa=r("a"),iv=r("span"),y(hh.$$.fragment),t6=c(),lv=r("span"),o6=o("FlaxBertForMaskedLM"),E1=c(),it=r("div"),y(fh.$$.fragment),n6=c(),mh=r("p"),s6=o("Bert Model with a "),dv=r("code"),r6=o("language modeling"),a6=o(" head on top."),i6=c(),uh=r("p"),l6=o("This model inherits from "),Ym=r("a"),d6=o("FlaxPreTrainedModel"),c6=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)`),p6=c(),gh=r("p"),h6=o("This model is also a Flax Linen "),_h=r("a"),f6=o("flax.linen.Module"),m6=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.`),u6=c(),cv=r("p"),g6=o("Finally, this model supports inherent JAX features such as:"),_6=c(),Wo=r("ul"),pv=r("li"),bh=r("a"),b6=o("Just-In-Time (JIT) compilation"),v6=c(),hv=r("li"),vh=r("a"),k6=o("Automatic Differentiation"),y6=c(),fv=r("li"),kh=r("a"),T6=o("Vectorization"),w6=c(),mv=r("li"),yh=r("a"),$6=o("Parallelization"),F6=c(),wo=r("div"),y(Th.$$.fragment),x6=c(),Rs=r("p"),B6=o("The "),uv=r("code"),E6=o("FlaxBertPreTrainedModel"),M6=o(" forward method, overrides the "),gv=r("code"),z6=o("__call__"),P6=o(" special method."),j6=c(),y(Va.$$.fragment),q6=c(),y(Ga.$$.fragment),M1=c(),Ks=r("h2"),Ja=r("a"),_v=r("span"),y(wh.$$.fragment),C6=c(),bv=r("span"),A6=o("FlaxBertForNextSentencePrediction"),z1=c(),lt=r("div"),y($h.$$.fragment),N6=c(),Fh=r("p"),O6=o("Bert Model with a "),vv=r("code"),I6=o("next sentence prediction (classification)"),L6=o(" head on top."),D6=c(),xh=r("p"),S6=o("This model inherits from "),Zm=r("a"),U6=o("FlaxPreTrainedModel"),W6=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)`),H6=c(),Bh=r("p"),R6=o("This model is also a Flax Linen "),Eh=r("a"),K6=o("flax.linen.Module"),Q6=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),V6=c(),kv=r("p"),G6=o("Finally, this model supports inherent JAX features such as:"),J6=c(),Ho=r("ul"),yv=r("li"),Mh=r("a"),X6=o("Just-In-Time (JIT) compilation"),Y6=c(),Tv=r("li"),zh=r("a"),Z6=o("Automatic Differentiation"),e7=c(),wv=r("li"),Ph=r("a"),t7=o("Vectorization"),o7=c(),$v=r("li"),jh=r("a"),n7=o("Parallelization"),s7=c(),$o=r("div"),y(qh.$$.fragment),r7=c(),Qs=r("p"),a7=o("The "),Fv=r("code"),i7=o("FlaxBertPreTrainedModel"),l7=o(" forward method, overrides the "),xv=r("code"),d7=o("__call__"),c7=o(" special method."),p7=c(),y(Xa.$$.fragment),h7=c(),y(Ya.$$.fragment),P1=c(),Vs=r("h2"),Za=r("a"),Bv=r("span"),y(Ch.$$.fragment),f7=c(),Ev=r("span"),m7=o("FlaxBertForSequenceClassification"),j1=c(),dt=r("div"),y(Ah.$$.fragment),u7=c(),Mv=r("p"),g7=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.`),_7=c(),Nh=r("p"),b7=o("This model inherits from "),eu=r("a"),v7=o("FlaxPreTrainedModel"),k7=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)`),y7=c(),Oh=r("p"),T7=o("This model is also a Flax Linen "),Ih=r("a"),w7=o("flax.linen.Module"),$7=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.`),F7=c(),zv=r("p"),x7=o("Finally, this model supports inherent JAX features such as:"),B7=c(),Ro=r("ul"),Pv=r("li"),Lh=r("a"),E7=o("Just-In-Time (JIT) compilation"),M7=c(),jv=r("li"),Dh=r("a"),z7=o("Automatic Differentiation"),P7=c(),qv=r("li"),Sh=r("a"),j7=o("Vectorization"),q7=c(),Cv=r("li"),Uh=r("a"),C7=o("Parallelization"),A7=c(),Fo=r("div"),y(Wh.$$.fragment),N7=c(),Gs=r("p"),O7=o("The "),Av=r("code"),I7=o("FlaxBertPreTrainedModel"),L7=o(" forward method, overrides the "),Nv=r("code"),D7=o("__call__"),S7=o(" special method."),U7=c(),y(ei.$$.fragment),W7=c(),y(ti.$$.fragment),q1=c(),Js=r("h2"),oi=r("a"),Ov=r("span"),y(Hh.$$.fragment),H7=c(),Iv=r("span"),R7=o("FlaxBertForMultipleChoice"),C1=c(),ct=r("div"),y(Rh.$$.fragment),K7=c(),Lv=r("p"),Q7=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.`),V7=c(),Kh=r("p"),G7=o("This model inherits from "),tu=r("a"),J7=o("FlaxPreTrainedModel"),X7=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)`),Y7=c(),Qh=r("p"),Z7=o("This model is also a Flax Linen "),Vh=r("a"),e8=o("flax.linen.Module"),t8=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.`),o8=c(),Dv=r("p"),n8=o("Finally, this model supports inherent JAX features such as:"),s8=c(),Ko=r("ul"),Sv=r("li"),Gh=r("a"),r8=o("Just-In-Time (JIT) compilation"),a8=c(),Uv=r("li"),Jh=r("a"),i8=o("Automatic Differentiation"),l8=c(),Wv=r("li"),Xh=r("a"),d8=o("Vectorization"),c8=c(),Hv=r("li"),Yh=r("a"),p8=o("Parallelization"),h8=c(),xo=r("div"),y(Zh.$$.fragment),f8=c(),Xs=r("p"),m8=o("The "),Rv=r("code"),u8=o("FlaxBertPreTrainedModel"),g8=o(" forward method, overrides the "),Kv=r("code"),_8=o("__call__"),b8=o(" special method."),v8=c(),y(ni.$$.fragment),k8=c(),y(si.$$.fragment),A1=c(),Ys=r("h2"),ri=r("a"),Qv=r("span"),y(ef.$$.fragment),y8=c(),Vv=r("span"),T8=o("FlaxBertForTokenClassification"),N1=c(),pt=r("div"),y(tf.$$.fragment),w8=c(),Gv=r("p"),$8=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.`),F8=c(),of=r("p"),x8=o("This model inherits from "),ou=r("a"),B8=o("FlaxPreTrainedModel"),E8=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)`),M8=c(),nf=r("p"),z8=o("This model is also a Flax Linen "),sf=r("a"),P8=o("flax.linen.Module"),j8=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.`),q8=c(),Jv=r("p"),C8=o("Finally, this model supports inherent JAX features such as:"),A8=c(),Qo=r("ul"),Xv=r("li"),rf=r("a"),N8=o("Just-In-Time (JIT) compilation"),O8=c(),Yv=r("li"),af=r("a"),I8=o("Automatic Differentiation"),L8=c(),Zv=r("li"),lf=r("a"),D8=o("Vectorization"),S8=c(),ek=r("li"),df=r("a"),U8=o("Parallelization"),W8=c(),Bo=r("div"),y(cf.$$.fragment),H8=c(),Zs=r("p"),R8=o("The "),tk=r("code"),K8=o("FlaxBertPreTrainedModel"),Q8=o(" forward method, overrides the "),ok=r("code"),V8=o("__call__"),G8=o(" special method."),J8=c(),y(ai.$$.fragment),X8=c(),y(ii.$$.fragment),O1=c(),er=r("h2"),li=r("a"),nk=r("span"),y(pf.$$.fragment),Y8=c(),sk=r("span"),Z8=o("FlaxBertForQuestionAnswering"),I1=c(),ht=r("div"),y(hf.$$.fragment),eA=c(),tr=r("p"),tA=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 `),rk=r("code"),oA=o("span start logits"),nA=o(" and "),ak=r("code"),sA=o("span end logits"),rA=o(")."),aA=c(),ff=r("p"),iA=o("This model inherits from "),nu=r("a"),lA=o("FlaxPreTrainedModel"),dA=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)`),cA=c(),mf=r("p"),pA=o("This model is also a Flax Linen "),uf=r("a"),hA=o("flax.linen.Module"),fA=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.`),mA=c(),ik=r("p"),uA=o("Finally, this model supports inherent JAX features such as:"),gA=c(),Vo=r("ul"),lk=r("li"),gf=r("a"),_A=o("Just-In-Time (JIT) compilation"),bA=c(),dk=r("li"),_f=r("a"),vA=o("Automatic Differentiation"),kA=c(),ck=r("li"),bf=r("a"),yA=o("Vectorization"),TA=c(),pk=r("li"),vf=r("a"),wA=o("Parallelization"),$A=c(),Eo=r("div"),y(kf.$$.fragment),FA=c(),or=r("p"),xA=o("The "),hk=r("code"),BA=o("FlaxBertPreTrainedModel"),EA=o(" forward method, overrides the "),fk=r("code"),MA=o("__call__"),zA=o(" special method."),PA=c(),y(di.$$.fragment),jA=c(),y(ci.$$.fragment),this.h()},l(s){const _=MU('[data-svelte="svelte-1phssyn"]',document.head);d=a(_,"META",{name:!0,content:!0}),_.forEach(t),b=p(s),m=a(s,"H1",{class:!0});var yf=i(m);u=a(yf,"A",{id:!0,class:!0,href:!0});var mk=i(u);v=a(mk,"SPAN",{});var uk=i(v);T(l.$$.fragment,uk),uk.forEach(t),mk.forEach(t),f=p(yf),M=a(yf,"SPAN",{});var gk=i(M);Fe=n(gk,"BERT"),gk.forEach(t),yf.forEach(t),ke=p(s),S=a(s,"H2",{class:!0});var Tf=i(S);pe=a(Tf,"A",{id:!0,class:!0,href:!0});var _k=i(pe);Z=a(_k,"SPAN",{});var bk=i(Z);T(E.$$.fragment,bk),bk.forEach(t),_k.forEach(t),xe=p(Tf),Q=a(Tf,"SPAN",{});var vk=i(Q);Be=n(vk,"Overview"),vk.forEach(t),Tf.forEach(t),ye=p(s),U=a(s,"P",{});var wf=i(U);Ee=n(wf,"The BERT model was proposed in "),fe=a(wf,"A",{href:!0,rel:!0});var kk=i(fe);X=n(kk,"BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding"),kk.forEach(t),Me=n(wf,` 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.`),wf.forEach(t),Te=p(s),R=a(s,"P",{});var yk=i(R);ze=n(yk,"The abstract from the paper is the following:"),yk.forEach(t),we=p(s),K=a(s,"P",{});var Tk=i(K);_e=a(Tk,"EM",{});var wk=i(_e);Pe=n(wk,`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.`),wk.forEach(t),Tk.forEach(t),te=p(s),j=a(s,"P",{});var $k=i(j);q=a($k,"EM",{});var Fk=i(q);je=n(Fk,`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).`),Fk.forEach(t),$k.forEach(t),G=p(s),ge=a(s,"P",{});var xk=i(ge);qe=n(xk,"Tips:"),xk.forEach(t),J=p(s),he=a(s,"UL",{});var $f=i(he);be=a($f,"LI",{});var Bk=i(be);A=n(Bk,`BERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),Bk.forEach(t),Ce=p($f),V=a($f,"LI",{});var Ek=i(V);Ae=n(Ek,`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.`),Ek.forEach(t),$f.forEach(t),$e=p(s),D=a(s,"P",{});var nr=i(D);Ne=n(nr,"This model was contributed by "),me=a(nr,"A",{href:!0,rel:!0});var Mk=i(me);L=n(Mk,"thomwolf"),Mk.forEach(t),Oe=n(nr,". The original code can be found "),W=a(nr,"A",{href:!0,rel:!0});var zk=i(W);Ie=n(zk,"here"),zk.forEach(t),ne=n(nr,"."),nr.forEach(t),C=p(s),ce=a(s,"H2",{class:!0});var Ff=i(ce);N=a(Ff,"A",{id:!0,class:!0,href:!0});var Pk=i(N);ve=a(Pk,"SPAN",{});var jk=i(ve);T(ue.$$.fragment,jk),jk.forEach(t),Pk.forEach(t),k=p(Ff),z=a(Ff,"SPAN",{});var qk=i(z);Ve=n(qk,"Resources"),qk.forEach(t),Ff.forEach(t),oe=p(s),Ke=a(s,"P",{});var Ck=i(Ke);Ge=n(Ck,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with BERT. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Ck.forEach(t),P=p(s),T(Ue.$$.fragment,s),Qe=p(s),re=a(s,"UL",{});var wt=i(re);We=a(wt,"LI",{});var xf=i(We);Je=n(xf,"A blog post on "),I=a(xf,"A",{href:!0,rel:!0});var Ak=i(I);Y=n(Ak,"BERT Text Classification in a different language"),Ak.forEach(t),Xe=n(xf,"."),xf.forEach(t),Ye=p(wt),H=a(wt,"LI",{});var Bf=i(H);Ze=n(Bf,"A notebook for "),He=a(Bf,"A",{href:!0,rel:!0});var Nk=i(He);Le=n(Nk,"Finetuning BERT (and friends) for multi-label text classification"),Nk.forEach(t),et=n(Bf,"."),Bf.forEach(t),se=p(wt),Re=a(wt,"LI",{});var Ef=i(Re);t2=n(Ef,"A notebook on how to "),Hi=a(Ef,"A",{href:!0,rel:!0});var Ok=i(Hi);o2=n(Ok,"Finetune BERT for multi-label classification using PyTorch"),Ok.forEach(t),n2=n(Ef,". \u{1F30E}"),Ef.forEach(t),s2=p(wt),Ri=a(wt,"LI",{});var Mf=i(Ri);r2=n(Mf,"A notebook on how to "),Ki=a(Mf,"A",{href:!0,rel:!0});var Ik=i(Ki);a2=n(Ik,"warm-start an EncoderDecoder model with BERT for summarization"),Ik.forEach(t),i2=n(Mf,"."),Mf.forEach(t),l2=p(wt),Jo=a(wt,"LI",{});var fn=i(Jo);Nf=a(fn,"A",{href:!0});var Lk=i(Nf);d2=n(Lk,"BertForSequenceClassification"),Lk.forEach(t),c2=n(fn," is supported by this "),Qi=a(fn,"A",{href:!0,rel:!0});var Dk=i(Qi);p2=n(Dk,"example script"),Dk.forEach(t),h2=n(fn," and "),Vi=a(fn,"A",{href:!0,rel:!0});var Sk=i(Vi);f2=n(Sk,"notebook"),Sk.forEach(t),m2=n(fn,"."),fn.forEach(t),u2=p(wt),Xo=a(wt,"LI",{});var mn=i(Xo);Of=a(mn,"A",{href:!0});var Uk=i(Of);g2=n(Uk,"TFBertForSequenceClassification"),Uk.forEach(t),_2=n(mn," is supported by this "),Gi=a(mn,"A",{href:!0,rel:!0});var Wk=i(Gi);b2=n(Wk,"example script"),Wk.forEach(t),v2=n(mn," and "),Ji=a(mn,"A",{href:!0,rel:!0});var Hk=i(Ji);k2=n(Hk,"notebook"),Hk.forEach(t),y2=n(mn,"."),mn.forEach(t),T2=p(wt),Yo=a(wt,"LI",{});var un=i(Yo);If=a(un,"A",{href:!0});var Rk=i(If);w2=n(Rk,"FlaxBertForSequenceClassification"),Rk.forEach(t),$2=n(un," is supported by this "),Xi=a(un,"A",{href:!0,rel:!0});var Kk=i(Xi);F2=n(Kk,"example script"),Kk.forEach(t),x2=n(un," and "),Yi=a(un,"A",{href:!0,rel:!0});var Qk=i(Yi);B2=n(Qk,"notebook"),Qk.forEach(t),E2=n(un,"."),un.forEach(t),wt.forEach(t),fy=p(s),T(Zi.$$.fragment,s),my=p(s),$t=a(s,"UL",{});var Ot=i($t);el=a(Ot,"LI",{});var zf=i(el);M2=n(zf,"A blog post on how to use "),tl=a(zf,"A",{href:!0,rel:!0});var Vk=i(tl);z2=n(Vk,"Hugging Face Transformers with Keras: Fine-tune a non-English BERT for Named Entity Recognition"),Vk.forEach(t),P2=n(zf,"."),zf.forEach(t),j2=p(Ot),In=a(Ot,"LI",{});var sr=i(In);q2=n(sr,"A notebook for "),ol=a(sr,"A",{href:!0,rel:!0});var Gk=i(ol);C2=n(Gk,"Finetuning BERT for named-entity recognition"),Gk.forEach(t),A2=n(sr," using only the first wordpiece of each word in the word label during tokenization. To propagate the label of the word to all wordpieces, see this "),nl=a(sr,"A",{href:!0,rel:!0});var Jk=i(nl);N2=n(Jk,"version"),Jk.forEach(t),O2=n(sr," of the notebook instead."),sr.forEach(t),I2=p(Ot),Zo=a(Ot,"LI",{});var gn=i(Zo);Lf=a(gn,"A",{href:!0});var Xk=i(Lf);L2=n(Xk,"BertForTokenClassification"),Xk.forEach(t),D2=n(gn," is supported by this "),sl=a(gn,"A",{href:!0,rel:!0});var Yk=i(sl);S2=n(Yk,"example script"),Yk.forEach(t),U2=n(gn," and "),rl=a(gn,"A",{href:!0,rel:!0});var Zk=i(rl);W2=n(Zk,"notebook"),Zk.forEach(t),H2=n(gn,"."),gn.forEach(t),R2=p(Ot),en=a(Ot,"LI",{});var _n=i(en);Df=a(_n,"A",{href:!0});var ey=i(Df);K2=n(ey,"TFBertForTokenClassification"),ey.forEach(t),Q2=n(_n," is supported by this "),al=a(_n,"A",{href:!0,rel:!0});var ty=i(al);V2=n(ty,"example script"),ty.forEach(t),G2=n(_n," and "),il=a(_n,"A",{href:!0,rel:!0});var oy=i(il);J2=n(oy,"notebook"),oy.forEach(t),X2=n(_n,"."),_n.forEach(t),Y2=p(Ot),rr=a(Ot,"LI",{});var pi=i(rr);Sf=a(pi,"A",{href:!0});var ny=i(Sf);Z2=n(ny,"FlaxBertForTokenClassification"),ny.forEach(t),e$=n(pi," is supported by this "),ll=a(pi,"A",{href:!0,rel:!0});var sy=i(ll);t$=n(sy,"example script"),sy.forEach(t),o$=n(pi,"."),pi.forEach(t),n$=p(Ot),Uf=a(Ot,"LI",{});var su=i(Uf);dl=a(su,"A",{href:!0,rel:!0});var ry=i(dl);s$=n(ry,"Token classification"),ry.forEach(t),r$=n(su," chapter of the \u{1F917} Hugging Face Course."),su.forEach(t),Ot.forEach(t),uy=p(s),T(cl.$$.fragment,s),gy=p(s),ao=a(s,"UL",{});var Go=i(ao);tn=a(Go,"LI",{});var bn=i(tn);Wf=a(bn,"A",{href:!0});var ay=i(Wf);a$=n(ay,"BertForMaskedLM"),ay.forEach(t),i$=n(bn," is supported by this "),pl=a(bn,"A",{href:!0,rel:!0});var iy=i(pl);l$=n(iy,"example script"),iy.forEach(t),d$=n(bn," and "),hl=a(bn,"A",{href:!0,rel:!0});var ly=i(hl);c$=n(ly,"notebook"),ly.forEach(t),p$=n(bn,"."),bn.forEach(t),h$=p(Go),on=a(Go,"LI",{});var vn=i(on);Hf=a(vn,"A",{href:!0});var dy=i(Hf);f$=n(dy,"TFBertForMaskedLM"),dy.forEach(t),m$=n(vn," is supported by this "),fl=a(vn,"A",{href:!0,rel:!0});var cy=i(fl);u$=n(cy,"example script"),cy.forEach(t),g$=n(vn," and "),ml=a(vn,"A",{href:!0,rel:!0});var py=i(ml);_$=n(py,"notebook"),py.forEach(t),b$=n(vn,"."),vn.forEach(t),v$=p(Go),nn=a(Go,"LI",{});var Pf=i(nn);Rf=a(Pf,"A",{href:!0});var UA=i(Rf);k$=n(UA,"FlaxBertForMaskedLM"),UA.forEach(t),y$=n(Pf," is supported by this "),ul=a(Pf,"A",{href:!0,rel:!0});var WA=i(ul);T$=n(WA,"example script"),WA.forEach(t),w$=n(Pf," and "),gl=a(Pf,"A",{href:!0,rel:!0});var HA=i(gl);$$=n(HA,"notebook"),HA.forEach(t),F$=n(Pf,"."),Pf.forEach(t),x$=p(Go),Kf=a(Go,"LI",{});var qA=i(Kf);_l=a(qA,"A",{href:!0,rel:!0});var RA=i(_l);B$=n(RA,"Masked language modeling"),RA.forEach(t),E$=n(qA," chapter of the \u{1F917} Hugging Face Course."),qA.forEach(t),Go.forEach(t),_y=p(s),T(bl.$$.fragment,s),by=p(s),io=a(s,"UL",{});var hi=i(io);sn=a(hi,"LI",{});var jf=i(sn);Qf=a(jf,"A",{href:!0});var KA=i(Qf);M$=n(KA,"BertForQuestionAnswering"),KA.forEach(t),z$=n(jf," is supported by this "),vl=a(jf,"A",{href:!0,rel:!0});var QA=i(vl);P$=n(QA,"example script"),QA.forEach(t),j$=n(jf," and "),kl=a(jf,"A",{href:!0,rel:!0});var VA=i(kl);q$=n(VA,"notebook"),VA.forEach(t),C$=n(jf,"."),jf.forEach(t),A$=p(hi),rn=a(hi,"LI",{});var qf=i(rn);Vf=a(qf,"A",{href:!0});var GA=i(Vf);N$=n(GA,"TFBertForQuestionAnswering"),GA.forEach(t),O$=n(qf," is supported by this "),yl=a(qf,"A",{href:!0,rel:!0});var JA=i(yl);I$=n(JA,"example script"),JA.forEach(t),L$=n(qf," and "),Tl=a(qf,"A",{href:!0,rel:!0});var XA=i(Tl);D$=n(XA,"notebook"),XA.forEach(t),S$=n(qf,"."),qf.forEach(t),U$=p(hi),ar=a(hi,"LI",{});var hy=i(ar);Gf=a(hy,"A",{href:!0});var YA=i(Gf);W$=n(YA,"FlaxBertForQuestionAnswering"),YA.forEach(t),H$=n(hy," is supported by this "),wl=a(hy,"A",{href:!0,rel:!0});var ZA=i(wl);R$=n(ZA,"example script"),ZA.forEach(t),K$=n(hy,"."),hy.forEach(t),Q$=p(hi),Jf=a(hi,"LI",{});var CA=i(Jf);$l=a(CA,"A",{href:!0,rel:!0});var eN=i($l);V$=n(eN,"Question answering"),eN.forEach(t),G$=n(CA," chapter of the \u{1F917} Hugging Face Course."),CA.forEach(t),hi.forEach(t),vy=p(s),Xf=a(s,"P",{});var tN=i(Xf);Qu=a(tN,"STRONG",{});var oN=i(Qu);J$=n(oN,"Multiple choice"),oN.forEach(t),tN.forEach(t),ky=p(s),ir=a(s,"UL",{});var D1=i(ir);an=a(D1,"LI",{});var Cf=i(an);Yf=a(Cf,"A",{href:!0});var nN=i(Yf);X$=n(nN,"BertForMultipleChoice"),nN.forEach(t),Y$=n(Cf," is supported by this "),Fl=a(Cf,"A",{href:!0,rel:!0});var sN=i(Fl);Z$=n(sN,"example script"),sN.forEach(t),eF=n(Cf," and "),xl=a(Cf,"A",{href:!0,rel:!0});var rN=i(xl);tF=n(rN,"notebook"),rN.forEach(t),oF=n(Cf,"."),Cf.forEach(t),nF=p(D1),ln=a(D1,"LI",{});var Af=i(ln);Zf=a(Af,"A",{href:!0});var aN=i(Zf);sF=n(aN,"TFBertForMultipleChoice"),aN.forEach(t),rF=n(Af," is supported by this "),Bl=a(Af,"A",{href:!0,rel:!0});var iN=i(Bl);aF=n(iN,"example script"),iN.forEach(t),iF=n(Af," and "),El=a(Af,"A",{href:!0,rel:!0});var lN=i(El);lF=n(lN,"notebook"),lN.forEach(t),dF=n(Af,"."),Af.forEach(t),D1.forEach(t),yy=p(s),Ml=a(s,"P",{});var AA=i(Ml);cF=n(AA,"\u26A1\uFE0F "),Vu=a(AA,"STRONG",{});var dN=i(Vu);pF=n(dN,"Inference"),dN.forEach(t),AA.forEach(t),Ty=p(s),lr=a(s,"UL",{});var S1=i(lr);zl=a(S1,"LI",{});var U1=i(zl);hF=n(U1,"A blog post on how to "),Pl=a(U1,"A",{href:!0,rel:!0});var cN=i(Pl);fF=n(cN,"Accelerate BERT inference with Hugging Face Transformers and AWS Inferentia"),cN.forEach(t),mF=n(U1,"."),U1.forEach(t),uF=p(S1),jl=a(S1,"LI",{});var W1=i(jl);gF=n(W1,"A blog post on how to "),ql=a(W1,"A",{href:!0,rel:!0});var pN=i(ql);_F=n(pN,"Accelerate BERT inference with DeepSpeed-Inference on GPUs"),pN.forEach(t),bF=n(W1,"."),W1.forEach(t),S1.forEach(t),wy=p(s),Cl=a(s,"P",{});var NA=i(Cl);vF=n(NA,"\u2699\uFE0F "),Gu=a(NA,"STRONG",{});var hN=i(Gu);kF=n(hN,"Pretraining"),hN.forEach(t),NA.forEach(t),$y=p(s),em=a(s,"UL",{});var fN=i(em);Al=a(fN,"LI",{});var H1=i(Al);yF=n(H1,"A blog post on "),Nl=a(H1,"A",{href:!0,rel:!0});var mN=i(Nl);TF=n(mN,"Pre-Training BERT with Hugging Face Transformers and Habana Gaudi"),mN.forEach(t),wF=n(H1,"."),H1.forEach(t),fN.forEach(t),Fy=p(s),Ol=a(s,"P",{});var OA=i(Ol);$F=n(OA,"\u{1F680} "),Ju=a(OA,"STRONG",{});var uN=i(Ju);FF=n(uN,"Deploy"),uN.forEach(t),OA.forEach(t),xy=p(s),Ft=a(s,"UL",{});var Mo=i(Ft);Il=a(Mo,"LI",{});var R1=i(Il);xF=n(R1,"A blog post on how to "),Ll=a(R1,"A",{href:!0,rel:!0});var gN=i(Ll);BF=n(gN,"Convert Transformers to ONNX with Hugging Face Optimum"),gN.forEach(t),EF=n(R1,"."),R1.forEach(t),MF=p(Mo),Dl=a(Mo,"LI",{});var K1=i(Dl);zF=n(K1,"A blog post on how to "),Sl=a(K1,"A",{href:!0,rel:!0});var _N=i(Sl);PF=n(_N,"Setup Deep Learning environment for Hugging Face Transformers with Habana Gaudi on AWS"),_N.forEach(t),jF=n(K1,"."),K1.forEach(t),qF=p(Mo),Ul=a(Mo,"LI",{});var Q1=i(Ul);CF=n(Q1,"A blog post on "),Wl=a(Q1,"A",{href:!0,rel:!0});var bN=i(Wl);AF=n(bN,"Autoscaling BERT with Hugging Face Transformers, Amazon SageMaker and Terraform module"),bN.forEach(t),NF=n(Q1,"."),Q1.forEach(t),OF=p(Mo),Hl=a(Mo,"LI",{});var V1=i(Hl);IF=n(V1,"A blog post on "),Rl=a(V1,"A",{href:!0,rel:!0});var vN=i(Rl);LF=n(vN,"Serverless BERT with HuggingFace, AWS Lambda, and Docker"),vN.forEach(t),DF=n(V1,"."),V1.forEach(t),SF=p(Mo),Kl=a(Mo,"LI",{});var G1=i(Kl);UF=n(G1,"A blog post on "),Ql=a(G1,"A",{href:!0,rel:!0});var kN=i(Ql);WF=n(kN,"Hugging Face Transformers BERT fine-tuning using Amazon SageMaker and Training Compiler"),kN.forEach(t),HF=n(G1,"."),G1.forEach(t),RF=p(Mo),Vl=a(Mo,"LI",{});var J1=i(Vl);KF=n(J1,"A blog post on "),Gl=a(J1,"A",{href:!0,rel:!0});var yN=i(Gl);QF=n(yN,"Task-specific knowledge distillation for BERT using Transformers & Amazon SageMaker"),yN.forEach(t),VF=n(J1,"."),J1.forEach(t),Mo.forEach(t),By=p(s),Ln=a(s,"H2",{class:!0});var X1=i(Ln);dr=a(X1,"A",{id:!0,class:!0,href:!0});var TN=i(dr);Xu=a(TN,"SPAN",{});var wN=i(Xu);T(Jl.$$.fragment,wN),wN.forEach(t),TN.forEach(t),GF=p(X1),Yu=a(X1,"SPAN",{});var $N=i(Yu);JF=n($N,"BertConfig"),$N.forEach(t),X1.forEach(t),Ey=p(s),ro=a(s,"DIV",{class:!0});var fi=i(ro);T(Xl.$$.fragment,fi),XF=p(fi),Io=a(fi,"P",{});var mi=i(Io);YF=n(mi,"This is the configuration class to store the configuration of a "),tm=a(mi,"A",{href:!0});var FN=i(tm);ZF=n(FN,"BertModel"),FN.forEach(t),ex=n(mi," or a "),om=a(mi,"A",{href:!0});var xN=i(om);tx=n(xN,"TFBertModel"),xN.forEach(t),ox=n(mi,`. 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
`),Yl=a(mi,"A",{href:!0,rel:!0});var BN=i(Yl);nx=n(BN,"bert-base-uncased"),BN.forEach(t),sx=n(mi," architecture."),mi.forEach(t),rx=p(fi),Dn=a(fi,"P",{});var ru=i(Dn);ax=n(ru,"Configuration objects inherit from "),nm=a(ru,"A",{href:!0});var EN=i(nm);ix=n(EN,"PretrainedConfig"),EN.forEach(t),lx=n(ru,` and can be used to control the model outputs. Read the
documentation from `),sm=a(ru,"A",{href:!0});var MN=i(sm);dx=n(MN,"PretrainedConfig"),MN.forEach(t),cx=n(ru," for more information."),ru.forEach(t),px=p(fi),T(cr.$$.fragment,fi),fi.forEach(t),My=p(s),Sn=a(s,"H2",{class:!0});var Y1=i(Sn);pr=a(Y1,"A",{id:!0,class:!0,href:!0});var zN=i(pr);Zu=a(zN,"SPAN",{});var PN=i(Zu);T(Zl.$$.fragment,PN),PN.forEach(t),zN.forEach(t),hx=p(Y1),eg=a(Y1,"SPAN",{});var jN=i(eg);fx=n(jN,"BertTokenizer"),jN.forEach(t),Y1.forEach(t),zy=p(s),tt=a(s,"DIV",{class:!0});var Kt=i(tt);T(ed.$$.fragment,Kt),mx=p(Kt),tg=a(Kt,"P",{});var qN=i(tg);ux=n(qN,"Construct a BERT tokenizer. Based on WordPiece."),qN.forEach(t),gx=p(Kt),td=a(Kt,"P",{});var Z1=i(td);_x=n(Z1,"This tokenizer inherits from "),rm=a(Z1,"A",{href:!0});var CN=i(rm);bx=n(CN,"PreTrainedTokenizer"),CN.forEach(t),vx=n(Z1,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Z1.forEach(t),kx=p(Kt),dn=a(Kt,"DIV",{class:!0});var au=i(dn);T(od.$$.fragment,au),yx=p(au),og=a(au,"P",{});var AN=i(og);Tx=n(AN,`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:`),AN.forEach(t),wx=p(au),nd=a(au,"UL",{});var eT=i(nd);am=a(eT,"LI",{});var IA=i(am);$x=n(IA,"single sequence: "),ng=a(IA,"CODE",{});var NN=i(ng);Fx=n(NN,"[CLS] X [SEP]"),NN.forEach(t),IA.forEach(t),xx=p(eT),im=a(eT,"LI",{});var LA=i(im);Bx=n(LA,"pair of sequences: "),sg=a(LA,"CODE",{});var ON=i(sg);Ex=n(ON,"[CLS] A [SEP] B [SEP]"),ON.forEach(t),LA.forEach(t),eT.forEach(t),au.forEach(t),Mx=p(Kt),hr=a(Kt,"DIV",{class:!0});var tT=i(hr);T(sd.$$.fragment,tT),zx=p(tT),rd=a(tT,"P",{});var oT=i(rd);Px=n(oT,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),rg=a(oT,"CODE",{});var IN=i(rg);jx=n(IN,"prepare_for_model"),IN.forEach(t),qx=n(oT," method."),oT.forEach(t),tT.forEach(t),Cx=p(Kt),lo=a(Kt,"DIV",{class:!0});var ui=i(lo);T(ad.$$.fragment,ui),Ax=p(ui),ag=a(ui,"P",{});var LN=i(ag);Nx=n(LN,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),LN.forEach(t),Ox=p(ui),T(fr.$$.fragment,ui),Ix=p(ui),Un=a(ui,"P",{});var iu=i(Un);Lx=n(iu,"If "),ig=a(iu,"CODE",{});var DN=i(ig);Dx=n(DN,"token_ids_1"),DN.forEach(t),Sx=n(iu," is "),lg=a(iu,"CODE",{});var SN=i(lg);Ux=n(SN,"None"),SN.forEach(t),Wx=n(iu,", this method only returns the first portion of the mask (0s)."),iu.forEach(t),ui.forEach(t),Hx=p(Kt),lm=a(Kt,"DIV",{class:!0});var UN=i(lm);T(id.$$.fragment,UN),UN.forEach(t),Kt.forEach(t),Py=p(s),Wn=a(s,"H2",{class:!0});var nT=i(Wn);mr=a(nT,"A",{id:!0,class:!0,href:!0});var WN=i(mr);dg=a(WN,"SPAN",{});var HN=i(dg);T(ld.$$.fragment,HN),HN.forEach(t),WN.forEach(t),Rx=p(nT),cg=a(nT,"SPAN",{});var RN=i(cg);Kx=n(RN,"BertTokenizerFast"),RN.forEach(t),nT.forEach(t),jy=p(s),Bt=a(s,"DIV",{class:!0});var kn=i(Bt);T(dd.$$.fragment,kn),Qx=p(kn),cd=a(kn,"P",{});var sT=i(cd);Vx=n(sT,"Construct a \u201Cfast\u201D BERT tokenizer (backed by HuggingFace\u2019s "),pg=a(sT,"EM",{});var KN=i(pg);Gx=n(KN,"tokenizers"),KN.forEach(t),Jx=n(sT," library). Based on WordPiece."),sT.forEach(t),Xx=p(kn),pd=a(kn,"P",{});var rT=i(pd);Yx=n(rT,"This tokenizer inherits from "),dm=a(rT,"A",{href:!0});var QN=i(dm);Zx=n(QN,"PreTrainedTokenizerFast"),QN.forEach(t),e0=n(rT,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),rT.forEach(t),t0=p(kn),cn=a(kn,"DIV",{class:!0});var lu=i(cn);T(hd.$$.fragment,lu),o0=p(lu),hg=a(lu,"P",{});var VN=i(hg);n0=n(VN,`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:`),VN.forEach(t),s0=p(lu),fd=a(lu,"UL",{});var aT=i(fd);cm=a(aT,"LI",{});var DA=i(cm);r0=n(DA,"single sequence: "),fg=a(DA,"CODE",{});var GN=i(fg);a0=n(GN,"[CLS] X [SEP]"),GN.forEach(t),DA.forEach(t),i0=p(aT),pm=a(aT,"LI",{});var SA=i(pm);l0=n(SA,"pair of sequences: "),mg=a(SA,"CODE",{});var JN=i(mg);d0=n(JN,"[CLS] A [SEP] B [SEP]"),JN.forEach(t),SA.forEach(t),aT.forEach(t),lu.forEach(t),c0=p(kn),co=a(kn,"DIV",{class:!0});var gi=i(co);T(md.$$.fragment,gi),p0=p(gi),ug=a(gi,"P",{});var XN=i(ug);h0=n(XN,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),XN.forEach(t),f0=p(gi),T(ur.$$.fragment,gi),m0=p(gi),Hn=a(gi,"P",{});var du=i(Hn);u0=n(du,"If "),gg=a(du,"CODE",{});var YN=i(gg);g0=n(YN,"token_ids_1"),YN.forEach(t),_0=n(du," is "),_g=a(du,"CODE",{});var ZN=i(_g);b0=n(ZN,"None"),ZN.forEach(t),v0=n(du,", this method only returns the first portion of the mask (0s)."),du.forEach(t),gi.forEach(t),kn.forEach(t),qy=p(s),Rn=a(s,"H2",{class:!0});var iT=i(Rn);gr=a(iT,"A",{id:!0,class:!0,href:!0});var eO=i(gr);bg=a(eO,"SPAN",{});var tO=i(bg);T(ud.$$.fragment,tO),tO.forEach(t),eO.forEach(t),k0=p(iT),vg=a(iT,"SPAN",{});var oO=i(vg);y0=n(oO,"TFBertTokenizer"),oO.forEach(t),iT.forEach(t),Cy=p(s),Et=a(s,"DIV",{class:!0});var yn=i(Et);T(gd.$$.fragment,yn),T0=p(yn),Kn=a(yn,"P",{});var cu=i(Kn);w0=n(cu,`This is an in-graph tokenizer for BERT. It should be initialized similarly to other tokenizers, using the
`),kg=a(cu,"CODE",{});var nO=i(kg);$0=n(nO,"from_pretrained()"),nO.forEach(t),F0=n(cu," method. It can also be initialized with the "),yg=a(cu,"CODE",{});var sO=i(yg);x0=n(sO,"from_tokenizer()"),sO.forEach(t),B0=n(cu,` method, which imports settings
from an existing standard tokenizer object.`),cu.forEach(t),E0=p(yn),_d=a(yn,"P",{});var lT=i(_d);M0=n(lT,`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 `),Tg=a(lT,"CODE",{});var rO=i(Tg);z0=n(rO,"tf.string"),rO.forEach(t),P0=n(lT," inputs to outputs."),lT.forEach(t),j0=p(yn),pn=a(yn,"DIV",{class:!0});var pu=i(pn);T(bd.$$.fragment,pu),q0=p(pu),vd=a(pu,"P",{});var dT=i(vd);C0=n(dT,"Instantiate a "),wg=a(dT,"CODE",{});var aO=i(wg);A0=n(aO,"TFBertTokenizer"),aO.forEach(t),N0=n(dT," from a pre-trained tokenizer."),dT.forEach(t),O0=p(pu),T(_r.$$.fragment,pu),pu.forEach(t),I0=p(yn),hn=a(yn,"DIV",{class:!0});var hu=i(hn);T(kd.$$.fragment,hu),L0=p(hu),Qn=a(hu,"P",{});var fu=i(Qn);D0=n(fu,"Initialize a "),$g=a(fu,"CODE",{});var iO=i($g);S0=n(iO,"TFBertTokenizer"),iO.forEach(t),U0=n(fu," from an existing "),Fg=a(fu,"CODE",{});var lO=i(Fg);W0=n(lO,"Tokenizer"),lO.forEach(t),H0=n(fu,"."),fu.forEach(t),R0=p(hu),T(br.$$.fragment,hu),hu.forEach(t),yn.forEach(t),Ay=p(s),Vn=a(s,"H2",{class:!0});var cT=i(Vn);vr=a(cT,"A",{id:!0,class:!0,href:!0});var dO=i(vr);xg=a(dO,"SPAN",{});var cO=i(xg);T(yd.$$.fragment,cO),cO.forEach(t),dO.forEach(t),K0=p(cT),Bg=a(cT,"SPAN",{});var pO=i(Bg);Q0=n(pO,"Bert specific outputs"),pO.forEach(t),cT.forEach(t),Ny=p(s),Gn=a(s,"DIV",{class:!0});var pT=i(Gn);T(Td.$$.fragment,pT),V0=p(pT),wd=a(pT,"P",{});var hT=i(wd);G0=n(hT,"Output type of "),hm=a(hT,"A",{href:!0});var hO=i(hm);J0=n(hO,"BertForPreTraining"),hO.forEach(t),X0=n(hT,"."),hT.forEach(t),pT.forEach(t),Oy=p(s),Jn=a(s,"DIV",{class:!0});var fT=i(Jn);T($d.$$.fragment,fT),Y0=p(fT),Fd=a(fT,"P",{});var mT=i(Fd);Z0=n(mT,"Output type of "),fm=a(mT,"A",{href:!0});var fO=i(fm);e4=n(fO,"TFBertForPreTraining"),fO.forEach(t),t4=n(mT,"."),mT.forEach(t),fT.forEach(t),Iy=p(s),Lo=a(s,"DIV",{class:!0});var mu=i(Lo);T(xd.$$.fragment,mu),o4=p(mu),Bd=a(mu,"P",{});var uT=i(Bd);n4=n(uT,"Output type of "),mm=a(uT,"A",{href:!0});var mO=i(mm);s4=n(mO,"BertForPreTraining"),mO.forEach(t),r4=n(uT,"."),uT.forEach(t),a4=p(mu),kr=a(mu,"DIV",{class:!0});var gT=i(kr);T(Ed.$$.fragment,gT),i4=p(gT),Eg=a(gT,"P",{});var uO=i(Eg);l4=n(uO,"\u201CReturns a new object replacing the specified fields with new values."),uO.forEach(t),gT.forEach(t),mu.forEach(t),Ly=p(s),Xn=a(s,"H2",{class:!0});var _T=i(Xn);yr=a(_T,"A",{id:!0,class:!0,href:!0});var gO=i(yr);Mg=a(gO,"SPAN",{});var _O=i(Mg);T(Md.$$.fragment,_O),_O.forEach(t),gO.forEach(t),d4=p(_T),zg=a(_T,"SPAN",{});var bO=i(zg);c4=n(bO,"BertModel"),bO.forEach(t),_T.forEach(t),Dy=p(s),ot=a(s,"DIV",{class:!0});var Qt=i(ot);T(zd.$$.fragment,Qt),p4=p(Qt),Pg=a(Qt,"P",{});var vO=i(Pg);h4=n(vO,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),vO.forEach(t),f4=p(Qt),Pd=a(Qt,"P",{});var bT=i(Pd);m4=n(bT,"This model inherits from "),um=a(bT,"A",{href:!0});var kO=i(um);u4=n(kO,"PreTrainedModel"),kO.forEach(t),g4=n(bT,`. 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.)`),bT.forEach(t),_4=p(Qt),jd=a(Qt,"P",{});var vT=i(jd);b4=n(vT,"This model is also a PyTorch "),qd=a(vT,"A",{href:!0,rel:!0});var yO=i(qd);v4=n(yO,"torch.nn.Module"),yO.forEach(t),k4=n(vT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),vT.forEach(t),y4=p(Qt),Cd=a(Qt,"P",{});var kT=i(Cd);T4=n(kT,`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 `),Ad=a(kT,"A",{href:!0,rel:!0});var TO=i(Ad);w4=n(TO,`Attention is
all you need`),TO.forEach(t),$4=n(kT,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),kT.forEach(t),F4=p(Qt),mt=a(Qt,"P",{});var Vt=i(mt);x4=n(Vt,"To behave as an decoder the model needs to be initialized with the "),jg=a(Vt,"CODE",{});var wO=i(jg);B4=n(wO,"is_decoder"),wO.forEach(t),E4=n(Vt,` argument of the configuration set
to `),qg=a(Vt,"CODE",{});var $O=i(qg);M4=n($O,"True"),$O.forEach(t),z4=n(Vt,". To be used in a Seq2Seq model, the model needs to initialized with both "),Cg=a(Vt,"CODE",{});var FO=i(Cg);P4=n(FO,"is_decoder"),FO.forEach(t),j4=n(Vt,` argument and
`),Ag=a(Vt,"CODE",{});var xO=i(Ag);q4=n(xO,"add_cross_attention"),xO.forEach(t),C4=n(Vt," set to "),Ng=a(Vt,"CODE",{});var BO=i(Ng);A4=n(BO,"True"),BO.forEach(t),N4=n(Vt,"; an "),Og=a(Vt,"CODE",{});var EO=i(Og);O4=n(EO,"encoder_hidden_states"),EO.forEach(t),I4=n(Vt," is then expected as an input to the forward pass."),Vt.forEach(t),L4=p(Qt),po=a(Qt,"DIV",{class:!0});var _i=i(po);T(Nd.$$.fragment,_i),D4=p(_i),Yn=a(_i,"P",{});var uu=i(Yn);S4=n(uu,"The "),gm=a(uu,"A",{href:!0});var MO=i(gm);U4=n(MO,"BertModel"),MO.forEach(t),W4=n(uu," forward method, overrides the "),Ig=a(uu,"CODE",{});var zO=i(Ig);H4=n(zO,"__call__"),zO.forEach(t),R4=n(uu," special method."),uu.forEach(t),K4=p(_i),T(Tr.$$.fragment,_i),Q4=p(_i),T(wr.$$.fragment,_i),_i.forEach(t),Qt.forEach(t),Sy=p(s),Zn=a(s,"H2",{class:!0});var yT=i(Zn);$r=a(yT,"A",{id:!0,class:!0,href:!0});var PO=i($r);Lg=a(PO,"SPAN",{});var jO=i(Lg);T(Od.$$.fragment,jO),jO.forEach(t),PO.forEach(t),V4=p(yT),Dg=a(yT,"SPAN",{});var qO=i(Dg);G4=n(qO,"BertForPreTraining"),qO.forEach(t),yT.forEach(t),Uy=p(s),Mt=a(s,"DIV",{class:!0});var Tn=i(Mt);T(Id.$$.fragment,Tn),J4=p(Tn),es=a(Tn,"P",{});var gu=i(es);X4=n(gu,"Bert Model with two heads on top as done during the pretraining: a "),Sg=a(gu,"CODE",{});var CO=i(Sg);Y4=n(CO,"masked language modeling"),CO.forEach(t),Z4=n(gu," head and a "),Ug=a(gu,"CODE",{});var AO=i(Ug);eB=n(AO,"next sentence prediction (classification)"),AO.forEach(t),tB=n(gu," head."),gu.forEach(t),oB=p(Tn),Ld=a(Tn,"P",{});var TT=i(Ld);nB=n(TT,"This model inherits from "),_m=a(TT,"A",{href:!0});var NO=i(_m);sB=n(NO,"PreTrainedModel"),NO.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),aB=p(Tn),Dd=a(Tn,"P",{});var wT=i(Dd);iB=n(wT,"This model is also a PyTorch "),Sd=a(wT,"A",{href:!0,rel:!0});var OO=i(Sd);lB=n(OO,"torch.nn.Module"),OO.forEach(t),dB=n(wT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),wT.forEach(t),cB=p(Tn),ho=a(Tn,"DIV",{class:!0});var bi=i(ho);T(Ud.$$.fragment,bi),pB=p(bi),ts=a(bi,"P",{});var _u=i(ts);hB=n(_u,"The "),bm=a(_u,"A",{href:!0});var IO=i(bm);fB=n(IO,"BertForPreTraining"),IO.forEach(t),mB=n(_u," forward method, overrides the "),Wg=a(_u,"CODE",{});var LO=i(Wg);uB=n(LO,"__call__"),LO.forEach(t),gB=n(_u," special method."),_u.forEach(t),_B=p(bi),T(Fr.$$.fragment,bi),bB=p(bi),T(xr.$$.fragment,bi),bi.forEach(t),Tn.forEach(t),Wy=p(s),os=a(s,"H2",{class:!0});var $T=i(os);Br=a($T,"A",{id:!0,class:!0,href:!0});var DO=i(Br);Hg=a(DO,"SPAN",{});var SO=i(Hg);T(Wd.$$.fragment,SO),SO.forEach(t),DO.forEach(t),vB=p($T),Rg=a($T,"SPAN",{});var UO=i(Rg);kB=n(UO,"BertLMHeadModel"),UO.forEach(t),$T.forEach(t),Hy=p(s),zt=a(s,"DIV",{class:!0});var wn=i(zt);T(Hd.$$.fragment,wn),yB=p(wn),Rd=a(wn,"P",{});var FT=i(Rd);TB=n(FT,"Bert Model with a "),Kg=a(FT,"CODE",{});var WO=i(Kg);wB=n(WO,"language modeling"),WO.forEach(t),$B=n(FT," head on top for CLM fine-tuning."),FT.forEach(t),FB=p(wn),Kd=a(wn,"P",{});var xT=i(Kd);xB=n(xT,"This model inherits from "),vm=a(xT,"A",{href:!0});var HO=i(vm);BB=n(HO,"PreTrainedModel"),HO.forEach(t),EB=n(xT,`. 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.)`),xT.forEach(t),MB=p(wn),Qd=a(wn,"P",{});var BT=i(Qd);zB=n(BT,"This model is also a PyTorch "),Vd=a(BT,"A",{href:!0,rel:!0});var RO=i(Vd);PB=n(RO,"torch.nn.Module"),RO.forEach(t),jB=n(BT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),BT.forEach(t),qB=p(wn),fo=a(wn,"DIV",{class:!0});var vi=i(fo);T(Gd.$$.fragment,vi),CB=p(vi),ns=a(vi,"P",{});var bu=i(ns);AB=n(bu,"The "),km=a(bu,"A",{href:!0});var KO=i(km);NB=n(KO,"BertLMHeadModel"),KO.forEach(t),OB=n(bu," forward method, overrides the "),Qg=a(bu,"CODE",{});var QO=i(Qg);IB=n(QO,"__call__"),QO.forEach(t),LB=n(bu," special method."),bu.forEach(t),DB=p(vi),T(Er.$$.fragment,vi),SB=p(vi),T(Mr.$$.fragment,vi),vi.forEach(t),wn.forEach(t),Ry=p(s),ss=a(s,"H2",{class:!0});var ET=i(ss);zr=a(ET,"A",{id:!0,class:!0,href:!0});var VO=i(zr);Vg=a(VO,"SPAN",{});var GO=i(Vg);T(Jd.$$.fragment,GO),GO.forEach(t),VO.forEach(t),UB=p(ET),Gg=a(ET,"SPAN",{});var JO=i(Gg);WB=n(JO,"BertForMaskedLM"),JO.forEach(t),ET.forEach(t),Ky=p(s),Pt=a(s,"DIV",{class:!0});var $n=i(Pt);T(Xd.$$.fragment,$n),HB=p($n),Yd=a($n,"P",{});var MT=i(Yd);RB=n(MT,"Bert Model with a "),Jg=a(MT,"CODE",{});var XO=i(Jg);KB=n(XO,"language modeling"),XO.forEach(t),QB=n(MT," head on top."),MT.forEach(t),VB=p($n),Zd=a($n,"P",{});var zT=i(Zd);GB=n(zT,"This model inherits from "),ym=a(zT,"A",{href:!0});var YO=i(ym);JB=n(YO,"PreTrainedModel"),YO.forEach(t),XB=n(zT,`. 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.)`),zT.forEach(t),YB=p($n),ec=a($n,"P",{});var PT=i(ec);ZB=n(PT,"This model is also a PyTorch "),tc=a(PT,"A",{href:!0,rel:!0});var ZO=i(tc);eE=n(ZO,"torch.nn.Module"),ZO.forEach(t),tE=n(PT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),PT.forEach(t),oE=p($n),It=a($n,"DIV",{class:!0});var Fn=i(It);T(oc.$$.fragment,Fn),nE=p(Fn),rs=a(Fn,"P",{});var vu=i(rs);sE=n(vu,"The "),Tm=a(vu,"A",{href:!0});var eI=i(Tm);rE=n(eI,"BertForMaskedLM"),eI.forEach(t),aE=n(vu," forward method, overrides the "),Xg=a(vu,"CODE",{});var tI=i(Xg);iE=n(tI,"__call__"),tI.forEach(t),lE=n(vu," special method."),vu.forEach(t),dE=p(Fn),T(Pr.$$.fragment,Fn),cE=p(Fn),T(jr.$$.fragment,Fn),pE=p(Fn),T(qr.$$.fragment,Fn),Fn.forEach(t),$n.forEach(t),Qy=p(s),as=a(s,"H2",{class:!0});var jT=i(as);Cr=a(jT,"A",{id:!0,class:!0,href:!0});var oI=i(Cr);Yg=a(oI,"SPAN",{});var nI=i(Yg);T(nc.$$.fragment,nI),nI.forEach(t),oI.forEach(t),hE=p(jT),Zg=a(jT,"SPAN",{});var sI=i(Zg);fE=n(sI,"BertForNextSentencePrediction"),sI.forEach(t),jT.forEach(t),Vy=p(s),jt=a(s,"DIV",{class:!0});var xn=i(jt);T(sc.$$.fragment,xn),mE=p(xn),rc=a(xn,"P",{});var qT=i(rc);uE=n(qT,"Bert Model with a "),e_=a(qT,"CODE",{});var rI=i(e_);gE=n(rI,"next sentence prediction (classification)"),rI.forEach(t),_E=n(qT," head on top."),qT.forEach(t),bE=p(xn),ac=a(xn,"P",{});var CT=i(ac);vE=n(CT,"This model inherits from "),wm=a(CT,"A",{href:!0});var aI=i(wm);kE=n(aI,"PreTrainedModel"),aI.forEach(t),yE=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),TE=p(xn),ic=a(xn,"P",{});var AT=i(ic);wE=n(AT,"This model is also a PyTorch "),lc=a(AT,"A",{href:!0,rel:!0});var iI=i(lc);$E=n(iI,"torch.nn.Module"),iI.forEach(t),FE=n(AT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),AT.forEach(t),xE=p(xn),mo=a(xn,"DIV",{class:!0});var ki=i(mo);T(dc.$$.fragment,ki),BE=p(ki),is=a(ki,"P",{});var ku=i(is);EE=n(ku,"The "),$m=a(ku,"A",{href:!0});var lI=i($m);ME=n(lI,"BertForNextSentencePrediction"),lI.forEach(t),zE=n(ku," forward method, overrides the "),t_=a(ku,"CODE",{});var dI=i(t_);PE=n(dI,"__call__"),dI.forEach(t),jE=n(ku," special method."),ku.forEach(t),qE=p(ki),T(Ar.$$.fragment,ki),CE=p(ki),T(Nr.$$.fragment,ki),ki.forEach(t),xn.forEach(t),Gy=p(s),ls=a(s,"H2",{class:!0});var NT=i(ls);Or=a(NT,"A",{id:!0,class:!0,href:!0});var cI=i(Or);o_=a(cI,"SPAN",{});var pI=i(o_);T(cc.$$.fragment,pI),pI.forEach(t),cI.forEach(t),AE=p(NT),n_=a(NT,"SPAN",{});var hI=i(n_);NE=n(hI,"BertForSequenceClassification"),hI.forEach(t),NT.forEach(t),Jy=p(s),qt=a(s,"DIV",{class:!0});var Bn=i(qt);T(pc.$$.fragment,Bn),OE=p(Bn),s_=a(Bn,"P",{});var fI=i(s_);IE=n(fI,`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.`),fI.forEach(t),LE=p(Bn),hc=a(Bn,"P",{});var OT=i(hc);DE=n(OT,"This model inherits from "),Fm=a(OT,"A",{href:!0});var mI=i(Fm);SE=n(mI,"PreTrainedModel"),mI.forEach(t),UE=n(OT,`. 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.)`),OT.forEach(t),WE=p(Bn),fc=a(Bn,"P",{});var IT=i(fc);HE=n(IT,"This model is also a PyTorch "),mc=a(IT,"A",{href:!0,rel:!0});var uI=i(mc);RE=n(uI,"torch.nn.Module"),uI.forEach(t),KE=n(IT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),IT.forEach(t),QE=p(Bn),ft=a(Bn,"DIV",{class:!0});var Gt=i(ft);T(uc.$$.fragment,Gt),VE=p(Gt),ds=a(Gt,"P",{});var yu=i(ds);GE=n(yu,"The "),xm=a(yu,"A",{href:!0});var gI=i(xm);JE=n(gI,"BertForSequenceClassification"),gI.forEach(t),XE=n(yu," forward method, overrides the "),r_=a(yu,"CODE",{});var _I=i(r_);YE=n(_I,"__call__"),_I.forEach(t),ZE=n(yu," special method."),yu.forEach(t),e5=p(Gt),T(Ir.$$.fragment,Gt),t5=p(Gt),T(Lr.$$.fragment,Gt),o5=p(Gt),T(Dr.$$.fragment,Gt),n5=p(Gt),T(Sr.$$.fragment,Gt),s5=p(Gt),T(Ur.$$.fragment,Gt),Gt.forEach(t),Bn.forEach(t),Xy=p(s),cs=a(s,"H2",{class:!0});var LT=i(cs);Wr=a(LT,"A",{id:!0,class:!0,href:!0});var bI=i(Wr);a_=a(bI,"SPAN",{});var vI=i(a_);T(gc.$$.fragment,vI),vI.forEach(t),bI.forEach(t),r5=p(LT),i_=a(LT,"SPAN",{});var kI=i(i_);a5=n(kI,"BertForMultipleChoice"),kI.forEach(t),LT.forEach(t),Yy=p(s),Ct=a(s,"DIV",{class:!0});var En=i(Ct);T(_c.$$.fragment,En),i5=p(En),l_=a(En,"P",{});var yI=i(l_);l5=n(yI,`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.`),yI.forEach(t),d5=p(En),bc=a(En,"P",{});var DT=i(bc);c5=n(DT,"This model inherits from "),Bm=a(DT,"A",{href:!0});var TI=i(Bm);p5=n(TI,"PreTrainedModel"),TI.forEach(t),h5=n(DT,`. 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.)`),DT.forEach(t),f5=p(En),vc=a(En,"P",{});var ST=i(vc);m5=n(ST,"This model is also a PyTorch "),kc=a(ST,"A",{href:!0,rel:!0});var wI=i(kc);u5=n(wI,"torch.nn.Module"),wI.forEach(t),g5=n(ST,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ST.forEach(t),_5=p(En),uo=a(En,"DIV",{class:!0});var yi=i(uo);T(yc.$$.fragment,yi),b5=p(yi),ps=a(yi,"P",{});var Tu=i(ps);v5=n(Tu,"The "),Em=a(Tu,"A",{href:!0});var $I=i(Em);k5=n($I,"BertForMultipleChoice"),$I.forEach(t),y5=n(Tu," forward method, overrides the "),d_=a(Tu,"CODE",{});var FI=i(d_);T5=n(FI,"__call__"),FI.forEach(t),w5=n(Tu," special method."),Tu.forEach(t),$5=p(yi),T(Hr.$$.fragment,yi),F5=p(yi),T(Rr.$$.fragment,yi),yi.forEach(t),En.forEach(t),Zy=p(s),hs=a(s,"H2",{class:!0});var UT=i(hs);Kr=a(UT,"A",{id:!0,class:!0,href:!0});var xI=i(Kr);c_=a(xI,"SPAN",{});var BI=i(c_);T(Tc.$$.fragment,BI),BI.forEach(t),xI.forEach(t),x5=p(UT),p_=a(UT,"SPAN",{});var EI=i(p_);B5=n(EI,"BertForTokenClassification"),EI.forEach(t),UT.forEach(t),e1=p(s),At=a(s,"DIV",{class:!0});var Mn=i(At);T(wc.$$.fragment,Mn),E5=p(Mn),h_=a(Mn,"P",{});var MI=i(h_);M5=n(MI,`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.`),MI.forEach(t),z5=p(Mn),$c=a(Mn,"P",{});var WT=i($c);P5=n(WT,"This model inherits from "),Mm=a(WT,"A",{href:!0});var zI=i(Mm);j5=n(zI,"PreTrainedModel"),zI.forEach(t),q5=n(WT,`. 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.)`),WT.forEach(t),C5=p(Mn),Fc=a(Mn,"P",{});var HT=i(Fc);A5=n(HT,"This model is also a PyTorch "),xc=a(HT,"A",{href:!0,rel:!0});var PI=i(xc);N5=n(PI,"torch.nn.Module"),PI.forEach(t),O5=n(HT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),HT.forEach(t),I5=p(Mn),Lt=a(Mn,"DIV",{class:!0});var zn=i(Lt);T(Bc.$$.fragment,zn),L5=p(zn),fs=a(zn,"P",{});var wu=i(fs);D5=n(wu,"The "),zm=a(wu,"A",{href:!0});var jI=i(zm);S5=n(jI,"BertForTokenClassification"),jI.forEach(t),U5=n(wu," forward method, overrides the "),f_=a(wu,"CODE",{});var qI=i(f_);W5=n(qI,"__call__"),qI.forEach(t),H5=n(wu," special method."),wu.forEach(t),R5=p(zn),T(Qr.$$.fragment,zn),K5=p(zn),T(Vr.$$.fragment,zn),Q5=p(zn),T(Gr.$$.fragment,zn),zn.forEach(t),Mn.forEach(t),t1=p(s),ms=a(s,"H2",{class:!0});var RT=i(ms);Jr=a(RT,"A",{id:!0,class:!0,href:!0});var CI=i(Jr);m_=a(CI,"SPAN",{});var AI=i(m_);T(Ec.$$.fragment,AI),AI.forEach(t),CI.forEach(t),V5=p(RT),u_=a(RT,"SPAN",{});var NI=i(u_);G5=n(NI,"BertForQuestionAnswering"),NI.forEach(t),RT.forEach(t),o1=p(s),Nt=a(s,"DIV",{class:!0});var Pn=i(Nt);T(Mc.$$.fragment,Pn),J5=p(Pn),us=a(Pn,"P",{});var $u=i(us);X5=n($u,`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 `),g_=a($u,"CODE",{});var OI=i(g_);Y5=n(OI,"span start logits"),OI.forEach(t),Z5=n($u," and "),__=a($u,"CODE",{});var II=i(__);eM=n(II,"span end logits"),II.forEach(t),tM=n($u,")."),$u.forEach(t),oM=p(Pn),zc=a(Pn,"P",{});var KT=i(zc);nM=n(KT,"This model inherits from "),Pm=a(KT,"A",{href:!0});var LI=i(Pm);sM=n(LI,"PreTrainedModel"),LI.forEach(t),rM=n(KT,`. 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.)`),KT.forEach(t),aM=p(Pn),Pc=a(Pn,"P",{});var QT=i(Pc);iM=n(QT,"This model is also a PyTorch "),jc=a(QT,"A",{href:!0,rel:!0});var DI=i(jc);lM=n(DI,"torch.nn.Module"),DI.forEach(t),dM=n(QT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),QT.forEach(t),cM=p(Pn),Dt=a(Pn,"DIV",{class:!0});var jn=i(Dt);T(qc.$$.fragment,jn),pM=p(jn),gs=a(jn,"P",{});var Fu=i(gs);hM=n(Fu,"The "),jm=a(Fu,"A",{href:!0});var SI=i(jm);fM=n(SI,"BertForQuestionAnswering"),SI.forEach(t),mM=n(Fu," forward method, overrides the "),b_=a(Fu,"CODE",{});var UI=i(b_);uM=n(UI,"__call__"),UI.forEach(t),gM=n(Fu," special method."),Fu.forEach(t),_M=p(jn),T(Xr.$$.fragment,jn),bM=p(jn),T(Yr.$$.fragment,jn),vM=p(jn),T(Zr.$$.fragment,jn),jn.forEach(t),Pn.forEach(t),n1=p(s),_s=a(s,"H2",{class:!0});var VT=i(_s);ea=a(VT,"A",{id:!0,class:!0,href:!0});var WI=i(ea);v_=a(WI,"SPAN",{});var HI=i(v_);T(Cc.$$.fragment,HI),HI.forEach(t),WI.forEach(t),kM=p(VT),k_=a(VT,"SPAN",{});var RI=i(k_);yM=n(RI,"TFBertModel"),RI.forEach(t),VT.forEach(t),s1=p(s),ut=a(s,"DIV",{class:!0});var zo=i(ut);T(Ac.$$.fragment,zo),TM=p(zo),y_=a(zo,"P",{});var KI=i(y_);wM=n(KI,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),KI.forEach(t),$M=p(zo),Nc=a(zo,"P",{});var GT=i(Nc);FM=n(GT,"This model inherits from "),qm=a(GT,"A",{href:!0});var QI=i(qm);xM=n(QI,"TFPreTrainedModel"),QI.forEach(t),BM=n(GT,`. 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.)`),GT.forEach(t),EM=p(zo),Oc=a(zo,"P",{});var JT=i(Oc);MM=n(JT,"This model is also a "),Ic=a(JT,"A",{href:!0,rel:!0});var VI=i(Ic);zM=n(VI,"tf.keras.Model"),VI.forEach(t),PM=n(JT,` 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.`),JT.forEach(t),jM=p(zo),T(ta.$$.fragment,zo),qM=p(zo),go=a(zo,"DIV",{class:!0});var Ti=i(go);T(Lc.$$.fragment,Ti),CM=p(Ti),bs=a(Ti,"P",{});var xu=i(bs);AM=n(xu,"The "),Cm=a(xu,"A",{href:!0});var GI=i(Cm);NM=n(GI,"TFBertModel"),GI.forEach(t),OM=n(xu," forward method, overrides the "),T_=a(xu,"CODE",{});var JI=i(T_);IM=n(JI,"__call__"),JI.forEach(t),LM=n(xu," special method."),xu.forEach(t),DM=p(Ti),T(oa.$$.fragment,Ti),SM=p(Ti),T(na.$$.fragment,Ti),Ti.forEach(t),zo.forEach(t),r1=p(s),vs=a(s,"H2",{class:!0});var XT=i(vs);sa=a(XT,"A",{id:!0,class:!0,href:!0});var XI=i(sa);w_=a(XI,"SPAN",{});var YI=i(w_);T(Dc.$$.fragment,YI),YI.forEach(t),XI.forEach(t),UM=p(XT),$_=a(XT,"SPAN",{});var ZI=i($_);WM=n(ZI,"TFBertForPreTraining"),ZI.forEach(t),XT.forEach(t),a1=p(s),gt=a(s,"DIV",{class:!0});var Po=i(gt);T(Sc.$$.fragment,Po),HM=p(Po),ks=a(Po,"P",{});var Bu=i(ks);RM=n(Bu,`Bert Model with two heads on top as done during the pretraining:
a `),F_=a(Bu,"CODE",{});var e9=i(F_);KM=n(e9,"masked language modeling"),e9.forEach(t),QM=n(Bu," head and a "),x_=a(Bu,"CODE",{});var t9=i(x_);VM=n(t9,"next sentence prediction (classification)"),t9.forEach(t),GM=n(Bu," head."),Bu.forEach(t),JM=p(Po),Uc=a(Po,"P",{});var YT=i(Uc);XM=n(YT,"This model inherits from "),Am=a(YT,"A",{href:!0});var o9=i(Am);YM=n(o9,"TFPreTrainedModel"),o9.forEach(t),ZM=n(YT,`. 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.)`),YT.forEach(t),ez=p(Po),Wc=a(Po,"P",{});var ZT=i(Wc);tz=n(ZT,"This model is also a "),Hc=a(ZT,"A",{href:!0,rel:!0});var n9=i(Hc);oz=n(n9,"tf.keras.Model"),n9.forEach(t),nz=n(ZT,` 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.`),ZT.forEach(t),sz=p(Po),T(ra.$$.fragment,Po),rz=p(Po),_o=a(Po,"DIV",{class:!0});var wi=i(_o);T(Rc.$$.fragment,wi),az=p(wi),ys=a(wi,"P",{});var Eu=i(ys);iz=n(Eu,"The "),Nm=a(Eu,"A",{href:!0});var s9=i(Nm);lz=n(s9,"TFBertForPreTraining"),s9.forEach(t),dz=n(Eu," forward method, overrides the "),B_=a(Eu,"CODE",{});var r9=i(B_);cz=n(r9,"__call__"),r9.forEach(t),pz=n(Eu," special method."),Eu.forEach(t),hz=p(wi),T(aa.$$.fragment,wi),fz=p(wi),T(ia.$$.fragment,wi),wi.forEach(t),Po.forEach(t),i1=p(s),Ts=a(s,"H2",{class:!0});var ew=i(Ts);la=a(ew,"A",{id:!0,class:!0,href:!0});var a9=i(la);E_=a(a9,"SPAN",{});var i9=i(E_);T(Kc.$$.fragment,i9),i9.forEach(t),a9.forEach(t),mz=p(ew),M_=a(ew,"SPAN",{});var l9=i(M_);uz=n(l9,"TFBertModelLMHeadModel"),l9.forEach(t),ew.forEach(t),l1=p(s),ws=a(s,"DIV",{class:!0});var tw=i(ws);T(Qc.$$.fragment,tw),gz=p(tw),St=a(tw,"DIV",{class:!0});var qn=i(St);T(Vc.$$.fragment,qn),_z=p(qn),nt=a(qn,"P",{});var xt=i(nt);bz=n(xt,"encoder_hidden_states  ("),z_=a(xt,"CODE",{});var d9=i(z_);vz=n(d9,"tf.Tensor"),d9.forEach(t),kz=n(xt," of shape "),P_=a(xt,"CODE",{});var c9=i(P_);yz=n(c9,"(batch_size, sequence_length, hidden_size)"),c9.forEach(t),Tz=n(xt,", "),j_=a(xt,"EM",{});var p9=i(j_);wz=n(p9,"optional"),p9.forEach(t),$z=n(xt,`):
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 (`),q_=a(xt,"CODE",{});var h9=i(q_);Fz=n(h9,"tf.Tensor"),h9.forEach(t),xz=n(xt," of shape "),C_=a(xt,"CODE",{});var f9=i(C_);Bz=n(f9,"(batch_size, sequence_length)"),f9.forEach(t),Ez=n(xt,", "),A_=a(xt,"EM",{});var m9=i(A_);Mz=n(m9,"optional"),m9.forEach(t),zz=n(xt,`):
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 `),N_=a(xt,"CODE",{});var u9=i(N_);Pz=n(u9,"[0, 1]"),u9.forEach(t),jz=n(xt,":"),xt.forEach(t),qz=p(qn),Gc=a(qn,"UL",{});var ow=i(Gc);Jc=a(ow,"LI",{});var nw=i(Jc);Cz=n(nw,"1 for tokens that are "),O_=a(nw,"STRONG",{});var g9=i(O_);Az=n(g9,"not masked"),g9.forEach(t),Nz=n(nw,","),nw.forEach(t),Oz=p(ow),Xc=a(ow,"LI",{});var sw=i(Xc);Iz=n(sw,"0 for tokens that are "),I_=a(sw,"STRONG",{});var _9=i(I_);Lz=n(_9,"masked"),_9.forEach(t),Dz=n(sw,"."),sw.forEach(t),ow.forEach(t),Sz=p(qn),ee=a(qn,"P",{});var ae=i(ee);Uz=n(ae,"past_key_values ("),L_=a(ae,"CODE",{});var b9=i(L_);Wz=n(b9,"Tuple[Tuple[tf.Tensor]]"),b9.forEach(t),Hz=n(ae," of length "),D_=a(ae,"CODE",{});var v9=i(D_);Rz=n(v9,"config.n_layers"),v9.forEach(t),Kz=n(ae,`)
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),S_=a(ae,"CODE",{});var k9=i(S_);Qz=n(k9,"past_key_values"),k9.forEach(t),Vz=n(ae," are used, the user can optionally input only the last "),U_=a(ae,"CODE",{});var y9=i(U_);Gz=n(y9,"decoder_input_ids"),y9.forEach(t),Jz=n(ae,` (those that
don\u2019t have their past key value states given to this model) of shape `),W_=a(ae,"CODE",{});var T9=i(W_);Xz=n(T9,"(batch_size, 1)"),T9.forEach(t),Yz=n(ae,` instead of all
`),H_=a(ae,"CODE",{});var w9=i(H_);Zz=n(w9,"decoder_input_ids"),w9.forEach(t),eP=n(ae," of shape "),R_=a(ae,"CODE",{});var $9=i(R_);tP=n($9,"(batch_size, sequence_length)"),$9.forEach(t),oP=n(ae,`.
use_cache (`),K_=a(ae,"CODE",{});var F9=i(K_);nP=n(F9,"bool"),F9.forEach(t),sP=n(ae,", "),Q_=a(ae,"EM",{});var x9=i(Q_);rP=n(x9,"optional"),x9.forEach(t),aP=n(ae,", defaults to "),V_=a(ae,"CODE",{});var B9=i(V_);iP=n(B9,"True"),B9.forEach(t),lP=n(ae,`):
If set to `),G_=a(ae,"CODE",{});var E9=i(G_);dP=n(E9,"True"),E9.forEach(t),cP=n(ae,", "),J_=a(ae,"CODE",{});var M9=i(J_);pP=n(M9,"past_key_values"),M9.forEach(t),hP=n(ae,` key value states are returned and can be used to speed up decoding (see
`),X_=a(ae,"CODE",{});var z9=i(X_);fP=n(z9,"past_key_values"),z9.forEach(t),mP=n(ae,"). Set to "),Y_=a(ae,"CODE",{});var P9=i(Y_);uP=n(P9,"False"),P9.forEach(t),gP=n(ae," during training, "),Z_=a(ae,"CODE",{});var j9=i(Z_);_P=n(j9,"True"),j9.forEach(t),bP=n(ae,` during generation
labels (`),eb=a(ae,"CODE",{});var q9=i(eb);vP=n(q9,"tf.Tensor"),q9.forEach(t),kP=n(ae," or "),tb=a(ae,"CODE",{});var C9=i(tb);yP=n(C9,"np.ndarray"),C9.forEach(t),TP=n(ae," of shape "),ob=a(ae,"CODE",{});var A9=i(ob);wP=n(A9,"(batch_size, sequence_length)"),A9.forEach(t),$P=n(ae,", "),nb=a(ae,"EM",{});var N9=i(nb);FP=n(N9,"optional"),N9.forEach(t),xP=n(ae,`):
Labels for computing the cross entropy classification loss. Indices should be in `),sb=a(ae,"CODE",{});var O9=i(sb);BP=n(O9,"[0, ..., config.vocab_size - 1]"),O9.forEach(t),EP=n(ae,"."),ae.forEach(t),MP=p(qn),T(da.$$.fragment,qn),qn.forEach(t),tw.forEach(t),d1=p(s),$s=a(s,"H2",{class:!0});var rw=i($s);ca=a(rw,"A",{id:!0,class:!0,href:!0});var I9=i(ca);rb=a(I9,"SPAN",{});var L9=i(rb);T(Yc.$$.fragment,L9),L9.forEach(t),I9.forEach(t),zP=p(rw),ab=a(rw,"SPAN",{});var D9=i(ab);PP=n(D9,"TFBertForMaskedLM"),D9.forEach(t),rw.forEach(t),c1=p(s),_t=a(s,"DIV",{class:!0});var jo=i(_t);T(Zc.$$.fragment,jo),jP=p(jo),ep=a(jo,"P",{});var aw=i(ep);qP=n(aw,"Bert Model with a "),ib=a(aw,"CODE",{});var S9=i(ib);CP=n(S9,"language modeling"),S9.forEach(t),AP=n(aw," head on top."),aw.forEach(t),NP=p(jo),tp=a(jo,"P",{});var iw=i(tp);OP=n(iw,"This model inherits from "),Om=a(iw,"A",{href:!0});var U9=i(Om);IP=n(U9,"TFPreTrainedModel"),U9.forEach(t),LP=n(iw,`. 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.)`),iw.forEach(t),DP=p(jo),op=a(jo,"P",{});var lw=i(op);SP=n(lw,"This model is also a "),np=a(lw,"A",{href:!0,rel:!0});var W9=i(np);UP=n(W9,"tf.keras.Model"),W9.forEach(t),WP=n(lw,` 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.`),lw.forEach(t),HP=p(jo),T(pa.$$.fragment,jo),RP=p(jo),Ut=a(jo,"DIV",{class:!0});var Cn=i(Ut);T(sp.$$.fragment,Cn),KP=p(Cn),Fs=a(Cn,"P",{});var Mu=i(Fs);QP=n(Mu,"The "),Im=a(Mu,"A",{href:!0});var H9=i(Im);VP=n(H9,"TFBertForMaskedLM"),H9.forEach(t),GP=n(Mu," forward method, overrides the "),lb=a(Mu,"CODE",{});var R9=i(lb);JP=n(R9,"__call__"),R9.forEach(t),XP=n(Mu," special method."),Mu.forEach(t),YP=p(Cn),T(ha.$$.fragment,Cn),ZP=p(Cn),T(fa.$$.fragment,Cn),ej=p(Cn),T(ma.$$.fragment,Cn),Cn.forEach(t),jo.forEach(t),p1=p(s),xs=a(s,"H2",{class:!0});var dw=i(xs);ua=a(dw,"A",{id:!0,class:!0,href:!0});var K9=i(ua);db=a(K9,"SPAN",{});var Q9=i(db);T(rp.$$.fragment,Q9),Q9.forEach(t),K9.forEach(t),tj=p(dw),cb=a(dw,"SPAN",{});var V9=i(cb);oj=n(V9,"TFBertForNextSentencePrediction"),V9.forEach(t),dw.forEach(t),h1=p(s),bt=a(s,"DIV",{class:!0});var qo=i(bt);T(ap.$$.fragment,qo),nj=p(qo),ip=a(qo,"P",{});var cw=i(ip);sj=n(cw,"Bert Model with a "),pb=a(cw,"CODE",{});var G9=i(pb);rj=n(G9,"next sentence prediction (classification)"),G9.forEach(t),aj=n(cw," head on top."),cw.forEach(t),ij=p(qo),lp=a(qo,"P",{});var pw=i(lp);lj=n(pw,"This model inherits from "),Lm=a(pw,"A",{href:!0});var J9=i(Lm);dj=n(J9,"TFPreTrainedModel"),J9.forEach(t),cj=n(pw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),pw.forEach(t),pj=p(qo),dp=a(qo,"P",{});var hw=i(dp);hj=n(hw,"This model is also a "),cp=a(hw,"A",{href:!0,rel:!0});var X9=i(cp);fj=n(X9,"tf.keras.Model"),X9.forEach(t),mj=n(hw,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),hw.forEach(t),uj=p(qo),T(ga.$$.fragment,qo),gj=p(qo),bo=a(qo,"DIV",{class:!0});var $i=i(bo);T(pp.$$.fragment,$i),_j=p($i),Bs=a($i,"P",{});var zu=i(Bs);bj=n(zu,"The "),Dm=a(zu,"A",{href:!0});var Y9=i(Dm);vj=n(Y9,"TFBertForNextSentencePrediction"),Y9.forEach(t),kj=n(zu," forward method, overrides the "),hb=a(zu,"CODE",{});var Z9=i(hb);yj=n(Z9,"__call__"),Z9.forEach(t),Tj=n(zu," special method."),zu.forEach(t),wj=p($i),T(_a.$$.fragment,$i),$j=p($i),T(ba.$$.fragment,$i),$i.forEach(t),qo.forEach(t),f1=p(s),Es=a(s,"H2",{class:!0});var fw=i(Es);va=a(fw,"A",{id:!0,class:!0,href:!0});var eL=i(va);fb=a(eL,"SPAN",{});var tL=i(fb);T(hp.$$.fragment,tL),tL.forEach(t),eL.forEach(t),Fj=p(fw),mb=a(fw,"SPAN",{});var oL=i(mb);xj=n(oL,"TFBertForSequenceClassification"),oL.forEach(t),fw.forEach(t),m1=p(s),vt=a(s,"DIV",{class:!0});var Co=i(vt);T(fp.$$.fragment,Co),Bj=p(Co),ub=a(Co,"P",{});var nL=i(ub);Ej=n(nL,`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.`),nL.forEach(t),Mj=p(Co),mp=a(Co,"P",{});var mw=i(mp);zj=n(mw,"This model inherits from "),Sm=a(mw,"A",{href:!0});var sL=i(Sm);Pj=n(sL,"TFPreTrainedModel"),sL.forEach(t),jj=n(mw,`. 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.)`),mw.forEach(t),qj=p(Co),up=a(Co,"P",{});var uw=i(up);Cj=n(uw,"This model is also a "),gp=a(uw,"A",{href:!0,rel:!0});var rL=i(gp);Aj=n(rL,"tf.keras.Model"),rL.forEach(t),Nj=n(uw,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),uw.forEach(t),Oj=p(Co),T(ka.$$.fragment,Co),Ij=p(Co),Wt=a(Co,"DIV",{class:!0});var An=i(Wt);T(_p.$$.fragment,An),Lj=p(An),Ms=a(An,"P",{});var Pu=i(Ms);Dj=n(Pu,"The "),Um=a(Pu,"A",{href:!0});var aL=i(Um);Sj=n(aL,"TFBertForSequenceClassification"),aL.forEach(t),Uj=n(Pu," forward method, overrides the "),gb=a(Pu,"CODE",{});var iL=i(gb);Wj=n(iL,"__call__"),iL.forEach(t),Hj=n(Pu," special method."),Pu.forEach(t),Rj=p(An),T(ya.$$.fragment,An),Kj=p(An),T(Ta.$$.fragment,An),Qj=p(An),T(wa.$$.fragment,An),An.forEach(t),Co.forEach(t),u1=p(s),zs=a(s,"H2",{class:!0});var gw=i(zs);$a=a(gw,"A",{id:!0,class:!0,href:!0});var lL=i($a);_b=a(lL,"SPAN",{});var dL=i(_b);T(bp.$$.fragment,dL),dL.forEach(t),lL.forEach(t),Vj=p(gw),bb=a(gw,"SPAN",{});var cL=i(bb);Gj=n(cL,"TFBertForMultipleChoice"),cL.forEach(t),gw.forEach(t),g1=p(s),kt=a(s,"DIV",{class:!0});var Ao=i(kt);T(vp.$$.fragment,Ao),Jj=p(Ao),vb=a(Ao,"P",{});var pL=i(vb);Xj=n(pL,`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.`),pL.forEach(t),Yj=p(Ao),kp=a(Ao,"P",{});var _w=i(kp);Zj=n(_w,"This model inherits from "),Wm=a(_w,"A",{href:!0});var hL=i(Wm);eq=n(hL,"TFPreTrainedModel"),hL.forEach(t),tq=n(_w,`. 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.)`),_w.forEach(t),oq=p(Ao),yp=a(Ao,"P",{});var bw=i(yp);nq=n(bw,"This model is also a "),Tp=a(bw,"A",{href:!0,rel:!0});var fL=i(Tp);sq=n(fL,"tf.keras.Model"),fL.forEach(t),rq=n(bw,` 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.`),bw.forEach(t),aq=p(Ao),T(Fa.$$.fragment,Ao),iq=p(Ao),vo=a(Ao,"DIV",{class:!0});var Fi=i(vo);T(wp.$$.fragment,Fi),lq=p(Fi),Ps=a(Fi,"P",{});var ju=i(Ps);dq=n(ju,"The "),Hm=a(ju,"A",{href:!0});var mL=i(Hm);cq=n(mL,"TFBertForMultipleChoice"),mL.forEach(t),pq=n(ju," forward method, overrides the "),kb=a(ju,"CODE",{});var uL=i(kb);hq=n(uL,"__call__"),uL.forEach(t),fq=n(ju," special method."),ju.forEach(t),mq=p(Fi),T(xa.$$.fragment,Fi),uq=p(Fi),T(Ba.$$.fragment,Fi),Fi.forEach(t),Ao.forEach(t),_1=p(s),js=a(s,"H2",{class:!0});var vw=i(js);Ea=a(vw,"A",{id:!0,class:!0,href:!0});var gL=i(Ea);yb=a(gL,"SPAN",{});var _L=i(yb);T($p.$$.fragment,_L),_L.forEach(t),gL.forEach(t),gq=p(vw),Tb=a(vw,"SPAN",{});var bL=i(Tb);_q=n(bL,"TFBertForTokenClassification"),bL.forEach(t),vw.forEach(t),b1=p(s),yt=a(s,"DIV",{class:!0});var No=i(yt);T(Fp.$$.fragment,No),bq=p(No),wb=a(No,"P",{});var vL=i(wb);vq=n(vL,`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.`),vL.forEach(t),kq=p(No),xp=a(No,"P",{});var kw=i(xp);yq=n(kw,"This model inherits from "),Rm=a(kw,"A",{href:!0});var kL=i(Rm);Tq=n(kL,"TFPreTrainedModel"),kL.forEach(t),wq=n(kw,`. 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.)`),kw.forEach(t),$q=p(No),Bp=a(No,"P",{});var yw=i(Bp);Fq=n(yw,"This model is also a "),Ep=a(yw,"A",{href:!0,rel:!0});var yL=i(Ep);xq=n(yL,"tf.keras.Model"),yL.forEach(t),Bq=n(yw,` 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.`),yw.forEach(t),Eq=p(No),T(Ma.$$.fragment,No),Mq=p(No),Ht=a(No,"DIV",{class:!0});var Nn=i(Ht);T(Mp.$$.fragment,Nn),zq=p(Nn),qs=a(Nn,"P",{});var qu=i(qs);Pq=n(qu,"The "),Km=a(qu,"A",{href:!0});var TL=i(Km);jq=n(TL,"TFBertForTokenClassification"),TL.forEach(t),qq=n(qu," forward method, overrides the "),$b=a(qu,"CODE",{});var wL=i($b);Cq=n(wL,"__call__"),wL.forEach(t),Aq=n(qu," special method."),qu.forEach(t),Nq=p(Nn),T(za.$$.fragment,Nn),Oq=p(Nn),T(Pa.$$.fragment,Nn),Iq=p(Nn),T(ja.$$.fragment,Nn),Nn.forEach(t),No.forEach(t),v1=p(s),Cs=a(s,"H2",{class:!0});var Tw=i(Cs);qa=a(Tw,"A",{id:!0,class:!0,href:!0});var $L=i(qa);Fb=a($L,"SPAN",{});var FL=i(Fb);T(zp.$$.fragment,FL),FL.forEach(t),$L.forEach(t),Lq=p(Tw),xb=a(Tw,"SPAN",{});var xL=i(xb);Dq=n(xL,"TFBertForQuestionAnswering"),xL.forEach(t),Tw.forEach(t),k1=p(s),Tt=a(s,"DIV",{class:!0});var Oo=i(Tt);T(Pp.$$.fragment,Oo),Sq=p(Oo),As=a(Oo,"P",{});var Cu=i(As);Uq=n(Cu,`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 `),Bb=a(Cu,"CODE",{});var BL=i(Bb);Wq=n(BL,"span start logits"),BL.forEach(t),Hq=n(Cu," and "),Eb=a(Cu,"CODE",{});var EL=i(Eb);Rq=n(EL,"span end logits"),EL.forEach(t),Kq=n(Cu,")."),Cu.forEach(t),Qq=p(Oo),jp=a(Oo,"P",{});var ww=i(jp);Vq=n(ww,"This model inherits from "),Qm=a(ww,"A",{href:!0});var ML=i(Qm);Gq=n(ML,"TFPreTrainedModel"),ML.forEach(t),Jq=n(ww,`. 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.)`),ww.forEach(t),Xq=p(Oo),qp=a(Oo,"P",{});var $w=i(qp);Yq=n($w,"This model is also a "),Cp=a($w,"A",{href:!0,rel:!0});var zL=i(Cp);Zq=n(zL,"tf.keras.Model"),zL.forEach(t),e3=n($w,` 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.`),$w.forEach(t),t3=p(Oo),T(Ca.$$.fragment,Oo),o3=p(Oo),Rt=a(Oo,"DIV",{class:!0});var On=i(Rt);T(Ap.$$.fragment,On),n3=p(On),Ns=a(On,"P",{});var Au=i(Ns);s3=n(Au,"The "),Vm=a(Au,"A",{href:!0});var PL=i(Vm);r3=n(PL,"TFBertForQuestionAnswering"),PL.forEach(t),a3=n(Au," forward method, overrides the "),Mb=a(Au,"CODE",{});var jL=i(Mb);i3=n(jL,"__call__"),jL.forEach(t),l3=n(Au," special method."),Au.forEach(t),d3=p(On),T(Aa.$$.fragment,On),c3=p(On),T(Na.$$.fragment,On),p3=p(On),T(Oa.$$.fragment,On),On.forEach(t),Oo.forEach(t),y1=p(s),Os=a(s,"H2",{class:!0});var Fw=i(Os);Ia=a(Fw,"A",{id:!0,class:!0,href:!0});var qL=i(Ia);zb=a(qL,"SPAN",{});var CL=i(zb);T(Np.$$.fragment,CL),CL.forEach(t),qL.forEach(t),h3=p(Fw),Pb=a(Fw,"SPAN",{});var AL=i(Pb);f3=n(AL,"FlaxBertModel"),AL.forEach(t),Fw.forEach(t),T1=p(s),st=a(s,"DIV",{class:!0});var Jt=i(st);T(Op.$$.fragment,Jt),m3=p(Jt),jb=a(Jt,"P",{});var NL=i(jb);u3=n(NL,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),NL.forEach(t),g3=p(Jt),Ip=a(Jt,"P",{});var xw=i(Ip);_3=n(xw,"This model inherits from "),Gm=a(xw,"A",{href:!0});var OL=i(Gm);b3=n(OL,"FlaxPreTrainedModel"),OL.forEach(t),v3=n(xw,`. 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)`),xw.forEach(t),k3=p(Jt),Lp=a(Jt,"P",{});var Bw=i(Lp);y3=n(Bw,"This model is also a Flax Linen "),Dp=a(Bw,"A",{href:!0,rel:!0});var IL=i(Dp);T3=n(IL,"flax.linen.Module"),IL.forEach(t),w3=n(Bw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Bw.forEach(t),$3=p(Jt),qb=a(Jt,"P",{});var LL=i(qb);F3=n(LL,"Finally, this model supports inherent JAX features such as:"),LL.forEach(t),x3=p(Jt),Do=a(Jt,"UL",{});var xi=i(Do);Cb=a(xi,"LI",{});var DL=i(Cb);Sp=a(DL,"A",{href:!0,rel:!0});var SL=i(Sp);B3=n(SL,"Just-In-Time (JIT) compilation"),SL.forEach(t),DL.forEach(t),E3=p(xi),Ab=a(xi,"LI",{});var UL=i(Ab);Up=a(UL,"A",{href:!0,rel:!0});var WL=i(Up);M3=n(WL,"Automatic Differentiation"),WL.forEach(t),UL.forEach(t),z3=p(xi),Nb=a(xi,"LI",{});var HL=i(Nb);Wp=a(HL,"A",{href:!0,rel:!0});var RL=i(Wp);P3=n(RL,"Vectorization"),RL.forEach(t),HL.forEach(t),j3=p(xi),Ob=a(xi,"LI",{});var KL=i(Ob);Hp=a(KL,"A",{href:!0,rel:!0});var QL=i(Hp);q3=n(QL,"Parallelization"),QL.forEach(t),KL.forEach(t),xi.forEach(t),C3=p(Jt),ko=a(Jt,"DIV",{class:!0});var Bi=i(ko);T(Rp.$$.fragment,Bi),A3=p(Bi),Is=a(Bi,"P",{});var Nu=i(Is);N3=n(Nu,"The "),Ib=a(Nu,"CODE",{});var VL=i(Ib);O3=n(VL,"FlaxBertPreTrainedModel"),VL.forEach(t),I3=n(Nu," forward method, overrides the "),Lb=a(Nu,"CODE",{});var GL=i(Lb);L3=n(GL,"__call__"),GL.forEach(t),D3=n(Nu," special method."),Nu.forEach(t),S3=p(Bi),T(La.$$.fragment,Bi),U3=p(Bi),T(Da.$$.fragment,Bi),Bi.forEach(t),Jt.forEach(t),w1=p(s),Ls=a(s,"H2",{class:!0});var Ew=i(Ls);Sa=a(Ew,"A",{id:!0,class:!0,href:!0});var JL=i(Sa);Db=a(JL,"SPAN",{});var XL=i(Db);T(Kp.$$.fragment,XL),XL.forEach(t),JL.forEach(t),W3=p(Ew),Sb=a(Ew,"SPAN",{});var YL=i(Sb);H3=n(YL,"FlaxBertForPreTraining"),YL.forEach(t),Ew.forEach(t),$1=p(s),rt=a(s,"DIV",{class:!0});var Xt=i(rt);T(Qp.$$.fragment,Xt),R3=p(Xt),Ds=a(Xt,"P",{});var Ou=i(Ds);K3=n(Ou,"Bert Model with two heads on top as done during the pretraining: a "),Ub=a(Ou,"CODE",{});var ZL=i(Ub);Q3=n(ZL,"masked language modeling"),ZL.forEach(t),V3=n(Ou," head and a "),Wb=a(Ou,"CODE",{});var eD=i(Wb);G3=n(eD,"next sentence prediction (classification)"),eD.forEach(t),J3=n(Ou," head."),Ou.forEach(t),X3=p(Xt),Vp=a(Xt,"P",{});var Mw=i(Vp);Y3=n(Mw,"This model inherits from "),Jm=a(Mw,"A",{href:!0});var tD=i(Jm);Z3=n(tD,"FlaxPreTrainedModel"),tD.forEach(t),eC=n(Mw,`. 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)`),Mw.forEach(t),tC=p(Xt),Gp=a(Xt,"P",{});var zw=i(Gp);oC=n(zw,"This model is also a Flax Linen "),Jp=a(zw,"A",{href:!0,rel:!0});var oD=i(Jp);nC=n(oD,"flax.linen.Module"),oD.forEach(t),sC=n(zw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),zw.forEach(t),rC=p(Xt),Hb=a(Xt,"P",{});var nD=i(Hb);aC=n(nD,"Finally, this model supports inherent JAX features such as:"),nD.forEach(t),iC=p(Xt),So=a(Xt,"UL",{});var Ei=i(So);Rb=a(Ei,"LI",{});var sD=i(Rb);Xp=a(sD,"A",{href:!0,rel:!0});var rD=i(Xp);lC=n(rD,"Just-In-Time (JIT) compilation"),rD.forEach(t),sD.forEach(t),dC=p(Ei),Kb=a(Ei,"LI",{});var aD=i(Kb);Yp=a(aD,"A",{href:!0,rel:!0});var iD=i(Yp);cC=n(iD,"Automatic Differentiation"),iD.forEach(t),aD.forEach(t),pC=p(Ei),Qb=a(Ei,"LI",{});var lD=i(Qb);Zp=a(lD,"A",{href:!0,rel:!0});var dD=i(Zp);hC=n(dD,"Vectorization"),dD.forEach(t),lD.forEach(t),fC=p(Ei),Vb=a(Ei,"LI",{});var cD=i(Vb);eh=a(cD,"A",{href:!0,rel:!0});var pD=i(eh);mC=n(pD,"Parallelization"),pD.forEach(t),cD.forEach(t),Ei.forEach(t),uC=p(Xt),yo=a(Xt,"DIV",{class:!0});var Mi=i(yo);T(th.$$.fragment,Mi),gC=p(Mi),Ss=a(Mi,"P",{});var Iu=i(Ss);_C=n(Iu,"The "),Gb=a(Iu,"CODE",{});var hD=i(Gb);bC=n(hD,"FlaxBertPreTrainedModel"),hD.forEach(t),vC=n(Iu," forward method, overrides the "),Jb=a(Iu,"CODE",{});var fD=i(Jb);kC=n(fD,"__call__"),fD.forEach(t),yC=n(Iu," special method."),Iu.forEach(t),TC=p(Mi),T(Ua.$$.fragment,Mi),wC=p(Mi),T(Wa.$$.fragment,Mi),Mi.forEach(t),Xt.forEach(t),F1=p(s),Us=a(s,"H2",{class:!0});var Pw=i(Us);Ha=a(Pw,"A",{id:!0,class:!0,href:!0});var mD=i(Ha);Xb=a(mD,"SPAN",{});var uD=i(Xb);T(oh.$$.fragment,uD),uD.forEach(t),mD.forEach(t),$C=p(Pw),Yb=a(Pw,"SPAN",{});var gD=i(Yb);FC=n(gD,"FlaxBertForCausalLM"),gD.forEach(t),Pw.forEach(t),x1=p(s),at=a(s,"DIV",{class:!0});var Yt=i(at);T(nh.$$.fragment,Yt),xC=p(Yt),Zb=a(Yt,"P",{});var _D=i(Zb);BC=n(_D,`Bert Model with a language modeling head on top (a linear layer on top of the hidden-states output) e.g for
autoregressive tasks.`),_D.forEach(t),EC=p(Yt),sh=a(Yt,"P",{});var jw=i(sh);MC=n(jw,"This model inherits from "),Xm=a(jw,"A",{href:!0});var bD=i(Xm);zC=n(bD,"FlaxPreTrainedModel"),bD.forEach(t),PC=n(jw,`. 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)`),jw.forEach(t),jC=p(Yt),rh=a(Yt,"P",{});var qw=i(rh);qC=n(qw,"This model is also a Flax Linen "),ah=a(qw,"A",{href:!0,rel:!0});var vD=i(ah);CC=n(vD,"flax.linen.Module"),vD.forEach(t),AC=n(qw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),qw.forEach(t),NC=p(Yt),ev=a(Yt,"P",{});var kD=i(ev);OC=n(kD,"Finally, this model supports inherent JAX features such as:"),kD.forEach(t),IC=p(Yt),Uo=a(Yt,"UL",{});var zi=i(Uo);tv=a(zi,"LI",{});var yD=i(tv);ih=a(yD,"A",{href:!0,rel:!0});var TD=i(ih);LC=n(TD,"Just-In-Time (JIT) compilation"),TD.forEach(t),yD.forEach(t),DC=p(zi),ov=a(zi,"LI",{});var wD=i(ov);lh=a(wD,"A",{href:!0,rel:!0});var $D=i(lh);SC=n($D,"Automatic Differentiation"),$D.forEach(t),wD.forEach(t),UC=p(zi),nv=a(zi,"LI",{});var FD=i(nv);dh=a(FD,"A",{href:!0,rel:!0});var xD=i(dh);WC=n(xD,"Vectorization"),xD.forEach(t),FD.forEach(t),HC=p(zi),sv=a(zi,"LI",{});var BD=i(sv);ch=a(BD,"A",{href:!0,rel:!0});var ED=i(ch);RC=n(ED,"Parallelization"),ED.forEach(t),BD.forEach(t),zi.forEach(t),KC=p(Yt),To=a(Yt,"DIV",{class:!0});var Pi=i(To);T(ph.$$.fragment,Pi),QC=p(Pi),Ws=a(Pi,"P",{});var Lu=i(Ws);VC=n(Lu,"The "),rv=a(Lu,"CODE",{});var MD=i(rv);GC=n(MD,"FlaxBertPreTrainedModel"),MD.forEach(t),JC=n(Lu," forward method, overrides the "),av=a(Lu,"CODE",{});var zD=i(av);XC=n(zD,"__call__"),zD.forEach(t),YC=n(Lu," special method."),Lu.forEach(t),ZC=p(Pi),T(Ra.$$.fragment,Pi),e6=p(Pi),T(Ka.$$.fragment,Pi),Pi.forEach(t),Yt.forEach(t),B1=p(s),Hs=a(s,"H2",{class:!0});var Cw=i(Hs);Qa=a(Cw,"A",{id:!0,class:!0,href:!0});var PD=i(Qa);iv=a(PD,"SPAN",{});var jD=i(iv);T(hh.$$.fragment,jD),jD.forEach(t),PD.forEach(t),t6=p(Cw),lv=a(Cw,"SPAN",{});var qD=i(lv);o6=n(qD,"FlaxBertForMaskedLM"),qD.forEach(t),Cw.forEach(t),E1=p(s),it=a(s,"DIV",{class:!0});var Zt=i(it);T(fh.$$.fragment,Zt),n6=p(Zt),mh=a(Zt,"P",{});var Aw=i(mh);s6=n(Aw,"Bert Model with a "),dv=a(Aw,"CODE",{});var CD=i(dv);r6=n(CD,"language modeling"),CD.forEach(t),a6=n(Aw," head on top."),Aw.forEach(t),i6=p(Zt),uh=a(Zt,"P",{});var Nw=i(uh);l6=n(Nw,"This model inherits from "),Ym=a(Nw,"A",{href:!0});var AD=i(Ym);d6=n(AD,"FlaxPreTrainedModel"),AD.forEach(t),c6=n(Nw,`. 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)`),Nw.forEach(t),p6=p(Zt),gh=a(Zt,"P",{});var Ow=i(gh);h6=n(Ow,"This model is also a Flax Linen "),_h=a(Ow,"A",{href:!0,rel:!0});var ND=i(_h);f6=n(ND,"flax.linen.Module"),ND.forEach(t),m6=n(Ow,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Ow.forEach(t),u6=p(Zt),cv=a(Zt,"P",{});var OD=i(cv);g6=n(OD,"Finally, this model supports inherent JAX features such as:"),OD.forEach(t),_6=p(Zt),Wo=a(Zt,"UL",{});var ji=i(Wo);pv=a(ji,"LI",{});var ID=i(pv);bh=a(ID,"A",{href:!0,rel:!0});var LD=i(bh);b6=n(LD,"Just-In-Time (JIT) compilation"),LD.forEach(t),ID.forEach(t),v6=p(ji),hv=a(ji,"LI",{});var DD=i(hv);vh=a(DD,"A",{href:!0,rel:!0});var SD=i(vh);k6=n(SD,"Automatic Differentiation"),SD.forEach(t),DD.forEach(t),y6=p(ji),fv=a(ji,"LI",{});var UD=i(fv);kh=a(UD,"A",{href:!0,rel:!0});var WD=i(kh);T6=n(WD,"Vectorization"),WD.forEach(t),UD.forEach(t),w6=p(ji),mv=a(ji,"LI",{});var HD=i(mv);yh=a(HD,"A",{href:!0,rel:!0});var RD=i(yh);$6=n(RD,"Parallelization"),RD.forEach(t),HD.forEach(t),ji.forEach(t),F6=p(Zt),wo=a(Zt,"DIV",{class:!0});var qi=i(wo);T(Th.$$.fragment,qi),x6=p(qi),Rs=a(qi,"P",{});var Du=i(Rs);B6=n(Du,"The "),uv=a(Du,"CODE",{});var KD=i(uv);E6=n(KD,"FlaxBertPreTrainedModel"),KD.forEach(t),M6=n(Du," forward method, overrides the "),gv=a(Du,"CODE",{});var QD=i(gv);z6=n(QD,"__call__"),QD.forEach(t),P6=n(Du," special method."),Du.forEach(t),j6=p(qi),T(Va.$$.fragment,qi),q6=p(qi),T(Ga.$$.fragment,qi),qi.forEach(t),Zt.forEach(t),M1=p(s),Ks=a(s,"H2",{class:!0});var Iw=i(Ks);Ja=a(Iw,"A",{id:!0,class:!0,href:!0});var VD=i(Ja);_v=a(VD,"SPAN",{});var GD=i(_v);T(wh.$$.fragment,GD),GD.forEach(t),VD.forEach(t),C6=p(Iw),bv=a(Iw,"SPAN",{});var JD=i(bv);A6=n(JD,"FlaxBertForNextSentencePrediction"),JD.forEach(t),Iw.forEach(t),z1=p(s),lt=a(s,"DIV",{class:!0});var eo=i(lt);T($h.$$.fragment,eo),N6=p(eo),Fh=a(eo,"P",{});var Lw=i(Fh);O6=n(Lw,"Bert Model with a "),vv=a(Lw,"CODE",{});var XD=i(vv);I6=n(XD,"next sentence prediction (classification)"),XD.forEach(t),L6=n(Lw," head on top."),Lw.forEach(t),D6=p(eo),xh=a(eo,"P",{});var Dw=i(xh);S6=n(Dw,"This model inherits from "),Zm=a(Dw,"A",{href:!0});var YD=i(Zm);U6=n(YD,"FlaxPreTrainedModel"),YD.forEach(t),W6=n(Dw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Dw.forEach(t),H6=p(eo),Bh=a(eo,"P",{});var Sw=i(Bh);R6=n(Sw,"This model is also a Flax Linen "),Eh=a(Sw,"A",{href:!0,rel:!0});var ZD=i(Eh);K6=n(ZD,"flax.linen.Module"),ZD.forEach(t),Q6=n(Sw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Sw.forEach(t),V6=p(eo),kv=a(eo,"P",{});var eS=i(kv);G6=n(eS,"Finally, this model supports inherent JAX features such as:"),eS.forEach(t),J6=p(eo),Ho=a(eo,"UL",{});var Ci=i(Ho);yv=a(Ci,"LI",{});var tS=i(yv);Mh=a(tS,"A",{href:!0,rel:!0});var oS=i(Mh);X6=n(oS,"Just-In-Time (JIT) compilation"),oS.forEach(t),tS.forEach(t),Y6=p(Ci),Tv=a(Ci,"LI",{});var nS=i(Tv);zh=a(nS,"A",{href:!0,rel:!0});var sS=i(zh);Z6=n(sS,"Automatic Differentiation"),sS.forEach(t),nS.forEach(t),e7=p(Ci),wv=a(Ci,"LI",{});var rS=i(wv);Ph=a(rS,"A",{href:!0,rel:!0});var aS=i(Ph);t7=n(aS,"Vectorization"),aS.forEach(t),rS.forEach(t),o7=p(Ci),$v=a(Ci,"LI",{});var iS=i($v);jh=a(iS,"A",{href:!0,rel:!0});var lS=i(jh);n7=n(lS,"Parallelization"),lS.forEach(t),iS.forEach(t),Ci.forEach(t),s7=p(eo),$o=a(eo,"DIV",{class:!0});var Ai=i($o);T(qh.$$.fragment,Ai),r7=p(Ai),Qs=a(Ai,"P",{});var Su=i(Qs);a7=n(Su,"The "),Fv=a(Su,"CODE",{});var dS=i(Fv);i7=n(dS,"FlaxBertPreTrainedModel"),dS.forEach(t),l7=n(Su," forward method, overrides the "),xv=a(Su,"CODE",{});var cS=i(xv);d7=n(cS,"__call__"),cS.forEach(t),c7=n(Su," special method."),Su.forEach(t),p7=p(Ai),T(Xa.$$.fragment,Ai),h7=p(Ai),T(Ya.$$.fragment,Ai),Ai.forEach(t),eo.forEach(t),P1=p(s),Vs=a(s,"H2",{class:!0});var Uw=i(Vs);Za=a(Uw,"A",{id:!0,class:!0,href:!0});var pS=i(Za);Bv=a(pS,"SPAN",{});var hS=i(Bv);T(Ch.$$.fragment,hS),hS.forEach(t),pS.forEach(t),f7=p(Uw),Ev=a(Uw,"SPAN",{});var fS=i(Ev);m7=n(fS,"FlaxBertForSequenceClassification"),fS.forEach(t),Uw.forEach(t),j1=p(s),dt=a(s,"DIV",{class:!0});var to=i(dt);T(Ah.$$.fragment,to),u7=p(to),Mv=a(to,"P",{});var mS=i(Mv);g7=n(mS,`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.`),mS.forEach(t),_7=p(to),Nh=a(to,"P",{});var Ww=i(Nh);b7=n(Ww,"This model inherits from "),eu=a(Ww,"A",{href:!0});var uS=i(eu);v7=n(uS,"FlaxPreTrainedModel"),uS.forEach(t),k7=n(Ww,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Ww.forEach(t),y7=p(to),Oh=a(to,"P",{});var Hw=i(Oh);T7=n(Hw,"This model is also a Flax Linen "),Ih=a(Hw,"A",{href:!0,rel:!0});var gS=i(Ih);w7=n(gS,"flax.linen.Module"),gS.forEach(t),$7=n(Hw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Hw.forEach(t),F7=p(to),zv=a(to,"P",{});var _S=i(zv);x7=n(_S,"Finally, this model supports inherent JAX features such as:"),_S.forEach(t),B7=p(to),Ro=a(to,"UL",{});var Ni=i(Ro);Pv=a(Ni,"LI",{});var bS=i(Pv);Lh=a(bS,"A",{href:!0,rel:!0});var vS=i(Lh);E7=n(vS,"Just-In-Time (JIT) compilation"),vS.forEach(t),bS.forEach(t),M7=p(Ni),jv=a(Ni,"LI",{});var kS=i(jv);Dh=a(kS,"A",{href:!0,rel:!0});var yS=i(Dh);z7=n(yS,"Automatic Differentiation"),yS.forEach(t),kS.forEach(t),P7=p(Ni),qv=a(Ni,"LI",{});var TS=i(qv);Sh=a(TS,"A",{href:!0,rel:!0});var wS=i(Sh);j7=n(wS,"Vectorization"),wS.forEach(t),TS.forEach(t),q7=p(Ni),Cv=a(Ni,"LI",{});var $S=i(Cv);Uh=a($S,"A",{href:!0,rel:!0});var FS=i(Uh);C7=n(FS,"Parallelization"),FS.forEach(t),$S.forEach(t),Ni.forEach(t),A7=p(to),Fo=a(to,"DIV",{class:!0});var Oi=i(Fo);T(Wh.$$.fragment,Oi),N7=p(Oi),Gs=a(Oi,"P",{});var Uu=i(Gs);O7=n(Uu,"The "),Av=a(Uu,"CODE",{});var xS=i(Av);I7=n(xS,"FlaxBertPreTrainedModel"),xS.forEach(t),L7=n(Uu," forward method, overrides the "),Nv=a(Uu,"CODE",{});var BS=i(Nv);D7=n(BS,"__call__"),BS.forEach(t),S7=n(Uu," special method."),Uu.forEach(t),U7=p(Oi),T(ei.$$.fragment,Oi),W7=p(Oi),T(ti.$$.fragment,Oi),Oi.forEach(t),to.forEach(t),q1=p(s),Js=a(s,"H2",{class:!0});var Rw=i(Js);oi=a(Rw,"A",{id:!0,class:!0,href:!0});var ES=i(oi);Ov=a(ES,"SPAN",{});var MS=i(Ov);T(Hh.$$.fragment,MS),MS.forEach(t),ES.forEach(t),H7=p(Rw),Iv=a(Rw,"SPAN",{});var zS=i(Iv);R7=n(zS,"FlaxBertForMultipleChoice"),zS.forEach(t),Rw.forEach(t),C1=p(s),ct=a(s,"DIV",{class:!0});var oo=i(ct);T(Rh.$$.fragment,oo),K7=p(oo),Lv=a(oo,"P",{});var PS=i(Lv);Q7=n(PS,`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.`),PS.forEach(t),V7=p(oo),Kh=a(oo,"P",{});var Kw=i(Kh);G7=n(Kw,"This model inherits from "),tu=a(Kw,"A",{href:!0});var jS=i(tu);J7=n(jS,"FlaxPreTrainedModel"),jS.forEach(t),X7=n(Kw,`. 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)`),Kw.forEach(t),Y7=p(oo),Qh=a(oo,"P",{});var Qw=i(Qh);Z7=n(Qw,"This model is also a Flax Linen "),Vh=a(Qw,"A",{href:!0,rel:!0});var qS=i(Vh);e8=n(qS,"flax.linen.Module"),qS.forEach(t),t8=n(Qw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Qw.forEach(t),o8=p(oo),Dv=a(oo,"P",{});var CS=i(Dv);n8=n(CS,"Finally, this model supports inherent JAX features such as:"),CS.forEach(t),s8=p(oo),Ko=a(oo,"UL",{});var Ii=i(Ko);Sv=a(Ii,"LI",{});var AS=i(Sv);Gh=a(AS,"A",{href:!0,rel:!0});var NS=i(Gh);r8=n(NS,"Just-In-Time (JIT) compilation"),NS.forEach(t),AS.forEach(t),a8=p(Ii),Uv=a(Ii,"LI",{});var OS=i(Uv);Jh=a(OS,"A",{href:!0,rel:!0});var IS=i(Jh);i8=n(IS,"Automatic Differentiation"),IS.forEach(t),OS.forEach(t),l8=p(Ii),Wv=a(Ii,"LI",{});var LS=i(Wv);Xh=a(LS,"A",{href:!0,rel:!0});var DS=i(Xh);d8=n(DS,"Vectorization"),DS.forEach(t),LS.forEach(t),c8=p(Ii),Hv=a(Ii,"LI",{});var SS=i(Hv);Yh=a(SS,"A",{href:!0,rel:!0});var US=i(Yh);p8=n(US,"Parallelization"),US.forEach(t),SS.forEach(t),Ii.forEach(t),h8=p(oo),xo=a(oo,"DIV",{class:!0});var Li=i(xo);T(Zh.$$.fragment,Li),f8=p(Li),Xs=a(Li,"P",{});var Wu=i(Xs);m8=n(Wu,"The "),Rv=a(Wu,"CODE",{});var WS=i(Rv);u8=n(WS,"FlaxBertPreTrainedModel"),WS.forEach(t),g8=n(Wu," forward method, overrides the "),Kv=a(Wu,"CODE",{});var HS=i(Kv);_8=n(HS,"__call__"),HS.forEach(t),b8=n(Wu," special method."),Wu.forEach(t),v8=p(Li),T(ni.$$.fragment,Li),k8=p(Li),T(si.$$.fragment,Li),Li.forEach(t),oo.forEach(t),A1=p(s),Ys=a(s,"H2",{class:!0});var Vw=i(Ys);ri=a(Vw,"A",{id:!0,class:!0,href:!0});var RS=i(ri);Qv=a(RS,"SPAN",{});var KS=i(Qv);T(ef.$$.fragment,KS),KS.forEach(t),RS.forEach(t),y8=p(Vw),Vv=a(Vw,"SPAN",{});var QS=i(Vv);T8=n(QS,"FlaxBertForTokenClassification"),QS.forEach(t),Vw.forEach(t),N1=p(s),pt=a(s,"DIV",{class:!0});var no=i(pt);T(tf.$$.fragment,no),w8=p(no),Gv=a(no,"P",{});var VS=i(Gv);$8=n(VS,`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.`),VS.forEach(t),F8=p(no),of=a(no,"P",{});var Gw=i(of);x8=n(Gw,"This model inherits from "),ou=a(Gw,"A",{href:!0});var GS=i(ou);B8=n(GS,"FlaxPreTrainedModel"),GS.forEach(t),E8=n(Gw,`. 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)`),Gw.forEach(t),M8=p(no),nf=a(no,"P",{});var Jw=i(nf);z8=n(Jw,"This model is also a Flax Linen "),sf=a(Jw,"A",{href:!0,rel:!0});var JS=i(sf);P8=n(JS,"flax.linen.Module"),JS.forEach(t),j8=n(Jw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Jw.forEach(t),q8=p(no),Jv=a(no,"P",{});var XS=i(Jv);C8=n(XS,"Finally, this model supports inherent JAX features such as:"),XS.forEach(t),A8=p(no),Qo=a(no,"UL",{});var Di=i(Qo);Xv=a(Di,"LI",{});var YS=i(Xv);rf=a(YS,"A",{href:!0,rel:!0});var ZS=i(rf);N8=n(ZS,"Just-In-Time (JIT) compilation"),ZS.forEach(t),YS.forEach(t),O8=p(Di),Yv=a(Di,"LI",{});var eU=i(Yv);af=a(eU,"A",{href:!0,rel:!0});var tU=i(af);I8=n(tU,"Automatic Differentiation"),tU.forEach(t),eU.forEach(t),L8=p(Di),Zv=a(Di,"LI",{});var oU=i(Zv);lf=a(oU,"A",{href:!0,rel:!0});var nU=i(lf);D8=n(nU,"Vectorization"),nU.forEach(t),oU.forEach(t),S8=p(Di),ek=a(Di,"LI",{});var sU=i(ek);df=a(sU,"A",{href:!0,rel:!0});var rU=i(df);U8=n(rU,"Parallelization"),rU.forEach(t),sU.forEach(t),Di.forEach(t),W8=p(no),Bo=a(no,"DIV",{class:!0});var Si=i(Bo);T(cf.$$.fragment,Si),H8=p(Si),Zs=a(Si,"P",{});var Hu=i(Zs);R8=n(Hu,"The "),tk=a(Hu,"CODE",{});var aU=i(tk);K8=n(aU,"FlaxBertPreTrainedModel"),aU.forEach(t),Q8=n(Hu," forward method, overrides the "),ok=a(Hu,"CODE",{});var iU=i(ok);V8=n(iU,"__call__"),iU.forEach(t),G8=n(Hu," special method."),Hu.forEach(t),J8=p(Si),T(ai.$$.fragment,Si),X8=p(Si),T(ii.$$.fragment,Si),Si.forEach(t),no.forEach(t),O1=p(s),er=a(s,"H2",{class:!0});var Xw=i(er);li=a(Xw,"A",{id:!0,class:!0,href:!0});var lU=i(li);nk=a(lU,"SPAN",{});var dU=i(nk);T(pf.$$.fragment,dU),dU.forEach(t),lU.forEach(t),Y8=p(Xw),sk=a(Xw,"SPAN",{});var cU=i(sk);Z8=n(cU,"FlaxBertForQuestionAnswering"),cU.forEach(t),Xw.forEach(t),I1=p(s),ht=a(s,"DIV",{class:!0});var so=i(ht);T(hf.$$.fragment,so),eA=p(so),tr=a(so,"P",{});var Ru=i(tr);tA=n(Ru,`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 `),rk=a(Ru,"CODE",{});var pU=i(rk);oA=n(pU,"span start logits"),pU.forEach(t),nA=n(Ru," and "),ak=a(Ru,"CODE",{});var hU=i(ak);sA=n(hU,"span end logits"),hU.forEach(t),rA=n(Ru,")."),Ru.forEach(t),aA=p(so),ff=a(so,"P",{});var Yw=i(ff);iA=n(Yw,"This model inherits from "),nu=a(Yw,"A",{href:!0});var fU=i(nu);lA=n(fU,"FlaxPreTrainedModel"),fU.forEach(t),dA=n(Yw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Yw.forEach(t),cA=p(so),mf=a(so,"P",{});var Zw=i(mf);pA=n(Zw,"This model is also a Flax Linen "),uf=a(Zw,"A",{href:!0,rel:!0});var mU=i(uf);hA=n(mU,"flax.linen.Module"),mU.forEach(t),fA=n(Zw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Zw.forEach(t),mA=p(so),ik=a(so,"P",{});var uU=i(ik);uA=n(uU,"Finally, this model supports inherent JAX features such as:"),uU.forEach(t),gA=p(so),Vo=a(so,"UL",{});var Ui=i(Vo);lk=a(Ui,"LI",{});var gU=i(lk);gf=a(gU,"A",{href:!0,rel:!0});var _U=i(gf);_A=n(_U,"Just-In-Time (JIT) compilation"),_U.forEach(t),gU.forEach(t),bA=p(Ui),dk=a(Ui,"LI",{});var bU=i(dk);_f=a(bU,"A",{href:!0,rel:!0});var vU=i(_f);vA=n(vU,"Automatic Differentiation"),vU.forEach(t),bU.forEach(t),kA=p(Ui),ck=a(Ui,"LI",{});var kU=i(ck);bf=a(kU,"A",{href:!0,rel:!0});var yU=i(bf);yA=n(yU,"Vectorization"),yU.forEach(t),kU.forEach(t),TA=p(Ui),pk=a(Ui,"LI",{});var TU=i(pk);vf=a(TU,"A",{href:!0,rel:!0});var wU=i(vf);wA=n(wU,"Parallelization"),wU.forEach(t),TU.forEach(t),Ui.forEach(t),$A=p(so),Eo=a(so,"DIV",{class:!0});var Wi=i(Eo);T(kf.$$.fragment,Wi),FA=p(Wi),or=a(Wi,"P",{});var Ku=i(or);xA=n(Ku,"The "),hk=a(Ku,"CODE",{});var $U=i(hk);BA=n($U,"FlaxBertPreTrainedModel"),$U.forEach(t),EA=n(Ku," forward method, overrides the "),fk=a(Ku,"CODE",{});var FU=i(fk);MA=n(FU,"__call__"),FU.forEach(t),zA=n(Ku," special method."),Ku.forEach(t),PA=p(Wi),T(di.$$.fragment,Wi),jA=p(Wi),T(ci.$$.fragment,Wi),Wi.forEach(t),so.forEach(t),this.h()},h(){h(d,"name","hf:doc:metadata"),h(d,"content",JSON.stringify(eH)),h(u,"id","bert"),h(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(u,"href","#bert"),h(m,"class","relative group"),h(pe,"id","overview"),h(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"),h(pe,"href","#overview"),h(S,"class","relative group"),h(fe,"href","https://arxiv.org/abs/1810.04805"),h(fe,"rel","nofollow"),h(me,"href","https://huggingface.co/thomwolf"),h(me,"rel","nofollow"),h(W,"href","https://github.com/google-research/bert"),h(W,"rel","nofollow"),h(N,"id","resources"),h(N,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(N,"href","#resources"),h(ce,"class","relative group"),h(I,"href","https://www.philschmid.de/bert-text-classification-in-a-different-language"),h(I,"rel","nofollow"),h(He,"href","https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/BERT/Fine_tuning_BERT_(and_friends)_for_multi_label_text_classification.ipynb"),h(He,"rel","nofollow"),h(Hi,"href","https://colab.research.google.com/github/abhimishra91/transformers-tutorials/blob/master/transformers_multi_label_classification.ipynb"),h(Hi,"rel","nofollow"),h(Ki,"href","https://colab.research.google.com/github/patrickvonplaten/notebooks/blob/master/BERT2BERT_for_CNN_Dailymail.ipynb"),h(Ki,"rel","nofollow"),h(Nf,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertForSequenceClassification"),h(Qi,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/text-classification"),h(Qi,"rel","nofollow"),h(Vi,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification.ipynb"),h(Vi,"rel","nofollow"),h(Of,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.TFBertForSequenceClassification"),h(Gi,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/text-classification"),h(Gi,"rel","nofollow"),h(Ji,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification-tf.ipynb"),h(Ji,"rel","nofollow"),h(If,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.FlaxBertForSequenceClassification"),h(Xi,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/text-classification"),h(Xi,"rel","nofollow"),h(Yi,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification_flax.ipynb"),h(Yi,"rel","nofollow"),h(tl,"href","https://www.philschmid.de/huggingface-transformers-keras-tf"),h(tl,"rel","nofollow"),h(ol,"href","https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/Custom_Named_Entity_Recognition_with_BERT_only_first_wordpiece.ipynb"),h(ol,"rel","nofollow"),h(nl,"href","https://github.com/NielsRogge/Transformers-Tutorials/blob/master/BERT/Custom_Named_Entity_Recognition_with_BERT.ipynb"),h(nl,"rel","nofollow"),h(Lf,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertForTokenClassification"),h(sl,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/token-classification"),h(sl,"rel","nofollow"),h(rl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/token_classification.ipynb"),h(rl,"rel","nofollow"),h(Df,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.TFBertForTokenClassification"),h(al,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/token-classification"),h(al,"rel","nofollow"),h(il,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/token_classification-tf.ipynb"),h(il,"rel","nofollow"),h(Sf,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.FlaxBertForTokenClassification"),h(ll,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/token-classification"),h(ll,"rel","nofollow"),h(dl,"href","https://huggingface.co/course/chapter7/2?fw=pt"),h(dl,"rel","nofollow"),h(Wf,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertForMaskedLM"),h(pl,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/language-modeling#robertabertdistilbert-and-masked-language-modeling"),h(pl,"rel","nofollow"),h(hl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb"),h(hl,"rel","nofollow"),h(Hf,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.TFBertForMaskedLM"),h(fl,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/language-modeling#run_mlmpy"),h(fl,"rel","nofollow"),h(ml,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb"),h(ml,"rel","nofollow"),h(Rf,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.FlaxBertForMaskedLM"),h(ul,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/language-modeling#masked-language-modeling"),h(ul,"rel","nofollow"),h(gl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/masked_language_modeling_flax.ipynb"),h(gl,"rel","nofollow"),h(_l,"href","https://huggingface.co/course/chapter7/3?fw=pt"),h(_l,"rel","nofollow"),h(Qf,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertForQuestionAnswering"),h(vl,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/question-answering"),h(vl,"rel","nofollow"),h(kl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/question_answering.ipynb"),h(kl,"rel","nofollow"),h(Vf,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.TFBertForQuestionAnswering"),h(yl,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/question-answering"),h(yl,"rel","nofollow"),h(Tl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/question_answering-tf.ipynb"),h(Tl,"rel","nofollow"),h(Gf,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.FlaxBertForQuestionAnswering"),h(wl,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/question-answering"),h(wl,"rel","nofollow"),h($l,"href","https://huggingface.co/course/chapter7/7?fw=pt"),h($l,"rel","nofollow"),h(Yf,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertForMultipleChoice"),h(Fl,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/multiple-choice"),h(Fl,"rel","nofollow"),h(xl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice.ipynb"),h(xl,"rel","nofollow"),h(Zf,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.TFBertForMultipleChoice"),h(Bl,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/multiple-choice"),h(Bl,"rel","nofollow"),h(El,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice-tf.ipynb"),h(El,"rel","nofollow"),h(Pl,"href","https://huggingface.co/blog/bert-inferentia-sagemaker"),h(Pl,"rel","nofollow"),h(ql,"href","https://www.philschmid.de/bert-deepspeed-inference"),h(ql,"rel","nofollow"),h(Nl,"href","https://www.philschmid.de/pre-training-bert-habana"),h(Nl,"rel","nofollow"),h(Ll,"href","https://www.philschmid.de/convert-transformers-to-onnx"),h(Ll,"rel","nofollow"),h(Sl,"href","https://www.philschmid.de/getting-started-habana-gaudi#conclusion"),h(Sl,"rel","nofollow"),h(Wl,"href","https://www.philschmid.de/terraform-huggingface-amazon-sagemaker-advanced"),h(Wl,"rel","nofollow"),h(Rl,"href","https://www.philschmid.de/serverless-bert-with-huggingface-aws-lambda-docker"),h(Rl,"rel","nofollow"),h(Ql,"href","https://www.philschmid.de/huggingface-amazon-sagemaker-training-compiler"),h(Ql,"rel","nofollow"),h(Gl,"href","https://www.philschmid.de/knowledge-distillation-bert-transformers"),h(Gl,"rel","nofollow"),h(dr,"id","transformers.BertConfig"),h(dr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(dr,"href","#transformers.BertConfig"),h(Ln,"class","relative group"),h(tm,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertModel"),h(om,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.TFBertModel"),h(Yl,"href","https://huggingface.co/bert-base-uncased"),h(Yl,"rel","nofollow"),h(nm,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),h(sm,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),h(ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(pr,"id","transformers.BertTokenizer"),h(pr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(pr,"href","#transformers.BertTokenizer"),h(Sn,"class","relative group"),h(rm,"href","/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),h(dn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(hr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(lm,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(mr,"id","transformers.BertTokenizerFast"),h(mr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(mr,"href","#transformers.BertTokenizerFast"),h(Wn,"class","relative group"),h(dm,"href","/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),h(cn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(co,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(gr,"id","transformers.TFBertTokenizer"),h(gr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(gr,"href","#transformers.TFBertTokenizer"),h(Rn,"class","relative group"),h(pn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(hn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(vr,"id","transformers.models.bert.modeling_bert.BertForPreTrainingOutput"),h(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"),h(vr,"href","#transformers.models.bert.modeling_bert.BertForPreTrainingOutput"),h(Vn,"class","relative group"),h(hm,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertForPreTraining"),h(Gn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(fm,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.TFBertForPreTraining"),h(Jn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(mm,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertForPreTraining"),h(kr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(yr,"id","transformers.BertModel"),h(yr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(yr,"href","#transformers.BertModel"),h(Xn,"class","relative group"),h(um,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),h(qd,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(qd,"rel","nofollow"),h(Ad,"href","https://arxiv.org/abs/1706.03762"),h(Ad,"rel","nofollow"),h(gm,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertModel"),h(po,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h($r,"id","transformers.BertForPreTraining"),h($r,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h($r,"href","#transformers.BertForPreTraining"),h(Zn,"class","relative group"),h(_m,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),h(Sd,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Sd,"rel","nofollow"),h(bm,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertForPreTraining"),h(ho,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Br,"id","transformers.BertLMHeadModel"),h(Br,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Br,"href","#transformers.BertLMHeadModel"),h(os,"class","relative group"),h(vm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),h(Vd,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Vd,"rel","nofollow"),h(km,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertLMHeadModel"),h(fo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(zr,"id","transformers.BertForMaskedLM"),h(zr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(zr,"href","#transformers.BertForMaskedLM"),h(ss,"class","relative group"),h(ym,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),h(tc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(tc,"rel","nofollow"),h(Tm,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertForMaskedLM"),h(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Cr,"id","transformers.BertForNextSentencePrediction"),h(Cr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Cr,"href","#transformers.BertForNextSentencePrediction"),h(as,"class","relative group"),h(wm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),h(lc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(lc,"rel","nofollow"),h($m,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertForNextSentencePrediction"),h(mo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Or,"id","transformers.BertForSequenceClassification"),h(Or,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Or,"href","#transformers.BertForSequenceClassification"),h(ls,"class","relative group"),h(Fm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),h(mc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(mc,"rel","nofollow"),h(xm,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertForSequenceClassification"),h(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Wr,"id","transformers.BertForMultipleChoice"),h(Wr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Wr,"href","#transformers.BertForMultipleChoice"),h(cs,"class","relative group"),h(Bm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),h(kc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(kc,"rel","nofollow"),h(Em,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertForMultipleChoice"),h(uo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Kr,"id","transformers.BertForTokenClassification"),h(Kr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Kr,"href","#transformers.BertForTokenClassification"),h(hs,"class","relative group"),h(Mm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),h(xc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(xc,"rel","nofollow"),h(zm,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertForTokenClassification"),h(Lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Jr,"id","transformers.BertForQuestionAnswering"),h(Jr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Jr,"href","#transformers.BertForQuestionAnswering"),h(ms,"class","relative group"),h(Pm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),h(jc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(jc,"rel","nofollow"),h(jm,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertForQuestionAnswering"),h(Dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ea,"id","transformers.TFBertModel"),h(ea,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ea,"href","#transformers.TFBertModel"),h(_s,"class","relative group"),h(qm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),h(Ic,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Ic,"rel","nofollow"),h(Cm,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.TFBertModel"),h(go,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(sa,"id","transformers.TFBertForPreTraining"),h(sa,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(sa,"href","#transformers.TFBertForPreTraining"),h(vs,"class","relative group"),h(Am,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),h(Hc,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Hc,"rel","nofollow"),h(Nm,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.TFBertForPreTraining"),h(_o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(la,"id","transformers.TFBertLMHeadModel"),h(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"),h(la,"href","#transformers.TFBertLMHeadModel"),h(Ts,"class","relative group"),h(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ws,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ca,"id","transformers.TFBertForMaskedLM"),h(ca,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ca,"href","#transformers.TFBertForMaskedLM"),h($s,"class","relative group"),h(Om,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),h(np,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(np,"rel","nofollow"),h(Im,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.TFBertForMaskedLM"),h(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ua,"id","transformers.TFBertForNextSentencePrediction"),h(ua,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ua,"href","#transformers.TFBertForNextSentencePrediction"),h(xs,"class","relative group"),h(Lm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),h(cp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(cp,"rel","nofollow"),h(Dm,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.TFBertForNextSentencePrediction"),h(bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(va,"id","transformers.TFBertForSequenceClassification"),h(va,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(va,"href","#transformers.TFBertForSequenceClassification"),h(Es,"class","relative group"),h(Sm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),h(gp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(gp,"rel","nofollow"),h(Um,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.TFBertForSequenceClassification"),h(Wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h($a,"id","transformers.TFBertForMultipleChoice"),h($a,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h($a,"href","#transformers.TFBertForMultipleChoice"),h(zs,"class","relative group"),h(Wm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),h(Tp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Tp,"rel","nofollow"),h(Hm,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.TFBertForMultipleChoice"),h(vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ea,"id","transformers.TFBertForTokenClassification"),h(Ea,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ea,"href","#transformers.TFBertForTokenClassification"),h(js,"class","relative group"),h(Rm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),h(Ep,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Ep,"rel","nofollow"),h(Km,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.TFBertForTokenClassification"),h(Ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(qa,"id","transformers.TFBertForQuestionAnswering"),h(qa,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(qa,"href","#transformers.TFBertForQuestionAnswering"),h(Cs,"class","relative group"),h(Qm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),h(Cp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Cp,"rel","nofollow"),h(Vm,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.TFBertForQuestionAnswering"),h(Rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ia,"id","transformers.FlaxBertModel"),h(Ia,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ia,"href","#transformers.FlaxBertModel"),h(Os,"class","relative group"),h(Gm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Dp,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Dp,"rel","nofollow"),h(Sp,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Sp,"rel","nofollow"),h(Up,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Up,"rel","nofollow"),h(Wp,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Wp,"rel","nofollow"),h(Hp,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Hp,"rel","nofollow"),h(ko,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Sa,"id","transformers.FlaxBertForPreTraining"),h(Sa,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Sa,"href","#transformers.FlaxBertForPreTraining"),h(Ls,"class","relative group"),h(Jm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Jp,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Jp,"rel","nofollow"),h(Xp,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Xp,"rel","nofollow"),h(Yp,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Yp,"rel","nofollow"),h(Zp,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Zp,"rel","nofollow"),h(eh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(eh,"rel","nofollow"),h(yo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ha,"id","transformers.FlaxBertForCausalLM"),h(Ha,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ha,"href","#transformers.FlaxBertForCausalLM"),h(Us,"class","relative group"),h(Xm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(ah,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(ah,"rel","nofollow"),h(ih,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(ih,"rel","nofollow"),h(lh,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(lh,"rel","nofollow"),h(dh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(dh,"rel","nofollow"),h(ch,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(ch,"rel","nofollow"),h(To,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Qa,"id","transformers.FlaxBertForMaskedLM"),h(Qa,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Qa,"href","#transformers.FlaxBertForMaskedLM"),h(Hs,"class","relative group"),h(Ym,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(_h,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(_h,"rel","nofollow"),h(bh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(bh,"rel","nofollow"),h(vh,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(vh,"rel","nofollow"),h(kh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(kh,"rel","nofollow"),h(yh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(yh,"rel","nofollow"),h(wo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ja,"id","transformers.FlaxBertForNextSentencePrediction"),h(Ja,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ja,"href","#transformers.FlaxBertForNextSentencePrediction"),h(Ks,"class","relative group"),h(Zm,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Eh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Eh,"rel","nofollow"),h(Mh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Mh,"rel","nofollow"),h(zh,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(zh,"rel","nofollow"),h(Ph,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Ph,"rel","nofollow"),h(jh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(jh,"rel","nofollow"),h($o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Za,"id","transformers.FlaxBertForSequenceClassification"),h(Za,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Za,"href","#transformers.FlaxBertForSequenceClassification"),h(Vs,"class","relative group"),h(eu,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Ih,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Ih,"rel","nofollow"),h(Lh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Lh,"rel","nofollow"),h(Dh,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Dh,"rel","nofollow"),h(Sh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Sh,"rel","nofollow"),h(Uh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Uh,"rel","nofollow"),h(Fo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(oi,"id","transformers.FlaxBertForMultipleChoice"),h(oi,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(oi,"href","#transformers.FlaxBertForMultipleChoice"),h(Js,"class","relative group"),h(tu,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Vh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Vh,"rel","nofollow"),h(Gh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Gh,"rel","nofollow"),h(Jh,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Jh,"rel","nofollow"),h(Xh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Xh,"rel","nofollow"),h(Yh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Yh,"rel","nofollow"),h(xo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ri,"id","transformers.FlaxBertForTokenClassification"),h(ri,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ri,"href","#transformers.FlaxBertForTokenClassification"),h(Ys,"class","relative group"),h(ou,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(sf,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(sf,"rel","nofollow"),h(rf,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(rf,"rel","nofollow"),h(af,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(af,"rel","nofollow"),h(lf,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(lf,"rel","nofollow"),h(df,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(df,"rel","nofollow"),h(Bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(li,"id","transformers.FlaxBertForQuestionAnswering"),h(li,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(li,"href","#transformers.FlaxBertForQuestionAnswering"),h(er,"class","relative group"),h(nu,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(uf,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(uf,"rel","nofollow"),h(gf,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(gf,"rel","nofollow"),h(_f,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(_f,"rel","nofollow"),h(bf,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(bf,"rel","nofollow"),h(vf,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(vf,"rel","nofollow"),h(Eo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(s,_){e(document.head,d),g(s,b,_),g(s,m,_),e(m,u),e(u,v),w(l,v,null),e(m,f),e(m,M),e(M,Fe),g(s,ke,_),g(s,S,_),e(S,pe),e(pe,Z),w(E,Z,null),e(S,xe),e(S,Q),e(Q,Be),g(s,ye,_),g(s,U,_),e(U,Ee),e(U,fe),e(fe,X),e(U,Me),g(s,Te,_),g(s,R,_),e(R,ze),g(s,we,_),g(s,K,_),e(K,_e),e(_e,Pe),g(s,te,_),g(s,j,_),e(j,q),e(q,je),g(s,G,_),g(s,ge,_),e(ge,qe),g(s,J,_),g(s,he,_),e(he,be),e(be,A),e(he,Ce),e(he,V),e(V,Ae),g(s,$e,_),g(s,D,_),e(D,Ne),e(D,me),e(me,L),e(D,Oe),e(D,W),e(W,Ie),e(D,ne),g(s,C,_),g(s,ce,_),e(ce,N),e(N,ve),w(ue,ve,null),e(ce,k),e(ce,z),e(z,Ve),g(s,oe,_),g(s,Ke,_),e(Ke,Ge),g(s,P,_),w(Ue,s,_),g(s,Qe,_),g(s,re,_),e(re,We),e(We,Je),e(We,I),e(I,Y),e(We,Xe),e(re,Ye),e(re,H),e(H,Ze),e(H,He),e(He,Le),e(H,et),e(re,se),e(re,Re),e(Re,t2),e(Re,Hi),e(Hi,o2),e(Re,n2),e(re,s2),e(re,Ri),e(Ri,r2),e(Ri,Ki),e(Ki,a2),e(Ri,i2),e(re,l2),e(re,Jo),e(Jo,Nf),e(Nf,d2),e(Jo,c2),e(Jo,Qi),e(Qi,p2),e(Jo,h2),e(Jo,Vi),e(Vi,f2),e(Jo,m2),e(re,u2),e(re,Xo),e(Xo,Of),e(Of,g2),e(Xo,_2),e(Xo,Gi),e(Gi,b2),e(Xo,v2),e(Xo,Ji),e(Ji,k2),e(Xo,y2),e(re,T2),e(re,Yo),e(Yo,If),e(If,w2),e(Yo,$2),e(Yo,Xi),e(Xi,F2),e(Yo,x2),e(Yo,Yi),e(Yi,B2),e(Yo,E2),g(s,fy,_),w(Zi,s,_),g(s,my,_),g(s,$t,_),e($t,el),e(el,M2),e(el,tl),e(tl,z2),e(el,P2),e($t,j2),e($t,In),e(In,q2),e(In,ol),e(ol,C2),e(In,A2),e(In,nl),e(nl,N2),e(In,O2),e($t,I2),e($t,Zo),e(Zo,Lf),e(Lf,L2),e(Zo,D2),e(Zo,sl),e(sl,S2),e(Zo,U2),e(Zo,rl),e(rl,W2),e(Zo,H2),e($t,R2),e($t,en),e(en,Df),e(Df,K2),e(en,Q2),e(en,al),e(al,V2),e(en,G2),e(en,il),e(il,J2),e(en,X2),e($t,Y2),e($t,rr),e(rr,Sf),e(Sf,Z2),e(rr,e$),e(rr,ll),e(ll,t$),e(rr,o$),e($t,n$),e($t,Uf),e(Uf,dl),e(dl,s$),e(Uf,r$),g(s,uy,_),w(cl,s,_),g(s,gy,_),g(s,ao,_),e(ao,tn),e(tn,Wf),e(Wf,a$),e(tn,i$),e(tn,pl),e(pl,l$),e(tn,d$),e(tn,hl),e(hl,c$),e(tn,p$),e(ao,h$),e(ao,on),e(on,Hf),e(Hf,f$),e(on,m$),e(on,fl),e(fl,u$),e(on,g$),e(on,ml),e(ml,_$),e(on,b$),e(ao,v$),e(ao,nn),e(nn,Rf),e(Rf,k$),e(nn,y$),e(nn,ul),e(ul,T$),e(nn,w$),e(nn,gl),e(gl,$$),e(nn,F$),e(ao,x$),e(ao,Kf),e(Kf,_l),e(_l,B$),e(Kf,E$),g(s,_y,_),w(bl,s,_),g(s,by,_),g(s,io,_),e(io,sn),e(sn,Qf),e(Qf,M$),e(sn,z$),e(sn,vl),e(vl,P$),e(sn,j$),e(sn,kl),e(kl,q$),e(sn,C$),e(io,A$),e(io,rn),e(rn,Vf),e(Vf,N$),e(rn,O$),e(rn,yl),e(yl,I$),e(rn,L$),e(rn,Tl),e(Tl,D$),e(rn,S$),e(io,U$),e(io,ar),e(ar,Gf),e(Gf,W$),e(ar,H$),e(ar,wl),e(wl,R$),e(ar,K$),e(io,Q$),e(io,Jf),e(Jf,$l),e($l,V$),e(Jf,G$),g(s,vy,_),g(s,Xf,_),e(Xf,Qu),e(Qu,J$),g(s,ky,_),g(s,ir,_),e(ir,an),e(an,Yf),e(Yf,X$),e(an,Y$),e(an,Fl),e(Fl,Z$),e(an,eF),e(an,xl),e(xl,tF),e(an,oF),e(ir,nF),e(ir,ln),e(ln,Zf),e(Zf,sF),e(ln,rF),e(ln,Bl),e(Bl,aF),e(ln,iF),e(ln,El),e(El,lF),e(ln,dF),g(s,yy,_),g(s,Ml,_),e(Ml,cF),e(Ml,Vu),e(Vu,pF),g(s,Ty,_),g(s,lr,_),e(lr,zl),e(zl,hF),e(zl,Pl),e(Pl,fF),e(zl,mF),e(lr,uF),e(lr,jl),e(jl,gF),e(jl,ql),e(ql,_F),e(jl,bF),g(s,wy,_),g(s,Cl,_),e(Cl,vF),e(Cl,Gu),e(Gu,kF),g(s,$y,_),g(s,em,_),e(em,Al),e(Al,yF),e(Al,Nl),e(Nl,TF),e(Al,wF),g(s,Fy,_),g(s,Ol,_),e(Ol,$F),e(Ol,Ju),e(Ju,FF),g(s,xy,_),g(s,Ft,_),e(Ft,Il),e(Il,xF),e(Il,Ll),e(Ll,BF),e(Il,EF),e(Ft,MF),e(Ft,Dl),e(Dl,zF),e(Dl,Sl),e(Sl,PF),e(Dl,jF),e(Ft,qF),e(Ft,Ul),e(Ul,CF),e(Ul,Wl),e(Wl,AF),e(Ul,NF),e(Ft,OF),e(Ft,Hl),e(Hl,IF),e(Hl,Rl),e(Rl,LF),e(Hl,DF),e(Ft,SF),e(Ft,Kl),e(Kl,UF),e(Kl,Ql),e(Ql,WF),e(Kl,HF),e(Ft,RF),e(Ft,Vl),e(Vl,KF),e(Vl,Gl),e(Gl,QF),e(Vl,VF),g(s,By,_),g(s,Ln,_),e(Ln,dr),e(dr,Xu),w(Jl,Xu,null),e(Ln,GF),e(Ln,Yu),e(Yu,JF),g(s,Ey,_),g(s,ro,_),w(Xl,ro,null),e(ro,XF),e(ro,Io),e(Io,YF),e(Io,tm),e(tm,ZF),e(Io,ex),e(Io,om),e(om,tx),e(Io,ox),e(Io,Yl),e(Yl,nx),e(Io,sx),e(ro,rx),e(ro,Dn),e(Dn,ax),e(Dn,nm),e(nm,ix),e(Dn,lx),e(Dn,sm),e(sm,dx),e(Dn,cx),e(ro,px),w(cr,ro,null),g(s,My,_),g(s,Sn,_),e(Sn,pr),e(pr,Zu),w(Zl,Zu,null),e(Sn,hx),e(Sn,eg),e(eg,fx),g(s,zy,_),g(s,tt,_),w(ed,tt,null),e(tt,mx),e(tt,tg),e(tg,ux),e(tt,gx),e(tt,td),e(td,_x),e(td,rm),e(rm,bx),e(td,vx),e(tt,kx),e(tt,dn),w(od,dn,null),e(dn,yx),e(dn,og),e(og,Tx),e(dn,wx),e(dn,nd),e(nd,am),e(am,$x),e(am,ng),e(ng,Fx),e(nd,xx),e(nd,im),e(im,Bx),e(im,sg),e(sg,Ex),e(tt,Mx),e(tt,hr),w(sd,hr,null),e(hr,zx),e(hr,rd),e(rd,Px),e(rd,rg),e(rg,jx),e(rd,qx),e(tt,Cx),e(tt,lo),w(ad,lo,null),e(lo,Ax),e(lo,ag),e(ag,Nx),e(lo,Ox),w(fr,lo,null),e(lo,Ix),e(lo,Un),e(Un,Lx),e(Un,ig),e(ig,Dx),e(Un,Sx),e(Un,lg),e(lg,Ux),e(Un,Wx),e(tt,Hx),e(tt,lm),w(id,lm,null),g(s,Py,_),g(s,Wn,_),e(Wn,mr),e(mr,dg),w(ld,dg,null),e(Wn,Rx),e(Wn,cg),e(cg,Kx),g(s,jy,_),g(s,Bt,_),w(dd,Bt,null),e(Bt,Qx),e(Bt,cd),e(cd,Vx),e(cd,pg),e(pg,Gx),e(cd,Jx),e(Bt,Xx),e(Bt,pd),e(pd,Yx),e(pd,dm),e(dm,Zx),e(pd,e0),e(Bt,t0),e(Bt,cn),w(hd,cn,null),e(cn,o0),e(cn,hg),e(hg,n0),e(cn,s0),e(cn,fd),e(fd,cm),e(cm,r0),e(cm,fg),e(fg,a0),e(fd,i0),e(fd,pm),e(pm,l0),e(pm,mg),e(mg,d0),e(Bt,c0),e(Bt,co),w(md,co,null),e(co,p0),e(co,ug),e(ug,h0),e(co,f0),w(ur,co,null),e(co,m0),e(co,Hn),e(Hn,u0),e(Hn,gg),e(gg,g0),e(Hn,_0),e(Hn,_g),e(_g,b0),e(Hn,v0),g(s,qy,_),g(s,Rn,_),e(Rn,gr),e(gr,bg),w(ud,bg,null),e(Rn,k0),e(Rn,vg),e(vg,y0),g(s,Cy,_),g(s,Et,_),w(gd,Et,null),e(Et,T0),e(Et,Kn),e(Kn,w0),e(Kn,kg),e(kg,$0),e(Kn,F0),e(Kn,yg),e(yg,x0),e(Kn,B0),e(Et,E0),e(Et,_d),e(_d,M0),e(_d,Tg),e(Tg,z0),e(_d,P0),e(Et,j0),e(Et,pn),w(bd,pn,null),e(pn,q0),e(pn,vd),e(vd,C0),e(vd,wg),e(wg,A0),e(vd,N0),e(pn,O0),w(_r,pn,null),e(Et,I0),e(Et,hn),w(kd,hn,null),e(hn,L0),e(hn,Qn),e(Qn,D0),e(Qn,$g),e($g,S0),e(Qn,U0),e(Qn,Fg),e(Fg,W0),e(Qn,H0),e(hn,R0),w(br,hn,null),g(s,Ay,_),g(s,Vn,_),e(Vn,vr),e(vr,xg),w(yd,xg,null),e(Vn,K0),e(Vn,Bg),e(Bg,Q0),g(s,Ny,_),g(s,Gn,_),w(Td,Gn,null),e(Gn,V0),e(Gn,wd),e(wd,G0),e(wd,hm),e(hm,J0),e(wd,X0),g(s,Oy,_),g(s,Jn,_),w($d,Jn,null),e(Jn,Y0),e(Jn,Fd),e(Fd,Z0),e(Fd,fm),e(fm,e4),e(Fd,t4),g(s,Iy,_),g(s,Lo,_),w(xd,Lo,null),e(Lo,o4),e(Lo,Bd),e(Bd,n4),e(Bd,mm),e(mm,s4),e(Bd,r4),e(Lo,a4),e(Lo,kr),w(Ed,kr,null),e(kr,i4),e(kr,Eg),e(Eg,l4),g(s,Ly,_),g(s,Xn,_),e(Xn,yr),e(yr,Mg),w(Md,Mg,null),e(Xn,d4),e(Xn,zg),e(zg,c4),g(s,Dy,_),g(s,ot,_),w(zd,ot,null),e(ot,p4),e(ot,Pg),e(Pg,h4),e(ot,f4),e(ot,Pd),e(Pd,m4),e(Pd,um),e(um,u4),e(Pd,g4),e(ot,_4),e(ot,jd),e(jd,b4),e(jd,qd),e(qd,v4),e(jd,k4),e(ot,y4),e(ot,Cd),e(Cd,T4),e(Cd,Ad),e(Ad,w4),e(Cd,$4),e(ot,F4),e(ot,mt),e(mt,x4),e(mt,jg),e(jg,B4),e(mt,E4),e(mt,qg),e(qg,M4),e(mt,z4),e(mt,Cg),e(Cg,P4),e(mt,j4),e(mt,Ag),e(Ag,q4),e(mt,C4),e(mt,Ng),e(Ng,A4),e(mt,N4),e(mt,Og),e(Og,O4),e(mt,I4),e(ot,L4),e(ot,po),w(Nd,po,null),e(po,D4),e(po,Yn),e(Yn,S4),e(Yn,gm),e(gm,U4),e(Yn,W4),e(Yn,Ig),e(Ig,H4),e(Yn,R4),e(po,K4),w(Tr,po,null),e(po,Q4),w(wr,po,null),g(s,Sy,_),g(s,Zn,_),e(Zn,$r),e($r,Lg),w(Od,Lg,null),e(Zn,V4),e(Zn,Dg),e(Dg,G4),g(s,Uy,_),g(s,Mt,_),w(Id,Mt,null),e(Mt,J4),e(Mt,es),e(es,X4),e(es,Sg),e(Sg,Y4),e(es,Z4),e(es,Ug),e(Ug,eB),e(es,tB),e(Mt,oB),e(Mt,Ld),e(Ld,nB),e(Ld,_m),e(_m,sB),e(Ld,rB),e(Mt,aB),e(Mt,Dd),e(Dd,iB),e(Dd,Sd),e(Sd,lB),e(Dd,dB),e(Mt,cB),e(Mt,ho),w(Ud,ho,null),e(ho,pB),e(ho,ts),e(ts,hB),e(ts,bm),e(bm,fB),e(ts,mB),e(ts,Wg),e(Wg,uB),e(ts,gB),e(ho,_B),w(Fr,ho,null),e(ho,bB),w(xr,ho,null),g(s,Wy,_),g(s,os,_),e(os,Br),e(Br,Hg),w(Wd,Hg,null),e(os,vB),e(os,Rg),e(Rg,kB),g(s,Hy,_),g(s,zt,_),w(Hd,zt,null),e(zt,yB),e(zt,Rd),e(Rd,TB),e(Rd,Kg),e(Kg,wB),e(Rd,$B),e(zt,FB),e(zt,Kd),e(Kd,xB),e(Kd,vm),e(vm,BB),e(Kd,EB),e(zt,MB),e(zt,Qd),e(Qd,zB),e(Qd,Vd),e(Vd,PB),e(Qd,jB),e(zt,qB),e(zt,fo),w(Gd,fo,null),e(fo,CB),e(fo,ns),e(ns,AB),e(ns,km),e(km,NB),e(ns,OB),e(ns,Qg),e(Qg,IB),e(ns,LB),e(fo,DB),w(Er,fo,null),e(fo,SB),w(Mr,fo,null),g(s,Ry,_),g(s,ss,_),e(ss,zr),e(zr,Vg),w(Jd,Vg,null),e(ss,UB),e(ss,Gg),e(Gg,WB),g(s,Ky,_),g(s,Pt,_),w(Xd,Pt,null),e(Pt,HB),e(Pt,Yd),e(Yd,RB),e(Yd,Jg),e(Jg,KB),e(Yd,QB),e(Pt,VB),e(Pt,Zd),e(Zd,GB),e(Zd,ym),e(ym,JB),e(Zd,XB),e(Pt,YB),e(Pt,ec),e(ec,ZB),e(ec,tc),e(tc,eE),e(ec,tE),e(Pt,oE),e(Pt,It),w(oc,It,null),e(It,nE),e(It,rs),e(rs,sE),e(rs,Tm),e(Tm,rE),e(rs,aE),e(rs,Xg),e(Xg,iE),e(rs,lE),e(It,dE),w(Pr,It,null),e(It,cE),w(jr,It,null),e(It,pE),w(qr,It,null),g(s,Qy,_),g(s,as,_),e(as,Cr),e(Cr,Yg),w(nc,Yg,null),e(as,hE),e(as,Zg),e(Zg,fE),g(s,Vy,_),g(s,jt,_),w(sc,jt,null),e(jt,mE),e(jt,rc),e(rc,uE),e(rc,e_),e(e_,gE),e(rc,_E),e(jt,bE),e(jt,ac),e(ac,vE),e(ac,wm),e(wm,kE),e(ac,yE),e(jt,TE),e(jt,ic),e(ic,wE),e(ic,lc),e(lc,$E),e(ic,FE),e(jt,xE),e(jt,mo),w(dc,mo,null),e(mo,BE),e(mo,is),e(is,EE),e(is,$m),e($m,ME),e(is,zE),e(is,t_),e(t_,PE),e(is,jE),e(mo,qE),w(Ar,mo,null),e(mo,CE),w(Nr,mo,null),g(s,Gy,_),g(s,ls,_),e(ls,Or),e(Or,o_),w(cc,o_,null),e(ls,AE),e(ls,n_),e(n_,NE),g(s,Jy,_),g(s,qt,_),w(pc,qt,null),e(qt,OE),e(qt,s_),e(s_,IE),e(qt,LE),e(qt,hc),e(hc,DE),e(hc,Fm),e(Fm,SE),e(hc,UE),e(qt,WE),e(qt,fc),e(fc,HE),e(fc,mc),e(mc,RE),e(fc,KE),e(qt,QE),e(qt,ft),w(uc,ft,null),e(ft,VE),e(ft,ds),e(ds,GE),e(ds,xm),e(xm,JE),e(ds,XE),e(ds,r_),e(r_,YE),e(ds,ZE),e(ft,e5),w(Ir,ft,null),e(ft,t5),w(Lr,ft,null),e(ft,o5),w(Dr,ft,null),e(ft,n5),w(Sr,ft,null),e(ft,s5),w(Ur,ft,null),g(s,Xy,_),g(s,cs,_),e(cs,Wr),e(Wr,a_),w(gc,a_,null),e(cs,r5),e(cs,i_),e(i_,a5),g(s,Yy,_),g(s,Ct,_),w(_c,Ct,null),e(Ct,i5),e(Ct,l_),e(l_,l5),e(Ct,d5),e(Ct,bc),e(bc,c5),e(bc,Bm),e(Bm,p5),e(bc,h5),e(Ct,f5),e(Ct,vc),e(vc,m5),e(vc,kc),e(kc,u5),e(vc,g5),e(Ct,_5),e(Ct,uo),w(yc,uo,null),e(uo,b5),e(uo,ps),e(ps,v5),e(ps,Em),e(Em,k5),e(ps,y5),e(ps,d_),e(d_,T5),e(ps,w5),e(uo,$5),w(Hr,uo,null),e(uo,F5),w(Rr,uo,null),g(s,Zy,_),g(s,hs,_),e(hs,Kr),e(Kr,c_),w(Tc,c_,null),e(hs,x5),e(hs,p_),e(p_,B5),g(s,e1,_),g(s,At,_),w(wc,At,null),e(At,E5),e(At,h_),e(h_,M5),e(At,z5),e(At,$c),e($c,P5),e($c,Mm),e(Mm,j5),e($c,q5),e(At,C5),e(At,Fc),e(Fc,A5),e(Fc,xc),e(xc,N5),e(Fc,O5),e(At,I5),e(At,Lt),w(Bc,Lt,null),e(Lt,L5),e(Lt,fs),e(fs,D5),e(fs,zm),e(zm,S5),e(fs,U5),e(fs,f_),e(f_,W5),e(fs,H5),e(Lt,R5),w(Qr,Lt,null),e(Lt,K5),w(Vr,Lt,null),e(Lt,Q5),w(Gr,Lt,null),g(s,t1,_),g(s,ms,_),e(ms,Jr),e(Jr,m_),w(Ec,m_,null),e(ms,V5),e(ms,u_),e(u_,G5),g(s,o1,_),g(s,Nt,_),w(Mc,Nt,null),e(Nt,J5),e(Nt,us),e(us,X5),e(us,g_),e(g_,Y5),e(us,Z5),e(us,__),e(__,eM),e(us,tM),e(Nt,oM),e(Nt,zc),e(zc,nM),e(zc,Pm),e(Pm,sM),e(zc,rM),e(Nt,aM),e(Nt,Pc),e(Pc,iM),e(Pc,jc),e(jc,lM),e(Pc,dM),e(Nt,cM),e(Nt,Dt),w(qc,Dt,null),e(Dt,pM),e(Dt,gs),e(gs,hM),e(gs,jm),e(jm,fM),e(gs,mM),e(gs,b_),e(b_,uM),e(gs,gM),e(Dt,_M),w(Xr,Dt,null),e(Dt,bM),w(Yr,Dt,null),e(Dt,vM),w(Zr,Dt,null),g(s,n1,_),g(s,_s,_),e(_s,ea),e(ea,v_),w(Cc,v_,null),e(_s,kM),e(_s,k_),e(k_,yM),g(s,s1,_),g(s,ut,_),w(Ac,ut,null),e(ut,TM),e(ut,y_),e(y_,wM),e(ut,$M),e(ut,Nc),e(Nc,FM),e(Nc,qm),e(qm,xM),e(Nc,BM),e(ut,EM),e(ut,Oc),e(Oc,MM),e(Oc,Ic),e(Ic,zM),e(Oc,PM),e(ut,jM),w(ta,ut,null),e(ut,qM),e(ut,go),w(Lc,go,null),e(go,CM),e(go,bs),e(bs,AM),e(bs,Cm),e(Cm,NM),e(bs,OM),e(bs,T_),e(T_,IM),e(bs,LM),e(go,DM),w(oa,go,null),e(go,SM),w(na,go,null),g(s,r1,_),g(s,vs,_),e(vs,sa),e(sa,w_),w(Dc,w_,null),e(vs,UM),e(vs,$_),e($_,WM),g(s,a1,_),g(s,gt,_),w(Sc,gt,null),e(gt,HM),e(gt,ks),e(ks,RM),e(ks,F_),e(F_,KM),e(ks,QM),e(ks,x_),e(x_,VM),e(ks,GM),e(gt,JM),e(gt,Uc),e(Uc,XM),e(Uc,Am),e(Am,YM),e(Uc,ZM),e(gt,ez),e(gt,Wc),e(Wc,tz),e(Wc,Hc),e(Hc,oz),e(Wc,nz),e(gt,sz),w(ra,gt,null),e(gt,rz),e(gt,_o),w(Rc,_o,null),e(_o,az),e(_o,ys),e(ys,iz),e(ys,Nm),e(Nm,lz),e(ys,dz),e(ys,B_),e(B_,cz),e(ys,pz),e(_o,hz),w(aa,_o,null),e(_o,fz),w(ia,_o,null),g(s,i1,_),g(s,Ts,_),e(Ts,la),e(la,E_),w(Kc,E_,null),e(Ts,mz),e(Ts,M_),e(M_,uz),g(s,l1,_),g(s,ws,_),w(Qc,ws,null),e(ws,gz),e(ws,St),w(Vc,St,null),e(St,_z),e(St,nt),e(nt,bz),e(nt,z_),e(z_,vz),e(nt,kz),e(nt,P_),e(P_,yz),e(nt,Tz),e(nt,j_),e(j_,wz),e(nt,$z),e(nt,q_),e(q_,Fz),e(nt,xz),e(nt,C_),e(C_,Bz),e(nt,Ez),e(nt,A_),e(A_,Mz),e(nt,zz),e(nt,N_),e(N_,Pz),e(nt,jz),e(St,qz),e(St,Gc),e(Gc,Jc),e(Jc,Cz),e(Jc,O_),e(O_,Az),e(Jc,Nz),e(Gc,Oz),e(Gc,Xc),e(Xc,Iz),e(Xc,I_),e(I_,Lz),e(Xc,Dz),e(St,Sz),e(St,ee),e(ee,Uz),e(ee,L_),e(L_,Wz),e(ee,Hz),e(ee,D_),e(D_,Rz),e(ee,Kz),e(ee,S_),e(S_,Qz),e(ee,Vz),e(ee,U_),e(U_,Gz),e(ee,Jz),e(ee,W_),e(W_,Xz),e(ee,Yz),e(ee,H_),e(H_,Zz),e(ee,eP),e(ee,R_),e(R_,tP),e(ee,oP),e(ee,K_),e(K_,nP),e(ee,sP),e(ee,Q_),e(Q_,rP),e(ee,aP),e(ee,V_),e(V_,iP),e(ee,lP),e(ee,G_),e(G_,dP),e(ee,cP),e(ee,J_),e(J_,pP),e(ee,hP),e(ee,X_),e(X_,fP),e(ee,mP),e(ee,Y_),e(Y_,uP),e(ee,gP),e(ee,Z_),e(Z_,_P),e(ee,bP),e(ee,eb),e(eb,vP),e(ee,kP),e(ee,tb),e(tb,yP),e(ee,TP),e(ee,ob),e(ob,wP),e(ee,$P),e(ee,nb),e(nb,FP),e(ee,xP),e(ee,sb),e(sb,BP),e(ee,EP),e(St,MP),w(da,St,null),g(s,d1,_),g(s,$s,_),e($s,ca),e(ca,rb),w(Yc,rb,null),e($s,zP),e($s,ab),e(ab,PP),g(s,c1,_),g(s,_t,_),w(Zc,_t,null),e(_t,jP),e(_t,ep),e(ep,qP),e(ep,ib),e(ib,CP),e(ep,AP),e(_t,NP),e(_t,tp),e(tp,OP),e(tp,Om),e(Om,IP),e(tp,LP),e(_t,DP),e(_t,op),e(op,SP),e(op,np),e(np,UP),e(op,WP),e(_t,HP),w(pa,_t,null),e(_t,RP),e(_t,Ut),w(sp,Ut,null),e(Ut,KP),e(Ut,Fs),e(Fs,QP),e(Fs,Im),e(Im,VP),e(Fs,GP),e(Fs,lb),e(lb,JP),e(Fs,XP),e(Ut,YP),w(ha,Ut,null),e(Ut,ZP),w(fa,Ut,null),e(Ut,ej),w(ma,Ut,null),g(s,p1,_),g(s,xs,_),e(xs,ua),e(ua,db),w(rp,db,null),e(xs,tj),e(xs,cb),e(cb,oj),g(s,h1,_),g(s,bt,_),w(ap,bt,null),e(bt,nj),e(bt,ip),e(ip,sj),e(ip,pb),e(pb,rj),e(ip,aj),e(bt,ij),e(bt,lp),e(lp,lj),e(lp,Lm),e(Lm,dj),e(lp,cj),e(bt,pj),e(bt,dp),e(dp,hj),e(dp,cp),e(cp,fj),e(dp,mj),e(bt,uj),w(ga,bt,null),e(bt,gj),e(bt,bo),w(pp,bo,null),e(bo,_j),e(bo,Bs),e(Bs,bj),e(Bs,Dm),e(Dm,vj),e(Bs,kj),e(Bs,hb),e(hb,yj),e(Bs,Tj),e(bo,wj),w(_a,bo,null),e(bo,$j),w(ba,bo,null),g(s,f1,_),g(s,Es,_),e(Es,va),e(va,fb),w(hp,fb,null),e(Es,Fj),e(Es,mb),e(mb,xj),g(s,m1,_),g(s,vt,_),w(fp,vt,null),e(vt,Bj),e(vt,ub),e(ub,Ej),e(vt,Mj),e(vt,mp),e(mp,zj),e(mp,Sm),e(Sm,Pj),e(mp,jj),e(vt,qj),e(vt,up),e(up,Cj),e(up,gp),e(gp,Aj),e(up,Nj),e(vt,Oj),w(ka,vt,null),e(vt,Ij),e(vt,Wt),w(_p,Wt,null),e(Wt,Lj),e(Wt,Ms),e(Ms,Dj),e(Ms,Um),e(Um,Sj),e(Ms,Uj),e(Ms,gb),e(gb,Wj),e(Ms,Hj),e(Wt,Rj),w(ya,Wt,null),e(Wt,Kj),w(Ta,Wt,null),e(Wt,Qj),w(wa,Wt,null),g(s,u1,_),g(s,zs,_),e(zs,$a),e($a,_b),w(bp,_b,null),e(zs,Vj),e(zs,bb),e(bb,Gj),g(s,g1,_),g(s,kt,_),w(vp,kt,null),e(kt,Jj),e(kt,vb),e(vb,Xj),e(kt,Yj),e(kt,kp),e(kp,Zj),e(kp,Wm),e(Wm,eq),e(kp,tq),e(kt,oq),e(kt,yp),e(yp,nq),e(yp,Tp),e(Tp,sq),e(yp,rq),e(kt,aq),w(Fa,kt,null),e(kt,iq),e(kt,vo),w(wp,vo,null),e(vo,lq),e(vo,Ps),e(Ps,dq),e(Ps,Hm),e(Hm,cq),e(Ps,pq),e(Ps,kb),e(kb,hq),e(Ps,fq),e(vo,mq),w(xa,vo,null),e(vo,uq),w(Ba,vo,null),g(s,_1,_),g(s,js,_),e(js,Ea),e(Ea,yb),w($p,yb,null),e(js,gq),e(js,Tb),e(Tb,_q),g(s,b1,_),g(s,yt,_),w(Fp,yt,null),e(yt,bq),e(yt,wb),e(wb,vq),e(yt,kq),e(yt,xp),e(xp,yq),e(xp,Rm),e(Rm,Tq),e(xp,wq),e(yt,$q),e(yt,Bp),e(Bp,Fq),e(Bp,Ep),e(Ep,xq),e(Bp,Bq),e(yt,Eq),w(Ma,yt,null),e(yt,Mq),e(yt,Ht),w(Mp,Ht,null),e(Ht,zq),e(Ht,qs),e(qs,Pq),e(qs,Km),e(Km,jq),e(qs,qq),e(qs,$b),e($b,Cq),e(qs,Aq),e(Ht,Nq),w(za,Ht,null),e(Ht,Oq),w(Pa,Ht,null),e(Ht,Iq),w(ja,Ht,null),g(s,v1,_),g(s,Cs,_),e(Cs,qa),e(qa,Fb),w(zp,Fb,null),e(Cs,Lq),e(Cs,xb),e(xb,Dq),g(s,k1,_),g(s,Tt,_),w(Pp,Tt,null),e(Tt,Sq),e(Tt,As),e(As,Uq),e(As,Bb),e(Bb,Wq),e(As,Hq),e(As,Eb),e(Eb,Rq),e(As,Kq),e(Tt,Qq),e(Tt,jp),e(jp,Vq),e(jp,Qm),e(Qm,Gq),e(jp,Jq),e(Tt,Xq),e(Tt,qp),e(qp,Yq),e(qp,Cp),e(Cp,Zq),e(qp,e3),e(Tt,t3),w(Ca,Tt,null),e(Tt,o3),e(Tt,Rt),w(Ap,Rt,null),e(Rt,n3),e(Rt,Ns),e(Ns,s3),e(Ns,Vm),e(Vm,r3),e(Ns,a3),e(Ns,Mb),e(Mb,i3),e(Ns,l3),e(Rt,d3),w(Aa,Rt,null),e(Rt,c3),w(Na,Rt,null),e(Rt,p3),w(Oa,Rt,null),g(s,y1,_),g(s,Os,_),e(Os,Ia),e(Ia,zb),w(Np,zb,null),e(Os,h3),e(Os,Pb),e(Pb,f3),g(s,T1,_),g(s,st,_),w(Op,st,null),e(st,m3),e(st,jb),e(jb,u3),e(st,g3),e(st,Ip),e(Ip,_3),e(Ip,Gm),e(Gm,b3),e(Ip,v3),e(st,k3),e(st,Lp),e(Lp,y3),e(Lp,Dp),e(Dp,T3),e(Lp,w3),e(st,$3),e(st,qb),e(qb,F3),e(st,x3),e(st,Do),e(Do,Cb),e(Cb,Sp),e(Sp,B3),e(Do,E3),e(Do,Ab),e(Ab,Up),e(Up,M3),e(Do,z3),e(Do,Nb),e(Nb,Wp),e(Wp,P3),e(Do,j3),e(Do,Ob),e(Ob,Hp),e(Hp,q3),e(st,C3),e(st,ko),w(Rp,ko,null),e(ko,A3),e(ko,Is),e(Is,N3),e(Is,Ib),e(Ib,O3),e(Is,I3),e(Is,Lb),e(Lb,L3),e(Is,D3),e(ko,S3),w(La,ko,null),e(ko,U3),w(Da,ko,null),g(s,w1,_),g(s,Ls,_),e(Ls,Sa),e(Sa,Db),w(Kp,Db,null),e(Ls,W3),e(Ls,Sb),e(Sb,H3),g(s,$1,_),g(s,rt,_),w(Qp,rt,null),e(rt,R3),e(rt,Ds),e(Ds,K3),e(Ds,Ub),e(Ub,Q3),e(Ds,V3),e(Ds,Wb),e(Wb,G3),e(Ds,J3),e(rt,X3),e(rt,Vp),e(Vp,Y3),e(Vp,Jm),e(Jm,Z3),e(Vp,eC),e(rt,tC),e(rt,Gp),e(Gp,oC),e(Gp,Jp),e(Jp,nC),e(Gp,sC),e(rt,rC),e(rt,Hb),e(Hb,aC),e(rt,iC),e(rt,So),e(So,Rb),e(Rb,Xp),e(Xp,lC),e(So,dC),e(So,Kb),e(Kb,Yp),e(Yp,cC),e(So,pC),e(So,Qb),e(Qb,Zp),e(Zp,hC),e(So,fC),e(So,Vb),e(Vb,eh),e(eh,mC),e(rt,uC),e(rt,yo),w(th,yo,null),e(yo,gC),e(yo,Ss),e(Ss,_C),e(Ss,Gb),e(Gb,bC),e(Ss,vC),e(Ss,Jb),e(Jb,kC),e(Ss,yC),e(yo,TC),w(Ua,yo,null),e(yo,wC),w(Wa,yo,null),g(s,F1,_),g(s,Us,_),e(Us,Ha),e(Ha,Xb),w(oh,Xb,null),e(Us,$C),e(Us,Yb),e(Yb,FC),g(s,x1,_),g(s,at,_),w(nh,at,null),e(at,xC),e(at,Zb),e(Zb,BC),e(at,EC),e(at,sh),e(sh,MC),e(sh,Xm),e(Xm,zC),e(sh,PC),e(at,jC),e(at,rh),e(rh,qC),e(rh,ah),e(ah,CC),e(rh,AC),e(at,NC),e(at,ev),e(ev,OC),e(at,IC),e(at,Uo),e(Uo,tv),e(tv,ih),e(ih,LC),e(Uo,DC),e(Uo,ov),e(ov,lh),e(lh,SC),e(Uo,UC),e(Uo,nv),e(nv,dh),e(dh,WC),e(Uo,HC),e(Uo,sv),e(sv,ch),e(ch,RC),e(at,KC),e(at,To),w(ph,To,null),e(To,QC),e(To,Ws),e(Ws,VC),e(Ws,rv),e(rv,GC),e(Ws,JC),e(Ws,av),e(av,XC),e(Ws,YC),e(To,ZC),w(Ra,To,null),e(To,e6),w(Ka,To,null),g(s,B1,_),g(s,Hs,_),e(Hs,Qa),e(Qa,iv),w(hh,iv,null),e(Hs,t6),e(Hs,lv),e(lv,o6),g(s,E1,_),g(s,it,_),w(fh,it,null),e(it,n6),e(it,mh),e(mh,s6),e(mh,dv),e(dv,r6),e(mh,a6),e(it,i6),e(it,uh),e(uh,l6),e(uh,Ym),e(Ym,d6),e(uh,c6),e(it,p6),e(it,gh),e(gh,h6),e(gh,_h),e(_h,f6),e(gh,m6),e(it,u6),e(it,cv),e(cv,g6),e(it,_6),e(it,Wo),e(Wo,pv),e(pv,bh),e(bh,b6),e(Wo,v6),e(Wo,hv),e(hv,vh),e(vh,k6),e(Wo,y6),e(Wo,fv),e(fv,kh),e(kh,T6),e(Wo,w6),e(Wo,mv),e(mv,yh),e(yh,$6),e(it,F6),e(it,wo),w(Th,wo,null),e(wo,x6),e(wo,Rs),e(Rs,B6),e(Rs,uv),e(uv,E6),e(Rs,M6),e(Rs,gv),e(gv,z6),e(Rs,P6),e(wo,j6),w(Va,wo,null),e(wo,q6),w(Ga,wo,null),g(s,M1,_),g(s,Ks,_),e(Ks,Ja),e(Ja,_v),w(wh,_v,null),e(Ks,C6),e(Ks,bv),e(bv,A6),g(s,z1,_),g(s,lt,_),w($h,lt,null),e(lt,N6),e(lt,Fh),e(Fh,O6),e(Fh,vv),e(vv,I6),e(Fh,L6),e(lt,D6),e(lt,xh),e(xh,S6),e(xh,Zm),e(Zm,U6),e(xh,W6),e(lt,H6),e(lt,Bh),e(Bh,R6),e(Bh,Eh),e(Eh,K6),e(Bh,Q6),e(lt,V6),e(lt,kv),e(kv,G6),e(lt,J6),e(lt,Ho),e(Ho,yv),e(yv,Mh),e(Mh,X6),e(Ho,Y6),e(Ho,Tv),e(Tv,zh),e(zh,Z6),e(Ho,e7),e(Ho,wv),e(wv,Ph),e(Ph,t7),e(Ho,o7),e(Ho,$v),e($v,jh),e(jh,n7),e(lt,s7),e(lt,$o),w(qh,$o,null),e($o,r7),e($o,Qs),e(Qs,a7),e(Qs,Fv),e(Fv,i7),e(Qs,l7),e(Qs,xv),e(xv,d7),e(Qs,c7),e($o,p7),w(Xa,$o,null),e($o,h7),w(Ya,$o,null),g(s,P1,_),g(s,Vs,_),e(Vs,Za),e(Za,Bv),w(Ch,Bv,null),e(Vs,f7),e(Vs,Ev),e(Ev,m7),g(s,j1,_),g(s,dt,_),w(Ah,dt,null),e(dt,u7),e(dt,Mv),e(Mv,g7),e(dt,_7),e(dt,Nh),e(Nh,b7),e(Nh,eu),e(eu,v7),e(Nh,k7),e(dt,y7),e(dt,Oh),e(Oh,T7),e(Oh,Ih),e(Ih,w7),e(Oh,$7),e(dt,F7),e(dt,zv),e(zv,x7),e(dt,B7),e(dt,Ro),e(Ro,Pv),e(Pv,Lh),e(Lh,E7),e(Ro,M7),e(Ro,jv),e(jv,Dh),e(Dh,z7),e(Ro,P7),e(Ro,qv),e(qv,Sh),e(Sh,j7),e(Ro,q7),e(Ro,Cv),e(Cv,Uh),e(Uh,C7),e(dt,A7),e(dt,Fo),w(Wh,Fo,null),e(Fo,N7),e(Fo,Gs),e(Gs,O7),e(Gs,Av),e(Av,I7),e(Gs,L7),e(Gs,Nv),e(Nv,D7),e(Gs,S7),e(Fo,U7),w(ei,Fo,null),e(Fo,W7),w(ti,Fo,null),g(s,q1,_),g(s,Js,_),e(Js,oi),e(oi,Ov),w(Hh,Ov,null),e(Js,H7),e(Js,Iv),e(Iv,R7),g(s,C1,_),g(s,ct,_),w(Rh,ct,null),e(ct,K7),e(ct,Lv),e(Lv,Q7),e(ct,V7),e(ct,Kh),e(Kh,G7),e(Kh,tu),e(tu,J7),e(Kh,X7),e(ct,Y7),e(ct,Qh),e(Qh,Z7),e(Qh,Vh),e(Vh,e8),e(Qh,t8),e(ct,o8),e(ct,Dv),e(Dv,n8),e(ct,s8),e(ct,Ko),e(Ko,Sv),e(Sv,Gh),e(Gh,r8),e(Ko,a8),e(Ko,Uv),e(Uv,Jh),e(Jh,i8),e(Ko,l8),e(Ko,Wv),e(Wv,Xh),e(Xh,d8),e(Ko,c8),e(Ko,Hv),e(Hv,Yh),e(Yh,p8),e(ct,h8),e(ct,xo),w(Zh,xo,null),e(xo,f8),e(xo,Xs),e(Xs,m8),e(Xs,Rv),e(Rv,u8),e(Xs,g8),e(Xs,Kv),e(Kv,_8),e(Xs,b8),e(xo,v8),w(ni,xo,null),e(xo,k8),w(si,xo,null),g(s,A1,_),g(s,Ys,_),e(Ys,ri),e(ri,Qv),w(ef,Qv,null),e(Ys,y8),e(Ys,Vv),e(Vv,T8),g(s,N1,_),g(s,pt,_),w(tf,pt,null),e(pt,w8),e(pt,Gv),e(Gv,$8),e(pt,F8),e(pt,of),e(of,x8),e(of,ou),e(ou,B8),e(of,E8),e(pt,M8),e(pt,nf),e(nf,z8),e(nf,sf),e(sf,P8),e(nf,j8),e(pt,q8),e(pt,Jv),e(Jv,C8),e(pt,A8),e(pt,Qo),e(Qo,Xv),e(Xv,rf),e(rf,N8),e(Qo,O8),e(Qo,Yv),e(Yv,af),e(af,I8),e(Qo,L8),e(Qo,Zv),e(Zv,lf),e(lf,D8),e(Qo,S8),e(Qo,ek),e(ek,df),e(df,U8),e(pt,W8),e(pt,Bo),w(cf,Bo,null),e(Bo,H8),e(Bo,Zs),e(Zs,R8),e(Zs,tk),e(tk,K8),e(Zs,Q8),e(Zs,ok),e(ok,V8),e(Zs,G8),e(Bo,J8),w(ai,Bo,null),e(Bo,X8),w(ii,Bo,null),g(s,O1,_),g(s,er,_),e(er,li),e(li,nk),w(pf,nk,null),e(er,Y8),e(er,sk),e(sk,Z8),g(s,I1,_),g(s,ht,_),w(hf,ht,null),e(ht,eA),e(ht,tr),e(tr,tA),e(tr,rk),e(rk,oA),e(tr,nA),e(tr,ak),e(ak,sA),e(tr,rA),e(ht,aA),e(ht,ff),e(ff,iA),e(ff,nu),e(nu,lA),e(ff,dA),e(ht,cA),e(ht,mf),e(mf,pA),e(mf,uf),e(uf,hA),e(mf,fA),e(ht,mA),e(ht,ik),e(ik,uA),e(ht,gA),e(ht,Vo),e(Vo,lk),e(lk,gf),e(gf,_A),e(Vo,bA),e(Vo,dk),e(dk,_f),e(_f,vA),e(Vo,kA),e(Vo,ck),e(ck,bf),e(bf,yA),e(Vo,TA),e(Vo,pk),e(pk,vf),e(vf,wA),e(ht,$A),e(ht,Eo),w(kf,Eo,null),e(Eo,FA),e(Eo,or),e(or,xA),e(or,hk),e(hk,BA),e(or,EA),e(or,fk),e(fk,MA),e(or,zA),e(Eo,PA),w(di,Eo,null),e(Eo,jA),w(ci,Eo,null),L1=!0},p(s,[_]){const yf={};_&2&&(yf.$$scope={dirty:_,ctx:s}),cr.$set(yf);const mk={};_&2&&(mk.$$scope={dirty:_,ctx:s}),fr.$set(mk);const uk={};_&2&&(uk.$$scope={dirty:_,ctx:s}),ur.$set(uk);const gk={};_&2&&(gk.$$scope={dirty:_,ctx:s}),_r.$set(gk);const Tf={};_&2&&(Tf.$$scope={dirty:_,ctx:s}),br.$set(Tf);const _k={};_&2&&(_k.$$scope={dirty:_,ctx:s}),Tr.$set(_k);const bk={};_&2&&(bk.$$scope={dirty:_,ctx:s}),wr.$set(bk);const vk={};_&2&&(vk.$$scope={dirty:_,ctx:s}),Fr.$set(vk);const wf={};_&2&&(wf.$$scope={dirty:_,ctx:s}),xr.$set(wf);const kk={};_&2&&(kk.$$scope={dirty:_,ctx:s}),Er.$set(kk);const yk={};_&2&&(yk.$$scope={dirty:_,ctx:s}),Mr.$set(yk);const Tk={};_&2&&(Tk.$$scope={dirty:_,ctx:s}),Pr.$set(Tk);const wk={};_&2&&(wk.$$scope={dirty:_,ctx:s}),jr.$set(wk);const $k={};_&2&&($k.$$scope={dirty:_,ctx:s}),qr.$set($k);const Fk={};_&2&&(Fk.$$scope={dirty:_,ctx:s}),Ar.$set(Fk);const xk={};_&2&&(xk.$$scope={dirty:_,ctx:s}),Nr.$set(xk);const $f={};_&2&&($f.$$scope={dirty:_,ctx:s}),Ir.$set($f);const Bk={};_&2&&(Bk.$$scope={dirty:_,ctx:s}),Lr.$set(Bk);const Ek={};_&2&&(Ek.$$scope={dirty:_,ctx:s}),Dr.$set(Ek);const nr={};_&2&&(nr.$$scope={dirty:_,ctx:s}),Sr.$set(nr);const Mk={};_&2&&(Mk.$$scope={dirty:_,ctx:s}),Ur.$set(Mk);const zk={};_&2&&(zk.$$scope={dirty:_,ctx:s}),Hr.$set(zk);const Ff={};_&2&&(Ff.$$scope={dirty:_,ctx:s}),Rr.$set(Ff);const Pk={};_&2&&(Pk.$$scope={dirty:_,ctx:s}),Qr.$set(Pk);const jk={};_&2&&(jk.$$scope={dirty:_,ctx:s}),Vr.$set(jk);const qk={};_&2&&(qk.$$scope={dirty:_,ctx:s}),Gr.$set(qk);const Ck={};_&2&&(Ck.$$scope={dirty:_,ctx:s}),Xr.$set(Ck);const wt={};_&2&&(wt.$$scope={dirty:_,ctx:s}),Yr.$set(wt);const xf={};_&2&&(xf.$$scope={dirty:_,ctx:s}),Zr.$set(xf);const Ak={};_&2&&(Ak.$$scope={dirty:_,ctx:s}),ta.$set(Ak);const Bf={};_&2&&(Bf.$$scope={dirty:_,ctx:s}),oa.$set(Bf);const Nk={};_&2&&(Nk.$$scope={dirty:_,ctx:s}),na.$set(Nk);const Ef={};_&2&&(Ef.$$scope={dirty:_,ctx:s}),ra.$set(Ef);const Ok={};_&2&&(Ok.$$scope={dirty:_,ctx:s}),aa.$set(Ok);const Mf={};_&2&&(Mf.$$scope={dirty:_,ctx:s}),ia.$set(Mf);const Ik={};_&2&&(Ik.$$scope={dirty:_,ctx:s}),da.$set(Ik);const fn={};_&2&&(fn.$$scope={dirty:_,ctx:s}),pa.$set(fn);const Lk={};_&2&&(Lk.$$scope={dirty:_,ctx:s}),ha.$set(Lk);const Dk={};_&2&&(Dk.$$scope={dirty:_,ctx:s}),fa.$set(Dk);const Sk={};_&2&&(Sk.$$scope={dirty:_,ctx:s}),ma.$set(Sk);const mn={};_&2&&(mn.$$scope={dirty:_,ctx:s}),ga.$set(mn);const Uk={};_&2&&(Uk.$$scope={dirty:_,ctx:s}),_a.$set(Uk);const Wk={};_&2&&(Wk.$$scope={dirty:_,ctx:s}),ba.$set(Wk);const Hk={};_&2&&(Hk.$$scope={dirty:_,ctx:s}),ka.$set(Hk);const un={};_&2&&(un.$$scope={dirty:_,ctx:s}),ya.$set(un);const Rk={};_&2&&(Rk.$$scope={dirty:_,ctx:s}),Ta.$set(Rk);const Kk={};_&2&&(Kk.$$scope={dirty:_,ctx:s}),wa.$set(Kk);const Qk={};_&2&&(Qk.$$scope={dirty:_,ctx:s}),Fa.$set(Qk);const Ot={};_&2&&(Ot.$$scope={dirty:_,ctx:s}),xa.$set(Ot);const zf={};_&2&&(zf.$$scope={dirty:_,ctx:s}),Ba.$set(zf);const Vk={};_&2&&(Vk.$$scope={dirty:_,ctx:s}),Ma.$set(Vk);const sr={};_&2&&(sr.$$scope={dirty:_,ctx:s}),za.$set(sr);const Gk={};_&2&&(Gk.$$scope={dirty:_,ctx:s}),Pa.$set(Gk);const Jk={};_&2&&(Jk.$$scope={dirty:_,ctx:s}),ja.$set(Jk);const gn={};_&2&&(gn.$$scope={dirty:_,ctx:s}),Ca.$set(gn);const Xk={};_&2&&(Xk.$$scope={dirty:_,ctx:s}),Aa.$set(Xk);const Yk={};_&2&&(Yk.$$scope={dirty:_,ctx:s}),Na.$set(Yk);const Zk={};_&2&&(Zk.$$scope={dirty:_,ctx:s}),Oa.$set(Zk);const _n={};_&2&&(_n.$$scope={dirty:_,ctx:s}),La.$set(_n);const ey={};_&2&&(ey.$$scope={dirty:_,ctx:s}),Da.$set(ey);const ty={};_&2&&(ty.$$scope={dirty:_,ctx:s}),Ua.$set(ty);const oy={};_&2&&(oy.$$scope={dirty:_,ctx:s}),Wa.$set(oy);const pi={};_&2&&(pi.$$scope={dirty:_,ctx:s}),Ra.$set(pi);const ny={};_&2&&(ny.$$scope={dirty:_,ctx:s}),Ka.$set(ny);const sy={};_&2&&(sy.$$scope={dirty:_,ctx:s}),Va.$set(sy);const su={};_&2&&(su.$$scope={dirty:_,ctx:s}),Ga.$set(su);const ry={};_&2&&(ry.$$scope={dirty:_,ctx:s}),Xa.$set(ry);const Go={};_&2&&(Go.$$scope={dirty:_,ctx:s}),Ya.$set(Go);const bn={};_&2&&(bn.$$scope={dirty:_,ctx:s}),ei.$set(bn);const ay={};_&2&&(ay.$$scope={dirty:_,ctx:s}),ti.$set(ay);const iy={};_&2&&(iy.$$scope={dirty:_,ctx:s}),ni.$set(iy);const ly={};_&2&&(ly.$$scope={dirty:_,ctx:s}),si.$set(ly);const vn={};_&2&&(vn.$$scope={dirty:_,ctx:s}),ai.$set(vn);const dy={};_&2&&(dy.$$scope={dirty:_,ctx:s}),ii.$set(dy);const cy={};_&2&&(cy.$$scope={dirty:_,ctx:s}),di.$set(cy);const py={};_&2&&(py.$$scope={dirty:_,ctx:s}),ci.$set(py)},i(s){L1||($(l.$$.fragment,s),$(E.$$.fragment,s),$(ue.$$.fragment,s),$(Ue.$$.fragment,s),$(Zi.$$.fragment,s),$(cl.$$.fragment,s),$(bl.$$.fragment,s),$(Jl.$$.fragment,s),$(Xl.$$.fragment,s),$(cr.$$.fragment,s),$(Zl.$$.fragment,s),$(ed.$$.fragment,s),$(od.$$.fragment,s),$(sd.$$.fragment,s),$(ad.$$.fragment,s),$(fr.$$.fragment,s),$(id.$$.fragment,s),$(ld.$$.fragment,s),$(dd.$$.fragment,s),$(hd.$$.fragment,s),$(md.$$.fragment,s),$(ur.$$.fragment,s),$(ud.$$.fragment,s),$(gd.$$.fragment,s),$(bd.$$.fragment,s),$(_r.$$.fragment,s),$(kd.$$.fragment,s),$(br.$$.fragment,s),$(yd.$$.fragment,s),$(Td.$$.fragment,s),$($d.$$.fragment,s),$(xd.$$.fragment,s),$(Ed.$$.fragment,s),$(Md.$$.fragment,s),$(zd.$$.fragment,s),$(Nd.$$.fragment,s),$(Tr.$$.fragment,s),$(wr.$$.fragment,s),$(Od.$$.fragment,s),$(Id.$$.fragment,s),$(Ud.$$.fragment,s),$(Fr.$$.fragment,s),$(xr.$$.fragment,s),$(Wd.$$.fragment,s),$(Hd.$$.fragment,s),$(Gd.$$.fragment,s),$(Er.$$.fragment,s),$(Mr.$$.fragment,s),$(Jd.$$.fragment,s),$(Xd.$$.fragment,s),$(oc.$$.fragment,s),$(Pr.$$.fragment,s),$(jr.$$.fragment,s),$(qr.$$.fragment,s),$(nc.$$.fragment,s),$(sc.$$.fragment,s),$(dc.$$.fragment,s),$(Ar.$$.fragment,s),$(Nr.$$.fragment,s),$(cc.$$.fragment,s),$(pc.$$.fragment,s),$(uc.$$.fragment,s),$(Ir.$$.fragment,s),$(Lr.$$.fragment,s),$(Dr.$$.fragment,s),$(Sr.$$.fragment,s),$(Ur.$$.fragment,s),$(gc.$$.fragment,s),$(_c.$$.fragment,s),$(yc.$$.fragment,s),$(Hr.$$.fragment,s),$(Rr.$$.fragment,s),$(Tc.$$.fragment,s),$(wc.$$.fragment,s),$(Bc.$$.fragment,s),$(Qr.$$.fragment,s),$(Vr.$$.fragment,s),$(Gr.$$.fragment,s),$(Ec.$$.fragment,s),$(Mc.$$.fragment,s),$(qc.$$.fragment,s),$(Xr.$$.fragment,s),$(Yr.$$.fragment,s),$(Zr.$$.fragment,s),$(Cc.$$.fragment,s),$(Ac.$$.fragment,s),$(ta.$$.fragment,s),$(Lc.$$.fragment,s),$(oa.$$.fragment,s),$(na.$$.fragment,s),$(Dc.$$.fragment,s),$(Sc.$$.fragment,s),$(ra.$$.fragment,s),$(Rc.$$.fragment,s),$(aa.$$.fragment,s),$(ia.$$.fragment,s),$(Kc.$$.fragment,s),$(Qc.$$.fragment,s),$(Vc.$$.fragment,s),$(da.$$.fragment,s),$(Yc.$$.fragment,s),$(Zc.$$.fragment,s),$(pa.$$.fragment,s),$(sp.$$.fragment,s),$(ha.$$.fragment,s),$(fa.$$.fragment,s),$(ma.$$.fragment,s),$(rp.$$.fragment,s),$(ap.$$.fragment,s),$(ga.$$.fragment,s),$(pp.$$.fragment,s),$(_a.$$.fragment,s),$(ba.$$.fragment,s),$(hp.$$.fragment,s),$(fp.$$.fragment,s),$(ka.$$.fragment,s),$(_p.$$.fragment,s),$(ya.$$.fragment,s),$(Ta.$$.fragment,s),$(wa.$$.fragment,s),$(bp.$$.fragment,s),$(vp.$$.fragment,s),$(Fa.$$.fragment,s),$(wp.$$.fragment,s),$(xa.$$.fragment,s),$(Ba.$$.fragment,s),$($p.$$.fragment,s),$(Fp.$$.fragment,s),$(Ma.$$.fragment,s),$(Mp.$$.fragment,s),$(za.$$.fragment,s),$(Pa.$$.fragment,s),$(ja.$$.fragment,s),$(zp.$$.fragment,s),$(Pp.$$.fragment,s),$(Ca.$$.fragment,s),$(Ap.$$.fragment,s),$(Aa.$$.fragment,s),$(Na.$$.fragment,s),$(Oa.$$.fragment,s),$(Np.$$.fragment,s),$(Op.$$.fragment,s),$(Rp.$$.fragment,s),$(La.$$.fragment,s),$(Da.$$.fragment,s),$(Kp.$$.fragment,s),$(Qp.$$.fragment,s),$(th.$$.fragment,s),$(Ua.$$.fragment,s),$(Wa.$$.fragment,s),$(oh.$$.fragment,s),$(nh.$$.fragment,s),$(ph.$$.fragment,s),$(Ra.$$.fragment,s),$(Ka.$$.fragment,s),$(hh.$$.fragment,s),$(fh.$$.fragment,s),$(Th.$$.fragment,s),$(Va.$$.fragment,s),$(Ga.$$.fragment,s),$(wh.$$.fragment,s),$($h.$$.fragment,s),$(qh.$$.fragment,s),$(Xa.$$.fragment,s),$(Ya.$$.fragment,s),$(Ch.$$.fragment,s),$(Ah.$$.fragment,s),$(Wh.$$.fragment,s),$(ei.$$.fragment,s),$(ti.$$.fragment,s),$(Hh.$$.fragment,s),$(Rh.$$.fragment,s),$(Zh.$$.fragment,s),$(ni.$$.fragment,s),$(si.$$.fragment,s),$(ef.$$.fragment,s),$(tf.$$.fragment,s),$(cf.$$.fragment,s),$(ai.$$.fragment,s),$(ii.$$.fragment,s),$(pf.$$.fragment,s),$(hf.$$.fragment,s),$(kf.$$.fragment,s),$(di.$$.fragment,s),$(ci.$$.fragment,s),L1=!0)},o(s){F(l.$$.fragment,s),F(E.$$.fragment,s),F(ue.$$.fragment,s),F(Ue.$$.fragment,s),F(Zi.$$.fragment,s),F(cl.$$.fragment,s),F(bl.$$.fragment,s),F(Jl.$$.fragment,s),F(Xl.$$.fragment,s),F(cr.$$.fragment,s),F(Zl.$$.fragment,s),F(ed.$$.fragment,s),F(od.$$.fragment,s),F(sd.$$.fragment,s),F(ad.$$.fragment,s),F(fr.$$.fragment,s),F(id.$$.fragment,s),F(ld.$$.fragment,s),F(dd.$$.fragment,s),F(hd.$$.fragment,s),F(md.$$.fragment,s),F(ur.$$.fragment,s),F(ud.$$.fragment,s),F(gd.$$.fragment,s),F(bd.$$.fragment,s),F(_r.$$.fragment,s),F(kd.$$.fragment,s),F(br.$$.fragment,s),F(yd.$$.fragment,s),F(Td.$$.fragment,s),F($d.$$.fragment,s),F(xd.$$.fragment,s),F(Ed.$$.fragment,s),F(Md.$$.fragment,s),F(zd.$$.fragment,s),F(Nd.$$.fragment,s),F(Tr.$$.fragment,s),F(wr.$$.fragment,s),F(Od.$$.fragment,s),F(Id.$$.fragment,s),F(Ud.$$.fragment,s),F(Fr.$$.fragment,s),F(xr.$$.fragment,s),F(Wd.$$.fragment,s),F(Hd.$$.fragment,s),F(Gd.$$.fragment,s),F(Er.$$.fragment,s),F(Mr.$$.fragment,s),F(Jd.$$.fragment,s),F(Xd.$$.fragment,s),F(oc.$$.fragment,s),F(Pr.$$.fragment,s),F(jr.$$.fragment,s),F(qr.$$.fragment,s),F(nc.$$.fragment,s),F(sc.$$.fragment,s),F(dc.$$.fragment,s),F(Ar.$$.fragment,s),F(Nr.$$.fragment,s),F(cc.$$.fragment,s),F(pc.$$.fragment,s),F(uc.$$.fragment,s),F(Ir.$$.fragment,s),F(Lr.$$.fragment,s),F(Dr.$$.fragment,s),F(Sr.$$.fragment,s),F(Ur.$$.fragment,s),F(gc.$$.fragment,s),F(_c.$$.fragment,s),F(yc.$$.fragment,s),F(Hr.$$.fragment,s),F(Rr.$$.fragment,s),F(Tc.$$.fragment,s),F(wc.$$.fragment,s),F(Bc.$$.fragment,s),F(Qr.$$.fragment,s),F(Vr.$$.fragment,s),F(Gr.$$.fragment,s),F(Ec.$$.fragment,s),F(Mc.$$.fragment,s),F(qc.$$.fragment,s),F(Xr.$$.fragment,s),F(Yr.$$.fragment,s),F(Zr.$$.fragment,s),F(Cc.$$.fragment,s),F(Ac.$$.fragment,s),F(ta.$$.fragment,s),F(Lc.$$.fragment,s),F(oa.$$.fragment,s),F(na.$$.fragment,s),F(Dc.$$.fragment,s),F(Sc.$$.fragment,s),F(ra.$$.fragment,s),F(Rc.$$.fragment,s),F(aa.$$.fragment,s),F(ia.$$.fragment,s),F(Kc.$$.fragment,s),F(Qc.$$.fragment,s),F(Vc.$$.fragment,s),F(da.$$.fragment,s),F(Yc.$$.fragment,s),F(Zc.$$.fragment,s),F(pa.$$.fragment,s),F(sp.$$.fragment,s),F(ha.$$.fragment,s),F(fa.$$.fragment,s),F(ma.$$.fragment,s),F(rp.$$.fragment,s),F(ap.$$.fragment,s),F(ga.$$.fragment,s),F(pp.$$.fragment,s),F(_a.$$.fragment,s),F(ba.$$.fragment,s),F(hp.$$.fragment,s),F(fp.$$.fragment,s),F(ka.$$.fragment,s),F(_p.$$.fragment,s),F(ya.$$.fragment,s),F(Ta.$$.fragment,s),F(wa.$$.fragment,s),F(bp.$$.fragment,s),F(vp.$$.fragment,s),F(Fa.$$.fragment,s),F(wp.$$.fragment,s),F(xa.$$.fragment,s),F(Ba.$$.fragment,s),F($p.$$.fragment,s),F(Fp.$$.fragment,s),F(Ma.$$.fragment,s),F(Mp.$$.fragment,s),F(za.$$.fragment,s),F(Pa.$$.fragment,s),F(ja.$$.fragment,s),F(zp.$$.fragment,s),F(Pp.$$.fragment,s),F(Ca.$$.fragment,s),F(Ap.$$.fragment,s),F(Aa.$$.fragment,s),F(Na.$$.fragment,s),F(Oa.$$.fragment,s),F(Np.$$.fragment,s),F(Op.$$.fragment,s),F(Rp.$$.fragment,s),F(La.$$.fragment,s),F(Da.$$.fragment,s),F(Kp.$$.fragment,s),F(Qp.$$.fragment,s),F(th.$$.fragment,s),F(Ua.$$.fragment,s),F(Wa.$$.fragment,s),F(oh.$$.fragment,s),F(nh.$$.fragment,s),F(ph.$$.fragment,s),F(Ra.$$.fragment,s),F(Ka.$$.fragment,s),F(hh.$$.fragment,s),F(fh.$$.fragment,s),F(Th.$$.fragment,s),F(Va.$$.fragment,s),F(Ga.$$.fragment,s),F(wh.$$.fragment,s),F($h.$$.fragment,s),F(qh.$$.fragment,s),F(Xa.$$.fragment,s),F(Ya.$$.fragment,s),F(Ch.$$.fragment,s),F(Ah.$$.fragment,s),F(Wh.$$.fragment,s),F(ei.$$.fragment,s),F(ti.$$.fragment,s),F(Hh.$$.fragment,s),F(Rh.$$.fragment,s),F(Zh.$$.fragment,s),F(ni.$$.fragment,s),F(si.$$.fragment,s),F(ef.$$.fragment,s),F(tf.$$.fragment,s),F(cf.$$.fragment,s),F(ai.$$.fragment,s),F(ii.$$.fragment,s),F(pf.$$.fragment,s),F(hf.$$.fragment,s),F(kf.$$.fragment,s),F(di.$$.fragment,s),F(ci.$$.fragment,s),L1=!1},d(s){t(d),s&&t(b),s&&t(m),x(l),s&&t(ke),s&&t(S),x(E),s&&t(ye),s&&t(U),s&&t(Te),s&&t(R),s&&t(we),s&&t(K),s&&t(te),s&&t(j),s&&t(G),s&&t(ge),s&&t(J),s&&t(he),s&&t($e),s&&t(D),s&&t(C),s&&t(ce),x(ue),s&&t(oe),s&&t(Ke),s&&t(P),x(Ue,s),s&&t(Qe),s&&t(re),s&&t(fy),x(Zi,s),s&&t(my),s&&t($t),s&&t(uy),x(cl,s),s&&t(gy),s&&t(ao),s&&t(_y),x(bl,s),s&&t(by),s&&t(io),s&&t(vy),s&&t(Xf),s&&t(ky),s&&t(ir),s&&t(yy),s&&t(Ml),s&&t(Ty),s&&t(lr),s&&t(wy),s&&t(Cl),s&&t($y),s&&t(em),s&&t(Fy),s&&t(Ol),s&&t(xy),s&&t(Ft),s&&t(By),s&&t(Ln),x(Jl),s&&t(Ey),s&&t(ro),x(Xl),x(cr),s&&t(My),s&&t(Sn),x(Zl),s&&t(zy),s&&t(tt),x(ed),x(od),x(sd),x(ad),x(fr),x(id),s&&t(Py),s&&t(Wn),x(ld),s&&t(jy),s&&t(Bt),x(dd),x(hd),x(md),x(ur),s&&t(qy),s&&t(Rn),x(ud),s&&t(Cy),s&&t(Et),x(gd),x(bd),x(_r),x(kd),x(br),s&&t(Ay),s&&t(Vn),x(yd),s&&t(Ny),s&&t(Gn),x(Td),s&&t(Oy),s&&t(Jn),x($d),s&&t(Iy),s&&t(Lo),x(xd),x(Ed),s&&t(Ly),s&&t(Xn),x(Md),s&&t(Dy),s&&t(ot),x(zd),x(Nd),x(Tr),x(wr),s&&t(Sy),s&&t(Zn),x(Od),s&&t(Uy),s&&t(Mt),x(Id),x(Ud),x(Fr),x(xr),s&&t(Wy),s&&t(os),x(Wd),s&&t(Hy),s&&t(zt),x(Hd),x(Gd),x(Er),x(Mr),s&&t(Ry),s&&t(ss),x(Jd),s&&t(Ky),s&&t(Pt),x(Xd),x(oc),x(Pr),x(jr),x(qr),s&&t(Qy),s&&t(as),x(nc),s&&t(Vy),s&&t(jt),x(sc),x(dc),x(Ar),x(Nr),s&&t(Gy),s&&t(ls),x(cc),s&&t(Jy),s&&t(qt),x(pc),x(uc),x(Ir),x(Lr),x(Dr),x(Sr),x(Ur),s&&t(Xy),s&&t(cs),x(gc),s&&t(Yy),s&&t(Ct),x(_c),x(yc),x(Hr),x(Rr),s&&t(Zy),s&&t(hs),x(Tc),s&&t(e1),s&&t(At),x(wc),x(Bc),x(Qr),x(Vr),x(Gr),s&&t(t1),s&&t(ms),x(Ec),s&&t(o1),s&&t(Nt),x(Mc),x(qc),x(Xr),x(Yr),x(Zr),s&&t(n1),s&&t(_s),x(Cc),s&&t(s1),s&&t(ut),x(Ac),x(ta),x(Lc),x(oa),x(na),s&&t(r1),s&&t(vs),x(Dc),s&&t(a1),s&&t(gt),x(Sc),x(ra),x(Rc),x(aa),x(ia),s&&t(i1),s&&t(Ts),x(Kc),s&&t(l1),s&&t(ws),x(Qc),x(Vc),x(da),s&&t(d1),s&&t($s),x(Yc),s&&t(c1),s&&t(_t),x(Zc),x(pa),x(sp),x(ha),x(fa),x(ma),s&&t(p1),s&&t(xs),x(rp),s&&t(h1),s&&t(bt),x(ap),x(ga),x(pp),x(_a),x(ba),s&&t(f1),s&&t(Es),x(hp),s&&t(m1),s&&t(vt),x(fp),x(ka),x(_p),x(ya),x(Ta),x(wa),s&&t(u1),s&&t(zs),x(bp),s&&t(g1),s&&t(kt),x(vp),x(Fa),x(wp),x(xa),x(Ba),s&&t(_1),s&&t(js),x($p),s&&t(b1),s&&t(yt),x(Fp),x(Ma),x(Mp),x(za),x(Pa),x(ja),s&&t(v1),s&&t(Cs),x(zp),s&&t(k1),s&&t(Tt),x(Pp),x(Ca),x(Ap),x(Aa),x(Na),x(Oa),s&&t(y1),s&&t(Os),x(Np),s&&t(T1),s&&t(st),x(Op),x(Rp),x(La),x(Da),s&&t(w1),s&&t(Ls),x(Kp),s&&t($1),s&&t(rt),x(Qp),x(th),x(Ua),x(Wa),s&&t(F1),s&&t(Us),x(oh),s&&t(x1),s&&t(at),x(nh),x(ph),x(Ra),x(Ka),s&&t(B1),s&&t(Hs),x(hh),s&&t(E1),s&&t(it),x(fh),x(Th),x(Va),x(Ga),s&&t(M1),s&&t(Ks),x(wh),s&&t(z1),s&&t(lt),x($h),x(qh),x(Xa),x(Ya),s&&t(P1),s&&t(Vs),x(Ch),s&&t(j1),s&&t(dt),x(Ah),x(Wh),x(ei),x(ti),s&&t(q1),s&&t(Js),x(Hh),s&&t(C1),s&&t(ct),x(Rh),x(Zh),x(ni),x(si),s&&t(A1),s&&t(Ys),x(ef),s&&t(N1),s&&t(pt),x(tf),x(cf),x(ai),x(ii),s&&t(O1),s&&t(er),x(pf),s&&t(I1),s&&t(ht),x(hf),x(kf),x(di),x(ci)}}}const eH={local:"bert",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.BertConfig",title:"BertConfig"},{local:"transformers.BertTokenizer",title:"BertTokenizer"},{local:"transformers.BertTokenizerFast",title:"BertTokenizerFast"},{local:"transformers.TFBertTokenizer",title:"TFBertTokenizer"},{local:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput",title:"Bert specific outputs"},{local:"transformers.BertModel",title:"BertModel"},{local:"transformers.BertForPreTraining",title:"BertForPreTraining"},{local:"transformers.BertLMHeadModel",title:"BertLMHeadModel"},{local:"transformers.BertForMaskedLM",title:"BertForMaskedLM"},{local:"transformers.BertForNextSentencePrediction",title:"BertForNextSentencePrediction"},{local:"transformers.BertForSequenceClassification",title:"BertForSequenceClassification"},{local:"transformers.BertForMultipleChoice",title:"BertForMultipleChoice"},{local:"transformers.BertForTokenClassification",title:"BertForTokenClassification"},{local:"transformers.BertForQuestionAnswering",title:"BertForQuestionAnswering"},{local:"transformers.TFBertModel",title:"TFBertModel"},{local:"transformers.TFBertForPreTraining",title:"TFBertForPreTraining"},{local:"transformers.TFBertLMHeadModel",title:"TFBertModelLMHeadModel"},{local:"transformers.TFBertForMaskedLM",title:"TFBertForMaskedLM"},{local:"transformers.TFBertForNextSentencePrediction",title:"TFBertForNextSentencePrediction"},{local:"transformers.TFBertForSequenceClassification",title:"TFBertForSequenceClassification"},{local:"transformers.TFBertForMultipleChoice",title:"TFBertForMultipleChoice"},{local:"transformers.TFBertForTokenClassification",title:"TFBertForTokenClassification"},{local:"transformers.TFBertForQuestionAnswering",title:"TFBertForQuestionAnswering"},{local:"transformers.FlaxBertModel",title:"FlaxBertModel"},{local:"transformers.FlaxBertForPreTraining",title:"FlaxBertForPreTraining"},{local:"transformers.FlaxBertForCausalLM",title:"FlaxBertForCausalLM"},{local:"transformers.FlaxBertForMaskedLM",title:"FlaxBertForMaskedLM"},{local:"transformers.FlaxBertForNextSentencePrediction",title:"FlaxBertForNextSentencePrediction"},{local:"transformers.FlaxBertForSequenceClassification",title:"FlaxBertForSequenceClassification"},{local:"transformers.FlaxBertForMultipleChoice",title:"FlaxBertForMultipleChoice"},{local:"transformers.FlaxBertForTokenClassification",title:"FlaxBertForTokenClassification"},{local:"transformers.FlaxBertForQuestionAnswering",title:"FlaxBertForQuestionAnswering"}],title:"BERT"};function tH(B){return zU(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class dH extends xU{constructor(d){super();BU(this,d,tH,ZW,EU,{})}}export{dH as default,eH as metadata};
