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,j1,Nn,rr,ag,Di,$2,ig,F2,q1,Wf,x2,C1,Si,A1,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,e$,t$,o$,Yo,Kf,n$,s$,el,r$,a$,tl,i$,l$,d$,lg,Qf,c$,N1,ol,I1,mt,nl,p$,sl,h$,f$,u$,In,m$,rl,g$,_$,al,b$,v$,k$,Zo,Vf,y$,T$,il,w$,$$,ll,F$,x$,E$,en,Gf,B$,M$,dl,z$,P$,cl,j$,q$,C$,ar,Jf,A$,N$,pl,I$,O$,L$,Xf,hl,D$,S$,U$,dg,Yf,W$,O1,fl,L1,Ot,tn,Zf,H$,R$,ul,K$,Q$,ml,V$,G$,J$,on,eu,X$,Y$,gl,Z$,eF,_l,tF,oF,nF,nn,tu,sF,rF,bl,aF,iF,vl,lF,dF,cF,ou,kl,pF,hF,fF,cg,nu,uF,D1,yl,S1,Lt,sn,su,mF,gF,Tl,_F,bF,wl,vF,kF,yF,rn,ru,TF,wF,$l,$F,FF,Fl,xF,EF,BF,ir,au,MF,zF,xl,PF,jF,qF,iu,El,CF,AF,NF,pg,lu,IF,U1,du,hg,OF,W1,an,ln,cu,LF,DF,Bl,SF,UF,Ml,WF,HF,RF,dn,pu,KF,QF,zl,VF,GF,Pl,JF,XF,YF,fg,hu,ZF,H1,jl,ex,ug,tx,R1,lr,ql,ox,Cl,nx,sx,rx,Al,ax,Nl,ix,lx,K1,Il,dx,mg,cx,Q1,fu,Ol,px,Ll,hx,fx,V1,Dl,ux,gg,mx,G1,xt,Sl,gx,Ul,_x,bx,vx,Wl,kx,Hl,yx,Tx,wx,Rl,$x,Kl,Fx,xx,Ex,Ql,Bx,Vl,Mx,zx,Px,Gl,jx,Jl,qx,Cx,Ax,Xl,Nx,Yl,Ix,Ox,J1,On,dr,_g,Zl,Lx,bg,Dx,X1,so,ed,Sx,Oo,Ux,uu,Wx,Hx,mu,Rx,Kx,td,Qx,Vx,Gx,Ln,Jx,gu,Xx,Yx,_u,Zx,e0,t0,cr,Y1,Dn,pr,vg,od,o0,kg,n0,Z1,ot,nd,s0,yg,r0,a0,sd,i0,bu,l0,d0,c0,cn,rd,p0,Tg,h0,f0,ad,vu,u0,wg,m0,g0,ku,_0,$g,b0,v0,hr,id,k0,ld,y0,Fg,T0,w0,$0,ro,dd,F0,xg,x0,E0,fr,B0,Sn,M0,Eg,z0,P0,Bg,j0,q0,C0,yu,cd,ey,Un,ur,Mg,pd,A0,zg,N0,ty,Bt,hd,I0,fd,O0,Pg,L0,D0,S0,ud,U0,Tu,W0,H0,R0,pn,md,K0,jg,Q0,V0,gd,wu,G0,qg,J0,X0,$u,Y0,Cg,Z0,e4,ao,_d,t4,Ag,o4,n4,mr,s4,Wn,r4,Ng,a4,i4,Ig,l4,d4,oy,Hn,gr,Og,bd,c4,Lg,p4,ny,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,sy,Qn,vr,Kg,$d,N4,Qg,I4,ry,Vn,Fd,O4,xd,L4,Fu,D4,S4,ay,Gn,Ed,U4,Bd,W4,xu,H4,R4,iy,Lo,Md,K4,zd,Q4,Eu,V4,G4,J4,kr,Pd,X4,Vg,Y4,ly,Jn,yr,Gg,jd,Z4,Jg,eE,dy,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,cy,Yn,$r,r_,Dd,OE,a_,LE,py,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,hy,ts,Er,c_,Kd,dB,p_,cB,fy,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,uy,ns,zr,u_,Zd,jB,m_,qB,my,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,gy,rs,qr,b_,ac,tM,v_,oM,_y,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,by,is,Nr,T_,fc,$M,w_,FM,vy,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,ky,ds,Dr,x_,vc,KM,E_,QM,yy,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,Ty,ps,Wr,z_,Fc,fz,P_,uz,wy,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,$y,fs,Kr,C_,Pc,Cz,A_,Az,Fy,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,e7,O_,t7,o7,n7,Qr,s7,Vr,xy,gs,Gr,L_,Ic,r7,D_,a7,Ey,_t,Oc,i7,S_,l7,d7,Lc,c7,Ku,p7,h7,f7,Dc,u7,Sc,m7,g7,_7,Jr,b7,go,Uc,v7,_s,k7,Qu,y7,T7,U_,w7,$7,F7,Xr,x7,Yr,By,bs,Zr,W_,Wc,E7,H_,B7,My,bt,Hc,M7,vs,z7,R_,P7,j7,K_,q7,C7,A7,Rc,N7,Vu,I7,O7,L7,Kc,D7,Qc,S7,U7,W7,ea,H7,_o,Vc,R7,ks,K7,Gu,Q7,V7,Q_,G7,J7,X7,ta,Y7,oa,zy,ys,na,V_,Gc,Z7,G_,eP,Py,Ts,Jc,tP,St,Xc,oP,st,nP,J_,sP,rP,X_,aP,iP,Y_,lP,dP,Z_,cP,pP,eb,hP,fP,tb,uP,mP,ob,gP,_P,bP,Yc,Zc,vP,nb,kP,yP,TP,ep,wP,sb,$P,FP,xP,ne,EP,rb,BP,MP,ab,zP,PP,ib,jP,qP,lb,CP,AP,db,NP,IP,cb,OP,LP,pb,DP,SP,hb,UP,WP,fb,HP,RP,ub,KP,QP,mb,VP,GP,gb,JP,XP,_b,YP,ZP,bb,ej,tj,vb,oj,nj,kb,sj,rj,yb,aj,ij,Tb,lj,dj,wb,cj,pj,$b,hj,fj,uj,sa,jy,ws,ra,Fb,tp,mj,xb,gj,qy,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,Cy,Fs,ca,Mb,lp,Dj,zb,Sj,Ay,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,Ny,Es,ua,qb,mp,cq,Cb,pq,Iy,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,Oy,Ms,va,Ib,yp,qq,Ob,Cq,Ly,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,Dy,Ps,wa,Sb,Ep,t3,Ub,o3,Sy,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,Uy,qs,Ba,Rb,qp,$3,Kb,F3,Wy,$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,Hy,Ns,qa,Jb,Lp,X3,Xb,Y3,Ry,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,Ky,Os,Na,av,Gp,BC,iv,MC,Qy,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,Vy,Ss,La,_v,rh,d6,bv,c6,Gy,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,Jy,Ws,Ua,Ev,mh,D6,Bv,S6,Xy,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,Yy,Rs,Ra,Iv,xh,v5,Ov,k5,Zy,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,eT,Qs,Va,Qv,Ih,Y5,Vv,Z5,tT,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,oT,Gs,Xa,nk,Qh,MA,sk,zA,nT,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,e8,t8,hk,o8,n8,s8,Ya,r8,Za,sT,Xs,ei,fk,nf,a8,uk,i8,rT,ht,sf,l8,mk,d8,c8,rf,p8,mm,h8,f8,u8,af,m8,lf,g8,_8,b8,gk,v8,k8,Qo,_k,df,y8,T8,bk,cf,w8,$8,vk,pf,F8,x8,kk,hf,E8,B8,Eo,ff,M8,Ys,z8,yk,P8,j8,Tk,q8,C8,A8,ti,N8,oi,aT,Zs,ni,wk,uf,I8,$k,O8,iT,ft,mf,L8,er,D8,Fk,S8,U8,xk,W8,H8,R8,gf,K8,gm,Q8,V8,G8,_f,J8,bf,X8,Y8,Z8,Ek,eN,tN,Vo,Bk,vf,oN,nN,Mk,kf,sN,rN,zk,yf,aN,iN,Pk,Tf,lN,dN,Bo,wf,cN,tr,pN,jk,hN,fN,qk,uN,mN,gN,si,_N,ri,lT;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.27.1/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.TFBertModel">TFBertModel</a>.`,name:"vocab_size"},{anchor:"transformers.BertConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.BertConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.BertConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.BertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.BertConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.BertConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.BertConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.BertConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.BertConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.TFBertModel">TFBertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.BertConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.BertConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.BertConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.BertConfig.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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/src/transformers/models/bert/tokenization_bert_fast.py#L249",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),_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.27.1/src/transformers/models/bert/tokenization_bert_fast.py#L273",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.BertModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.BertModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BertModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_bert.py#L912",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/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.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked),
the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>
next_sentence_label (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>):
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence
pair (see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.
kwargs (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>):
Used to hide legacy arguments that have been deprecated.</li>
</ul>`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_bert.py#L1073",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.models.bert.modeling_bert.BertForPreTrainingOutput"
>transformers.models.bert.modeling_bert.BertForPreTrainingOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.</p>
</li>
<li>
<p><strong>prediction_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>seq_relationship_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.models.bert.modeling_bert.BertForPreTrainingOutput"
>transformers.models.bert.modeling_bert.BertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fr=new 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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertLMHeadModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.BertLMHeadModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.BertLMHeadModel.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the left-to-right language modeling loss (next word prediction). Indices should be in
<code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are
ignored (masked), the loss is only computed for the tokens with labels n <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.BertLMHeadModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BertLMHeadModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_bert.py#L1183",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_bert.py#L1326",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/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.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertForNextSentencePrediction.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence pair
(see <code>input_ids</code> docstring). Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.</li>
</ul>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_bert.py#L1422",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>next_sentence_label</code> is provided) \u2014 Next sequence prediction (classification) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_bert.py#L1533",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/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.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_bert.py#L1634",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/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.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_bert.py#L1731",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/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.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BertForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.BertForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_bert.py#L1812",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/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.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertModel.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertModel.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertModel.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertModel.call.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.TFBertModel.call.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.TFBertModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFBertModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_tf_bert.py#L1070",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you\u2019re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForPreTraining.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForPreTraining.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertForPreTraining.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForPreTraining.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForPreTraining.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForPreTraining.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForPreTraining.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForPreTraining.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForPreTraining.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForPreTraining.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.TFBertForPreTraining.call.next_sentence_label",description:`<strong>next_sentence_label</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence pair
(see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.</li>
</ul>`,name:"next_sentence_label"},{anchor:"transformers.TFBertForPreTraining.call.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>) &#x2014;
Used to hide legacy arguments that have been deprecated.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_tf_bert.py#L1182",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput"
>transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>prediction_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>seq_relationship_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput"
>transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),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.27.1/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.27.1/src/transformers/models/bert/modeling_tf_bert.py#L1405",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForMaskedLM.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForMaskedLM.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertForMaskedLM.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForMaskedLM.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForMaskedLM.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForMaskedLM.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForMaskedLM.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForMaskedLM.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForMaskedLM.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForMaskedLM.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_tf_bert.py#L1305",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForNextSentencePrediction.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForNextSentencePrediction.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertForNextSentencePrediction.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForNextSentencePrediction.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForNextSentencePrediction.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForNextSentencePrediction.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForNextSentencePrediction.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForNextSentencePrediction.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForNextSentencePrediction.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_tf_bert.py#L1520",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFNextSentencePredictorOutput"
>transformers.modeling_tf_outputs.TFNextSentencePredictorOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>next_sentence_label</code> is provided) \u2014 Next sentence prediction loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForSequenceClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForSequenceClassification.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertForSequenceClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForSequenceClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForSequenceClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForSequenceClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForSequenceClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForSequenceClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForSequenceClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForSequenceClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_tf_bert.py#L1622",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForMultipleChoice.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForMultipleChoice.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertForMultipleChoice.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForMultipleChoice.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForMultipleChoice.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForMultipleChoice.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForMultipleChoice.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForMultipleChoice.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForMultipleChoice.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForMultipleChoice.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices]</code>
where <code>num_choices</code> is the size of the second dimension of the input tensors. (See <code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_tf_bert.py#L1717",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <em>(batch_size, )</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForTokenClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForTokenClassification.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertForTokenClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForTokenClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForTokenClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForTokenClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForTokenClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForTokenClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForTokenClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForTokenClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_tf_bert.py#L1849",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of unmasked labels, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForQuestionAnswering.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForQuestionAnswering.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertForQuestionAnswering.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForQuestionAnswering.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForQuestionAnswering.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForQuestionAnswering.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForQuestionAnswering.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForQuestionAnswering.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForQuestionAnswering.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForQuestionAnswering.call.start_positions",description:`<strong>start_positions</strong> (<code>tf.Tensor</code> or <code>np.ndarray</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.TFBertForQuestionAnswering.call.end_positions",description:`<strong>end_positions</strong> (<code>tf.Tensor</code> or <code>np.ndarray</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_tf_bert.py#L1940",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>start_positions</code> and <code>end_positions</code> are provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForPreTraining.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForPreTraining.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput"
>transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>prediction_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>seq_relationship_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput"
>transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForCausalLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForCausalLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key, value
states of the self-attention and the cross-attention layers if model is used in encoder-decoder setting.
Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForMaskedLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForMaskedLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForNextSentencePrediction.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForNextSentencePrediction.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput"
>transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForSequenceClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForSequenceClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForMultipleChoice.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForMultipleChoice.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput"
>transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForTokenClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForTokenClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxTokenClassifierOutput"
>transformers.modeling_flax_outputs.FlaxTokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForQuestionAnswering.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForQuestionAnswering.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>start_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/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("."),j1=c(),Nn=s("h2"),rr=s("a"),ag=s("span"),y(Di.$$.fragment),$2=c(),ig=s("span"),F2=o("Resources"),q1=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."),C1=c(),y(Si.$$.fragment),A1=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"),e$=o("notebook"),t$=o("."),o$=c(),Yo=s("li"),Kf=s("a"),n$=o("FlaxBertForSequenceClassification"),s$=o(" is supported by this "),el=s("a"),r$=o("example script"),a$=o(" and "),tl=s("a"),i$=o("notebook"),l$=o("."),d$=c(),lg=s("li"),Qf=s("a"),c$=o("Text classification task guide"),N1=c(),y(ol.$$.fragment),I1=c(),mt=s("ul"),nl=s("li"),p$=o("A blog post on how to use "),sl=s("a"),h$=o("Hugging Face Transformers with Keras: Fine-tune a non-English BERT for Named Entity Recognition"),f$=o("."),u$=c(),In=s("li"),m$=o("A notebook for "),rl=s("a"),g$=o("Finetuning BERT for named-entity recognition"),_$=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"),b$=o("version"),v$=o(" of the notebook instead."),k$=c(),Zo=s("li"),Vf=s("a"),y$=o("BertForTokenClassification"),T$=o(" is supported by this "),il=s("a"),w$=o("example script"),$$=o(" and "),ll=s("a"),F$=o("notebook"),x$=o("."),E$=c(),en=s("li"),Gf=s("a"),B$=o("TFBertForTokenClassification"),M$=o(" is supported by this "),dl=s("a"),z$=o("example script"),P$=o(" and "),cl=s("a"),j$=o("notebook"),q$=o("."),C$=c(),ar=s("li"),Jf=s("a"),A$=o("FlaxBertForTokenClassification"),N$=o(" is supported by this "),pl=s("a"),I$=o("example script"),O$=o("."),L$=c(),Xf=s("li"),hl=s("a"),D$=o("Token classification"),S$=o(" chapter of the \u{1F917} Hugging Face Course."),U$=c(),dg=s("li"),Yf=s("a"),W$=o("Token classification task guide"),O1=c(),y(fl.$$.fragment),L1=c(),Ot=s("ul"),tn=s("li"),Zf=s("a"),H$=o("BertForMaskedLM"),R$=o(" is supported by this "),ul=s("a"),K$=o("example script"),Q$=o(" and "),ml=s("a"),V$=o("notebook"),G$=o("."),J$=c(),on=s("li"),eu=s("a"),X$=o("TFBertForMaskedLM"),Y$=o(" is supported by this "),gl=s("a"),Z$=o("example script"),eF=o(" and "),_l=s("a"),tF=o("notebook"),oF=o("."),nF=c(),nn=s("li"),tu=s("a"),sF=o("FlaxBertForMaskedLM"),rF=o(" is supported by this "),bl=s("a"),aF=o("example script"),iF=o(" and "),vl=s("a"),lF=o("notebook"),dF=o("."),cF=c(),ou=s("li"),kl=s("a"),pF=o("Masked language modeling"),hF=o(" chapter of the \u{1F917} Hugging Face Course."),fF=c(),cg=s("li"),nu=s("a"),uF=o("Masked language modeling task guide"),D1=c(),y(yl.$$.fragment),S1=c(),Lt=s("ul"),sn=s("li"),su=s("a"),mF=o("BertForQuestionAnswering"),gF=o(" is supported by this "),Tl=s("a"),_F=o("example script"),bF=o(" and "),wl=s("a"),vF=o("notebook"),kF=o("."),yF=c(),rn=s("li"),ru=s("a"),TF=o("TFBertForQuestionAnswering"),wF=o(" is supported by this "),$l=s("a"),$F=o("example script"),FF=o(" and "),Fl=s("a"),xF=o("notebook"),EF=o("."),BF=c(),ir=s("li"),au=s("a"),MF=o("FlaxBertForQuestionAnswering"),zF=o(" is supported by this "),xl=s("a"),PF=o("example script"),jF=o("."),qF=c(),iu=s("li"),El=s("a"),CF=o("Question answering"),AF=o(" chapter of the \u{1F917} Hugging Face Course."),NF=c(),pg=s("li"),lu=s("a"),IF=o("Question answering task guide"),U1=c(),du=s("p"),hg=s("strong"),OF=o("Multiple choice"),W1=c(),an=s("ul"),ln=s("li"),cu=s("a"),LF=o("BertForMultipleChoice"),DF=o(" is supported by this "),Bl=s("a"),SF=o("example script"),UF=o(" and "),Ml=s("a"),WF=o("notebook"),HF=o("."),RF=c(),dn=s("li"),pu=s("a"),KF=o("TFBertForMultipleChoice"),QF=o(" is supported by this "),zl=s("a"),VF=o("example script"),GF=o(" and "),Pl=s("a"),JF=o("notebook"),XF=o("."),YF=c(),fg=s("li"),hu=s("a"),ZF=o("Multiple choice task guide"),H1=c(),jl=s("p"),ex=o("\u26A1\uFE0F "),ug=s("strong"),tx=o("Inference"),R1=c(),lr=s("ul"),ql=s("li"),ox=o("A blog post on how to "),Cl=s("a"),nx=o("Accelerate BERT inference with Hugging Face Transformers and AWS Inferentia"),sx=o("."),rx=c(),Al=s("li"),ax=o("A blog post on how to "),Nl=s("a"),ix=o("Accelerate BERT inference with DeepSpeed-Inference on GPUs"),lx=o("."),K1=c(),Il=s("p"),dx=o("\u2699\uFE0F "),mg=s("strong"),cx=o("Pretraining"),Q1=c(),fu=s("ul"),Ol=s("li"),px=o("A blog post on "),Ll=s("a"),hx=o("Pre-Training BERT with Hugging Face Transformers and Habana Gaudi"),fx=o("."),V1=c(),Dl=s("p"),ux=o("\u{1F680} "),gg=s("strong"),mx=o("Deploy"),G1=c(),xt=s("ul"),Sl=s("li"),gx=o("A blog post on how to "),Ul=s("a"),_x=o("Convert Transformers to ONNX with Hugging Face Optimum"),bx=o("."),vx=c(),Wl=s("li"),kx=o("A blog post on how to "),Hl=s("a"),yx=o("Setup Deep Learning environment for Hugging Face Transformers with Habana Gaudi on AWS"),Tx=o("."),wx=c(),Rl=s("li"),$x=o("A blog post on "),Kl=s("a"),Fx=o("Autoscaling BERT with Hugging Face Transformers, Amazon SageMaker and Terraform module"),xx=o("."),Ex=c(),Ql=s("li"),Bx=o("A blog post on "),Vl=s("a"),Mx=o("Serverless BERT with HuggingFace, AWS Lambda, and Docker"),zx=o("."),Px=c(),Gl=s("li"),jx=o("A blog post on "),Jl=s("a"),qx=o("Hugging Face Transformers BERT fine-tuning using Amazon SageMaker and Training Compiler"),Cx=o("."),Ax=c(),Xl=s("li"),Nx=o("A blog post on "),Yl=s("a"),Ix=o("Task-specific knowledge distillation for BERT using Transformers & Amazon SageMaker"),Ox=o("."),J1=c(),On=s("h2"),dr=s("a"),_g=s("span"),y(Zl.$$.fragment),Lx=c(),bg=s("span"),Dx=o("BertConfig"),X1=c(),so=s("div"),y(ed.$$.fragment),Sx=c(),Oo=s("p"),Ux=o("This is the configuration class to store the configuration of a "),uu=s("a"),Wx=o("BertModel"),Hx=o(" or a "),mu=s("a"),Rx=o("TFBertModel"),Kx=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"),Qx=o("bert-base-uncased"),Vx=o(" architecture."),Gx=c(),Ln=s("p"),Jx=o("Configuration objects inherit from "),gu=s("a"),Xx=o("PretrainedConfig"),Yx=o(` and can be used to control the model outputs. Read the
documentation from `),_u=s("a"),Zx=o("PretrainedConfig"),e0=o(" for more information."),t0=c(),y(cr.$$.fragment),Y1=c(),Dn=s("h2"),pr=s("a"),vg=s("span"),y(od.$$.fragment),o0=c(),kg=s("span"),n0=o("BertTokenizer"),Z1=c(),ot=s("div"),y(nd.$$.fragment),s0=c(),yg=s("p"),r0=o("Construct a BERT tokenizer. Based on WordPiece."),a0=c(),sd=s("p"),i0=o("This tokenizer inherits from "),bu=s("a"),l0=o("PreTrainedTokenizer"),d0=o(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),c0=c(),cn=s("div"),y(rd.$$.fragment),p0=c(),Tg=s("p"),h0=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:`),f0=c(),ad=s("ul"),vu=s("li"),u0=o("single sequence: "),wg=s("code"),m0=o("[CLS] X [SEP]"),g0=c(),ku=s("li"),_0=o("pair of sequences: "),$g=s("code"),b0=o("[CLS] A [SEP] B [SEP]"),v0=c(),hr=s("div"),y(id.$$.fragment),k0=c(),ld=s("p"),y0=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"),T0=o("prepare_for_model"),w0=o(" method."),$0=c(),ro=s("div"),y(dd.$$.fragment),F0=c(),xg=s("p"),x0=o("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),E0=c(),y(fr.$$.fragment),B0=c(),Sn=s("p"),M0=o("If "),Eg=s("code"),z0=o("token_ids_1"),P0=o(" is "),Bg=s("code"),j0=o("None"),q0=o(", this method only returns the first portion of the mask (0s)."),C0=c(),yu=s("div"),y(cd.$$.fragment),ey=c(),Un=s("h2"),ur=s("a"),Mg=s("span"),y(pd.$$.fragment),A0=c(),zg=s("span"),N0=o("BertTokenizerFast"),ty=c(),Bt=s("div"),y(hd.$$.fragment),I0=c(),fd=s("p"),O0=o("Construct a \u201Cfast\u201D BERT tokenizer (backed by HuggingFace\u2019s "),Pg=s("em"),L0=o("tokenizers"),D0=o(" library). Based on WordPiece."),S0=c(),ud=s("p"),U0=o("This tokenizer inherits from "),Tu=s("a"),W0=o("PreTrainedTokenizerFast"),H0=o(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),R0=c(),pn=s("div"),y(md.$$.fragment),K0=c(),jg=s("p"),Q0=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:`),V0=c(),gd=s("ul"),wu=s("li"),G0=o("single sequence: "),qg=s("code"),J0=o("[CLS] X [SEP]"),X0=c(),$u=s("li"),Y0=o("pair of sequences: "),Cg=s("code"),Z0=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)."),oy=c(),Hn=s("h2"),gr=s("a"),Og=s("span"),y(bd.$$.fragment),c4=c(),Lg=s("span"),p4=o("TFBertTokenizer"),ny=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),sy=c(),Qn=s("h2"),vr=s("a"),Kg=s("span"),y($d.$$.fragment),N4=c(),Qg=s("span"),I4=o("Bert specific outputs"),ry=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("."),ay=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("."),iy=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."),ly=c(),Jn=s("h2"),yr=s("a"),Gg=s("span"),y(jd.$$.fragment),Z4=c(),Jg=s("span"),eE=o("BertModel"),dy=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),cy=c(),Yn=s("h2"),$r=s("a"),r_=s("span"),y(Dd.$$.fragment),OE=c(),a_=s("span"),LE=o("BertForPreTraining"),py=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),hy=c(),ts=s("h2"),Er=s("a"),c_=s("span"),y(Kd.$$.fragment),dB=c(),p_=s("span"),cB=o("BertLMHeadModel"),fy=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),uy=c(),ns=s("h2"),zr=s("a"),u_=s("span"),y(Zd.$$.fragment),jB=c(),m_=s("span"),qB=o("BertForMaskedLM"),my=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),gy=c(),rs=s("h2"),qr=s("a"),b_=s("span"),y(ac.$$.fragment),tM=c(),v_=s("span"),oM=o("BertForNextSentencePrediction"),_y=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),by=c(),is=s("h2"),Nr=s("a"),T_=s("span"),y(fc.$$.fragment),$M=c(),w_=s("span"),FM=o("BertForSequenceClassification"),vy=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),ky=c(),ds=s("h2"),Dr=s("a"),x_=s("span"),y(vc.$$.fragment),KM=c(),E_=s("span"),QM=o("BertForMultipleChoice"),yy=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),Ty=c(),ps=s("h2"),Wr=s("a"),z_=s("span"),y(Fc.$$.fragment),fz=c(),P_=s("span"),uz=o("BertForTokenClassification"),wy=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),$y=c(),fs=s("h2"),Kr=s("a"),C_=s("span"),y(Pc.$$.fragment),Cz=c(),A_=s("span"),Az=o("BertForQuestionAnswering"),Fy=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"),e7=o(" forward method, overrides the "),O_=s("code"),t7=o("__call__"),o7=o(" special method."),n7=c(),y(Qr.$$.fragment),s7=c(),y(Vr.$$.fragment),xy=c(),gs=s("h2"),Gr=s("a"),L_=s("span"),y(Ic.$$.fragment),r7=c(),D_=s("span"),a7=o("TFBertModel"),Ey=c(),_t=s("div"),y(Oc.$$.fragment),i7=c(),S_=s("p"),l7=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),d7=c(),Lc=s("p"),c7=o("This model inherits from "),Ku=s("a"),p7=o("TFPreTrainedModel"),h7=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.)`),f7=c(),Dc=s("p"),u7=o("This model is also a "),Sc=s("a"),m7=o("tf.keras.Model"),g7=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.`),_7=c(),y(Jr.$$.fragment),b7=c(),go=s("div"),y(Uc.$$.fragment),v7=c(),_s=s("p"),k7=o("The "),Qu=s("a"),y7=o("TFBertModel"),T7=o(" forward method, overrides the "),U_=s("code"),w7=o("__call__"),$7=o(" special method."),F7=c(),y(Xr.$$.fragment),x7=c(),y(Yr.$$.fragment),By=c(),bs=s("h2"),Zr=s("a"),W_=s("span"),y(Wc.$$.fragment),E7=c(),H_=s("span"),B7=o("TFBertForPreTraining"),My=c(),bt=s("div"),y(Hc.$$.fragment),M7=c(),vs=s("p"),z7=o(`Bert Model with two heads on top as done during the pretraining:
a `),R_=s("code"),P7=o("masked language modeling"),j7=o(" head and a "),K_=s("code"),q7=o("next sentence prediction (classification)"),C7=o(" head."),A7=c(),Rc=s("p"),N7=o("This model inherits from "),Vu=s("a"),I7=o("TFPreTrainedModel"),O7=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.)`),L7=c(),Kc=s("p"),D7=o("This model is also a "),Qc=s("a"),S7=o("tf.keras.Model"),U7=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.`),W7=c(),y(ea.$$.fragment),H7=c(),_o=s("div"),y(Vc.$$.fragment),R7=c(),ks=s("p"),K7=o("The "),Gu=s("a"),Q7=o("TFBertForPreTraining"),V7=o(" forward method, overrides the "),Q_=s("code"),G7=o("__call__"),J7=o(" special method."),X7=c(),y(ta.$$.fragment),Y7=c(),y(oa.$$.fragment),zy=c(),ys=s("h2"),na=s("a"),V_=s("span"),y(Gc.$$.fragment),Z7=c(),G_=s("span"),eP=o("TFBertModelLMHeadModel"),Py=c(),Ts=s("div"),y(Jc.$$.fragment),tP=c(),St=s("div"),y(Xc.$$.fragment),oP=c(),st=s("p"),nP=o("encoder_hidden_states  ("),J_=s("code"),sP=o("tf.Tensor"),rP=o(" of shape "),X_=s("code"),aP=o("(batch_size, sequence_length, hidden_size)"),iP=o(", "),Y_=s("em"),lP=o("optional"),dP=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"),cP=o("tf.Tensor"),pP=o(" of shape "),eb=s("code"),hP=o("(batch_size, sequence_length)"),fP=o(", "),tb=s("em"),uP=o("optional"),mP=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"),gP=o("[0, 1]"),_P=o(":"),bP=c(),Yc=s("ul"),Zc=s("li"),vP=o("1 for tokens that are "),nb=s("strong"),kP=o("not masked"),yP=o(","),TP=c(),ep=s("li"),wP=o("0 for tokens that are "),sb=s("strong"),$P=o("masked"),FP=o("."),xP=c(),ne=s("p"),EP=o("past_key_values ("),rb=s("code"),BP=o("Tuple[Tuple[tf.Tensor]]"),MP=o(" of length "),ab=s("code"),zP=o("config.n_layers"),PP=o(`)
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),ib=s("code"),jP=o("past_key_values"),qP=o(" are used, the user can optionally input only the last "),lb=s("code"),CP=o("decoder_input_ids"),AP=o(` (those that
don\u2019t have their past key value states given to this model) of shape `),db=s("code"),NP=o("(batch_size, 1)"),IP=o(` instead of all
`),cb=s("code"),OP=o("decoder_input_ids"),LP=o(" of shape "),pb=s("code"),DP=o("(batch_size, sequence_length)"),SP=o(`.
use_cache (`),hb=s("code"),UP=o("bool"),WP=o(", "),fb=s("em"),HP=o("optional"),RP=o(", defaults to "),ub=s("code"),KP=o("True"),QP=o(`):
If set to `),mb=s("code"),VP=o("True"),GP=o(", "),gb=s("code"),JP=o("past_key_values"),XP=o(` key value states are returned and can be used to speed up decoding (see
`),_b=s("code"),YP=o("past_key_values"),ZP=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),jy=c(),ws=s("h2"),ra=s("a"),Fb=s("span"),y(tp.$$.fragment),mj=c(),xb=s("span"),gj=o("TFBertForMaskedLM"),qy=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),Cy=c(),Fs=s("h2"),ca=s("a"),Mb=s("span"),y(lp.$$.fragment),Dj=c(),zb=s("span"),Sj=o("TFBertForNextSentencePrediction"),Ay=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),Ny=c(),Es=s("h2"),ua=s("a"),qb=s("span"),y(mp.$$.fragment),cq=c(),Cb=s("span"),pq=o("TFBertForSequenceClassification"),Iy=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),Oy=c(),Ms=s("h2"),va=s("a"),Ib=s("span"),y(yp.$$.fragment),qq=c(),Ob=s("span"),Cq=o("TFBertForMultipleChoice"),Ly=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),Dy=c(),Ps=s("h2"),wa=s("a"),Sb=s("span"),y(Ep.$$.fragment),t3=c(),Ub=s("span"),o3=o("TFBertForTokenClassification"),Sy=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),Uy=c(),qs=s("h2"),Ba=s("a"),Rb=s("span"),y(qp.$$.fragment),$3=c(),Kb=s("span"),F3=o("TFBertForQuestionAnswering"),Wy=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),Hy=c(),Ns=s("h2"),qa=s("a"),Jb=s("span"),y(Lp.$$.fragment),X3=c(),Xb=s("span"),Y3=o("FlaxBertModel"),Ry=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),Ky=c(),Os=s("h2"),Na=s("a"),av=s("span"),y(Gp.$$.fragment),BC=c(),iv=s("span"),MC=o("FlaxBertForPreTraining"),Qy=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),Vy=c(),Ss=s("h2"),La=s("a"),_v=s("span"),y(rh.$$.fragment),d6=c(),bv=s("span"),c6=o("FlaxBertForCausalLM"),Gy=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),Jy=c(),Ws=s("h2"),Ua=s("a"),Ev=s("span"),y(mh.$$.fragment),D6=c(),Bv=s("span"),S6=o("FlaxBertForMaskedLM"),Xy=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),Yy=c(),Rs=s("h2"),Ra=s("a"),Iv=s("span"),y(xh.$$.fragment),v5=c(),Ov=s("span"),k5=o("FlaxBertForNextSentencePrediction"),Zy=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),eT=c(),Qs=s("h2"),Va=s("a"),Qv=s("span"),y(Ih.$$.fragment),Y5=c(),Vv=s("span"),Z5=o("FlaxBertForSequenceClassification"),tT=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),oT=c(),Gs=s("h2"),Xa=s("a"),nk=s("span"),y(Qh.$$.fragment),MA=c(),sk=s("span"),zA=o("FlaxBertForMultipleChoice"),nT=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"),e8=o("FlaxBertPreTrainedModel"),t8=o(" forward method, overrides the "),hk=s("code"),o8=o("__call__"),n8=o(" special method."),s8=c(),y(Ya.$$.fragment),r8=c(),y(Za.$$.fragment),sT=c(),Xs=s("h2"),ei=s("a"),fk=s("span"),y(nf.$$.fragment),a8=c(),uk=s("span"),i8=o("FlaxBertForTokenClassification"),rT=c(),ht=s("div"),y(sf.$$.fragment),l8=c(),mk=s("p"),d8=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.`),c8=c(),rf=s("p"),p8=o("This model inherits from "),mm=s("a"),h8=o("FlaxPreTrainedModel"),f8=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)`),u8=c(),af=s("p"),m8=o("This model is also a Flax Linen "),lf=s("a"),g8=o("flax.linen.Module"),_8=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.`),b8=c(),gk=s("p"),v8=o("Finally, this model supports inherent JAX features such as:"),k8=c(),Qo=s("ul"),_k=s("li"),df=s("a"),y8=o("Just-In-Time (JIT) compilation"),T8=c(),bk=s("li"),cf=s("a"),w8=o("Automatic Differentiation"),$8=c(),vk=s("li"),pf=s("a"),F8=o("Vectorization"),x8=c(),kk=s("li"),hf=s("a"),E8=o("Parallelization"),B8=c(),Eo=s("div"),y(ff.$$.fragment),M8=c(),Ys=s("p"),z8=o("The "),yk=s("code"),P8=o("FlaxBertPreTrainedModel"),j8=o(" forward method, overrides the "),Tk=s("code"),q8=o("__call__"),C8=o(" special method."),A8=c(),y(ti.$$.fragment),N8=c(),y(oi.$$.fragment),aT=c(),Zs=s("h2"),ni=s("a"),wk=s("span"),y(uf.$$.fragment),I8=c(),$k=s("span"),O8=o("FlaxBertForQuestionAnswering"),iT=c(),ft=s("div"),y(mf.$$.fragment),L8=c(),er=s("p"),D8=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"),S8=o("span start logits"),U8=o(" and "),xk=s("code"),W8=o("span end logits"),H8=o(")."),R8=c(),gf=s("p"),K8=o("This model inherits from "),gm=s("a"),Q8=o("FlaxPreTrainedModel"),V8=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)`),G8=c(),_f=s("p"),J8=o("This model is also a Flax Linen "),bf=s("a"),X8=o("flax.linen.Module"),Y8=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.`),Z8=c(),Ek=s("p"),eN=o("Finally, this model supports inherent JAX features such as:"),tN=c(),Vo=s("ul"),Bk=s("li"),vf=s("a"),oN=o("Just-In-Time (JIT) compilation"),nN=c(),Mk=s("li"),kf=s("a"),sN=o("Automatic Differentiation"),rN=c(),zk=s("li"),yf=s("a"),aN=o("Vectorization"),iN=c(),Pk=s("li"),Tf=s("a"),lN=o("Parallelization"),dN=c(),Bo=s("div"),y(wf.$$.fragment),cN=c(),tr=s("p"),pN=o("The "),jk=s("code"),hN=o("FlaxBertPreTrainedModel"),fN=o(" forward method, overrides the "),qk=s("code"),uN=o("__call__"),mN=o(" special method."),gN=c(),y(si.$$.fragment),_N=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 e1=a(oe);Re=n(e1,"a special mask token with probability 0.8"),e1.forEach(t),Ke=p(or),P=r(or,"LI",{});var t1=a(P);Qe=n(t1,"a random token different from the one masked with probability 0.1"),t1.forEach(t),Ve=p(or),We=r(or,"LI",{});var o1=a(We);Ge=n(o1,"the same token with probability 0.1"),o1.forEach(t),or.forEach(t),Bf.forEach(t),Je=p(Go),L=r(Go,"LI",{});var n1=a(L);Q=r(n1,"P",{});var s1=a(Q);Xe=n(s1,"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."),s1.forEach(t),n1.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 r1=a(Ue);Ie=n(r1,"thomwolf"),r1.forEach(t),Ze=n(nr,". The original code can be found "),Z=r(nr,"A",{href:!0,rel:!0});var a1=a(Z);et=n(a1,"here"),a1.forEach(t),w2=n(nr,"."),nr.forEach(t),j1=p(i),Nn=r(i,"H2",{class:!0});var Mf=a(Nn);rr=r(Mf,"A",{id:!0,class:!0,href:!0});var i1=a(rr);ag=r(i1,"SPAN",{});var l1=a(ag);T(Di.$$.fragment,l1),l1.forEach(t),i1.forEach(t),$2=p(Mf),ig=r(Mf,"SPAN",{});var d1=a(ig);F2=n(d1,"Resources"),d1.forEach(t),Mf.forEach(t),q1=p(i),Wf=r(i,"P",{});var c1=a(Wf);x2=n(c1,"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."),c1.forEach(t),C1=p(i),T(Si.$$.fragment,i),A1=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 p1=a(Wi);B2=n(p1,"BERT Text Classification in a different language"),p1.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 h1=a(Ri);j2=n(h1,"Finetuning BERT (and friends) for multi-label text classification"),h1.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 f1=a(Qi);N2=n(f1,"Finetune BERT for multi-label classification using PyTorch"),f1.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 u1=a(Gi);D2=n(u1,"warm-start an EncoderDecoder model with BERT for summarization"),u1.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 m1=a(Hf);W2=n(m1,"BertForSequenceClassification"),m1.forEach(t),H2=n(un," is supported by this "),Ji=r(un,"A",{href:!0,rel:!0});var g1=a(Ji);R2=n(g1,"example script"),g1.forEach(t),K2=n(un," and "),Xi=r(un,"A",{href:!0,rel:!0});var _1=a(Xi);Q2=n(_1,"notebook"),_1.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 b1=a(Rf);J2=n(b1,"TFBertForSequenceClassification"),b1.forEach(t),X2=n(mn," is supported by this "),Yi=r(mn,"A",{href:!0,rel:!0});var v1=a(Yi);Y2=n(v1,"example script"),v1.forEach(t),Z2=n(mn," and "),Zi=r(mn,"A",{href:!0,rel:!0});var k1=a(Zi);e$=n(k1,"notebook"),k1.forEach(t),t$=n(mn,"."),mn.forEach(t),o$=p(ut),Yo=r(ut,"LI",{});var gn=a(Yo);Kf=r(gn,"A",{href:!0});var y1=a(Kf);n$=n(y1,"FlaxBertForSequenceClassification"),y1.forEach(t),s$=n(gn," is supported by this "),el=r(gn,"A",{href:!0,rel:!0});var T1=a(el);r$=n(T1,"example script"),T1.forEach(t),a$=n(gn," and "),tl=r(gn,"A",{href:!0,rel:!0});var w1=a(tl);i$=n(w1,"notebook"),w1.forEach(t),l$=n(gn,"."),gn.forEach(t),d$=p(ut),lg=r(ut,"LI",{});var $1=a(lg);Qf=r($1,"A",{href:!0});var F1=a(Qf);c$=n(F1,"Text classification task guide"),F1.forEach(t),$1.forEach(t),ut.forEach(t),N1=p(i),T(ol.$$.fragment,i),I1=p(i),mt=r(i,"UL",{});var Ft=a(mt);nl=r(Ft,"LI",{});var Cf=a(nl);p$=n(Cf,"A blog post on how to use "),sl=r(Cf,"A",{href:!0,rel:!0});var x1=a(sl);h$=n(x1,"Hugging Face Transformers with Keras: Fine-tune a non-English BERT for Named Entity Recognition"),x1.forEach(t),f$=n(Cf,"."),Cf.forEach(t),u$=p(Ft),In=r(Ft,"LI",{});var sr=a(In);m$=n(sr,"A notebook for "),rl=r(sr,"A",{href:!0,rel:!0});var E1=a(rl);g$=n(E1,"Finetuning BERT for named-entity recognition"),E1.forEach(t),_$=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 B1=a(al);b$=n(B1,"version"),B1.forEach(t),v$=n(sr," of the notebook instead."),sr.forEach(t),k$=p(Ft),Zo=r(Ft,"LI",{});var _n=a(Zo);Vf=r(_n,"A",{href:!0});var M1=a(Vf);y$=n(M1,"BertForTokenClassification"),M1.forEach(t),T$=n(_n," is supported by this "),il=r(_n,"A",{href:!0,rel:!0});var BN=a(il);w$=n(BN,"example script"),BN.forEach(t),$$=n(_n," and "),ll=r(_n,"A",{href:!0,rel:!0});var MN=a(ll);F$=n(MN,"notebook"),MN.forEach(t),x$=n(_n,"."),_n.forEach(t),E$=p(Ft),en=r(Ft,"LI",{});var Af=a(en);Gf=r(Af,"A",{href:!0});var zN=a(Gf);B$=n(zN,"TFBertForTokenClassification"),zN.forEach(t),M$=n(Af," is supported by this "),dl=r(Af,"A",{href:!0,rel:!0});var PN=a(dl);z$=n(PN,"example script"),PN.forEach(t),P$=n(Af," and "),cl=r(Af,"A",{href:!0,rel:!0});var jN=a(cl);j$=n(jN,"notebook"),jN.forEach(t),q$=n(Af,"."),Af.forEach(t),C$=p(Ft),ar=r(Ft,"LI",{});var z1=a(ar);Jf=r(z1,"A",{href:!0});var qN=a(Jf);A$=n(qN,"FlaxBertForTokenClassification"),qN.forEach(t),N$=n(z1," is supported by this "),pl=r(z1,"A",{href:!0,rel:!0});var CN=a(pl);I$=n(CN,"example script"),CN.forEach(t),O$=n(z1,"."),z1.forEach(t),L$=p(Ft),Xf=r(Ft,"LI",{});var bN=a(Xf);hl=r(bN,"A",{href:!0,rel:!0});var AN=a(hl);D$=n(AN,"Token classification"),AN.forEach(t),S$=n(bN," chapter of the \u{1F917} Hugging Face Course."),bN.forEach(t),U$=p(Ft),dg=r(Ft,"LI",{});var NN=a(dg);Yf=r(NN,"A",{href:!0});var IN=a(Yf);W$=n(IN,"Token classification task guide"),IN.forEach(t),NN.forEach(t),Ft.forEach(t),O1=p(i),T(fl.$$.fragment,i),L1=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 ON=a(Zf);H$=n(ON,"BertForMaskedLM"),ON.forEach(t),R$=n(Nf," is supported by this "),ul=r(Nf,"A",{href:!0,rel:!0});var LN=a(ul);K$=n(LN,"example script"),LN.forEach(t),Q$=n(Nf," and "),ml=r(Nf,"A",{href:!0,rel:!0});var DN=a(ml);V$=n(DN,"notebook"),DN.forEach(t),G$=n(Nf,"."),Nf.forEach(t),J$=p(bn),on=r(bn,"LI",{});var If=a(on);eu=r(If,"A",{href:!0});var SN=a(eu);X$=n(SN,"TFBertForMaskedLM"),SN.forEach(t),Y$=n(If," is supported by this "),gl=r(If,"A",{href:!0,rel:!0});var UN=a(gl);Z$=n(UN,"example script"),UN.forEach(t),eF=n(If," and "),_l=r(If,"A",{href:!0,rel:!0});var WN=a(_l);tF=n(WN,"notebook"),WN.forEach(t),oF=n(If,"."),If.forEach(t),nF=p(bn),nn=r(bn,"LI",{});var Of=a(nn);tu=r(Of,"A",{href:!0});var HN=a(tu);sF=n(HN,"FlaxBertForMaskedLM"),HN.forEach(t),rF=n(Of," is supported by this "),bl=r(Of,"A",{href:!0,rel:!0});var RN=a(bl);aF=n(RN,"example script"),RN.forEach(t),iF=n(Of," and "),vl=r(Of,"A",{href:!0,rel:!0});var KN=a(vl);lF=n(KN,"notebook"),KN.forEach(t),dF=n(Of,"."),Of.forEach(t),cF=p(bn),ou=r(bn,"LI",{});var vN=a(ou);kl=r(vN,"A",{href:!0,rel:!0});var QN=a(kl);pF=n(QN,"Masked language modeling"),QN.forEach(t),hF=n(vN," chapter of the \u{1F917} Hugging Face Course."),vN.forEach(t),fF=p(bn),cg=r(bn,"LI",{});var VN=a(cg);nu=r(VN,"A",{href:!0});var GN=a(nu);uF=n(GN,"Masked language modeling task guide"),GN.forEach(t),VN.forEach(t),bn.forEach(t),D1=p(i),T(yl.$$.fragment,i),S1=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 JN=a(su);mF=n(JN,"BertForQuestionAnswering"),JN.forEach(t),gF=n(Lf," is supported by this "),Tl=r(Lf,"A",{href:!0,rel:!0});var XN=a(Tl);_F=n(XN,"example script"),XN.forEach(t),bF=n(Lf," and "),wl=r(Lf,"A",{href:!0,rel:!0});var YN=a(wl);vF=n(YN,"notebook"),YN.forEach(t),kF=n(Lf,"."),Lf.forEach(t),yF=p(vn),rn=r(vn,"LI",{});var Df=a(rn);ru=r(Df,"A",{href:!0});var ZN=a(ru);TF=n(ZN,"TFBertForQuestionAnswering"),ZN.forEach(t),wF=n(Df," is supported by this "),$l=r(Df,"A",{href:!0,rel:!0});var eI=a($l);$F=n(eI,"example script"),eI.forEach(t),FF=n(Df," and "),Fl=r(Df,"A",{href:!0,rel:!0});var tI=a(Fl);xF=n(tI,"notebook"),tI.forEach(t),EF=n(Df,"."),Df.forEach(t),BF=p(vn),ir=r(vn,"LI",{});var P1=a(ir);au=r(P1,"A",{href:!0});var oI=a(au);MF=n(oI,"FlaxBertForQuestionAnswering"),oI.forEach(t),zF=n(P1," is supported by this "),xl=r(P1,"A",{href:!0,rel:!0});var nI=a(xl);PF=n(nI,"example script"),nI.forEach(t),jF=n(P1,"."),P1.forEach(t),qF=p(vn),iu=r(vn,"LI",{});var kN=a(iu);El=r(kN,"A",{href:!0,rel:!0});var sI=a(El);CF=n(sI,"Question answering"),sI.forEach(t),AF=n(kN," chapter of the \u{1F917} Hugging Face Course."),kN.forEach(t),NF=p(vn),pg=r(vn,"LI",{});var rI=a(pg);lu=r(rI,"A",{href:!0});var aI=a(lu);IF=n(aI,"Question answering task guide"),aI.forEach(t),rI.forEach(t),vn.forEach(t),U1=p(i),du=r(i,"P",{});var iI=a(du);hg=r(iI,"STRONG",{});var lI=a(hg);OF=n(lI,"Multiple choice"),lI.forEach(t),iI.forEach(t),W1=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 dI=a(cu);LF=n(dI,"BertForMultipleChoice"),dI.forEach(t),DF=n(Sf," is supported by this "),Bl=r(Sf,"A",{href:!0,rel:!0});var cI=a(Bl);SF=n(cI,"example script"),cI.forEach(t),UF=n(Sf," and "),Ml=r(Sf,"A",{href:!0,rel:!0});var pI=a(Ml);WF=n(pI,"notebook"),pI.forEach(t),HF=n(Sf,"."),Sf.forEach(t),RF=p(_m),dn=r(_m,"LI",{});var Uf=a(dn);pu=r(Uf,"A",{href:!0});var hI=a(pu);KF=n(hI,"TFBertForMultipleChoice"),hI.forEach(t),QF=n(Uf," is supported by this "),zl=r(Uf,"A",{href:!0,rel:!0});var fI=a(zl);VF=n(fI,"example script"),fI.forEach(t),GF=n(Uf," and "),Pl=r(Uf,"A",{href:!0,rel:!0});var uI=a(Pl);JF=n(uI,"notebook"),uI.forEach(t),XF=n(Uf,"."),Uf.forEach(t),YF=p(_m),fg=r(_m,"LI",{});var mI=a(fg);hu=r(mI,"A",{href:!0});var gI=a(hu);ZF=n(gI,"Multiple choice task guide"),gI.forEach(t),mI.forEach(t),_m.forEach(t),H1=p(i),jl=r(i,"P",{});var yN=a(jl);ex=n(yN,"\u26A1\uFE0F "),ug=r(yN,"STRONG",{});var _I=a(ug);tx=n(_I,"Inference"),_I.forEach(t),yN.forEach(t),R1=p(i),lr=r(i,"UL",{});var dT=a(lr);ql=r(dT,"LI",{});var cT=a(ql);ox=n(cT,"A blog post on how to "),Cl=r(cT,"A",{href:!0,rel:!0});var bI=a(Cl);nx=n(bI,"Accelerate BERT inference with Hugging Face Transformers and AWS Inferentia"),bI.forEach(t),sx=n(cT,"."),cT.forEach(t),rx=p(dT),Al=r(dT,"LI",{});var pT=a(Al);ax=n(pT,"A blog post on how to "),Nl=r(pT,"A",{href:!0,rel:!0});var vI=a(Nl);ix=n(vI,"Accelerate BERT inference with DeepSpeed-Inference on GPUs"),vI.forEach(t),lx=n(pT,"."),pT.forEach(t),dT.forEach(t),K1=p(i),Il=r(i,"P",{});var TN=a(Il);dx=n(TN,"\u2699\uFE0F "),mg=r(TN,"STRONG",{});var kI=a(mg);cx=n(kI,"Pretraining"),kI.forEach(t),TN.forEach(t),Q1=p(i),fu=r(i,"UL",{});var yI=a(fu);Ol=r(yI,"LI",{});var hT=a(Ol);px=n(hT,"A blog post on "),Ll=r(hT,"A",{href:!0,rel:!0});var TI=a(Ll);hx=n(TI,"Pre-Training BERT with Hugging Face Transformers and Habana Gaudi"),TI.forEach(t),fx=n(hT,"."),hT.forEach(t),yI.forEach(t),V1=p(i),Dl=r(i,"P",{});var wN=a(Dl);ux=n(wN,"\u{1F680} "),gg=r(wN,"STRONG",{});var wI=a(gg);mx=n(wI,"Deploy"),wI.forEach(t),wN.forEach(t),G1=p(i),xt=r(i,"UL",{});var Mo=a(xt);Sl=r(Mo,"LI",{});var fT=a(Sl);gx=n(fT,"A blog post on how to "),Ul=r(fT,"A",{href:!0,rel:!0});var $I=a(Ul);_x=n($I,"Convert Transformers to ONNX with Hugging Face Optimum"),$I.forEach(t),bx=n(fT,"."),fT.forEach(t),vx=p(Mo),Wl=r(Mo,"LI",{});var uT=a(Wl);kx=n(uT,"A blog post on how to "),Hl=r(uT,"A",{href:!0,rel:!0});var FI=a(Hl);yx=n(FI,"Setup Deep Learning environment for Hugging Face Transformers with Habana Gaudi on AWS"),FI.forEach(t),Tx=n(uT,"."),uT.forEach(t),wx=p(Mo),Rl=r(Mo,"LI",{});var mT=a(Rl);$x=n(mT,"A blog post on "),Kl=r(mT,"A",{href:!0,rel:!0});var xI=a(Kl);Fx=n(xI,"Autoscaling BERT with Hugging Face Transformers, Amazon SageMaker and Terraform module"),xI.forEach(t),xx=n(mT,"."),mT.forEach(t),Ex=p(Mo),Ql=r(Mo,"LI",{});var gT=a(Ql);Bx=n(gT,"A blog post on "),Vl=r(gT,"A",{href:!0,rel:!0});var EI=a(Vl);Mx=n(EI,"Serverless BERT with HuggingFace, AWS Lambda, and Docker"),EI.forEach(t),zx=n(gT,"."),gT.forEach(t),Px=p(Mo),Gl=r(Mo,"LI",{});var _T=a(Gl);jx=n(_T,"A blog post on "),Jl=r(_T,"A",{href:!0,rel:!0});var BI=a(Jl);qx=n(BI,"Hugging Face Transformers BERT fine-tuning using Amazon SageMaker and Training Compiler"),BI.forEach(t),Cx=n(_T,"."),_T.forEach(t),Ax=p(Mo),Xl=r(Mo,"LI",{});var bT=a(Xl);Nx=n(bT,"A blog post on "),Yl=r(bT,"A",{href:!0,rel:!0});var MI=a(Yl);Ix=n(MI,"Task-specific knowledge distillation for BERT using Transformers & Amazon SageMaker"),MI.forEach(t),Ox=n(bT,"."),bT.forEach(t),Mo.forEach(t),J1=p(i),On=r(i,"H2",{class:!0});var vT=a(On);dr=r(vT,"A",{id:!0,class:!0,href:!0});var zI=a(dr);_g=r(zI,"SPAN",{});var PI=a(_g);T(Zl.$$.fragment,PI),PI.forEach(t),zI.forEach(t),Lx=p(vT),bg=r(vT,"SPAN",{});var jI=a(bg);Dx=n(jI,"BertConfig"),jI.forEach(t),vT.forEach(t),X1=p(i),so=r(i,"DIV",{class:!0});var ai=a(so);T(ed.$$.fragment,ai),Sx=p(ai),Oo=r(ai,"P",{});var ii=a(Oo);Ux=n(ii,"This is the configuration class to store the configuration of a "),uu=r(ii,"A",{href:!0});var qI=a(uu);Wx=n(qI,"BertModel"),qI.forEach(t),Hx=n(ii," or a "),mu=r(ii,"A",{href:!0});var CI=a(mu);Rx=n(CI,"TFBertModel"),CI.forEach(t),Kx=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 AI=a(td);Qx=n(AI,"bert-base-uncased"),AI.forEach(t),Vx=n(ii," architecture."),ii.forEach(t),Gx=p(ai),Ln=r(ai,"P",{});var bm=a(Ln);Jx=n(bm,"Configuration objects inherit from "),gu=r(bm,"A",{href:!0});var NI=a(gu);Xx=n(NI,"PretrainedConfig"),NI.forEach(t),Yx=n(bm,` and can be used to control the model outputs. Read the
documentation from `),_u=r(bm,"A",{href:!0});var II=a(_u);Zx=n(II,"PretrainedConfig"),II.forEach(t),e0=n(bm," for more information."),bm.forEach(t),t0=p(ai),T(cr.$$.fragment,ai),ai.forEach(t),Y1=p(i),Dn=r(i,"H2",{class:!0});var kT=a(Dn);pr=r(kT,"A",{id:!0,class:!0,href:!0});var OI=a(pr);vg=r(OI,"SPAN",{});var LI=a(vg);T(od.$$.fragment,LI),LI.forEach(t),OI.forEach(t),o0=p(kT),kg=r(kT,"SPAN",{});var DI=a(kg);n0=n(DI,"BertTokenizer"),DI.forEach(t),kT.forEach(t),Z1=p(i),ot=r(i,"DIV",{class:!0});var Kt=a(ot);T(nd.$$.fragment,Kt),s0=p(Kt),yg=r(Kt,"P",{});var SI=a(yg);r0=n(SI,"Construct a BERT tokenizer. Based on WordPiece."),SI.forEach(t),a0=p(Kt),sd=r(Kt,"P",{});var yT=a(sd);i0=n(yT,"This tokenizer inherits from "),bu=r(yT,"A",{href:!0});var UI=a(bu);l0=n(UI,"PreTrainedTokenizer"),UI.forEach(t),d0=n(yT,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),yT.forEach(t),c0=p(Kt),cn=r(Kt,"DIV",{class:!0});var vm=a(cn);T(rd.$$.fragment,vm),p0=p(vm),Tg=r(vm,"P",{});var WI=a(Tg);h0=n(WI,`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:`),WI.forEach(t),f0=p(vm),ad=r(vm,"UL",{});var TT=a(ad);vu=r(TT,"LI",{});var $N=a(vu);u0=n($N,"single sequence: "),wg=r($N,"CODE",{});var HI=a(wg);m0=n(HI,"[CLS] X [SEP]"),HI.forEach(t),$N.forEach(t),g0=p(TT),ku=r(TT,"LI",{});var FN=a(ku);_0=n(FN,"pair of sequences: "),$g=r(FN,"CODE",{});var RI=a($g);b0=n(RI,"[CLS] A [SEP] B [SEP]"),RI.forEach(t),FN.forEach(t),TT.forEach(t),vm.forEach(t),v0=p(Kt),hr=r(Kt,"DIV",{class:!0});var wT=a(hr);T(id.$$.fragment,wT),k0=p(wT),ld=r(wT,"P",{});var $T=a(ld);y0=n($T,`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($T,"CODE",{});var KI=a(Fg);T0=n(KI,"prepare_for_model"),KI.forEach(t),w0=n($T," method."),$T.forEach(t),wT.forEach(t),$0=p(Kt),ro=r(Kt,"DIV",{class:!0});var li=a(ro);T(dd.$$.fragment,li),F0=p(li),xg=r(li,"P",{});var QI=a(xg);x0=n(QI,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),QI.forEach(t),E0=p(li),T(fr.$$.fragment,li),B0=p(li),Sn=r(li,"P",{});var km=a(Sn);M0=n(km,"If "),Eg=r(km,"CODE",{});var VI=a(Eg);z0=n(VI,"token_ids_1"),VI.forEach(t),P0=n(km," is "),Bg=r(km,"CODE",{});var GI=a(Bg);j0=n(GI,"None"),GI.forEach(t),q0=n(km,", this method only returns the first portion of the mask (0s)."),km.forEach(t),li.forEach(t),C0=p(Kt),yu=r(Kt,"DIV",{class:!0});var JI=a(yu);T(cd.$$.fragment,JI),JI.forEach(t),Kt.forEach(t),ey=p(i),Un=r(i,"H2",{class:!0});var FT=a(Un);ur=r(FT,"A",{id:!0,class:!0,href:!0});var XI=a(ur);Mg=r(XI,"SPAN",{});var YI=a(Mg);T(pd.$$.fragment,YI),YI.forEach(t),XI.forEach(t),A0=p(FT),zg=r(FT,"SPAN",{});var ZI=a(zg);N0=n(ZI,"BertTokenizerFast"),ZI.forEach(t),FT.forEach(t),ty=p(i),Bt=r(i,"DIV",{class:!0});var kn=a(Bt);T(hd.$$.fragment,kn),I0=p(kn),fd=r(kn,"P",{});var xT=a(fd);O0=n(xT,"Construct a \u201Cfast\u201D BERT tokenizer (backed by HuggingFace\u2019s "),Pg=r(xT,"EM",{});var e9=a(Pg);L0=n(e9,"tokenizers"),e9.forEach(t),D0=n(xT," library). Based on WordPiece."),xT.forEach(t),S0=p(kn),ud=r(kn,"P",{});var ET=a(ud);U0=n(ET,"This tokenizer inherits from "),Tu=r(ET,"A",{href:!0});var t9=a(Tu);W0=n(t9,"PreTrainedTokenizerFast"),t9.forEach(t),H0=n(ET,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),ET.forEach(t),R0=p(kn),pn=r(kn,"DIV",{class:!0});var ym=a(pn);T(md.$$.fragment,ym),K0=p(ym),jg=r(ym,"P",{});var o9=a(jg);Q0=n(o9,`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:`),o9.forEach(t),V0=p(ym),gd=r(ym,"UL",{});var BT=a(gd);wu=r(BT,"LI",{});var xN=a(wu);G0=n(xN,"single sequence: "),qg=r(xN,"CODE",{});var n9=a(qg);J0=n(n9,"[CLS] X [SEP]"),n9.forEach(t),xN.forEach(t),X0=p(BT),$u=r(BT,"LI",{});var EN=a($u);Y0=n(EN,"pair of sequences: "),Cg=r(EN,"CODE",{});var s9=a(Cg);Z0=n(s9,"[CLS] A [SEP] B [SEP]"),s9.forEach(t),EN.forEach(t),BT.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 r9=a(Ag);o4=n(r9,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),r9.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 a9=a(Ng);a4=n(a9,"token_ids_1"),a9.forEach(t),i4=n(Tm," is "),Ig=r(Tm,"CODE",{});var i9=a(Ig);l4=n(i9,"None"),i9.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),oy=p(i),Hn=r(i,"H2",{class:!0});var MT=a(Hn);gr=r(MT,"A",{id:!0,class:!0,href:!0});var l9=a(gr);Og=r(l9,"SPAN",{});var d9=a(Og);T(bd.$$.fragment,d9),d9.forEach(t),l9.forEach(t),c4=p(MT),Lg=r(MT,"SPAN",{});var c9=a(Lg);p4=n(c9,"TFBertTokenizer"),c9.forEach(t),MT.forEach(t),ny=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 p9=a(Dg);u4=n(p9,"from_pretrained()"),p9.forEach(t),m4=n(wm," method. It can also be initialized with the "),Sg=r(wm,"CODE",{});var h9=a(Sg);g4=n(h9,"from_tokenizer()"),h9.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 zT=a(kd);v4=n(zT,`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(zT,"CODE",{});var f9=a(Ug);k4=n(f9,"tf.string"),f9.forEach(t),y4=n(zT," inputs to outputs."),zT.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 PT=a(Td);$4=n(PT,"Instantiate a "),Wg=r(PT,"CODE",{});var u9=a(Wg);F4=n(u9,"TFBertTokenizer"),u9.forEach(t),x4=n(PT," from a pre-trained tokenizer."),PT.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 m9=a(Hg);P4=n(m9,"TFBertTokenizer"),m9.forEach(t),j4=n(xm," from an existing "),Rg=r(xm,"CODE",{});var g9=a(Rg);q4=n(g9,"Tokenizer"),g9.forEach(t),C4=n(xm,"."),xm.forEach(t),A4=p(Fm),T(br.$$.fragment,Fm),Fm.forEach(t),yn.forEach(t),sy=p(i),Qn=r(i,"H2",{class:!0});var jT=a(Qn);vr=r(jT,"A",{id:!0,class:!0,href:!0});var _9=a(vr);Kg=r(_9,"SPAN",{});var b9=a(Kg);T($d.$$.fragment,b9),b9.forEach(t),_9.forEach(t),N4=p(jT),Qg=r(jT,"SPAN",{});var v9=a(Qg);I4=n(v9,"Bert specific outputs"),v9.forEach(t),jT.forEach(t),ry=p(i),Vn=r(i,"DIV",{class:!0});var qT=a(Vn);T(Fd.$$.fragment,qT),O4=p(qT),xd=r(qT,"P",{});var CT=a(xd);L4=n(CT,"Output type of "),Fu=r(CT,"A",{href:!0});var k9=a(Fu);D4=n(k9,"BertForPreTraining"),k9.forEach(t),S4=n(CT,"."),CT.forEach(t),qT.forEach(t),ay=p(i),Gn=r(i,"DIV",{class:!0});var AT=a(Gn);T(Ed.$$.fragment,AT),U4=p(AT),Bd=r(AT,"P",{});var NT=a(Bd);W4=n(NT,"Output type of "),xu=r(NT,"A",{href:!0});var y9=a(xu);H4=n(y9,"TFBertForPreTraining"),y9.forEach(t),R4=n(NT,"."),NT.forEach(t),AT.forEach(t),iy=p(i),Lo=r(i,"DIV",{class:!0});var Em=a(Lo);T(Md.$$.fragment,Em),K4=p(Em),zd=r(Em,"P",{});var IT=a(zd);Q4=n(IT,"Output type of "),Eu=r(IT,"A",{href:!0});var T9=a(Eu);V4=n(T9,"BertForPreTraining"),T9.forEach(t),G4=n(IT,"."),IT.forEach(t),J4=p(Em),kr=r(Em,"DIV",{class:!0});var OT=a(kr);T(Pd.$$.fragment,OT),X4=p(OT),Vg=r(OT,"P",{});var w9=a(Vg);Y4=n(w9,"\u201CReturns a new object replacing the specified fields with new values."),w9.forEach(t),OT.forEach(t),Em.forEach(t),ly=p(i),Jn=r(i,"H2",{class:!0});var LT=a(Jn);yr=r(LT,"A",{id:!0,class:!0,href:!0});var $9=a(yr);Gg=r($9,"SPAN",{});var F9=a(Gg);T(jd.$$.fragment,F9),F9.forEach(t),$9.forEach(t),Z4=p(LT),Jg=r(LT,"SPAN",{});var x9=a(Jg);eE=n(x9,"BertModel"),x9.forEach(t),LT.forEach(t),dy=p(i),nt=r(i,"DIV",{class:!0});var Qt=a(nt);T(qd.$$.fragment,Qt),tE=p(Qt),Xg=r(Qt,"P",{});var E9=a(Xg);oE=n(E9,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),E9.forEach(t),nE=p(Qt),Cd=r(Qt,"P",{});var DT=a(Cd);sE=n(DT,"This model inherits from "),Bu=r(DT,"A",{href:!0});var B9=a(Bu);rE=n(B9,"PreTrainedModel"),B9.forEach(t),aE=n(DT,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),DT.forEach(t),iE=p(Qt),Ad=r(Qt,"P",{});var ST=a(Ad);lE=n(ST,"This model is also a PyTorch "),Nd=r(ST,"A",{href:!0,rel:!0});var M9=a(Nd);dE=n(M9,"torch.nn.Module"),M9.forEach(t),cE=n(ST,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ST.forEach(t),pE=p(Qt),Id=r(Qt,"P",{});var UT=a(Id);hE=n(UT,`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(UT,"A",{href:!0,rel:!0});var z9=a(Od);fE=n(z9,`Attention is
all you need`),z9.forEach(t),uE=n(UT,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),UT.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 P9=a(Yg);_E=n(P9,"is_decoder"),P9.forEach(t),bE=n(Vt,` argument of the configuration set
to `),Zg=r(Vt,"CODE",{});var j9=a(Zg);vE=n(j9,"True"),j9.forEach(t),kE=n(Vt,". To be used in a Seq2Seq model, the model needs to initialized with both "),e_=r(Vt,"CODE",{});var q9=a(e_);yE=n(q9,"is_decoder"),q9.forEach(t),TE=n(Vt,` argument and
`),t_=r(Vt,"CODE",{});var C9=a(t_);wE=n(C9,"add_cross_attention"),C9.forEach(t),$E=n(Vt," set to "),o_=r(Vt,"CODE",{});var A9=a(o_);FE=n(A9,"True"),A9.forEach(t),xE=n(Vt,"; an "),n_=r(Vt,"CODE",{});var N9=a(n_);EE=n(N9,"encoder_hidden_states"),N9.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 I9=a(Mu);jE=n(I9,"BertModel"),I9.forEach(t),qE=n(Bm," forward method, overrides the "),s_=r(Bm,"CODE",{});var O9=a(s_);CE=n(O9,"__call__"),O9.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),cy=p(i),Yn=r(i,"H2",{class:!0});var WT=a(Yn);$r=r(WT,"A",{id:!0,class:!0,href:!0});var L9=a($r);r_=r(L9,"SPAN",{});var D9=a(r_);T(Dd.$$.fragment,D9),D9.forEach(t),L9.forEach(t),OE=p(WT),a_=r(WT,"SPAN",{});var S9=a(a_);LE=n(S9,"BertForPreTraining"),S9.forEach(t),WT.forEach(t),py=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 U9=a(i_);UE=n(U9,"masked language modeling"),U9.forEach(t),WE=n(Mm," head and a "),l_=r(Mm,"CODE",{});var W9=a(l_);HE=n(W9,"next sentence prediction (classification)"),W9.forEach(t),RE=n(Mm," head."),Mm.forEach(t),KE=p(Tn),Ud=r(Tn,"P",{});var HT=a(Ud);QE=n(HT,"This model inherits from "),zu=r(HT,"A",{href:!0});var H9=a(zu);VE=n(H9,"PreTrainedModel"),H9.forEach(t),GE=n(HT,`. 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.)`),HT.forEach(t),JE=p(Tn),Wd=r(Tn,"P",{});var RT=a(Wd);XE=n(RT,"This model is also a PyTorch "),Hd=r(RT,"A",{href:!0,rel:!0});var R9=a(Hd);YE=n(R9,"torch.nn.Module"),R9.forEach(t),ZE=n(RT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),RT.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 K9=a(Pu);nB=n(K9,"BertForPreTraining"),K9.forEach(t),sB=n(zm," forward method, overrides the "),d_=r(zm,"CODE",{});var Q9=a(d_);rB=n(Q9,"__call__"),Q9.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),hy=p(i),ts=r(i,"H2",{class:!0});var KT=a(ts);Er=r(KT,"A",{id:!0,class:!0,href:!0});var V9=a(Er);c_=r(V9,"SPAN",{});var G9=a(c_);T(Kd.$$.fragment,G9),G9.forEach(t),V9.forEach(t),dB=p(KT),p_=r(KT,"SPAN",{});var J9=a(p_);cB=n(J9,"BertLMHeadModel"),J9.forEach(t),KT.forEach(t),fy=p(i),Pt=r(i,"DIV",{class:!0});var wn=a(Pt);T(Qd.$$.fragment,wn),pB=p(wn),Vd=r(wn,"P",{});var QT=a(Vd);hB=n(QT,"Bert Model with a "),h_=r(QT,"CODE",{});var X9=a(h_);fB=n(X9,"language modeling"),X9.forEach(t),uB=n(QT," head on top for CLM fine-tuning."),QT.forEach(t),mB=p(wn),Gd=r(wn,"P",{});var VT=a(Gd);gB=n(VT,"This model inherits from "),ju=r(VT,"A",{href:!0});var Y9=a(ju);_B=n(Y9,"PreTrainedModel"),Y9.forEach(t),bB=n(VT,`. 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.)`),VT.forEach(t),vB=p(wn),Jd=r(wn,"P",{});var GT=a(Jd);kB=n(GT,"This model is also a PyTorch "),Xd=r(GT,"A",{href:!0,rel:!0});var Z9=a(Xd);yB=n(Z9,"torch.nn.Module"),Z9.forEach(t),TB=n(GT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),GT.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),uy=p(i),ns=r(i,"H2",{class:!0});var JT=a(ns);zr=r(JT,"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(JT),m_=r(JT,"SPAN",{});var sO=a(m_);qB=n(sO,"BertForMaskedLM"),sO.forEach(t),JT.forEach(t),my=p(i),jt=r(i,"DIV",{class:!0});var $n=a(jt);T(ec.$$.fragment,$n),CB=p($n),tc=r($n,"P",{});var XT=a(tc);AB=n(XT,"Bert Model with a "),g_=r(XT,"CODE",{});var rO=a(g_);NB=n(rO,"language modeling"),rO.forEach(t),IB=n(XT," head on top."),XT.forEach(t),OB=p($n),oc=r($n,"P",{});var YT=a(oc);LB=n(YT,"This model inherits from "),Cu=r(YT,"A",{href:!0});var aO=a(Cu);DB=n(aO,"PreTrainedModel"),aO.forEach(t),SB=n(YT,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),YT.forEach(t),UB=p($n),nc=r($n,"P",{});var ZT=a(nc);WB=n(ZT,"This model is also a PyTorch "),sc=r(ZT,"A",{href:!0,rel:!0});var iO=a(sc);HB=n(iO,"torch.nn.Module"),iO.forEach(t),RB=n(ZT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ZT.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),gy=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),_y=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),by=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),vy=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),ky=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),yy=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),Ty=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),wy=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),$y=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),Fy=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),e7=n(Om," forward method, overrides the "),O_=r(Om,"CODE",{});var JO=a(O_);t7=n(JO,"__call__"),JO.forEach(t),o7=n(Om," special method."),Om.forEach(t),n7=p(_i),T(Qr.$$.fragment,_i),s7=p(_i),T(Vr.$$.fragment,_i),_i.forEach(t),zn.forEach(t),xy=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),r7=p(gw),D_=r(gw,"SPAN",{});var ZO=a(D_);a7=n(ZO,"TFBertModel"),ZO.forEach(t),gw.forEach(t),Ey=p(i),_t=r(i,"DIV",{class:!0});var zo=a(_t);T(Oc.$$.fragment,zo),i7=p(zo),S_=r(zo,"P",{});var eL=a(S_);l7=n(eL,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),eL.forEach(t),d7=p(zo),Lc=r(zo,"P",{});var _w=a(Lc);c7=n(_w,"This model inherits from "),Ku=r(_w,"A",{href:!0});var tL=a(Ku);p7=n(tL,"TFPreTrainedModel"),tL.forEach(t),h7=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),f7=p(zo),Dc=r(zo,"P",{});var bw=a(Dc);u7=n(bw,"This model is also a "),Sc=r(bw,"A",{href:!0,rel:!0});var oL=a(Sc);m7=n(oL,"tf.keras.Model"),oL.forEach(t),g7=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),_7=p(zo),T(Jr.$$.fragment,zo),b7=p(zo),go=r(zo,"DIV",{class:!0});var bi=a(go);T(Uc.$$.fragment,bi),v7=p(bi),_s=r(bi,"P",{});var Lm=a(_s);k7=n(Lm,"The "),Qu=r(Lm,"A",{href:!0});var nL=a(Qu);y7=n(nL,"TFBertModel"),nL.forEach(t),T7=n(Lm," forward method, overrides the "),U_=r(Lm,"CODE",{});var sL=a(U_);w7=n(sL,"__call__"),sL.forEach(t),$7=n(Lm," special method."),Lm.forEach(t),F7=p(bi),T(Xr.$$.fragment,bi),x7=p(bi),T(Yr.$$.fragment,bi),bi.forEach(t),zo.forEach(t),By=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),E7=p(vw),H_=r(vw,"SPAN",{});var iL=a(H_);B7=n(iL,"TFBertForPreTraining"),iL.forEach(t),vw.forEach(t),My=p(i),bt=r(i,"DIV",{class:!0});var Po=a(bt);T(Hc.$$.fragment,Po),M7=p(Po),vs=r(Po,"P",{});var Dm=a(vs);z7=n(Dm,`Bert Model with two heads on top as done during the pretraining:
a `),R_=r(Dm,"CODE",{});var lL=a(R_);P7=n(lL,"masked language modeling"),lL.forEach(t),j7=n(Dm," head and a "),K_=r(Dm,"CODE",{});var dL=a(K_);q7=n(dL,"next sentence prediction (classification)"),dL.forEach(t),C7=n(Dm," head."),Dm.forEach(t),A7=p(Po),Rc=r(Po,"P",{});var kw=a(Rc);N7=n(kw,"This model inherits from "),Vu=r(kw,"A",{href:!0});var cL=a(Vu);I7=n(cL,"TFPreTrainedModel"),cL.forEach(t),O7=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),L7=p(Po),Kc=r(Po,"P",{});var yw=a(Kc);D7=n(yw,"This model is also a "),Qc=r(yw,"A",{href:!0,rel:!0});var pL=a(Qc);S7=n(pL,"tf.keras.Model"),pL.forEach(t),U7=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),W7=p(Po),T(ea.$$.fragment,Po),H7=p(Po),_o=r(Po,"DIV",{class:!0});var vi=a(_o);T(Vc.$$.fragment,vi),R7=p(vi),ks=r(vi,"P",{});var Sm=a(ks);K7=n(Sm,"The "),Gu=r(Sm,"A",{href:!0});var hL=a(Gu);Q7=n(hL,"TFBertForPreTraining"),hL.forEach(t),V7=n(Sm," forward method, overrides the "),Q_=r(Sm,"CODE",{});var fL=a(Q_);G7=n(fL,"__call__"),fL.forEach(t),J7=n(Sm," special method."),Sm.forEach(t),X7=p(vi),T(ta.$$.fragment,vi),Y7=p(vi),T(oa.$$.fragment,vi),vi.forEach(t),Po.forEach(t),zy=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),Z7=p(Tw),G_=r(Tw,"SPAN",{});var gL=a(G_);eP=n(gL,"TFBertModelLMHeadModel"),gL.forEach(t),Tw.forEach(t),Py=p(i),Ts=r(i,"DIV",{class:!0});var ww=a(Ts);T(Jc.$$.fragment,ww),tP=p(ww),St=r(ww,"DIV",{class:!0});var Pn=a(St);T(Xc.$$.fragment,Pn),oP=p(Pn),st=r(Pn,"P",{});var Et=a(st);nP=n(Et,"encoder_hidden_states  ("),J_=r(Et,"CODE",{});var _L=a(J_);sP=n(_L,"tf.Tensor"),_L.forEach(t),rP=n(Et," of shape "),X_=r(Et,"CODE",{});var bL=a(X_);aP=n(bL,"(batch_size, sequence_length, hidden_size)"),bL.forEach(t),iP=n(Et,", "),Y_=r(Et,"EM",{});var vL=a(Y_);lP=n(vL,"optional"),vL.forEach(t),dP=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_);cP=n(kL,"tf.Tensor"),kL.forEach(t),pP=n(Et," of shape "),eb=r(Et,"CODE",{});var yL=a(eb);hP=n(yL,"(batch_size, sequence_length)"),yL.forEach(t),fP=n(Et,", "),tb=r(Et,"EM",{});var TL=a(tb);uP=n(TL,"optional"),TL.forEach(t),mP=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);gP=n(wL,"[0, 1]"),wL.forEach(t),_P=n(Et,":"),Et.forEach(t),bP=p(Pn),Yc=r(Pn,"UL",{});var $w=a(Yc);Zc=r($w,"LI",{});var Fw=a(Zc);vP=n(Fw,"1 for tokens that are "),nb=r(Fw,"STRONG",{});var $L=a(nb);kP=n($L,"not masked"),$L.forEach(t),yP=n(Fw,","),Fw.forEach(t),TP=p($w),ep=r($w,"LI",{});var xw=a(ep);wP=n(xw,"0 for tokens that are "),sb=r(xw,"STRONG",{});var FL=a(sb);$P=n(FL,"masked"),FL.forEach(t),FP=n(xw,"."),xw.forEach(t),$w.forEach(t),xP=p(Pn),ne=r(Pn,"P",{});var ae=a(ne);EP=n(ae,"past_key_values ("),rb=r(ae,"CODE",{});var xL=a(rb);BP=n(xL,"Tuple[Tuple[tf.Tensor]]"),xL.forEach(t),MP=n(ae," of length "),ab=r(ae,"CODE",{});var EL=a(ab);zP=n(EL,"config.n_layers"),EL.forEach(t),PP=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);jP=n(BL,"past_key_values"),BL.forEach(t),qP=n(ae," are used, the user can optionally input only the last "),lb=r(ae,"CODE",{});var ML=a(lb);CP=n(ML,"decoder_input_ids"),ML.forEach(t),AP=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);NP=n(zL,"(batch_size, 1)"),zL.forEach(t),IP=n(ae,` instead of all
`),cb=r(ae,"CODE",{});var PL=a(cb);OP=n(PL,"decoder_input_ids"),PL.forEach(t),LP=n(ae," of shape "),pb=r(ae,"CODE",{});var jL=a(pb);DP=n(jL,"(batch_size, sequence_length)"),jL.forEach(t),SP=n(ae,`.
use_cache (`),hb=r(ae,"CODE",{});var qL=a(hb);UP=n(qL,"bool"),qL.forEach(t),WP=n(ae,", "),fb=r(ae,"EM",{});var CL=a(fb);HP=n(CL,"optional"),CL.forEach(t),RP=n(ae,", defaults to "),ub=r(ae,"CODE",{});var AL=a(ub);KP=n(AL,"True"),AL.forEach(t),QP=n(ae,`):
If set to `),mb=r(ae,"CODE",{});var NL=a(mb);VP=n(NL,"True"),NL.forEach(t),GP=n(ae,", "),gb=r(ae,"CODE",{});var IL=a(gb);JP=n(IL,"past_key_values"),IL.forEach(t),XP=n(ae,` key value states are returned and can be used to speed up decoding (see
`),_b=r(ae,"CODE",{});var OL=a(_b);YP=n(OL,"past_key_values"),OL.forEach(t),ZP=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),jy=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),qy=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),Cy=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),Ay=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),Ny=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),Iy=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),Oy=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),Ly=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),Dy=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),Sy=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),Uy=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),Wy=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),Hy=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),Ry=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),Ky=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),Qy=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),Vy=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),Gy=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),Jy=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),Xy=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),Yy=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),Zy=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),eT=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),tT=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),oT=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),nT=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);e8=n(XU,"FlaxBertPreTrainedModel"),XU.forEach(t),t8=n(og," forward method, overrides the "),hk=r(og,"CODE",{});var YU=a(hk);o8=n(YU,"__call__"),YU.forEach(t),n8=n(og," special method."),og.forEach(t),s8=p(Ai),T(Ya.$$.fragment,Ai),r8=p(Ai),T(Za.$$.fragment,Ai),Ai.forEach(t),to.forEach(t),sT=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),a8=p(g2),uk=r(g2,"SPAN",{});var tW=a(uk);i8=n(tW,"FlaxBertForTokenClassification"),tW.forEach(t),g2.forEach(t),rT=p(i),ht=r(i,"DIV",{class:!0});var oo=a(ht);T(sf.$$.fragment,oo),l8=p(oo),mk=r(oo,"P",{});var oW=a(mk);d8=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),c8=p(oo),rf=r(oo,"P",{});var _2=a(rf);p8=n(_2,"This model inherits from "),mm=r(_2,"A",{href:!0});var nW=a(mm);h8=n(nW,"FlaxPreTrainedModel"),nW.forEach(t),f8=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),u8=p(oo),af=r(oo,"P",{});var b2=a(af);m8=n(b2,"This model is also a Flax Linen "),lf=r(b2,"A",{href:!0,rel:!0});var sW=a(lf);g8=n(sW,"flax.linen.Module"),sW.forEach(t),_8=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),b8=p(oo),gk=r(oo,"P",{});var rW=a(gk);v8=n(rW,"Finally, this model supports inherent JAX features such as:"),rW.forEach(t),k8=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);y8=n(iW,"Just-In-Time (JIT) compilation"),iW.forEach(t),aW.forEach(t),T8=p(Ni),bk=r(Ni,"LI",{});var lW=a(bk);cf=r(lW,"A",{href:!0,rel:!0});var dW=a(cf);w8=n(dW,"Automatic Differentiation"),dW.forEach(t),lW.forEach(t),$8=p(Ni),vk=r(Ni,"LI",{});var cW=a(vk);pf=r(cW,"A",{href:!0,rel:!0});var pW=a(pf);F8=n(pW,"Vectorization"),pW.forEach(t),cW.forEach(t),x8=p(Ni),kk=r(Ni,"LI",{});var hW=a(kk);hf=r(hW,"A",{href:!0,rel:!0});var fW=a(hf);E8=n(fW,"Parallelization"),fW.forEach(t),hW.forEach(t),Ni.forEach(t),B8=p(oo),Eo=r(oo,"DIV",{class:!0});var Ii=a(Eo);T(ff.$$.fragment,Ii),M8=p(Ii),Ys=r(Ii,"P",{});var ng=a(Ys);z8=n(ng,"The "),yk=r(ng,"CODE",{});var uW=a(yk);P8=n(uW,"FlaxBertPreTrainedModel"),uW.forEach(t),j8=n(ng," forward method, overrides the "),Tk=r(ng,"CODE",{});var mW=a(Tk);q8=n(mW,"__call__"),mW.forEach(t),C8=n(ng," special method."),ng.forEach(t),A8=p(Ii),T(ti.$$.fragment,Ii),N8=p(Ii),T(oi.$$.fragment,Ii),Ii.forEach(t),oo.forEach(t),aT=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),I8=p(v2),$k=r(v2,"SPAN",{});var bW=a($k);O8=n(bW,"FlaxBertForQuestionAnswering"),bW.forEach(t),v2.forEach(t),iT=p(i),ft=r(i,"DIV",{class:!0});var no=a(ft);T(mf.$$.fragment,no),L8=p(no),er=r(no,"P",{});var sg=a(er);D8=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);S8=n(vW,"span start logits"),vW.forEach(t),U8=n(sg," and "),xk=r(sg,"CODE",{});var kW=a(xk);W8=n(kW,"span end logits"),kW.forEach(t),H8=n(sg,")."),sg.forEach(t),R8=p(no),gf=r(no,"P",{});var k2=a(gf);K8=n(k2,"This model inherits from "),gm=r(k2,"A",{href:!0});var yW=a(gm);Q8=n(yW,"FlaxPreTrainedModel"),yW.forEach(t),V8=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),G8=p(no),_f=r(no,"P",{});var y2=a(_f);J8=n(y2,"This model is also a Flax Linen "),bf=r(y2,"A",{href:!0,rel:!0});var TW=a(bf);X8=n(TW,"flax.linen.Module"),TW.forEach(t),Y8=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),Z8=p(no),Ek=r(no,"P",{});var wW=a(Ek);eN=n(wW,"Finally, this model supports inherent JAX features such as:"),wW.forEach(t),tN=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);oN=n(FW,"Just-In-Time (JIT) compilation"),FW.forEach(t),$W.forEach(t),nN=p(Oi),Mk=r(Oi,"LI",{});var xW=a(Mk);kf=r(xW,"A",{href:!0,rel:!0});var EW=a(kf);sN=n(EW,"Automatic Differentiation"),EW.forEach(t),xW.forEach(t),rN=p(Oi),zk=r(Oi,"LI",{});var BW=a(zk);yf=r(BW,"A",{href:!0,rel:!0});var MW=a(yf);aN=n(MW,"Vectorization"),MW.forEach(t),BW.forEach(t),iN=p(Oi),Pk=r(Oi,"LI",{});var zW=a(Pk);Tf=r(zW,"A",{href:!0,rel:!0});var PW=a(Tf);lN=n(PW,"Parallelization"),PW.forEach(t),zW.forEach(t),Oi.forEach(t),dN=p(no),Bo=r(no,"DIV",{class:!0});var Li=a(Bo);T(wf.$$.fragment,Li),cN=p(Li),tr=r(Li,"P",{});var rg=a(tr);pN=n(rg,"The "),jk=r(rg,"CODE",{});var jW=a(jk);hN=n(jW,"FlaxBertPreTrainedModel"),jW.forEach(t),fN=n(rg," forward method, overrides the "),qk=r(rg,"CODE",{});var qW=a(qk);uN=n(qW,"__call__"),qW.forEach(t),mN=n(rg," special method."),rg.forEach(t),gN=p(Li),T(si.$$.fragment,Li),_N=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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/en/model_doc/bert#transformers.BertModel"),h(mu,"href","/docs/transformers/v4.27.1/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.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),h(_u,"href","/docs/transformers/v4.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/en/model_doc/bert#transformers.BertForPreTraining"),h(kr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(yr,"id","transformers.BertModel"),h(yr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(yr,"href","#transformers.BertModel"),h(Jn,"class","relative group"),h(Bu,"href","/docs/transformers/v4.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/en/main_classes/model#transformers.PreTrainedModel"),h(Mc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Mc,"rel","nofollow"),h(Wu,"href","/docs/transformers/v4.27.1/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.27.1/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.27.1/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.27.1/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.27.1/en/model_doc/bert#transformers.TFBertModel"),h(go,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(_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.27.1/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.27.1/en/model_doc/bert#transformers.TFBertForPreTraining"),h(_o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(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.27.1/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.27.1/en/model_doc/bert#transformers.TFBertForMaskedLM"),h(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(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.27.1/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.27.1/en/model_doc/bert#transformers.TFBertForNextSentencePrediction"),h(bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(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.27.1/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.27.1/en/model_doc/bert#transformers.TFBertForSequenceClassification"),h(Wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(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.27.1/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.27.1/en/model_doc/bert#transformers.TFBertForMultipleChoice"),h(vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(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.27.1/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.27.1/en/model_doc/bert#transformers.TFBertForTokenClassification"),h(Ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(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.27.1/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.27.1/en/model_doc/bert#transformers.TFBertForQuestionAnswering"),h(Rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h($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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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,j1,_),g(i,Nn,_),e(Nn,rr),e(rr,ag),w(Di,ag,null),e(Nn,$2),e(Nn,ig),e(ig,F2),g(i,q1,_),g(i,Wf,_),e(Wf,x2),g(i,C1,_),w(Si,i,_),g(i,A1,_),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,e$),e(Xo,t$),e(tt,o$),e(tt,Yo),e(Yo,Kf),e(Kf,n$),e(Yo,s$),e(Yo,el),e(el,r$),e(Yo,a$),e(Yo,tl),e(tl,i$),e(Yo,l$),e(tt,d$),e(tt,lg),e(lg,Qf),e(Qf,c$),g(i,N1,_),w(ol,i,_),g(i,I1,_),g(i,mt,_),e(mt,nl),e(nl,p$),e(nl,sl),e(sl,h$),e(nl,f$),e(mt,u$),e(mt,In),e(In,m$),e(In,rl),e(rl,g$),e(In,_$),e(In,al),e(al,b$),e(In,v$),e(mt,k$),e(mt,Zo),e(Zo,Vf),e(Vf,y$),e(Zo,T$),e(Zo,il),e(il,w$),e(Zo,$$),e(Zo,ll),e(ll,F$),e(Zo,x$),e(mt,E$),e(mt,en),e(en,Gf),e(Gf,B$),e(en,M$),e(en,dl),e(dl,z$),e(en,P$),e(en,cl),e(cl,j$),e(en,q$),e(mt,C$),e(mt,ar),e(ar,Jf),e(Jf,A$),e(ar,N$),e(ar,pl),e(pl,I$),e(ar,O$),e(mt,L$),e(mt,Xf),e(Xf,hl),e(hl,D$),e(Xf,S$),e(mt,U$),e(mt,dg),e(dg,Yf),e(Yf,W$),g(i,O1,_),w(fl,i,_),g(i,L1,_),g(i,Ot,_),e(Ot,tn),e(tn,Zf),e(Zf,H$),e(tn,R$),e(tn,ul),e(ul,K$),e(tn,Q$),e(tn,ml),e(ml,V$),e(tn,G$),e(Ot,J$),e(Ot,on),e(on,eu),e(eu,X$),e(on,Y$),e(on,gl),e(gl,Z$),e(on,eF),e(on,_l),e(_l,tF),e(on,oF),e(Ot,nF),e(Ot,nn),e(nn,tu),e(tu,sF),e(nn,rF),e(nn,bl),e(bl,aF),e(nn,iF),e(nn,vl),e(vl,lF),e(nn,dF),e(Ot,cF),e(Ot,ou),e(ou,kl),e(kl,pF),e(ou,hF),e(Ot,fF),e(Ot,cg),e(cg,nu),e(nu,uF),g(i,D1,_),w(yl,i,_),g(i,S1,_),g(i,Lt,_),e(Lt,sn),e(sn,su),e(su,mF),e(sn,gF),e(sn,Tl),e(Tl,_F),e(sn,bF),e(sn,wl),e(wl,vF),e(sn,kF),e(Lt,yF),e(Lt,rn),e(rn,ru),e(ru,TF),e(rn,wF),e(rn,$l),e($l,$F),e(rn,FF),e(rn,Fl),e(Fl,xF),e(rn,EF),e(Lt,BF),e(Lt,ir),e(ir,au),e(au,MF),e(ir,zF),e(ir,xl),e(xl,PF),e(ir,jF),e(Lt,qF),e(Lt,iu),e(iu,El),e(El,CF),e(iu,AF),e(Lt,NF),e(Lt,pg),e(pg,lu),e(lu,IF),g(i,U1,_),g(i,du,_),e(du,hg),e(hg,OF),g(i,W1,_),g(i,an,_),e(an,ln),e(ln,cu),e(cu,LF),e(ln,DF),e(ln,Bl),e(Bl,SF),e(ln,UF),e(ln,Ml),e(Ml,WF),e(ln,HF),e(an,RF),e(an,dn),e(dn,pu),e(pu,KF),e(dn,QF),e(dn,zl),e(zl,VF),e(dn,GF),e(dn,Pl),e(Pl,JF),e(dn,XF),e(an,YF),e(an,fg),e(fg,hu),e(hu,ZF),g(i,H1,_),g(i,jl,_),e(jl,ex),e(jl,ug),e(ug,tx),g(i,R1,_),g(i,lr,_),e(lr,ql),e(ql,ox),e(ql,Cl),e(Cl,nx),e(ql,sx),e(lr,rx),e(lr,Al),e(Al,ax),e(Al,Nl),e(Nl,ix),e(Al,lx),g(i,K1,_),g(i,Il,_),e(Il,dx),e(Il,mg),e(mg,cx),g(i,Q1,_),g(i,fu,_),e(fu,Ol),e(Ol,px),e(Ol,Ll),e(Ll,hx),e(Ol,fx),g(i,V1,_),g(i,Dl,_),e(Dl,ux),e(Dl,gg),e(gg,mx),g(i,G1,_),g(i,xt,_),e(xt,Sl),e(Sl,gx),e(Sl,Ul),e(Ul,_x),e(Sl,bx),e(xt,vx),e(xt,Wl),e(Wl,kx),e(Wl,Hl),e(Hl,yx),e(Wl,Tx),e(xt,wx),e(xt,Rl),e(Rl,$x),e(Rl,Kl),e(Kl,Fx),e(Rl,xx),e(xt,Ex),e(xt,Ql),e(Ql,Bx),e(Ql,Vl),e(Vl,Mx),e(Ql,zx),e(xt,Px),e(xt,Gl),e(Gl,jx),e(Gl,Jl),e(Jl,qx),e(Gl,Cx),e(xt,Ax),e(xt,Xl),e(Xl,Nx),e(Xl,Yl),e(Yl,Ix),e(Xl,Ox),g(i,J1,_),g(i,On,_),e(On,dr),e(dr,_g),w(Zl,_g,null),e(On,Lx),e(On,bg),e(bg,Dx),g(i,X1,_),g(i,so,_),w(ed,so,null),e(so,Sx),e(so,Oo),e(Oo,Ux),e(Oo,uu),e(uu,Wx),e(Oo,Hx),e(Oo,mu),e(mu,Rx),e(Oo,Kx),e(Oo,td),e(td,Qx),e(Oo,Vx),e(so,Gx),e(so,Ln),e(Ln,Jx),e(Ln,gu),e(gu,Xx),e(Ln,Yx),e(Ln,_u),e(_u,Zx),e(Ln,e0),e(so,t0),w(cr,so,null),g(i,Y1,_),g(i,Dn,_),e(Dn,pr),e(pr,vg),w(od,vg,null),e(Dn,o0),e(Dn,kg),e(kg,n0),g(i,Z1,_),g(i,ot,_),w(nd,ot,null),e(ot,s0),e(ot,yg),e(yg,r0),e(ot,a0),e(ot,sd),e(sd,i0),e(sd,bu),e(bu,l0),e(sd,d0),e(ot,c0),e(ot,cn),w(rd,cn,null),e(cn,p0),e(cn,Tg),e(Tg,h0),e(cn,f0),e(cn,ad),e(ad,vu),e(vu,u0),e(vu,wg),e(wg,m0),e(ad,g0),e(ad,ku),e(ku,_0),e(ku,$g),e($g,b0),e(ot,v0),e(ot,hr),w(id,hr,null),e(hr,k0),e(hr,ld),e(ld,y0),e(ld,Fg),e(Fg,T0),e(ld,w0),e(ot,$0),e(ot,ro),w(dd,ro,null),e(ro,F0),e(ro,xg),e(xg,x0),e(ro,E0),w(fr,ro,null),e(ro,B0),e(ro,Sn),e(Sn,M0),e(Sn,Eg),e(Eg,z0),e(Sn,P0),e(Sn,Bg),e(Bg,j0),e(Sn,q0),e(ot,C0),e(ot,yu),w(cd,yu,null),g(i,ey,_),g(i,Un,_),e(Un,ur),e(ur,Mg),w(pd,Mg,null),e(Un,A0),e(Un,zg),e(zg,N0),g(i,ty,_),g(i,Bt,_),w(hd,Bt,null),e(Bt,I0),e(Bt,fd),e(fd,O0),e(fd,Pg),e(Pg,L0),e(fd,D0),e(Bt,S0),e(Bt,ud),e(ud,U0),e(ud,Tu),e(Tu,W0),e(ud,H0),e(Bt,R0),e(Bt,pn),w(md,pn,null),e(pn,K0),e(pn,jg),e(jg,Q0),e(pn,V0),e(pn,gd),e(gd,wu),e(wu,G0),e(wu,qg),e(qg,J0),e(gd,X0),e(gd,$u),e($u,Y0),e($u,Cg),e(Cg,Z0),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,oy,_),g(i,Hn,_),e(Hn,gr),e(gr,Og),w(bd,Og,null),e(Hn,c4),e(Hn,Lg),e(Lg,p4),g(i,ny,_),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,sy,_),g(i,Qn,_),e(Qn,vr),e(vr,Kg),w($d,Kg,null),e(Qn,N4),e(Qn,Qg),e(Qg,I4),g(i,ry,_),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,ay,_),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,iy,_),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,ly,_),g(i,Jn,_),e(Jn,yr),e(yr,Gg),w(jd,Gg,null),e(Jn,Z4),e(Jn,Jg),e(Jg,eE),g(i,dy,_),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,cy,_),g(i,Yn,_),e(Yn,$r),e($r,r_),w(Dd,r_,null),e(Yn,OE),e(Yn,a_),e(a_,LE),g(i,py,_),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,hy,_),g(i,ts,_),e(ts,Er),e(Er,c_),w(Kd,c_,null),e(ts,dB),e(ts,p_),e(p_,cB),g(i,fy,_),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,uy,_),g(i,ns,_),e(ns,zr),e(zr,u_),w(Zd,u_,null),e(ns,jB),e(ns,m_),e(m_,qB),g(i,my,_),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,gy,_),g(i,rs,_),e(rs,qr),e(qr,b_),w(ac,b_,null),e(rs,tM),e(rs,v_),e(v_,oM),g(i,_y,_),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,by,_),g(i,is,_),e(is,Nr),e(Nr,T_),w(fc,T_,null),e(is,$M),e(is,w_),e(w_,FM),g(i,vy,_),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,ky,_),g(i,ds,_),e(ds,Dr),e(Dr,x_),w(vc,x_,null),e(ds,KM),e(ds,E_),e(E_,QM),g(i,yy,_),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,Ty,_),g(i,ps,_),e(ps,Wr),e(Wr,z_),w(Fc,z_,null),e(ps,fz),e(ps,P_),e(P_,uz),g(i,wy,_),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,$y,_),g(i,fs,_),e(fs,Kr),e(Kr,C_),w(Pc,C_,null),e(fs,Cz),e(fs,A_),e(A_,Az),g(i,Fy,_),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,e7),e(ms,O_),e(O_,t7),e(ms,o7),e(mo,n7),w(Qr,mo,null),e(mo,s7),w(Vr,mo,null),g(i,xy,_),g(i,gs,_),e(gs,Gr),e(Gr,L_),w(Ic,L_,null),e(gs,r7),e(gs,D_),e(D_,a7),g(i,Ey,_),g(i,_t,_),w(Oc,_t,null),e(_t,i7),e(_t,S_),e(S_,l7),e(_t,d7),e(_t,Lc),e(Lc,c7),e(Lc,Ku),e(Ku,p7),e(Lc,h7),e(_t,f7),e(_t,Dc),e(Dc,u7),e(Dc,Sc),e(Sc,m7),e(Dc,g7),e(_t,_7),w(Jr,_t,null),e(_t,b7),e(_t,go),w(Uc,go,null),e(go,v7),e(go,_s),e(_s,k7),e(_s,Qu),e(Qu,y7),e(_s,T7),e(_s,U_),e(U_,w7),e(_s,$7),e(go,F7),w(Xr,go,null),e(go,x7),w(Yr,go,null),g(i,By,_),g(i,bs,_),e(bs,Zr),e(Zr,W_),w(Wc,W_,null),e(bs,E7),e(bs,H_),e(H_,B7),g(i,My,_),g(i,bt,_),w(Hc,bt,null),e(bt,M7),e(bt,vs),e(vs,z7),e(vs,R_),e(R_,P7),e(vs,j7),e(vs,K_),e(K_,q7),e(vs,C7),e(bt,A7),e(bt,Rc),e(Rc,N7),e(Rc,Vu),e(Vu,I7),e(Rc,O7),e(bt,L7),e(bt,Kc),e(Kc,D7),e(Kc,Qc),e(Qc,S7),e(Kc,U7),e(bt,W7),w(ea,bt,null),e(bt,H7),e(bt,_o),w(Vc,_o,null),e(_o,R7),e(_o,ks),e(ks,K7),e(ks,Gu),e(Gu,Q7),e(ks,V7),e(ks,Q_),e(Q_,G7),e(ks,J7),e(_o,X7),w(ta,_o,null),e(_o,Y7),w(oa,_o,null),g(i,zy,_),g(i,ys,_),e(ys,na),e(na,V_),w(Gc,V_,null),e(ys,Z7),e(ys,G_),e(G_,eP),g(i,Py,_),g(i,Ts,_),w(Jc,Ts,null),e(Ts,tP),e(Ts,St),w(Xc,St,null),e(St,oP),e(St,st),e(st,nP),e(st,J_),e(J_,sP),e(st,rP),e(st,X_),e(X_,aP),e(st,iP),e(st,Y_),e(Y_,lP),e(st,dP),e(st,Z_),e(Z_,cP),e(st,pP),e(st,eb),e(eb,hP),e(st,fP),e(st,tb),e(tb,uP),e(st,mP),e(st,ob),e(ob,gP),e(st,_P),e(St,bP),e(St,Yc),e(Yc,Zc),e(Zc,vP),e(Zc,nb),e(nb,kP),e(Zc,yP),e(Yc,TP),e(Yc,ep),e(ep,wP),e(ep,sb),e(sb,$P),e(ep,FP),e(St,xP),e(St,ne),e(ne,EP),e(ne,rb),e(rb,BP),e(ne,MP),e(ne,ab),e(ab,zP),e(ne,PP),e(ne,ib),e(ib,jP),e(ne,qP),e(ne,lb),e(lb,CP),e(ne,AP),e(ne,db),e(db,NP),e(ne,IP),e(ne,cb),e(cb,OP),e(ne,LP),e(ne,pb),e(pb,DP),e(ne,SP),e(ne,hb),e(hb,UP),e(ne,WP),e(ne,fb),e(fb,HP),e(ne,RP),e(ne,ub),e(ub,KP),e(ne,QP),e(ne,mb),e(mb,VP),e(ne,GP),e(ne,gb),e(gb,JP),e(ne,XP),e(ne,_b),e(_b,YP),e(ne,ZP),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,jy,_),g(i,ws,_),e(ws,ra),e(ra,Fb),w(tp,Fb,null),e(ws,mj),e(ws,xb),e(xb,gj),g(i,qy,_),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,Cy,_),g(i,Fs,_),e(Fs,ca),e(ca,Mb),w(lp,Mb,null),e(Fs,Dj),e(Fs,zb),e(zb,Sj),g(i,Ay,_),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,Ny,_),g(i,Es,_),e(Es,ua),e(ua,qb),w(mp,qb,null),e(Es,cq),e(Es,Cb),e(Cb,pq),g(i,Iy,_),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,Oy,_),g(i,Ms,_),e(Ms,va),e(va,Ib),w(yp,Ib,null),e(Ms,qq),e(Ms,Ob),e(Ob,Cq),g(i,Ly,_),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,Dy,_),g(i,Ps,_),e(Ps,wa),e(wa,Sb),w(Ep,Sb,null),e(Ps,t3),e(Ps,Ub),e(Ub,o3),g(i,Sy,_),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,Uy,_),g(i,qs,_),e(qs,Ba),e(Ba,Rb),w(qp,Rb,null),e(qs,$3),e(qs,Kb),e(Kb,F3),g(i,Wy,_),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,Hy,_),g(i,Ns,_),e(Ns,qa),e(qa,Jb),w(Lp,Jb,null),e(Ns,X3),e(Ns,Xb),e(Xb,Y3),g(i,Ry,_),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,Ky,_),g(i,Os,_),e(Os,Na),e(Na,av),w(Gp,av,null),e(Os,BC),e(Os,iv),e(iv,MC),g(i,Qy,_),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,Vy,_),g(i,Ss,_),e(Ss,La),e(La,_v),w(rh,_v,null),e(Ss,d6),e(Ss,bv),e(bv,c6),g(i,Gy,_),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,Jy,_),g(i,Ws,_),e(Ws,Ua),e(Ua,Ev),w(mh,Ev,null),e(Ws,D6),e(Ws,Bv),e(Bv,S6),g(i,Xy,_),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,Yy,_),g(i,Rs,_),e(Rs,Ra),e(Ra,Iv),w(xh,Iv,null),e(Rs,v5),e(Rs,Ov),e(Ov,k5),g(i,Zy,_),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,eT,_),g(i,Qs,_),e(Qs,Va),e(Va,Qv),w(Ih,Qv,null),e(Qs,Y5),e(Qs,Vv),e(Vv,Z5),g(i,tT,_),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,oT,_),g(i,Gs,_),e(Gs,Xa),e(Xa,nk),w(Qh,nk,null),e(Gs,MA),e(Gs,sk),e(sk,zA),g(i,nT,_),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,e8),e(Js,t8),e(Js,hk),e(hk,o8),e(Js,n8),e(xo,s8),w(Ya,xo,null),e(xo,r8),w(Za,xo,null),g(i,sT,_),g(i,Xs,_),e(Xs,ei),e(ei,fk),w(nf,fk,null),e(Xs,a8),e(Xs,uk),e(uk,i8),g(i,rT,_),g(i,ht,_),w(sf,ht,null),e(ht,l8),e(ht,mk),e(mk,d8),e(ht,c8),e(ht,rf),e(rf,p8),e(rf,mm),e(mm,h8),e(rf,f8),e(ht,u8),e(ht,af),e(af,m8),e(af,lf),e(lf,g8),e(af,_8),e(ht,b8),e(ht,gk),e(gk,v8),e(ht,k8),e(ht,Qo),e(Qo,_k),e(_k,df),e(df,y8),e(Qo,T8),e(Qo,bk),e(bk,cf),e(cf,w8),e(Qo,$8),e(Qo,vk),e(vk,pf),e(pf,F8),e(Qo,x8),e(Qo,kk),e(kk,hf),e(hf,E8),e(ht,B8),e(ht,Eo),w(ff,Eo,null),e(Eo,M8),e(Eo,Ys),e(Ys,z8),e(Ys,yk),e(yk,P8),e(Ys,j8),e(Ys,Tk),e(Tk,q8),e(Ys,C8),e(Eo,A8),w(ti,Eo,null),e(Eo,N8),w(oi,Eo,null),g(i,aT,_),g(i,Zs,_),e(Zs,ni),e(ni,wk),w(uf,wk,null),e(Zs,I8),e(Zs,$k),e($k,O8),g(i,iT,_),g(i,ft,_),w(mf,ft,null),e(ft,L8),e(ft,er),e(er,D8),e(er,Fk),e(Fk,S8),e(er,U8),e(er,xk),e(xk,W8),e(er,H8),e(ft,R8),e(ft,gf),e(gf,K8),e(gf,gm),e(gm,Q8),e(gf,V8),e(ft,G8),e(ft,_f),e(_f,J8),e(_f,bf),e(bf,X8),e(_f,Y8),e(ft,Z8),e(ft,Ek),e(Ek,eN),e(ft,tN),e(ft,Vo),e(Vo,Bk),e(Bk,vf),e(vf,oN),e(Vo,nN),e(Vo,Mk),e(Mk,kf),e(kf,sN),e(Vo,rN),e(Vo,zk),e(zk,yf),e(yf,aN),e(Vo,iN),e(Vo,Pk),e(Pk,Tf),e(Tf,lN),e(ft,dN),e(ft,Bo),w(wf,Bo,null),e(Bo,cN),e(Bo,tr),e(tr,pN),e(tr,jk),e(jk,hN),e(tr,fN),e(tr,qk),e(qk,uN),e(tr,mN),e(Bo,gN),w(si,Bo,null),e(Bo,_N),w(ri,Bo,null),lT=!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 e1={};_&2&&(e1.$$scope={dirty:_,ctx:i}),ea.$set(e1);const t1={};_&2&&(t1.$$scope={dirty:_,ctx:i}),ta.$set(t1);const o1={};_&2&&(o1.$$scope={dirty:_,ctx:i}),oa.$set(o1);const n1={};_&2&&(n1.$$scope={dirty:_,ctx:i}),sa.$set(n1);const s1={};_&2&&(s1.$$scope={dirty:_,ctx:i}),aa.$set(s1);const nr={};_&2&&(nr.$$scope={dirty:_,ctx:i}),ia.$set(nr);const r1={};_&2&&(r1.$$scope={dirty:_,ctx:i}),la.$set(r1);const a1={};_&2&&(a1.$$scope={dirty:_,ctx:i}),da.$set(a1);const Mf={};_&2&&(Mf.$$scope={dirty:_,ctx:i}),pa.$set(Mf);const i1={};_&2&&(i1.$$scope={dirty:_,ctx:i}),ha.$set(i1);const l1={};_&2&&(l1.$$scope={dirty:_,ctx:i}),fa.$set(l1);const d1={};_&2&&(d1.$$scope={dirty:_,ctx:i}),ma.$set(d1);const c1={};_&2&&(c1.$$scope={dirty:_,ctx:i}),ga.$set(c1);const ut={};_&2&&(ut.$$scope={dirty:_,ctx:i}),_a.$set(ut);const zf={};_&2&&(zf.$$scope={dirty:_,ctx:i}),ba.$set(zf);const p1={};_&2&&(p1.$$scope={dirty:_,ctx:i}),ka.$set(p1);const Pf={};_&2&&(Pf.$$scope={dirty:_,ctx:i}),ya.$set(Pf);const h1={};_&2&&(h1.$$scope={dirty:_,ctx:i}),Ta.$set(h1);const jf={};_&2&&(jf.$$scope={dirty:_,ctx:i}),$a.$set(jf);const f1={};_&2&&(f1.$$scope={dirty:_,ctx:i}),Fa.$set(f1);const qf={};_&2&&(qf.$$scope={dirty:_,ctx:i}),xa.$set(qf);const u1={};_&2&&(u1.$$scope={dirty:_,ctx:i}),Ea.$set(u1);const un={};_&2&&(un.$$scope={dirty:_,ctx:i}),Ma.$set(un);const m1={};_&2&&(m1.$$scope={dirty:_,ctx:i}),za.$set(m1);const g1={};_&2&&(g1.$$scope={dirty:_,ctx:i}),Pa.$set(g1);const _1={};_&2&&(_1.$$scope={dirty:_,ctx:i}),ja.$set(_1);const mn={};_&2&&(mn.$$scope={dirty:_,ctx:i}),Ca.$set(mn);const b1={};_&2&&(b1.$$scope={dirty:_,ctx:i}),Aa.$set(b1);const v1={};_&2&&(v1.$$scope={dirty:_,ctx:i}),Ia.$set(v1);const k1={};_&2&&(k1.$$scope={dirty:_,ctx:i}),Oa.$set(k1);const gn={};_&2&&(gn.$$scope={dirty:_,ctx:i}),Da.$set(gn);const y1={};_&2&&(y1.$$scope={dirty:_,ctx:i}),Sa.$set(y1);const T1={};_&2&&(T1.$$scope={dirty:_,ctx:i}),Wa.$set(T1);const w1={};_&2&&(w1.$$scope={dirty:_,ctx:i}),Ha.$set(w1);const $1={};_&2&&($1.$$scope={dirty:_,ctx:i}),Ka.$set($1);const F1={};_&2&&(F1.$$scope={dirty:_,ctx:i}),Qa.$set(F1);const Ft={};_&2&&(Ft.$$scope={dirty:_,ctx:i}),Ga.$set(Ft);const Cf={};_&2&&(Cf.$$scope={dirty:_,ctx:i}),Ja.$set(Cf);const x1={};_&2&&(x1.$$scope={dirty:_,ctx:i}),Ya.$set(x1);const sr={};_&2&&(sr.$$scope={dirty:_,ctx:i}),Za.$set(sr);const E1={};_&2&&(E1.$$scope={dirty:_,ctx:i}),ti.$set(E1);const B1={};_&2&&(B1.$$scope={dirty:_,ctx:i}),oi.$set(B1);const _n={};_&2&&(_n.$$scope={dirty:_,ctx:i}),si.$set(_n);const M1={};_&2&&(M1.$$scope={dirty:_,ctx:i}),ri.$set(M1)},i(i){lT||($(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),lT=!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),lT=!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(j1),i&&t(Nn),x(Di),i&&t(q1),i&&t(Wf),i&&t(C1),x(Si,i),i&&t(A1),i&&t(tt),i&&t(N1),x(ol,i),i&&t(I1),i&&t(mt),i&&t(O1),x(fl,i),i&&t(L1),i&&t(Ot),i&&t(D1),x(yl,i),i&&t(S1),i&&t(Lt),i&&t(U1),i&&t(du),i&&t(W1),i&&t(an),i&&t(H1),i&&t(jl),i&&t(R1),i&&t(lr),i&&t(K1),i&&t(Il),i&&t(Q1),i&&t(fu),i&&t(V1),i&&t(Dl),i&&t(G1),i&&t(xt),i&&t(J1),i&&t(On),x(Zl),i&&t(X1),i&&t(so),x(ed),x(cr),i&&t(Y1),i&&t(Dn),x(od),i&&t(Z1),i&&t(ot),x(nd),x(rd),x(id),x(dd),x(fr),x(cd),i&&t(ey),i&&t(Un),x(pd),i&&t(ty),i&&t(Bt),x(hd),x(md),x(_d),x(mr),i&&t(oy),i&&t(Hn),x(bd),i&&t(ny),i&&t(Mt),x(vd),x(yd),x(_r),x(wd),x(br),i&&t(sy),i&&t(Qn),x($d),i&&t(ry),i&&t(Vn),x(Fd),i&&t(ay),i&&t(Gn),x(Ed),i&&t(iy),i&&t(Lo),x(Md),x(Pd),i&&t(ly),i&&t(Jn),x(jd),i&&t(dy),i&&t(nt),x(qd),x(Ld),x(Tr),x(wr),i&&t(cy),i&&t(Yn),x(Dd),i&&t(py),i&&t(zt),x(Sd),x(Rd),x(Fr),x(xr),i&&t(hy),i&&t(ts),x(Kd),i&&t(fy),i&&t(Pt),x(Qd),x(Yd),x(Br),x(Mr),i&&t(uy),i&&t(ns),x(Zd),i&&t(my),i&&t(jt),x(ec),x(rc),x(Pr),x(jr),i&&t(gy),i&&t(rs),x(ac),i&&t(_y),i&&t(qt),x(ic),x(hc),x(Cr),x(Ar),i&&t(by),i&&t(is),x(fc),i&&t(vy),i&&t(Ct),x(uc),x(bc),x(Ir),x(Or),x(Lr),i&&t(ky),i&&t(ds),x(vc),i&&t(yy),i&&t(At),x(kc),x($c),x(Sr),x(Ur),i&&t(Ty),i&&t(ps),x(Fc),i&&t(wy),i&&t(Nt),x(xc),x(zc),x(Hr),x(Rr),i&&t($y),i&&t(fs),x(Pc),i&&t(Fy),i&&t(It),x(jc),x(Nc),x(Qr),x(Vr),i&&t(xy),i&&t(gs),x(Ic),i&&t(Ey),i&&t(_t),x(Oc),x(Jr),x(Uc),x(Xr),x(Yr),i&&t(By),i&&t(bs),x(Wc),i&&t(My),i&&t(bt),x(Hc),x(ea),x(Vc),x(ta),x(oa),i&&t(zy),i&&t(ys),x(Gc),i&&t(Py),i&&t(Ts),x(Jc),x(Xc),x(sa),i&&t(jy),i&&t(ws),x(tp),i&&t(qy),i&&t(vt),x(op),x(aa),x(ip),x(ia),x(la),x(da),i&&t(Cy),i&&t(Fs),x(lp),i&&t(Ay),i&&t(kt),x(dp),x(pa),x(up),x(ha),x(fa),i&&t(Ny),i&&t(Es),x(mp),i&&t(Iy),i&&t(yt),x(gp),x(ma),x(kp),x(ga),x(_a),x(ba),i&&t(Oy),i&&t(Ms),x(yp),i&&t(Ly),i&&t(Tt),x(Tp),x(ka),x(xp),x(ya),x(Ta),i&&t(Dy),i&&t(Ps),x(Ep),i&&t(Sy),i&&t(wt),x(Bp),x($a),x(jp),x(Fa),x(xa),x(Ea),i&&t(Uy),i&&t(qs),x(qp),i&&t(Wy),i&&t($t),x(Cp),x(Ma),x(Op),x(za),x(Pa),x(ja),i&&t(Hy),i&&t(Ns),x(Lp),i&&t(Ry),i&&t(rt),x(Dp),x(Vp),x(Ca),x(Aa),i&&t(Ky),i&&t(Os),x(Gp),i&&t(Qy),i&&t(at),x(Jp),x(sh),x(Ia),x(Oa),i&&t(Vy),i&&t(Ss),x(rh),i&&t(Gy),i&&t(it),x(ah),x(uh),x(Da),x(Sa),i&&t(Jy),i&&t(Ws),x(mh),i&&t(Xy),i&&t(lt),x(gh),x(Fh),x(Wa),x(Ha),i&&t(Yy),i&&t(Rs),x(xh),i&&t(Zy),i&&t(dt),x(Eh),x(Nh),x(Ka),x(Qa),i&&t(eT),i&&t(Qs),x(Ih),i&&t(tT),i&&t(ct),x(Oh),x(Kh),x(Ga),x(Ja),i&&t(oT),i&&t(Gs),x(Qh),i&&t(nT),i&&t(pt),x(Vh),x(of),x(Ya),x(Za),i&&t(sT),i&&t(Xs),x(nf),i&&t(rT),i&&t(ht),x(sf),x(ff),x(ti),x(oi),i&&t(aT),i&&t(Zs),x(uf),i&&t(iT),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};
