import{S as AW,i as NW,s as IW,e as s,k as c,w as y,t as o,M as OW,c as r,d as t,m as p,a,x as T,h as n,b as h,N as CW,G as e,g,y as w,q as $,o as F,B as x,v as LW,L as ye}from"../../chunks/vendor-hf-doc-builder.js";import{T as De}from"../../chunks/Tip-hf-doc-builder.js";import{D as N}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Te}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Oe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ke}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as T2}from"../../chunks/PipelineTag-hf-doc-builder.js";function DW(E){let d,v,u,m,b;return m=new Te({props:{code:`from transformers import BertConfig, BertModel

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

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

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

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

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

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

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

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

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

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

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

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

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

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

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

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs, labels=inputs["input_ids"])
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertLMHeadModel

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

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

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

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

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

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

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

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

outputs = model(**inputs, labels=labels)
round(outputs.loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

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

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

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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_sentence = <span class="hljs-string">&quot;The sky is blue due to the shorter wavelength of blue light.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(prompt, next_sentence, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

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

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

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

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

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = BertForSequenceClassification.from_pretrained("textattack/bert-base-uncased-yelp-polarity", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertForSequenceClassification

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
<span class="hljs-string">&#x27;LABEL_1&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;textattack/bert-base-uncased-yelp-polarity&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.01</span>`}}),{c(){d=s("p"),v=o("Example of single-label classification:"),u=c(),y(m.$$.fragment)},l(l){d=r(l,"P",{});var f=a(d);v=n(f,"Example of single-label classification:"),f.forEach(t),u=p(l),T(m.$$.fragment,l)},m(l,f){g(l,d,f),e(d,v),g(l,u,f),w(m,l,f),b=!0},p:ye,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){F(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),x(m,l)}}}function nH(E){let d,v,u,m,b;return m=new Te({props:{code:`import torch
from transformers import AutoTokenizer, BertForSequenceClassification

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

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

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

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

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = BertForSequenceClassification.from_pretrained(
    "textattack/bert-base-uncased-yelp-polarity", num_labels=num_labels, problem_type="multi_label_classification"
)

labels = torch.sum(
    torch.nn.functional.one_hot(predicted_class_ids[None, :].clone(), num_classes=num_labels), dim=1
).to(torch.float)
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;textattack/bert-base-uncased-yelp-polarity&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;textattack/bert-base-uncased-yelp-polarity&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;textattack/bert-base-uncased-yelp-polarity&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=s("p"),v=o("Example of multi-label classification:"),u=c(),y(m.$$.fragment)},l(l){d=r(l,"P",{});var f=a(d);v=n(f,"Example of multi-label classification:"),f.forEach(t),u=p(l),T(m.$$.fragment,l)},m(l,f){g(l,d,f),e(d,v),g(l,u,f),w(m,l,f),b=!0},p:ye,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){F(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),x(m,l)}}}function sH(E){let d,v,u,m,b;return{c(){d=s("p"),v=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),m=o("Module"),b=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var f=a(d);v=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(f,"CODE",{});var M=a(u);m=n(M,"Module"),M.forEach(t),b=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,v),e(d,u),e(u,m),e(d,b)},d(l){l&&t(d)}}}function rH(E){let d,v,u,m,b;return m=new Te({props:{code:`from transformers import AutoTokenizer, BertForMultipleChoice
import torch

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

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

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

# the linear classifier still needs to be trained
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(<span class="hljs-number">0</span>).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># choice0 is correct (according to Wikipedia ;)), batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**{k: v.unsqueeze(<span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}, labels=labels)  <span class="hljs-comment"># batch size is 1</span>

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

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

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

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

predicted_token_class_ids = logits.argmax(-1)

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

labels = predicted_token_class_ids
loss = model(**inputs, labels=labels).loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;dbmdz/bert-large-cased-finetuned-conll03-english&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;dbmdz/bert-large-cased-finetuned-conll03-english&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = logits.argmax(-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t.item()] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>]]
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes
[<span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;I-LOC&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;I-LOC&#x27;</span>, <span class="hljs-string">&#x27;I-LOC&#x27;</span>] 

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

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

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

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

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

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
tokenizer.decode(predict_answer_tokens, skip_special_tokens=True)

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

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = outputs.start_logits.argmax()
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = outputs.end_logits.argmax()

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predict_answer_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-string">&#x27;a nice puppet&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

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

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

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

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFBertModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)

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

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

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

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

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

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

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
outputs = model(inputs)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFBertLMHeadModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_sentence = <span class="hljs-string">&quot;The sky is blue due to the shorter wavelength of blue light.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(prompt, next_sentence, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

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

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

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

logits = model(**inputs).logits

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

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

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

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

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
choice0 = "It is eaten with a fork and a knife."
choice1 = "It is eaten while held in the hand."

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

# the linear classifier still needs to be trained
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFBertForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;tf&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = {k: tf.expand_dims(v, <span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)  <span class="hljs-comment"># batch size is 1</span>

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

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

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

logits = model(**inputs).logits
predicted_token_class_ids = tf.math.argmax(logits, axis=-1)

# Note that tokens are classified rather then input words which means that
# there might be more predicted token classes than words.
# Multiple token classes might account for the same word
predicted_tokens_classes = [model.config.id2label[t] for t in predicted_token_class_ids[0].numpy().tolist()]
predicted_tokens_classes`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFBertForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predict_answer_tokens)
<span class="hljs-string">&#x27;a nice puppet&#x27;</span>`}}),{c(){d=s("p"),v=o("Example:"),u=c(),y(m.$$.fragment)},l(l){d=r(l,"P",{});var f=a(d);v=n(f,"Example:"),f.forEach(t),u=p(l),T(m.$$.fragment,l)},m(l,f){g(l,d,f),e(d,v),g(l,u,f),w(m,l,f),b=!0},p:ye,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){F(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),x(m,l)}}}function OH(E){let d,v;return d=new Te({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(u){T(d.$$.fragment,u)},m(u,m){w(d,u,m),v=!0},p:ye,i(u){v||($(d.$$.fragment,u),v=!0)},o(u){F(d.$$.fragment,u),v=!1},d(u){x(d,u)}}}function LH(E){let d,v,u,m,b;return{c(){d=s("p"),v=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),m=o("Module"),b=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var f=a(d);v=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(f,"CODE",{});var M=a(u);m=n(M,"Module"),M.forEach(t),b=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,v),e(d,u),e(u,m),e(d,b)},d(l){l&&t(d)}}}function DH(E){let d,v,u,m,b;return m=new Te({props:{code:`from transformers import AutoTokenizer, FlaxBertModel

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;jax&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

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

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

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

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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_sentence = <span class="hljs-string">&quot;The sky is blue due to the shorter wavelength of blue light.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(prompt, next_sentence, return_tensors=<span class="hljs-string">&quot;jax&quot;</span>)

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;jax&quot;</span>)

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

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

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
choice0 = "It is eaten with a fork and a knife."
choice1 = "It is eaten while held in the hand."

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;jax&quot;</span>)

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;jax&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>start_scores = outputs.start_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>end_scores = outputs.end_logits`}}),{c(){d=s("p"),v=o("Example:"),u=c(),y(m.$$.fragment)},l(l){d=r(l,"P",{});var f=a(d);v=n(f,"Example:"),f.forEach(t),u=p(l),T(m.$$.fragment,l)},m(l,f){g(l,d,f),e(d,v),g(l,u,f),w(m,l,f),b=!0},p:ye,i(l){b||($(m.$$.fragment,l),b=!0)},o(l){F(m.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),x(m,l)}}}function nR(E){let d,v,u,m,b,l,f,M,Me,we,S,he,ee,B,ze,W,fe,Le,V,ie,le,H,de,Pe,R,je,$e,U,qe,ce,re,j,A,ue,G,Fe,me,K,Ce,xe,q,_e,J,Ee,ge,X,Be,se,O,be,Y,Ae,te,C,Ne,I,pe,ve,k,z,Se,oe,Re,Ke,P,Qe,Ve,We,Ge,Je,L,Q,Xe,He,D,Ye,Ue,Ie,Ze,Z,et,w2,jy,Nn,rr,ag,Di,$2,ig,F2,qy,Wf,x2,Cy,Si,Ay,tt,Ui,E2,Wi,B2,M2,z2,Hi,P2,Ri,j2,q2,C2,Ki,A2,Qi,N2,I2,O2,Vi,L2,Gi,D2,S2,U2,Jo,Hf,W2,H2,Ji,R2,K2,Xi,Q2,V2,G2,Xo,Rf,J2,X2,Yi,Y2,Z2,Zi,e0,t0,o0,Yo,Kf,n0,s0,el,r0,a0,tl,i0,l0,d0,lg,Qf,c0,Ny,ol,Iy,mt,nl,p0,sl,h0,f0,u0,In,m0,rl,g0,_0,al,b0,v0,k0,Zo,Vf,y0,T0,il,w0,$0,ll,F0,x0,E0,en,Gf,B0,M0,dl,z0,P0,cl,j0,q0,C0,ar,Jf,A0,N0,pl,I0,O0,L0,Xf,hl,D0,S0,U0,dg,Yf,W0,Oy,fl,Ly,Ot,tn,Zf,H0,R0,ul,K0,Q0,ml,V0,G0,J0,on,eu,X0,Y0,gl,Z0,e$,_l,t$,o$,n$,nn,tu,s$,r$,bl,a$,i$,vl,l$,d$,c$,ou,kl,p$,h$,f$,cg,nu,u$,Dy,yl,Sy,Lt,sn,su,m$,g$,Tl,_$,b$,wl,v$,k$,y$,rn,ru,T$,w$,$l,$$,F$,Fl,x$,E$,B$,ir,au,M$,z$,xl,P$,j$,q$,iu,El,C$,A$,N$,pg,lu,I$,Uy,du,hg,O$,Wy,an,ln,cu,L$,D$,Bl,S$,U$,Ml,W$,H$,R$,dn,pu,K$,Q$,zl,V$,G$,Pl,J$,X$,Y$,fg,hu,Z$,Hy,jl,eF,ug,tF,Ry,lr,ql,oF,Cl,nF,sF,rF,Al,aF,Nl,iF,lF,Ky,Il,dF,mg,cF,Qy,fu,Ol,pF,Ll,hF,fF,Vy,Dl,uF,gg,mF,Gy,xt,Sl,gF,Ul,_F,bF,vF,Wl,kF,Hl,yF,TF,wF,Rl,$F,Kl,FF,xF,EF,Ql,BF,Vl,MF,zF,PF,Gl,jF,Jl,qF,CF,AF,Xl,NF,Yl,IF,OF,Jy,On,dr,_g,Zl,LF,bg,DF,Xy,so,ed,SF,Oo,UF,uu,WF,HF,mu,RF,KF,td,QF,VF,GF,Ln,JF,gu,XF,YF,_u,ZF,ex,tx,cr,Yy,Dn,pr,vg,od,ox,kg,nx,Zy,ot,nd,sx,yg,rx,ax,sd,ix,bu,lx,dx,cx,cn,rd,px,Tg,hx,fx,ad,vu,ux,wg,mx,gx,ku,_x,$g,bx,vx,hr,id,kx,ld,yx,Fg,Tx,wx,$x,ro,dd,Fx,xg,xx,Ex,fr,Bx,Sn,Mx,Eg,zx,Px,Bg,jx,qx,Cx,yu,cd,eT,Un,ur,Mg,pd,Ax,zg,Nx,tT,Bt,hd,Ix,fd,Ox,Pg,Lx,Dx,Sx,ud,Ux,Tu,Wx,Hx,Rx,pn,md,Kx,jg,Qx,Vx,gd,wu,Gx,qg,Jx,Xx,$u,Yx,Cg,Zx,e4,ao,_d,t4,Ag,o4,n4,mr,s4,Wn,r4,Ng,a4,i4,Ig,l4,d4,oT,Hn,gr,Og,bd,c4,Lg,p4,nT,Mt,vd,h4,Rn,f4,Dg,u4,m4,Sg,g4,_4,b4,kd,v4,Ug,k4,y4,T4,hn,yd,w4,Td,$4,Wg,F4,x4,E4,_r,B4,fn,wd,M4,Kn,z4,Hg,P4,j4,Rg,q4,C4,A4,br,sT,Qn,vr,Kg,$d,N4,Qg,I4,rT,Vn,Fd,O4,xd,L4,Fu,D4,S4,aT,Gn,Ed,U4,Bd,W4,xu,H4,R4,iT,Lo,Md,K4,zd,Q4,Eu,V4,G4,J4,kr,Pd,X4,Vg,Y4,lT,Jn,yr,Gg,jd,Z4,Jg,eE,dT,nt,qd,tE,Xg,oE,nE,Cd,sE,Bu,rE,aE,iE,Ad,lE,Nd,dE,cE,pE,Id,hE,Od,fE,uE,mE,gt,gE,Yg,_E,bE,Zg,vE,kE,e_,yE,TE,t_,wE,$E,o_,FE,xE,n_,EE,BE,ME,io,Ld,zE,Xn,PE,Mu,jE,qE,s_,CE,AE,NE,Tr,IE,wr,cT,Yn,$r,r_,Dd,OE,a_,LE,pT,zt,Sd,DE,Zn,SE,i_,UE,WE,l_,HE,RE,KE,Ud,QE,zu,VE,GE,JE,Wd,XE,Hd,YE,ZE,eB,lo,Rd,tB,es,oB,Pu,nB,sB,d_,rB,aB,iB,Fr,lB,xr,hT,ts,Er,c_,Kd,dB,p_,cB,fT,Pt,Qd,pB,Vd,hB,h_,fB,uB,mB,Gd,gB,ju,_B,bB,vB,Jd,kB,Xd,yB,TB,wB,co,Yd,$B,os,FB,qu,xB,EB,f_,BB,MB,zB,Br,PB,Mr,uT,ns,zr,u_,Zd,jB,m_,qB,mT,jt,ec,CB,tc,AB,g_,NB,IB,OB,oc,LB,Cu,DB,SB,UB,nc,WB,sc,HB,RB,KB,po,rc,QB,ss,VB,Au,GB,JB,__,XB,YB,ZB,Pr,eM,jr,gT,rs,qr,b_,ac,tM,v_,oM,_T,qt,ic,nM,lc,sM,k_,rM,aM,iM,dc,lM,Nu,dM,cM,pM,cc,hM,pc,fM,uM,mM,ho,hc,gM,as,_M,Iu,bM,vM,y_,kM,yM,TM,Cr,wM,Ar,bT,is,Nr,T_,fc,$M,w_,FM,vT,Ct,uc,xM,$_,EM,BM,mc,MM,Ou,zM,PM,jM,gc,qM,_c,CM,AM,NM,Dt,bc,IM,ls,OM,Lu,LM,DM,F_,SM,UM,WM,Ir,HM,Or,RM,Lr,kT,ds,Dr,x_,vc,KM,E_,QM,yT,At,kc,VM,B_,GM,JM,yc,XM,Du,YM,ZM,ez,Tc,tz,wc,oz,nz,sz,fo,$c,rz,cs,az,Su,iz,lz,M_,dz,cz,pz,Sr,hz,Ur,TT,ps,Wr,z_,Fc,fz,P_,uz,wT,Nt,xc,mz,j_,gz,_z,Ec,bz,Uu,vz,kz,yz,Bc,Tz,Mc,wz,$z,Fz,uo,zc,xz,hs,Ez,Wu,Bz,Mz,q_,zz,Pz,jz,Hr,qz,Rr,$T,fs,Kr,C_,Pc,Cz,A_,Az,FT,It,jc,Nz,us,Iz,N_,Oz,Lz,I_,Dz,Sz,Uz,qc,Wz,Hu,Hz,Rz,Kz,Cc,Qz,Ac,Vz,Gz,Jz,mo,Nc,Xz,ms,Yz,Ru,Zz,eP,O_,tP,oP,nP,Qr,sP,Vr,xT,gs,Gr,L_,Ic,rP,D_,aP,ET,_t,Oc,iP,S_,lP,dP,Lc,cP,Ku,pP,hP,fP,Dc,uP,Sc,mP,gP,_P,Jr,bP,go,Uc,vP,_s,kP,Qu,yP,TP,U_,wP,$P,FP,Xr,xP,Yr,BT,bs,Zr,W_,Wc,EP,H_,BP,MT,bt,Hc,MP,vs,zP,R_,PP,jP,K_,qP,CP,AP,Rc,NP,Vu,IP,OP,LP,Kc,DP,Qc,SP,UP,WP,ea,HP,_o,Vc,RP,ks,KP,Gu,QP,VP,Q_,GP,JP,XP,ta,YP,oa,zT,ys,na,V_,Gc,ZP,G_,e9,PT,Ts,Jc,t9,St,Xc,o9,st,n9,J_,s9,r9,X_,a9,i9,Y_,l9,d9,Z_,c9,p9,eb,h9,f9,tb,u9,m9,ob,g9,_9,b9,Yc,Zc,v9,nb,k9,y9,T9,ep,w9,sb,$9,F9,x9,ne,E9,rb,B9,M9,ab,z9,P9,ib,j9,q9,lb,C9,A9,db,N9,I9,cb,O9,L9,pb,D9,S9,hb,U9,W9,fb,H9,R9,ub,K9,Q9,mb,V9,G9,gb,J9,X9,_b,Y9,Z9,bb,ej,tj,vb,oj,nj,kb,sj,rj,yb,aj,ij,Tb,lj,dj,wb,cj,pj,$b,hj,fj,uj,sa,jT,ws,ra,Fb,tp,mj,xb,gj,qT,vt,op,_j,np,bj,Eb,vj,kj,yj,sp,Tj,Ju,wj,$j,Fj,rp,xj,ap,Ej,Bj,Mj,aa,zj,Ut,ip,Pj,$s,jj,Xu,qj,Cj,Bb,Aj,Nj,Ij,ia,Oj,la,Lj,da,CT,Fs,ca,Mb,lp,Dj,zb,Sj,AT,kt,dp,Uj,cp,Wj,Pb,Hj,Rj,Kj,pp,Qj,Yu,Vj,Gj,Jj,hp,Xj,fp,Yj,Zj,eq,pa,tq,bo,up,oq,xs,nq,Zu,sq,rq,jb,aq,iq,lq,ha,dq,fa,NT,Es,ua,qb,mp,cq,Cb,pq,IT,yt,gp,hq,Ab,fq,uq,_p,mq,em,gq,_q,bq,bp,vq,vp,kq,yq,Tq,ma,wq,Wt,kp,$q,Bs,Fq,tm,xq,Eq,Nb,Bq,Mq,zq,ga,Pq,_a,jq,ba,OT,Ms,va,Ib,yp,qq,Ob,Cq,LT,Tt,Tp,Aq,Lb,Nq,Iq,wp,Oq,om,Lq,Dq,Sq,$p,Uq,Fp,Wq,Hq,Rq,ka,Kq,vo,xp,Qq,zs,Vq,nm,Gq,Jq,Db,Xq,Yq,Zq,ya,e3,Ta,DT,Ps,wa,Sb,Ep,t3,Ub,o3,ST,wt,Bp,n3,Wb,s3,r3,Mp,a3,sm,i3,l3,d3,zp,c3,Pp,p3,h3,f3,$a,u3,Ht,jp,m3,js,g3,rm,_3,b3,Hb,v3,k3,y3,Fa,T3,xa,w3,Ea,UT,qs,Ba,Rb,qp,$3,Kb,F3,WT,$t,Cp,x3,Cs,E3,Qb,B3,M3,Vb,z3,P3,j3,Ap,q3,am,C3,A3,N3,Np,I3,Ip,O3,L3,D3,Ma,S3,Rt,Op,U3,As,W3,im,H3,R3,Gb,K3,Q3,V3,za,G3,Pa,J3,ja,HT,Ns,qa,Jb,Lp,X3,Xb,Y3,RT,rt,Dp,Z3,Yb,eC,tC,Sp,oC,lm,nC,sC,rC,Up,aC,Wp,iC,lC,dC,Zb,cC,pC,Do,ev,Hp,hC,fC,tv,Rp,uC,mC,ov,Kp,gC,_C,nv,Qp,bC,vC,ko,Vp,kC,Is,yC,sv,TC,wC,rv,$C,FC,xC,Ca,EC,Aa,KT,Os,Na,av,Gp,BC,iv,MC,QT,at,Jp,zC,Ls,PC,lv,jC,qC,dv,CC,AC,NC,Xp,IC,dm,OC,LC,DC,Yp,SC,Zp,UC,WC,HC,cv,RC,KC,So,pv,eh,QC,VC,hv,th,GC,JC,fv,oh,XC,YC,uv,nh,ZC,e6,yo,sh,t6,Ds,o6,mv,n6,s6,gv,r6,a6,i6,Ia,l6,Oa,VT,Ss,La,_v,rh,d6,bv,c6,GT,it,ah,p6,vv,h6,f6,ih,u6,cm,m6,g6,_6,lh,b6,dh,v6,k6,y6,kv,T6,w6,Uo,yv,ch,$6,F6,Tv,ph,x6,E6,wv,hh,B6,M6,$v,fh,z6,P6,To,uh,j6,Us,q6,Fv,C6,A6,xv,N6,I6,O6,Da,L6,Sa,JT,Ws,Ua,Ev,mh,D6,Bv,S6,XT,lt,gh,U6,_h,W6,Mv,H6,R6,K6,bh,Q6,pm,V6,G6,J6,vh,X6,kh,Y6,Z6,e5,zv,t5,o5,Wo,Pv,yh,n5,s5,jv,Th,r5,a5,qv,wh,i5,l5,Cv,$h,d5,c5,wo,Fh,p5,Hs,h5,Av,f5,u5,Nv,m5,g5,_5,Wa,b5,Ha,YT,Rs,Ra,Iv,xh,v5,Ov,k5,ZT,dt,Eh,y5,Bh,T5,Lv,w5,$5,F5,Mh,x5,hm,E5,B5,M5,zh,z5,Ph,P5,j5,q5,Dv,C5,A5,Ho,Sv,jh,N5,I5,Uv,qh,O5,L5,Wv,Ch,D5,S5,Hv,Ah,U5,W5,$o,Nh,H5,Ks,R5,Rv,K5,Q5,Kv,V5,G5,J5,Ka,X5,Qa,e1,Qs,Va,Qv,Ih,Y5,Vv,Z5,t1,ct,Oh,eA,Gv,tA,oA,Lh,nA,fm,sA,rA,aA,Dh,iA,Sh,lA,dA,cA,Jv,pA,hA,Ro,Xv,Uh,fA,uA,Yv,Wh,mA,gA,Zv,Hh,_A,bA,ek,Rh,vA,kA,Fo,Kh,yA,Vs,TA,tk,wA,$A,ok,FA,xA,EA,Ga,BA,Ja,o1,Gs,Xa,nk,Qh,MA,sk,zA,n1,pt,Vh,PA,rk,jA,qA,Gh,CA,um,AA,NA,IA,Jh,OA,Xh,LA,DA,SA,ak,UA,WA,Ko,ik,Yh,HA,RA,lk,Zh,KA,QA,dk,ef,VA,GA,ck,tf,JA,XA,xo,of,YA,Js,ZA,pk,e7,t7,hk,o7,n7,s7,Ya,r7,Za,s1,Xs,ei,fk,nf,a7,uk,i7,r1,ht,sf,l7,mk,d7,c7,rf,p7,mm,h7,f7,u7,af,m7,lf,g7,_7,b7,gk,v7,k7,Qo,_k,df,y7,T7,bk,cf,w7,$7,vk,pf,F7,x7,kk,hf,E7,B7,Eo,ff,M7,Ys,z7,yk,P7,j7,Tk,q7,C7,A7,ti,N7,oi,a1,Zs,ni,wk,uf,I7,$k,O7,i1,ft,mf,L7,er,D7,Fk,S7,U7,xk,W7,H7,R7,gf,K7,gm,Q7,V7,G7,_f,J7,bf,X7,Y7,Z7,Ek,e8,t8,Vo,Bk,vf,o8,n8,Mk,kf,s8,r8,zk,yf,a8,i8,Pk,Tf,l8,d8,Bo,wf,c8,tr,p8,jk,h8,f8,qk,u8,m8,g8,si,_8,ri,l1;return l=new Oe({}),de=new Oe({}),Di=new Oe({}),Si=new T2({props:{pipeline:"text-classification"}}),ol=new T2({props:{pipeline:"token-classification"}}),fl=new T2({props:{pipeline:"fill-mask"}}),yl=new T2({props:{pipeline:"question-answering"}}),Zl=new Oe({}),ed=new N({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.29.0/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/v4.29.0/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.29.0/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/v4.29.0/en/model_doc/bert#transformers.TFBertModel">TFBertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.BertConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.BertConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.BertConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.BertConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model is used as a decoder or not. If <code>False</code>, the model is used as an encoder.`,name:"is_decoder"},{anchor:"transformers.BertConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.BertConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bert/configuration_bert.py#L72"}}),cr=new ke({props:{anchor:"transformers.BertConfig.example",$$slots:{default:[DW]},$$scope:{ctx:E}}}),od=new Oe({}),nd=new N({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.29.0/src/transformers/models/bert/tokenization_bert.py#L137"}}),rd=new N({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.29.0/src/transformers/models/bert/tokenization_bert.py#L267",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>
`}}),id=new N({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.29.0/src/transformers/models/bert/tokenization_bert.py#L292",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>
`}}),dd=new N({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.29.0/src/transformers/models/bert/tokenization_bert.py#L320",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 ke({props:{anchor:"transformers.BertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[SW]},$$scope:{ctx:E}}}),cd=new N({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.29.0/src/transformers/models/bert/tokenization_bert.py#L349"}}),pd=new Oe({}),hd=new N({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.29.0/src/transformers/models/bert/tokenization_bert_fast.py#L161"}}),md=new N({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.29.0/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>
`}}),_d=new N({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.29.0/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>
`}}),mr=new ke({props:{anchor:"transformers.BertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[UW]},$$scope:{ctx:E}}}),bd=new Oe({}),vd=new N({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.29.0/src/transformers/models/bert/tokenization_bert_tf.py#L11"}}),yd=new N({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.29.0/src/transformers/models/bert/tokenization_bert_tf.py#L138"}}),_r=new ke({props:{anchor:"transformers.TFBertTokenizer.from_pretrained.example",$$slots:{default:[WW]},$$scope:{ctx:E}}}),wd=new N({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.29.0/src/transformers/models/bert/tokenization_bert_tf.py#L99"}}),br=new ke({props:{anchor:"transformers.TFBertTokenizer.from_tokenizer.example",$$slots:{default:[HW]},$$scope:{ctx:E}}}),$d=new Oe({}),Fd=new N({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.29.0/src/transformers/models/bert/modeling_bert.py#L770"}}),Ed=new N({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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L932"}}),Md=new N({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.29.0/src/transformers/models/bert/modeling_flax_bert.py#L62"}}),Pd=new N({props:{name:"replace",anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/flax/struct.py#L108"}}),jd=new Oe({}),qd=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L873"}}),Ld=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L912",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Tr=new De({props:{$$slots:{default:[RW]},$$scope:{ctx:E}}}),wr=new ke({props:{anchor:"transformers.BertModel.forward.example",$$slots:{default:[KW]},$$scope:{ctx:E}}}),Dd=new Oe({}),Sd=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1055"}}),Rd=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1073",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/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 De({props:{$$slots:{default:[QW]},$$scope:{ctx:E}}}),xr=new ke({props:{anchor:"transformers.BertForPreTraining.forward.example",$$slots:{default:[VW]},$$scope:{ctx:E}}}),Kd=new Oe({}),Qd=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1161"}}),Yd=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1183",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Br=new De({props:{$$slots:{default:[GW]},$$scope:{ctx:E}}}),Mr=new ke({props:{anchor:"transformers.BertLMHeadModel.forward.example",$$slots:{default:[JW]},$$scope:{ctx:E}}}),Zd=new Oe({}),ec=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1301"}}),rc=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1326",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Pr=new De({props:{$$slots:{default:[XW]},$$scope:{ctx:E}}}),jr=new ke({props:{anchor:"transformers.BertForMaskedLM.forward.example",$$slots:{default:[YW]},$$scope:{ctx:E}}}),ac=new Oe({}),ic=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1412"}}),hc=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1422",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Cr=new De({props:{$$slots:{default:[ZW]},$$scope:{ctx:E}}}),Ar=new ke({props:{anchor:"transformers.BertForNextSentencePrediction.forward.example",$$slots:{default:[eH]},$$scope:{ctx:E}}}),fc=new Oe({}),uc=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1517"}}),bc=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1533",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ir=new De({props:{$$slots:{default:[tH]},$$scope:{ctx:E}}}),Or=new ke({props:{anchor:"transformers.BertForSequenceClassification.forward.example",$$slots:{default:[oH]},$$scope:{ctx:E}}}),Lr=new ke({props:{anchor:"transformers.BertForSequenceClassification.forward.example-2",$$slots:{default:[nH]},$$scope:{ctx:E}}}),vc=new Oe({}),kc=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1620"}}),$c=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1634",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Sr=new De({props:{$$slots:{default:[sH]},$$scope:{ctx:E}}}),Ur=new ke({props:{anchor:"transformers.BertForMultipleChoice.forward.example",$$slots:{default:[rH]},$$scope:{ctx:E}}}),Fc=new Oe({}),xc=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1714"}}),zc=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1731",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Hr=new De({props:{$$slots:{default:[aH]},$$scope:{ctx:E}}}),Rr=new ke({props:{anchor:"transformers.BertForTokenClassification.forward.example",$$slots:{default:[iH]},$$scope:{ctx:E}}}),Pc=new Oe({}),jc=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1799"}}),Nc=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_bert.py#L1812",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qr=new De({props:{$$slots:{default:[lH]},$$scope:{ctx:E}}}),Vr=new ke({props:{anchor:"transformers.BertForQuestionAnswering.forward.example",$$slots:{default:[dH]},$$scope:{ctx:E}}}),Ic=new Oe({}),Oc=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1064"}}),Jr=new De({props:{$$slots:{default:[cH]},$$scope:{ctx:E}}}),Uc=new N({props:{name:"call",anchor:"transformers.TFBertModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_hidden_states",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertModel.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1070",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Xr=new De({props:{$$slots:{default:[pH]},$$scope:{ctx:E}}}),Yr=new ke({props:{anchor:"transformers.TFBertModel.call.example",$$slots:{default:[hH]},$$scope:{ctx:E}}}),Wc=new Oe({}),Hc=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1160"}}),ea=new De({props:{$$slots:{default:[fH]},$$scope:{ctx:E}}}),Vc=new N({props:{name:"call",anchor:"transformers.TFBertForPreTraining.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"next_sentence_label",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForPreTraining.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1182",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/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>
`}}),ta=new De({props:{$$slots:{default:[uH]},$$scope:{ctx:E}}}),oa=new ke({props:{anchor:"transformers.TFBertForPreTraining.call.example",$$slots:{default:[mH]},$$scope:{ctx:E}}}),Gc=new Oe({}),Jc=new N({props:{name:"class transformers.TFBertLMHeadModel",anchor:"transformers.TFBertLMHeadModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1368"}}),Xc=new N({props:{name:"call",anchor:"transformers.TFBertLMHeadModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_hidden_states",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1405",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),sa=new ke({props:{anchor:"transformers.TFBertLMHeadModel.call.example",$$slots:{default:[gH]},$$scope:{ctx:E}}}),tp=new Oe({}),op=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1277"}}),aa=new De({props:{$$slots:{default:[_H]},$$scope:{ctx:E}}}),ip=new N({props:{name:"call",anchor:"transformers.TFBertForMaskedLM.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForMaskedLM.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1305",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ia=new De({props:{$$slots:{default:[bH]},$$scope:{ctx:E}}}),la=new ke({props:{anchor:"transformers.TFBertForMaskedLM.call.example",$$slots:{default:[vH]},$$scope:{ctx:E}}}),da=new ke({props:{anchor:"transformers.TFBertForMaskedLM.call.example-2",$$slots:{default:[kH]},$$scope:{ctx:E}}}),lp=new Oe({}),dp=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1510"}}),pa=new De({props:{$$slots:{default:[yH]},$$scope:{ctx:E}}}),up=new N({props:{name:"call",anchor:"transformers.TFBertForNextSentencePrediction.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"next_sentence_label",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForNextSentencePrediction.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1520",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFNextSentencePredictorOutput"
>transformers.modeling_tf_outputs.TFNextSentencePredictorOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ha=new De({props:{$$slots:{default:[TH]},$$scope:{ctx:E}}}),fa=new ke({props:{anchor:"transformers.TFBertForNextSentencePrediction.call.example",$$slots:{default:[wH]},$$scope:{ctx:E}}}),mp=new Oe({}),gp=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1601"}}),ma=new De({props:{$$slots:{default:[$H]},$$scope:{ctx:E}}}),kp=new N({props:{name:"call",anchor:"transformers.TFBertForSequenceClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1622",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ga=new De({props:{$$slots:{default:[FH]},$$scope:{ctx:E}}}),_a=new ke({props:{anchor:"transformers.TFBertForSequenceClassification.call.example",$$slots:{default:[xH]},$$scope:{ctx:E}}}),ba=new ke({props:{anchor:"transformers.TFBertForSequenceClassification.call.example-2",$$slots:{default:[EH]},$$scope:{ctx:E}}}),yp=new Oe({}),Tp=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1693"}}),ka=new De({props:{$$slots:{default:[BH]},$$scope:{ctx:E}}}),xp=new N({props:{name:"call",anchor:"transformers.TFBertForMultipleChoice.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForMultipleChoice.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1717",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ya=new De({props:{$$slots:{default:[MH]},$$scope:{ctx:E}}}),Ta=new ke({props:{anchor:"transformers.TFBertForMultipleChoice.call.example",$$slots:{default:[zH]},$$scope:{ctx:E}}}),Ep=new Oe({}),Bp=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1822"}}),$a=new De({props:{$$slots:{default:[PH]},$$scope:{ctx:E}}}),jp=new N({props:{name:"call",anchor:"transformers.TFBertForTokenClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForTokenClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1849",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Fa=new De({props:{$$slots:{default:[jH]},$$scope:{ctx:E}}}),xa=new ke({props:{anchor:"transformers.TFBertForTokenClassification.call.example",$$slots:{default:[qH]},$$scope:{ctx:E}}}),Ea=new ke({props:{anchor:"transformers.TFBertForTokenClassification.call.example-2",$$slots:{default:[CH]},$$scope:{ctx:E}}}),qp=new Oe({}),Cp=new N({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.29.0/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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1918"}}),Ma=new De({props:{$$slots:{default:[AH]},$$scope:{ctx:E}}}),Op=new N({props:{name:"call",anchor:"transformers.TFBertForQuestionAnswering.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"start_positions",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"end_positions",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForQuestionAnswering.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.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.29.0/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.29.0/src/transformers/models/bert/modeling_tf_bert.py#L1940",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),za=new De({props:{$$slots:{default:[NH]},$$scope:{ctx:E}}}),Pa=new ke({props:{anchor:"transformers.TFBertForQuestionAnswering.call.example",$$slots:{default:[IH]},$$scope:{ctx:E}}}),ja=new ke({props:{anchor:"transformers.TFBertForQuestionAnswering.call.example-2",$$slots:{default:[OH]},$$scope:{ctx:E}}}),Lp=new Oe({}),Dp=new N({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.29.0/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.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bert/modeling_flax_bert.py#L1029"}}),Vp=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ca=new De({props:{$$slots:{default:[LH]},$$scope:{ctx:E}}}),Aa=new ke({props:{anchor:"transformers.FlaxBertModel.__call__.example",$$slots:{default:[DH]},$$scope:{ctx:E}}}),Gp=new Oe({}),Jp=new N({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.29.0/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.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bert/modeling_flax_bert.py#L1104"}}),sh=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/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>
`}}),Ia=new De({props:{$$slots:{default:[SH]},$$scope:{ctx:E}}}),Oa=new ke({props:{anchor:"transformers.FlaxBertForPreTraining.__call__.example",$$slots:{default:[UH]},$$scope:{ctx:E}}}),rh=new Oe({}),ah=new N({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.29.0/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.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bert/modeling_flax_bert.py#L1677"}}),uh=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Da=new De({props:{$$slots:{default:[WH]},$$scope:{ctx:E}}}),Sa=new ke({props:{anchor:"transformers.FlaxBertForCausalLM.__call__.example",$$slots:{default:[HH]},$$scope:{ctx:E}}}),mh=new Oe({}),gh=new N({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.29.0/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.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bert/modeling_flax_bert.py#L1195"}}),Fh=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Wa=new De({props:{$$slots:{default:[RH]},$$scope:{ctx:E}}}),Ha=new ke({props:{anchor:"transformers.FlaxBertForMaskedLM.__call__.example",$$slots:{default:[KH]},$$scope:{ctx:E}}}),xh=new Oe({}),Eh=new N({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.29.0/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.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bert/modeling_flax_bert.py#L1259"}}),Nh=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput"
>transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ka=new De({props:{$$slots:{default:[QH]},$$scope:{ctx:E}}}),Qa=new ke({props:{anchor:"transformers.FlaxBertForNextSentencePrediction.__call__.example",$$slots:{default:[VH]},$$scope:{ctx:E}}}),Ih=new Oe({}),Oh=new N({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.29.0/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.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bert/modeling_flax_bert.py#L1362"}}),Kh=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ga=new De({props:{$$slots:{default:[GH]},$$scope:{ctx:E}}}),Ja=new ke({props:{anchor:"transformers.FlaxBertForSequenceClassification.__call__.example",$$slots:{default:[JH]},$$scope:{ctx:E}}}),Qh=new Oe({}),Vh=new N({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.29.0/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.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bert/modeling_flax_bert.py#L1442"}}),of=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput"
>transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ya=new De({props:{$$slots:{default:[XH]},$$scope:{ctx:E}}}),Za=new ke({props:{anchor:"transformers.FlaxBertForMultipleChoice.__call__.example",$$slots:{default:[YH]},$$scope:{ctx:E}}}),nf=new Oe({}),sf=new N({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.29.0/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.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bert/modeling_flax_bert.py#L1520"}}),ff=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxTokenClassifierOutput"
>transformers.modeling_flax_outputs.FlaxTokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ti=new De({props:{$$slots:{default:[ZH]},$$scope:{ctx:E}}}),oi=new ke({props:{anchor:"transformers.FlaxBertForTokenClassification.__call__.example",$$slots:{default:[eR]},$$scope:{ctx:E}}}),uf=new Oe({}),mf=new N({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.29.0/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.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bert/modeling_flax_bert.py#L1593"}}),wf=new N({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.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.29.0/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.29.0/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),si=new De({props:{$$slots:{default:[tR]},$$scope:{ctx:E}}}),ri=new ke({props:{anchor:"transformers.FlaxBertForQuestionAnswering.__call__.example",$$slots:{default:[oR]},$$scope:{ctx:E}}}),{c(){d=s("meta"),v=c(),u=s("h1"),m=s("a"),b=s("span"),y(l.$$.fragment),f=c(),M=s("span"),Me=o("BERT"),we=c(),S=s("div"),he=s("a"),ee=s("img"),ze=c(),W=s("a"),fe=s("img"),V=c(),ie=s("h2"),le=s("a"),H=s("span"),y(de.$$.fragment),Pe=c(),R=s("span"),je=o("Overview"),$e=c(),U=s("p"),qe=o("The BERT model was proposed in "),ce=s("a"),re=o("BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding"),j=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.`),A=c(),ue=s("p"),G=o("The abstract from the paper is the following:"),Fe=c(),me=s("p"),K=s("em"),Ce=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.`),xe=c(),q=s("p"),_e=s("em"),J=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).`),Ee=c(),ge=s("p"),X=o("Tips:"),Be=c(),se=s("ul"),O=s("li"),be=s("p"),Y=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.`),Ae=c(),te=s("li"),C=s("p"),Ne=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.`),I=c(),pe=s("li"),ve=s("p"),k=o("Corrupts the inputs by using random masking, more precisely, during pretraining, a given percentage of tokens (usually 15%) is masked by:"),z=c(),Se=s("ul"),oe=s("li"),Re=o("a special mask token with probability 0.8"),Ke=c(),P=s("li"),Qe=o("a random token different from the one masked with probability 0.1"),Ve=c(),We=s("li"),Ge=o("the same token with probability 0.1"),Je=c(),L=s("li"),Q=s("p"),Xe=o("The model must predict the original sentence, but has a second objective: inputs are two sentences A and B (with a separation token in between). With probability 50%, the sentences are consecutive in the corpus, in the remaining 50% they are not related. The model has to predict if the sentences are consecutive or not."),He=c(),D=s("p"),Ye=o("This model was contributed by "),Ue=s("a"),Ie=o("thomwolf"),Ze=o(". The original code can be found "),Z=s("a"),et=o("here"),w2=o("."),jy=c(),Nn=s("h2"),rr=s("a"),ag=s("span"),y(Di.$$.fragment),$2=c(),ig=s("span"),F2=o("Resources"),qy=c(),Wf=s("p"),x2=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."),Cy=c(),y(Si.$$.fragment),Ay=c(),tt=s("ul"),Ui=s("li"),E2=o("A blog post on "),Wi=s("a"),B2=o("BERT Text Classification in a different language"),M2=o("."),z2=c(),Hi=s("li"),P2=o("A notebook for "),Ri=s("a"),j2=o("Finetuning BERT (and friends) for multi-label text classification"),q2=o("."),C2=c(),Ki=s("li"),A2=o("A notebook on how to "),Qi=s("a"),N2=o("Finetune BERT for multi-label classification using PyTorch"),I2=o(". \u{1F30E}"),O2=c(),Vi=s("li"),L2=o("A notebook on how to "),Gi=s("a"),D2=o("warm-start an EncoderDecoder model with BERT for summarization"),S2=o("."),U2=c(),Jo=s("li"),Hf=s("a"),W2=o("BertForSequenceClassification"),H2=o(" is supported by this "),Ji=s("a"),R2=o("example script"),K2=o(" and "),Xi=s("a"),Q2=o("notebook"),V2=o("."),G2=c(),Xo=s("li"),Rf=s("a"),J2=o("TFBertForSequenceClassification"),X2=o(" is supported by this "),Yi=s("a"),Y2=o("example script"),Z2=o(" and "),Zi=s("a"),e0=o("notebook"),t0=o("."),o0=c(),Yo=s("li"),Kf=s("a"),n0=o("FlaxBertForSequenceClassification"),s0=o(" is supported by this "),el=s("a"),r0=o("example script"),a0=o(" and "),tl=s("a"),i0=o("notebook"),l0=o("."),d0=c(),lg=s("li"),Qf=s("a"),c0=o("Text classification task guide"),Ny=c(),y(ol.$$.fragment),Iy=c(),mt=s("ul"),nl=s("li"),p0=o("A blog post on how to use "),sl=s("a"),h0=o("Hugging Face Transformers with Keras: Fine-tune a non-English BERT for Named Entity Recognition"),f0=o("."),u0=c(),In=s("li"),m0=o("A notebook for "),rl=s("a"),g0=o("Finetuning BERT for named-entity recognition"),_0=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 "),al=s("a"),b0=o("version"),v0=o(" of the notebook instead."),k0=c(),Zo=s("li"),Vf=s("a"),y0=o("BertForTokenClassification"),T0=o(" is supported by this "),il=s("a"),w0=o("example script"),$0=o(" and "),ll=s("a"),F0=o("notebook"),x0=o("."),E0=c(),en=s("li"),Gf=s("a"),B0=o("TFBertForTokenClassification"),M0=o(" is supported by this "),dl=s("a"),z0=o("example script"),P0=o(" and "),cl=s("a"),j0=o("notebook"),q0=o("."),C0=c(),ar=s("li"),Jf=s("a"),A0=o("FlaxBertForTokenClassification"),N0=o(" is supported by this "),pl=s("a"),I0=o("example script"),O0=o("."),L0=c(),Xf=s("li"),hl=s("a"),D0=o("Token classification"),S0=o(" chapter of the \u{1F917} Hugging Face Course."),U0=c(),dg=s("li"),Yf=s("a"),W0=o("Token classification task guide"),Oy=c(),y(fl.$$.fragment),Ly=c(),Ot=s("ul"),tn=s("li"),Zf=s("a"),H0=o("BertForMaskedLM"),R0=o(" is supported by this "),ul=s("a"),K0=o("example script"),Q0=o(" and "),ml=s("a"),V0=o("notebook"),G0=o("."),J0=c(),on=s("li"),eu=s("a"),X0=o("TFBertForMaskedLM"),Y0=o(" is supported by this "),gl=s("a"),Z0=o("example script"),e$=o(" and "),_l=s("a"),t$=o("notebook"),o$=o("."),n$=c(),nn=s("li"),tu=s("a"),s$=o("FlaxBertForMaskedLM"),r$=o(" is supported by this "),bl=s("a"),a$=o("example script"),i$=o(" and "),vl=s("a"),l$=o("notebook"),d$=o("."),c$=c(),ou=s("li"),kl=s("a"),p$=o("Masked language modeling"),h$=o(" chapter of the \u{1F917} Hugging Face Course."),f$=c(),cg=s("li"),nu=s("a"),u$=o("Masked language modeling task guide"),Dy=c(),y(yl.$$.fragment),Sy=c(),Lt=s("ul"),sn=s("li"),su=s("a"),m$=o("BertForQuestionAnswering"),g$=o(" is supported by this "),Tl=s("a"),_$=o("example script"),b$=o(" and "),wl=s("a"),v$=o("notebook"),k$=o("."),y$=c(),rn=s("li"),ru=s("a"),T$=o("TFBertForQuestionAnswering"),w$=o(" is supported by this "),$l=s("a"),$$=o("example script"),F$=o(" and "),Fl=s("a"),x$=o("notebook"),E$=o("."),B$=c(),ir=s("li"),au=s("a"),M$=o("FlaxBertForQuestionAnswering"),z$=o(" is supported by this "),xl=s("a"),P$=o("example script"),j$=o("."),q$=c(),iu=s("li"),El=s("a"),C$=o("Question answering"),A$=o(" chapter of the \u{1F917} Hugging Face Course."),N$=c(),pg=s("li"),lu=s("a"),I$=o("Question answering task guide"),Uy=c(),du=s("p"),hg=s("strong"),O$=o("Multiple choice"),Wy=c(),an=s("ul"),ln=s("li"),cu=s("a"),L$=o("BertForMultipleChoice"),D$=o(" is supported by this "),Bl=s("a"),S$=o("example script"),U$=o(" and "),Ml=s("a"),W$=o("notebook"),H$=o("."),R$=c(),dn=s("li"),pu=s("a"),K$=o("TFBertForMultipleChoice"),Q$=o(" is supported by this "),zl=s("a"),V$=o("example script"),G$=o(" and "),Pl=s("a"),J$=o("notebook"),X$=o("."),Y$=c(),fg=s("li"),hu=s("a"),Z$=o("Multiple choice task guide"),Hy=c(),jl=s("p"),eF=o("\u26A1\uFE0F "),ug=s("strong"),tF=o("Inference"),Ry=c(),lr=s("ul"),ql=s("li"),oF=o("A blog post on how to "),Cl=s("a"),nF=o("Accelerate BERT inference with Hugging Face Transformers and AWS Inferentia"),sF=o("."),rF=c(),Al=s("li"),aF=o("A blog post on how to "),Nl=s("a"),iF=o("Accelerate BERT inference with DeepSpeed-Inference on GPUs"),lF=o("."),Ky=c(),Il=s("p"),dF=o("\u2699\uFE0F "),mg=s("strong"),cF=o("Pretraining"),Qy=c(),fu=s("ul"),Ol=s("li"),pF=o("A blog post on "),Ll=s("a"),hF=o("Pre-Training BERT with Hugging Face Transformers and Habana Gaudi"),fF=o("."),Vy=c(),Dl=s("p"),uF=o("\u{1F680} "),gg=s("strong"),mF=o("Deploy"),Gy=c(),xt=s("ul"),Sl=s("li"),gF=o("A blog post on how to "),Ul=s("a"),_F=o("Convert Transformers to ONNX with Hugging Face Optimum"),bF=o("."),vF=c(),Wl=s("li"),kF=o("A blog post on how to "),Hl=s("a"),yF=o("Setup Deep Learning environment for Hugging Face Transformers with Habana Gaudi on AWS"),TF=o("."),wF=c(),Rl=s("li"),$F=o("A blog post on "),Kl=s("a"),FF=o("Autoscaling BERT with Hugging Face Transformers, Amazon SageMaker and Terraform module"),xF=o("."),EF=c(),Ql=s("li"),BF=o("A blog post on "),Vl=s("a"),MF=o("Serverless BERT with HuggingFace, AWS Lambda, and Docker"),zF=o("."),PF=c(),Gl=s("li"),jF=o("A blog post on "),Jl=s("a"),qF=o("Hugging Face Transformers BERT fine-tuning using Amazon SageMaker and Training Compiler"),CF=o("."),AF=c(),Xl=s("li"),NF=o("A blog post on "),Yl=s("a"),IF=o("Task-specific knowledge distillation for BERT using Transformers & Amazon SageMaker"),OF=o("."),Jy=c(),On=s("h2"),dr=s("a"),_g=s("span"),y(Zl.$$.fragment),LF=c(),bg=s("span"),DF=o("BertConfig"),Xy=c(),so=s("div"),y(ed.$$.fragment),SF=c(),Oo=s("p"),UF=o("This is the configuration class to store the configuration of a "),uu=s("a"),WF=o("BertModel"),HF=o(" or a "),mu=s("a"),RF=o("TFBertModel"),KF=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
`),td=s("a"),QF=o("bert-base-uncased"),VF=o(" architecture."),GF=c(),Ln=s("p"),JF=o("Configuration objects inherit from "),gu=s("a"),XF=o("PretrainedConfig"),YF=o(` and can be used to control the model outputs. Read the
documentation from `),_u=s("a"),ZF=o("PretrainedConfig"),ex=o(" for more information."),tx=c(),y(cr.$$.fragment),Yy=c(),Dn=s("h2"),pr=s("a"),vg=s("span"),y(od.$$.fragment),ox=c(),kg=s("span"),nx=o("BertTokenizer"),Zy=c(),ot=s("div"),y(nd.$$.fragment),sx=c(),yg=s("p"),rx=o("Construct a BERT tokenizer. Based on WordPiece."),ax=c(),sd=s("p"),ix=o("This tokenizer inherits from "),bu=s("a"),lx=o("PreTrainedTokenizer"),dx=o(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),cx=c(),cn=s("div"),y(rd.$$.fragment),px=c(),Tg=s("p"),hx=o(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),fx=c(),ad=s("ul"),vu=s("li"),ux=o("single sequence: "),wg=s("code"),mx=o("[CLS] X [SEP]"),gx=c(),ku=s("li"),_x=o("pair of sequences: "),$g=s("code"),bx=o("[CLS] A [SEP] B [SEP]"),vx=c(),hr=s("div"),y(id.$$.fragment),kx=c(),ld=s("p"),yx=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 `),Fg=s("code"),Tx=o("prepare_for_model"),wx=o(" method."),$x=c(),ro=s("div"),y(dd.$$.fragment),Fx=c(),xg=s("p"),xx=o("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),Ex=c(),y(fr.$$.fragment),Bx=c(),Sn=s("p"),Mx=o("If "),Eg=s("code"),zx=o("token_ids_1"),Px=o(" is "),Bg=s("code"),jx=o("None"),qx=o(", this method only returns the first portion of the mask (0s)."),Cx=c(),yu=s("div"),y(cd.$$.fragment),eT=c(),Un=s("h2"),ur=s("a"),Mg=s("span"),y(pd.$$.fragment),Ax=c(),zg=s("span"),Nx=o("BertTokenizerFast"),tT=c(),Bt=s("div"),y(hd.$$.fragment),Ix=c(),fd=s("p"),Ox=o("Construct a \u201Cfast\u201D BERT tokenizer (backed by HuggingFace\u2019s "),Pg=s("em"),Lx=o("tokenizers"),Dx=o(" library). Based on WordPiece."),Sx=c(),ud=s("p"),Ux=o("This tokenizer inherits from "),Tu=s("a"),Wx=o("PreTrainedTokenizerFast"),Hx=o(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Rx=c(),pn=s("div"),y(md.$$.fragment),Kx=c(),jg=s("p"),Qx=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:`),Vx=c(),gd=s("ul"),wu=s("li"),Gx=o("single sequence: "),qg=s("code"),Jx=o("[CLS] X [SEP]"),Xx=c(),$u=s("li"),Yx=o("pair of sequences: "),Cg=s("code"),Zx=o("[CLS] A [SEP] B [SEP]"),e4=c(),ao=s("div"),y(_d.$$.fragment),t4=c(),Ag=s("p"),o4=o("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),n4=c(),y(mr.$$.fragment),s4=c(),Wn=s("p"),r4=o("If "),Ng=s("code"),a4=o("token_ids_1"),i4=o(" is "),Ig=s("code"),l4=o("None"),d4=o(", this method only returns the first portion of the mask (0s)."),oT=c(),Hn=s("h2"),gr=s("a"),Og=s("span"),y(bd.$$.fragment),c4=c(),Lg=s("span"),p4=o("TFBertTokenizer"),nT=c(),Mt=s("div"),y(vd.$$.fragment),h4=c(),Rn=s("p"),f4=o(`This is an in-graph tokenizer for BERT. It should be initialized similarly to other tokenizers, using the
`),Dg=s("code"),u4=o("from_pretrained()"),m4=o(" method. It can also be initialized with the "),Sg=s("code"),g4=o("from_tokenizer()"),_4=o(` method, which imports settings
from an existing standard tokenizer object.`),b4=c(),kd=s("p"),v4=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 `),Ug=s("code"),k4=o("tf.string"),y4=o(" inputs to outputs."),T4=c(),hn=s("div"),y(yd.$$.fragment),w4=c(),Td=s("p"),$4=o("Instantiate a "),Wg=s("code"),F4=o("TFBertTokenizer"),x4=o(" from a pre-trained tokenizer."),E4=c(),y(_r.$$.fragment),B4=c(),fn=s("div"),y(wd.$$.fragment),M4=c(),Kn=s("p"),z4=o("Initialize a "),Hg=s("code"),P4=o("TFBertTokenizer"),j4=o(" from an existing "),Rg=s("code"),q4=o("Tokenizer"),C4=o("."),A4=c(),y(br.$$.fragment),sT=c(),Qn=s("h2"),vr=s("a"),Kg=s("span"),y($d.$$.fragment),N4=c(),Qg=s("span"),I4=o("Bert specific outputs"),rT=c(),Vn=s("div"),y(Fd.$$.fragment),O4=c(),xd=s("p"),L4=o("Output type of "),Fu=s("a"),D4=o("BertForPreTraining"),S4=o("."),aT=c(),Gn=s("div"),y(Ed.$$.fragment),U4=c(),Bd=s("p"),W4=o("Output type of "),xu=s("a"),H4=o("TFBertForPreTraining"),R4=o("."),iT=c(),Lo=s("div"),y(Md.$$.fragment),K4=c(),zd=s("p"),Q4=o("Output type of "),Eu=s("a"),V4=o("BertForPreTraining"),G4=o("."),J4=c(),kr=s("div"),y(Pd.$$.fragment),X4=c(),Vg=s("p"),Y4=o("\u201CReturns a new object replacing the specified fields with new values."),lT=c(),Jn=s("h2"),yr=s("a"),Gg=s("span"),y(jd.$$.fragment),Z4=c(),Jg=s("span"),eE=o("BertModel"),dT=c(),nt=s("div"),y(qd.$$.fragment),tE=c(),Xg=s("p"),oE=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),nE=c(),Cd=s("p"),sE=o("This model inherits from "),Bu=s("a"),rE=o("PreTrainedModel"),aE=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.)`),iE=c(),Ad=s("p"),lE=o("This model is also a PyTorch "),Nd=s("a"),dE=o("torch.nn.Module"),cE=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pE=c(),Id=s("p"),hE=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 `),Od=s("a"),fE=o(`Attention is
all you need`),uE=o(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),mE=c(),gt=s("p"),gE=o("To behave as an decoder the model needs to be initialized with the "),Yg=s("code"),_E=o("is_decoder"),bE=o(` argument of the configuration set
to `),Zg=s("code"),vE=o("True"),kE=o(". To be used in a Seq2Seq model, the model needs to initialized with both "),e_=s("code"),yE=o("is_decoder"),TE=o(` argument and
`),t_=s("code"),wE=o("add_cross_attention"),$E=o(" set to "),o_=s("code"),FE=o("True"),xE=o("; an "),n_=s("code"),EE=o("encoder_hidden_states"),BE=o(" is then expected as an input to the forward pass."),ME=c(),io=s("div"),y(Ld.$$.fragment),zE=c(),Xn=s("p"),PE=o("The "),Mu=s("a"),jE=o("BertModel"),qE=o(" forward method, overrides the "),s_=s("code"),CE=o("__call__"),AE=o(" special method."),NE=c(),y(Tr.$$.fragment),IE=c(),y(wr.$$.fragment),cT=c(),Yn=s("h2"),$r=s("a"),r_=s("span"),y(Dd.$$.fragment),OE=c(),a_=s("span"),LE=o("BertForPreTraining"),pT=c(),zt=s("div"),y(Sd.$$.fragment),DE=c(),Zn=s("p"),SE=o("Bert Model with two heads on top as done during the pretraining: a "),i_=s("code"),UE=o("masked language modeling"),WE=o(" head and a "),l_=s("code"),HE=o("next sentence prediction (classification)"),RE=o(" head."),KE=c(),Ud=s("p"),QE=o("This model inherits from "),zu=s("a"),VE=o("PreTrainedModel"),GE=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.)`),JE=c(),Wd=s("p"),XE=o("This model is also a PyTorch "),Hd=s("a"),YE=o("torch.nn.Module"),ZE=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),eB=c(),lo=s("div"),y(Rd.$$.fragment),tB=c(),es=s("p"),oB=o("The "),Pu=s("a"),nB=o("BertForPreTraining"),sB=o(" forward method, overrides the "),d_=s("code"),rB=o("__call__"),aB=o(" special method."),iB=c(),y(Fr.$$.fragment),lB=c(),y(xr.$$.fragment),hT=c(),ts=s("h2"),Er=s("a"),c_=s("span"),y(Kd.$$.fragment),dB=c(),p_=s("span"),cB=o("BertLMHeadModel"),fT=c(),Pt=s("div"),y(Qd.$$.fragment),pB=c(),Vd=s("p"),hB=o("Bert Model with a "),h_=s("code"),fB=o("language modeling"),uB=o(" head on top for CLM fine-tuning."),mB=c(),Gd=s("p"),gB=o("This model inherits from "),ju=s("a"),_B=o("PreTrainedModel"),bB=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),vB=c(),Jd=s("p"),kB=o("This model is also a PyTorch "),Xd=s("a"),yB=o("torch.nn.Module"),TB=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),wB=c(),co=s("div"),y(Yd.$$.fragment),$B=c(),os=s("p"),FB=o("The "),qu=s("a"),xB=o("BertLMHeadModel"),EB=o(" forward method, overrides the "),f_=s("code"),BB=o("__call__"),MB=o(" special method."),zB=c(),y(Br.$$.fragment),PB=c(),y(Mr.$$.fragment),uT=c(),ns=s("h2"),zr=s("a"),u_=s("span"),y(Zd.$$.fragment),jB=c(),m_=s("span"),qB=o("BertForMaskedLM"),mT=c(),jt=s("div"),y(ec.$$.fragment),CB=c(),tc=s("p"),AB=o("Bert Model with a "),g_=s("code"),NB=o("language modeling"),IB=o(" head on top."),OB=c(),oc=s("p"),LB=o("This model inherits from "),Cu=s("a"),DB=o("PreTrainedModel"),SB=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.)`),UB=c(),nc=s("p"),WB=o("This model is also a PyTorch "),sc=s("a"),HB=o("torch.nn.Module"),RB=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),KB=c(),po=s("div"),y(rc.$$.fragment),QB=c(),ss=s("p"),VB=o("The "),Au=s("a"),GB=o("BertForMaskedLM"),JB=o(" forward method, overrides the "),__=s("code"),XB=o("__call__"),YB=o(" special method."),ZB=c(),y(Pr.$$.fragment),eM=c(),y(jr.$$.fragment),gT=c(),rs=s("h2"),qr=s("a"),b_=s("span"),y(ac.$$.fragment),tM=c(),v_=s("span"),oM=o("BertForNextSentencePrediction"),_T=c(),qt=s("div"),y(ic.$$.fragment),nM=c(),lc=s("p"),sM=o("Bert Model with a "),k_=s("code"),rM=o("next sentence prediction (classification)"),aM=o(" head on top."),iM=c(),dc=s("p"),lM=o("This model inherits from "),Nu=s("a"),dM=o("PreTrainedModel"),cM=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.)`),pM=c(),cc=s("p"),hM=o("This model is also a PyTorch "),pc=s("a"),fM=o("torch.nn.Module"),uM=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),mM=c(),ho=s("div"),y(hc.$$.fragment),gM=c(),as=s("p"),_M=o("The "),Iu=s("a"),bM=o("BertForNextSentencePrediction"),vM=o(" forward method, overrides the "),y_=s("code"),kM=o("__call__"),yM=o(" special method."),TM=c(),y(Cr.$$.fragment),wM=c(),y(Ar.$$.fragment),bT=c(),is=s("h2"),Nr=s("a"),T_=s("span"),y(fc.$$.fragment),$M=c(),w_=s("span"),FM=o("BertForSequenceClassification"),vT=c(),Ct=s("div"),y(uc.$$.fragment),xM=c(),$_=s("p"),EM=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.`),BM=c(),mc=s("p"),MM=o("This model inherits from "),Ou=s("a"),zM=o("PreTrainedModel"),PM=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.)`),jM=c(),gc=s("p"),qM=o("This model is also a PyTorch "),_c=s("a"),CM=o("torch.nn.Module"),AM=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),NM=c(),Dt=s("div"),y(bc.$$.fragment),IM=c(),ls=s("p"),OM=o("The "),Lu=s("a"),LM=o("BertForSequenceClassification"),DM=o(" forward method, overrides the "),F_=s("code"),SM=o("__call__"),UM=o(" special method."),WM=c(),y(Ir.$$.fragment),HM=c(),y(Or.$$.fragment),RM=c(),y(Lr.$$.fragment),kT=c(),ds=s("h2"),Dr=s("a"),x_=s("span"),y(vc.$$.fragment),KM=c(),E_=s("span"),QM=o("BertForMultipleChoice"),yT=c(),At=s("div"),y(kc.$$.fragment),VM=c(),B_=s("p"),GM=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.`),JM=c(),yc=s("p"),XM=o("This model inherits from "),Du=s("a"),YM=o("PreTrainedModel"),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(),Tc=s("p"),tz=o("This model is also a PyTorch "),wc=s("a"),oz=o("torch.nn.Module"),nz=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),sz=c(),fo=s("div"),y($c.$$.fragment),rz=c(),cs=s("p"),az=o("The "),Su=s("a"),iz=o("BertForMultipleChoice"),lz=o(" forward method, overrides the "),M_=s("code"),dz=o("__call__"),cz=o(" special method."),pz=c(),y(Sr.$$.fragment),hz=c(),y(Ur.$$.fragment),TT=c(),ps=s("h2"),Wr=s("a"),z_=s("span"),y(Fc.$$.fragment),fz=c(),P_=s("span"),uz=o("BertForTokenClassification"),wT=c(),Nt=s("div"),y(xc.$$.fragment),mz=c(),j_=s("p"),gz=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.`),_z=c(),Ec=s("p"),bz=o("This model inherits from "),Uu=s("a"),vz=o("PreTrainedModel"),kz=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.)`),yz=c(),Bc=s("p"),Tz=o("This model is also a PyTorch "),Mc=s("a"),wz=o("torch.nn.Module"),$z=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Fz=c(),uo=s("div"),y(zc.$$.fragment),xz=c(),hs=s("p"),Ez=o("The "),Wu=s("a"),Bz=o("BertForTokenClassification"),Mz=o(" forward method, overrides the "),q_=s("code"),zz=o("__call__"),Pz=o(" special method."),jz=c(),y(Hr.$$.fragment),qz=c(),y(Rr.$$.fragment),$T=c(),fs=s("h2"),Kr=s("a"),C_=s("span"),y(Pc.$$.fragment),Cz=c(),A_=s("span"),Az=o("BertForQuestionAnswering"),FT=c(),It=s("div"),y(jc.$$.fragment),Nz=c(),us=s("p"),Iz=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 `),N_=s("code"),Oz=o("span start logits"),Lz=o(" and "),I_=s("code"),Dz=o("span end logits"),Sz=o(")."),Uz=c(),qc=s("p"),Wz=o("This model inherits from "),Hu=s("a"),Hz=o("PreTrainedModel"),Rz=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.)`),Kz=c(),Cc=s("p"),Qz=o("This model is also a PyTorch "),Ac=s("a"),Vz=o("torch.nn.Module"),Gz=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Jz=c(),mo=s("div"),y(Nc.$$.fragment),Xz=c(),ms=s("p"),Yz=o("The "),Ru=s("a"),Zz=o("BertForQuestionAnswering"),eP=o(" forward method, overrides the "),O_=s("code"),tP=o("__call__"),oP=o(" special method."),nP=c(),y(Qr.$$.fragment),sP=c(),y(Vr.$$.fragment),xT=c(),gs=s("h2"),Gr=s("a"),L_=s("span"),y(Ic.$$.fragment),rP=c(),D_=s("span"),aP=o("TFBertModel"),ET=c(),_t=s("div"),y(Oc.$$.fragment),iP=c(),S_=s("p"),lP=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),dP=c(),Lc=s("p"),cP=o("This model inherits from "),Ku=s("a"),pP=o("TFPreTrainedModel"),hP=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.)`),fP=c(),Dc=s("p"),uP=o("This model is also a "),Sc=s("a"),mP=o("tf.keras.Model"),gP=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.`),_P=c(),y(Jr.$$.fragment),bP=c(),go=s("div"),y(Uc.$$.fragment),vP=c(),_s=s("p"),kP=o("The "),Qu=s("a"),yP=o("TFBertModel"),TP=o(" forward method, overrides the "),U_=s("code"),wP=o("__call__"),$P=o(" special method."),FP=c(),y(Xr.$$.fragment),xP=c(),y(Yr.$$.fragment),BT=c(),bs=s("h2"),Zr=s("a"),W_=s("span"),y(Wc.$$.fragment),EP=c(),H_=s("span"),BP=o("TFBertForPreTraining"),MT=c(),bt=s("div"),y(Hc.$$.fragment),MP=c(),vs=s("p"),zP=o(`Bert Model with two heads on top as done during the pretraining:
a `),R_=s("code"),PP=o("masked language modeling"),jP=o(" head and a "),K_=s("code"),qP=o("next sentence prediction (classification)"),CP=o(" head."),AP=c(),Rc=s("p"),NP=o("This model inherits from "),Vu=s("a"),IP=o("TFPreTrainedModel"),OP=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.)`),LP=c(),Kc=s("p"),DP=o("This model is also a "),Qc=s("a"),SP=o("tf.keras.Model"),UP=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.`),WP=c(),y(ea.$$.fragment),HP=c(),_o=s("div"),y(Vc.$$.fragment),RP=c(),ks=s("p"),KP=o("The "),Gu=s("a"),QP=o("TFBertForPreTraining"),VP=o(" forward method, overrides the "),Q_=s("code"),GP=o("__call__"),JP=o(" special method."),XP=c(),y(ta.$$.fragment),YP=c(),y(oa.$$.fragment),zT=c(),ys=s("h2"),na=s("a"),V_=s("span"),y(Gc.$$.fragment),ZP=c(),G_=s("span"),e9=o("TFBertModelLMHeadModel"),PT=c(),Ts=s("div"),y(Jc.$$.fragment),t9=c(),St=s("div"),y(Xc.$$.fragment),o9=c(),st=s("p"),n9=o("encoder_hidden_states  ("),J_=s("code"),s9=o("tf.Tensor"),r9=o(" of shape "),X_=s("code"),a9=o("(batch_size, sequence_length, hidden_size)"),i9=o(", "),Y_=s("em"),l9=o("optional"),d9=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 (`),Z_=s("code"),c9=o("tf.Tensor"),p9=o(" of shape "),eb=s("code"),h9=o("(batch_size, sequence_length)"),f9=o(", "),tb=s("em"),u9=o("optional"),m9=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 `),ob=s("code"),g9=o("[0, 1]"),_9=o(":"),b9=c(),Yc=s("ul"),Zc=s("li"),v9=o("1 for tokens that are "),nb=s("strong"),k9=o("not masked"),y9=o(","),T9=c(),ep=s("li"),w9=o("0 for tokens that are "),sb=s("strong"),$9=o("masked"),F9=o("."),x9=c(),ne=s("p"),E9=o("past_key_values ("),rb=s("code"),B9=o("Tuple[Tuple[tf.Tensor]]"),M9=o(" of length "),ab=s("code"),z9=o("config.n_layers"),P9=o(`)
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),ib=s("code"),j9=o("past_key_values"),q9=o(" are used, the user can optionally input only the last "),lb=s("code"),C9=o("decoder_input_ids"),A9=o(` (those that
don\u2019t have their past key value states given to this model) of shape `),db=s("code"),N9=o("(batch_size, 1)"),I9=o(` instead of all
`),cb=s("code"),O9=o("decoder_input_ids"),L9=o(" of shape "),pb=s("code"),D9=o("(batch_size, sequence_length)"),S9=o(`.
use_cache (`),hb=s("code"),U9=o("bool"),W9=o(", "),fb=s("em"),H9=o("optional"),R9=o(", defaults to "),ub=s("code"),K9=o("True"),Q9=o(`):
If set to `),mb=s("code"),V9=o("True"),G9=o(", "),gb=s("code"),J9=o("past_key_values"),X9=o(` key value states are returned and can be used to speed up decoding (see
`),_b=s("code"),Y9=o("past_key_values"),Z9=o("). Set to "),bb=s("code"),ej=o("False"),tj=o(" during training, "),vb=s("code"),oj=o("True"),nj=o(` during generation
labels (`),kb=s("code"),sj=o("tf.Tensor"),rj=o(" or "),yb=s("code"),aj=o("np.ndarray"),ij=o(" of shape "),Tb=s("code"),lj=o("(batch_size, sequence_length)"),dj=o(", "),wb=s("em"),cj=o("optional"),pj=o(`):
Labels for computing the cross entropy classification loss. Indices should be in `),$b=s("code"),hj=o("[0, ..., config.vocab_size - 1]"),fj=o("."),uj=c(),y(sa.$$.fragment),jT=c(),ws=s("h2"),ra=s("a"),Fb=s("span"),y(tp.$$.fragment),mj=c(),xb=s("span"),gj=o("TFBertForMaskedLM"),qT=c(),vt=s("div"),y(op.$$.fragment),_j=c(),np=s("p"),bj=o("Bert Model with a "),Eb=s("code"),vj=o("language modeling"),kj=o(" head on top."),yj=c(),sp=s("p"),Tj=o("This model inherits from "),Ju=s("a"),wj=o("TFPreTrainedModel"),$j=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.)`),Fj=c(),rp=s("p"),xj=o("This model is also a "),ap=s("a"),Ej=o("tf.keras.Model"),Bj=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Mj=c(),y(aa.$$.fragment),zj=c(),Ut=s("div"),y(ip.$$.fragment),Pj=c(),$s=s("p"),jj=o("The "),Xu=s("a"),qj=o("TFBertForMaskedLM"),Cj=o(" forward method, overrides the "),Bb=s("code"),Aj=o("__call__"),Nj=o(" special method."),Ij=c(),y(ia.$$.fragment),Oj=c(),y(la.$$.fragment),Lj=c(),y(da.$$.fragment),CT=c(),Fs=s("h2"),ca=s("a"),Mb=s("span"),y(lp.$$.fragment),Dj=c(),zb=s("span"),Sj=o("TFBertForNextSentencePrediction"),AT=c(),kt=s("div"),y(dp.$$.fragment),Uj=c(),cp=s("p"),Wj=o("Bert Model with a "),Pb=s("code"),Hj=o("next sentence prediction (classification)"),Rj=o(" head on top."),Kj=c(),pp=s("p"),Qj=o("This model inherits from "),Yu=s("a"),Vj=o("TFPreTrainedModel"),Gj=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.)`),Jj=c(),hp=s("p"),Xj=o("This model is also a "),fp=s("a"),Yj=o("tf.keras.Model"),Zj=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),eq=c(),y(pa.$$.fragment),tq=c(),bo=s("div"),y(up.$$.fragment),oq=c(),xs=s("p"),nq=o("The "),Zu=s("a"),sq=o("TFBertForNextSentencePrediction"),rq=o(" forward method, overrides the "),jb=s("code"),aq=o("__call__"),iq=o(" special method."),lq=c(),y(ha.$$.fragment),dq=c(),y(fa.$$.fragment),NT=c(),Es=s("h2"),ua=s("a"),qb=s("span"),y(mp.$$.fragment),cq=c(),Cb=s("span"),pq=o("TFBertForSequenceClassification"),IT=c(),yt=s("div"),y(gp.$$.fragment),hq=c(),Ab=s("p"),fq=o(`Bert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),uq=c(),_p=s("p"),mq=o("This model inherits from "),em=s("a"),gq=o("TFPreTrainedModel"),_q=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),bq=c(),bp=s("p"),vq=o("This model is also a "),vp=s("a"),kq=o("tf.keras.Model"),yq=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Tq=c(),y(ma.$$.fragment),wq=c(),Wt=s("div"),y(kp.$$.fragment),$q=c(),Bs=s("p"),Fq=o("The "),tm=s("a"),xq=o("TFBertForSequenceClassification"),Eq=o(" forward method, overrides the "),Nb=s("code"),Bq=o("__call__"),Mq=o(" special method."),zq=c(),y(ga.$$.fragment),Pq=c(),y(_a.$$.fragment),jq=c(),y(ba.$$.fragment),OT=c(),Ms=s("h2"),va=s("a"),Ib=s("span"),y(yp.$$.fragment),qq=c(),Ob=s("span"),Cq=o("TFBertForMultipleChoice"),LT=c(),Tt=s("div"),y(Tp.$$.fragment),Aq=c(),Lb=s("p"),Nq=o(`Bert Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a
softmax) e.g. for RocStories/SWAG tasks.`),Iq=c(),wp=s("p"),Oq=o("This model inherits from "),om=s("a"),Lq=o("TFPreTrainedModel"),Dq=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.)`),Sq=c(),$p=s("p"),Uq=o("This model is also a "),Fp=s("a"),Wq=o("tf.keras.Model"),Hq=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.`),Rq=c(),y(ka.$$.fragment),Kq=c(),vo=s("div"),y(xp.$$.fragment),Qq=c(),zs=s("p"),Vq=o("The "),nm=s("a"),Gq=o("TFBertForMultipleChoice"),Jq=o(" forward method, overrides the "),Db=s("code"),Xq=o("__call__"),Yq=o(" special method."),Zq=c(),y(ya.$$.fragment),e3=c(),y(Ta.$$.fragment),DT=c(),Ps=s("h2"),wa=s("a"),Sb=s("span"),y(Ep.$$.fragment),t3=c(),Ub=s("span"),o3=o("TFBertForTokenClassification"),ST=c(),wt=s("div"),y(Bp.$$.fragment),n3=c(),Wb=s("p"),s3=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.`),r3=c(),Mp=s("p"),a3=o("This model inherits from "),sm=s("a"),i3=o("TFPreTrainedModel"),l3=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.)`),d3=c(),zp=s("p"),c3=o("This model is also a "),Pp=s("a"),p3=o("tf.keras.Model"),h3=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),f3=c(),y($a.$$.fragment),u3=c(),Ht=s("div"),y(jp.$$.fragment),m3=c(),js=s("p"),g3=o("The "),rm=s("a"),_3=o("TFBertForTokenClassification"),b3=o(" forward method, overrides the "),Hb=s("code"),v3=o("__call__"),k3=o(" special method."),y3=c(),y(Fa.$$.fragment),T3=c(),y(xa.$$.fragment),w3=c(),y(Ea.$$.fragment),UT=c(),qs=s("h2"),Ba=s("a"),Rb=s("span"),y(qp.$$.fragment),$3=c(),Kb=s("span"),F3=o("TFBertForQuestionAnswering"),WT=c(),$t=s("div"),y(Cp.$$.fragment),x3=c(),Cs=s("p"),E3=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 `),Qb=s("code"),B3=o("span start logits"),M3=o(" and "),Vb=s("code"),z3=o("span end logits"),P3=o(")."),j3=c(),Ap=s("p"),q3=o("This model inherits from "),am=s("a"),C3=o("TFPreTrainedModel"),A3=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.)`),N3=c(),Np=s("p"),I3=o("This model is also a "),Ip=s("a"),O3=o("tf.keras.Model"),L3=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.`),D3=c(),y(Ma.$$.fragment),S3=c(),Rt=s("div"),y(Op.$$.fragment),U3=c(),As=s("p"),W3=o("The "),im=s("a"),H3=o("TFBertForQuestionAnswering"),R3=o(" forward method, overrides the "),Gb=s("code"),K3=o("__call__"),Q3=o(" special method."),V3=c(),y(za.$$.fragment),G3=c(),y(Pa.$$.fragment),J3=c(),y(ja.$$.fragment),HT=c(),Ns=s("h2"),qa=s("a"),Jb=s("span"),y(Lp.$$.fragment),X3=c(),Xb=s("span"),Y3=o("FlaxBertModel"),RT=c(),rt=s("div"),y(Dp.$$.fragment),Z3=c(),Yb=s("p"),eC=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),tC=c(),Sp=s("p"),oC=o("This model inherits from "),lm=s("a"),nC=o("FlaxPreTrainedModel"),sC=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)`),rC=c(),Up=s("p"),aC=o("This model is also a Flax Linen "),Wp=s("a"),iC=o("flax.linen.Module"),lC=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.`),dC=c(),Zb=s("p"),cC=o("Finally, this model supports inherent JAX features such as:"),pC=c(),Do=s("ul"),ev=s("li"),Hp=s("a"),hC=o("Just-In-Time (JIT) compilation"),fC=c(),tv=s("li"),Rp=s("a"),uC=o("Automatic Differentiation"),mC=c(),ov=s("li"),Kp=s("a"),gC=o("Vectorization"),_C=c(),nv=s("li"),Qp=s("a"),bC=o("Parallelization"),vC=c(),ko=s("div"),y(Vp.$$.fragment),kC=c(),Is=s("p"),yC=o("The "),sv=s("code"),TC=o("FlaxBertPreTrainedModel"),wC=o(" forward method, overrides the "),rv=s("code"),$C=o("__call__"),FC=o(" special method."),xC=c(),y(Ca.$$.fragment),EC=c(),y(Aa.$$.fragment),KT=c(),Os=s("h2"),Na=s("a"),av=s("span"),y(Gp.$$.fragment),BC=c(),iv=s("span"),MC=o("FlaxBertForPreTraining"),QT=c(),at=s("div"),y(Jp.$$.fragment),zC=c(),Ls=s("p"),PC=o("Bert Model with two heads on top as done during the pretraining: a "),lv=s("code"),jC=o("masked language modeling"),qC=o(" head and a "),dv=s("code"),CC=o("next sentence prediction (classification)"),AC=o(" head."),NC=c(),Xp=s("p"),IC=o("This model inherits from "),dm=s("a"),OC=o("FlaxPreTrainedModel"),LC=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)`),DC=c(),Yp=s("p"),SC=o("This model is also a Flax Linen "),Zp=s("a"),UC=o("flax.linen.Module"),WC=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.`),HC=c(),cv=s("p"),RC=o("Finally, this model supports inherent JAX features such as:"),KC=c(),So=s("ul"),pv=s("li"),eh=s("a"),QC=o("Just-In-Time (JIT) compilation"),VC=c(),hv=s("li"),th=s("a"),GC=o("Automatic Differentiation"),JC=c(),fv=s("li"),oh=s("a"),XC=o("Vectorization"),YC=c(),uv=s("li"),nh=s("a"),ZC=o("Parallelization"),e6=c(),yo=s("div"),y(sh.$$.fragment),t6=c(),Ds=s("p"),o6=o("The "),mv=s("code"),n6=o("FlaxBertPreTrainedModel"),s6=o(" forward method, overrides the "),gv=s("code"),r6=o("__call__"),a6=o(" special method."),i6=c(),y(Ia.$$.fragment),l6=c(),y(Oa.$$.fragment),VT=c(),Ss=s("h2"),La=s("a"),_v=s("span"),y(rh.$$.fragment),d6=c(),bv=s("span"),c6=o("FlaxBertForCausalLM"),GT=c(),it=s("div"),y(ah.$$.fragment),p6=c(),vv=s("p"),h6=o(`Bert Model with a language modeling head on top (a linear layer on top of the hidden-states output) e.g for
autoregressive tasks.`),f6=c(),ih=s("p"),u6=o("This model inherits from "),cm=s("a"),m6=o("FlaxPreTrainedModel"),g6=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)`),_6=c(),lh=s("p"),b6=o("This model is also a Flax Linen "),dh=s("a"),v6=o("flax.linen.Module"),k6=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.`),y6=c(),kv=s("p"),T6=o("Finally, this model supports inherent JAX features such as:"),w6=c(),Uo=s("ul"),yv=s("li"),ch=s("a"),$6=o("Just-In-Time (JIT) compilation"),F6=c(),Tv=s("li"),ph=s("a"),x6=o("Automatic Differentiation"),E6=c(),wv=s("li"),hh=s("a"),B6=o("Vectorization"),M6=c(),$v=s("li"),fh=s("a"),z6=o("Parallelization"),P6=c(),To=s("div"),y(uh.$$.fragment),j6=c(),Us=s("p"),q6=o("The "),Fv=s("code"),C6=o("FlaxBertPreTrainedModel"),A6=o(" forward method, overrides the "),xv=s("code"),N6=o("__call__"),I6=o(" special method."),O6=c(),y(Da.$$.fragment),L6=c(),y(Sa.$$.fragment),JT=c(),Ws=s("h2"),Ua=s("a"),Ev=s("span"),y(mh.$$.fragment),D6=c(),Bv=s("span"),S6=o("FlaxBertForMaskedLM"),XT=c(),lt=s("div"),y(gh.$$.fragment),U6=c(),_h=s("p"),W6=o("Bert Model with a "),Mv=s("code"),H6=o("language modeling"),R6=o(" head on top."),K6=c(),bh=s("p"),Q6=o("This model inherits from "),pm=s("a"),V6=o("FlaxPreTrainedModel"),G6=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)`),J6=c(),vh=s("p"),X6=o("This model is also a Flax Linen "),kh=s("a"),Y6=o("flax.linen.Module"),Z6=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.`),e5=c(),zv=s("p"),t5=o("Finally, this model supports inherent JAX features such as:"),o5=c(),Wo=s("ul"),Pv=s("li"),yh=s("a"),n5=o("Just-In-Time (JIT) compilation"),s5=c(),jv=s("li"),Th=s("a"),r5=o("Automatic Differentiation"),a5=c(),qv=s("li"),wh=s("a"),i5=o("Vectorization"),l5=c(),Cv=s("li"),$h=s("a"),d5=o("Parallelization"),c5=c(),wo=s("div"),y(Fh.$$.fragment),p5=c(),Hs=s("p"),h5=o("The "),Av=s("code"),f5=o("FlaxBertPreTrainedModel"),u5=o(" forward method, overrides the "),Nv=s("code"),m5=o("__call__"),g5=o(" special method."),_5=c(),y(Wa.$$.fragment),b5=c(),y(Ha.$$.fragment),YT=c(),Rs=s("h2"),Ra=s("a"),Iv=s("span"),y(xh.$$.fragment),v5=c(),Ov=s("span"),k5=o("FlaxBertForNextSentencePrediction"),ZT=c(),dt=s("div"),y(Eh.$$.fragment),y5=c(),Bh=s("p"),T5=o("Bert Model with a "),Lv=s("code"),w5=o("next sentence prediction (classification)"),$5=o(" head on top."),F5=c(),Mh=s("p"),x5=o("This model inherits from "),hm=s("a"),E5=o("FlaxPreTrainedModel"),B5=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),M5=c(),zh=s("p"),z5=o("This model is also a Flax Linen "),Ph=s("a"),P5=o("flax.linen.Module"),j5=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.`),q5=c(),Dv=s("p"),C5=o("Finally, this model supports inherent JAX features such as:"),A5=c(),Ho=s("ul"),Sv=s("li"),jh=s("a"),N5=o("Just-In-Time (JIT) compilation"),I5=c(),Uv=s("li"),qh=s("a"),O5=o("Automatic Differentiation"),L5=c(),Wv=s("li"),Ch=s("a"),D5=o("Vectorization"),S5=c(),Hv=s("li"),Ah=s("a"),U5=o("Parallelization"),W5=c(),$o=s("div"),y(Nh.$$.fragment),H5=c(),Ks=s("p"),R5=o("The "),Rv=s("code"),K5=o("FlaxBertPreTrainedModel"),Q5=o(" forward method, overrides the "),Kv=s("code"),V5=o("__call__"),G5=o(" special method."),J5=c(),y(Ka.$$.fragment),X5=c(),y(Qa.$$.fragment),e1=c(),Qs=s("h2"),Va=s("a"),Qv=s("span"),y(Ih.$$.fragment),Y5=c(),Vv=s("span"),Z5=o("FlaxBertForSequenceClassification"),t1=c(),ct=s("div"),y(Oh.$$.fragment),eA=c(),Gv=s("p"),tA=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.`),oA=c(),Lh=s("p"),nA=o("This model inherits from "),fm=s("a"),sA=o("FlaxPreTrainedModel"),rA=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)`),aA=c(),Dh=s("p"),iA=o("This model is also a Flax Linen "),Sh=s("a"),lA=o("flax.linen.Module"),dA=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.`),cA=c(),Jv=s("p"),pA=o("Finally, this model supports inherent JAX features such as:"),hA=c(),Ro=s("ul"),Xv=s("li"),Uh=s("a"),fA=o("Just-In-Time (JIT) compilation"),uA=c(),Yv=s("li"),Wh=s("a"),mA=o("Automatic Differentiation"),gA=c(),Zv=s("li"),Hh=s("a"),_A=o("Vectorization"),bA=c(),ek=s("li"),Rh=s("a"),vA=o("Parallelization"),kA=c(),Fo=s("div"),y(Kh.$$.fragment),yA=c(),Vs=s("p"),TA=o("The "),tk=s("code"),wA=o("FlaxBertPreTrainedModel"),$A=o(" forward method, overrides the "),ok=s("code"),FA=o("__call__"),xA=o(" special method."),EA=c(),y(Ga.$$.fragment),BA=c(),y(Ja.$$.fragment),o1=c(),Gs=s("h2"),Xa=s("a"),nk=s("span"),y(Qh.$$.fragment),MA=c(),sk=s("span"),zA=o("FlaxBertForMultipleChoice"),n1=c(),pt=s("div"),y(Vh.$$.fragment),PA=c(),rk=s("p"),jA=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.`),qA=c(),Gh=s("p"),CA=o("This model inherits from "),um=s("a"),AA=o("FlaxPreTrainedModel"),NA=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),IA=c(),Jh=s("p"),OA=o("This model is also a Flax Linen "),Xh=s("a"),LA=o("flax.linen.Module"),DA=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.`),SA=c(),ak=s("p"),UA=o("Finally, this model supports inherent JAX features such as:"),WA=c(),Ko=s("ul"),ik=s("li"),Yh=s("a"),HA=o("Just-In-Time (JIT) compilation"),RA=c(),lk=s("li"),Zh=s("a"),KA=o("Automatic Differentiation"),QA=c(),dk=s("li"),ef=s("a"),VA=o("Vectorization"),GA=c(),ck=s("li"),tf=s("a"),JA=o("Parallelization"),XA=c(),xo=s("div"),y(of.$$.fragment),YA=c(),Js=s("p"),ZA=o("The "),pk=s("code"),e7=o("FlaxBertPreTrainedModel"),t7=o(" forward method, overrides the "),hk=s("code"),o7=o("__call__"),n7=o(" special method."),s7=c(),y(Ya.$$.fragment),r7=c(),y(Za.$$.fragment),s1=c(),Xs=s("h2"),ei=s("a"),fk=s("span"),y(nf.$$.fragment),a7=c(),uk=s("span"),i7=o("FlaxBertForTokenClassification"),r1=c(),ht=s("div"),y(sf.$$.fragment),l7=c(),mk=s("p"),d7=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.`),c7=c(),rf=s("p"),p7=o("This model inherits from "),mm=s("a"),h7=o("FlaxPreTrainedModel"),f7=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),u7=c(),af=s("p"),m7=o("This model is also a Flax Linen "),lf=s("a"),g7=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.`),b7=c(),gk=s("p"),v7=o("Finally, this model supports inherent JAX features such as:"),k7=c(),Qo=s("ul"),_k=s("li"),df=s("a"),y7=o("Just-In-Time (JIT) compilation"),T7=c(),bk=s("li"),cf=s("a"),w7=o("Automatic Differentiation"),$7=c(),vk=s("li"),pf=s("a"),F7=o("Vectorization"),x7=c(),kk=s("li"),hf=s("a"),E7=o("Parallelization"),B7=c(),Eo=s("div"),y(ff.$$.fragment),M7=c(),Ys=s("p"),z7=o("The "),yk=s("code"),P7=o("FlaxBertPreTrainedModel"),j7=o(" forward method, overrides the "),Tk=s("code"),q7=o("__call__"),C7=o(" special method."),A7=c(),y(ti.$$.fragment),N7=c(),y(oi.$$.fragment),a1=c(),Zs=s("h2"),ni=s("a"),wk=s("span"),y(uf.$$.fragment),I7=c(),$k=s("span"),O7=o("FlaxBertForQuestionAnswering"),i1=c(),ft=s("div"),y(mf.$$.fragment),L7=c(),er=s("p"),D7=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 `),Fk=s("code"),S7=o("span start logits"),U7=o(" and "),xk=s("code"),W7=o("span end logits"),H7=o(")."),R7=c(),gf=s("p"),K7=o("This model inherits from "),gm=s("a"),Q7=o("FlaxPreTrainedModel"),V7=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)`),G7=c(),_f=s("p"),J7=o("This model is also a Flax Linen "),bf=s("a"),X7=o("flax.linen.Module"),Y7=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.`),Z7=c(),Ek=s("p"),e8=o("Finally, this model supports inherent JAX features such as:"),t8=c(),Vo=s("ul"),Bk=s("li"),vf=s("a"),o8=o("Just-In-Time (JIT) compilation"),n8=c(),Mk=s("li"),kf=s("a"),s8=o("Automatic Differentiation"),r8=c(),zk=s("li"),yf=s("a"),a8=o("Vectorization"),i8=c(),Pk=s("li"),Tf=s("a"),l8=o("Parallelization"),d8=c(),Bo=s("div"),y(wf.$$.fragment),c8=c(),tr=s("p"),p8=o("The "),jk=s("code"),h8=o("FlaxBertPreTrainedModel"),f8=o(" forward method, overrides the "),qk=s("code"),u8=o("__call__"),m8=o(" special method."),g8=c(),y(si.$$.fragment),_8=c(),y(ri.$$.fragment),this.h()},l(i){const _=OW('[data-svelte="svelte-1phssyn"]',document.head);d=r(_,"META",{name:!0,content:!0}),_.forEach(t),v=p(i),u=r(i,"H1",{class:!0});var $f=a(u);m=r($f,"A",{id:!0,class:!0,href:!0});var Ck=a(m);b=r(Ck,"SPAN",{});var Ak=a(b);T(l.$$.fragment,Ak),Ak.forEach(t),Ck.forEach(t),f=p($f),M=r($f,"SPAN",{});var Nk=a(M);Me=n(Nk,"BERT"),Nk.forEach(t),$f.forEach(t),we=p(i),S=r(i,"DIV",{class:!0});var Ff=a(S);he=r(Ff,"A",{href:!0});var Ik=a(he);ee=r(Ik,"IMG",{alt:!0,src:!0}),Ik.forEach(t),ze=p(Ff),W=r(Ff,"A",{href:!0});var Ok=a(W);fe=r(Ok,"IMG",{alt:!0,src:!0}),Ok.forEach(t),Ff.forEach(t),V=p(i),ie=r(i,"H2",{class:!0});var xf=a(ie);le=r(xf,"A",{id:!0,class:!0,href:!0});var Lk=a(le);H=r(Lk,"SPAN",{});var Dk=a(H);T(de.$$.fragment,Dk),Dk.forEach(t),Lk.forEach(t),Pe=p(xf),R=r(xf,"SPAN",{});var Sk=a(R);je=n(Sk,"Overview"),Sk.forEach(t),xf.forEach(t),$e=p(i),U=r(i,"P",{});var Ef=a(U);qe=n(Ef,"The BERT model was proposed in "),ce=r(Ef,"A",{href:!0,rel:!0});var Uk=a(ce);re=n(Uk,"BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding"),Uk.forEach(t),j=n(Ef,` 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.`),Ef.forEach(t),A=p(i),ue=r(i,"P",{});var Wk=a(ue);G=n(Wk,"The abstract from the paper is the following:"),Wk.forEach(t),Fe=p(i),me=r(i,"P",{});var Hk=a(me);K=r(Hk,"EM",{});var Rk=a(K);Ce=n(Rk,`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.`),Rk.forEach(t),Hk.forEach(t),xe=p(i),q=r(i,"P",{});var Kk=a(q);_e=r(Kk,"EM",{});var Qk=a(_e);J=n(Qk,`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).`),Qk.forEach(t),Kk.forEach(t),Ee=p(i),ge=r(i,"P",{});var Vk=a(ge);X=n(Vk,"Tips:"),Vk.forEach(t),Be=p(i),se=r(i,"UL",{});var Go=a(se);O=r(Go,"LI",{});var Gk=a(O);be=r(Gk,"P",{});var Jk=a(be);Y=n(Jk,`BERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),Jk.forEach(t),Gk.forEach(t),Ae=p(Go),te=r(Go,"LI",{});var Xk=a(te);C=r(Xk,"P",{});var Yk=a(C);Ne=n(Yk,`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.`),Yk.forEach(t),Xk.forEach(t),I=p(Go),pe=r(Go,"LI",{});var Bf=a(pe);ve=r(Bf,"P",{});var Zk=a(ve);k=n(Zk,"Corrupts the inputs by using random masking, more precisely, during pretraining, a given percentage of tokens (usually 15%) is masked by:"),Zk.forEach(t),z=p(Bf),Se=r(Bf,"UL",{});var or=a(Se);oe=r(or,"LI",{});var ey=a(oe);Re=n(ey,"a special mask token with probability 0.8"),ey.forEach(t),Ke=p(or),P=r(or,"LI",{});var ty=a(P);Qe=n(ty,"a random token different from the one masked with probability 0.1"),ty.forEach(t),Ve=p(or),We=r(or,"LI",{});var oy=a(We);Ge=n(oy,"the same token with probability 0.1"),oy.forEach(t),or.forEach(t),Bf.forEach(t),Je=p(Go),L=r(Go,"LI",{});var ny=a(L);Q=r(ny,"P",{});var sy=a(Q);Xe=n(sy,"The model must predict the original sentence, but has a second objective: inputs are two sentences A and B (with a separation token in between). With probability 50%, the sentences are consecutive in the corpus, in the remaining 50% they are not related. The model has to predict if the sentences are consecutive or not."),sy.forEach(t),ny.forEach(t),Go.forEach(t),He=p(i),D=r(i,"P",{});var nr=a(D);Ye=n(nr,"This model was contributed by "),Ue=r(nr,"A",{href:!0,rel:!0});var ry=a(Ue);Ie=n(ry,"thomwolf"),ry.forEach(t),Ze=n(nr,". The original code can be found "),Z=r(nr,"A",{href:!0,rel:!0});var ay=a(Z);et=n(ay,"here"),ay.forEach(t),w2=n(nr,"."),nr.forEach(t),jy=p(i),Nn=r(i,"H2",{class:!0});var Mf=a(Nn);rr=r(Mf,"A",{id:!0,class:!0,href:!0});var iy=a(rr);ag=r(iy,"SPAN",{});var ly=a(ag);T(Di.$$.fragment,ly),ly.forEach(t),iy.forEach(t),$2=p(Mf),ig=r(Mf,"SPAN",{});var dy=a(ig);F2=n(dy,"Resources"),dy.forEach(t),Mf.forEach(t),qy=p(i),Wf=r(i,"P",{});var cy=a(Wf);x2=n(cy,"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."),cy.forEach(t),Cy=p(i),T(Si.$$.fragment,i),Ay=p(i),tt=r(i,"UL",{});var ut=a(tt);Ui=r(ut,"LI",{});var zf=a(Ui);E2=n(zf,"A blog post on "),Wi=r(zf,"A",{href:!0,rel:!0});var py=a(Wi);B2=n(py,"BERT Text Classification in a different language"),py.forEach(t),M2=n(zf,"."),zf.forEach(t),z2=p(ut),Hi=r(ut,"LI",{});var Pf=a(Hi);P2=n(Pf,"A notebook for "),Ri=r(Pf,"A",{href:!0,rel:!0});var hy=a(Ri);j2=n(hy,"Finetuning BERT (and friends) for multi-label text classification"),hy.forEach(t),q2=n(Pf,"."),Pf.forEach(t),C2=p(ut),Ki=r(ut,"LI",{});var jf=a(Ki);A2=n(jf,"A notebook on how to "),Qi=r(jf,"A",{href:!0,rel:!0});var fy=a(Qi);N2=n(fy,"Finetune BERT for multi-label classification using PyTorch"),fy.forEach(t),I2=n(jf,". \u{1F30E}"),jf.forEach(t),O2=p(ut),Vi=r(ut,"LI",{});var qf=a(Vi);L2=n(qf,"A notebook on how to "),Gi=r(qf,"A",{href:!0,rel:!0});var uy=a(Gi);D2=n(uy,"warm-start an EncoderDecoder model with BERT for summarization"),uy.forEach(t),S2=n(qf,"."),qf.forEach(t),U2=p(ut),Jo=r(ut,"LI",{});var un=a(Jo);Hf=r(un,"A",{href:!0});var my=a(Hf);W2=n(my,"BertForSequenceClassification"),my.forEach(t),H2=n(un," is supported by this "),Ji=r(un,"A",{href:!0,rel:!0});var gy=a(Ji);R2=n(gy,"example script"),gy.forEach(t),K2=n(un," and "),Xi=r(un,"A",{href:!0,rel:!0});var _y=a(Xi);Q2=n(_y,"notebook"),_y.forEach(t),V2=n(un,"."),un.forEach(t),G2=p(ut),Xo=r(ut,"LI",{});var mn=a(Xo);Rf=r(mn,"A",{href:!0});var by=a(Rf);J2=n(by,"TFBertForSequenceClassification"),by.forEach(t),X2=n(mn," is supported by this "),Yi=r(mn,"A",{href:!0,rel:!0});var vy=a(Yi);Y2=n(vy,"example script"),vy.forEach(t),Z2=n(mn," and "),Zi=r(mn,"A",{href:!0,rel:!0});var ky=a(Zi);e0=n(ky,"notebook"),ky.forEach(t),t0=n(mn,"."),mn.forEach(t),o0=p(ut),Yo=r(ut,"LI",{});var gn=a(Yo);Kf=r(gn,"A",{href:!0});var yy=a(Kf);n0=n(yy,"FlaxBertForSequenceClassification"),yy.forEach(t),s0=n(gn," is supported by this "),el=r(gn,"A",{href:!0,rel:!0});var Ty=a(el);r0=n(Ty,"example script"),Ty.forEach(t),a0=n(gn," and "),tl=r(gn,"A",{href:!0,rel:!0});var wy=a(tl);i0=n(wy,"notebook"),wy.forEach(t),l0=n(gn,"."),gn.forEach(t),d0=p(ut),lg=r(ut,"LI",{});var $y=a(lg);Qf=r($y,"A",{href:!0});var Fy=a(Qf);c0=n(Fy,"Text classification task guide"),Fy.forEach(t),$y.forEach(t),ut.forEach(t),Ny=p(i),T(ol.$$.fragment,i),Iy=p(i),mt=r(i,"UL",{});var Ft=a(mt);nl=r(Ft,"LI",{});var Cf=a(nl);p0=n(Cf,"A blog post on how to use "),sl=r(Cf,"A",{href:!0,rel:!0});var xy=a(sl);h0=n(xy,"Hugging Face Transformers with Keras: Fine-tune a non-English BERT for Named Entity Recognition"),xy.forEach(t),f0=n(Cf,"."),Cf.forEach(t),u0=p(Ft),In=r(Ft,"LI",{});var sr=a(In);m0=n(sr,"A notebook for "),rl=r(sr,"A",{href:!0,rel:!0});var Ey=a(rl);g0=n(Ey,"Finetuning BERT for named-entity recognition"),Ey.forEach(t),_0=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 "),al=r(sr,"A",{href:!0,rel:!0});var By=a(al);b0=n(By,"version"),By.forEach(t),v0=n(sr," of the notebook instead."),sr.forEach(t),k0=p(Ft),Zo=r(Ft,"LI",{});var _n=a(Zo);Vf=r(_n,"A",{href:!0});var My=a(Vf);y0=n(My,"BertForTokenClassification"),My.forEach(t),T0=n(_n," is supported by this "),il=r(_n,"A",{href:!0,rel:!0});var B8=a(il);w0=n(B8,"example script"),B8.forEach(t),$0=n(_n," and "),ll=r(_n,"A",{href:!0,rel:!0});var M8=a(ll);F0=n(M8,"notebook"),M8.forEach(t),x0=n(_n,"."),_n.forEach(t),E0=p(Ft),en=r(Ft,"LI",{});var Af=a(en);Gf=r(Af,"A",{href:!0});var z8=a(Gf);B0=n(z8,"TFBertForTokenClassification"),z8.forEach(t),M0=n(Af," is supported by this "),dl=r(Af,"A",{href:!0,rel:!0});var P8=a(dl);z0=n(P8,"example script"),P8.forEach(t),P0=n(Af," and "),cl=r(Af,"A",{href:!0,rel:!0});var j8=a(cl);j0=n(j8,"notebook"),j8.forEach(t),q0=n(Af,"."),Af.forEach(t),C0=p(Ft),ar=r(Ft,"LI",{});var zy=a(ar);Jf=r(zy,"A",{href:!0});var q8=a(Jf);A0=n(q8,"FlaxBertForTokenClassification"),q8.forEach(t),N0=n(zy," is supported by this "),pl=r(zy,"A",{href:!0,rel:!0});var C8=a(pl);I0=n(C8,"example script"),C8.forEach(t),O0=n(zy,"."),zy.forEach(t),L0=p(Ft),Xf=r(Ft,"LI",{});var b8=a(Xf);hl=r(b8,"A",{href:!0,rel:!0});var A8=a(hl);D0=n(A8,"Token classification"),A8.forEach(t),S0=n(b8," chapter of the \u{1F917} Hugging Face Course."),b8.forEach(t),U0=p(Ft),dg=r(Ft,"LI",{});var N8=a(dg);Yf=r(N8,"A",{href:!0});var I8=a(Yf);W0=n(I8,"Token classification task guide"),I8.forEach(t),N8.forEach(t),Ft.forEach(t),Oy=p(i),T(fl.$$.fragment,i),Ly=p(i),Ot=r(i,"UL",{});var bn=a(Ot);tn=r(bn,"LI",{});var Nf=a(tn);Zf=r(Nf,"A",{href:!0});var O8=a(Zf);H0=n(O8,"BertForMaskedLM"),O8.forEach(t),R0=n(Nf," is supported by this "),ul=r(Nf,"A",{href:!0,rel:!0});var L8=a(ul);K0=n(L8,"example script"),L8.forEach(t),Q0=n(Nf," and "),ml=r(Nf,"A",{href:!0,rel:!0});var D8=a(ml);V0=n(D8,"notebook"),D8.forEach(t),G0=n(Nf,"."),Nf.forEach(t),J0=p(bn),on=r(bn,"LI",{});var If=a(on);eu=r(If,"A",{href:!0});var S8=a(eu);X0=n(S8,"TFBertForMaskedLM"),S8.forEach(t),Y0=n(If," is supported by this "),gl=r(If,"A",{href:!0,rel:!0});var U8=a(gl);Z0=n(U8,"example script"),U8.forEach(t),e$=n(If," and "),_l=r(If,"A",{href:!0,rel:!0});var W8=a(_l);t$=n(W8,"notebook"),W8.forEach(t),o$=n(If,"."),If.forEach(t),n$=p(bn),nn=r(bn,"LI",{});var Of=a(nn);tu=r(Of,"A",{href:!0});var H8=a(tu);s$=n(H8,"FlaxBertForMaskedLM"),H8.forEach(t),r$=n(Of," is supported by this "),bl=r(Of,"A",{href:!0,rel:!0});var R8=a(bl);a$=n(R8,"example script"),R8.forEach(t),i$=n(Of," and "),vl=r(Of,"A",{href:!0,rel:!0});var K8=a(vl);l$=n(K8,"notebook"),K8.forEach(t),d$=n(Of,"."),Of.forEach(t),c$=p(bn),ou=r(bn,"LI",{});var v8=a(ou);kl=r(v8,"A",{href:!0,rel:!0});var Q8=a(kl);p$=n(Q8,"Masked language modeling"),Q8.forEach(t),h$=n(v8," chapter of the \u{1F917} Hugging Face Course."),v8.forEach(t),f$=p(bn),cg=r(bn,"LI",{});var V8=a(cg);nu=r(V8,"A",{href:!0});var G8=a(nu);u$=n(G8,"Masked language modeling task guide"),G8.forEach(t),V8.forEach(t),bn.forEach(t),Dy=p(i),T(yl.$$.fragment,i),Sy=p(i),Lt=r(i,"UL",{});var vn=a(Lt);sn=r(vn,"LI",{});var Lf=a(sn);su=r(Lf,"A",{href:!0});var J8=a(su);m$=n(J8,"BertForQuestionAnswering"),J8.forEach(t),g$=n(Lf," is supported by this "),Tl=r(Lf,"A",{href:!0,rel:!0});var X8=a(Tl);_$=n(X8,"example script"),X8.forEach(t),b$=n(Lf," and "),wl=r(Lf,"A",{href:!0,rel:!0});var Y8=a(wl);v$=n(Y8,"notebook"),Y8.forEach(t),k$=n(Lf,"."),Lf.forEach(t),y$=p(vn),rn=r(vn,"LI",{});var Df=a(rn);ru=r(Df,"A",{href:!0});var Z8=a(ru);T$=n(Z8,"TFBertForQuestionAnswering"),Z8.forEach(t),w$=n(Df," is supported by this "),$l=r(Df,"A",{href:!0,rel:!0});var eN=a($l);$$=n(eN,"example script"),eN.forEach(t),F$=n(Df," and "),Fl=r(Df,"A",{href:!0,rel:!0});var tN=a(Fl);x$=n(tN,"notebook"),tN.forEach(t),E$=n(Df,"."),Df.forEach(t),B$=p(vn),ir=r(vn,"LI",{});var Py=a(ir);au=r(Py,"A",{href:!0});var oN=a(au);M$=n(oN,"FlaxBertForQuestionAnswering"),oN.forEach(t),z$=n(Py," is supported by this "),xl=r(Py,"A",{href:!0,rel:!0});var nN=a(xl);P$=n(nN,"example script"),nN.forEach(t),j$=n(Py,"."),Py.forEach(t),q$=p(vn),iu=r(vn,"LI",{});var k8=a(iu);El=r(k8,"A",{href:!0,rel:!0});var sN=a(El);C$=n(sN,"Question answering"),sN.forEach(t),A$=n(k8," chapter of the \u{1F917} Hugging Face Course."),k8.forEach(t),N$=p(vn),pg=r(vn,"LI",{});var rN=a(pg);lu=r(rN,"A",{href:!0});var aN=a(lu);I$=n(aN,"Question answering task guide"),aN.forEach(t),rN.forEach(t),vn.forEach(t),Uy=p(i),du=r(i,"P",{});var iN=a(du);hg=r(iN,"STRONG",{});var lN=a(hg);O$=n(lN,"Multiple choice"),lN.forEach(t),iN.forEach(t),Wy=p(i),an=r(i,"UL",{});var _m=a(an);ln=r(_m,"LI",{});var Sf=a(ln);cu=r(Sf,"A",{href:!0});var dN=a(cu);L$=n(dN,"BertForMultipleChoice"),dN.forEach(t),D$=n(Sf," is supported by this "),Bl=r(Sf,"A",{href:!0,rel:!0});var cN=a(Bl);S$=n(cN,"example script"),cN.forEach(t),U$=n(Sf," and "),Ml=r(Sf,"A",{href:!0,rel:!0});var pN=a(Ml);W$=n(pN,"notebook"),pN.forEach(t),H$=n(Sf,"."),Sf.forEach(t),R$=p(_m),dn=r(_m,"LI",{});var Uf=a(dn);pu=r(Uf,"A",{href:!0});var hN=a(pu);K$=n(hN,"TFBertForMultipleChoice"),hN.forEach(t),Q$=n(Uf," is supported by this "),zl=r(Uf,"A",{href:!0,rel:!0});var fN=a(zl);V$=n(fN,"example script"),fN.forEach(t),G$=n(Uf," and "),Pl=r(Uf,"A",{href:!0,rel:!0});var uN=a(Pl);J$=n(uN,"notebook"),uN.forEach(t),X$=n(Uf,"."),Uf.forEach(t),Y$=p(_m),fg=r(_m,"LI",{});var mN=a(fg);hu=r(mN,"A",{href:!0});var gN=a(hu);Z$=n(gN,"Multiple choice task guide"),gN.forEach(t),mN.forEach(t),_m.forEach(t),Hy=p(i),jl=r(i,"P",{});var y8=a(jl);eF=n(y8,"\u26A1\uFE0F "),ug=r(y8,"STRONG",{});var _N=a(ug);tF=n(_N,"Inference"),_N.forEach(t),y8.forEach(t),Ry=p(i),lr=r(i,"UL",{});var d1=a(lr);ql=r(d1,"LI",{});var c1=a(ql);oF=n(c1,"A blog post on how to "),Cl=r(c1,"A",{href:!0,rel:!0});var bN=a(Cl);nF=n(bN,"Accelerate BERT inference with Hugging Face Transformers and AWS Inferentia"),bN.forEach(t),sF=n(c1,"."),c1.forEach(t),rF=p(d1),Al=r(d1,"LI",{});var p1=a(Al);aF=n(p1,"A blog post on how to "),Nl=r(p1,"A",{href:!0,rel:!0});var vN=a(Nl);iF=n(vN,"Accelerate BERT inference with DeepSpeed-Inference on GPUs"),vN.forEach(t),lF=n(p1,"."),p1.forEach(t),d1.forEach(t),Ky=p(i),Il=r(i,"P",{});var T8=a(Il);dF=n(T8,"\u2699\uFE0F "),mg=r(T8,"STRONG",{});var kN=a(mg);cF=n(kN,"Pretraining"),kN.forEach(t),T8.forEach(t),Qy=p(i),fu=r(i,"UL",{});var yN=a(fu);Ol=r(yN,"LI",{});var h1=a(Ol);pF=n(h1,"A blog post on "),Ll=r(h1,"A",{href:!0,rel:!0});var TN=a(Ll);hF=n(TN,"Pre-Training BERT with Hugging Face Transformers and Habana Gaudi"),TN.forEach(t),fF=n(h1,"."),h1.forEach(t),yN.forEach(t),Vy=p(i),Dl=r(i,"P",{});var w8=a(Dl);uF=n(w8,"\u{1F680} "),gg=r(w8,"STRONG",{});var wN=a(gg);mF=n(wN,"Deploy"),wN.forEach(t),w8.forEach(t),Gy=p(i),xt=r(i,"UL",{});var Mo=a(xt);Sl=r(Mo,"LI",{});var f1=a(Sl);gF=n(f1,"A blog post on how to "),Ul=r(f1,"A",{href:!0,rel:!0});var $N=a(Ul);_F=n($N,"Convert Transformers to ONNX with Hugging Face Optimum"),$N.forEach(t),bF=n(f1,"."),f1.forEach(t),vF=p(Mo),Wl=r(Mo,"LI",{});var u1=a(Wl);kF=n(u1,"A blog post on how to "),Hl=r(u1,"A",{href:!0,rel:!0});var FN=a(Hl);yF=n(FN,"Setup Deep Learning environment for Hugging Face Transformers with Habana Gaudi on AWS"),FN.forEach(t),TF=n(u1,"."),u1.forEach(t),wF=p(Mo),Rl=r(Mo,"LI",{});var m1=a(Rl);$F=n(m1,"A blog post on "),Kl=r(m1,"A",{href:!0,rel:!0});var xN=a(Kl);FF=n(xN,"Autoscaling BERT with Hugging Face Transformers, Amazon SageMaker and Terraform module"),xN.forEach(t),xF=n(m1,"."),m1.forEach(t),EF=p(Mo),Ql=r(Mo,"LI",{});var g1=a(Ql);BF=n(g1,"A blog post on "),Vl=r(g1,"A",{href:!0,rel:!0});var EN=a(Vl);MF=n(EN,"Serverless BERT with HuggingFace, AWS Lambda, and Docker"),EN.forEach(t),zF=n(g1,"."),g1.forEach(t),PF=p(Mo),Gl=r(Mo,"LI",{});var _1=a(Gl);jF=n(_1,"A blog post on "),Jl=r(_1,"A",{href:!0,rel:!0});var BN=a(Jl);qF=n(BN,"Hugging Face Transformers BERT fine-tuning using Amazon SageMaker and Training Compiler"),BN.forEach(t),CF=n(_1,"."),_1.forEach(t),AF=p(Mo),Xl=r(Mo,"LI",{});var b1=a(Xl);NF=n(b1,"A blog post on "),Yl=r(b1,"A",{href:!0,rel:!0});var MN=a(Yl);IF=n(MN,"Task-specific knowledge distillation for BERT using Transformers & Amazon SageMaker"),MN.forEach(t),OF=n(b1,"."),b1.forEach(t),Mo.forEach(t),Jy=p(i),On=r(i,"H2",{class:!0});var v1=a(On);dr=r(v1,"A",{id:!0,class:!0,href:!0});var zN=a(dr);_g=r(zN,"SPAN",{});var PN=a(_g);T(Zl.$$.fragment,PN),PN.forEach(t),zN.forEach(t),LF=p(v1),bg=r(v1,"SPAN",{});var jN=a(bg);DF=n(jN,"BertConfig"),jN.forEach(t),v1.forEach(t),Xy=p(i),so=r(i,"DIV",{class:!0});var ai=a(so);T(ed.$$.fragment,ai),SF=p(ai),Oo=r(ai,"P",{});var ii=a(Oo);UF=n(ii,"This is the configuration class to store the configuration of a "),uu=r(ii,"A",{href:!0});var qN=a(uu);WF=n(qN,"BertModel"),qN.forEach(t),HF=n(ii," or a "),mu=r(ii,"A",{href:!0});var CN=a(mu);RF=n(CN,"TFBertModel"),CN.forEach(t),KF=n(ii,`. 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
`),td=r(ii,"A",{href:!0,rel:!0});var AN=a(td);QF=n(AN,"bert-base-uncased"),AN.forEach(t),VF=n(ii," architecture."),ii.forEach(t),GF=p(ai),Ln=r(ai,"P",{});var bm=a(Ln);JF=n(bm,"Configuration objects inherit from "),gu=r(bm,"A",{href:!0});var NN=a(gu);XF=n(NN,"PretrainedConfig"),NN.forEach(t),YF=n(bm,` and can be used to control the model outputs. Read the
documentation from `),_u=r(bm,"A",{href:!0});var IN=a(_u);ZF=n(IN,"PretrainedConfig"),IN.forEach(t),ex=n(bm," for more information."),bm.forEach(t),tx=p(ai),T(cr.$$.fragment,ai),ai.forEach(t),Yy=p(i),Dn=r(i,"H2",{class:!0});var k1=a(Dn);pr=r(k1,"A",{id:!0,class:!0,href:!0});var ON=a(pr);vg=r(ON,"SPAN",{});var LN=a(vg);T(od.$$.fragment,LN),LN.forEach(t),ON.forEach(t),ox=p(k1),kg=r(k1,"SPAN",{});var DN=a(kg);nx=n(DN,"BertTokenizer"),DN.forEach(t),k1.forEach(t),Zy=p(i),ot=r(i,"DIV",{class:!0});var Kt=a(ot);T(nd.$$.fragment,Kt),sx=p(Kt),yg=r(Kt,"P",{});var SN=a(yg);rx=n(SN,"Construct a BERT tokenizer. Based on WordPiece."),SN.forEach(t),ax=p(Kt),sd=r(Kt,"P",{});var y1=a(sd);ix=n(y1,"This tokenizer inherits from "),bu=r(y1,"A",{href:!0});var UN=a(bu);lx=n(UN,"PreTrainedTokenizer"),UN.forEach(t),dx=n(y1,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),y1.forEach(t),cx=p(Kt),cn=r(Kt,"DIV",{class:!0});var vm=a(cn);T(rd.$$.fragment,vm),px=p(vm),Tg=r(vm,"P",{});var WN=a(Tg);hx=n(WN,`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:`),WN.forEach(t),fx=p(vm),ad=r(vm,"UL",{});var T1=a(ad);vu=r(T1,"LI",{});var $8=a(vu);ux=n($8,"single sequence: "),wg=r($8,"CODE",{});var HN=a(wg);mx=n(HN,"[CLS] X [SEP]"),HN.forEach(t),$8.forEach(t),gx=p(T1),ku=r(T1,"LI",{});var F8=a(ku);_x=n(F8,"pair of sequences: "),$g=r(F8,"CODE",{});var RN=a($g);bx=n(RN,"[CLS] A [SEP] B [SEP]"),RN.forEach(t),F8.forEach(t),T1.forEach(t),vm.forEach(t),vx=p(Kt),hr=r(Kt,"DIV",{class:!0});var w1=a(hr);T(id.$$.fragment,w1),kx=p(w1),ld=r(w1,"P",{});var $1=a(ld);yx=n($1,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Fg=r($1,"CODE",{});var KN=a(Fg);Tx=n(KN,"prepare_for_model"),KN.forEach(t),wx=n($1," method."),$1.forEach(t),w1.forEach(t),$x=p(Kt),ro=r(Kt,"DIV",{class:!0});var li=a(ro);T(dd.$$.fragment,li),Fx=p(li),xg=r(li,"P",{});var QN=a(xg);xx=n(QN,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),QN.forEach(t),Ex=p(li),T(fr.$$.fragment,li),Bx=p(li),Sn=r(li,"P",{});var km=a(Sn);Mx=n(km,"If "),Eg=r(km,"CODE",{});var VN=a(Eg);zx=n(VN,"token_ids_1"),VN.forEach(t),Px=n(km," is "),Bg=r(km,"CODE",{});var GN=a(Bg);jx=n(GN,"None"),GN.forEach(t),qx=n(km,", this method only returns the first portion of the mask (0s)."),km.forEach(t),li.forEach(t),Cx=p(Kt),yu=r(Kt,"DIV",{class:!0});var JN=a(yu);T(cd.$$.fragment,JN),JN.forEach(t),Kt.forEach(t),eT=p(i),Un=r(i,"H2",{class:!0});var F1=a(Un);ur=r(F1,"A",{id:!0,class:!0,href:!0});var XN=a(ur);Mg=r(XN,"SPAN",{});var YN=a(Mg);T(pd.$$.fragment,YN),YN.forEach(t),XN.forEach(t),Ax=p(F1),zg=r(F1,"SPAN",{});var ZN=a(zg);Nx=n(ZN,"BertTokenizerFast"),ZN.forEach(t),F1.forEach(t),tT=p(i),Bt=r(i,"DIV",{class:!0});var kn=a(Bt);T(hd.$$.fragment,kn),Ix=p(kn),fd=r(kn,"P",{});var x1=a(fd);Ox=n(x1,"Construct a \u201Cfast\u201D BERT tokenizer (backed by HuggingFace\u2019s "),Pg=r(x1,"EM",{});var eI=a(Pg);Lx=n(eI,"tokenizers"),eI.forEach(t),Dx=n(x1," library). Based on WordPiece."),x1.forEach(t),Sx=p(kn),ud=r(kn,"P",{});var E1=a(ud);Ux=n(E1,"This tokenizer inherits from "),Tu=r(E1,"A",{href:!0});var tI=a(Tu);Wx=n(tI,"PreTrainedTokenizerFast"),tI.forEach(t),Hx=n(E1,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),E1.forEach(t),Rx=p(kn),pn=r(kn,"DIV",{class:!0});var ym=a(pn);T(md.$$.fragment,ym),Kx=p(ym),jg=r(ym,"P",{});var oI=a(jg);Qx=n(oI,`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:`),oI.forEach(t),Vx=p(ym),gd=r(ym,"UL",{});var B1=a(gd);wu=r(B1,"LI",{});var x8=a(wu);Gx=n(x8,"single sequence: "),qg=r(x8,"CODE",{});var nI=a(qg);Jx=n(nI,"[CLS] X [SEP]"),nI.forEach(t),x8.forEach(t),Xx=p(B1),$u=r(B1,"LI",{});var E8=a($u);Yx=n(E8,"pair of sequences: "),Cg=r(E8,"CODE",{});var sI=a(Cg);Zx=n(sI,"[CLS] A [SEP] B [SEP]"),sI.forEach(t),E8.forEach(t),B1.forEach(t),ym.forEach(t),e4=p(kn),ao=r(kn,"DIV",{class:!0});var di=a(ao);T(_d.$$.fragment,di),t4=p(di),Ag=r(di,"P",{});var rI=a(Ag);o4=n(rI,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),rI.forEach(t),n4=p(di),T(mr.$$.fragment,di),s4=p(di),Wn=r(di,"P",{});var Tm=a(Wn);r4=n(Tm,"If "),Ng=r(Tm,"CODE",{});var aI=a(Ng);a4=n(aI,"token_ids_1"),aI.forEach(t),i4=n(Tm," is "),Ig=r(Tm,"CODE",{});var iI=a(Ig);l4=n(iI,"None"),iI.forEach(t),d4=n(Tm,", this method only returns the first portion of the mask (0s)."),Tm.forEach(t),di.forEach(t),kn.forEach(t),oT=p(i),Hn=r(i,"H2",{class:!0});var M1=a(Hn);gr=r(M1,"A",{id:!0,class:!0,href:!0});var lI=a(gr);Og=r(lI,"SPAN",{});var dI=a(Og);T(bd.$$.fragment,dI),dI.forEach(t),lI.forEach(t),c4=p(M1),Lg=r(M1,"SPAN",{});var cI=a(Lg);p4=n(cI,"TFBertTokenizer"),cI.forEach(t),M1.forEach(t),nT=p(i),Mt=r(i,"DIV",{class:!0});var yn=a(Mt);T(vd.$$.fragment,yn),h4=p(yn),Rn=r(yn,"P",{});var wm=a(Rn);f4=n(wm,`This is an in-graph tokenizer for BERT. It should be initialized similarly to other tokenizers, using the
`),Dg=r(wm,"CODE",{});var pI=a(Dg);u4=n(pI,"from_pretrained()"),pI.forEach(t),m4=n(wm," method. It can also be initialized with the "),Sg=r(wm,"CODE",{});var hI=a(Sg);g4=n(hI,"from_tokenizer()"),hI.forEach(t),_4=n(wm,` method, which imports settings
from an existing standard tokenizer object.`),wm.forEach(t),b4=p(yn),kd=r(yn,"P",{});var z1=a(kd);v4=n(z1,`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 `),Ug=r(z1,"CODE",{});var fI=a(Ug);k4=n(fI,"tf.string"),fI.forEach(t),y4=n(z1," inputs to outputs."),z1.forEach(t),T4=p(yn),hn=r(yn,"DIV",{class:!0});var $m=a(hn);T(yd.$$.fragment,$m),w4=p($m),Td=r($m,"P",{});var P1=a(Td);$4=n(P1,"Instantiate a "),Wg=r(P1,"CODE",{});var uI=a(Wg);F4=n(uI,"TFBertTokenizer"),uI.forEach(t),x4=n(P1," from a pre-trained tokenizer."),P1.forEach(t),E4=p($m),T(_r.$$.fragment,$m),$m.forEach(t),B4=p(yn),fn=r(yn,"DIV",{class:!0});var Fm=a(fn);T(wd.$$.fragment,Fm),M4=p(Fm),Kn=r(Fm,"P",{});var xm=a(Kn);z4=n(xm,"Initialize a "),Hg=r(xm,"CODE",{});var mI=a(Hg);P4=n(mI,"TFBertTokenizer"),mI.forEach(t),j4=n(xm," from an existing "),Rg=r(xm,"CODE",{});var gI=a(Rg);q4=n(gI,"Tokenizer"),gI.forEach(t),C4=n(xm,"."),xm.forEach(t),A4=p(Fm),T(br.$$.fragment,Fm),Fm.forEach(t),yn.forEach(t),sT=p(i),Qn=r(i,"H2",{class:!0});var j1=a(Qn);vr=r(j1,"A",{id:!0,class:!0,href:!0});var _I=a(vr);Kg=r(_I,"SPAN",{});var bI=a(Kg);T($d.$$.fragment,bI),bI.forEach(t),_I.forEach(t),N4=p(j1),Qg=r(j1,"SPAN",{});var vI=a(Qg);I4=n(vI,"Bert specific outputs"),vI.forEach(t),j1.forEach(t),rT=p(i),Vn=r(i,"DIV",{class:!0});var q1=a(Vn);T(Fd.$$.fragment,q1),O4=p(q1),xd=r(q1,"P",{});var C1=a(xd);L4=n(C1,"Output type of "),Fu=r(C1,"A",{href:!0});var kI=a(Fu);D4=n(kI,"BertForPreTraining"),kI.forEach(t),S4=n(C1,"."),C1.forEach(t),q1.forEach(t),aT=p(i),Gn=r(i,"DIV",{class:!0});var A1=a(Gn);T(Ed.$$.fragment,A1),U4=p(A1),Bd=r(A1,"P",{});var N1=a(Bd);W4=n(N1,"Output type of "),xu=r(N1,"A",{href:!0});var yI=a(xu);H4=n(yI,"TFBertForPreTraining"),yI.forEach(t),R4=n(N1,"."),N1.forEach(t),A1.forEach(t),iT=p(i),Lo=r(i,"DIV",{class:!0});var Em=a(Lo);T(Md.$$.fragment,Em),K4=p(Em),zd=r(Em,"P",{});var I1=a(zd);Q4=n(I1,"Output type of "),Eu=r(I1,"A",{href:!0});var TI=a(Eu);V4=n(TI,"BertForPreTraining"),TI.forEach(t),G4=n(I1,"."),I1.forEach(t),J4=p(Em),kr=r(Em,"DIV",{class:!0});var O1=a(kr);T(Pd.$$.fragment,O1),X4=p(O1),Vg=r(O1,"P",{});var wI=a(Vg);Y4=n(wI,"\u201CReturns a new object replacing the specified fields with new values."),wI.forEach(t),O1.forEach(t),Em.forEach(t),lT=p(i),Jn=r(i,"H2",{class:!0});var L1=a(Jn);yr=r(L1,"A",{id:!0,class:!0,href:!0});var $I=a(yr);Gg=r($I,"SPAN",{});var FI=a(Gg);T(jd.$$.fragment,FI),FI.forEach(t),$I.forEach(t),Z4=p(L1),Jg=r(L1,"SPAN",{});var xI=a(Jg);eE=n(xI,"BertModel"),xI.forEach(t),L1.forEach(t),dT=p(i),nt=r(i,"DIV",{class:!0});var Qt=a(nt);T(qd.$$.fragment,Qt),tE=p(Qt),Xg=r(Qt,"P",{});var EI=a(Xg);oE=n(EI,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),EI.forEach(t),nE=p(Qt),Cd=r(Qt,"P",{});var D1=a(Cd);sE=n(D1,"This model inherits from "),Bu=r(D1,"A",{href:!0});var BI=a(Bu);rE=n(BI,"PreTrainedModel"),BI.forEach(t),aE=n(D1,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),D1.forEach(t),iE=p(Qt),Ad=r(Qt,"P",{});var S1=a(Ad);lE=n(S1,"This model is also a PyTorch "),Nd=r(S1,"A",{href:!0,rel:!0});var MI=a(Nd);dE=n(MI,"torch.nn.Module"),MI.forEach(t),cE=n(S1,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),S1.forEach(t),pE=p(Qt),Id=r(Qt,"P",{});var U1=a(Id);hE=n(U1,`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 `),Od=r(U1,"A",{href:!0,rel:!0});var zI=a(Od);fE=n(zI,`Attention is
all you need`),zI.forEach(t),uE=n(U1,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),U1.forEach(t),mE=p(Qt),gt=r(Qt,"P",{});var Vt=a(gt);gE=n(Vt,"To behave as an decoder the model needs to be initialized with the "),Yg=r(Vt,"CODE",{});var PI=a(Yg);_E=n(PI,"is_decoder"),PI.forEach(t),bE=n(Vt,` argument of the configuration set
to `),Zg=r(Vt,"CODE",{});var jI=a(Zg);vE=n(jI,"True"),jI.forEach(t),kE=n(Vt,". To be used in a Seq2Seq model, the model needs to initialized with both "),e_=r(Vt,"CODE",{});var qI=a(e_);yE=n(qI,"is_decoder"),qI.forEach(t),TE=n(Vt,` argument and
`),t_=r(Vt,"CODE",{});var CI=a(t_);wE=n(CI,"add_cross_attention"),CI.forEach(t),$E=n(Vt," set to "),o_=r(Vt,"CODE",{});var AI=a(o_);FE=n(AI,"True"),AI.forEach(t),xE=n(Vt,"; an "),n_=r(Vt,"CODE",{});var NI=a(n_);EE=n(NI,"encoder_hidden_states"),NI.forEach(t),BE=n(Vt," is then expected as an input to the forward pass."),Vt.forEach(t),ME=p(Qt),io=r(Qt,"DIV",{class:!0});var ci=a(io);T(Ld.$$.fragment,ci),zE=p(ci),Xn=r(ci,"P",{});var Bm=a(Xn);PE=n(Bm,"The "),Mu=r(Bm,"A",{href:!0});var II=a(Mu);jE=n(II,"BertModel"),II.forEach(t),qE=n(Bm," forward method, overrides the "),s_=r(Bm,"CODE",{});var OI=a(s_);CE=n(OI,"__call__"),OI.forEach(t),AE=n(Bm," special method."),Bm.forEach(t),NE=p(ci),T(Tr.$$.fragment,ci),IE=p(ci),T(wr.$$.fragment,ci),ci.forEach(t),Qt.forEach(t),cT=p(i),Yn=r(i,"H2",{class:!0});var W1=a(Yn);$r=r(W1,"A",{id:!0,class:!0,href:!0});var LI=a($r);r_=r(LI,"SPAN",{});var DI=a(r_);T(Dd.$$.fragment,DI),DI.forEach(t),LI.forEach(t),OE=p(W1),a_=r(W1,"SPAN",{});var SI=a(a_);LE=n(SI,"BertForPreTraining"),SI.forEach(t),W1.forEach(t),pT=p(i),zt=r(i,"DIV",{class:!0});var Tn=a(zt);T(Sd.$$.fragment,Tn),DE=p(Tn),Zn=r(Tn,"P",{});var Mm=a(Zn);SE=n(Mm,"Bert Model with two heads on top as done during the pretraining: a "),i_=r(Mm,"CODE",{});var UI=a(i_);UE=n(UI,"masked language modeling"),UI.forEach(t),WE=n(Mm," head and a "),l_=r(Mm,"CODE",{});var WI=a(l_);HE=n(WI,"next sentence prediction (classification)"),WI.forEach(t),RE=n(Mm," head."),Mm.forEach(t),KE=p(Tn),Ud=r(Tn,"P",{});var H1=a(Ud);QE=n(H1,"This model inherits from "),zu=r(H1,"A",{href:!0});var HI=a(zu);VE=n(HI,"PreTrainedModel"),HI.forEach(t),GE=n(H1,`. 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.)`),H1.forEach(t),JE=p(Tn),Wd=r(Tn,"P",{});var R1=a(Wd);XE=n(R1,"This model is also a PyTorch "),Hd=r(R1,"A",{href:!0,rel:!0});var RI=a(Hd);YE=n(RI,"torch.nn.Module"),RI.forEach(t),ZE=n(R1,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),R1.forEach(t),eB=p(Tn),lo=r(Tn,"DIV",{class:!0});var pi=a(lo);T(Rd.$$.fragment,pi),tB=p(pi),es=r(pi,"P",{});var zm=a(es);oB=n(zm,"The "),Pu=r(zm,"A",{href:!0});var KI=a(Pu);nB=n(KI,"BertForPreTraining"),KI.forEach(t),sB=n(zm," forward method, overrides the "),d_=r(zm,"CODE",{});var QI=a(d_);rB=n(QI,"__call__"),QI.forEach(t),aB=n(zm," special method."),zm.forEach(t),iB=p(pi),T(Fr.$$.fragment,pi),lB=p(pi),T(xr.$$.fragment,pi),pi.forEach(t),Tn.forEach(t),hT=p(i),ts=r(i,"H2",{class:!0});var K1=a(ts);Er=r(K1,"A",{id:!0,class:!0,href:!0});var VI=a(Er);c_=r(VI,"SPAN",{});var GI=a(c_);T(Kd.$$.fragment,GI),GI.forEach(t),VI.forEach(t),dB=p(K1),p_=r(K1,"SPAN",{});var JI=a(p_);cB=n(JI,"BertLMHeadModel"),JI.forEach(t),K1.forEach(t),fT=p(i),Pt=r(i,"DIV",{class:!0});var wn=a(Pt);T(Qd.$$.fragment,wn),pB=p(wn),Vd=r(wn,"P",{});var Q1=a(Vd);hB=n(Q1,"Bert Model with a "),h_=r(Q1,"CODE",{});var XI=a(h_);fB=n(XI,"language modeling"),XI.forEach(t),uB=n(Q1," head on top for CLM fine-tuning."),Q1.forEach(t),mB=p(wn),Gd=r(wn,"P",{});var V1=a(Gd);gB=n(V1,"This model inherits from "),ju=r(V1,"A",{href:!0});var YI=a(ju);_B=n(YI,"PreTrainedModel"),YI.forEach(t),bB=n(V1,`. 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.)`),V1.forEach(t),vB=p(wn),Jd=r(wn,"P",{});var G1=a(Jd);kB=n(G1,"This model is also a PyTorch "),Xd=r(G1,"A",{href:!0,rel:!0});var ZI=a(Xd);yB=n(ZI,"torch.nn.Module"),ZI.forEach(t),TB=n(G1,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),G1.forEach(t),wB=p(wn),co=r(wn,"DIV",{class:!0});var hi=a(co);T(Yd.$$.fragment,hi),$B=p(hi),os=r(hi,"P",{});var Pm=a(os);FB=n(Pm,"The "),qu=r(Pm,"A",{href:!0});var eO=a(qu);xB=n(eO,"BertLMHeadModel"),eO.forEach(t),EB=n(Pm," forward method, overrides the "),f_=r(Pm,"CODE",{});var tO=a(f_);BB=n(tO,"__call__"),tO.forEach(t),MB=n(Pm," special method."),Pm.forEach(t),zB=p(hi),T(Br.$$.fragment,hi),PB=p(hi),T(Mr.$$.fragment,hi),hi.forEach(t),wn.forEach(t),uT=p(i),ns=r(i,"H2",{class:!0});var J1=a(ns);zr=r(J1,"A",{id:!0,class:!0,href:!0});var oO=a(zr);u_=r(oO,"SPAN",{});var nO=a(u_);T(Zd.$$.fragment,nO),nO.forEach(t),oO.forEach(t),jB=p(J1),m_=r(J1,"SPAN",{});var sO=a(m_);qB=n(sO,"BertForMaskedLM"),sO.forEach(t),J1.forEach(t),mT=p(i),jt=r(i,"DIV",{class:!0});var $n=a(jt);T(ec.$$.fragment,$n),CB=p($n),tc=r($n,"P",{});var X1=a(tc);AB=n(X1,"Bert Model with a "),g_=r(X1,"CODE",{});var rO=a(g_);NB=n(rO,"language modeling"),rO.forEach(t),IB=n(X1," head on top."),X1.forEach(t),OB=p($n),oc=r($n,"P",{});var Y1=a(oc);LB=n(Y1,"This model inherits from "),Cu=r(Y1,"A",{href:!0});var aO=a(Cu);DB=n(aO,"PreTrainedModel"),aO.forEach(t),SB=n(Y1,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Y1.forEach(t),UB=p($n),nc=r($n,"P",{});var Z1=a(nc);WB=n(Z1,"This model is also a PyTorch "),sc=r(Z1,"A",{href:!0,rel:!0});var iO=a(sc);HB=n(iO,"torch.nn.Module"),iO.forEach(t),RB=n(Z1,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Z1.forEach(t),KB=p($n),po=r($n,"DIV",{class:!0});var fi=a(po);T(rc.$$.fragment,fi),QB=p(fi),ss=r(fi,"P",{});var jm=a(ss);VB=n(jm,"The "),Au=r(jm,"A",{href:!0});var lO=a(Au);GB=n(lO,"BertForMaskedLM"),lO.forEach(t),JB=n(jm," forward method, overrides the "),__=r(jm,"CODE",{});var dO=a(__);XB=n(dO,"__call__"),dO.forEach(t),YB=n(jm," special method."),jm.forEach(t),ZB=p(fi),T(Pr.$$.fragment,fi),eM=p(fi),T(jr.$$.fragment,fi),fi.forEach(t),$n.forEach(t),gT=p(i),rs=r(i,"H2",{class:!0});var ew=a(rs);qr=r(ew,"A",{id:!0,class:!0,href:!0});var cO=a(qr);b_=r(cO,"SPAN",{});var pO=a(b_);T(ac.$$.fragment,pO),pO.forEach(t),cO.forEach(t),tM=p(ew),v_=r(ew,"SPAN",{});var hO=a(v_);oM=n(hO,"BertForNextSentencePrediction"),hO.forEach(t),ew.forEach(t),_T=p(i),qt=r(i,"DIV",{class:!0});var Fn=a(qt);T(ic.$$.fragment,Fn),nM=p(Fn),lc=r(Fn,"P",{});var tw=a(lc);sM=n(tw,"Bert Model with a "),k_=r(tw,"CODE",{});var fO=a(k_);rM=n(fO,"next sentence prediction (classification)"),fO.forEach(t),aM=n(tw," head on top."),tw.forEach(t),iM=p(Fn),dc=r(Fn,"P",{});var ow=a(dc);lM=n(ow,"This model inherits from "),Nu=r(ow,"A",{href:!0});var uO=a(Nu);dM=n(uO,"PreTrainedModel"),uO.forEach(t),cM=n(ow,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ow.forEach(t),pM=p(Fn),cc=r(Fn,"P",{});var nw=a(cc);hM=n(nw,"This model is also a PyTorch "),pc=r(nw,"A",{href:!0,rel:!0});var mO=a(pc);fM=n(mO,"torch.nn.Module"),mO.forEach(t),uM=n(nw,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),nw.forEach(t),mM=p(Fn),ho=r(Fn,"DIV",{class:!0});var ui=a(ho);T(hc.$$.fragment,ui),gM=p(ui),as=r(ui,"P",{});var qm=a(as);_M=n(qm,"The "),Iu=r(qm,"A",{href:!0});var gO=a(Iu);bM=n(gO,"BertForNextSentencePrediction"),gO.forEach(t),vM=n(qm," forward method, overrides the "),y_=r(qm,"CODE",{});var _O=a(y_);kM=n(_O,"__call__"),_O.forEach(t),yM=n(qm," special method."),qm.forEach(t),TM=p(ui),T(Cr.$$.fragment,ui),wM=p(ui),T(Ar.$$.fragment,ui),ui.forEach(t),Fn.forEach(t),bT=p(i),is=r(i,"H2",{class:!0});var sw=a(is);Nr=r(sw,"A",{id:!0,class:!0,href:!0});var bO=a(Nr);T_=r(bO,"SPAN",{});var vO=a(T_);T(fc.$$.fragment,vO),vO.forEach(t),bO.forEach(t),$M=p(sw),w_=r(sw,"SPAN",{});var kO=a(w_);FM=n(kO,"BertForSequenceClassification"),kO.forEach(t),sw.forEach(t),vT=p(i),Ct=r(i,"DIV",{class:!0});var xn=a(Ct);T(uc.$$.fragment,xn),xM=p(xn),$_=r(xn,"P",{});var yO=a($_);EM=n(yO,`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.`),yO.forEach(t),BM=p(xn),mc=r(xn,"P",{});var rw=a(mc);MM=n(rw,"This model inherits from "),Ou=r(rw,"A",{href:!0});var TO=a(Ou);zM=n(TO,"PreTrainedModel"),TO.forEach(t),PM=n(rw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),rw.forEach(t),jM=p(xn),gc=r(xn,"P",{});var aw=a(gc);qM=n(aw,"This model is also a PyTorch "),_c=r(aw,"A",{href:!0,rel:!0});var wO=a(_c);CM=n(wO,"torch.nn.Module"),wO.forEach(t),AM=n(aw,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),aw.forEach(t),NM=p(xn),Dt=r(xn,"DIV",{class:!0});var En=a(Dt);T(bc.$$.fragment,En),IM=p(En),ls=r(En,"P",{});var Cm=a(ls);OM=n(Cm,"The "),Lu=r(Cm,"A",{href:!0});var $O=a(Lu);LM=n($O,"BertForSequenceClassification"),$O.forEach(t),DM=n(Cm," forward method, overrides the "),F_=r(Cm,"CODE",{});var FO=a(F_);SM=n(FO,"__call__"),FO.forEach(t),UM=n(Cm," special method."),Cm.forEach(t),WM=p(En),T(Ir.$$.fragment,En),HM=p(En),T(Or.$$.fragment,En),RM=p(En),T(Lr.$$.fragment,En),En.forEach(t),xn.forEach(t),kT=p(i),ds=r(i,"H2",{class:!0});var iw=a(ds);Dr=r(iw,"A",{id:!0,class:!0,href:!0});var xO=a(Dr);x_=r(xO,"SPAN",{});var EO=a(x_);T(vc.$$.fragment,EO),EO.forEach(t),xO.forEach(t),KM=p(iw),E_=r(iw,"SPAN",{});var BO=a(E_);QM=n(BO,"BertForMultipleChoice"),BO.forEach(t),iw.forEach(t),yT=p(i),At=r(i,"DIV",{class:!0});var Bn=a(At);T(kc.$$.fragment,Bn),VM=p(Bn),B_=r(Bn,"P",{});var MO=a(B_);GM=n(MO,`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.`),MO.forEach(t),JM=p(Bn),yc=r(Bn,"P",{});var lw=a(yc);XM=n(lw,"This model inherits from "),Du=r(lw,"A",{href:!0});var zO=a(Du);YM=n(zO,"PreTrainedModel"),zO.forEach(t),ZM=n(lw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),lw.forEach(t),ez=p(Bn),Tc=r(Bn,"P",{});var dw=a(Tc);tz=n(dw,"This model is also a PyTorch "),wc=r(dw,"A",{href:!0,rel:!0});var PO=a(wc);oz=n(PO,"torch.nn.Module"),PO.forEach(t),nz=n(dw,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),dw.forEach(t),sz=p(Bn),fo=r(Bn,"DIV",{class:!0});var mi=a(fo);T($c.$$.fragment,mi),rz=p(mi),cs=r(mi,"P",{});var Am=a(cs);az=n(Am,"The "),Su=r(Am,"A",{href:!0});var jO=a(Su);iz=n(jO,"BertForMultipleChoice"),jO.forEach(t),lz=n(Am," forward method, overrides the "),M_=r(Am,"CODE",{});var qO=a(M_);dz=n(qO,"__call__"),qO.forEach(t),cz=n(Am," special method."),Am.forEach(t),pz=p(mi),T(Sr.$$.fragment,mi),hz=p(mi),T(Ur.$$.fragment,mi),mi.forEach(t),Bn.forEach(t),TT=p(i),ps=r(i,"H2",{class:!0});var cw=a(ps);Wr=r(cw,"A",{id:!0,class:!0,href:!0});var CO=a(Wr);z_=r(CO,"SPAN",{});var AO=a(z_);T(Fc.$$.fragment,AO),AO.forEach(t),CO.forEach(t),fz=p(cw),P_=r(cw,"SPAN",{});var NO=a(P_);uz=n(NO,"BertForTokenClassification"),NO.forEach(t),cw.forEach(t),wT=p(i),Nt=r(i,"DIV",{class:!0});var Mn=a(Nt);T(xc.$$.fragment,Mn),mz=p(Mn),j_=r(Mn,"P",{});var IO=a(j_);gz=n(IO,`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.`),IO.forEach(t),_z=p(Mn),Ec=r(Mn,"P",{});var pw=a(Ec);bz=n(pw,"This model inherits from "),Uu=r(pw,"A",{href:!0});var OO=a(Uu);vz=n(OO,"PreTrainedModel"),OO.forEach(t),kz=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),yz=p(Mn),Bc=r(Mn,"P",{});var hw=a(Bc);Tz=n(hw,"This model is also a PyTorch "),Mc=r(hw,"A",{href:!0,rel:!0});var LO=a(Mc);wz=n(LO,"torch.nn.Module"),LO.forEach(t),$z=n(hw,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),hw.forEach(t),Fz=p(Mn),uo=r(Mn,"DIV",{class:!0});var gi=a(uo);T(zc.$$.fragment,gi),xz=p(gi),hs=r(gi,"P",{});var Nm=a(hs);Ez=n(Nm,"The "),Wu=r(Nm,"A",{href:!0});var DO=a(Wu);Bz=n(DO,"BertForTokenClassification"),DO.forEach(t),Mz=n(Nm," forward method, overrides the "),q_=r(Nm,"CODE",{});var SO=a(q_);zz=n(SO,"__call__"),SO.forEach(t),Pz=n(Nm," special method."),Nm.forEach(t),jz=p(gi),T(Hr.$$.fragment,gi),qz=p(gi),T(Rr.$$.fragment,gi),gi.forEach(t),Mn.forEach(t),$T=p(i),fs=r(i,"H2",{class:!0});var fw=a(fs);Kr=r(fw,"A",{id:!0,class:!0,href:!0});var UO=a(Kr);C_=r(UO,"SPAN",{});var WO=a(C_);T(Pc.$$.fragment,WO),WO.forEach(t),UO.forEach(t),Cz=p(fw),A_=r(fw,"SPAN",{});var HO=a(A_);Az=n(HO,"BertForQuestionAnswering"),HO.forEach(t),fw.forEach(t),FT=p(i),It=r(i,"DIV",{class:!0});var zn=a(It);T(jc.$$.fragment,zn),Nz=p(zn),us=r(zn,"P",{});var Im=a(us);Iz=n(Im,`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 `),N_=r(Im,"CODE",{});var RO=a(N_);Oz=n(RO,"span start logits"),RO.forEach(t),Lz=n(Im," and "),I_=r(Im,"CODE",{});var KO=a(I_);Dz=n(KO,"span end logits"),KO.forEach(t),Sz=n(Im,")."),Im.forEach(t),Uz=p(zn),qc=r(zn,"P",{});var uw=a(qc);Wz=n(uw,"This model inherits from "),Hu=r(uw,"A",{href:!0});var QO=a(Hu);Hz=n(QO,"PreTrainedModel"),QO.forEach(t),Rz=n(uw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),uw.forEach(t),Kz=p(zn),Cc=r(zn,"P",{});var mw=a(Cc);Qz=n(mw,"This model is also a PyTorch "),Ac=r(mw,"A",{href:!0,rel:!0});var VO=a(Ac);Vz=n(VO,"torch.nn.Module"),VO.forEach(t),Gz=n(mw,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),mw.forEach(t),Jz=p(zn),mo=r(zn,"DIV",{class:!0});var _i=a(mo);T(Nc.$$.fragment,_i),Xz=p(_i),ms=r(_i,"P",{});var Om=a(ms);Yz=n(Om,"The "),Ru=r(Om,"A",{href:!0});var GO=a(Ru);Zz=n(GO,"BertForQuestionAnswering"),GO.forEach(t),eP=n(Om," forward method, overrides the "),O_=r(Om,"CODE",{});var JO=a(O_);tP=n(JO,"__call__"),JO.forEach(t),oP=n(Om," special method."),Om.forEach(t),nP=p(_i),T(Qr.$$.fragment,_i),sP=p(_i),T(Vr.$$.fragment,_i),_i.forEach(t),zn.forEach(t),xT=p(i),gs=r(i,"H2",{class:!0});var gw=a(gs);Gr=r(gw,"A",{id:!0,class:!0,href:!0});var XO=a(Gr);L_=r(XO,"SPAN",{});var YO=a(L_);T(Ic.$$.fragment,YO),YO.forEach(t),XO.forEach(t),rP=p(gw),D_=r(gw,"SPAN",{});var ZO=a(D_);aP=n(ZO,"TFBertModel"),ZO.forEach(t),gw.forEach(t),ET=p(i),_t=r(i,"DIV",{class:!0});var zo=a(_t);T(Oc.$$.fragment,zo),iP=p(zo),S_=r(zo,"P",{});var eL=a(S_);lP=n(eL,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),eL.forEach(t),dP=p(zo),Lc=r(zo,"P",{});var _w=a(Lc);cP=n(_w,"This model inherits from "),Ku=r(_w,"A",{href:!0});var tL=a(Ku);pP=n(tL,"TFPreTrainedModel"),tL.forEach(t),hP=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),fP=p(zo),Dc=r(zo,"P",{});var bw=a(Dc);uP=n(bw,"This model is also a "),Sc=r(bw,"A",{href:!0,rel:!0});var oL=a(Sc);mP=n(oL,"tf.keras.Model"),oL.forEach(t),gP=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),_P=p(zo),T(Jr.$$.fragment,zo),bP=p(zo),go=r(zo,"DIV",{class:!0});var bi=a(go);T(Uc.$$.fragment,bi),vP=p(bi),_s=r(bi,"P",{});var Lm=a(_s);kP=n(Lm,"The "),Qu=r(Lm,"A",{href:!0});var nL=a(Qu);yP=n(nL,"TFBertModel"),nL.forEach(t),TP=n(Lm," forward method, overrides the "),U_=r(Lm,"CODE",{});var sL=a(U_);wP=n(sL,"__call__"),sL.forEach(t),$P=n(Lm," special method."),Lm.forEach(t),FP=p(bi),T(Xr.$$.fragment,bi),xP=p(bi),T(Yr.$$.fragment,bi),bi.forEach(t),zo.forEach(t),BT=p(i),bs=r(i,"H2",{class:!0});var vw=a(bs);Zr=r(vw,"A",{id:!0,class:!0,href:!0});var rL=a(Zr);W_=r(rL,"SPAN",{});var aL=a(W_);T(Wc.$$.fragment,aL),aL.forEach(t),rL.forEach(t),EP=p(vw),H_=r(vw,"SPAN",{});var iL=a(H_);BP=n(iL,"TFBertForPreTraining"),iL.forEach(t),vw.forEach(t),MT=p(i),bt=r(i,"DIV",{class:!0});var Po=a(bt);T(Hc.$$.fragment,Po),MP=p(Po),vs=r(Po,"P",{});var Dm=a(vs);zP=n(Dm,`Bert Model with two heads on top as done during the pretraining:
a `),R_=r(Dm,"CODE",{});var lL=a(R_);PP=n(lL,"masked language modeling"),lL.forEach(t),jP=n(Dm," head and a "),K_=r(Dm,"CODE",{});var dL=a(K_);qP=n(dL,"next sentence prediction (classification)"),dL.forEach(t),CP=n(Dm," head."),Dm.forEach(t),AP=p(Po),Rc=r(Po,"P",{});var kw=a(Rc);NP=n(kw,"This model inherits from "),Vu=r(kw,"A",{href:!0});var cL=a(Vu);IP=n(cL,"TFPreTrainedModel"),cL.forEach(t),OP=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),LP=p(Po),Kc=r(Po,"P",{});var yw=a(Kc);DP=n(yw,"This model is also a "),Qc=r(yw,"A",{href:!0,rel:!0});var pL=a(Qc);SP=n(pL,"tf.keras.Model"),pL.forEach(t),UP=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),WP=p(Po),T(ea.$$.fragment,Po),HP=p(Po),_o=r(Po,"DIV",{class:!0});var vi=a(_o);T(Vc.$$.fragment,vi),RP=p(vi),ks=r(vi,"P",{});var Sm=a(ks);KP=n(Sm,"The "),Gu=r(Sm,"A",{href:!0});var hL=a(Gu);QP=n(hL,"TFBertForPreTraining"),hL.forEach(t),VP=n(Sm," forward method, overrides the "),Q_=r(Sm,"CODE",{});var fL=a(Q_);GP=n(fL,"__call__"),fL.forEach(t),JP=n(Sm," special method."),Sm.forEach(t),XP=p(vi),T(ta.$$.fragment,vi),YP=p(vi),T(oa.$$.fragment,vi),vi.forEach(t),Po.forEach(t),zT=p(i),ys=r(i,"H2",{class:!0});var Tw=a(ys);na=r(Tw,"A",{id:!0,class:!0,href:!0});var uL=a(na);V_=r(uL,"SPAN",{});var mL=a(V_);T(Gc.$$.fragment,mL),mL.forEach(t),uL.forEach(t),ZP=p(Tw),G_=r(Tw,"SPAN",{});var gL=a(G_);e9=n(gL,"TFBertModelLMHeadModel"),gL.forEach(t),Tw.forEach(t),PT=p(i),Ts=r(i,"DIV",{class:!0});var ww=a(Ts);T(Jc.$$.fragment,ww),t9=p(ww),St=r(ww,"DIV",{class:!0});var Pn=a(St);T(Xc.$$.fragment,Pn),o9=p(Pn),st=r(Pn,"P",{});var Et=a(st);n9=n(Et,"encoder_hidden_states  ("),J_=r(Et,"CODE",{});var _L=a(J_);s9=n(_L,"tf.Tensor"),_L.forEach(t),r9=n(Et," of shape "),X_=r(Et,"CODE",{});var bL=a(X_);a9=n(bL,"(batch_size, sequence_length, hidden_size)"),bL.forEach(t),i9=n(Et,", "),Y_=r(Et,"EM",{});var vL=a(Y_);l9=n(vL,"optional"),vL.forEach(t),d9=n(Et,`):
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 (`),Z_=r(Et,"CODE",{});var kL=a(Z_);c9=n(kL,"tf.Tensor"),kL.forEach(t),p9=n(Et," of shape "),eb=r(Et,"CODE",{});var yL=a(eb);h9=n(yL,"(batch_size, sequence_length)"),yL.forEach(t),f9=n(Et,", "),tb=r(Et,"EM",{});var TL=a(tb);u9=n(TL,"optional"),TL.forEach(t),m9=n(Et,`):
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 `),ob=r(Et,"CODE",{});var wL=a(ob);g9=n(wL,"[0, 1]"),wL.forEach(t),_9=n(Et,":"),Et.forEach(t),b9=p(Pn),Yc=r(Pn,"UL",{});var $w=a(Yc);Zc=r($w,"LI",{});var Fw=a(Zc);v9=n(Fw,"1 for tokens that are "),nb=r(Fw,"STRONG",{});var $L=a(nb);k9=n($L,"not masked"),$L.forEach(t),y9=n(Fw,","),Fw.forEach(t),T9=p($w),ep=r($w,"LI",{});var xw=a(ep);w9=n(xw,"0 for tokens that are "),sb=r(xw,"STRONG",{});var FL=a(sb);$9=n(FL,"masked"),FL.forEach(t),F9=n(xw,"."),xw.forEach(t),$w.forEach(t),x9=p(Pn),ne=r(Pn,"P",{});var ae=a(ne);E9=n(ae,"past_key_values ("),rb=r(ae,"CODE",{});var xL=a(rb);B9=n(xL,"Tuple[Tuple[tf.Tensor]]"),xL.forEach(t),M9=n(ae," of length "),ab=r(ae,"CODE",{});var EL=a(ab);z9=n(EL,"config.n_layers"),EL.forEach(t),P9=n(ae,`)
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),ib=r(ae,"CODE",{});var BL=a(ib);j9=n(BL,"past_key_values"),BL.forEach(t),q9=n(ae," are used, the user can optionally input only the last "),lb=r(ae,"CODE",{});var ML=a(lb);C9=n(ML,"decoder_input_ids"),ML.forEach(t),A9=n(ae,` (those that
don\u2019t have their past key value states given to this model) of shape `),db=r(ae,"CODE",{});var zL=a(db);N9=n(zL,"(batch_size, 1)"),zL.forEach(t),I9=n(ae,` instead of all
`),cb=r(ae,"CODE",{});var PL=a(cb);O9=n(PL,"decoder_input_ids"),PL.forEach(t),L9=n(ae," of shape "),pb=r(ae,"CODE",{});var jL=a(pb);D9=n(jL,"(batch_size, sequence_length)"),jL.forEach(t),S9=n(ae,`.
use_cache (`),hb=r(ae,"CODE",{});var qL=a(hb);U9=n(qL,"bool"),qL.forEach(t),W9=n(ae,", "),fb=r(ae,"EM",{});var CL=a(fb);H9=n(CL,"optional"),CL.forEach(t),R9=n(ae,", defaults to "),ub=r(ae,"CODE",{});var AL=a(ub);K9=n(AL,"True"),AL.forEach(t),Q9=n(ae,`):
If set to `),mb=r(ae,"CODE",{});var NL=a(mb);V9=n(NL,"True"),NL.forEach(t),G9=n(ae,", "),gb=r(ae,"CODE",{});var IL=a(gb);J9=n(IL,"past_key_values"),IL.forEach(t),X9=n(ae,` key value states are returned and can be used to speed up decoding (see
`),_b=r(ae,"CODE",{});var OL=a(_b);Y9=n(OL,"past_key_values"),OL.forEach(t),Z9=n(ae,"). Set to "),bb=r(ae,"CODE",{});var LL=a(bb);ej=n(LL,"False"),LL.forEach(t),tj=n(ae," during training, "),vb=r(ae,"CODE",{});var DL=a(vb);oj=n(DL,"True"),DL.forEach(t),nj=n(ae,` during generation
labels (`),kb=r(ae,"CODE",{});var SL=a(kb);sj=n(SL,"tf.Tensor"),SL.forEach(t),rj=n(ae," or "),yb=r(ae,"CODE",{});var UL=a(yb);aj=n(UL,"np.ndarray"),UL.forEach(t),ij=n(ae," of shape "),Tb=r(ae,"CODE",{});var WL=a(Tb);lj=n(WL,"(batch_size, sequence_length)"),WL.forEach(t),dj=n(ae,", "),wb=r(ae,"EM",{});var HL=a(wb);cj=n(HL,"optional"),HL.forEach(t),pj=n(ae,`):
Labels for computing the cross entropy classification loss. Indices should be in `),$b=r(ae,"CODE",{});var RL=a($b);hj=n(RL,"[0, ..., config.vocab_size - 1]"),RL.forEach(t),fj=n(ae,"."),ae.forEach(t),uj=p(Pn),T(sa.$$.fragment,Pn),Pn.forEach(t),ww.forEach(t),jT=p(i),ws=r(i,"H2",{class:!0});var Ew=a(ws);ra=r(Ew,"A",{id:!0,class:!0,href:!0});var KL=a(ra);Fb=r(KL,"SPAN",{});var QL=a(Fb);T(tp.$$.fragment,QL),QL.forEach(t),KL.forEach(t),mj=p(Ew),xb=r(Ew,"SPAN",{});var VL=a(xb);gj=n(VL,"TFBertForMaskedLM"),VL.forEach(t),Ew.forEach(t),qT=p(i),vt=r(i,"DIV",{class:!0});var jo=a(vt);T(op.$$.fragment,jo),_j=p(jo),np=r(jo,"P",{});var Bw=a(np);bj=n(Bw,"Bert Model with a "),Eb=r(Bw,"CODE",{});var GL=a(Eb);vj=n(GL,"language modeling"),GL.forEach(t),kj=n(Bw," head on top."),Bw.forEach(t),yj=p(jo),sp=r(jo,"P",{});var Mw=a(sp);Tj=n(Mw,"This model inherits from "),Ju=r(Mw,"A",{href:!0});var JL=a(Ju);wj=n(JL,"TFPreTrainedModel"),JL.forEach(t),$j=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),Fj=p(jo),rp=r(jo,"P",{});var zw=a(rp);xj=n(zw,"This model is also a "),ap=r(zw,"A",{href:!0,rel:!0});var XL=a(ap);Ej=n(XL,"tf.keras.Model"),XL.forEach(t),Bj=n(zw,` 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.`),zw.forEach(t),Mj=p(jo),T(aa.$$.fragment,jo),zj=p(jo),Ut=r(jo,"DIV",{class:!0});var jn=a(Ut);T(ip.$$.fragment,jn),Pj=p(jn),$s=r(jn,"P",{});var Um=a($s);jj=n(Um,"The "),Xu=r(Um,"A",{href:!0});var YL=a(Xu);qj=n(YL,"TFBertForMaskedLM"),YL.forEach(t),Cj=n(Um," forward method, overrides the "),Bb=r(Um,"CODE",{});var ZL=a(Bb);Aj=n(ZL,"__call__"),ZL.forEach(t),Nj=n(Um," special method."),Um.forEach(t),Ij=p(jn),T(ia.$$.fragment,jn),Oj=p(jn),T(la.$$.fragment,jn),Lj=p(jn),T(da.$$.fragment,jn),jn.forEach(t),jo.forEach(t),CT=p(i),Fs=r(i,"H2",{class:!0});var Pw=a(Fs);ca=r(Pw,"A",{id:!0,class:!0,href:!0});var eD=a(ca);Mb=r(eD,"SPAN",{});var tD=a(Mb);T(lp.$$.fragment,tD),tD.forEach(t),eD.forEach(t),Dj=p(Pw),zb=r(Pw,"SPAN",{});var oD=a(zb);Sj=n(oD,"TFBertForNextSentencePrediction"),oD.forEach(t),Pw.forEach(t),AT=p(i),kt=r(i,"DIV",{class:!0});var qo=a(kt);T(dp.$$.fragment,qo),Uj=p(qo),cp=r(qo,"P",{});var jw=a(cp);Wj=n(jw,"Bert Model with a "),Pb=r(jw,"CODE",{});var nD=a(Pb);Hj=n(nD,"next sentence prediction (classification)"),nD.forEach(t),Rj=n(jw," head on top."),jw.forEach(t),Kj=p(qo),pp=r(qo,"P",{});var qw=a(pp);Qj=n(qw,"This model inherits from "),Yu=r(qw,"A",{href:!0});var sD=a(Yu);Vj=n(sD,"TFPreTrainedModel"),sD.forEach(t),Gj=n(qw,`. 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.)`),qw.forEach(t),Jj=p(qo),hp=r(qo,"P",{});var Cw=a(hp);Xj=n(Cw,"This model is also a "),fp=r(Cw,"A",{href:!0,rel:!0});var rD=a(fp);Yj=n(rD,"tf.keras.Model"),rD.forEach(t),Zj=n(Cw,` 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.`),Cw.forEach(t),eq=p(qo),T(pa.$$.fragment,qo),tq=p(qo),bo=r(qo,"DIV",{class:!0});var ki=a(bo);T(up.$$.fragment,ki),oq=p(ki),xs=r(ki,"P",{});var Wm=a(xs);nq=n(Wm,"The "),Zu=r(Wm,"A",{href:!0});var aD=a(Zu);sq=n(aD,"TFBertForNextSentencePrediction"),aD.forEach(t),rq=n(Wm," forward method, overrides the "),jb=r(Wm,"CODE",{});var iD=a(jb);aq=n(iD,"__call__"),iD.forEach(t),iq=n(Wm," special method."),Wm.forEach(t),lq=p(ki),T(ha.$$.fragment,ki),dq=p(ki),T(fa.$$.fragment,ki),ki.forEach(t),qo.forEach(t),NT=p(i),Es=r(i,"H2",{class:!0});var Aw=a(Es);ua=r(Aw,"A",{id:!0,class:!0,href:!0});var lD=a(ua);qb=r(lD,"SPAN",{});var dD=a(qb);T(mp.$$.fragment,dD),dD.forEach(t),lD.forEach(t),cq=p(Aw),Cb=r(Aw,"SPAN",{});var cD=a(Cb);pq=n(cD,"TFBertForSequenceClassification"),cD.forEach(t),Aw.forEach(t),IT=p(i),yt=r(i,"DIV",{class:!0});var Co=a(yt);T(gp.$$.fragment,Co),hq=p(Co),Ab=r(Co,"P",{});var pD=a(Ab);fq=n(pD,`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.`),pD.forEach(t),uq=p(Co),_p=r(Co,"P",{});var Nw=a(_p);mq=n(Nw,"This model inherits from "),em=r(Nw,"A",{href:!0});var hD=a(em);gq=n(hD,"TFPreTrainedModel"),hD.forEach(t),_q=n(Nw,`. 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.)`),Nw.forEach(t),bq=p(Co),bp=r(Co,"P",{});var Iw=a(bp);vq=n(Iw,"This model is also a "),vp=r(Iw,"A",{href:!0,rel:!0});var fD=a(vp);kq=n(fD,"tf.keras.Model"),fD.forEach(t),yq=n(Iw,` 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.`),Iw.forEach(t),Tq=p(Co),T(ma.$$.fragment,Co),wq=p(Co),Wt=r(Co,"DIV",{class:!0});var qn=a(Wt);T(kp.$$.fragment,qn),$q=p(qn),Bs=r(qn,"P",{});var Hm=a(Bs);Fq=n(Hm,"The "),tm=r(Hm,"A",{href:!0});var uD=a(tm);xq=n(uD,"TFBertForSequenceClassification"),uD.forEach(t),Eq=n(Hm," forward method, overrides the "),Nb=r(Hm,"CODE",{});var mD=a(Nb);Bq=n(mD,"__call__"),mD.forEach(t),Mq=n(Hm," special method."),Hm.forEach(t),zq=p(qn),T(ga.$$.fragment,qn),Pq=p(qn),T(_a.$$.fragment,qn),jq=p(qn),T(ba.$$.fragment,qn),qn.forEach(t),Co.forEach(t),OT=p(i),Ms=r(i,"H2",{class:!0});var Ow=a(Ms);va=r(Ow,"A",{id:!0,class:!0,href:!0});var gD=a(va);Ib=r(gD,"SPAN",{});var _D=a(Ib);T(yp.$$.fragment,_D),_D.forEach(t),gD.forEach(t),qq=p(Ow),Ob=r(Ow,"SPAN",{});var bD=a(Ob);Cq=n(bD,"TFBertForMultipleChoice"),bD.forEach(t),Ow.forEach(t),LT=p(i),Tt=r(i,"DIV",{class:!0});var Ao=a(Tt);T(Tp.$$.fragment,Ao),Aq=p(Ao),Lb=r(Ao,"P",{});var vD=a(Lb);Nq=n(vD,`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.`),vD.forEach(t),Iq=p(Ao),wp=r(Ao,"P",{});var Lw=a(wp);Oq=n(Lw,"This model inherits from "),om=r(Lw,"A",{href:!0});var kD=a(om);Lq=n(kD,"TFPreTrainedModel"),kD.forEach(t),Dq=n(Lw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Lw.forEach(t),Sq=p(Ao),$p=r(Ao,"P",{});var Dw=a($p);Uq=n(Dw,"This model is also a "),Fp=r(Dw,"A",{href:!0,rel:!0});var yD=a(Fp);Wq=n(yD,"tf.keras.Model"),yD.forEach(t),Hq=n(Dw,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Dw.forEach(t),Rq=p(Ao),T(ka.$$.fragment,Ao),Kq=p(Ao),vo=r(Ao,"DIV",{class:!0});var yi=a(vo);T(xp.$$.fragment,yi),Qq=p(yi),zs=r(yi,"P",{});var Rm=a(zs);Vq=n(Rm,"The "),nm=r(Rm,"A",{href:!0});var TD=a(nm);Gq=n(TD,"TFBertForMultipleChoice"),TD.forEach(t),Jq=n(Rm," forward method, overrides the "),Db=r(Rm,"CODE",{});var wD=a(Db);Xq=n(wD,"__call__"),wD.forEach(t),Yq=n(Rm," special method."),Rm.forEach(t),Zq=p(yi),T(ya.$$.fragment,yi),e3=p(yi),T(Ta.$$.fragment,yi),yi.forEach(t),Ao.forEach(t),DT=p(i),Ps=r(i,"H2",{class:!0});var Sw=a(Ps);wa=r(Sw,"A",{id:!0,class:!0,href:!0});var $D=a(wa);Sb=r($D,"SPAN",{});var FD=a(Sb);T(Ep.$$.fragment,FD),FD.forEach(t),$D.forEach(t),t3=p(Sw),Ub=r(Sw,"SPAN",{});var xD=a(Ub);o3=n(xD,"TFBertForTokenClassification"),xD.forEach(t),Sw.forEach(t),ST=p(i),wt=r(i,"DIV",{class:!0});var No=a(wt);T(Bp.$$.fragment,No),n3=p(No),Wb=r(No,"P",{});var ED=a(Wb);s3=n(ED,`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.`),ED.forEach(t),r3=p(No),Mp=r(No,"P",{});var Uw=a(Mp);a3=n(Uw,"This model inherits from "),sm=r(Uw,"A",{href:!0});var BD=a(sm);i3=n(BD,"TFPreTrainedModel"),BD.forEach(t),l3=n(Uw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Uw.forEach(t),d3=p(No),zp=r(No,"P",{});var Ww=a(zp);c3=n(Ww,"This model is also a "),Pp=r(Ww,"A",{href:!0,rel:!0});var MD=a(Pp);p3=n(MD,"tf.keras.Model"),MD.forEach(t),h3=n(Ww,` 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.`),Ww.forEach(t),f3=p(No),T($a.$$.fragment,No),u3=p(No),Ht=r(No,"DIV",{class:!0});var Cn=a(Ht);T(jp.$$.fragment,Cn),m3=p(Cn),js=r(Cn,"P",{});var Km=a(js);g3=n(Km,"The "),rm=r(Km,"A",{href:!0});var zD=a(rm);_3=n(zD,"TFBertForTokenClassification"),zD.forEach(t),b3=n(Km," forward method, overrides the "),Hb=r(Km,"CODE",{});var PD=a(Hb);v3=n(PD,"__call__"),PD.forEach(t),k3=n(Km," special method."),Km.forEach(t),y3=p(Cn),T(Fa.$$.fragment,Cn),T3=p(Cn),T(xa.$$.fragment,Cn),w3=p(Cn),T(Ea.$$.fragment,Cn),Cn.forEach(t),No.forEach(t),UT=p(i),qs=r(i,"H2",{class:!0});var Hw=a(qs);Ba=r(Hw,"A",{id:!0,class:!0,href:!0});var jD=a(Ba);Rb=r(jD,"SPAN",{});var qD=a(Rb);T(qp.$$.fragment,qD),qD.forEach(t),jD.forEach(t),$3=p(Hw),Kb=r(Hw,"SPAN",{});var CD=a(Kb);F3=n(CD,"TFBertForQuestionAnswering"),CD.forEach(t),Hw.forEach(t),WT=p(i),$t=r(i,"DIV",{class:!0});var Io=a($t);T(Cp.$$.fragment,Io),x3=p(Io),Cs=r(Io,"P",{});var Qm=a(Cs);E3=n(Qm,`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 `),Qb=r(Qm,"CODE",{});var AD=a(Qb);B3=n(AD,"span start logits"),AD.forEach(t),M3=n(Qm," and "),Vb=r(Qm,"CODE",{});var ND=a(Vb);z3=n(ND,"span end logits"),ND.forEach(t),P3=n(Qm,")."),Qm.forEach(t),j3=p(Io),Ap=r(Io,"P",{});var Rw=a(Ap);q3=n(Rw,"This model inherits from "),am=r(Rw,"A",{href:!0});var ID=a(am);C3=n(ID,"TFPreTrainedModel"),ID.forEach(t),A3=n(Rw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Rw.forEach(t),N3=p(Io),Np=r(Io,"P",{});var Kw=a(Np);I3=n(Kw,"This model is also a "),Ip=r(Kw,"A",{href:!0,rel:!0});var OD=a(Ip);O3=n(OD,"tf.keras.Model"),OD.forEach(t),L3=n(Kw,` 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.`),Kw.forEach(t),D3=p(Io),T(Ma.$$.fragment,Io),S3=p(Io),Rt=r(Io,"DIV",{class:!0});var An=a(Rt);T(Op.$$.fragment,An),U3=p(An),As=r(An,"P",{});var Vm=a(As);W3=n(Vm,"The "),im=r(Vm,"A",{href:!0});var LD=a(im);H3=n(LD,"TFBertForQuestionAnswering"),LD.forEach(t),R3=n(Vm," forward method, overrides the "),Gb=r(Vm,"CODE",{});var DD=a(Gb);K3=n(DD,"__call__"),DD.forEach(t),Q3=n(Vm," special method."),Vm.forEach(t),V3=p(An),T(za.$$.fragment,An),G3=p(An),T(Pa.$$.fragment,An),J3=p(An),T(ja.$$.fragment,An),An.forEach(t),Io.forEach(t),HT=p(i),Ns=r(i,"H2",{class:!0});var Qw=a(Ns);qa=r(Qw,"A",{id:!0,class:!0,href:!0});var SD=a(qa);Jb=r(SD,"SPAN",{});var UD=a(Jb);T(Lp.$$.fragment,UD),UD.forEach(t),SD.forEach(t),X3=p(Qw),Xb=r(Qw,"SPAN",{});var WD=a(Xb);Y3=n(WD,"FlaxBertModel"),WD.forEach(t),Qw.forEach(t),RT=p(i),rt=r(i,"DIV",{class:!0});var Gt=a(rt);T(Dp.$$.fragment,Gt),Z3=p(Gt),Yb=r(Gt,"P",{});var HD=a(Yb);eC=n(HD,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),HD.forEach(t),tC=p(Gt),Sp=r(Gt,"P",{});var Vw=a(Sp);oC=n(Vw,"This model inherits from "),lm=r(Vw,"A",{href:!0});var RD=a(lm);nC=n(RD,"FlaxPreTrainedModel"),RD.forEach(t),sC=n(Vw,`. 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)`),Vw.forEach(t),rC=p(Gt),Up=r(Gt,"P",{});var Gw=a(Up);aC=n(Gw,"This model is also a Flax Linen "),Wp=r(Gw,"A",{href:!0,rel:!0});var KD=a(Wp);iC=n(KD,"flax.linen.Module"),KD.forEach(t),lC=n(Gw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Gw.forEach(t),dC=p(Gt),Zb=r(Gt,"P",{});var QD=a(Zb);cC=n(QD,"Finally, this model supports inherent JAX features such as:"),QD.forEach(t),pC=p(Gt),Do=r(Gt,"UL",{});var Ti=a(Do);ev=r(Ti,"LI",{});var VD=a(ev);Hp=r(VD,"A",{href:!0,rel:!0});var GD=a(Hp);hC=n(GD,"Just-In-Time (JIT) compilation"),GD.forEach(t),VD.forEach(t),fC=p(Ti),tv=r(Ti,"LI",{});var JD=a(tv);Rp=r(JD,"A",{href:!0,rel:!0});var XD=a(Rp);uC=n(XD,"Automatic Differentiation"),XD.forEach(t),JD.forEach(t),mC=p(Ti),ov=r(Ti,"LI",{});var YD=a(ov);Kp=r(YD,"A",{href:!0,rel:!0});var ZD=a(Kp);gC=n(ZD,"Vectorization"),ZD.forEach(t),YD.forEach(t),_C=p(Ti),nv=r(Ti,"LI",{});var eS=a(nv);Qp=r(eS,"A",{href:!0,rel:!0});var tS=a(Qp);bC=n(tS,"Parallelization"),tS.forEach(t),eS.forEach(t),Ti.forEach(t),vC=p(Gt),ko=r(Gt,"DIV",{class:!0});var wi=a(ko);T(Vp.$$.fragment,wi),kC=p(wi),Is=r(wi,"P",{});var Gm=a(Is);yC=n(Gm,"The "),sv=r(Gm,"CODE",{});var oS=a(sv);TC=n(oS,"FlaxBertPreTrainedModel"),oS.forEach(t),wC=n(Gm," forward method, overrides the "),rv=r(Gm,"CODE",{});var nS=a(rv);$C=n(nS,"__call__"),nS.forEach(t),FC=n(Gm," special method."),Gm.forEach(t),xC=p(wi),T(Ca.$$.fragment,wi),EC=p(wi),T(Aa.$$.fragment,wi),wi.forEach(t),Gt.forEach(t),KT=p(i),Os=r(i,"H2",{class:!0});var Jw=a(Os);Na=r(Jw,"A",{id:!0,class:!0,href:!0});var sS=a(Na);av=r(sS,"SPAN",{});var rS=a(av);T(Gp.$$.fragment,rS),rS.forEach(t),sS.forEach(t),BC=p(Jw),iv=r(Jw,"SPAN",{});var aS=a(iv);MC=n(aS,"FlaxBertForPreTraining"),aS.forEach(t),Jw.forEach(t),QT=p(i),at=r(i,"DIV",{class:!0});var Jt=a(at);T(Jp.$$.fragment,Jt),zC=p(Jt),Ls=r(Jt,"P",{});var Jm=a(Ls);PC=n(Jm,"Bert Model with two heads on top as done during the pretraining: a "),lv=r(Jm,"CODE",{});var iS=a(lv);jC=n(iS,"masked language modeling"),iS.forEach(t),qC=n(Jm," head and a "),dv=r(Jm,"CODE",{});var lS=a(dv);CC=n(lS,"next sentence prediction (classification)"),lS.forEach(t),AC=n(Jm," head."),Jm.forEach(t),NC=p(Jt),Xp=r(Jt,"P",{});var Xw=a(Xp);IC=n(Xw,"This model inherits from "),dm=r(Xw,"A",{href:!0});var dS=a(dm);OC=n(dS,"FlaxPreTrainedModel"),dS.forEach(t),LC=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),DC=p(Jt),Yp=r(Jt,"P",{});var Yw=a(Yp);SC=n(Yw,"This model is also a Flax Linen "),Zp=r(Yw,"A",{href:!0,rel:!0});var cS=a(Zp);UC=n(cS,"flax.linen.Module"),cS.forEach(t),WC=n(Yw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Yw.forEach(t),HC=p(Jt),cv=r(Jt,"P",{});var pS=a(cv);RC=n(pS,"Finally, this model supports inherent JAX features such as:"),pS.forEach(t),KC=p(Jt),So=r(Jt,"UL",{});var $i=a(So);pv=r($i,"LI",{});var hS=a(pv);eh=r(hS,"A",{href:!0,rel:!0});var fS=a(eh);QC=n(fS,"Just-In-Time (JIT) compilation"),fS.forEach(t),hS.forEach(t),VC=p($i),hv=r($i,"LI",{});var uS=a(hv);th=r(uS,"A",{href:!0,rel:!0});var mS=a(th);GC=n(mS,"Automatic Differentiation"),mS.forEach(t),uS.forEach(t),JC=p($i),fv=r($i,"LI",{});var gS=a(fv);oh=r(gS,"A",{href:!0,rel:!0});var _S=a(oh);XC=n(_S,"Vectorization"),_S.forEach(t),gS.forEach(t),YC=p($i),uv=r($i,"LI",{});var bS=a(uv);nh=r(bS,"A",{href:!0,rel:!0});var vS=a(nh);ZC=n(vS,"Parallelization"),vS.forEach(t),bS.forEach(t),$i.forEach(t),e6=p(Jt),yo=r(Jt,"DIV",{class:!0});var Fi=a(yo);T(sh.$$.fragment,Fi),t6=p(Fi),Ds=r(Fi,"P",{});var Xm=a(Ds);o6=n(Xm,"The "),mv=r(Xm,"CODE",{});var kS=a(mv);n6=n(kS,"FlaxBertPreTrainedModel"),kS.forEach(t),s6=n(Xm," forward method, overrides the "),gv=r(Xm,"CODE",{});var yS=a(gv);r6=n(yS,"__call__"),yS.forEach(t),a6=n(Xm," special method."),Xm.forEach(t),i6=p(Fi),T(Ia.$$.fragment,Fi),l6=p(Fi),T(Oa.$$.fragment,Fi),Fi.forEach(t),Jt.forEach(t),VT=p(i),Ss=r(i,"H2",{class:!0});var Zw=a(Ss);La=r(Zw,"A",{id:!0,class:!0,href:!0});var TS=a(La);_v=r(TS,"SPAN",{});var wS=a(_v);T(rh.$$.fragment,wS),wS.forEach(t),TS.forEach(t),d6=p(Zw),bv=r(Zw,"SPAN",{});var $S=a(bv);c6=n($S,"FlaxBertForCausalLM"),$S.forEach(t),Zw.forEach(t),GT=p(i),it=r(i,"DIV",{class:!0});var Xt=a(it);T(ah.$$.fragment,Xt),p6=p(Xt),vv=r(Xt,"P",{});var FS=a(vv);h6=n(FS,`Bert Model with a language modeling head on top (a linear layer on top of the hidden-states output) e.g for
autoregressive tasks.`),FS.forEach(t),f6=p(Xt),ih=r(Xt,"P",{});var e2=a(ih);u6=n(e2,"This model inherits from "),cm=r(e2,"A",{href:!0});var xS=a(cm);m6=n(xS,"FlaxPreTrainedModel"),xS.forEach(t),g6=n(e2,`. 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)`),e2.forEach(t),_6=p(Xt),lh=r(Xt,"P",{});var t2=a(lh);b6=n(t2,"This model is also a Flax Linen "),dh=r(t2,"A",{href:!0,rel:!0});var ES=a(dh);v6=n(ES,"flax.linen.Module"),ES.forEach(t),k6=n(t2,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),t2.forEach(t),y6=p(Xt),kv=r(Xt,"P",{});var BS=a(kv);T6=n(BS,"Finally, this model supports inherent JAX features such as:"),BS.forEach(t),w6=p(Xt),Uo=r(Xt,"UL",{});var xi=a(Uo);yv=r(xi,"LI",{});var MS=a(yv);ch=r(MS,"A",{href:!0,rel:!0});var zS=a(ch);$6=n(zS,"Just-In-Time (JIT) compilation"),zS.forEach(t),MS.forEach(t),F6=p(xi),Tv=r(xi,"LI",{});var PS=a(Tv);ph=r(PS,"A",{href:!0,rel:!0});var jS=a(ph);x6=n(jS,"Automatic Differentiation"),jS.forEach(t),PS.forEach(t),E6=p(xi),wv=r(xi,"LI",{});var qS=a(wv);hh=r(qS,"A",{href:!0,rel:!0});var CS=a(hh);B6=n(CS,"Vectorization"),CS.forEach(t),qS.forEach(t),M6=p(xi),$v=r(xi,"LI",{});var AS=a($v);fh=r(AS,"A",{href:!0,rel:!0});var NS=a(fh);z6=n(NS,"Parallelization"),NS.forEach(t),AS.forEach(t),xi.forEach(t),P6=p(Xt),To=r(Xt,"DIV",{class:!0});var Ei=a(To);T(uh.$$.fragment,Ei),j6=p(Ei),Us=r(Ei,"P",{});var Ym=a(Us);q6=n(Ym,"The "),Fv=r(Ym,"CODE",{});var IS=a(Fv);C6=n(IS,"FlaxBertPreTrainedModel"),IS.forEach(t),A6=n(Ym," forward method, overrides the "),xv=r(Ym,"CODE",{});var OS=a(xv);N6=n(OS,"__call__"),OS.forEach(t),I6=n(Ym," special method."),Ym.forEach(t),O6=p(Ei),T(Da.$$.fragment,Ei),L6=p(Ei),T(Sa.$$.fragment,Ei),Ei.forEach(t),Xt.forEach(t),JT=p(i),Ws=r(i,"H2",{class:!0});var o2=a(Ws);Ua=r(o2,"A",{id:!0,class:!0,href:!0});var LS=a(Ua);Ev=r(LS,"SPAN",{});var DS=a(Ev);T(mh.$$.fragment,DS),DS.forEach(t),LS.forEach(t),D6=p(o2),Bv=r(o2,"SPAN",{});var SS=a(Bv);S6=n(SS,"FlaxBertForMaskedLM"),SS.forEach(t),o2.forEach(t),XT=p(i),lt=r(i,"DIV",{class:!0});var Yt=a(lt);T(gh.$$.fragment,Yt),U6=p(Yt),_h=r(Yt,"P",{});var n2=a(_h);W6=n(n2,"Bert Model with a "),Mv=r(n2,"CODE",{});var US=a(Mv);H6=n(US,"language modeling"),US.forEach(t),R6=n(n2," head on top."),n2.forEach(t),K6=p(Yt),bh=r(Yt,"P",{});var s2=a(bh);Q6=n(s2,"This model inherits from "),pm=r(s2,"A",{href:!0});var WS=a(pm);V6=n(WS,"FlaxPreTrainedModel"),WS.forEach(t),G6=n(s2,`. 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)`),s2.forEach(t),J6=p(Yt),vh=r(Yt,"P",{});var r2=a(vh);X6=n(r2,"This model is also a Flax Linen "),kh=r(r2,"A",{href:!0,rel:!0});var HS=a(kh);Y6=n(HS,"flax.linen.Module"),HS.forEach(t),Z6=n(r2,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),r2.forEach(t),e5=p(Yt),zv=r(Yt,"P",{});var RS=a(zv);t5=n(RS,"Finally, this model supports inherent JAX features such as:"),RS.forEach(t),o5=p(Yt),Wo=r(Yt,"UL",{});var Bi=a(Wo);Pv=r(Bi,"LI",{});var KS=a(Pv);yh=r(KS,"A",{href:!0,rel:!0});var QS=a(yh);n5=n(QS,"Just-In-Time (JIT) compilation"),QS.forEach(t),KS.forEach(t),s5=p(Bi),jv=r(Bi,"LI",{});var VS=a(jv);Th=r(VS,"A",{href:!0,rel:!0});var GS=a(Th);r5=n(GS,"Automatic Differentiation"),GS.forEach(t),VS.forEach(t),a5=p(Bi),qv=r(Bi,"LI",{});var JS=a(qv);wh=r(JS,"A",{href:!0,rel:!0});var XS=a(wh);i5=n(XS,"Vectorization"),XS.forEach(t),JS.forEach(t),l5=p(Bi),Cv=r(Bi,"LI",{});var YS=a(Cv);$h=r(YS,"A",{href:!0,rel:!0});var ZS=a($h);d5=n(ZS,"Parallelization"),ZS.forEach(t),YS.forEach(t),Bi.forEach(t),c5=p(Yt),wo=r(Yt,"DIV",{class:!0});var Mi=a(wo);T(Fh.$$.fragment,Mi),p5=p(Mi),Hs=r(Mi,"P",{});var Zm=a(Hs);h5=n(Zm,"The "),Av=r(Zm,"CODE",{});var eU=a(Av);f5=n(eU,"FlaxBertPreTrainedModel"),eU.forEach(t),u5=n(Zm," forward method, overrides the "),Nv=r(Zm,"CODE",{});var tU=a(Nv);m5=n(tU,"__call__"),tU.forEach(t),g5=n(Zm," special method."),Zm.forEach(t),_5=p(Mi),T(Wa.$$.fragment,Mi),b5=p(Mi),T(Ha.$$.fragment,Mi),Mi.forEach(t),Yt.forEach(t),YT=p(i),Rs=r(i,"H2",{class:!0});var a2=a(Rs);Ra=r(a2,"A",{id:!0,class:!0,href:!0});var oU=a(Ra);Iv=r(oU,"SPAN",{});var nU=a(Iv);T(xh.$$.fragment,nU),nU.forEach(t),oU.forEach(t),v5=p(a2),Ov=r(a2,"SPAN",{});var sU=a(Ov);k5=n(sU,"FlaxBertForNextSentencePrediction"),sU.forEach(t),a2.forEach(t),ZT=p(i),dt=r(i,"DIV",{class:!0});var Zt=a(dt);T(Eh.$$.fragment,Zt),y5=p(Zt),Bh=r(Zt,"P",{});var i2=a(Bh);T5=n(i2,"Bert Model with a "),Lv=r(i2,"CODE",{});var rU=a(Lv);w5=n(rU,"next sentence prediction (classification)"),rU.forEach(t),$5=n(i2," head on top."),i2.forEach(t),F5=p(Zt),Mh=r(Zt,"P",{});var l2=a(Mh);x5=n(l2,"This model inherits from "),hm=r(l2,"A",{href:!0});var aU=a(hm);E5=n(aU,"FlaxPreTrainedModel"),aU.forEach(t),B5=n(l2,`. 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)`),l2.forEach(t),M5=p(Zt),zh=r(Zt,"P",{});var d2=a(zh);z5=n(d2,"This model is also a Flax Linen "),Ph=r(d2,"A",{href:!0,rel:!0});var iU=a(Ph);P5=n(iU,"flax.linen.Module"),iU.forEach(t),j5=n(d2,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),d2.forEach(t),q5=p(Zt),Dv=r(Zt,"P",{});var lU=a(Dv);C5=n(lU,"Finally, this model supports inherent JAX features such as:"),lU.forEach(t),A5=p(Zt),Ho=r(Zt,"UL",{});var zi=a(Ho);Sv=r(zi,"LI",{});var dU=a(Sv);jh=r(dU,"A",{href:!0,rel:!0});var cU=a(jh);N5=n(cU,"Just-In-Time (JIT) compilation"),cU.forEach(t),dU.forEach(t),I5=p(zi),Uv=r(zi,"LI",{});var pU=a(Uv);qh=r(pU,"A",{href:!0,rel:!0});var hU=a(qh);O5=n(hU,"Automatic Differentiation"),hU.forEach(t),pU.forEach(t),L5=p(zi),Wv=r(zi,"LI",{});var fU=a(Wv);Ch=r(fU,"A",{href:!0,rel:!0});var uU=a(Ch);D5=n(uU,"Vectorization"),uU.forEach(t),fU.forEach(t),S5=p(zi),Hv=r(zi,"LI",{});var mU=a(Hv);Ah=r(mU,"A",{href:!0,rel:!0});var gU=a(Ah);U5=n(gU,"Parallelization"),gU.forEach(t),mU.forEach(t),zi.forEach(t),W5=p(Zt),$o=r(Zt,"DIV",{class:!0});var Pi=a($o);T(Nh.$$.fragment,Pi),H5=p(Pi),Ks=r(Pi,"P",{});var eg=a(Ks);R5=n(eg,"The "),Rv=r(eg,"CODE",{});var _U=a(Rv);K5=n(_U,"FlaxBertPreTrainedModel"),_U.forEach(t),Q5=n(eg," forward method, overrides the "),Kv=r(eg,"CODE",{});var bU=a(Kv);V5=n(bU,"__call__"),bU.forEach(t),G5=n(eg," special method."),eg.forEach(t),J5=p(Pi),T(Ka.$$.fragment,Pi),X5=p(Pi),T(Qa.$$.fragment,Pi),Pi.forEach(t),Zt.forEach(t),e1=p(i),Qs=r(i,"H2",{class:!0});var c2=a(Qs);Va=r(c2,"A",{id:!0,class:!0,href:!0});var vU=a(Va);Qv=r(vU,"SPAN",{});var kU=a(Qv);T(Ih.$$.fragment,kU),kU.forEach(t),vU.forEach(t),Y5=p(c2),Vv=r(c2,"SPAN",{});var yU=a(Vv);Z5=n(yU,"FlaxBertForSequenceClassification"),yU.forEach(t),c2.forEach(t),t1=p(i),ct=r(i,"DIV",{class:!0});var eo=a(ct);T(Oh.$$.fragment,eo),eA=p(eo),Gv=r(eo,"P",{});var TU=a(Gv);tA=n(TU,`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.`),TU.forEach(t),oA=p(eo),Lh=r(eo,"P",{});var p2=a(Lh);nA=n(p2,"This model inherits from "),fm=r(p2,"A",{href:!0});var wU=a(fm);sA=n(wU,"FlaxPreTrainedModel"),wU.forEach(t),rA=n(p2,`. 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)`),p2.forEach(t),aA=p(eo),Dh=r(eo,"P",{});var h2=a(Dh);iA=n(h2,"This model is also a Flax Linen "),Sh=r(h2,"A",{href:!0,rel:!0});var $U=a(Sh);lA=n($U,"flax.linen.Module"),$U.forEach(t),dA=n(h2,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),h2.forEach(t),cA=p(eo),Jv=r(eo,"P",{});var FU=a(Jv);pA=n(FU,"Finally, this model supports inherent JAX features such as:"),FU.forEach(t),hA=p(eo),Ro=r(eo,"UL",{});var ji=a(Ro);Xv=r(ji,"LI",{});var xU=a(Xv);Uh=r(xU,"A",{href:!0,rel:!0});var EU=a(Uh);fA=n(EU,"Just-In-Time (JIT) compilation"),EU.forEach(t),xU.forEach(t),uA=p(ji),Yv=r(ji,"LI",{});var BU=a(Yv);Wh=r(BU,"A",{href:!0,rel:!0});var MU=a(Wh);mA=n(MU,"Automatic Differentiation"),MU.forEach(t),BU.forEach(t),gA=p(ji),Zv=r(ji,"LI",{});var zU=a(Zv);Hh=r(zU,"A",{href:!0,rel:!0});var PU=a(Hh);_A=n(PU,"Vectorization"),PU.forEach(t),zU.forEach(t),bA=p(ji),ek=r(ji,"LI",{});var jU=a(ek);Rh=r(jU,"A",{href:!0,rel:!0});var qU=a(Rh);vA=n(qU,"Parallelization"),qU.forEach(t),jU.forEach(t),ji.forEach(t),kA=p(eo),Fo=r(eo,"DIV",{class:!0});var qi=a(Fo);T(Kh.$$.fragment,qi),yA=p(qi),Vs=r(qi,"P",{});var tg=a(Vs);TA=n(tg,"The "),tk=r(tg,"CODE",{});var CU=a(tk);wA=n(CU,"FlaxBertPreTrainedModel"),CU.forEach(t),$A=n(tg," forward method, overrides the "),ok=r(tg,"CODE",{});var AU=a(ok);FA=n(AU,"__call__"),AU.forEach(t),xA=n(tg," special method."),tg.forEach(t),EA=p(qi),T(Ga.$$.fragment,qi),BA=p(qi),T(Ja.$$.fragment,qi),qi.forEach(t),eo.forEach(t),o1=p(i),Gs=r(i,"H2",{class:!0});var f2=a(Gs);Xa=r(f2,"A",{id:!0,class:!0,href:!0});var NU=a(Xa);nk=r(NU,"SPAN",{});var IU=a(nk);T(Qh.$$.fragment,IU),IU.forEach(t),NU.forEach(t),MA=p(f2),sk=r(f2,"SPAN",{});var OU=a(sk);zA=n(OU,"FlaxBertForMultipleChoice"),OU.forEach(t),f2.forEach(t),n1=p(i),pt=r(i,"DIV",{class:!0});var to=a(pt);T(Vh.$$.fragment,to),PA=p(to),rk=r(to,"P",{});var LU=a(rk);jA=n(LU,`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.`),LU.forEach(t),qA=p(to),Gh=r(to,"P",{});var u2=a(Gh);CA=n(u2,"This model inherits from "),um=r(u2,"A",{href:!0});var DU=a(um);AA=n(DU,"FlaxPreTrainedModel"),DU.forEach(t),NA=n(u2,`. 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)`),u2.forEach(t),IA=p(to),Jh=r(to,"P",{});var m2=a(Jh);OA=n(m2,"This model is also a Flax Linen "),Xh=r(m2,"A",{href:!0,rel:!0});var SU=a(Xh);LA=n(SU,"flax.linen.Module"),SU.forEach(t),DA=n(m2,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),m2.forEach(t),SA=p(to),ak=r(to,"P",{});var UU=a(ak);UA=n(UU,"Finally, this model supports inherent JAX features such as:"),UU.forEach(t),WA=p(to),Ko=r(to,"UL",{});var Ci=a(Ko);ik=r(Ci,"LI",{});var WU=a(ik);Yh=r(WU,"A",{href:!0,rel:!0});var HU=a(Yh);HA=n(HU,"Just-In-Time (JIT) compilation"),HU.forEach(t),WU.forEach(t),RA=p(Ci),lk=r(Ci,"LI",{});var RU=a(lk);Zh=r(RU,"A",{href:!0,rel:!0});var KU=a(Zh);KA=n(KU,"Automatic Differentiation"),KU.forEach(t),RU.forEach(t),QA=p(Ci),dk=r(Ci,"LI",{});var QU=a(dk);ef=r(QU,"A",{href:!0,rel:!0});var VU=a(ef);VA=n(VU,"Vectorization"),VU.forEach(t),QU.forEach(t),GA=p(Ci),ck=r(Ci,"LI",{});var GU=a(ck);tf=r(GU,"A",{href:!0,rel:!0});var JU=a(tf);JA=n(JU,"Parallelization"),JU.forEach(t),GU.forEach(t),Ci.forEach(t),XA=p(to),xo=r(to,"DIV",{class:!0});var Ai=a(xo);T(of.$$.fragment,Ai),YA=p(Ai),Js=r(Ai,"P",{});var og=a(Js);ZA=n(og,"The "),pk=r(og,"CODE",{});var XU=a(pk);e7=n(XU,"FlaxBertPreTrainedModel"),XU.forEach(t),t7=n(og," forward method, overrides the "),hk=r(og,"CODE",{});var YU=a(hk);o7=n(YU,"__call__"),YU.forEach(t),n7=n(og," special method."),og.forEach(t),s7=p(Ai),T(Ya.$$.fragment,Ai),r7=p(Ai),T(Za.$$.fragment,Ai),Ai.forEach(t),to.forEach(t),s1=p(i),Xs=r(i,"H2",{class:!0});var g2=a(Xs);ei=r(g2,"A",{id:!0,class:!0,href:!0});var ZU=a(ei);fk=r(ZU,"SPAN",{});var eW=a(fk);T(nf.$$.fragment,eW),eW.forEach(t),ZU.forEach(t),a7=p(g2),uk=r(g2,"SPAN",{});var tW=a(uk);i7=n(tW,"FlaxBertForTokenClassification"),tW.forEach(t),g2.forEach(t),r1=p(i),ht=r(i,"DIV",{class:!0});var oo=a(ht);T(sf.$$.fragment,oo),l7=p(oo),mk=r(oo,"P",{});var oW=a(mk);d7=n(oW,`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.`),oW.forEach(t),c7=p(oo),rf=r(oo,"P",{});var _2=a(rf);p7=n(_2,"This model inherits from "),mm=r(_2,"A",{href:!0});var nW=a(mm);h7=n(nW,"FlaxPreTrainedModel"),nW.forEach(t),f7=n(_2,`. 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)`),_2.forEach(t),u7=p(oo),af=r(oo,"P",{});var b2=a(af);m7=n(b2,"This model is also a Flax Linen "),lf=r(b2,"A",{href:!0,rel:!0});var sW=a(lf);g7=n(sW,"flax.linen.Module"),sW.forEach(t),_7=n(b2,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),b2.forEach(t),b7=p(oo),gk=r(oo,"P",{});var rW=a(gk);v7=n(rW,"Finally, this model supports inherent JAX features such as:"),rW.forEach(t),k7=p(oo),Qo=r(oo,"UL",{});var Ni=a(Qo);_k=r(Ni,"LI",{});var aW=a(_k);df=r(aW,"A",{href:!0,rel:!0});var iW=a(df);y7=n(iW,"Just-In-Time (JIT) compilation"),iW.forEach(t),aW.forEach(t),T7=p(Ni),bk=r(Ni,"LI",{});var lW=a(bk);cf=r(lW,"A",{href:!0,rel:!0});var dW=a(cf);w7=n(dW,"Automatic Differentiation"),dW.forEach(t),lW.forEach(t),$7=p(Ni),vk=r(Ni,"LI",{});var cW=a(vk);pf=r(cW,"A",{href:!0,rel:!0});var pW=a(pf);F7=n(pW,"Vectorization"),pW.forEach(t),cW.forEach(t),x7=p(Ni),kk=r(Ni,"LI",{});var hW=a(kk);hf=r(hW,"A",{href:!0,rel:!0});var fW=a(hf);E7=n(fW,"Parallelization"),fW.forEach(t),hW.forEach(t),Ni.forEach(t),B7=p(oo),Eo=r(oo,"DIV",{class:!0});var Ii=a(Eo);T(ff.$$.fragment,Ii),M7=p(Ii),Ys=r(Ii,"P",{});var ng=a(Ys);z7=n(ng,"The "),yk=r(ng,"CODE",{});var uW=a(yk);P7=n(uW,"FlaxBertPreTrainedModel"),uW.forEach(t),j7=n(ng," forward method, overrides the "),Tk=r(ng,"CODE",{});var mW=a(Tk);q7=n(mW,"__call__"),mW.forEach(t),C7=n(ng," special method."),ng.forEach(t),A7=p(Ii),T(ti.$$.fragment,Ii),N7=p(Ii),T(oi.$$.fragment,Ii),Ii.forEach(t),oo.forEach(t),a1=p(i),Zs=r(i,"H2",{class:!0});var v2=a(Zs);ni=r(v2,"A",{id:!0,class:!0,href:!0});var gW=a(ni);wk=r(gW,"SPAN",{});var _W=a(wk);T(uf.$$.fragment,_W),_W.forEach(t),gW.forEach(t),I7=p(v2),$k=r(v2,"SPAN",{});var bW=a($k);O7=n(bW,"FlaxBertForQuestionAnswering"),bW.forEach(t),v2.forEach(t),i1=p(i),ft=r(i,"DIV",{class:!0});var no=a(ft);T(mf.$$.fragment,no),L7=p(no),er=r(no,"P",{});var sg=a(er);D7=n(sg,`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 `),Fk=r(sg,"CODE",{});var vW=a(Fk);S7=n(vW,"span start logits"),vW.forEach(t),U7=n(sg," and "),xk=r(sg,"CODE",{});var kW=a(xk);W7=n(kW,"span end logits"),kW.forEach(t),H7=n(sg,")."),sg.forEach(t),R7=p(no),gf=r(no,"P",{});var k2=a(gf);K7=n(k2,"This model inherits from "),gm=r(k2,"A",{href:!0});var yW=a(gm);Q7=n(yW,"FlaxPreTrainedModel"),yW.forEach(t),V7=n(k2,`. 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)`),k2.forEach(t),G7=p(no),_f=r(no,"P",{});var y2=a(_f);J7=n(y2,"This model is also a Flax Linen "),bf=r(y2,"A",{href:!0,rel:!0});var TW=a(bf);X7=n(TW,"flax.linen.Module"),TW.forEach(t),Y7=n(y2,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),y2.forEach(t),Z7=p(no),Ek=r(no,"P",{});var wW=a(Ek);e8=n(wW,"Finally, this model supports inherent JAX features such as:"),wW.forEach(t),t8=p(no),Vo=r(no,"UL",{});var Oi=a(Vo);Bk=r(Oi,"LI",{});var $W=a(Bk);vf=r($W,"A",{href:!0,rel:!0});var FW=a(vf);o8=n(FW,"Just-In-Time (JIT) compilation"),FW.forEach(t),$W.forEach(t),n8=p(Oi),Mk=r(Oi,"LI",{});var xW=a(Mk);kf=r(xW,"A",{href:!0,rel:!0});var EW=a(kf);s8=n(EW,"Automatic Differentiation"),EW.forEach(t),xW.forEach(t),r8=p(Oi),zk=r(Oi,"LI",{});var BW=a(zk);yf=r(BW,"A",{href:!0,rel:!0});var MW=a(yf);a8=n(MW,"Vectorization"),MW.forEach(t),BW.forEach(t),i8=p(Oi),Pk=r(Oi,"LI",{});var zW=a(Pk);Tf=r(zW,"A",{href:!0,rel:!0});var PW=a(Tf);l8=n(PW,"Parallelization"),PW.forEach(t),zW.forEach(t),Oi.forEach(t),d8=p(no),Bo=r(no,"DIV",{class:!0});var Li=a(Bo);T(wf.$$.fragment,Li),c8=p(Li),tr=r(Li,"P",{});var rg=a(tr);p8=n(rg,"The "),jk=r(rg,"CODE",{});var jW=a(jk);h8=n(jW,"FlaxBertPreTrainedModel"),jW.forEach(t),f8=n(rg," forward method, overrides the "),qk=r(rg,"CODE",{});var qW=a(qk);u8=n(qW,"__call__"),qW.forEach(t),m8=n(rg," special method."),rg.forEach(t),g8=p(Li),T(si.$$.fragment,Li),_8=p(Li),T(ri.$$.fragment,Li),Li.forEach(t),no.forEach(t),this.h()},h(){h(d,"name","hf:doc:metadata"),h(d,"content",JSON.stringify(sR)),h(m,"id","bert"),h(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(m,"href","#bert"),h(u,"class","relative group"),h(ee,"alt","Models"),CW(ee.src,B="https://img.shields.io/badge/All_model_pages-bert-blueviolet")||h(ee,"src",B),h(he,"href","https://huggingface.co/models?filter=bert"),h(fe,"alt","Spaces"),CW(fe.src,Le="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||h(fe,"src",Le),h(W,"href","https://huggingface.co/spaces/docs-demos/bert-base-uncased"),h(S,"class","flex flex-wrap space-x-1"),h(le,"id","overview"),h(le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(le,"href","#overview"),h(ie,"class","relative group"),h(ce,"href","https://arxiv.org/abs/1810.04805"),h(ce,"rel","nofollow"),h(Ue,"href","https://huggingface.co/thomwolf"),h(Ue,"rel","nofollow"),h(Z,"href","https://github.com/google-research/bert"),h(Z,"rel","nofollow"),h(rr,"id","resources"),h(rr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(rr,"href","#resources"),h(Nn,"class","relative group"),h(Wi,"href","https://www.philschmid.de/bert-text-classification-in-a-different-language"),h(Wi,"rel","nofollow"),h(Ri,"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(Ri,"rel","nofollow"),h(Qi,"href","https://colab.research.google.com/github/abhimishra91/transformers-tutorials/blob/master/transformers_multi_label_classification.ipynb"),h(Qi,"rel","nofollow"),h(Gi,"href","https://colab.research.google.com/github/patrickvonplaten/notebooks/blob/master/BERT2BERT_for_CNN_Dailymail.ipynb"),h(Gi,"rel","nofollow"),h(Hf,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertForSequenceClassification"),h(Ji,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/text-classification"),h(Ji,"rel","nofollow"),h(Xi,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification.ipynb"),h(Xi,"rel","nofollow"),h(Rf,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.TFBertForSequenceClassification"),h(Yi,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/text-classification"),h(Yi,"rel","nofollow"),h(Zi,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification-tf.ipynb"),h(Zi,"rel","nofollow"),h(Kf,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.FlaxBertForSequenceClassification"),h(el,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/text-classification"),h(el,"rel","nofollow"),h(tl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification_flax.ipynb"),h(tl,"rel","nofollow"),h(Qf,"href","../tasks/sequence_classification"),h(sl,"href","https://www.philschmid.de/huggingface-transformers-keras-tf"),h(sl,"rel","nofollow"),h(rl,"href","https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/Custom_Named_Entity_Recognition_with_BERT_only_first_wordpiece.ipynb"),h(rl,"rel","nofollow"),h(al,"href","https://github.com/NielsRogge/Transformers-Tutorials/blob/master/BERT/Custom_Named_Entity_Recognition_with_BERT.ipynb"),h(al,"rel","nofollow"),h(Vf,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertForTokenClassification"),h(il,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/token-classification"),h(il,"rel","nofollow"),h(ll,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/token_classification.ipynb"),h(ll,"rel","nofollow"),h(Gf,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.TFBertForTokenClassification"),h(dl,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/token-classification"),h(dl,"rel","nofollow"),h(cl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/token_classification-tf.ipynb"),h(cl,"rel","nofollow"),h(Jf,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.FlaxBertForTokenClassification"),h(pl,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/token-classification"),h(pl,"rel","nofollow"),h(hl,"href","https://huggingface.co/course/chapter7/2?fw=pt"),h(hl,"rel","nofollow"),h(Yf,"href","../tasks/token_classification"),h(Zf,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertForMaskedLM"),h(ul,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/language-modeling#robertabertdistilbert-and-masked-language-modeling"),h(ul,"rel","nofollow"),h(ml,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb"),h(ml,"rel","nofollow"),h(eu,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.TFBertForMaskedLM"),h(gl,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/language-modeling#run_mlmpy"),h(gl,"rel","nofollow"),h(_l,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb"),h(_l,"rel","nofollow"),h(tu,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.FlaxBertForMaskedLM"),h(bl,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/language-modeling#masked-language-modeling"),h(bl,"rel","nofollow"),h(vl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/masked_language_modeling_flax.ipynb"),h(vl,"rel","nofollow"),h(kl,"href","https://huggingface.co/course/chapter7/3?fw=pt"),h(kl,"rel","nofollow"),h(nu,"href","../tasks/masked_language_modeling"),h(su,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertForQuestionAnswering"),h(Tl,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/question-answering"),h(Tl,"rel","nofollow"),h(wl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/question_answering.ipynb"),h(wl,"rel","nofollow"),h(ru,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.TFBertForQuestionAnswering"),h($l,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/question-answering"),h($l,"rel","nofollow"),h(Fl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/question_answering-tf.ipynb"),h(Fl,"rel","nofollow"),h(au,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.FlaxBertForQuestionAnswering"),h(xl,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/question-answering"),h(xl,"rel","nofollow"),h(El,"href","https://huggingface.co/course/chapter7/7?fw=pt"),h(El,"rel","nofollow"),h(lu,"href","../tasks/question_answering"),h(cu,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertForMultipleChoice"),h(Bl,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/multiple-choice"),h(Bl,"rel","nofollow"),h(Ml,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice.ipynb"),h(Ml,"rel","nofollow"),h(pu,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.TFBertForMultipleChoice"),h(zl,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/multiple-choice"),h(zl,"rel","nofollow"),h(Pl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice-tf.ipynb"),h(Pl,"rel","nofollow"),h(hu,"href","../tasks/multiple_choice"),h(Cl,"href","https://huggingface.co/blog/bert-inferentia-sagemaker"),h(Cl,"rel","nofollow"),h(Nl,"href","https://www.philschmid.de/bert-deepspeed-inference"),h(Nl,"rel","nofollow"),h(Ll,"href","https://www.philschmid.de/pre-training-bert-habana"),h(Ll,"rel","nofollow"),h(Ul,"href","https://www.philschmid.de/convert-transformers-to-onnx"),h(Ul,"rel","nofollow"),h(Hl,"href","https://www.philschmid.de/getting-started-habana-gaudi#conclusion"),h(Hl,"rel","nofollow"),h(Kl,"href","https://www.philschmid.de/terraform-huggingface-amazon-sagemaker-advanced"),h(Kl,"rel","nofollow"),h(Vl,"href","https://www.philschmid.de/serverless-bert-with-huggingface-aws-lambda-docker"),h(Vl,"rel","nofollow"),h(Jl,"href","https://www.philschmid.de/huggingface-amazon-sagemaker-training-compiler"),h(Jl,"rel","nofollow"),h(Yl,"href","https://www.philschmid.de/knowledge-distillation-bert-transformers"),h(Yl,"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(On,"class","relative group"),h(uu,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertModel"),h(mu,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.TFBertModel"),h(td,"href","https://huggingface.co/bert-base-uncased"),h(td,"rel","nofollow"),h(gu,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(_u,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(so,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(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(Dn,"class","relative group"),h(bu,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),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(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(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(yu,"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(ur,"id","transformers.BertTokenizerFast"),h(ur,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ur,"href","#transformers.BertTokenizerFast"),h(Un,"class","relative group"),h(Tu,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),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(ao,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(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(Hn,"class","relative group"),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(fn,"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(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(Qn,"class","relative group"),h(Fu,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertForPreTraining"),h(Vn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(xu,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.TFBertForPreTraining"),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(Eu,"href","/docs/transformers/v4.29.0/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(Jn,"class","relative group"),h(Bu,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),h(Nd,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Nd,"rel","nofollow"),h(Od,"href","https://arxiv.org/abs/1706.03762"),h(Od,"rel","nofollow"),h(Mu,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertModel"),h(io,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(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($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(Yn,"class","relative group"),h(zu,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),h(Hd,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Hd,"rel","nofollow"),h(Pu,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertForPreTraining"),h(lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Er,"id","transformers.BertLMHeadModel"),h(Er,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Er,"href","#transformers.BertLMHeadModel"),h(ts,"class","relative group"),h(ju,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),h(Xd,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Xd,"rel","nofollow"),h(qu,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertLMHeadModel"),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(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(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(ns,"class","relative group"),h(Cu,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),h(sc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(sc,"rel","nofollow"),h(Au,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertForMaskedLM"),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(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(qr,"id","transformers.BertForNextSentencePrediction"),h(qr,"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(qr,"href","#transformers.BertForNextSentencePrediction"),h(rs,"class","relative group"),h(Nu,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),h(pc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(pc,"rel","nofollow"),h(Iu,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertForNextSentencePrediction"),h(ho,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Nr,"id","transformers.BertForSequenceClassification"),h(Nr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Nr,"href","#transformers.BertForSequenceClassification"),h(is,"class","relative group"),h(Ou,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),h(_c,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(_c,"rel","nofollow"),h(Lu,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertForSequenceClassification"),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(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(Dr,"id","transformers.BertForMultipleChoice"),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.BertForMultipleChoice"),h(ds,"class","relative group"),h(Du,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),h(wc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(wc,"rel","nofollow"),h(Su,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertForMultipleChoice"),h(fo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Wr,"id","transformers.BertForTokenClassification"),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.BertForTokenClassification"),h(ps,"class","relative group"),h(Uu,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),h(Mc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Mc,"rel","nofollow"),h(Wu,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertForTokenClassification"),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(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(Kr,"id","transformers.BertForQuestionAnswering"),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.BertForQuestionAnswering"),h(fs,"class","relative group"),h(Hu,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),h(Ac,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Ac,"rel","nofollow"),h(Ru,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertForQuestionAnswering"),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(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(Gr,"id","transformers.TFBertModel"),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.TFBertModel"),h(gs,"class","relative group"),h(Ku,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(Sc,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Sc,"rel","nofollow"),h(Qu,"href","/docs/transformers/v4.29.0/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(_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(Zr,"id","transformers.TFBertForPreTraining"),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.TFBertForPreTraining"),h(bs,"class","relative group"),h(Vu,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(Qc,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Qc,"rel","nofollow"),h(Gu,"href","/docs/transformers/v4.29.0/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(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(na,"id","transformers.TFBertLMHeadModel"),h(na,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(na,"href","#transformers.TFBertLMHeadModel"),h(ys,"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(Ts,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ra,"id","transformers.TFBertForMaskedLM"),h(ra,"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(ra,"href","#transformers.TFBertForMaskedLM"),h(ws,"class","relative group"),h(Ju,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(ap,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(ap,"rel","nofollow"),h(Xu,"href","/docs/transformers/v4.29.0/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(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(ca,"id","transformers.TFBertForNextSentencePrediction"),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.TFBertForNextSentencePrediction"),h(Fs,"class","relative group"),h(Yu,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(fp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(fp,"rel","nofollow"),h(Zu,"href","/docs/transformers/v4.29.0/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(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(ua,"id","transformers.TFBertForSequenceClassification"),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.TFBertForSequenceClassification"),h(Es,"class","relative group"),h(em,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(vp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(vp,"rel","nofollow"),h(tm,"href","/docs/transformers/v4.29.0/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(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(va,"id","transformers.TFBertForMultipleChoice"),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.TFBertForMultipleChoice"),h(Ms,"class","relative group"),h(om,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(Fp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Fp,"rel","nofollow"),h(nm,"href","/docs/transformers/v4.29.0/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(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(wa,"id","transformers.TFBertForTokenClassification"),h(wa,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(wa,"href","#transformers.TFBertForTokenClassification"),h(Ps,"class","relative group"),h(sm,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(Pp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Pp,"rel","nofollow"),h(rm,"href","/docs/transformers/v4.29.0/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(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(Ba,"id","transformers.TFBertForQuestionAnswering"),h(Ba,"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(Ba,"href","#transformers.TFBertForQuestionAnswering"),h(qs,"class","relative group"),h(am,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(Ip,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Ip,"rel","nofollow"),h(im,"href","/docs/transformers/v4.29.0/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($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(qa,"id","transformers.FlaxBertModel"),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.FlaxBertModel"),h(Ns,"class","relative group"),h(lm,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Wp,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Wp,"rel","nofollow"),h(Hp,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Hp,"rel","nofollow"),h(Rp,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Rp,"rel","nofollow"),h(Kp,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Kp,"rel","nofollow"),h(Qp,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Qp,"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(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(Na,"id","transformers.FlaxBertForPreTraining"),h(Na,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Na,"href","#transformers.FlaxBertForPreTraining"),h(Os,"class","relative group"),h(dm,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Zp,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Zp,"rel","nofollow"),h(eh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(eh,"rel","nofollow"),h(th,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(th,"rel","nofollow"),h(oh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(oh,"rel","nofollow"),h(nh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(nh,"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(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(La,"id","transformers.FlaxBertForCausalLM"),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.FlaxBertForCausalLM"),h(Ss,"class","relative group"),h(cm,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(dh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(dh,"rel","nofollow"),h(ch,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(ch,"rel","nofollow"),h(ph,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(ph,"rel","nofollow"),h(hh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(hh,"rel","nofollow"),h(fh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(fh,"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(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(Ua,"id","transformers.FlaxBertForMaskedLM"),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.FlaxBertForMaskedLM"),h(Ws,"class","relative group"),h(pm,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(kh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(kh,"rel","nofollow"),h(yh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(yh,"rel","nofollow"),h(Th,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Th,"rel","nofollow"),h(wh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(wh,"rel","nofollow"),h($h,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h($h,"rel","nofollow"),h(wo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ra,"id","transformers.FlaxBertForNextSentencePrediction"),h(Ra,"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(Ra,"href","#transformers.FlaxBertForNextSentencePrediction"),h(Rs,"class","relative group"),h(hm,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Ph,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Ph,"rel","nofollow"),h(jh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(jh,"rel","nofollow"),h(qh,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(qh,"rel","nofollow"),h(Ch,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Ch,"rel","nofollow"),h(Ah,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Ah,"rel","nofollow"),h($o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Va,"id","transformers.FlaxBertForSequenceClassification"),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.FlaxBertForSequenceClassification"),h(Qs,"class","relative group"),h(fm,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Sh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Sh,"rel","nofollow"),h(Uh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Uh,"rel","nofollow"),h(Wh,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Wh,"rel","nofollow"),h(Hh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Hh,"rel","nofollow"),h(Rh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Rh,"rel","nofollow"),h(Fo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Xa,"id","transformers.FlaxBertForMultipleChoice"),h(Xa,"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(Xa,"href","#transformers.FlaxBertForMultipleChoice"),h(Gs,"class","relative group"),h(um,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Xh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Xh,"rel","nofollow"),h(Yh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Yh,"rel","nofollow"),h(Zh,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Zh,"rel","nofollow"),h(ef,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(ef,"rel","nofollow"),h(tf,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(tf,"rel","nofollow"),h(xo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ei,"id","transformers.FlaxBertForTokenClassification"),h(ei,"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(ei,"href","#transformers.FlaxBertForTokenClassification"),h(Xs,"class","relative group"),h(mm,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(lf,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(lf,"rel","nofollow"),h(df,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(df,"rel","nofollow"),h(cf,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(cf,"rel","nofollow"),h(pf,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(pf,"rel","nofollow"),h(hf,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(hf,"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"),h(ni,"id","transformers.FlaxBertForQuestionAnswering"),h(ni,"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(ni,"href","#transformers.FlaxBertForQuestionAnswering"),h(Zs,"class","relative group"),h(gm,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(bf,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(bf,"rel","nofollow"),h(vf,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(vf,"rel","nofollow"),h(kf,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(kf,"rel","nofollow"),h(yf,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(yf,"rel","nofollow"),h(Tf,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Tf,"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(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(i,_){e(document.head,d),g(i,v,_),g(i,u,_),e(u,m),e(m,b),w(l,b,null),e(u,f),e(u,M),e(M,Me),g(i,we,_),g(i,S,_),e(S,he),e(he,ee),e(S,ze),e(S,W),e(W,fe),g(i,V,_),g(i,ie,_),e(ie,le),e(le,H),w(de,H,null),e(ie,Pe),e(ie,R),e(R,je),g(i,$e,_),g(i,U,_),e(U,qe),e(U,ce),e(ce,re),e(U,j),g(i,A,_),g(i,ue,_),e(ue,G),g(i,Fe,_),g(i,me,_),e(me,K),e(K,Ce),g(i,xe,_),g(i,q,_),e(q,_e),e(_e,J),g(i,Ee,_),g(i,ge,_),e(ge,X),g(i,Be,_),g(i,se,_),e(se,O),e(O,be),e(be,Y),e(se,Ae),e(se,te),e(te,C),e(C,Ne),e(se,I),e(se,pe),e(pe,ve),e(ve,k),e(pe,z),e(pe,Se),e(Se,oe),e(oe,Re),e(Se,Ke),e(Se,P),e(P,Qe),e(Se,Ve),e(Se,We),e(We,Ge),e(se,Je),e(se,L),e(L,Q),e(Q,Xe),g(i,He,_),g(i,D,_),e(D,Ye),e(D,Ue),e(Ue,Ie),e(D,Ze),e(D,Z),e(Z,et),e(D,w2),g(i,jy,_),g(i,Nn,_),e(Nn,rr),e(rr,ag),w(Di,ag,null),e(Nn,$2),e(Nn,ig),e(ig,F2),g(i,qy,_),g(i,Wf,_),e(Wf,x2),g(i,Cy,_),w(Si,i,_),g(i,Ay,_),g(i,tt,_),e(tt,Ui),e(Ui,E2),e(Ui,Wi),e(Wi,B2),e(Ui,M2),e(tt,z2),e(tt,Hi),e(Hi,P2),e(Hi,Ri),e(Ri,j2),e(Hi,q2),e(tt,C2),e(tt,Ki),e(Ki,A2),e(Ki,Qi),e(Qi,N2),e(Ki,I2),e(tt,O2),e(tt,Vi),e(Vi,L2),e(Vi,Gi),e(Gi,D2),e(Vi,S2),e(tt,U2),e(tt,Jo),e(Jo,Hf),e(Hf,W2),e(Jo,H2),e(Jo,Ji),e(Ji,R2),e(Jo,K2),e(Jo,Xi),e(Xi,Q2),e(Jo,V2),e(tt,G2),e(tt,Xo),e(Xo,Rf),e(Rf,J2),e(Xo,X2),e(Xo,Yi),e(Yi,Y2),e(Xo,Z2),e(Xo,Zi),e(Zi,e0),e(Xo,t0),e(tt,o0),e(tt,Yo),e(Yo,Kf),e(Kf,n0),e(Yo,s0),e(Yo,el),e(el,r0),e(Yo,a0),e(Yo,tl),e(tl,i0),e(Yo,l0),e(tt,d0),e(tt,lg),e(lg,Qf),e(Qf,c0),g(i,Ny,_),w(ol,i,_),g(i,Iy,_),g(i,mt,_),e(mt,nl),e(nl,p0),e(nl,sl),e(sl,h0),e(nl,f0),e(mt,u0),e(mt,In),e(In,m0),e(In,rl),e(rl,g0),e(In,_0),e(In,al),e(al,b0),e(In,v0),e(mt,k0),e(mt,Zo),e(Zo,Vf),e(Vf,y0),e(Zo,T0),e(Zo,il),e(il,w0),e(Zo,$0),e(Zo,ll),e(ll,F0),e(Zo,x0),e(mt,E0),e(mt,en),e(en,Gf),e(Gf,B0),e(en,M0),e(en,dl),e(dl,z0),e(en,P0),e(en,cl),e(cl,j0),e(en,q0),e(mt,C0),e(mt,ar),e(ar,Jf),e(Jf,A0),e(ar,N0),e(ar,pl),e(pl,I0),e(ar,O0),e(mt,L0),e(mt,Xf),e(Xf,hl),e(hl,D0),e(Xf,S0),e(mt,U0),e(mt,dg),e(dg,Yf),e(Yf,W0),g(i,Oy,_),w(fl,i,_),g(i,Ly,_),g(i,Ot,_),e(Ot,tn),e(tn,Zf),e(Zf,H0),e(tn,R0),e(tn,ul),e(ul,K0),e(tn,Q0),e(tn,ml),e(ml,V0),e(tn,G0),e(Ot,J0),e(Ot,on),e(on,eu),e(eu,X0),e(on,Y0),e(on,gl),e(gl,Z0),e(on,e$),e(on,_l),e(_l,t$),e(on,o$),e(Ot,n$),e(Ot,nn),e(nn,tu),e(tu,s$),e(nn,r$),e(nn,bl),e(bl,a$),e(nn,i$),e(nn,vl),e(vl,l$),e(nn,d$),e(Ot,c$),e(Ot,ou),e(ou,kl),e(kl,p$),e(ou,h$),e(Ot,f$),e(Ot,cg),e(cg,nu),e(nu,u$),g(i,Dy,_),w(yl,i,_),g(i,Sy,_),g(i,Lt,_),e(Lt,sn),e(sn,su),e(su,m$),e(sn,g$),e(sn,Tl),e(Tl,_$),e(sn,b$),e(sn,wl),e(wl,v$),e(sn,k$),e(Lt,y$),e(Lt,rn),e(rn,ru),e(ru,T$),e(rn,w$),e(rn,$l),e($l,$$),e(rn,F$),e(rn,Fl),e(Fl,x$),e(rn,E$),e(Lt,B$),e(Lt,ir),e(ir,au),e(au,M$),e(ir,z$),e(ir,xl),e(xl,P$),e(ir,j$),e(Lt,q$),e(Lt,iu),e(iu,El),e(El,C$),e(iu,A$),e(Lt,N$),e(Lt,pg),e(pg,lu),e(lu,I$),g(i,Uy,_),g(i,du,_),e(du,hg),e(hg,O$),g(i,Wy,_),g(i,an,_),e(an,ln),e(ln,cu),e(cu,L$),e(ln,D$),e(ln,Bl),e(Bl,S$),e(ln,U$),e(ln,Ml),e(Ml,W$),e(ln,H$),e(an,R$),e(an,dn),e(dn,pu),e(pu,K$),e(dn,Q$),e(dn,zl),e(zl,V$),e(dn,G$),e(dn,Pl),e(Pl,J$),e(dn,X$),e(an,Y$),e(an,fg),e(fg,hu),e(hu,Z$),g(i,Hy,_),g(i,jl,_),e(jl,eF),e(jl,ug),e(ug,tF),g(i,Ry,_),g(i,lr,_),e(lr,ql),e(ql,oF),e(ql,Cl),e(Cl,nF),e(ql,sF),e(lr,rF),e(lr,Al),e(Al,aF),e(Al,Nl),e(Nl,iF),e(Al,lF),g(i,Ky,_),g(i,Il,_),e(Il,dF),e(Il,mg),e(mg,cF),g(i,Qy,_),g(i,fu,_),e(fu,Ol),e(Ol,pF),e(Ol,Ll),e(Ll,hF),e(Ol,fF),g(i,Vy,_),g(i,Dl,_),e(Dl,uF),e(Dl,gg),e(gg,mF),g(i,Gy,_),g(i,xt,_),e(xt,Sl),e(Sl,gF),e(Sl,Ul),e(Ul,_F),e(Sl,bF),e(xt,vF),e(xt,Wl),e(Wl,kF),e(Wl,Hl),e(Hl,yF),e(Wl,TF),e(xt,wF),e(xt,Rl),e(Rl,$F),e(Rl,Kl),e(Kl,FF),e(Rl,xF),e(xt,EF),e(xt,Ql),e(Ql,BF),e(Ql,Vl),e(Vl,MF),e(Ql,zF),e(xt,PF),e(xt,Gl),e(Gl,jF),e(Gl,Jl),e(Jl,qF),e(Gl,CF),e(xt,AF),e(xt,Xl),e(Xl,NF),e(Xl,Yl),e(Yl,IF),e(Xl,OF),g(i,Jy,_),g(i,On,_),e(On,dr),e(dr,_g),w(Zl,_g,null),e(On,LF),e(On,bg),e(bg,DF),g(i,Xy,_),g(i,so,_),w(ed,so,null),e(so,SF),e(so,Oo),e(Oo,UF),e(Oo,uu),e(uu,WF),e(Oo,HF),e(Oo,mu),e(mu,RF),e(Oo,KF),e(Oo,td),e(td,QF),e(Oo,VF),e(so,GF),e(so,Ln),e(Ln,JF),e(Ln,gu),e(gu,XF),e(Ln,YF),e(Ln,_u),e(_u,ZF),e(Ln,ex),e(so,tx),w(cr,so,null),g(i,Yy,_),g(i,Dn,_),e(Dn,pr),e(pr,vg),w(od,vg,null),e(Dn,ox),e(Dn,kg),e(kg,nx),g(i,Zy,_),g(i,ot,_),w(nd,ot,null),e(ot,sx),e(ot,yg),e(yg,rx),e(ot,ax),e(ot,sd),e(sd,ix),e(sd,bu),e(bu,lx),e(sd,dx),e(ot,cx),e(ot,cn),w(rd,cn,null),e(cn,px),e(cn,Tg),e(Tg,hx),e(cn,fx),e(cn,ad),e(ad,vu),e(vu,ux),e(vu,wg),e(wg,mx),e(ad,gx),e(ad,ku),e(ku,_x),e(ku,$g),e($g,bx),e(ot,vx),e(ot,hr),w(id,hr,null),e(hr,kx),e(hr,ld),e(ld,yx),e(ld,Fg),e(Fg,Tx),e(ld,wx),e(ot,$x),e(ot,ro),w(dd,ro,null),e(ro,Fx),e(ro,xg),e(xg,xx),e(ro,Ex),w(fr,ro,null),e(ro,Bx),e(ro,Sn),e(Sn,Mx),e(Sn,Eg),e(Eg,zx),e(Sn,Px),e(Sn,Bg),e(Bg,jx),e(Sn,qx),e(ot,Cx),e(ot,yu),w(cd,yu,null),g(i,eT,_),g(i,Un,_),e(Un,ur),e(ur,Mg),w(pd,Mg,null),e(Un,Ax),e(Un,zg),e(zg,Nx),g(i,tT,_),g(i,Bt,_),w(hd,Bt,null),e(Bt,Ix),e(Bt,fd),e(fd,Ox),e(fd,Pg),e(Pg,Lx),e(fd,Dx),e(Bt,Sx),e(Bt,ud),e(ud,Ux),e(ud,Tu),e(Tu,Wx),e(ud,Hx),e(Bt,Rx),e(Bt,pn),w(md,pn,null),e(pn,Kx),e(pn,jg),e(jg,Qx),e(pn,Vx),e(pn,gd),e(gd,wu),e(wu,Gx),e(wu,qg),e(qg,Jx),e(gd,Xx),e(gd,$u),e($u,Yx),e($u,Cg),e(Cg,Zx),e(Bt,e4),e(Bt,ao),w(_d,ao,null),e(ao,t4),e(ao,Ag),e(Ag,o4),e(ao,n4),w(mr,ao,null),e(ao,s4),e(ao,Wn),e(Wn,r4),e(Wn,Ng),e(Ng,a4),e(Wn,i4),e(Wn,Ig),e(Ig,l4),e(Wn,d4),g(i,oT,_),g(i,Hn,_),e(Hn,gr),e(gr,Og),w(bd,Og,null),e(Hn,c4),e(Hn,Lg),e(Lg,p4),g(i,nT,_),g(i,Mt,_),w(vd,Mt,null),e(Mt,h4),e(Mt,Rn),e(Rn,f4),e(Rn,Dg),e(Dg,u4),e(Rn,m4),e(Rn,Sg),e(Sg,g4),e(Rn,_4),e(Mt,b4),e(Mt,kd),e(kd,v4),e(kd,Ug),e(Ug,k4),e(kd,y4),e(Mt,T4),e(Mt,hn),w(yd,hn,null),e(hn,w4),e(hn,Td),e(Td,$4),e(Td,Wg),e(Wg,F4),e(Td,x4),e(hn,E4),w(_r,hn,null),e(Mt,B4),e(Mt,fn),w(wd,fn,null),e(fn,M4),e(fn,Kn),e(Kn,z4),e(Kn,Hg),e(Hg,P4),e(Kn,j4),e(Kn,Rg),e(Rg,q4),e(Kn,C4),e(fn,A4),w(br,fn,null),g(i,sT,_),g(i,Qn,_),e(Qn,vr),e(vr,Kg),w($d,Kg,null),e(Qn,N4),e(Qn,Qg),e(Qg,I4),g(i,rT,_),g(i,Vn,_),w(Fd,Vn,null),e(Vn,O4),e(Vn,xd),e(xd,L4),e(xd,Fu),e(Fu,D4),e(xd,S4),g(i,aT,_),g(i,Gn,_),w(Ed,Gn,null),e(Gn,U4),e(Gn,Bd),e(Bd,W4),e(Bd,xu),e(xu,H4),e(Bd,R4),g(i,iT,_),g(i,Lo,_),w(Md,Lo,null),e(Lo,K4),e(Lo,zd),e(zd,Q4),e(zd,Eu),e(Eu,V4),e(zd,G4),e(Lo,J4),e(Lo,kr),w(Pd,kr,null),e(kr,X4),e(kr,Vg),e(Vg,Y4),g(i,lT,_),g(i,Jn,_),e(Jn,yr),e(yr,Gg),w(jd,Gg,null),e(Jn,Z4),e(Jn,Jg),e(Jg,eE),g(i,dT,_),g(i,nt,_),w(qd,nt,null),e(nt,tE),e(nt,Xg),e(Xg,oE),e(nt,nE),e(nt,Cd),e(Cd,sE),e(Cd,Bu),e(Bu,rE),e(Cd,aE),e(nt,iE),e(nt,Ad),e(Ad,lE),e(Ad,Nd),e(Nd,dE),e(Ad,cE),e(nt,pE),e(nt,Id),e(Id,hE),e(Id,Od),e(Od,fE),e(Id,uE),e(nt,mE),e(nt,gt),e(gt,gE),e(gt,Yg),e(Yg,_E),e(gt,bE),e(gt,Zg),e(Zg,vE),e(gt,kE),e(gt,e_),e(e_,yE),e(gt,TE),e(gt,t_),e(t_,wE),e(gt,$E),e(gt,o_),e(o_,FE),e(gt,xE),e(gt,n_),e(n_,EE),e(gt,BE),e(nt,ME),e(nt,io),w(Ld,io,null),e(io,zE),e(io,Xn),e(Xn,PE),e(Xn,Mu),e(Mu,jE),e(Xn,qE),e(Xn,s_),e(s_,CE),e(Xn,AE),e(io,NE),w(Tr,io,null),e(io,IE),w(wr,io,null),g(i,cT,_),g(i,Yn,_),e(Yn,$r),e($r,r_),w(Dd,r_,null),e(Yn,OE),e(Yn,a_),e(a_,LE),g(i,pT,_),g(i,zt,_),w(Sd,zt,null),e(zt,DE),e(zt,Zn),e(Zn,SE),e(Zn,i_),e(i_,UE),e(Zn,WE),e(Zn,l_),e(l_,HE),e(Zn,RE),e(zt,KE),e(zt,Ud),e(Ud,QE),e(Ud,zu),e(zu,VE),e(Ud,GE),e(zt,JE),e(zt,Wd),e(Wd,XE),e(Wd,Hd),e(Hd,YE),e(Wd,ZE),e(zt,eB),e(zt,lo),w(Rd,lo,null),e(lo,tB),e(lo,es),e(es,oB),e(es,Pu),e(Pu,nB),e(es,sB),e(es,d_),e(d_,rB),e(es,aB),e(lo,iB),w(Fr,lo,null),e(lo,lB),w(xr,lo,null),g(i,hT,_),g(i,ts,_),e(ts,Er),e(Er,c_),w(Kd,c_,null),e(ts,dB),e(ts,p_),e(p_,cB),g(i,fT,_),g(i,Pt,_),w(Qd,Pt,null),e(Pt,pB),e(Pt,Vd),e(Vd,hB),e(Vd,h_),e(h_,fB),e(Vd,uB),e(Pt,mB),e(Pt,Gd),e(Gd,gB),e(Gd,ju),e(ju,_B),e(Gd,bB),e(Pt,vB),e(Pt,Jd),e(Jd,kB),e(Jd,Xd),e(Xd,yB),e(Jd,TB),e(Pt,wB),e(Pt,co),w(Yd,co,null),e(co,$B),e(co,os),e(os,FB),e(os,qu),e(qu,xB),e(os,EB),e(os,f_),e(f_,BB),e(os,MB),e(co,zB),w(Br,co,null),e(co,PB),w(Mr,co,null),g(i,uT,_),g(i,ns,_),e(ns,zr),e(zr,u_),w(Zd,u_,null),e(ns,jB),e(ns,m_),e(m_,qB),g(i,mT,_),g(i,jt,_),w(ec,jt,null),e(jt,CB),e(jt,tc),e(tc,AB),e(tc,g_),e(g_,NB),e(tc,IB),e(jt,OB),e(jt,oc),e(oc,LB),e(oc,Cu),e(Cu,DB),e(oc,SB),e(jt,UB),e(jt,nc),e(nc,WB),e(nc,sc),e(sc,HB),e(nc,RB),e(jt,KB),e(jt,po),w(rc,po,null),e(po,QB),e(po,ss),e(ss,VB),e(ss,Au),e(Au,GB),e(ss,JB),e(ss,__),e(__,XB),e(ss,YB),e(po,ZB),w(Pr,po,null),e(po,eM),w(jr,po,null),g(i,gT,_),g(i,rs,_),e(rs,qr),e(qr,b_),w(ac,b_,null),e(rs,tM),e(rs,v_),e(v_,oM),g(i,_T,_),g(i,qt,_),w(ic,qt,null),e(qt,nM),e(qt,lc),e(lc,sM),e(lc,k_),e(k_,rM),e(lc,aM),e(qt,iM),e(qt,dc),e(dc,lM),e(dc,Nu),e(Nu,dM),e(dc,cM),e(qt,pM),e(qt,cc),e(cc,hM),e(cc,pc),e(pc,fM),e(cc,uM),e(qt,mM),e(qt,ho),w(hc,ho,null),e(ho,gM),e(ho,as),e(as,_M),e(as,Iu),e(Iu,bM),e(as,vM),e(as,y_),e(y_,kM),e(as,yM),e(ho,TM),w(Cr,ho,null),e(ho,wM),w(Ar,ho,null),g(i,bT,_),g(i,is,_),e(is,Nr),e(Nr,T_),w(fc,T_,null),e(is,$M),e(is,w_),e(w_,FM),g(i,vT,_),g(i,Ct,_),w(uc,Ct,null),e(Ct,xM),e(Ct,$_),e($_,EM),e(Ct,BM),e(Ct,mc),e(mc,MM),e(mc,Ou),e(Ou,zM),e(mc,PM),e(Ct,jM),e(Ct,gc),e(gc,qM),e(gc,_c),e(_c,CM),e(gc,AM),e(Ct,NM),e(Ct,Dt),w(bc,Dt,null),e(Dt,IM),e(Dt,ls),e(ls,OM),e(ls,Lu),e(Lu,LM),e(ls,DM),e(ls,F_),e(F_,SM),e(ls,UM),e(Dt,WM),w(Ir,Dt,null),e(Dt,HM),w(Or,Dt,null),e(Dt,RM),w(Lr,Dt,null),g(i,kT,_),g(i,ds,_),e(ds,Dr),e(Dr,x_),w(vc,x_,null),e(ds,KM),e(ds,E_),e(E_,QM),g(i,yT,_),g(i,At,_),w(kc,At,null),e(At,VM),e(At,B_),e(B_,GM),e(At,JM),e(At,yc),e(yc,XM),e(yc,Du),e(Du,YM),e(yc,ZM),e(At,ez),e(At,Tc),e(Tc,tz),e(Tc,wc),e(wc,oz),e(Tc,nz),e(At,sz),e(At,fo),w($c,fo,null),e(fo,rz),e(fo,cs),e(cs,az),e(cs,Su),e(Su,iz),e(cs,lz),e(cs,M_),e(M_,dz),e(cs,cz),e(fo,pz),w(Sr,fo,null),e(fo,hz),w(Ur,fo,null),g(i,TT,_),g(i,ps,_),e(ps,Wr),e(Wr,z_),w(Fc,z_,null),e(ps,fz),e(ps,P_),e(P_,uz),g(i,wT,_),g(i,Nt,_),w(xc,Nt,null),e(Nt,mz),e(Nt,j_),e(j_,gz),e(Nt,_z),e(Nt,Ec),e(Ec,bz),e(Ec,Uu),e(Uu,vz),e(Ec,kz),e(Nt,yz),e(Nt,Bc),e(Bc,Tz),e(Bc,Mc),e(Mc,wz),e(Bc,$z),e(Nt,Fz),e(Nt,uo),w(zc,uo,null),e(uo,xz),e(uo,hs),e(hs,Ez),e(hs,Wu),e(Wu,Bz),e(hs,Mz),e(hs,q_),e(q_,zz),e(hs,Pz),e(uo,jz),w(Hr,uo,null),e(uo,qz),w(Rr,uo,null),g(i,$T,_),g(i,fs,_),e(fs,Kr),e(Kr,C_),w(Pc,C_,null),e(fs,Cz),e(fs,A_),e(A_,Az),g(i,FT,_),g(i,It,_),w(jc,It,null),e(It,Nz),e(It,us),e(us,Iz),e(us,N_),e(N_,Oz),e(us,Lz),e(us,I_),e(I_,Dz),e(us,Sz),e(It,Uz),e(It,qc),e(qc,Wz),e(qc,Hu),e(Hu,Hz),e(qc,Rz),e(It,Kz),e(It,Cc),e(Cc,Qz),e(Cc,Ac),e(Ac,Vz),e(Cc,Gz),e(It,Jz),e(It,mo),w(Nc,mo,null),e(mo,Xz),e(mo,ms),e(ms,Yz),e(ms,Ru),e(Ru,Zz),e(ms,eP),e(ms,O_),e(O_,tP),e(ms,oP),e(mo,nP),w(Qr,mo,null),e(mo,sP),w(Vr,mo,null),g(i,xT,_),g(i,gs,_),e(gs,Gr),e(Gr,L_),w(Ic,L_,null),e(gs,rP),e(gs,D_),e(D_,aP),g(i,ET,_),g(i,_t,_),w(Oc,_t,null),e(_t,iP),e(_t,S_),e(S_,lP),e(_t,dP),e(_t,Lc),e(Lc,cP),e(Lc,Ku),e(Ku,pP),e(Lc,hP),e(_t,fP),e(_t,Dc),e(Dc,uP),e(Dc,Sc),e(Sc,mP),e(Dc,gP),e(_t,_P),w(Jr,_t,null),e(_t,bP),e(_t,go),w(Uc,go,null),e(go,vP),e(go,_s),e(_s,kP),e(_s,Qu),e(Qu,yP),e(_s,TP),e(_s,U_),e(U_,wP),e(_s,$P),e(go,FP),w(Xr,go,null),e(go,xP),w(Yr,go,null),g(i,BT,_),g(i,bs,_),e(bs,Zr),e(Zr,W_),w(Wc,W_,null),e(bs,EP),e(bs,H_),e(H_,BP),g(i,MT,_),g(i,bt,_),w(Hc,bt,null),e(bt,MP),e(bt,vs),e(vs,zP),e(vs,R_),e(R_,PP),e(vs,jP),e(vs,K_),e(K_,qP),e(vs,CP),e(bt,AP),e(bt,Rc),e(Rc,NP),e(Rc,Vu),e(Vu,IP),e(Rc,OP),e(bt,LP),e(bt,Kc),e(Kc,DP),e(Kc,Qc),e(Qc,SP),e(Kc,UP),e(bt,WP),w(ea,bt,null),e(bt,HP),e(bt,_o),w(Vc,_o,null),e(_o,RP),e(_o,ks),e(ks,KP),e(ks,Gu),e(Gu,QP),e(ks,VP),e(ks,Q_),e(Q_,GP),e(ks,JP),e(_o,XP),w(ta,_o,null),e(_o,YP),w(oa,_o,null),g(i,zT,_),g(i,ys,_),e(ys,na),e(na,V_),w(Gc,V_,null),e(ys,ZP),e(ys,G_),e(G_,e9),g(i,PT,_),g(i,Ts,_),w(Jc,Ts,null),e(Ts,t9),e(Ts,St),w(Xc,St,null),e(St,o9),e(St,st),e(st,n9),e(st,J_),e(J_,s9),e(st,r9),e(st,X_),e(X_,a9),e(st,i9),e(st,Y_),e(Y_,l9),e(st,d9),e(st,Z_),e(Z_,c9),e(st,p9),e(st,eb),e(eb,h9),e(st,f9),e(st,tb),e(tb,u9),e(st,m9),e(st,ob),e(ob,g9),e(st,_9),e(St,b9),e(St,Yc),e(Yc,Zc),e(Zc,v9),e(Zc,nb),e(nb,k9),e(Zc,y9),e(Yc,T9),e(Yc,ep),e(ep,w9),e(ep,sb),e(sb,$9),e(ep,F9),e(St,x9),e(St,ne),e(ne,E9),e(ne,rb),e(rb,B9),e(ne,M9),e(ne,ab),e(ab,z9),e(ne,P9),e(ne,ib),e(ib,j9),e(ne,q9),e(ne,lb),e(lb,C9),e(ne,A9),e(ne,db),e(db,N9),e(ne,I9),e(ne,cb),e(cb,O9),e(ne,L9),e(ne,pb),e(pb,D9),e(ne,S9),e(ne,hb),e(hb,U9),e(ne,W9),e(ne,fb),e(fb,H9),e(ne,R9),e(ne,ub),e(ub,K9),e(ne,Q9),e(ne,mb),e(mb,V9),e(ne,G9),e(ne,gb),e(gb,J9),e(ne,X9),e(ne,_b),e(_b,Y9),e(ne,Z9),e(ne,bb),e(bb,ej),e(ne,tj),e(ne,vb),e(vb,oj),e(ne,nj),e(ne,kb),e(kb,sj),e(ne,rj),e(ne,yb),e(yb,aj),e(ne,ij),e(ne,Tb),e(Tb,lj),e(ne,dj),e(ne,wb),e(wb,cj),e(ne,pj),e(ne,$b),e($b,hj),e(ne,fj),e(St,uj),w(sa,St,null),g(i,jT,_),g(i,ws,_),e(ws,ra),e(ra,Fb),w(tp,Fb,null),e(ws,mj),e(ws,xb),e(xb,gj),g(i,qT,_),g(i,vt,_),w(op,vt,null),e(vt,_j),e(vt,np),e(np,bj),e(np,Eb),e(Eb,vj),e(np,kj),e(vt,yj),e(vt,sp),e(sp,Tj),e(sp,Ju),e(Ju,wj),e(sp,$j),e(vt,Fj),e(vt,rp),e(rp,xj),e(rp,ap),e(ap,Ej),e(rp,Bj),e(vt,Mj),w(aa,vt,null),e(vt,zj),e(vt,Ut),w(ip,Ut,null),e(Ut,Pj),e(Ut,$s),e($s,jj),e($s,Xu),e(Xu,qj),e($s,Cj),e($s,Bb),e(Bb,Aj),e($s,Nj),e(Ut,Ij),w(ia,Ut,null),e(Ut,Oj),w(la,Ut,null),e(Ut,Lj),w(da,Ut,null),g(i,CT,_),g(i,Fs,_),e(Fs,ca),e(ca,Mb),w(lp,Mb,null),e(Fs,Dj),e(Fs,zb),e(zb,Sj),g(i,AT,_),g(i,kt,_),w(dp,kt,null),e(kt,Uj),e(kt,cp),e(cp,Wj),e(cp,Pb),e(Pb,Hj),e(cp,Rj),e(kt,Kj),e(kt,pp),e(pp,Qj),e(pp,Yu),e(Yu,Vj),e(pp,Gj),e(kt,Jj),e(kt,hp),e(hp,Xj),e(hp,fp),e(fp,Yj),e(hp,Zj),e(kt,eq),w(pa,kt,null),e(kt,tq),e(kt,bo),w(up,bo,null),e(bo,oq),e(bo,xs),e(xs,nq),e(xs,Zu),e(Zu,sq),e(xs,rq),e(xs,jb),e(jb,aq),e(xs,iq),e(bo,lq),w(ha,bo,null),e(bo,dq),w(fa,bo,null),g(i,NT,_),g(i,Es,_),e(Es,ua),e(ua,qb),w(mp,qb,null),e(Es,cq),e(Es,Cb),e(Cb,pq),g(i,IT,_),g(i,yt,_),w(gp,yt,null),e(yt,hq),e(yt,Ab),e(Ab,fq),e(yt,uq),e(yt,_p),e(_p,mq),e(_p,em),e(em,gq),e(_p,_q),e(yt,bq),e(yt,bp),e(bp,vq),e(bp,vp),e(vp,kq),e(bp,yq),e(yt,Tq),w(ma,yt,null),e(yt,wq),e(yt,Wt),w(kp,Wt,null),e(Wt,$q),e(Wt,Bs),e(Bs,Fq),e(Bs,tm),e(tm,xq),e(Bs,Eq),e(Bs,Nb),e(Nb,Bq),e(Bs,Mq),e(Wt,zq),w(ga,Wt,null),e(Wt,Pq),w(_a,Wt,null),e(Wt,jq),w(ba,Wt,null),g(i,OT,_),g(i,Ms,_),e(Ms,va),e(va,Ib),w(yp,Ib,null),e(Ms,qq),e(Ms,Ob),e(Ob,Cq),g(i,LT,_),g(i,Tt,_),w(Tp,Tt,null),e(Tt,Aq),e(Tt,Lb),e(Lb,Nq),e(Tt,Iq),e(Tt,wp),e(wp,Oq),e(wp,om),e(om,Lq),e(wp,Dq),e(Tt,Sq),e(Tt,$p),e($p,Uq),e($p,Fp),e(Fp,Wq),e($p,Hq),e(Tt,Rq),w(ka,Tt,null),e(Tt,Kq),e(Tt,vo),w(xp,vo,null),e(vo,Qq),e(vo,zs),e(zs,Vq),e(zs,nm),e(nm,Gq),e(zs,Jq),e(zs,Db),e(Db,Xq),e(zs,Yq),e(vo,Zq),w(ya,vo,null),e(vo,e3),w(Ta,vo,null),g(i,DT,_),g(i,Ps,_),e(Ps,wa),e(wa,Sb),w(Ep,Sb,null),e(Ps,t3),e(Ps,Ub),e(Ub,o3),g(i,ST,_),g(i,wt,_),w(Bp,wt,null),e(wt,n3),e(wt,Wb),e(Wb,s3),e(wt,r3),e(wt,Mp),e(Mp,a3),e(Mp,sm),e(sm,i3),e(Mp,l3),e(wt,d3),e(wt,zp),e(zp,c3),e(zp,Pp),e(Pp,p3),e(zp,h3),e(wt,f3),w($a,wt,null),e(wt,u3),e(wt,Ht),w(jp,Ht,null),e(Ht,m3),e(Ht,js),e(js,g3),e(js,rm),e(rm,_3),e(js,b3),e(js,Hb),e(Hb,v3),e(js,k3),e(Ht,y3),w(Fa,Ht,null),e(Ht,T3),w(xa,Ht,null),e(Ht,w3),w(Ea,Ht,null),g(i,UT,_),g(i,qs,_),e(qs,Ba),e(Ba,Rb),w(qp,Rb,null),e(qs,$3),e(qs,Kb),e(Kb,F3),g(i,WT,_),g(i,$t,_),w(Cp,$t,null),e($t,x3),e($t,Cs),e(Cs,E3),e(Cs,Qb),e(Qb,B3),e(Cs,M3),e(Cs,Vb),e(Vb,z3),e(Cs,P3),e($t,j3),e($t,Ap),e(Ap,q3),e(Ap,am),e(am,C3),e(Ap,A3),e($t,N3),e($t,Np),e(Np,I3),e(Np,Ip),e(Ip,O3),e(Np,L3),e($t,D3),w(Ma,$t,null),e($t,S3),e($t,Rt),w(Op,Rt,null),e(Rt,U3),e(Rt,As),e(As,W3),e(As,im),e(im,H3),e(As,R3),e(As,Gb),e(Gb,K3),e(As,Q3),e(Rt,V3),w(za,Rt,null),e(Rt,G3),w(Pa,Rt,null),e(Rt,J3),w(ja,Rt,null),g(i,HT,_),g(i,Ns,_),e(Ns,qa),e(qa,Jb),w(Lp,Jb,null),e(Ns,X3),e(Ns,Xb),e(Xb,Y3),g(i,RT,_),g(i,rt,_),w(Dp,rt,null),e(rt,Z3),e(rt,Yb),e(Yb,eC),e(rt,tC),e(rt,Sp),e(Sp,oC),e(Sp,lm),e(lm,nC),e(Sp,sC),e(rt,rC),e(rt,Up),e(Up,aC),e(Up,Wp),e(Wp,iC),e(Up,lC),e(rt,dC),e(rt,Zb),e(Zb,cC),e(rt,pC),e(rt,Do),e(Do,ev),e(ev,Hp),e(Hp,hC),e(Do,fC),e(Do,tv),e(tv,Rp),e(Rp,uC),e(Do,mC),e(Do,ov),e(ov,Kp),e(Kp,gC),e(Do,_C),e(Do,nv),e(nv,Qp),e(Qp,bC),e(rt,vC),e(rt,ko),w(Vp,ko,null),e(ko,kC),e(ko,Is),e(Is,yC),e(Is,sv),e(sv,TC),e(Is,wC),e(Is,rv),e(rv,$C),e(Is,FC),e(ko,xC),w(Ca,ko,null),e(ko,EC),w(Aa,ko,null),g(i,KT,_),g(i,Os,_),e(Os,Na),e(Na,av),w(Gp,av,null),e(Os,BC),e(Os,iv),e(iv,MC),g(i,QT,_),g(i,at,_),w(Jp,at,null),e(at,zC),e(at,Ls),e(Ls,PC),e(Ls,lv),e(lv,jC),e(Ls,qC),e(Ls,dv),e(dv,CC),e(Ls,AC),e(at,NC),e(at,Xp),e(Xp,IC),e(Xp,dm),e(dm,OC),e(Xp,LC),e(at,DC),e(at,Yp),e(Yp,SC),e(Yp,Zp),e(Zp,UC),e(Yp,WC),e(at,HC),e(at,cv),e(cv,RC),e(at,KC),e(at,So),e(So,pv),e(pv,eh),e(eh,QC),e(So,VC),e(So,hv),e(hv,th),e(th,GC),e(So,JC),e(So,fv),e(fv,oh),e(oh,XC),e(So,YC),e(So,uv),e(uv,nh),e(nh,ZC),e(at,e6),e(at,yo),w(sh,yo,null),e(yo,t6),e(yo,Ds),e(Ds,o6),e(Ds,mv),e(mv,n6),e(Ds,s6),e(Ds,gv),e(gv,r6),e(Ds,a6),e(yo,i6),w(Ia,yo,null),e(yo,l6),w(Oa,yo,null),g(i,VT,_),g(i,Ss,_),e(Ss,La),e(La,_v),w(rh,_v,null),e(Ss,d6),e(Ss,bv),e(bv,c6),g(i,GT,_),g(i,it,_),w(ah,it,null),e(it,p6),e(it,vv),e(vv,h6),e(it,f6),e(it,ih),e(ih,u6),e(ih,cm),e(cm,m6),e(ih,g6),e(it,_6),e(it,lh),e(lh,b6),e(lh,dh),e(dh,v6),e(lh,k6),e(it,y6),e(it,kv),e(kv,T6),e(it,w6),e(it,Uo),e(Uo,yv),e(yv,ch),e(ch,$6),e(Uo,F6),e(Uo,Tv),e(Tv,ph),e(ph,x6),e(Uo,E6),e(Uo,wv),e(wv,hh),e(hh,B6),e(Uo,M6),e(Uo,$v),e($v,fh),e(fh,z6),e(it,P6),e(it,To),w(uh,To,null),e(To,j6),e(To,Us),e(Us,q6),e(Us,Fv),e(Fv,C6),e(Us,A6),e(Us,xv),e(xv,N6),e(Us,I6),e(To,O6),w(Da,To,null),e(To,L6),w(Sa,To,null),g(i,JT,_),g(i,Ws,_),e(Ws,Ua),e(Ua,Ev),w(mh,Ev,null),e(Ws,D6),e(Ws,Bv),e(Bv,S6),g(i,XT,_),g(i,lt,_),w(gh,lt,null),e(lt,U6),e(lt,_h),e(_h,W6),e(_h,Mv),e(Mv,H6),e(_h,R6),e(lt,K6),e(lt,bh),e(bh,Q6),e(bh,pm),e(pm,V6),e(bh,G6),e(lt,J6),e(lt,vh),e(vh,X6),e(vh,kh),e(kh,Y6),e(vh,Z6),e(lt,e5),e(lt,zv),e(zv,t5),e(lt,o5),e(lt,Wo),e(Wo,Pv),e(Pv,yh),e(yh,n5),e(Wo,s5),e(Wo,jv),e(jv,Th),e(Th,r5),e(Wo,a5),e(Wo,qv),e(qv,wh),e(wh,i5),e(Wo,l5),e(Wo,Cv),e(Cv,$h),e($h,d5),e(lt,c5),e(lt,wo),w(Fh,wo,null),e(wo,p5),e(wo,Hs),e(Hs,h5),e(Hs,Av),e(Av,f5),e(Hs,u5),e(Hs,Nv),e(Nv,m5),e(Hs,g5),e(wo,_5),w(Wa,wo,null),e(wo,b5),w(Ha,wo,null),g(i,YT,_),g(i,Rs,_),e(Rs,Ra),e(Ra,Iv),w(xh,Iv,null),e(Rs,v5),e(Rs,Ov),e(Ov,k5),g(i,ZT,_),g(i,dt,_),w(Eh,dt,null),e(dt,y5),e(dt,Bh),e(Bh,T5),e(Bh,Lv),e(Lv,w5),e(Bh,$5),e(dt,F5),e(dt,Mh),e(Mh,x5),e(Mh,hm),e(hm,E5),e(Mh,B5),e(dt,M5),e(dt,zh),e(zh,z5),e(zh,Ph),e(Ph,P5),e(zh,j5),e(dt,q5),e(dt,Dv),e(Dv,C5),e(dt,A5),e(dt,Ho),e(Ho,Sv),e(Sv,jh),e(jh,N5),e(Ho,I5),e(Ho,Uv),e(Uv,qh),e(qh,O5),e(Ho,L5),e(Ho,Wv),e(Wv,Ch),e(Ch,D5),e(Ho,S5),e(Ho,Hv),e(Hv,Ah),e(Ah,U5),e(dt,W5),e(dt,$o),w(Nh,$o,null),e($o,H5),e($o,Ks),e(Ks,R5),e(Ks,Rv),e(Rv,K5),e(Ks,Q5),e(Ks,Kv),e(Kv,V5),e(Ks,G5),e($o,J5),w(Ka,$o,null),e($o,X5),w(Qa,$o,null),g(i,e1,_),g(i,Qs,_),e(Qs,Va),e(Va,Qv),w(Ih,Qv,null),e(Qs,Y5),e(Qs,Vv),e(Vv,Z5),g(i,t1,_),g(i,ct,_),w(Oh,ct,null),e(ct,eA),e(ct,Gv),e(Gv,tA),e(ct,oA),e(ct,Lh),e(Lh,nA),e(Lh,fm),e(fm,sA),e(Lh,rA),e(ct,aA),e(ct,Dh),e(Dh,iA),e(Dh,Sh),e(Sh,lA),e(Dh,dA),e(ct,cA),e(ct,Jv),e(Jv,pA),e(ct,hA),e(ct,Ro),e(Ro,Xv),e(Xv,Uh),e(Uh,fA),e(Ro,uA),e(Ro,Yv),e(Yv,Wh),e(Wh,mA),e(Ro,gA),e(Ro,Zv),e(Zv,Hh),e(Hh,_A),e(Ro,bA),e(Ro,ek),e(ek,Rh),e(Rh,vA),e(ct,kA),e(ct,Fo),w(Kh,Fo,null),e(Fo,yA),e(Fo,Vs),e(Vs,TA),e(Vs,tk),e(tk,wA),e(Vs,$A),e(Vs,ok),e(ok,FA),e(Vs,xA),e(Fo,EA),w(Ga,Fo,null),e(Fo,BA),w(Ja,Fo,null),g(i,o1,_),g(i,Gs,_),e(Gs,Xa),e(Xa,nk),w(Qh,nk,null),e(Gs,MA),e(Gs,sk),e(sk,zA),g(i,n1,_),g(i,pt,_),w(Vh,pt,null),e(pt,PA),e(pt,rk),e(rk,jA),e(pt,qA),e(pt,Gh),e(Gh,CA),e(Gh,um),e(um,AA),e(Gh,NA),e(pt,IA),e(pt,Jh),e(Jh,OA),e(Jh,Xh),e(Xh,LA),e(Jh,DA),e(pt,SA),e(pt,ak),e(ak,UA),e(pt,WA),e(pt,Ko),e(Ko,ik),e(ik,Yh),e(Yh,HA),e(Ko,RA),e(Ko,lk),e(lk,Zh),e(Zh,KA),e(Ko,QA),e(Ko,dk),e(dk,ef),e(ef,VA),e(Ko,GA),e(Ko,ck),e(ck,tf),e(tf,JA),e(pt,XA),e(pt,xo),w(of,xo,null),e(xo,YA),e(xo,Js),e(Js,ZA),e(Js,pk),e(pk,e7),e(Js,t7),e(Js,hk),e(hk,o7),e(Js,n7),e(xo,s7),w(Ya,xo,null),e(xo,r7),w(Za,xo,null),g(i,s1,_),g(i,Xs,_),e(Xs,ei),e(ei,fk),w(nf,fk,null),e(Xs,a7),e(Xs,uk),e(uk,i7),g(i,r1,_),g(i,ht,_),w(sf,ht,null),e(ht,l7),e(ht,mk),e(mk,d7),e(ht,c7),e(ht,rf),e(rf,p7),e(rf,mm),e(mm,h7),e(rf,f7),e(ht,u7),e(ht,af),e(af,m7),e(af,lf),e(lf,g7),e(af,_7),e(ht,b7),e(ht,gk),e(gk,v7),e(ht,k7),e(ht,Qo),e(Qo,_k),e(_k,df),e(df,y7),e(Qo,T7),e(Qo,bk),e(bk,cf),e(cf,w7),e(Qo,$7),e(Qo,vk),e(vk,pf),e(pf,F7),e(Qo,x7),e(Qo,kk),e(kk,hf),e(hf,E7),e(ht,B7),e(ht,Eo),w(ff,Eo,null),e(Eo,M7),e(Eo,Ys),e(Ys,z7),e(Ys,yk),e(yk,P7),e(Ys,j7),e(Ys,Tk),e(Tk,q7),e(Ys,C7),e(Eo,A7),w(ti,Eo,null),e(Eo,N7),w(oi,Eo,null),g(i,a1,_),g(i,Zs,_),e(Zs,ni),e(ni,wk),w(uf,wk,null),e(Zs,I7),e(Zs,$k),e($k,O7),g(i,i1,_),g(i,ft,_),w(mf,ft,null),e(ft,L7),e(ft,er),e(er,D7),e(er,Fk),e(Fk,S7),e(er,U7),e(er,xk),e(xk,W7),e(er,H7),e(ft,R7),e(ft,gf),e(gf,K7),e(gf,gm),e(gm,Q7),e(gf,V7),e(ft,G7),e(ft,_f),e(_f,J7),e(_f,bf),e(bf,X7),e(_f,Y7),e(ft,Z7),e(ft,Ek),e(Ek,e8),e(ft,t8),e(ft,Vo),e(Vo,Bk),e(Bk,vf),e(vf,o8),e(Vo,n8),e(Vo,Mk),e(Mk,kf),e(kf,s8),e(Vo,r8),e(Vo,zk),e(zk,yf),e(yf,a8),e(Vo,i8),e(Vo,Pk),e(Pk,Tf),e(Tf,l8),e(ft,d8),e(ft,Bo),w(wf,Bo,null),e(Bo,c8),e(Bo,tr),e(tr,p8),e(tr,jk),e(jk,h8),e(tr,f8),e(tr,qk),e(qk,u8),e(tr,m8),e(Bo,g8),w(si,Bo,null),e(Bo,_8),w(ri,Bo,null),l1=!0},p(i,[_]){const $f={};_&2&&($f.$$scope={dirty:_,ctx:i}),cr.$set($f);const Ck={};_&2&&(Ck.$$scope={dirty:_,ctx:i}),fr.$set(Ck);const Ak={};_&2&&(Ak.$$scope={dirty:_,ctx:i}),mr.$set(Ak);const Nk={};_&2&&(Nk.$$scope={dirty:_,ctx:i}),_r.$set(Nk);const Ff={};_&2&&(Ff.$$scope={dirty:_,ctx:i}),br.$set(Ff);const Ik={};_&2&&(Ik.$$scope={dirty:_,ctx:i}),Tr.$set(Ik);const Ok={};_&2&&(Ok.$$scope={dirty:_,ctx:i}),wr.$set(Ok);const xf={};_&2&&(xf.$$scope={dirty:_,ctx:i}),Fr.$set(xf);const Lk={};_&2&&(Lk.$$scope={dirty:_,ctx:i}),xr.$set(Lk);const Dk={};_&2&&(Dk.$$scope={dirty:_,ctx:i}),Br.$set(Dk);const Sk={};_&2&&(Sk.$$scope={dirty:_,ctx:i}),Mr.$set(Sk);const Ef={};_&2&&(Ef.$$scope={dirty:_,ctx:i}),Pr.$set(Ef);const Uk={};_&2&&(Uk.$$scope={dirty:_,ctx:i}),jr.$set(Uk);const Wk={};_&2&&(Wk.$$scope={dirty:_,ctx:i}),Cr.$set(Wk);const Hk={};_&2&&(Hk.$$scope={dirty:_,ctx:i}),Ar.$set(Hk);const Rk={};_&2&&(Rk.$$scope={dirty:_,ctx:i}),Ir.$set(Rk);const Kk={};_&2&&(Kk.$$scope={dirty:_,ctx:i}),Or.$set(Kk);const Qk={};_&2&&(Qk.$$scope={dirty:_,ctx:i}),Lr.$set(Qk);const Vk={};_&2&&(Vk.$$scope={dirty:_,ctx:i}),Sr.$set(Vk);const Go={};_&2&&(Go.$$scope={dirty:_,ctx:i}),Ur.$set(Go);const Gk={};_&2&&(Gk.$$scope={dirty:_,ctx:i}),Hr.$set(Gk);const Jk={};_&2&&(Jk.$$scope={dirty:_,ctx:i}),Rr.$set(Jk);const Xk={};_&2&&(Xk.$$scope={dirty:_,ctx:i}),Qr.$set(Xk);const Yk={};_&2&&(Yk.$$scope={dirty:_,ctx:i}),Vr.$set(Yk);const Bf={};_&2&&(Bf.$$scope={dirty:_,ctx:i}),Jr.$set(Bf);const Zk={};_&2&&(Zk.$$scope={dirty:_,ctx:i}),Xr.$set(Zk);const or={};_&2&&(or.$$scope={dirty:_,ctx:i}),Yr.$set(or);const ey={};_&2&&(ey.$$scope={dirty:_,ctx:i}),ea.$set(ey);const ty={};_&2&&(ty.$$scope={dirty:_,ctx:i}),ta.$set(ty);const oy={};_&2&&(oy.$$scope={dirty:_,ctx:i}),oa.$set(oy);const ny={};_&2&&(ny.$$scope={dirty:_,ctx:i}),sa.$set(ny);const sy={};_&2&&(sy.$$scope={dirty:_,ctx:i}),aa.$set(sy);const nr={};_&2&&(nr.$$scope={dirty:_,ctx:i}),ia.$set(nr);const ry={};_&2&&(ry.$$scope={dirty:_,ctx:i}),la.$set(ry);const ay={};_&2&&(ay.$$scope={dirty:_,ctx:i}),da.$set(ay);const Mf={};_&2&&(Mf.$$scope={dirty:_,ctx:i}),pa.$set(Mf);const iy={};_&2&&(iy.$$scope={dirty:_,ctx:i}),ha.$set(iy);const ly={};_&2&&(ly.$$scope={dirty:_,ctx:i}),fa.$set(ly);const dy={};_&2&&(dy.$$scope={dirty:_,ctx:i}),ma.$set(dy);const cy={};_&2&&(cy.$$scope={dirty:_,ctx:i}),ga.$set(cy);const ut={};_&2&&(ut.$$scope={dirty:_,ctx:i}),_a.$set(ut);const zf={};_&2&&(zf.$$scope={dirty:_,ctx:i}),ba.$set(zf);const py={};_&2&&(py.$$scope={dirty:_,ctx:i}),ka.$set(py);const Pf={};_&2&&(Pf.$$scope={dirty:_,ctx:i}),ya.$set(Pf);const hy={};_&2&&(hy.$$scope={dirty:_,ctx:i}),Ta.$set(hy);const jf={};_&2&&(jf.$$scope={dirty:_,ctx:i}),$a.$set(jf);const fy={};_&2&&(fy.$$scope={dirty:_,ctx:i}),Fa.$set(fy);const qf={};_&2&&(qf.$$scope={dirty:_,ctx:i}),xa.$set(qf);const uy={};_&2&&(uy.$$scope={dirty:_,ctx:i}),Ea.$set(uy);const un={};_&2&&(un.$$scope={dirty:_,ctx:i}),Ma.$set(un);const my={};_&2&&(my.$$scope={dirty:_,ctx:i}),za.$set(my);const gy={};_&2&&(gy.$$scope={dirty:_,ctx:i}),Pa.$set(gy);const _y={};_&2&&(_y.$$scope={dirty:_,ctx:i}),ja.$set(_y);const mn={};_&2&&(mn.$$scope={dirty:_,ctx:i}),Ca.$set(mn);const by={};_&2&&(by.$$scope={dirty:_,ctx:i}),Aa.$set(by);const vy={};_&2&&(vy.$$scope={dirty:_,ctx:i}),Ia.$set(vy);const ky={};_&2&&(ky.$$scope={dirty:_,ctx:i}),Oa.$set(ky);const gn={};_&2&&(gn.$$scope={dirty:_,ctx:i}),Da.$set(gn);const yy={};_&2&&(yy.$$scope={dirty:_,ctx:i}),Sa.$set(yy);const Ty={};_&2&&(Ty.$$scope={dirty:_,ctx:i}),Wa.$set(Ty);const wy={};_&2&&(wy.$$scope={dirty:_,ctx:i}),Ha.$set(wy);const $y={};_&2&&($y.$$scope={dirty:_,ctx:i}),Ka.$set($y);const Fy={};_&2&&(Fy.$$scope={dirty:_,ctx:i}),Qa.$set(Fy);const Ft={};_&2&&(Ft.$$scope={dirty:_,ctx:i}),Ga.$set(Ft);const Cf={};_&2&&(Cf.$$scope={dirty:_,ctx:i}),Ja.$set(Cf);const xy={};_&2&&(xy.$$scope={dirty:_,ctx:i}),Ya.$set(xy);const sr={};_&2&&(sr.$$scope={dirty:_,ctx:i}),Za.$set(sr);const Ey={};_&2&&(Ey.$$scope={dirty:_,ctx:i}),ti.$set(Ey);const By={};_&2&&(By.$$scope={dirty:_,ctx:i}),oi.$set(By);const _n={};_&2&&(_n.$$scope={dirty:_,ctx:i}),si.$set(_n);const My={};_&2&&(My.$$scope={dirty:_,ctx:i}),ri.$set(My)},i(i){l1||($(l.$$.fragment,i),$(de.$$.fragment,i),$(Di.$$.fragment,i),$(Si.$$.fragment,i),$(ol.$$.fragment,i),$(fl.$$.fragment,i),$(yl.$$.fragment,i),$(Zl.$$.fragment,i),$(ed.$$.fragment,i),$(cr.$$.fragment,i),$(od.$$.fragment,i),$(nd.$$.fragment,i),$(rd.$$.fragment,i),$(id.$$.fragment,i),$(dd.$$.fragment,i),$(fr.$$.fragment,i),$(cd.$$.fragment,i),$(pd.$$.fragment,i),$(hd.$$.fragment,i),$(md.$$.fragment,i),$(_d.$$.fragment,i),$(mr.$$.fragment,i),$(bd.$$.fragment,i),$(vd.$$.fragment,i),$(yd.$$.fragment,i),$(_r.$$.fragment,i),$(wd.$$.fragment,i),$(br.$$.fragment,i),$($d.$$.fragment,i),$(Fd.$$.fragment,i),$(Ed.$$.fragment,i),$(Md.$$.fragment,i),$(Pd.$$.fragment,i),$(jd.$$.fragment,i),$(qd.$$.fragment,i),$(Ld.$$.fragment,i),$(Tr.$$.fragment,i),$(wr.$$.fragment,i),$(Dd.$$.fragment,i),$(Sd.$$.fragment,i),$(Rd.$$.fragment,i),$(Fr.$$.fragment,i),$(xr.$$.fragment,i),$(Kd.$$.fragment,i),$(Qd.$$.fragment,i),$(Yd.$$.fragment,i),$(Br.$$.fragment,i),$(Mr.$$.fragment,i),$(Zd.$$.fragment,i),$(ec.$$.fragment,i),$(rc.$$.fragment,i),$(Pr.$$.fragment,i),$(jr.$$.fragment,i),$(ac.$$.fragment,i),$(ic.$$.fragment,i),$(hc.$$.fragment,i),$(Cr.$$.fragment,i),$(Ar.$$.fragment,i),$(fc.$$.fragment,i),$(uc.$$.fragment,i),$(bc.$$.fragment,i),$(Ir.$$.fragment,i),$(Or.$$.fragment,i),$(Lr.$$.fragment,i),$(vc.$$.fragment,i),$(kc.$$.fragment,i),$($c.$$.fragment,i),$(Sr.$$.fragment,i),$(Ur.$$.fragment,i),$(Fc.$$.fragment,i),$(xc.$$.fragment,i),$(zc.$$.fragment,i),$(Hr.$$.fragment,i),$(Rr.$$.fragment,i),$(Pc.$$.fragment,i),$(jc.$$.fragment,i),$(Nc.$$.fragment,i),$(Qr.$$.fragment,i),$(Vr.$$.fragment,i),$(Ic.$$.fragment,i),$(Oc.$$.fragment,i),$(Jr.$$.fragment,i),$(Uc.$$.fragment,i),$(Xr.$$.fragment,i),$(Yr.$$.fragment,i),$(Wc.$$.fragment,i),$(Hc.$$.fragment,i),$(ea.$$.fragment,i),$(Vc.$$.fragment,i),$(ta.$$.fragment,i),$(oa.$$.fragment,i),$(Gc.$$.fragment,i),$(Jc.$$.fragment,i),$(Xc.$$.fragment,i),$(sa.$$.fragment,i),$(tp.$$.fragment,i),$(op.$$.fragment,i),$(aa.$$.fragment,i),$(ip.$$.fragment,i),$(ia.$$.fragment,i),$(la.$$.fragment,i),$(da.$$.fragment,i),$(lp.$$.fragment,i),$(dp.$$.fragment,i),$(pa.$$.fragment,i),$(up.$$.fragment,i),$(ha.$$.fragment,i),$(fa.$$.fragment,i),$(mp.$$.fragment,i),$(gp.$$.fragment,i),$(ma.$$.fragment,i),$(kp.$$.fragment,i),$(ga.$$.fragment,i),$(_a.$$.fragment,i),$(ba.$$.fragment,i),$(yp.$$.fragment,i),$(Tp.$$.fragment,i),$(ka.$$.fragment,i),$(xp.$$.fragment,i),$(ya.$$.fragment,i),$(Ta.$$.fragment,i),$(Ep.$$.fragment,i),$(Bp.$$.fragment,i),$($a.$$.fragment,i),$(jp.$$.fragment,i),$(Fa.$$.fragment,i),$(xa.$$.fragment,i),$(Ea.$$.fragment,i),$(qp.$$.fragment,i),$(Cp.$$.fragment,i),$(Ma.$$.fragment,i),$(Op.$$.fragment,i),$(za.$$.fragment,i),$(Pa.$$.fragment,i),$(ja.$$.fragment,i),$(Lp.$$.fragment,i),$(Dp.$$.fragment,i),$(Vp.$$.fragment,i),$(Ca.$$.fragment,i),$(Aa.$$.fragment,i),$(Gp.$$.fragment,i),$(Jp.$$.fragment,i),$(sh.$$.fragment,i),$(Ia.$$.fragment,i),$(Oa.$$.fragment,i),$(rh.$$.fragment,i),$(ah.$$.fragment,i),$(uh.$$.fragment,i),$(Da.$$.fragment,i),$(Sa.$$.fragment,i),$(mh.$$.fragment,i),$(gh.$$.fragment,i),$(Fh.$$.fragment,i),$(Wa.$$.fragment,i),$(Ha.$$.fragment,i),$(xh.$$.fragment,i),$(Eh.$$.fragment,i),$(Nh.$$.fragment,i),$(Ka.$$.fragment,i),$(Qa.$$.fragment,i),$(Ih.$$.fragment,i),$(Oh.$$.fragment,i),$(Kh.$$.fragment,i),$(Ga.$$.fragment,i),$(Ja.$$.fragment,i),$(Qh.$$.fragment,i),$(Vh.$$.fragment,i),$(of.$$.fragment,i),$(Ya.$$.fragment,i),$(Za.$$.fragment,i),$(nf.$$.fragment,i),$(sf.$$.fragment,i),$(ff.$$.fragment,i),$(ti.$$.fragment,i),$(oi.$$.fragment,i),$(uf.$$.fragment,i),$(mf.$$.fragment,i),$(wf.$$.fragment,i),$(si.$$.fragment,i),$(ri.$$.fragment,i),l1=!0)},o(i){F(l.$$.fragment,i),F(de.$$.fragment,i),F(Di.$$.fragment,i),F(Si.$$.fragment,i),F(ol.$$.fragment,i),F(fl.$$.fragment,i),F(yl.$$.fragment,i),F(Zl.$$.fragment,i),F(ed.$$.fragment,i),F(cr.$$.fragment,i),F(od.$$.fragment,i),F(nd.$$.fragment,i),F(rd.$$.fragment,i),F(id.$$.fragment,i),F(dd.$$.fragment,i),F(fr.$$.fragment,i),F(cd.$$.fragment,i),F(pd.$$.fragment,i),F(hd.$$.fragment,i),F(md.$$.fragment,i),F(_d.$$.fragment,i),F(mr.$$.fragment,i),F(bd.$$.fragment,i),F(vd.$$.fragment,i),F(yd.$$.fragment,i),F(_r.$$.fragment,i),F(wd.$$.fragment,i),F(br.$$.fragment,i),F($d.$$.fragment,i),F(Fd.$$.fragment,i),F(Ed.$$.fragment,i),F(Md.$$.fragment,i),F(Pd.$$.fragment,i),F(jd.$$.fragment,i),F(qd.$$.fragment,i),F(Ld.$$.fragment,i),F(Tr.$$.fragment,i),F(wr.$$.fragment,i),F(Dd.$$.fragment,i),F(Sd.$$.fragment,i),F(Rd.$$.fragment,i),F(Fr.$$.fragment,i),F(xr.$$.fragment,i),F(Kd.$$.fragment,i),F(Qd.$$.fragment,i),F(Yd.$$.fragment,i),F(Br.$$.fragment,i),F(Mr.$$.fragment,i),F(Zd.$$.fragment,i),F(ec.$$.fragment,i),F(rc.$$.fragment,i),F(Pr.$$.fragment,i),F(jr.$$.fragment,i),F(ac.$$.fragment,i),F(ic.$$.fragment,i),F(hc.$$.fragment,i),F(Cr.$$.fragment,i),F(Ar.$$.fragment,i),F(fc.$$.fragment,i),F(uc.$$.fragment,i),F(bc.$$.fragment,i),F(Ir.$$.fragment,i),F(Or.$$.fragment,i),F(Lr.$$.fragment,i),F(vc.$$.fragment,i),F(kc.$$.fragment,i),F($c.$$.fragment,i),F(Sr.$$.fragment,i),F(Ur.$$.fragment,i),F(Fc.$$.fragment,i),F(xc.$$.fragment,i),F(zc.$$.fragment,i),F(Hr.$$.fragment,i),F(Rr.$$.fragment,i),F(Pc.$$.fragment,i),F(jc.$$.fragment,i),F(Nc.$$.fragment,i),F(Qr.$$.fragment,i),F(Vr.$$.fragment,i),F(Ic.$$.fragment,i),F(Oc.$$.fragment,i),F(Jr.$$.fragment,i),F(Uc.$$.fragment,i),F(Xr.$$.fragment,i),F(Yr.$$.fragment,i),F(Wc.$$.fragment,i),F(Hc.$$.fragment,i),F(ea.$$.fragment,i),F(Vc.$$.fragment,i),F(ta.$$.fragment,i),F(oa.$$.fragment,i),F(Gc.$$.fragment,i),F(Jc.$$.fragment,i),F(Xc.$$.fragment,i),F(sa.$$.fragment,i),F(tp.$$.fragment,i),F(op.$$.fragment,i),F(aa.$$.fragment,i),F(ip.$$.fragment,i),F(ia.$$.fragment,i),F(la.$$.fragment,i),F(da.$$.fragment,i),F(lp.$$.fragment,i),F(dp.$$.fragment,i),F(pa.$$.fragment,i),F(up.$$.fragment,i),F(ha.$$.fragment,i),F(fa.$$.fragment,i),F(mp.$$.fragment,i),F(gp.$$.fragment,i),F(ma.$$.fragment,i),F(kp.$$.fragment,i),F(ga.$$.fragment,i),F(_a.$$.fragment,i),F(ba.$$.fragment,i),F(yp.$$.fragment,i),F(Tp.$$.fragment,i),F(ka.$$.fragment,i),F(xp.$$.fragment,i),F(ya.$$.fragment,i),F(Ta.$$.fragment,i),F(Ep.$$.fragment,i),F(Bp.$$.fragment,i),F($a.$$.fragment,i),F(jp.$$.fragment,i),F(Fa.$$.fragment,i),F(xa.$$.fragment,i),F(Ea.$$.fragment,i),F(qp.$$.fragment,i),F(Cp.$$.fragment,i),F(Ma.$$.fragment,i),F(Op.$$.fragment,i),F(za.$$.fragment,i),F(Pa.$$.fragment,i),F(ja.$$.fragment,i),F(Lp.$$.fragment,i),F(Dp.$$.fragment,i),F(Vp.$$.fragment,i),F(Ca.$$.fragment,i),F(Aa.$$.fragment,i),F(Gp.$$.fragment,i),F(Jp.$$.fragment,i),F(sh.$$.fragment,i),F(Ia.$$.fragment,i),F(Oa.$$.fragment,i),F(rh.$$.fragment,i),F(ah.$$.fragment,i),F(uh.$$.fragment,i),F(Da.$$.fragment,i),F(Sa.$$.fragment,i),F(mh.$$.fragment,i),F(gh.$$.fragment,i),F(Fh.$$.fragment,i),F(Wa.$$.fragment,i),F(Ha.$$.fragment,i),F(xh.$$.fragment,i),F(Eh.$$.fragment,i),F(Nh.$$.fragment,i),F(Ka.$$.fragment,i),F(Qa.$$.fragment,i),F(Ih.$$.fragment,i),F(Oh.$$.fragment,i),F(Kh.$$.fragment,i),F(Ga.$$.fragment,i),F(Ja.$$.fragment,i),F(Qh.$$.fragment,i),F(Vh.$$.fragment,i),F(of.$$.fragment,i),F(Ya.$$.fragment,i),F(Za.$$.fragment,i),F(nf.$$.fragment,i),F(sf.$$.fragment,i),F(ff.$$.fragment,i),F(ti.$$.fragment,i),F(oi.$$.fragment,i),F(uf.$$.fragment,i),F(mf.$$.fragment,i),F(wf.$$.fragment,i),F(si.$$.fragment,i),F(ri.$$.fragment,i),l1=!1},d(i){t(d),i&&t(v),i&&t(u),x(l),i&&t(we),i&&t(S),i&&t(V),i&&t(ie),x(de),i&&t($e),i&&t(U),i&&t(A),i&&t(ue),i&&t(Fe),i&&t(me),i&&t(xe),i&&t(q),i&&t(Ee),i&&t(ge),i&&t(Be),i&&t(se),i&&t(He),i&&t(D),i&&t(jy),i&&t(Nn),x(Di),i&&t(qy),i&&t(Wf),i&&t(Cy),x(Si,i),i&&t(Ay),i&&t(tt),i&&t(Ny),x(ol,i),i&&t(Iy),i&&t(mt),i&&t(Oy),x(fl,i),i&&t(Ly),i&&t(Ot),i&&t(Dy),x(yl,i),i&&t(Sy),i&&t(Lt),i&&t(Uy),i&&t(du),i&&t(Wy),i&&t(an),i&&t(Hy),i&&t(jl),i&&t(Ry),i&&t(lr),i&&t(Ky),i&&t(Il),i&&t(Qy),i&&t(fu),i&&t(Vy),i&&t(Dl),i&&t(Gy),i&&t(xt),i&&t(Jy),i&&t(On),x(Zl),i&&t(Xy),i&&t(so),x(ed),x(cr),i&&t(Yy),i&&t(Dn),x(od),i&&t(Zy),i&&t(ot),x(nd),x(rd),x(id),x(dd),x(fr),x(cd),i&&t(eT),i&&t(Un),x(pd),i&&t(tT),i&&t(Bt),x(hd),x(md),x(_d),x(mr),i&&t(oT),i&&t(Hn),x(bd),i&&t(nT),i&&t(Mt),x(vd),x(yd),x(_r),x(wd),x(br),i&&t(sT),i&&t(Qn),x($d),i&&t(rT),i&&t(Vn),x(Fd),i&&t(aT),i&&t(Gn),x(Ed),i&&t(iT),i&&t(Lo),x(Md),x(Pd),i&&t(lT),i&&t(Jn),x(jd),i&&t(dT),i&&t(nt),x(qd),x(Ld),x(Tr),x(wr),i&&t(cT),i&&t(Yn),x(Dd),i&&t(pT),i&&t(zt),x(Sd),x(Rd),x(Fr),x(xr),i&&t(hT),i&&t(ts),x(Kd),i&&t(fT),i&&t(Pt),x(Qd),x(Yd),x(Br),x(Mr),i&&t(uT),i&&t(ns),x(Zd),i&&t(mT),i&&t(jt),x(ec),x(rc),x(Pr),x(jr),i&&t(gT),i&&t(rs),x(ac),i&&t(_T),i&&t(qt),x(ic),x(hc),x(Cr),x(Ar),i&&t(bT),i&&t(is),x(fc),i&&t(vT),i&&t(Ct),x(uc),x(bc),x(Ir),x(Or),x(Lr),i&&t(kT),i&&t(ds),x(vc),i&&t(yT),i&&t(At),x(kc),x($c),x(Sr),x(Ur),i&&t(TT),i&&t(ps),x(Fc),i&&t(wT),i&&t(Nt),x(xc),x(zc),x(Hr),x(Rr),i&&t($T),i&&t(fs),x(Pc),i&&t(FT),i&&t(It),x(jc),x(Nc),x(Qr),x(Vr),i&&t(xT),i&&t(gs),x(Ic),i&&t(ET),i&&t(_t),x(Oc),x(Jr),x(Uc),x(Xr),x(Yr),i&&t(BT),i&&t(bs),x(Wc),i&&t(MT),i&&t(bt),x(Hc),x(ea),x(Vc),x(ta),x(oa),i&&t(zT),i&&t(ys),x(Gc),i&&t(PT),i&&t(Ts),x(Jc),x(Xc),x(sa),i&&t(jT),i&&t(ws),x(tp),i&&t(qT),i&&t(vt),x(op),x(aa),x(ip),x(ia),x(la),x(da),i&&t(CT),i&&t(Fs),x(lp),i&&t(AT),i&&t(kt),x(dp),x(pa),x(up),x(ha),x(fa),i&&t(NT),i&&t(Es),x(mp),i&&t(IT),i&&t(yt),x(gp),x(ma),x(kp),x(ga),x(_a),x(ba),i&&t(OT),i&&t(Ms),x(yp),i&&t(LT),i&&t(Tt),x(Tp),x(ka),x(xp),x(ya),x(Ta),i&&t(DT),i&&t(Ps),x(Ep),i&&t(ST),i&&t(wt),x(Bp),x($a),x(jp),x(Fa),x(xa),x(Ea),i&&t(UT),i&&t(qs),x(qp),i&&t(WT),i&&t($t),x(Cp),x(Ma),x(Op),x(za),x(Pa),x(ja),i&&t(HT),i&&t(Ns),x(Lp),i&&t(RT),i&&t(rt),x(Dp),x(Vp),x(Ca),x(Aa),i&&t(KT),i&&t(Os),x(Gp),i&&t(QT),i&&t(at),x(Jp),x(sh),x(Ia),x(Oa),i&&t(VT),i&&t(Ss),x(rh),i&&t(GT),i&&t(it),x(ah),x(uh),x(Da),x(Sa),i&&t(JT),i&&t(Ws),x(mh),i&&t(XT),i&&t(lt),x(gh),x(Fh),x(Wa),x(Ha),i&&t(YT),i&&t(Rs),x(xh),i&&t(ZT),i&&t(dt),x(Eh),x(Nh),x(Ka),x(Qa),i&&t(e1),i&&t(Qs),x(Ih),i&&t(t1),i&&t(ct),x(Oh),x(Kh),x(Ga),x(Ja),i&&t(o1),i&&t(Gs),x(Qh),i&&t(n1),i&&t(pt),x(Vh),x(of),x(Ya),x(Za),i&&t(s1),i&&t(Xs),x(nf),i&&t(r1),i&&t(ht),x(sf),x(ff),x(ti),x(oi),i&&t(a1),i&&t(Zs),x(uf),i&&t(i1),i&&t(ft),x(mf),x(wf),x(si),x(ri)}}}const sR={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 rR(E){return LW(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class fR extends AW{constructor(d){super();NW(this,d,rR,nR,IW,{})}}export{fR as default,sR as metadata};
