import{S as N6,i as O6,s as I6,e as s,k as l,w as y,t as o,M as A6,c as r,d as t,m as d,a,x as k,h as n,b as c,F as e,g as f,y as b,q as v,o as w,B as F}from"../../chunks/vendor-4833417e.js";import{T as be}from"../../chunks/Tip-fffd6df1.js";import{D as C}from"../../chunks/Docstring-4f315ed9.js";import{C as Be}from"../../chunks/CodeBlock-6a3d1b46.js";import{I as we}from"../../chunks/IconCopyLink-4b81c553.js";import"../../chunks/CopyButton-dacfbfaf.js";function D6(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function L6(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function S6(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function U6(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function W6(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function H6(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function R6(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function Q6(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function V6(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function K6(j){let p,x,g,T,$,_,m,B,me,X,M,ee,D,oe,ge,L,_e,ce,J,O,ne,Y,z,q,se,H,pe,re,S,Te,he,P,ie,R,fe,ae,Q,ue,te,N,ye,V,le;return{c(){p=s("p"),x=o("TF 2.0 models accepts two formats as inputs:"),g=l(),T=s("ul"),$=s("li"),_=o("having all inputs as keyword arguments (like PyTorch models), or"),m=l(),B=s("li"),me=o("having all inputs as a list, tuple or dict in the first positional arguments."),X=l(),M=s("p"),ee=o("This second option is useful when using "),D=s("code"),oe=o("tf.keras.Model.fit"),ge=o(` method which currently requires having all the
tensors in the first argument of the model call function: `),L=s("code"),_e=o("model(inputs)"),ce=o("."),J=l(),O=s("p"),ne=o(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),Y=l(),z=s("ul"),q=s("li"),se=o("a single Tensor with "),H=s("code"),pe=o("input_ids"),re=o(" only and nothing else: "),S=s("code"),Te=o("model(inputs_ids)"),he=l(),P=s("li"),ie=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=s("code"),fe=o("model([input_ids, attention_mask])"),ae=o(" or "),Q=s("code"),ue=o("model([input_ids, attention_mask, token_type_ids])"),te=l(),N=s("li"),ye=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=s("code"),le=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(h){p=r(h,"P",{});var E=a(p);x=n(E,"TF 2.0 models accepts two formats as inputs:"),E.forEach(t),g=d(h),T=r(h,"UL",{});var K=a(T);$=r(K,"LI",{});var Ee=a($);_=n(Ee,"having all inputs as keyword arguments (like PyTorch models), or"),Ee.forEach(t),m=d(K),B=r(K,"LI",{});var Fe=a(B);me=n(Fe,"having all inputs as a list, tuple or dict in the first positional arguments."),Fe.forEach(t),K.forEach(t),X=d(h),M=r(h,"P",{});var I=a(M);ee=n(I,"This second option is useful when using "),D=r(I,"CODE",{});var Me=a(D);oe=n(Me,"tf.keras.Model.fit"),Me.forEach(t),ge=n(I,` method which currently requires having all the
tensors in the first argument of the model call function: `),L=r(I,"CODE",{});var $e=a(L);_e=n($e,"model(inputs)"),$e.forEach(t),ce=n(I,"."),I.forEach(t),J=d(h),O=r(h,"P",{});var ze=a(O);ne=n(ze,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ze.forEach(t),Y=d(h),z=r(h,"UL",{});var A=a(z);q=r(A,"LI",{});var W=a(q);se=n(W,"a single Tensor with "),H=r(W,"CODE",{});var ke=a(H);pe=n(ke,"input_ids"),ke.forEach(t),re=n(W," only and nothing else: "),S=r(W,"CODE",{});var ve=a(S);Te=n(ve,"model(inputs_ids)"),ve.forEach(t),W.forEach(t),he=d(A),P=r(A,"LI",{});var U=a(P);ie=n(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=r(U,"CODE",{});var xe=a(R);fe=n(xe,"model([input_ids, attention_mask])"),xe.forEach(t),ae=n(U," or "),Q=r(U,"CODE",{});var Pe=a(Q);ue=n(Pe,"model([input_ids, attention_mask, token_type_ids])"),Pe.forEach(t),U.forEach(t),te=d(A),N=r(A,"LI",{});var de=a(N);ye=n(de,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=r(de,"CODE",{});var qe=a(V);le=n(qe,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),qe.forEach(t),de.forEach(t),A.forEach(t)},m(h,E){f(h,p,E),e(p,x),f(h,g,E),f(h,T,E),e(T,$),e($,_),e(T,m),e(T,B),e(B,me),f(h,X,E),f(h,M,E),e(M,ee),e(M,D),e(D,oe),e(M,ge),e(M,L),e(L,_e),e(M,ce),f(h,J,E),f(h,O,E),e(O,ne),f(h,Y,E),f(h,z,E),e(z,q),e(q,se),e(q,H),e(H,pe),e(q,re),e(q,S),e(S,Te),e(z,he),e(z,P),e(P,ie),e(P,R),e(R,fe),e(P,ae),e(P,Q),e(Q,ue),e(z,te),e(z,N),e(N,ye),e(N,V),e(V,le)},d(h){h&&t(p),h&&t(g),h&&t(T),h&&t(X),h&&t(M),h&&t(J),h&&t(O),h&&t(Y),h&&t(z)}}}function J6(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function G6(j){let p,x,g,T,$,_,m,B,me,X,M,ee,D,oe,ge,L,_e,ce,J,O,ne,Y,z,q,se,H,pe,re,S,Te,he,P,ie,R,fe,ae,Q,ue,te,N,ye,V,le;return{c(){p=s("p"),x=o("TF 2.0 models accepts two formats as inputs:"),g=l(),T=s("ul"),$=s("li"),_=o("having all inputs as keyword arguments (like PyTorch models), or"),m=l(),B=s("li"),me=o("having all inputs as a list, tuple or dict in the first positional arguments."),X=l(),M=s("p"),ee=o("This second option is useful when using "),D=s("code"),oe=o("tf.keras.Model.fit"),ge=o(` method which currently requires having all the
tensors in the first argument of the model call function: `),L=s("code"),_e=o("model(inputs)"),ce=o("."),J=l(),O=s("p"),ne=o(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),Y=l(),z=s("ul"),q=s("li"),se=o("a single Tensor with "),H=s("code"),pe=o("input_ids"),re=o(" only and nothing else: "),S=s("code"),Te=o("model(inputs_ids)"),he=l(),P=s("li"),ie=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=s("code"),fe=o("model([input_ids, attention_mask])"),ae=o(" or "),Q=s("code"),ue=o("model([input_ids, attention_mask, token_type_ids])"),te=l(),N=s("li"),ye=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=s("code"),le=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(h){p=r(h,"P",{});var E=a(p);x=n(E,"TF 2.0 models accepts two formats as inputs:"),E.forEach(t),g=d(h),T=r(h,"UL",{});var K=a(T);$=r(K,"LI",{});var Ee=a($);_=n(Ee,"having all inputs as keyword arguments (like PyTorch models), or"),Ee.forEach(t),m=d(K),B=r(K,"LI",{});var Fe=a(B);me=n(Fe,"having all inputs as a list, tuple or dict in the first positional arguments."),Fe.forEach(t),K.forEach(t),X=d(h),M=r(h,"P",{});var I=a(M);ee=n(I,"This second option is useful when using "),D=r(I,"CODE",{});var Me=a(D);oe=n(Me,"tf.keras.Model.fit"),Me.forEach(t),ge=n(I,` method which currently requires having all the
tensors in the first argument of the model call function: `),L=r(I,"CODE",{});var $e=a(L);_e=n($e,"model(inputs)"),$e.forEach(t),ce=n(I,"."),I.forEach(t),J=d(h),O=r(h,"P",{});var ze=a(O);ne=n(ze,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ze.forEach(t),Y=d(h),z=r(h,"UL",{});var A=a(z);q=r(A,"LI",{});var W=a(q);se=n(W,"a single Tensor with "),H=r(W,"CODE",{});var ke=a(H);pe=n(ke,"input_ids"),ke.forEach(t),re=n(W," only and nothing else: "),S=r(W,"CODE",{});var ve=a(S);Te=n(ve,"model(inputs_ids)"),ve.forEach(t),W.forEach(t),he=d(A),P=r(A,"LI",{});var U=a(P);ie=n(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=r(U,"CODE",{});var xe=a(R);fe=n(xe,"model([input_ids, attention_mask])"),xe.forEach(t),ae=n(U," or "),Q=r(U,"CODE",{});var Pe=a(Q);ue=n(Pe,"model([input_ids, attention_mask, token_type_ids])"),Pe.forEach(t),U.forEach(t),te=d(A),N=r(A,"LI",{});var de=a(N);ye=n(de,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=r(de,"CODE",{});var qe=a(V);le=n(qe,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),qe.forEach(t),de.forEach(t),A.forEach(t)},m(h,E){f(h,p,E),e(p,x),f(h,g,E),f(h,T,E),e(T,$),e($,_),e(T,m),e(T,B),e(B,me),f(h,X,E),f(h,M,E),e(M,ee),e(M,D),e(D,oe),e(M,ge),e(M,L),e(L,_e),e(M,ce),f(h,J,E),f(h,O,E),e(O,ne),f(h,Y,E),f(h,z,E),e(z,q),e(q,se),e(q,H),e(H,pe),e(q,re),e(q,S),e(S,Te),e(z,he),e(z,P),e(P,ie),e(P,R),e(R,fe),e(P,ae),e(P,Q),e(Q,ue),e(z,te),e(z,N),e(N,ye),e(N,V),e(V,le)},d(h){h&&t(p),h&&t(g),h&&t(T),h&&t(X),h&&t(M),h&&t(J),h&&t(O),h&&t(Y),h&&t(z)}}}function X6(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function Y6(j){let p,x,g,T,$,_,m,B,me,X,M,ee,D,oe,ge,L,_e,ce,J,O,ne,Y,z,q,se,H,pe,re,S,Te,he,P,ie,R,fe,ae,Q,ue,te,N,ye,V,le;return{c(){p=s("p"),x=o("TF 2.0 models accepts two formats as inputs:"),g=l(),T=s("ul"),$=s("li"),_=o("having all inputs as keyword arguments (like PyTorch models), or"),m=l(),B=s("li"),me=o("having all inputs as a list, tuple or dict in the first positional arguments."),X=l(),M=s("p"),ee=o("This second option is useful when using "),D=s("code"),oe=o("tf.keras.Model.fit"),ge=o(` method which currently requires having all the
tensors in the first argument of the model call function: `),L=s("code"),_e=o("model(inputs)"),ce=o("."),J=l(),O=s("p"),ne=o(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),Y=l(),z=s("ul"),q=s("li"),se=o("a single Tensor with "),H=s("code"),pe=o("input_ids"),re=o(" only and nothing else: "),S=s("code"),Te=o("model(inputs_ids)"),he=l(),P=s("li"),ie=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=s("code"),fe=o("model([input_ids, attention_mask])"),ae=o(" or "),Q=s("code"),ue=o("model([input_ids, attention_mask, token_type_ids])"),te=l(),N=s("li"),ye=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=s("code"),le=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(h){p=r(h,"P",{});var E=a(p);x=n(E,"TF 2.0 models accepts two formats as inputs:"),E.forEach(t),g=d(h),T=r(h,"UL",{});var K=a(T);$=r(K,"LI",{});var Ee=a($);_=n(Ee,"having all inputs as keyword arguments (like PyTorch models), or"),Ee.forEach(t),m=d(K),B=r(K,"LI",{});var Fe=a(B);me=n(Fe,"having all inputs as a list, tuple or dict in the first positional arguments."),Fe.forEach(t),K.forEach(t),X=d(h),M=r(h,"P",{});var I=a(M);ee=n(I,"This second option is useful when using "),D=r(I,"CODE",{});var Me=a(D);oe=n(Me,"tf.keras.Model.fit"),Me.forEach(t),ge=n(I,` method which currently requires having all the
tensors in the first argument of the model call function: `),L=r(I,"CODE",{});var $e=a(L);_e=n($e,"model(inputs)"),$e.forEach(t),ce=n(I,"."),I.forEach(t),J=d(h),O=r(h,"P",{});var ze=a(O);ne=n(ze,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ze.forEach(t),Y=d(h),z=r(h,"UL",{});var A=a(z);q=r(A,"LI",{});var W=a(q);se=n(W,"a single Tensor with "),H=r(W,"CODE",{});var ke=a(H);pe=n(ke,"input_ids"),ke.forEach(t),re=n(W," only and nothing else: "),S=r(W,"CODE",{});var ve=a(S);Te=n(ve,"model(inputs_ids)"),ve.forEach(t),W.forEach(t),he=d(A),P=r(A,"LI",{});var U=a(P);ie=n(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=r(U,"CODE",{});var xe=a(R);fe=n(xe,"model([input_ids, attention_mask])"),xe.forEach(t),ae=n(U," or "),Q=r(U,"CODE",{});var Pe=a(Q);ue=n(Pe,"model([input_ids, attention_mask, token_type_ids])"),Pe.forEach(t),U.forEach(t),te=d(A),N=r(A,"LI",{});var de=a(N);ye=n(de,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=r(de,"CODE",{});var qe=a(V);le=n(qe,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),qe.forEach(t),de.forEach(t),A.forEach(t)},m(h,E){f(h,p,E),e(p,x),f(h,g,E),f(h,T,E),e(T,$),e($,_),e(T,m),e(T,B),e(B,me),f(h,X,E),f(h,M,E),e(M,ee),e(M,D),e(D,oe),e(M,ge),e(M,L),e(L,_e),e(M,ce),f(h,J,E),f(h,O,E),e(O,ne),f(h,Y,E),f(h,z,E),e(z,q),e(q,se),e(q,H),e(H,pe),e(q,re),e(q,S),e(S,Te),e(z,he),e(z,P),e(P,ie),e(P,R),e(R,fe),e(P,ae),e(P,Q),e(Q,ue),e(z,te),e(z,N),e(N,ye),e(N,V),e(V,le)},d(h){h&&t(p),h&&t(g),h&&t(T),h&&t(X),h&&t(M),h&&t(J),h&&t(O),h&&t(Y),h&&t(z)}}}function Z6(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function eN(j){let p,x,g,T,$,_,m,B,me,X,M,ee,D,oe,ge,L,_e,ce,J,O,ne,Y,z,q,se,H,pe,re,S,Te,he,P,ie,R,fe,ae,Q,ue,te,N,ye,V,le;return{c(){p=s("p"),x=o("TF 2.0 models accepts two formats as inputs:"),g=l(),T=s("ul"),$=s("li"),_=o("having all inputs as keyword arguments (like PyTorch models), or"),m=l(),B=s("li"),me=o("having all inputs as a list, tuple or dict in the first positional arguments."),X=l(),M=s("p"),ee=o("This second option is useful when using "),D=s("code"),oe=o("tf.keras.Model.fit"),ge=o(` method which currently requires having all the
tensors in the first argument of the model call function: `),L=s("code"),_e=o("model(inputs)"),ce=o("."),J=l(),O=s("p"),ne=o(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),Y=l(),z=s("ul"),q=s("li"),se=o("a single Tensor with "),H=s("code"),pe=o("input_ids"),re=o(" only and nothing else: "),S=s("code"),Te=o("model(inputs_ids)"),he=l(),P=s("li"),ie=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=s("code"),fe=o("model([input_ids, attention_mask])"),ae=o(" or "),Q=s("code"),ue=o("model([input_ids, attention_mask, token_type_ids])"),te=l(),N=s("li"),ye=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=s("code"),le=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(h){p=r(h,"P",{});var E=a(p);x=n(E,"TF 2.0 models accepts two formats as inputs:"),E.forEach(t),g=d(h),T=r(h,"UL",{});var K=a(T);$=r(K,"LI",{});var Ee=a($);_=n(Ee,"having all inputs as keyword arguments (like PyTorch models), or"),Ee.forEach(t),m=d(K),B=r(K,"LI",{});var Fe=a(B);me=n(Fe,"having all inputs as a list, tuple or dict in the first positional arguments."),Fe.forEach(t),K.forEach(t),X=d(h),M=r(h,"P",{});var I=a(M);ee=n(I,"This second option is useful when using "),D=r(I,"CODE",{});var Me=a(D);oe=n(Me,"tf.keras.Model.fit"),Me.forEach(t),ge=n(I,` method which currently requires having all the
tensors in the first argument of the model call function: `),L=r(I,"CODE",{});var $e=a(L);_e=n($e,"model(inputs)"),$e.forEach(t),ce=n(I,"."),I.forEach(t),J=d(h),O=r(h,"P",{});var ze=a(O);ne=n(ze,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ze.forEach(t),Y=d(h),z=r(h,"UL",{});var A=a(z);q=r(A,"LI",{});var W=a(q);se=n(W,"a single Tensor with "),H=r(W,"CODE",{});var ke=a(H);pe=n(ke,"input_ids"),ke.forEach(t),re=n(W," only and nothing else: "),S=r(W,"CODE",{});var ve=a(S);Te=n(ve,"model(inputs_ids)"),ve.forEach(t),W.forEach(t),he=d(A),P=r(A,"LI",{});var U=a(P);ie=n(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=r(U,"CODE",{});var xe=a(R);fe=n(xe,"model([input_ids, attention_mask])"),xe.forEach(t),ae=n(U," or "),Q=r(U,"CODE",{});var Pe=a(Q);ue=n(Pe,"model([input_ids, attention_mask, token_type_ids])"),Pe.forEach(t),U.forEach(t),te=d(A),N=r(A,"LI",{});var de=a(N);ye=n(de,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=r(de,"CODE",{});var qe=a(V);le=n(qe,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),qe.forEach(t),de.forEach(t),A.forEach(t)},m(h,E){f(h,p,E),e(p,x),f(h,g,E),f(h,T,E),e(T,$),e($,_),e(T,m),e(T,B),e(B,me),f(h,X,E),f(h,M,E),e(M,ee),e(M,D),e(D,oe),e(M,ge),e(M,L),e(L,_e),e(M,ce),f(h,J,E),f(h,O,E),e(O,ne),f(h,Y,E),f(h,z,E),e(z,q),e(q,se),e(q,H),e(H,pe),e(q,re),e(q,S),e(S,Te),e(z,he),e(z,P),e(P,ie),e(P,R),e(R,fe),e(P,ae),e(P,Q),e(Q,ue),e(z,te),e(z,N),e(N,ye),e(N,V),e(V,le)},d(h){h&&t(p),h&&t(g),h&&t(T),h&&t(X),h&&t(M),h&&t(J),h&&t(O),h&&t(Y),h&&t(z)}}}function tN(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function oN(j){let p,x,g,T,$,_,m,B,me,X,M,ee,D,oe,ge,L,_e,ce,J,O,ne,Y,z,q,se,H,pe,re,S,Te,he,P,ie,R,fe,ae,Q,ue,te,N,ye,V,le;return{c(){p=s("p"),x=o("TF 2.0 models accepts two formats as inputs:"),g=l(),T=s("ul"),$=s("li"),_=o("having all inputs as keyword arguments (like PyTorch models), or"),m=l(),B=s("li"),me=o("having all inputs as a list, tuple or dict in the first positional arguments."),X=l(),M=s("p"),ee=o("This second option is useful when using "),D=s("code"),oe=o("tf.keras.Model.fit"),ge=o(` method which currently requires having all the
tensors in the first argument of the model call function: `),L=s("code"),_e=o("model(inputs)"),ce=o("."),J=l(),O=s("p"),ne=o(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),Y=l(),z=s("ul"),q=s("li"),se=o("a single Tensor with "),H=s("code"),pe=o("input_ids"),re=o(" only and nothing else: "),S=s("code"),Te=o("model(inputs_ids)"),he=l(),P=s("li"),ie=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=s("code"),fe=o("model([input_ids, attention_mask])"),ae=o(" or "),Q=s("code"),ue=o("model([input_ids, attention_mask, token_type_ids])"),te=l(),N=s("li"),ye=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=s("code"),le=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(h){p=r(h,"P",{});var E=a(p);x=n(E,"TF 2.0 models accepts two formats as inputs:"),E.forEach(t),g=d(h),T=r(h,"UL",{});var K=a(T);$=r(K,"LI",{});var Ee=a($);_=n(Ee,"having all inputs as keyword arguments (like PyTorch models), or"),Ee.forEach(t),m=d(K),B=r(K,"LI",{});var Fe=a(B);me=n(Fe,"having all inputs as a list, tuple or dict in the first positional arguments."),Fe.forEach(t),K.forEach(t),X=d(h),M=r(h,"P",{});var I=a(M);ee=n(I,"This second option is useful when using "),D=r(I,"CODE",{});var Me=a(D);oe=n(Me,"tf.keras.Model.fit"),Me.forEach(t),ge=n(I,` method which currently requires having all the
tensors in the first argument of the model call function: `),L=r(I,"CODE",{});var $e=a(L);_e=n($e,"model(inputs)"),$e.forEach(t),ce=n(I,"."),I.forEach(t),J=d(h),O=r(h,"P",{});var ze=a(O);ne=n(ze,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ze.forEach(t),Y=d(h),z=r(h,"UL",{});var A=a(z);q=r(A,"LI",{});var W=a(q);se=n(W,"a single Tensor with "),H=r(W,"CODE",{});var ke=a(H);pe=n(ke,"input_ids"),ke.forEach(t),re=n(W," only and nothing else: "),S=r(W,"CODE",{});var ve=a(S);Te=n(ve,"model(inputs_ids)"),ve.forEach(t),W.forEach(t),he=d(A),P=r(A,"LI",{});var U=a(P);ie=n(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=r(U,"CODE",{});var xe=a(R);fe=n(xe,"model([input_ids, attention_mask])"),xe.forEach(t),ae=n(U," or "),Q=r(U,"CODE",{});var Pe=a(Q);ue=n(Pe,"model([input_ids, attention_mask, token_type_ids])"),Pe.forEach(t),U.forEach(t),te=d(A),N=r(A,"LI",{});var de=a(N);ye=n(de,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=r(de,"CODE",{});var qe=a(V);le=n(qe,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),qe.forEach(t),de.forEach(t),A.forEach(t)},m(h,E){f(h,p,E),e(p,x),f(h,g,E),f(h,T,E),e(T,$),e($,_),e(T,m),e(T,B),e(B,me),f(h,X,E),f(h,M,E),e(M,ee),e(M,D),e(D,oe),e(M,ge),e(M,L),e(L,_e),e(M,ce),f(h,J,E),f(h,O,E),e(O,ne),f(h,Y,E),f(h,z,E),e(z,q),e(q,se),e(q,H),e(H,pe),e(q,re),e(q,S),e(S,Te),e(z,he),e(z,P),e(P,ie),e(P,R),e(R,fe),e(P,ae),e(P,Q),e(Q,ue),e(z,te),e(z,N),e(N,ye),e(N,V),e(V,le)},d(h){h&&t(p),h&&t(g),h&&t(T),h&&t(X),h&&t(M),h&&t(J),h&&t(O),h&&t(Y),h&&t(z)}}}function nN(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function sN(j){let p,x,g,T,$,_,m,B,me,X,M,ee,D,oe,ge,L,_e,ce,J,O,ne,Y,z,q,se,H,pe,re,S,Te,he,P,ie,R,fe,ae,Q,ue,te,N,ye,V,le;return{c(){p=s("p"),x=o("TF 2.0 models accepts two formats as inputs:"),g=l(),T=s("ul"),$=s("li"),_=o("having all inputs as keyword arguments (like PyTorch models), or"),m=l(),B=s("li"),me=o("having all inputs as a list, tuple or dict in the first positional arguments."),X=l(),M=s("p"),ee=o("This second option is useful when using "),D=s("code"),oe=o("tf.keras.Model.fit"),ge=o(` method which currently requires having all the
tensors in the first argument of the model call function: `),L=s("code"),_e=o("model(inputs)"),ce=o("."),J=l(),O=s("p"),ne=o(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),Y=l(),z=s("ul"),q=s("li"),se=o("a single Tensor with "),H=s("code"),pe=o("input_ids"),re=o(" only and nothing else: "),S=s("code"),Te=o("model(inputs_ids)"),he=l(),P=s("li"),ie=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=s("code"),fe=o("model([input_ids, attention_mask])"),ae=o(" or "),Q=s("code"),ue=o("model([input_ids, attention_mask, token_type_ids])"),te=l(),N=s("li"),ye=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=s("code"),le=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(h){p=r(h,"P",{});var E=a(p);x=n(E,"TF 2.0 models accepts two formats as inputs:"),E.forEach(t),g=d(h),T=r(h,"UL",{});var K=a(T);$=r(K,"LI",{});var Ee=a($);_=n(Ee,"having all inputs as keyword arguments (like PyTorch models), or"),Ee.forEach(t),m=d(K),B=r(K,"LI",{});var Fe=a(B);me=n(Fe,"having all inputs as a list, tuple or dict in the first positional arguments."),Fe.forEach(t),K.forEach(t),X=d(h),M=r(h,"P",{});var I=a(M);ee=n(I,"This second option is useful when using "),D=r(I,"CODE",{});var Me=a(D);oe=n(Me,"tf.keras.Model.fit"),Me.forEach(t),ge=n(I,` method which currently requires having all the
tensors in the first argument of the model call function: `),L=r(I,"CODE",{});var $e=a(L);_e=n($e,"model(inputs)"),$e.forEach(t),ce=n(I,"."),I.forEach(t),J=d(h),O=r(h,"P",{});var ze=a(O);ne=n(ze,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ze.forEach(t),Y=d(h),z=r(h,"UL",{});var A=a(z);q=r(A,"LI",{});var W=a(q);se=n(W,"a single Tensor with "),H=r(W,"CODE",{});var ke=a(H);pe=n(ke,"input_ids"),ke.forEach(t),re=n(W," only and nothing else: "),S=r(W,"CODE",{});var ve=a(S);Te=n(ve,"model(inputs_ids)"),ve.forEach(t),W.forEach(t),he=d(A),P=r(A,"LI",{});var U=a(P);ie=n(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=r(U,"CODE",{});var xe=a(R);fe=n(xe,"model([input_ids, attention_mask])"),xe.forEach(t),ae=n(U," or "),Q=r(U,"CODE",{});var Pe=a(Q);ue=n(Pe,"model([input_ids, attention_mask, token_type_ids])"),Pe.forEach(t),U.forEach(t),te=d(A),N=r(A,"LI",{});var de=a(N);ye=n(de,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=r(de,"CODE",{});var qe=a(V);le=n(qe,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),qe.forEach(t),de.forEach(t),A.forEach(t)},m(h,E){f(h,p,E),e(p,x),f(h,g,E),f(h,T,E),e(T,$),e($,_),e(T,m),e(T,B),e(B,me),f(h,X,E),f(h,M,E),e(M,ee),e(M,D),e(D,oe),e(M,ge),e(M,L),e(L,_e),e(M,ce),f(h,J,E),f(h,O,E),e(O,ne),f(h,Y,E),f(h,z,E),e(z,q),e(q,se),e(q,H),e(H,pe),e(q,re),e(q,S),e(S,Te),e(z,he),e(z,P),e(P,ie),e(P,R),e(R,fe),e(P,ae),e(P,Q),e(Q,ue),e(z,te),e(z,N),e(N,ye),e(N,V),e(V,le)},d(h){h&&t(p),h&&t(g),h&&t(T),h&&t(X),h&&t(M),h&&t(J),h&&t(O),h&&t(Y),h&&t(z)}}}function rN(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function aN(j){let p,x,g,T,$,_,m,B,me,X,M,ee,D,oe,ge,L,_e,ce,J,O,ne,Y,z,q,se,H,pe,re,S,Te,he,P,ie,R,fe,ae,Q,ue,te,N,ye,V,le;return{c(){p=s("p"),x=o("TF 2.0 models accepts two formats as inputs:"),g=l(),T=s("ul"),$=s("li"),_=o("having all inputs as keyword arguments (like PyTorch models), or"),m=l(),B=s("li"),me=o("having all inputs as a list, tuple or dict in the first positional arguments."),X=l(),M=s("p"),ee=o("This second option is useful when using "),D=s("code"),oe=o("tf.keras.Model.fit"),ge=o(` method which currently requires having all the
tensors in the first argument of the model call function: `),L=s("code"),_e=o("model(inputs)"),ce=o("."),J=l(),O=s("p"),ne=o(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),Y=l(),z=s("ul"),q=s("li"),se=o("a single Tensor with "),H=s("code"),pe=o("input_ids"),re=o(" only and nothing else: "),S=s("code"),Te=o("model(inputs_ids)"),he=l(),P=s("li"),ie=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=s("code"),fe=o("model([input_ids, attention_mask])"),ae=o(" or "),Q=s("code"),ue=o("model([input_ids, attention_mask, token_type_ids])"),te=l(),N=s("li"),ye=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=s("code"),le=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(h){p=r(h,"P",{});var E=a(p);x=n(E,"TF 2.0 models accepts two formats as inputs:"),E.forEach(t),g=d(h),T=r(h,"UL",{});var K=a(T);$=r(K,"LI",{});var Ee=a($);_=n(Ee,"having all inputs as keyword arguments (like PyTorch models), or"),Ee.forEach(t),m=d(K),B=r(K,"LI",{});var Fe=a(B);me=n(Fe,"having all inputs as a list, tuple or dict in the first positional arguments."),Fe.forEach(t),K.forEach(t),X=d(h),M=r(h,"P",{});var I=a(M);ee=n(I,"This second option is useful when using "),D=r(I,"CODE",{});var Me=a(D);oe=n(Me,"tf.keras.Model.fit"),Me.forEach(t),ge=n(I,` method which currently requires having all the
tensors in the first argument of the model call function: `),L=r(I,"CODE",{});var $e=a(L);_e=n($e,"model(inputs)"),$e.forEach(t),ce=n(I,"."),I.forEach(t),J=d(h),O=r(h,"P",{});var ze=a(O);ne=n(ze,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ze.forEach(t),Y=d(h),z=r(h,"UL",{});var A=a(z);q=r(A,"LI",{});var W=a(q);se=n(W,"a single Tensor with "),H=r(W,"CODE",{});var ke=a(H);pe=n(ke,"input_ids"),ke.forEach(t),re=n(W," only and nothing else: "),S=r(W,"CODE",{});var ve=a(S);Te=n(ve,"model(inputs_ids)"),ve.forEach(t),W.forEach(t),he=d(A),P=r(A,"LI",{});var U=a(P);ie=n(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=r(U,"CODE",{});var xe=a(R);fe=n(xe,"model([input_ids, attention_mask])"),xe.forEach(t),ae=n(U," or "),Q=r(U,"CODE",{});var Pe=a(Q);ue=n(Pe,"model([input_ids, attention_mask, token_type_ids])"),Pe.forEach(t),U.forEach(t),te=d(A),N=r(A,"LI",{});var de=a(N);ye=n(de,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=r(de,"CODE",{});var qe=a(V);le=n(qe,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),qe.forEach(t),de.forEach(t),A.forEach(t)},m(h,E){f(h,p,E),e(p,x),f(h,g,E),f(h,T,E),e(T,$),e($,_),e(T,m),e(T,B),e(B,me),f(h,X,E),f(h,M,E),e(M,ee),e(M,D),e(D,oe),e(M,ge),e(M,L),e(L,_e),e(M,ce),f(h,J,E),f(h,O,E),e(O,ne),f(h,Y,E),f(h,z,E),e(z,q),e(q,se),e(q,H),e(H,pe),e(q,re),e(q,S),e(S,Te),e(z,he),e(z,P),e(P,ie),e(P,R),e(R,fe),e(P,ae),e(P,Q),e(Q,ue),e(z,te),e(z,N),e(N,ye),e(N,V),e(V,le)},d(h){h&&t(p),h&&t(g),h&&t(T),h&&t(X),h&&t(M),h&&t(J),h&&t(O),h&&t(Y),h&&t(z)}}}function iN(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function lN(j){let p,x,g,T,$,_,m,B,me,X,M,ee,D,oe,ge,L,_e,ce,J,O,ne,Y,z,q,se,H,pe,re,S,Te,he,P,ie,R,fe,ae,Q,ue,te,N,ye,V,le;return{c(){p=s("p"),x=o("TF 2.0 models accepts two formats as inputs:"),g=l(),T=s("ul"),$=s("li"),_=o("having all inputs as keyword arguments (like PyTorch models), or"),m=l(),B=s("li"),me=o("having all inputs as a list, tuple or dict in the first positional arguments."),X=l(),M=s("p"),ee=o("This second option is useful when using "),D=s("code"),oe=o("tf.keras.Model.fit"),ge=o(` method which currently requires having all the
tensors in the first argument of the model call function: `),L=s("code"),_e=o("model(inputs)"),ce=o("."),J=l(),O=s("p"),ne=o(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),Y=l(),z=s("ul"),q=s("li"),se=o("a single Tensor with "),H=s("code"),pe=o("input_ids"),re=o(" only and nothing else: "),S=s("code"),Te=o("model(inputs_ids)"),he=l(),P=s("li"),ie=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=s("code"),fe=o("model([input_ids, attention_mask])"),ae=o(" or "),Q=s("code"),ue=o("model([input_ids, attention_mask, token_type_ids])"),te=l(),N=s("li"),ye=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=s("code"),le=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(h){p=r(h,"P",{});var E=a(p);x=n(E,"TF 2.0 models accepts two formats as inputs:"),E.forEach(t),g=d(h),T=r(h,"UL",{});var K=a(T);$=r(K,"LI",{});var Ee=a($);_=n(Ee,"having all inputs as keyword arguments (like PyTorch models), or"),Ee.forEach(t),m=d(K),B=r(K,"LI",{});var Fe=a(B);me=n(Fe,"having all inputs as a list, tuple or dict in the first positional arguments."),Fe.forEach(t),K.forEach(t),X=d(h),M=r(h,"P",{});var I=a(M);ee=n(I,"This second option is useful when using "),D=r(I,"CODE",{});var Me=a(D);oe=n(Me,"tf.keras.Model.fit"),Me.forEach(t),ge=n(I,` method which currently requires having all the
tensors in the first argument of the model call function: `),L=r(I,"CODE",{});var $e=a(L);_e=n($e,"model(inputs)"),$e.forEach(t),ce=n(I,"."),I.forEach(t),J=d(h),O=r(h,"P",{});var ze=a(O);ne=n(ze,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ze.forEach(t),Y=d(h),z=r(h,"UL",{});var A=a(z);q=r(A,"LI",{});var W=a(q);se=n(W,"a single Tensor with "),H=r(W,"CODE",{});var ke=a(H);pe=n(ke,"input_ids"),ke.forEach(t),re=n(W," only and nothing else: "),S=r(W,"CODE",{});var ve=a(S);Te=n(ve,"model(inputs_ids)"),ve.forEach(t),W.forEach(t),he=d(A),P=r(A,"LI",{});var U=a(P);ie=n(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=r(U,"CODE",{});var xe=a(R);fe=n(xe,"model([input_ids, attention_mask])"),xe.forEach(t),ae=n(U," or "),Q=r(U,"CODE",{});var Pe=a(Q);ue=n(Pe,"model([input_ids, attention_mask, token_type_ids])"),Pe.forEach(t),U.forEach(t),te=d(A),N=r(A,"LI",{});var de=a(N);ye=n(de,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=r(de,"CODE",{});var qe=a(V);le=n(qe,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),qe.forEach(t),de.forEach(t),A.forEach(t)},m(h,E){f(h,p,E),e(p,x),f(h,g,E),f(h,T,E),e(T,$),e($,_),e(T,m),e(T,B),e(B,me),f(h,X,E),f(h,M,E),e(M,ee),e(M,D),e(D,oe),e(M,ge),e(M,L),e(L,_e),e(M,ce),f(h,J,E),f(h,O,E),e(O,ne),f(h,Y,E),f(h,z,E),e(z,q),e(q,se),e(q,H),e(H,pe),e(q,re),e(q,S),e(S,Te),e(z,he),e(z,P),e(P,ie),e(P,R),e(R,fe),e(P,ae),e(P,Q),e(Q,ue),e(z,te),e(z,N),e(N,ye),e(N,V),e(V,le)},d(h){h&&t(p),h&&t(g),h&&t(T),h&&t(X),h&&t(M),h&&t(J),h&&t(O),h&&t(Y),h&&t(z)}}}function dN(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function cN(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function pN(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function hN(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function fN(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function uN(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function mN(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function gN(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function _N(j){let p,x,g,T,$;return{c(){p=s("p"),x=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),T=o("Module"),$=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(_){p=r(_,"P",{});var m=a(p);x=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var B=a(g);T=n(B,"Module"),B.forEach(t),$=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(_,m){f(_,p,m),e(p,x),e(p,g),e(g,T),e(p,$)},d(_){_&&t(p)}}}function TN(j){let p,x,g,T,$,_,m,B,me,X,M,ee,D,oe,ge,L,_e,ce,J,O,ne,Y,z,q,se,H,pe,re,S,Te,he,P,ie,R,fe,ae,Q,ue,te,N,ye,V,le,h,E,K,Ee,Fe,I,Me,$e,ze,A,W,ke,ve,U,xe,Pe,de,qe,o_,ot,Cr,ak,ao,ik,vc,lk,dk,wc,ck,pk,Nr,hk,fk,uk,Zo,mk,Fc,gk,_k,$c,Tk,yk,kk,ah,bk,vk,Or,n_,en,us,ih,Ir,wk,lh,Fk,s_,je,Ar,$k,dh,xk,Bk,Dr,Ek,xc,Mk,zk,Pk,To,Lr,qk,ch,jk,Ck,Sr,Bc,Nk,ph,Ok,Ik,Ec,Ak,hh,Dk,Lk,ms,Ur,Sk,Wr,Uk,fh,Wk,Hk,Rk,Jt,Hr,Qk,uh,Vk,Kk,Rr,Jk,tn,Gk,mh,Xk,Yk,gh,Zk,eb,tb,Mc,Qr,r_,on,gs,_h,Vr,ob,Th,nb,a_,nt,Kr,sb,Jr,rb,yh,ab,ib,lb,Gr,db,zc,cb,pb,hb,yo,Xr,fb,kh,ub,mb,Yr,Pc,gb,bh,_b,Tb,qc,yb,vh,kb,bb,Gt,Zr,vb,wh,wb,Fb,ea,$b,nn,xb,Fh,Bb,Eb,$h,Mb,zb,i_,sn,_s,xh,ta,Pb,Bh,qb,l_,rn,oa,jb,na,Cb,jc,Nb,Ob,d_,an,sa,Ib,ra,Ab,Cc,Db,Lb,c_,io,aa,Sb,ia,Ub,Nc,Wb,Hb,Rb,Ts,la,Qb,Eh,Vb,p_,ln,ys,Mh,da,Kb,zh,Jb,h_,Ce,ca,Gb,Ph,Xb,Yb,pa,Zb,Oc,ev,tv,ov,ha,nv,fa,sv,rv,av,ua,iv,ma,lv,dv,cv,Re,pv,qh,hv,fv,jh,uv,mv,Ch,gv,_v,Nh,Tv,yv,Oh,kv,bv,Ih,vv,wv,Fv,ht,ga,$v,dn,xv,Ic,Bv,Ev,Ah,Mv,zv,Pv,ks,qv,Dh,jv,Cv,_a,f_,cn,bs,Lh,Ta,Nv,Sh,Ov,u_,st,ya,Iv,pn,Av,Uh,Dv,Lv,Wh,Sv,Uv,Wv,ka,Hv,Ac,Rv,Qv,Vv,ba,Kv,va,Jv,Gv,Xv,ft,wa,Yv,hn,Zv,Dc,e1,t1,Hh,o1,n1,s1,vs,r1,Rh,a1,i1,Fa,m_,fn,ws,Qh,$a,l1,Vh,d1,g_,rt,xa,c1,Ba,p1,Kh,h1,f1,u1,Ea,m1,Lc,g1,_1,T1,Ma,y1,za,k1,b1,v1,ut,Pa,w1,un,F1,Sc,$1,x1,Jh,B1,E1,M1,Fs,z1,Gh,P1,q1,qa,__,mn,$s,Xh,ja,j1,Yh,C1,T_,at,Ca,N1,Na,O1,Zh,I1,A1,D1,Oa,L1,Uc,S1,U1,W1,Ia,H1,Aa,R1,Q1,V1,mt,Da,K1,gn,J1,Wc,G1,X1,ef,Y1,Z1,ew,xs,tw,tf,ow,nw,La,y_,_n,Bs,of,Sa,sw,nf,rw,k_,it,Ua,aw,Wa,iw,sf,lw,dw,cw,Ha,pw,Hc,hw,fw,uw,Ra,mw,Qa,gw,_w,Tw,gt,Va,yw,Tn,kw,Rc,bw,vw,rf,ww,Fw,$w,Es,xw,af,Bw,Ew,Ka,b_,yn,Ms,lf,Ja,Mw,df,zw,v_,lt,Ga,Pw,cf,qw,jw,Xa,Cw,Qc,Nw,Ow,Iw,Ya,Aw,Za,Dw,Lw,Sw,He,ei,Uw,kn,Ww,Vc,Hw,Rw,pf,Qw,Vw,Kw,zs,Jw,hf,Gw,Xw,ti,Yw,ff,Zw,eF,oi,w_,bn,Ps,uf,ni,tF,mf,oF,F_,dt,si,nF,gf,sF,rF,ri,aF,Kc,iF,lF,dF,ai,cF,ii,pF,hF,fF,_t,li,uF,vn,mF,Jc,gF,_F,_f,TF,yF,kF,qs,bF,Tf,vF,wF,di,$_,wn,js,yf,ci,FF,kf,$F,x_,ct,pi,xF,bf,BF,EF,hi,MF,Gc,zF,PF,qF,fi,jF,ui,CF,NF,OF,Tt,mi,IF,Fn,AF,Xc,DF,LF,vf,SF,UF,WF,Cs,HF,wf,RF,QF,gi,B_,$n,Ns,Ff,_i,VF,$f,KF,E_,pt,Ti,JF,xn,GF,xf,XF,YF,Bf,ZF,e$,t$,yi,o$,Yc,n$,s$,r$,ki,a$,bi,i$,l$,d$,yt,vi,c$,Bn,p$,Zc,h$,f$,Ef,u$,m$,g$,Os,_$,Mf,T$,y$,wi,M_,En,Is,zf,Fi,k$,Pf,b$,z_,Qe,$i,v$,qf,w$,F$,xi,$$,ep,x$,B$,E$,Bi,M$,Ei,z$,P$,q$,As,j$,kt,Mi,C$,Mn,N$,tp,O$,I$,jf,A$,D$,L$,Ds,S$,Cf,U$,W$,zi,P_,zn,Ls,Nf,Pi,H$,Of,R$,q_,Ve,qi,Q$,Pn,V$,If,K$,J$,Af,G$,X$,Y$,ji,Z$,op,e2,t2,o2,Ci,n2,Ni,s2,r2,a2,Ss,i2,bt,Oi,l2,qn,d2,np,c2,p2,Df,h2,f2,u2,Us,m2,Lf,g2,_2,Ii,j_,jn,Ws,Sf,Ai,T2,Uf,y2,C_,Cn,Di,k2,et,Li,b2,Ne,v2,Wf,w2,F2,Hf,$2,x2,Rf,B2,E2,Qf,M2,z2,Vf,P2,q2,Kf,j2,C2,Jf,N2,O2,I2,Si,Ui,A2,Gf,D2,L2,S2,Wi,U2,Xf,W2,H2,R2,G,Q2,Yf,V2,K2,Zf,J2,G2,eu,X2,Y2,tu,Z2,e0,ou,t0,o0,nu,n0,s0,su,r0,a0,ru,i0,l0,au,d0,c0,iu,p0,h0,lu,f0,u0,du,m0,g0,cu,_0,T0,pu,y0,k0,hu,b0,v0,fu,w0,F0,uu,$0,x0,mu,B0,E0,gu,M0,z0,_u,P0,q0,j0,Tu,C0,N0,Hi,N_,Nn,Hs,yu,Ri,O0,ku,I0,O_,Ke,Qi,A0,Vi,D0,bu,L0,S0,U0,Ki,W0,sp,H0,R0,Q0,Ji,V0,Gi,K0,J0,G0,Rs,X0,vt,Xi,Y0,On,Z0,rp,ex,tx,vu,ox,nx,sx,Qs,rx,wu,ax,ix,Yi,I_,In,Vs,Fu,Zi,lx,$u,dx,A_,Je,el,cx,tl,px,xu,hx,fx,ux,ol,mx,ap,gx,_x,Tx,nl,yx,sl,kx,bx,vx,Ks,wx,wt,rl,Fx,An,$x,ip,xx,Bx,Bu,Ex,Mx,zx,Js,Px,Eu,qx,jx,al,D_,Dn,Gs,Mu,il,Cx,zu,Nx,L_,Ge,ll,Ox,Pu,Ix,Ax,dl,Dx,lp,Lx,Sx,Ux,cl,Wx,pl,Hx,Rx,Qx,Xs,Vx,Ft,hl,Kx,Ln,Jx,dp,Gx,Xx,qu,Yx,Zx,eB,Ys,tB,ju,oB,nB,fl,S_,Sn,Zs,Cu,ul,sB,Nu,rB,U_,Xe,ml,aB,Ou,iB,lB,gl,dB,cp,cB,pB,hB,_l,fB,Tl,uB,mB,gB,er,_B,$t,yl,TB,Un,yB,pp,kB,bB,Iu,vB,wB,FB,tr,$B,Au,xB,BB,kl,W_,Wn,or,Du,bl,EB,Lu,MB,H_,Ye,vl,zB,Su,PB,qB,wl,jB,hp,CB,NB,OB,Fl,IB,$l,AB,DB,LB,nr,SB,xt,xl,UB,Hn,WB,fp,HB,RB,Uu,QB,VB,KB,sr,JB,Wu,GB,XB,Bl,R_,Rn,rr,Hu,El,YB,Ru,ZB,Q_,Ze,Ml,eE,Qn,tE,Qu,oE,nE,Vu,sE,rE,aE,zl,iE,up,lE,dE,cE,Pl,pE,ql,hE,fE,uE,ar,mE,Bt,jl,gE,Vn,_E,mp,TE,yE,Ku,kE,bE,vE,ir,wE,Ju,FE,$E,Cl,V_,Kn,lr,Gu,Nl,xE,Xu,BE,K_,Oe,Ol,EE,Yu,ME,zE,Il,PE,gp,qE,jE,CE,Al,NE,Dl,OE,IE,AE,Zu,DE,LE,lo,em,Ll,SE,UE,tm,Sl,WE,HE,om,Ul,RE,QE,nm,Wl,VE,KE,Et,Hl,JE,Jn,GE,sm,XE,YE,rm,ZE,eM,tM,dr,oM,am,nM,sM,Rl,J_,Gn,cr,im,Ql,rM,lm,aM,G_,Ie,Vl,iM,Xn,lM,dm,dM,cM,cm,pM,hM,fM,Kl,uM,_p,mM,gM,_M,Jl,TM,Gl,yM,kM,bM,pm,vM,wM,co,hm,Xl,FM,$M,fm,Yl,xM,BM,um,Zl,EM,MM,mm,ed,zM,PM,Mt,td,qM,Yn,jM,gm,CM,NM,_m,OM,IM,AM,pr,DM,Tm,LM,SM,od,X_,Zn,hr,ym,nd,UM,km,WM,Y_,Ae,sd,HM,rd,RM,bm,QM,VM,KM,ad,JM,Tp,GM,XM,YM,id,ZM,ld,e3,t3,o3,vm,n3,s3,po,wm,dd,r3,a3,Fm,cd,i3,l3,$m,pd,d3,c3,xm,hd,p3,h3,zt,fd,f3,es,u3,Bm,m3,g3,Em,_3,T3,y3,fr,k3,Mm,b3,v3,ud,Z_,ts,ur,zm,md,w3,Pm,F3,eT,De,gd,$3,_d,x3,qm,B3,E3,M3,Td,z3,yp,P3,q3,j3,yd,C3,kd,N3,O3,I3,jm,A3,D3,ho,Cm,bd,L3,S3,Nm,vd,U3,W3,Om,wd,H3,R3,Im,Fd,Q3,V3,Pt,$d,K3,os,J3,Am,G3,X3,Dm,Y3,Z3,ez,mr,tz,Lm,oz,nz,xd,tT,ns,gr,Sm,Bd,sz,Um,rz,oT,Le,Ed,az,Wm,iz,lz,Md,dz,kp,cz,pz,hz,zd,fz,Pd,uz,mz,gz,Hm,_z,Tz,fo,Rm,qd,yz,kz,Qm,jd,bz,vz,Vm,Cd,wz,Fz,Km,Nd,$z,xz,qt,Od,Bz,ss,Ez,Jm,Mz,zz,Gm,Pz,qz,jz,_r,Cz,Xm,Nz,Oz,Id,nT,rs,Tr,Ym,Ad,Iz,Zm,Az,sT,Se,Dd,Dz,eg,Lz,Sz,Ld,Uz,bp,Wz,Hz,Rz,Sd,Qz,Ud,Vz,Kz,Jz,tg,Gz,Xz,uo,og,Wd,Yz,Zz,ng,Hd,e5,t5,sg,Rd,o5,n5,rg,Qd,s5,r5,jt,Vd,a5,as,i5,ag,l5,d5,ig,c5,p5,h5,yr,f5,lg,u5,m5,Kd,rT,is,kr,dg,Jd,g5,cg,_5,aT,Ue,Gd,T5,pg,y5,k5,Xd,b5,vp,v5,w5,F5,Yd,$5,Zd,x5,B5,E5,hg,M5,z5,mo,fg,ec,P5,q5,ug,tc,j5,C5,mg,oc,N5,O5,gg,nc,I5,A5,Ct,sc,D5,ls,L5,_g,S5,U5,Tg,W5,H5,R5,br,Q5,yg,V5,K5,rc,iT,ds,vr,kg,ac,J5,bg,G5,lT,We,ic,X5,cs,Y5,vg,Z5,eP,wg,tP,oP,nP,lc,sP,wp,rP,aP,iP,dc,lP,cc,dP,cP,pP,Fg,hP,fP,go,$g,pc,uP,mP,xg,hc,gP,_P,Bg,fc,TP,yP,Eg,uc,kP,bP,Nt,mc,vP,ps,wP,Mg,FP,$P,zg,xP,BP,EP,wr,MP,Pg,zP,PP,gc,dT;return _=new we({}),oe=new we({}),xe=new we({}),Cr=new C({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:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/configuration_bert.py#L54",parametersDescription:[{anchor:"transformers.BertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the BERT model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.TFBertModel">TFBertModel</a>.`,name:"vocab_size"},{anchor:"transformers.BertConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.BertConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.BertConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.BertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.BertConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.BertConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.BertConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.BertConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.BertConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.TFBertModel">TFBertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.BertConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.BertConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.BertConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.BertConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.BertConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"}]}}),Or=new Be({props:{code:`from transformers import BertModel, BertConfig

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

# Initializing a model 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> BertModel, BertConfig

<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 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`}}),Ir=new we({}),Ar=new C({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:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/tokenization_bert.py#L117",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"}]}}),Lr=new C({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/tokenization_bert.py#L248",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"}],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>
`}}),Ur=new C({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/tokenization_bert.py#L273",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"}],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>
`}}),Hr=new C({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/tokenization_bert.py#L301",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"}],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>
`}}),Rr=new Be({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 |`}}),Qr=new C({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/pr_15839/src/transformers/models/bert/tokenization_bert.py#L330"}}),Vr=new we({}),Kr=new C({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:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/tokenization_bert_fast.py#L117",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"}]}}),Xr=new C({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/tokenization_bert_fast.py#L205",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"}],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>
`}}),Zr=new C({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/tokenization_bert_fast.py#L229",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"}],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>
`}}),ea=new Be({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 |`}}),ta=new we({}),oa=new C({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L745",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"}]}}),sa=new C({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L913",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"}]}}),aa=new C({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.lax_numpy.ndarray]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[jax._src.numpy.lax_numpy.ndarray]] = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L58",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"}]}}),la=new C({props:{name:"replace",anchor:"None",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/flax/struct.py#L120"}}),da=new we({}),ca=new C({props:{name:"class transformers.BertModel",anchor:"transformers.BertModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L848",parametersDescription:[{anchor:"transformers.BertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),ga=new C({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L887",parametersDescription:[{anchor:"transformers.BertModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.BertModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BertModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BertModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/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 + 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>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ks=new be({props:{$$slots:{default:[D6]},$$scope:{ctx:j}}}),_a=new Be({props:{code:`from transformers import BertTokenizer, BertModel
import torch

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),Ta=new we({}),ya=new C({props:{name:"class transformers.BertForPreTraining",anchor:"transformers.BertForPreTraining",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1031",parametersDescription:[{anchor:"transformers.BertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),wa=new C({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1047",parametersDescription:[{anchor:"transformers.BertForPreTraining.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertForPreTraining.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertForPreTraining.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.BertForPreTraining.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BertForPreTraining.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertForPreTraining.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertForPreTraining.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertForPreTraining.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BertForPreTraining.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.models.bert.modeling_bert.BertForPreTrainingOutput"
>transformers.models.bert.modeling_bert.BertForPreTrainingOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.</p>
</li>
<li>
<p><strong>prediction_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>seq_relationship_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.models.bert.modeling_bert.BertForPreTrainingOutput"
>transformers.models.bert.modeling_bert.BertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),vs=new be({props:{$$slots:{default:[L6]},$$scope:{ctx:j}}}),Fa=new Be({props:{code:`from transformers import BertTokenizer, BertForPreTraining
import torch

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prediction_logits = outputs.prediction_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>seq_relationship_logits = outputs.seq_relationship_logits`}}),$a=new we({}),xa=new C({props:{name:"class transformers.BertLMHeadModel",anchor:"transformers.BertLMHeadModel",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1135",parametersDescription:[{anchor:"transformers.BertLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Pa=new C({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1158",parametersDescription:[{anchor:"transformers.BertLMHeadModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertLMHeadModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertLMHeadModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.BertLMHeadModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BertLMHeadModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertLMHeadModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertLMHeadModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertLMHeadModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BertLMHeadModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>  encoder_hidden_states  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>):
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 (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
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>.
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
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>
past_key_values (<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>):
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up
decoding.</li>
</ul>`,name:"return_dict"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/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 + 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>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fs=new be({props:{$$slots:{default:[S6]},$$scope:{ctx:j}}}),qa=new Be({props:{code:`from transformers import BertTokenizer, BertLMHeadModel, BertConfig
import torch

tokenizer = BertTokenizer.from_pretrained("bert-base-cased")
config = BertConfig.from_pretrained("bert-base-cased")
config.is_decoder = True
model = BertLMHeadModel.from_pretrained("bert-base-cased", config=config)

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

prediction_logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer, BertLMHeadModel, BertConfig
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config = BertConfig.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config.is_decoder = <span class="hljs-literal">True</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertLMHeadModel.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>, config=config)

<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.logits`}}),ja=new we({}),Ca=new C({props:{name:"class transformers.BertForMaskedLM",anchor:"transformers.BertForMaskedLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1286",parametersDescription:[{anchor:"transformers.BertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Da=new C({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1312",parametersDescription:[{anchor:"transformers.BertForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.BertForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BertForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertForMaskedLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertForMaskedLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BertForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xs=new be({props:{$$slots:{default:[U6]},$$scope:{ctx:j}}}),La=new Be({props:{code:`from transformers import BertTokenizer, BertForMaskedLM
import torch

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is [MASK].&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>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>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),Sa=new we({}),Ua=new C({props:{name:"class transformers.BertForNextSentencePrediction",anchor:"transformers.BertForNextSentencePrediction",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1397",parametersDescription:[{anchor:"transformers.BertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Va=new C({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:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1407",parametersDescription:[{anchor:"transformers.BertForNextSentencePrediction.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertForNextSentencePrediction.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertForNextSentencePrediction.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.BertForNextSentencePrediction.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BertForNextSentencePrediction.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertForNextSentencePrediction.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertForNextSentencePrediction.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertForNextSentencePrediction.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BertForNextSentencePrediction.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Es=new be({props:{$$slots:{default:[W6]},$$scope:{ctx:j}}}),Ka=new Be({props:{code:`from transformers import BertTokenizer, BertForNextSentencePrediction
import torch

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding, labels=torch.LongTensor([<span class="hljs-number">1</span>]))
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> logits[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>] &lt; logits[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>]  <span class="hljs-comment"># next sentence was random</span>`}}),Ja=new we({}),Ga=new C({props:{name:"class transformers.BertForSequenceClassification",anchor:"transformers.BertForSequenceClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1501",parametersDescription:[{anchor:"transformers.BertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),ei=new C({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1517",parametersDescription:[{anchor:"transformers.BertForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.BertForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BertForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BertForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),zs=new be({props:{$$slots:{default:[H6]},$$scope:{ctx:j}}}),ti=new Be({props:{code:`import torch
from transformers import BertTokenizer, BertForSequenceClassification

torch.manual_seed(0)
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
model = BertForSequenceClassification.from_pretrained("bert-base-uncased", num_labels=2)

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
labels = torch.tensor([1]).unsqueeze(0)  # Batch size 1
outputs = model(**inputs, labels=labels)
loss = outputs.loss
logits = outputs.logits
list(logits.shape)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer, BertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>, num_labels=<span class="hljs-number">2</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>labels = torch.tensor([<span class="hljs-number">1</span>]).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
`}}),oi=new Be({props:{code:`import torch
from transformers import BertTokenizer, BertForSequenceClassification

torch.manual_seed(0)
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
model = BertForSequenceClassification.from_pretrained("bert-base-uncased", problem_type="multi_label_classification", num_labels=2)

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
labels = torch.tensor([[1, 1]], dtype=torch.float)  # need dtype=float for BCEWithLogitsLoss
outputs = model(**inputs, labels=labels)
loss = outputs.loss
list(logits.shape)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer, BertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>, num_labels=<span class="hljs-number">2</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>labels = torch.tensor([[<span class="hljs-number">1</span>, <span class="hljs-number">1</span>]], dtype=torch.<span class="hljs-built_in">float</span>)  <span class="hljs-comment"># need dtype=float for BCEWithLogitsLoss</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
`}}),ni=new we({}),si=new C({props:{name:"class transformers.BertForMultipleChoice",anchor:"transformers.BertForMultipleChoice",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1603",parametersDescription:[{anchor:"transformers.BertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),li=new C({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1617",parametersDescription:[{anchor:"transformers.BertForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.BertForMultipleChoice.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BertForMultipleChoice.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertForMultipleChoice.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertForMultipleChoice.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BertForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qs=new be({props:{$$slots:{default:[R6]},$$scope:{ctx:j}}}),di=new Be({props:{code:`from transformers import BertTokenizer, BertForMultipleChoice
import torch

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the linear classifier still needs to be trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),ci=new we({}),pi=new C({props:{name:"class transformers.BertForTokenClassification",anchor:"transformers.BertForTokenClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1698",parametersDescription:[{anchor:"transformers.BertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),mi=new C({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1716",parametersDescription:[{anchor:"transformers.BertForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.BertForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BertForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertForTokenClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertForTokenClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BertForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Cs=new be({props:{$$slots:{default:[Q6]},$$scope:{ctx:j}}}),gi=new Be({props:{code:`from transformers import BertTokenizer, BertForTokenClassification
import torch

tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
model = BertForTokenClassification.from_pretrained("bert-base-uncased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
labels = torch.tensor([1] * inputs["input_ids"].size(1)).unsqueeze(0)  # Batch size 1

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForTokenClassification.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>labels = torch.tensor([<span class="hljs-number">1</span>] * inputs[<span class="hljs-string">&quot;input_ids&quot;</span>].size(<span class="hljs-number">1</span>)).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),_i=new we({}),Ti=new C({props:{name:"class transformers.BertForQuestionAnswering",anchor:"transformers.BertForQuestionAnswering",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1783",parametersDescription:[{anchor:"transformers.BertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),vi=new C({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_bert.py#L1797",parametersDescription:[{anchor:"transformers.BertForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BertForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.BertForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BertForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BertForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Os=new be({props:{$$slots:{default:[V6]},$$scope:{ctx:j}}}),wi=new Be({props:{code:`from transformers import BertTokenizer, BertForQuestionAnswering
import torch

torch.manual_seed(0)
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
model = BertForQuestionAnswering.from_pretrained("bert-base-uncased")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
inputs = tokenizer(question, text, return_tensors="pt")
start_positions = torch.tensor([1])
end_positions = torch.tensor([3])

outputs = model(**inputs, start_positions=start_positions, end_positions=end_positions)
loss = outputs.loss
round(loss.item(), 2)


start_scores = outputs.start_logits
list(start_scores.shape)


end_scores = outputs.end_logits
list(end_scores.shape)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer, BertForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForQuestionAnswering.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;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>start_positions = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>end_positions = torch.tensor([<span class="hljs-number">3</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=start_positions, end_positions=end_positions)
<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-meta">&gt;&gt;&gt; </span>start_scores = outputs.start_logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(start_scores.shape)


<span class="hljs-meta">&gt;&gt;&gt; </span>end_scores = outputs.end_logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(end_scores.shape)
`}}),Fi=new we({}),$i=new C({props:{name:"class transformers.TFBertModel",anchor:"transformers.TFBertModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1040",parametersDescription:[{anchor:"transformers.TFBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),As=new be({props:{$$slots:{default:[K6]},$$scope:{ctx:j}}}),Mi=new C({props:{name:"call",anchor:"transformers.TFBertModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_hidden_states",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1046",parametersDescription:[{anchor:"transformers.TFBertModel.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertModel.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertModel.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertModel.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you\u2019re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Ds=new be({props:{$$slots:{default:[J6]},$$scope:{ctx:j}}}),zi=new Be({props:{code:`from transformers import BertTokenizer, TFBertModel
import tensorflow as tf

tokenizer = BertTokenizer.from_pretrained("bert-base-cased")
model = TFBertModel.from_pretrained("bert-base-cased")

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertModel.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&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`}}),Pi=new we({}),qi=new C({props:{name:"class transformers.TFBertForPreTraining",anchor:"transformers.TFBertForPreTraining",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1138",parametersDescription:[{anchor:"transformers.TFBertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Ss=new be({props:{$$slots:{default:[G6]},$$scope:{ctx:j}}}),Oi=new C({props:{name:"call",anchor:"transformers.TFBertForPreTraining.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"next_sentence_label",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1160",parametersDescription:[{anchor:"transformers.TFBertForPreTraining.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForPreTraining.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForPreTraining.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertForPreTraining.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForPreTraining.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForPreTraining.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForPreTraining.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForPreTraining.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForPreTraining.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput"
>transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>prediction_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>seq_relationship_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/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>
`}}),Us=new be({props:{$$slots:{default:[X6]},$$scope:{ctx:j}}}),Ii=new Be({props:{code:`import tensorflow as tf
from transformers import BertTokenizer, TFBertForPreTraining

tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
model = TFBertForPreTraining.from_pretrained("bert-base-uncased")
input_ids = tf.constant(tokenizer.encode("Hello, my dog is cute", add_special_tokens=True))[
    None, :
]  # Batch size 1
outputs = model(input_ids)
prediction_scores, seq_relationship_scores = outputs[:2]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer, TFBertForPreTraining

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForPreTraining.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tf.constant(tokenizer.encode(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, add_special_tokens=<span class="hljs-literal">True</span>))[
<span class="hljs-meta">... </span>    <span class="hljs-literal">None</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_scores, seq_relationship_scores = outputs[:<span class="hljs-number">2</span>]`}}),Ai=new we({}),Di=new C({props:{name:"class transformers.TFBertLMHeadModel",anchor:"transformers.TFBertLMHeadModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1347"}}),Li=new C({props:{name:"call",anchor:"transformers.TFBertLMHeadModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_hidden_states",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1384",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Hi=new Be({props:{code:`from transformers import BertTokenizer, TFBertLMHeadModel
import tensorflow as tf

tokenizer = BertTokenizer.from_pretrained("bert-base-cased")
model = TFBertLMHeadModel.from_pretrained("bert-base-cased")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertLMHeadModel.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&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`}}),Ri=new we({}),Qi=new C({props:{name:"class transformers.TFBertForMaskedLM",anchor:"transformers.TFBertForMaskedLM",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1256",parametersDescription:[{anchor:"transformers.TFBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Rs=new be({props:{$$slots:{default:[Y6]},$$scope:{ctx:j}}}),Xi=new C({props:{name:"call",anchor:"transformers.TFBertForMaskedLM.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1284",parametersDescription:[{anchor:"transformers.TFBertForMaskedLM.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForMaskedLM.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForMaskedLM.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertForMaskedLM.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForMaskedLM.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForMaskedLM.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForMaskedLM.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForMaskedLM.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForMaskedLM.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Qs=new be({props:{$$slots:{default:[Z6]},$$scope:{ctx:j}}}),Yi=new Be({props:{code:`from transformers import BertTokenizer, TFBertForMaskedLM
import tensorflow as tf

tokenizer = BertTokenizer.from_pretrained("bert-base-cased")
model = TFBertForMaskedLM.from_pretrained("bert-base-cased")

inputs = tokenizer("The capital of France is [MASK].", return_tensors="tf")
inputs["labels"] = tokenizer("The capital of France is Paris.", return_tensors="tf")["input_ids"]

outputs = model(inputs)
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer, TFBertForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&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>inputs[<span class="hljs-string">&quot;labels&quot;</span>] = 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>outputs = model(inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),Zi=new we({}),el=new C({props:{name:"class transformers.TFBertForNextSentencePrediction",anchor:"transformers.TFBertForNextSentencePrediction",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1497",parametersDescription:[{anchor:"transformers.TFBertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Ks=new be({props:{$$slots:{default:[eN]},$$scope:{ctx:j}}}),rl=new C({props:{name:"call",anchor:"transformers.TFBertForNextSentencePrediction.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"next_sentence_label",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1507",parametersDescription:[{anchor:"transformers.TFBertForNextSentencePrediction.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForNextSentencePrediction.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForNextSentencePrediction.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertForNextSentencePrediction.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForNextSentencePrediction.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForNextSentencePrediction.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForNextSentencePrediction.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForNextSentencePrediction.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForNextSentencePrediction.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFNextSentencePredictorOutput"
>transformers.modeling_tf_outputs.TFNextSentencePredictorOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>next_sentence_label</code> is provided) \u2014 Next sentence prediction loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFNextSentencePredictorOutput"
>transformers.modeling_tf_outputs.TFNextSentencePredictorOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Js=new be({props:{$$slots:{default:[tN]},$$scope:{ctx:j}}}),al=new Be({props:{code:`import tensorflow as tf
from transformers import BertTokenizer, TFBertForNextSentencePrediction

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(encoding[<span class="hljs-string">&quot;input_ids&quot;</span>], token_type_ids=encoding[<span class="hljs-string">&quot;token_type_ids&quot;</span>])[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> logits[<span class="hljs-number">0</span>][<span class="hljs-number">0</span>] &lt; logits[<span class="hljs-number">0</span>][<span class="hljs-number">1</span>]  <span class="hljs-comment"># the next sentence was random</span>`}}),il=new we({}),ll=new C({props:{name:"class transformers.TFBertForSequenceClassification",anchor:"transformers.TFBertForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1589",parametersDescription:[{anchor:"transformers.TFBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Xs=new be({props:{$$slots:{default:[oN]},$$scope:{ctx:j}}}),hl=new C({props:{name:"call",anchor:"transformers.TFBertForSequenceClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1610",parametersDescription:[{anchor:"transformers.TFBertForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForSequenceClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForSequenceClassification.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertForSequenceClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForSequenceClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForSequenceClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForSequenceClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForSequenceClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForSequenceClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Ys=new be({props:{$$slots:{default:[nN]},$$scope:{ctx:j}}}),fl=new Be({props:{code:`from transformers import BertTokenizer, TFBertForSequenceClassification
import tensorflow as tf

tokenizer = BertTokenizer.from_pretrained("bert-base-cased")
model = TFBertForSequenceClassification.from_pretrained("bert-base-cased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
inputs["labels"] = tf.reshape(tf.constant(1), (-1, 1))  # Batch size 1

outputs = model(inputs)
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer, TFBertForSequenceClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&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>inputs[<span class="hljs-string">&quot;labels&quot;</span>] = tf.reshape(tf.constant(<span class="hljs-number">1</span>), (-<span class="hljs-number">1</span>, <span class="hljs-number">1</span>))  <span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),ul=new we({}),ml=new C({props:{name:"class transformers.TFBertForMultipleChoice",anchor:"transformers.TFBertForMultipleChoice",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1681",parametersDescription:[{anchor:"transformers.TFBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),er=new be({props:{$$slots:{default:[sN]},$$scope:{ctx:j}}}),yl=new C({props:{name:"call",anchor:"transformers.TFBertForMultipleChoice.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1705",parametersDescription:[{anchor:"transformers.TFBertForMultipleChoice.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForMultipleChoice.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForMultipleChoice.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertForMultipleChoice.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForMultipleChoice.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForMultipleChoice.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForMultipleChoice.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForMultipleChoice.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForMultipleChoice.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <em>(batch_size, )</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),tr=new be({props:{$$slots:{default:[rN]},$$scope:{ctx:j}}}),kl=new Be({props:{code:`from transformers import BertTokenizer, TFBertForMultipleChoice
import tensorflow as tf

tokenizer = BertTokenizer.from_pretrained("bert-base-cased")
model = TFBertForMultipleChoice.from_pretrained("bert-base-cased")

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&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`}}),bl=new we({}),vl=new C({props:{name:"class transformers.TFBertForTokenClassification",anchor:"transformers.TFBertForTokenClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1812",parametersDescription:[{anchor:"transformers.TFBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),nr=new be({props:{$$slots:{default:[aN]},$$scope:{ctx:j}}}),xl=new C({props:{name:"call",anchor:"transformers.TFBertForTokenClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1839",parametersDescription:[{anchor:"transformers.TFBertForTokenClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForTokenClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForTokenClassification.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertForTokenClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForTokenClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForTokenClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForTokenClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForTokenClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForTokenClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of unmasked labels, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),sr=new be({props:{$$slots:{default:[iN]},$$scope:{ctx:j}}}),Bl=new Be({props:{code:`from transformers import BertTokenizer, TFBertForTokenClassification
import tensorflow as tf

tokenizer = BertTokenizer.from_pretrained("bert-base-cased")
model = TFBertForTokenClassification.from_pretrained("bert-base-cased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
input_ids = inputs["input_ids"]
inputs["labels"] = tf.reshape(
    tf.constant([1] * tf.size(input_ids).numpy()), (-1, tf.size(input_ids))
)  # Batch size 1

outputs = model(inputs)
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer, TFBertForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&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>input_ids = inputs[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs[<span class="hljs-string">&quot;labels&quot;</span>] = tf.reshape(
<span class="hljs-meta">... </span>    tf.constant([<span class="hljs-number">1</span>] * tf.size(input_ids).numpy()), (-<span class="hljs-number">1</span>, tf.size(input_ids))
<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(inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),El=new we({}),Ml=new C({props:{name:"class transformers.TFBertForQuestionAnswering",anchor:"transformers.TFBertForQuestionAnswering",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1908",parametersDescription:[{anchor:"transformers.TFBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),ar=new be({props:{$$slots:{default:[lN]},$$scope:{ctx:j}}}),jl=new C({props:{name:"call",anchor:"transformers.TFBertForQuestionAnswering.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"start_positions",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"end_positions",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_tf_bert.py#L1930",parametersDescription:[{anchor:"transformers.TFBertForQuestionAnswering.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForQuestionAnswering.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForQuestionAnswering.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFBertForQuestionAnswering.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForQuestionAnswering.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForQuestionAnswering.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForQuestionAnswering.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForQuestionAnswering.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForQuestionAnswering.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>start_positions</code> and <code>end_positions</code> are provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ir=new be({props:{$$slots:{default:[dN]},$$scope:{ctx:j}}}),Cl=new Be({props:{code:`from transformers import BertTokenizer, TFBertForQuestionAnswering
import tensorflow as tf

tokenizer = BertTokenizer.from_pretrained("bert-base-cased")
model = TFBertForQuestionAnswering.from_pretrained("bert-base-cased")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
input_dict = tokenizer(question, text, return_tensors="tf")
outputs = model(input_dict)
start_logits = outputs.start_logits
end_logits = outputs.end_logits

all_tokens = tokenizer.convert_ids_to_tokens(input_dict["input_ids"].numpy()[0])
answer = " ".join(all_tokens[tf.math.argmax(start_logits, 1)[0] : tf.math.argmax(end_logits, 1)[0] + 1])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer, TFBertForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&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>input_dict = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_dict)
<span class="hljs-meta">&gt;&gt;&gt; </span>start_logits = outputs.start_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>end_logits = outputs.end_logits

<span class="hljs-meta">&gt;&gt;&gt; </span>all_tokens = tokenizer.convert_ids_to_tokens(input_dict[<span class="hljs-string">&quot;input_ids&quot;</span>].numpy()[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>answer = <span class="hljs-string">&quot; &quot;</span>.join(all_tokens[tf.math.argmax(start_logits, <span class="hljs-number">1</span>)[<span class="hljs-number">0</span>] : tf.math.argmax(end_logits, <span class="hljs-number">1</span>)[<span class="hljs-number">0</span>] + <span class="hljs-number">1</span>])`}}),Nl=new we({}),Ol=new C({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._src.numpy.lax_numpy.float32'>"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L757",parametersDescription:[{anchor:"transformers.FlaxBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}]}}),Hl=new C({props:{name:"__call__",anchor:"transformers.FlaxBertPreTrainedModel.__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:"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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L640",parametersDescription:[{anchor:"transformers.FlaxBertPreTrainedModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),dr=new be({props:{$$slots:{default:[cN]},$$scope:{ctx:j}}}),Rl=new Be({props:{code:`from transformers import BertTokenizer, FlaxBertModel

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),Ql=new we({}),Vl=new C({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._src.numpy.lax_numpy.float32'>"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L830",parametersDescription:[{anchor:"transformers.FlaxBertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForPreTraining.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForPreTraining.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}]}}),td=new C({props:{name:"__call__",anchor:"transformers.FlaxBertPreTrainedModel.__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:"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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L640",parametersDescription:[{anchor:"transformers.FlaxBertPreTrainedModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput"
>transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>prediction_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>seq_relationship_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/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>
`}}),pr=new be({props:{$$slots:{default:[pN]},$$scope:{ctx:j}}}),od=new Be({props:{code:`from transformers import BertTokenizer, FlaxBertForPreTraining

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prediction_logits = outputs.prediction_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>seq_relationship_logits = outputs.seq_relationship_logits`}}),nd=new we({}),sd=new C({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._src.numpy.lax_numpy.float32'>"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L915",parametersDescription:[{anchor:"transformers.FlaxBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForMaskedLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForMaskedLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}]}}),fd=new C({props:{name:"__call__",anchor:"transformers.FlaxBertPreTrainedModel.__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:"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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L640",parametersDescription:[{anchor:"transformers.FlaxBertPreTrainedModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),fr=new be({props:{$$slots:{default:[hN]},$$scope:{ctx:j}}}),ud=new Be({props:{code:`from transformers import BertTokenizer, FlaxBertForMaskedLM

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),md=new we({}),gd=new C({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._src.numpy.lax_numpy.float32'>"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L976",parametersDescription:[{anchor:"transformers.FlaxBertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForNextSentencePrediction.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForNextSentencePrediction.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}]}}),$d=new C({props:{name:"__call__",anchor:"transformers.FlaxBertPreTrainedModel.__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:"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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L640",parametersDescription:[{anchor:"transformers.FlaxBertPreTrainedModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput"
>transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput"
>transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),mr=new be({props:{$$slots:{default:[fN]},$$scope:{ctx:j}}}),xd=new Be({props:{code:`from transformers import BertTokenizer, FlaxBertForNextSentencePrediction

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> logits[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>] &lt; logits[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>]  <span class="hljs-comment"># next sentence was random</span>`}}),Bd=new we({}),Ed=new C({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._src.numpy.lax_numpy.float32'>"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L1074",parametersDescription:[{anchor:"transformers.FlaxBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForSequenceClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForSequenceClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}]}}),Od=new C({props:{name:"__call__",anchor:"transformers.FlaxBertPreTrainedModel.__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:"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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L640",parametersDescription:[{anchor:"transformers.FlaxBertPreTrainedModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_r=new be({props:{$$slots:{default:[uN]},$$scope:{ctx:j}}}),Id=new Be({props:{code:`from transformers import BertTokenizer, FlaxBertForSequenceClassification

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),Ad=new we({}),Dd=new C({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._src.numpy.lax_numpy.float32'>"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L1150",parametersDescription:[{anchor:"transformers.FlaxBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForMultipleChoice.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForMultipleChoice.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}]}}),Vd=new C({props:{name:"__call__",anchor:"transformers.FlaxBertPreTrainedModel.__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:"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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L640",parametersDescription:[{anchor:"transformers.FlaxBertPreTrainedModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput"
>transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput"
>transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),yr=new be({props:{$$slots:{default:[mN]},$$scope:{ctx:j}}}),Kd=new Be({props:{code:`from transformers import BertTokenizer, FlaxBertForMultipleChoice

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),Jd=new we({}),Gd=new C({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._src.numpy.lax_numpy.float32'>"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L1222",parametersDescription:[{anchor:"transformers.FlaxBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForTokenClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForTokenClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}]}}),sc=new C({props:{name:"__call__",anchor:"transformers.FlaxBertPreTrainedModel.__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:"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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L640",parametersDescription:[{anchor:"transformers.FlaxBertPreTrainedModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_flax_outputs.FlaxTokenClassifierOutput"
>transformers.modeling_flax_outputs.FlaxTokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_flax_outputs.FlaxTokenClassifierOutput"
>transformers.modeling_flax_outputs.FlaxTokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),br=new be({props:{$$slots:{default:[gN]},$$scope:{ctx:j}}}),rc=new Be({props:{code:`from transformers import BertTokenizer, FlaxBertForTokenClassification

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),ac=new we({}),ic=new C({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._src.numpy.lax_numpy.float32'>"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L1289",parametersDescription:[{anchor:"transformers.FlaxBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig">BertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForQuestionAnswering.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForQuestionAnswering.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}]}}),mc=new C({props:{name:"__call__",anchor:"transformers.FlaxBertPreTrainedModel.__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:"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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/modeling_flax_bert.py#L640",parametersDescription:[{anchor:"transformers.FlaxBertPreTrainedModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__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.FlaxBertPreTrainedModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>start_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),wr=new be({props:{$$slots:{default:[_N]},$$scope:{ctx:j}}}),gc=new Be({props:{code:`from transformers import BertTokenizer, FlaxBertForQuestionAnswering

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>start_scores = outputs.start_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>end_scores = outputs.end_logits`}}),{c(){p=s("meta"),x=l(),g=s("h1"),T=s("a"),$=s("span"),y(_.$$.fragment),m=l(),B=s("span"),me=o("BERT"),X=l(),M=s("h2"),ee=s("a"),D=s("span"),y(oe.$$.fragment),ge=l(),L=s("span"),_e=o("Overview"),ce=l(),J=s("p"),O=o("The BERT model was proposed in "),ne=s("a"),Y=o("BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding"),z=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.`),q=l(),se=s("p"),H=o("The abstract from the paper is the following:"),pe=l(),re=s("p"),S=s("em"),Te=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.`),he=l(),P=s("p"),ie=s("em"),R=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).`),fe=l(),ae=s("p"),Q=o("Tips:"),ue=l(),te=s("ul"),N=s("li"),ye=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.`),V=l(),le=s("li"),h=o(`BERT was trained with the masked language modeling (MLM) and next sentence prediction (NSP) objectives. It is
efficient at predicting masked tokens and at NLU in general, but is not optimal for text generation.`),E=l(),K=s("p"),Ee=o("This model was contributed by "),Fe=s("a"),I=o("thomwolf"),Me=o(". The original code can be found "),$e=s("a"),ze=o("here"),A=o("."),W=l(),ke=s("h2"),ve=s("a"),U=s("span"),y(xe.$$.fragment),Pe=l(),de=s("span"),qe=o("BertConfig"),o_=l(),ot=s("div"),y(Cr.$$.fragment),ak=l(),ao=s("p"),ik=o("This is the configuration class to store the configuration of a "),vc=s("a"),lk=o("BertModel"),dk=o(" or a "),wc=s("a"),ck=o("TFBertModel"),pk=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
`),Nr=s("a"),hk=o("bert-base-uncased"),fk=o(" architecture."),uk=l(),Zo=s("p"),mk=o("Configuration objects inherit from "),Fc=s("a"),gk=o("PretrainedConfig"),_k=o(` and can be used to control the model outputs. Read the
documentation from `),$c=s("a"),Tk=o("PretrainedConfig"),yk=o(" for more information."),kk=l(),ah=s("p"),bk=o("Examples:"),vk=l(),y(Or.$$.fragment),n_=l(),en=s("h2"),us=s("a"),ih=s("span"),y(Ir.$$.fragment),wk=l(),lh=s("span"),Fk=o("BertTokenizer"),s_=l(),je=s("div"),y(Ar.$$.fragment),$k=l(),dh=s("p"),xk=o("Construct a BERT tokenizer. Based on WordPiece."),Bk=l(),Dr=s("p"),Ek=o("This tokenizer inherits from "),xc=s("a"),Mk=o("PreTrainedTokenizer"),zk=o(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Pk=l(),To=s("div"),y(Lr.$$.fragment),qk=l(),ch=s("p"),jk=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:`),Ck=l(),Sr=s("ul"),Bc=s("li"),Nk=o("single sequence: "),ph=s("code"),Ok=o("[CLS] X [SEP]"),Ik=l(),Ec=s("li"),Ak=o("pair of sequences: "),hh=s("code"),Dk=o("[CLS] A [SEP] B [SEP]"),Lk=l(),ms=s("div"),y(Ur.$$.fragment),Sk=l(),Wr=s("p"),Uk=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 `),fh=s("code"),Wk=o("prepare_for_model"),Hk=o(" method."),Rk=l(),Jt=s("div"),y(Hr.$$.fragment),Qk=l(),uh=s("p"),Vk=o(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence
pair mask has the following format:`),Kk=l(),y(Rr.$$.fragment),Jk=l(),tn=s("p"),Gk=o("If "),mh=s("code"),Xk=o("token_ids_1"),Yk=o(" is "),gh=s("code"),Zk=o("None"),eb=o(", this method only returns the first portion of the mask (0s)."),tb=l(),Mc=s("div"),y(Qr.$$.fragment),r_=l(),on=s("h2"),gs=s("a"),_h=s("span"),y(Vr.$$.fragment),ob=l(),Th=s("span"),nb=o("BertTokenizerFast"),a_=l(),nt=s("div"),y(Kr.$$.fragment),sb=l(),Jr=s("p"),rb=o("Construct a \u201Cfast\u201D BERT tokenizer (backed by HuggingFace\u2019s "),yh=s("em"),ab=o("tokenizers"),ib=o(" library). Based on WordPiece."),lb=l(),Gr=s("p"),db=o("This tokenizer inherits from "),zc=s("a"),cb=o("PreTrainedTokenizerFast"),pb=o(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),hb=l(),yo=s("div"),y(Xr.$$.fragment),fb=l(),kh=s("p"),ub=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:`),mb=l(),Yr=s("ul"),Pc=s("li"),gb=o("single sequence: "),bh=s("code"),_b=o("[CLS] X [SEP]"),Tb=l(),qc=s("li"),yb=o("pair of sequences: "),vh=s("code"),kb=o("[CLS] A [SEP] B [SEP]"),bb=l(),Gt=s("div"),y(Zr.$$.fragment),vb=l(),wh=s("p"),wb=o(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence
pair mask has the following format:`),Fb=l(),y(ea.$$.fragment),$b=l(),nn=s("p"),xb=o("If "),Fh=s("code"),Bb=o("token_ids_1"),Eb=o(" is "),$h=s("code"),Mb=o("None"),zb=o(", this method only returns the first portion of the mask (0s)."),i_=l(),sn=s("h2"),_s=s("a"),xh=s("span"),y(ta.$$.fragment),Pb=l(),Bh=s("span"),qb=o("Bert specific outputs"),l_=l(),rn=s("div"),y(oa.$$.fragment),jb=l(),na=s("p"),Cb=o("Output type of "),jc=s("a"),Nb=o("BertForPreTraining"),Ob=o("."),d_=l(),an=s("div"),y(sa.$$.fragment),Ib=l(),ra=s("p"),Ab=o("Output type of "),Cc=s("a"),Db=o("TFBertForPreTraining"),Lb=o("."),c_=l(),io=s("div"),y(aa.$$.fragment),Sb=l(),ia=s("p"),Ub=o("Output type of "),Nc=s("a"),Wb=o("BertForPreTraining"),Hb=o("."),Rb=l(),Ts=s("div"),y(la.$$.fragment),Qb=l(),Eh=s("p"),Vb=o("\u201CReturns a new object replacing the specified fields with new values."),p_=l(),ln=s("h2"),ys=s("a"),Mh=s("span"),y(da.$$.fragment),Kb=l(),zh=s("span"),Jb=o("BertModel"),h_=l(),Ce=s("div"),y(ca.$$.fragment),Gb=l(),Ph=s("p"),Xb=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),Yb=l(),pa=s("p"),Zb=o("This model inherits from "),Oc=s("a"),ev=o("PreTrainedModel"),tv=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.)`),ov=l(),ha=s("p"),nv=o("This model is also a PyTorch "),fa=s("a"),sv=o("torch.nn.Module"),rv=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),av=l(),ua=s("p"),iv=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 `),ma=s("a"),lv=o(`Attention is
all you need`),dv=o(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),cv=l(),Re=s("p"),pv=o("To behave as an decoder the model needs to be initialized with the "),qh=s("code"),hv=o("is_decoder"),fv=o(` argument of the configuration set
to `),jh=s("code"),uv=o("True"),mv=o(". To be used in a Seq2Seq model, the model needs to initialized with both "),Ch=s("code"),gv=o("is_decoder"),_v=o(` argument and
`),Nh=s("code"),Tv=o("add_cross_attention"),yv=o(" set to "),Oh=s("code"),kv=o("True"),bv=o("; an "),Ih=s("code"),vv=o("encoder_hidden_states"),wv=o(" is then expected as an input to the forward pass."),Fv=l(),ht=s("div"),y(ga.$$.fragment),$v=l(),dn=s("p"),xv=o("The "),Ic=s("a"),Bv=o("BertModel"),Ev=o(" forward method, overrides the "),Ah=s("code"),Mv=o("__call__"),zv=o(" special method."),Pv=l(),y(ks.$$.fragment),qv=l(),Dh=s("p"),jv=o("Example:"),Cv=l(),y(_a.$$.fragment),f_=l(),cn=s("h2"),bs=s("a"),Lh=s("span"),y(Ta.$$.fragment),Nv=l(),Sh=s("span"),Ov=o("BertForPreTraining"),u_=l(),st=s("div"),y(ya.$$.fragment),Iv=l(),pn=s("p"),Av=o("Bert Model with two heads on top as done during the pretraining: a "),Uh=s("code"),Dv=o("masked language modeling"),Lv=o(" head and a "),Wh=s("code"),Sv=o("next sentence prediction (classification)"),Uv=o(" head."),Wv=l(),ka=s("p"),Hv=o("This model inherits from "),Ac=s("a"),Rv=o("PreTrainedModel"),Qv=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.)`),Vv=l(),ba=s("p"),Kv=o("This model is also a PyTorch "),va=s("a"),Jv=o("torch.nn.Module"),Gv=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Xv=l(),ft=s("div"),y(wa.$$.fragment),Yv=l(),hn=s("p"),Zv=o("The "),Dc=s("a"),e1=o("BertForPreTraining"),t1=o(" forward method, overrides the "),Hh=s("code"),o1=o("__call__"),n1=o(" special method."),s1=l(),y(vs.$$.fragment),r1=l(),Rh=s("p"),a1=o("Example:"),i1=l(),y(Fa.$$.fragment),m_=l(),fn=s("h2"),ws=s("a"),Qh=s("span"),y($a.$$.fragment),l1=l(),Vh=s("span"),d1=o("BertLMHeadModel"),g_=l(),rt=s("div"),y(xa.$$.fragment),c1=l(),Ba=s("p"),p1=o("Bert Model with a "),Kh=s("code"),h1=o("language modeling"),f1=o(" head on top for CLM fine-tuning."),u1=l(),Ea=s("p"),m1=o("This model inherits from "),Lc=s("a"),g1=o("PreTrainedModel"),_1=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.)`),T1=l(),Ma=s("p"),y1=o("This model is also a PyTorch "),za=s("a"),k1=o("torch.nn.Module"),b1=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),v1=l(),ut=s("div"),y(Pa.$$.fragment),w1=l(),un=s("p"),F1=o("The "),Sc=s("a"),$1=o("BertLMHeadModel"),x1=o(" forward method, overrides the "),Jh=s("code"),B1=o("__call__"),E1=o(" special method."),M1=l(),y(Fs.$$.fragment),z1=l(),Gh=s("p"),P1=o("Example:"),q1=l(),y(qa.$$.fragment),__=l(),mn=s("h2"),$s=s("a"),Xh=s("span"),y(ja.$$.fragment),j1=l(),Yh=s("span"),C1=o("BertForMaskedLM"),T_=l(),at=s("div"),y(Ca.$$.fragment),N1=l(),Na=s("p"),O1=o("Bert Model with a "),Zh=s("code"),I1=o("language modeling"),A1=o(" head on top."),D1=l(),Oa=s("p"),L1=o("This model inherits from "),Uc=s("a"),S1=o("PreTrainedModel"),U1=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.)`),W1=l(),Ia=s("p"),H1=o("This model is also a PyTorch "),Aa=s("a"),R1=o("torch.nn.Module"),Q1=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),V1=l(),mt=s("div"),y(Da.$$.fragment),K1=l(),gn=s("p"),J1=o("The "),Wc=s("a"),G1=o("BertForMaskedLM"),X1=o(" forward method, overrides the "),ef=s("code"),Y1=o("__call__"),Z1=o(" special method."),ew=l(),y(xs.$$.fragment),tw=l(),tf=s("p"),ow=o("Example:"),nw=l(),y(La.$$.fragment),y_=l(),_n=s("h2"),Bs=s("a"),of=s("span"),y(Sa.$$.fragment),sw=l(),nf=s("span"),rw=o("BertForNextSentencePrediction"),k_=l(),it=s("div"),y(Ua.$$.fragment),aw=l(),Wa=s("p"),iw=o("Bert Model with a "),sf=s("code"),lw=o("next sentence prediction (classification)"),dw=o(" head on top."),cw=l(),Ha=s("p"),pw=o("This model inherits from "),Hc=s("a"),hw=o("PreTrainedModel"),fw=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),uw=l(),Ra=s("p"),mw=o("This model is also a PyTorch "),Qa=s("a"),gw=o("torch.nn.Module"),_w=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Tw=l(),gt=s("div"),y(Va.$$.fragment),yw=l(),Tn=s("p"),kw=o("The "),Rc=s("a"),bw=o("BertForNextSentencePrediction"),vw=o(" forward method, overrides the "),rf=s("code"),ww=o("__call__"),Fw=o(" special method."),$w=l(),y(Es.$$.fragment),xw=l(),af=s("p"),Bw=o("Example:"),Ew=l(),y(Ka.$$.fragment),b_=l(),yn=s("h2"),Ms=s("a"),lf=s("span"),y(Ja.$$.fragment),Mw=l(),df=s("span"),zw=o("BertForSequenceClassification"),v_=l(),lt=s("div"),y(Ga.$$.fragment),Pw=l(),cf=s("p"),qw=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.`),jw=l(),Xa=s("p"),Cw=o("This model inherits from "),Qc=s("a"),Nw=o("PreTrainedModel"),Ow=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.)`),Iw=l(),Ya=s("p"),Aw=o("This model is also a PyTorch "),Za=s("a"),Dw=o("torch.nn.Module"),Lw=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sw=l(),He=s("div"),y(ei.$$.fragment),Uw=l(),kn=s("p"),Ww=o("The "),Vc=s("a"),Hw=o("BertForSequenceClassification"),Rw=o(" forward method, overrides the "),pf=s("code"),Qw=o("__call__"),Vw=o(" special method."),Kw=l(),y(zs.$$.fragment),Jw=l(),hf=s("p"),Gw=o("Example of single-label classification:"),Xw=l(),y(ti.$$.fragment),Yw=l(),ff=s("p"),Zw=o("Example of multi-label classification:"),eF=l(),y(oi.$$.fragment),w_=l(),bn=s("h2"),Ps=s("a"),uf=s("span"),y(ni.$$.fragment),tF=l(),mf=s("span"),oF=o("BertForMultipleChoice"),F_=l(),dt=s("div"),y(si.$$.fragment),nF=l(),gf=s("p"),sF=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.`),rF=l(),ri=s("p"),aF=o("This model inherits from "),Kc=s("a"),iF=o("PreTrainedModel"),lF=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.)`),dF=l(),ai=s("p"),cF=o("This model is also a PyTorch "),ii=s("a"),pF=o("torch.nn.Module"),hF=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),fF=l(),_t=s("div"),y(li.$$.fragment),uF=l(),vn=s("p"),mF=o("The "),Jc=s("a"),gF=o("BertForMultipleChoice"),_F=o(" forward method, overrides the "),_f=s("code"),TF=o("__call__"),yF=o(" special method."),kF=l(),y(qs.$$.fragment),bF=l(),Tf=s("p"),vF=o("Example:"),wF=l(),y(di.$$.fragment),$_=l(),wn=s("h2"),js=s("a"),yf=s("span"),y(ci.$$.fragment),FF=l(),kf=s("span"),$F=o("BertForTokenClassification"),x_=l(),ct=s("div"),y(pi.$$.fragment),xF=l(),bf=s("p"),BF=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.`),EF=l(),hi=s("p"),MF=o("This model inherits from "),Gc=s("a"),zF=o("PreTrainedModel"),PF=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.)`),qF=l(),fi=s("p"),jF=o("This model is also a PyTorch "),ui=s("a"),CF=o("torch.nn.Module"),NF=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),OF=l(),Tt=s("div"),y(mi.$$.fragment),IF=l(),Fn=s("p"),AF=o("The "),Xc=s("a"),DF=o("BertForTokenClassification"),LF=o(" forward method, overrides the "),vf=s("code"),SF=o("__call__"),UF=o(" special method."),WF=l(),y(Cs.$$.fragment),HF=l(),wf=s("p"),RF=o("Example:"),QF=l(),y(gi.$$.fragment),B_=l(),$n=s("h2"),Ns=s("a"),Ff=s("span"),y(_i.$$.fragment),VF=l(),$f=s("span"),KF=o("BertForQuestionAnswering"),E_=l(),pt=s("div"),y(Ti.$$.fragment),JF=l(),xn=s("p"),GF=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 `),xf=s("code"),XF=o("span start logits"),YF=o(" and "),Bf=s("code"),ZF=o("span end logits"),e$=o(")."),t$=l(),yi=s("p"),o$=o("This model inherits from "),Yc=s("a"),n$=o("PreTrainedModel"),s$=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.)`),r$=l(),ki=s("p"),a$=o("This model is also a PyTorch "),bi=s("a"),i$=o("torch.nn.Module"),l$=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),d$=l(),yt=s("div"),y(vi.$$.fragment),c$=l(),Bn=s("p"),p$=o("The "),Zc=s("a"),h$=o("BertForQuestionAnswering"),f$=o(" forward method, overrides the "),Ef=s("code"),u$=o("__call__"),m$=o(" special method."),g$=l(),y(Os.$$.fragment),_$=l(),Mf=s("p"),T$=o("Example:"),y$=l(),y(wi.$$.fragment),M_=l(),En=s("h2"),Is=s("a"),zf=s("span"),y(Fi.$$.fragment),k$=l(),Pf=s("span"),b$=o("TFBertModel"),z_=l(),Qe=s("div"),y($i.$$.fragment),v$=l(),qf=s("p"),w$=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),F$=l(),xi=s("p"),$$=o("This model inherits from "),ep=s("a"),x$=o("TFPreTrainedModel"),B$=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.)`),E$=l(),Bi=s("p"),M$=o("This model is also a "),Ei=s("a"),z$=o("tf.keras.Model"),P$=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.`),q$=l(),y(As.$$.fragment),j$=l(),kt=s("div"),y(Mi.$$.fragment),C$=l(),Mn=s("p"),N$=o("The "),tp=s("a"),O$=o("TFBertModel"),I$=o(" forward method, overrides the "),jf=s("code"),A$=o("__call__"),D$=o(" special method."),L$=l(),y(Ds.$$.fragment),S$=l(),Cf=s("p"),U$=o("Example:"),W$=l(),y(zi.$$.fragment),P_=l(),zn=s("h2"),Ls=s("a"),Nf=s("span"),y(Pi.$$.fragment),H$=l(),Of=s("span"),R$=o("TFBertForPreTraining"),q_=l(),Ve=s("div"),y(qi.$$.fragment),Q$=l(),Pn=s("p"),V$=o(`Bert Model with two heads on top as done during the pretraining:
a `),If=s("code"),K$=o("masked language modeling"),J$=o(" head and a "),Af=s("code"),G$=o("next sentence prediction (classification)"),X$=o(" head."),Y$=l(),ji=s("p"),Z$=o("This model inherits from "),op=s("a"),e2=o("TFPreTrainedModel"),t2=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.)`),o2=l(),Ci=s("p"),n2=o("This model is also a "),Ni=s("a"),s2=o("tf.keras.Model"),r2=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.`),a2=l(),y(Ss.$$.fragment),i2=l(),bt=s("div"),y(Oi.$$.fragment),l2=l(),qn=s("p"),d2=o("The "),np=s("a"),c2=o("TFBertForPreTraining"),p2=o(" forward method, overrides the "),Df=s("code"),h2=o("__call__"),f2=o(" special method."),u2=l(),y(Us.$$.fragment),m2=l(),Lf=s("p"),g2=o("Examples:"),_2=l(),y(Ii.$$.fragment),j_=l(),jn=s("h2"),Ws=s("a"),Sf=s("span"),y(Ai.$$.fragment),T2=l(),Uf=s("span"),y2=o("TFBertModelLMHeadModel"),C_=l(),Cn=s("div"),y(Di.$$.fragment),k2=l(),et=s("div"),y(Li.$$.fragment),b2=l(),Ne=s("p"),v2=o("encoder_hidden_states  ("),Wf=s("code"),w2=o("tf.Tensor"),F2=o(" of shape "),Hf=s("code"),$2=o("(batch_size, sequence_length, hidden_size)"),x2=o(", "),Rf=s("em"),B2=o("optional"),E2=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 (`),Qf=s("code"),M2=o("tf.Tensor"),z2=o(" of shape "),Vf=s("code"),P2=o("(batch_size, sequence_length)"),q2=o(", "),Kf=s("em"),j2=o("optional"),C2=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 `),Jf=s("code"),N2=o("[0, 1]"),O2=o(":"),I2=l(),Si=s("ul"),Ui=s("li"),A2=o("1 for tokens that are "),Gf=s("strong"),D2=o("not masked"),L2=o(","),S2=l(),Wi=s("li"),U2=o("0 for tokens that are "),Xf=s("strong"),W2=o("masked"),H2=o("."),R2=l(),G=s("p"),Q2=o("past_key_values ("),Yf=s("code"),V2=o("Tuple[Tuple[tf.Tensor]]"),K2=o(" of length "),Zf=s("code"),J2=o("config.n_layers"),G2=o(`)
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),eu=s("code"),X2=o("past_key_values"),Y2=o(" are used, the user can optionally input only the last "),tu=s("code"),Z2=o("decoder_input_ids"),e0=o(` (those that
don\u2019t have their past key value states given to this model) of shape `),ou=s("code"),t0=o("(batch_size, 1)"),o0=o(` instead of all
`),nu=s("code"),n0=o("decoder_input_ids"),s0=o(" of shape "),su=s("code"),r0=o("(batch_size, sequence_length)"),a0=o(`.
use_cache (`),ru=s("code"),i0=o("bool"),l0=o(", "),au=s("em"),d0=o("optional"),c0=o(", defaults to "),iu=s("code"),p0=o("True"),h0=o(`):
If set to `),lu=s("code"),f0=o("True"),u0=o(", "),du=s("code"),m0=o("past_key_values"),g0=o(` key value states are returned and can be used to speed up decoding (see
`),cu=s("code"),_0=o("past_key_values"),T0=o("). Set to "),pu=s("code"),y0=o("False"),k0=o(" during training, "),hu=s("code"),b0=o("True"),v0=o(` during generation
labels (`),fu=s("code"),w0=o("tf.Tensor"),F0=o(" or "),uu=s("code"),$0=o("np.ndarray"),x0=o(" of shape "),mu=s("code"),B0=o("(batch_size, sequence_length)"),E0=o(", "),gu=s("em"),M0=o("optional"),z0=o(`):
Labels for computing the cross entropy classification loss. Indices should be in `),_u=s("code"),P0=o("[0, ..., config.vocab_size - 1]"),q0=o("."),j0=l(),Tu=s("p"),C0=o("Example:"),N0=l(),y(Hi.$$.fragment),N_=l(),Nn=s("h2"),Hs=s("a"),yu=s("span"),y(Ri.$$.fragment),O0=l(),ku=s("span"),I0=o("TFBertForMaskedLM"),O_=l(),Ke=s("div"),y(Qi.$$.fragment),A0=l(),Vi=s("p"),D0=o("Bert Model with a "),bu=s("code"),L0=o("language modeling"),S0=o(" head on top."),U0=l(),Ki=s("p"),W0=o("This model inherits from "),sp=s("a"),H0=o("TFPreTrainedModel"),R0=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.)`),Q0=l(),Ji=s("p"),V0=o("This model is also a "),Gi=s("a"),K0=o("tf.keras.Model"),J0=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.`),G0=l(),y(Rs.$$.fragment),X0=l(),vt=s("div"),y(Xi.$$.fragment),Y0=l(),On=s("p"),Z0=o("The "),rp=s("a"),ex=o("TFBertForMaskedLM"),tx=o(" forward method, overrides the "),vu=s("code"),ox=o("__call__"),nx=o(" special method."),sx=l(),y(Qs.$$.fragment),rx=l(),wu=s("p"),ax=o("Example:"),ix=l(),y(Yi.$$.fragment),I_=l(),In=s("h2"),Vs=s("a"),Fu=s("span"),y(Zi.$$.fragment),lx=l(),$u=s("span"),dx=o("TFBertForNextSentencePrediction"),A_=l(),Je=s("div"),y(el.$$.fragment),cx=l(),tl=s("p"),px=o("Bert Model with a "),xu=s("code"),hx=o("next sentence prediction (classification)"),fx=o(" head on top."),ux=l(),ol=s("p"),mx=o("This model inherits from "),ap=s("a"),gx=o("TFPreTrainedModel"),_x=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.)`),Tx=l(),nl=s("p"),yx=o("This model is also a "),sl=s("a"),kx=o("tf.keras.Model"),bx=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.`),vx=l(),y(Ks.$$.fragment),wx=l(),wt=s("div"),y(rl.$$.fragment),Fx=l(),An=s("p"),$x=o("The "),ip=s("a"),xx=o("TFBertForNextSentencePrediction"),Bx=o(" forward method, overrides the "),Bu=s("code"),Ex=o("__call__"),Mx=o(" special method."),zx=l(),y(Js.$$.fragment),Px=l(),Eu=s("p"),qx=o("Examples:"),jx=l(),y(al.$$.fragment),D_=l(),Dn=s("h2"),Gs=s("a"),Mu=s("span"),y(il.$$.fragment),Cx=l(),zu=s("span"),Nx=o("TFBertForSequenceClassification"),L_=l(),Ge=s("div"),y(ll.$$.fragment),Ox=l(),Pu=s("p"),Ix=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.`),Ax=l(),dl=s("p"),Dx=o("This model inherits from "),lp=s("a"),Lx=o("TFPreTrainedModel"),Sx=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.)`),Ux=l(),cl=s("p"),Wx=o("This model is also a "),pl=s("a"),Hx=o("tf.keras.Model"),Rx=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.`),Qx=l(),y(Xs.$$.fragment),Vx=l(),Ft=s("div"),y(hl.$$.fragment),Kx=l(),Ln=s("p"),Jx=o("The "),dp=s("a"),Gx=o("TFBertForSequenceClassification"),Xx=o(" forward method, overrides the "),qu=s("code"),Yx=o("__call__"),Zx=o(" special method."),eB=l(),y(Ys.$$.fragment),tB=l(),ju=s("p"),oB=o("Example:"),nB=l(),y(fl.$$.fragment),S_=l(),Sn=s("h2"),Zs=s("a"),Cu=s("span"),y(ul.$$.fragment),sB=l(),Nu=s("span"),rB=o("TFBertForMultipleChoice"),U_=l(),Xe=s("div"),y(ml.$$.fragment),aB=l(),Ou=s("p"),iB=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.`),lB=l(),gl=s("p"),dB=o("This model inherits from "),cp=s("a"),cB=o("TFPreTrainedModel"),pB=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.)`),hB=l(),_l=s("p"),fB=o("This model is also a "),Tl=s("a"),uB=o("tf.keras.Model"),mB=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.`),gB=l(),y(er.$$.fragment),_B=l(),$t=s("div"),y(yl.$$.fragment),TB=l(),Un=s("p"),yB=o("The "),pp=s("a"),kB=o("TFBertForMultipleChoice"),bB=o(" forward method, overrides the "),Iu=s("code"),vB=o("__call__"),wB=o(" special method."),FB=l(),y(tr.$$.fragment),$B=l(),Au=s("p"),xB=o("Example:"),BB=l(),y(kl.$$.fragment),W_=l(),Wn=s("h2"),or=s("a"),Du=s("span"),y(bl.$$.fragment),EB=l(),Lu=s("span"),MB=o("TFBertForTokenClassification"),H_=l(),Ye=s("div"),y(vl.$$.fragment),zB=l(),Su=s("p"),PB=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.`),qB=l(),wl=s("p"),jB=o("This model inherits from "),hp=s("a"),CB=o("TFPreTrainedModel"),NB=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.)`),OB=l(),Fl=s("p"),IB=o("This model is also a "),$l=s("a"),AB=o("tf.keras.Model"),DB=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.`),LB=l(),y(nr.$$.fragment),SB=l(),xt=s("div"),y(xl.$$.fragment),UB=l(),Hn=s("p"),WB=o("The "),fp=s("a"),HB=o("TFBertForTokenClassification"),RB=o(" forward method, overrides the "),Uu=s("code"),QB=o("__call__"),VB=o(" special method."),KB=l(),y(sr.$$.fragment),JB=l(),Wu=s("p"),GB=o("Example:"),XB=l(),y(Bl.$$.fragment),R_=l(),Rn=s("h2"),rr=s("a"),Hu=s("span"),y(El.$$.fragment),YB=l(),Ru=s("span"),ZB=o("TFBertForQuestionAnswering"),Q_=l(),Ze=s("div"),y(Ml.$$.fragment),eE=l(),Qn=s("p"),tE=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 `),Qu=s("code"),oE=o("span start logits"),nE=o(" and "),Vu=s("code"),sE=o("span end logits"),rE=o(")."),aE=l(),zl=s("p"),iE=o("This model inherits from "),up=s("a"),lE=o("TFPreTrainedModel"),dE=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.)`),cE=l(),Pl=s("p"),pE=o("This model is also a "),ql=s("a"),hE=o("tf.keras.Model"),fE=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.`),uE=l(),y(ar.$$.fragment),mE=l(),Bt=s("div"),y(jl.$$.fragment),gE=l(),Vn=s("p"),_E=o("The "),mp=s("a"),TE=o("TFBertForQuestionAnswering"),yE=o(" forward method, overrides the "),Ku=s("code"),kE=o("__call__"),bE=o(" special method."),vE=l(),y(ir.$$.fragment),wE=l(),Ju=s("p"),FE=o("Example:"),$E=l(),y(Cl.$$.fragment),V_=l(),Kn=s("h2"),lr=s("a"),Gu=s("span"),y(Nl.$$.fragment),xE=l(),Xu=s("span"),BE=o("FlaxBertModel"),K_=l(),Oe=s("div"),y(Ol.$$.fragment),EE=l(),Yu=s("p"),ME=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),zE=l(),Il=s("p"),PE=o("This model inherits from "),gp=s("a"),qE=o("FlaxPreTrainedModel"),jE=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)`),CE=l(),Al=s("p"),NE=o("This model is also a Flax Linen "),Dl=s("a"),OE=o("flax.linen.Module"),IE=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.`),AE=l(),Zu=s("p"),DE=o("Finally, this model supports inherent JAX features such as:"),LE=l(),lo=s("ul"),em=s("li"),Ll=s("a"),SE=o("Just-In-Time (JIT) compilation"),UE=l(),tm=s("li"),Sl=s("a"),WE=o("Automatic Differentiation"),HE=l(),om=s("li"),Ul=s("a"),RE=o("Vectorization"),QE=l(),nm=s("li"),Wl=s("a"),VE=o("Parallelization"),KE=l(),Et=s("div"),y(Hl.$$.fragment),JE=l(),Jn=s("p"),GE=o("The "),sm=s("code"),XE=o("FlaxBertPreTrainedModel"),YE=o("forward method, overrides the "),rm=s("code"),ZE=o("__call__"),eM=o(" special method."),tM=l(),y(dr.$$.fragment),oM=l(),am=s("p"),nM=o("Example:"),sM=l(),y(Rl.$$.fragment),J_=l(),Gn=s("h2"),cr=s("a"),im=s("span"),y(Ql.$$.fragment),rM=l(),lm=s("span"),aM=o("FlaxBertForPreTraining"),G_=l(),Ie=s("div"),y(Vl.$$.fragment),iM=l(),Xn=s("p"),lM=o("Bert Model with two heads on top as done during the pretraining: a "),dm=s("code"),dM=o("masked language modeling"),cM=o(" head and a "),cm=s("code"),pM=o("next sentence prediction (classification)"),hM=o(" head."),fM=l(),Kl=s("p"),uM=o("This model inherits from "),_p=s("a"),mM=o("FlaxPreTrainedModel"),gM=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)`),_M=l(),Jl=s("p"),TM=o("This model is also a Flax Linen "),Gl=s("a"),yM=o("flax.linen.Module"),kM=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),bM=l(),pm=s("p"),vM=o("Finally, this model supports inherent JAX features such as:"),wM=l(),co=s("ul"),hm=s("li"),Xl=s("a"),FM=o("Just-In-Time (JIT) compilation"),$M=l(),fm=s("li"),Yl=s("a"),xM=o("Automatic Differentiation"),BM=l(),um=s("li"),Zl=s("a"),EM=o("Vectorization"),MM=l(),mm=s("li"),ed=s("a"),zM=o("Parallelization"),PM=l(),Mt=s("div"),y(td.$$.fragment),qM=l(),Yn=s("p"),jM=o("The "),gm=s("code"),CM=o("FlaxBertPreTrainedModel"),NM=o("forward method, overrides the "),_m=s("code"),OM=o("__call__"),IM=o(" special method."),AM=l(),y(pr.$$.fragment),DM=l(),Tm=s("p"),LM=o("Example:"),SM=l(),y(od.$$.fragment),X_=l(),Zn=s("h2"),hr=s("a"),ym=s("span"),y(nd.$$.fragment),UM=l(),km=s("span"),WM=o("FlaxBertForMaskedLM"),Y_=l(),Ae=s("div"),y(sd.$$.fragment),HM=l(),rd=s("p"),RM=o("Bert Model with a "),bm=s("code"),QM=o("language modeling"),VM=o(" head on top."),KM=l(),ad=s("p"),JM=o("This model inherits from "),Tp=s("a"),GM=o("FlaxPreTrainedModel"),XM=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)`),YM=l(),id=s("p"),ZM=o("This model is also a Flax Linen "),ld=s("a"),e3=o("flax.linen.Module"),t3=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.`),o3=l(),vm=s("p"),n3=o("Finally, this model supports inherent JAX features such as:"),s3=l(),po=s("ul"),wm=s("li"),dd=s("a"),r3=o("Just-In-Time (JIT) compilation"),a3=l(),Fm=s("li"),cd=s("a"),i3=o("Automatic Differentiation"),l3=l(),$m=s("li"),pd=s("a"),d3=o("Vectorization"),c3=l(),xm=s("li"),hd=s("a"),p3=o("Parallelization"),h3=l(),zt=s("div"),y(fd.$$.fragment),f3=l(),es=s("p"),u3=o("The "),Bm=s("code"),m3=o("FlaxBertPreTrainedModel"),g3=o("forward method, overrides the "),Em=s("code"),_3=o("__call__"),T3=o(" special method."),y3=l(),y(fr.$$.fragment),k3=l(),Mm=s("p"),b3=o("Example:"),v3=l(),y(ud.$$.fragment),Z_=l(),ts=s("h2"),ur=s("a"),zm=s("span"),y(md.$$.fragment),w3=l(),Pm=s("span"),F3=o("FlaxBertForNextSentencePrediction"),eT=l(),De=s("div"),y(gd.$$.fragment),$3=l(),_d=s("p"),x3=o("Bert Model with a "),qm=s("code"),B3=o("next sentence prediction (classification)"),E3=o(" head on top."),M3=l(),Td=s("p"),z3=o("This model inherits from "),yp=s("a"),P3=o("FlaxPreTrainedModel"),q3=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)`),j3=l(),yd=s("p"),C3=o("This model is also a Flax Linen "),kd=s("a"),N3=o("flax.linen.Module"),O3=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.`),I3=l(),jm=s("p"),A3=o("Finally, this model supports inherent JAX features such as:"),D3=l(),ho=s("ul"),Cm=s("li"),bd=s("a"),L3=o("Just-In-Time (JIT) compilation"),S3=l(),Nm=s("li"),vd=s("a"),U3=o("Automatic Differentiation"),W3=l(),Om=s("li"),wd=s("a"),H3=o("Vectorization"),R3=l(),Im=s("li"),Fd=s("a"),Q3=o("Parallelization"),V3=l(),Pt=s("div"),y($d.$$.fragment),K3=l(),os=s("p"),J3=o("The "),Am=s("code"),G3=o("FlaxBertPreTrainedModel"),X3=o("forward method, overrides the "),Dm=s("code"),Y3=o("__call__"),Z3=o(" special method."),ez=l(),y(mr.$$.fragment),tz=l(),Lm=s("p"),oz=o("Example:"),nz=l(),y(xd.$$.fragment),tT=l(),ns=s("h2"),gr=s("a"),Sm=s("span"),y(Bd.$$.fragment),sz=l(),Um=s("span"),rz=o("FlaxBertForSequenceClassification"),oT=l(),Le=s("div"),y(Ed.$$.fragment),az=l(),Wm=s("p"),iz=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.`),lz=l(),Md=s("p"),dz=o("This model inherits from "),kp=s("a"),cz=o("FlaxPreTrainedModel"),pz=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)`),hz=l(),zd=s("p"),fz=o("This model is also a Flax Linen "),Pd=s("a"),uz=o("flax.linen.Module"),mz=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.`),gz=l(),Hm=s("p"),_z=o("Finally, this model supports inherent JAX features such as:"),Tz=l(),fo=s("ul"),Rm=s("li"),qd=s("a"),yz=o("Just-In-Time (JIT) compilation"),kz=l(),Qm=s("li"),jd=s("a"),bz=o("Automatic Differentiation"),vz=l(),Vm=s("li"),Cd=s("a"),wz=o("Vectorization"),Fz=l(),Km=s("li"),Nd=s("a"),$z=o("Parallelization"),xz=l(),qt=s("div"),y(Od.$$.fragment),Bz=l(),ss=s("p"),Ez=o("The "),Jm=s("code"),Mz=o("FlaxBertPreTrainedModel"),zz=o("forward method, overrides the "),Gm=s("code"),Pz=o("__call__"),qz=o(" special method."),jz=l(),y(_r.$$.fragment),Cz=l(),Xm=s("p"),Nz=o("Example:"),Oz=l(),y(Id.$$.fragment),nT=l(),rs=s("h2"),Tr=s("a"),Ym=s("span"),y(Ad.$$.fragment),Iz=l(),Zm=s("span"),Az=o("FlaxBertForMultipleChoice"),sT=l(),Se=s("div"),y(Dd.$$.fragment),Dz=l(),eg=s("p"),Lz=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.`),Sz=l(),Ld=s("p"),Uz=o("This model inherits from "),bp=s("a"),Wz=o("FlaxPreTrainedModel"),Hz=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)`),Rz=l(),Sd=s("p"),Qz=o("This model is also a Flax Linen "),Ud=s("a"),Vz=o("flax.linen.Module"),Kz=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.`),Jz=l(),tg=s("p"),Gz=o("Finally, this model supports inherent JAX features such as:"),Xz=l(),uo=s("ul"),og=s("li"),Wd=s("a"),Yz=o("Just-In-Time (JIT) compilation"),Zz=l(),ng=s("li"),Hd=s("a"),e5=o("Automatic Differentiation"),t5=l(),sg=s("li"),Rd=s("a"),o5=o("Vectorization"),n5=l(),rg=s("li"),Qd=s("a"),s5=o("Parallelization"),r5=l(),jt=s("div"),y(Vd.$$.fragment),a5=l(),as=s("p"),i5=o("The "),ag=s("code"),l5=o("FlaxBertPreTrainedModel"),d5=o("forward method, overrides the "),ig=s("code"),c5=o("__call__"),p5=o(" special method."),h5=l(),y(yr.$$.fragment),f5=l(),lg=s("p"),u5=o("Example:"),m5=l(),y(Kd.$$.fragment),rT=l(),is=s("h2"),kr=s("a"),dg=s("span"),y(Jd.$$.fragment),g5=l(),cg=s("span"),_5=o("FlaxBertForTokenClassification"),aT=l(),Ue=s("div"),y(Gd.$$.fragment),T5=l(),pg=s("p"),y5=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.`),k5=l(),Xd=s("p"),b5=o("This model inherits from "),vp=s("a"),v5=o("FlaxPreTrainedModel"),w5=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)`),F5=l(),Yd=s("p"),$5=o("This model is also a Flax Linen "),Zd=s("a"),x5=o("flax.linen.Module"),B5=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=l(),hg=s("p"),M5=o("Finally, this model supports inherent JAX features such as:"),z5=l(),mo=s("ul"),fg=s("li"),ec=s("a"),P5=o("Just-In-Time (JIT) compilation"),q5=l(),ug=s("li"),tc=s("a"),j5=o("Automatic Differentiation"),C5=l(),mg=s("li"),oc=s("a"),N5=o("Vectorization"),O5=l(),gg=s("li"),nc=s("a"),I5=o("Parallelization"),A5=l(),Ct=s("div"),y(sc.$$.fragment),D5=l(),ls=s("p"),L5=o("The "),_g=s("code"),S5=o("FlaxBertPreTrainedModel"),U5=o("forward method, overrides the "),Tg=s("code"),W5=o("__call__"),H5=o(" special method."),R5=l(),y(br.$$.fragment),Q5=l(),yg=s("p"),V5=o("Example:"),K5=l(),y(rc.$$.fragment),iT=l(),ds=s("h2"),vr=s("a"),kg=s("span"),y(ac.$$.fragment),J5=l(),bg=s("span"),G5=o("FlaxBertForQuestionAnswering"),lT=l(),We=s("div"),y(ic.$$.fragment),X5=l(),cs=s("p"),Y5=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 `),vg=s("code"),Z5=o("span start logits"),eP=o(" and "),wg=s("code"),tP=o("span end logits"),oP=o(")."),nP=l(),lc=s("p"),sP=o("This model inherits from "),wp=s("a"),rP=o("FlaxPreTrainedModel"),aP=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)`),iP=l(),dc=s("p"),lP=o("This model is also a Flax Linen "),cc=s("a"),dP=o("flax.linen.Module"),cP=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.`),pP=l(),Fg=s("p"),hP=o("Finally, this model supports inherent JAX features such as:"),fP=l(),go=s("ul"),$g=s("li"),pc=s("a"),uP=o("Just-In-Time (JIT) compilation"),mP=l(),xg=s("li"),hc=s("a"),gP=o("Automatic Differentiation"),_P=l(),Bg=s("li"),fc=s("a"),TP=o("Vectorization"),yP=l(),Eg=s("li"),uc=s("a"),kP=o("Parallelization"),bP=l(),Nt=s("div"),y(mc.$$.fragment),vP=l(),ps=s("p"),wP=o("The "),Mg=s("code"),FP=o("FlaxBertPreTrainedModel"),$P=o("forward method, overrides the "),zg=s("code"),xP=o("__call__"),BP=o(" special method."),EP=l(),y(wr.$$.fragment),MP=l(),Pg=s("p"),zP=o("Example:"),PP=l(),y(gc.$$.fragment),this.h()},l(i){const u=A6('[data-svelte="svelte-1phssyn"]',document.head);p=r(u,"META",{name:!0,content:!0}),u.forEach(t),x=d(i),g=r(i,"H1",{class:!0});var _c=a(g);T=r(_c,"A",{id:!0,class:!0,href:!0});var qg=a(T);$=r(qg,"SPAN",{});var jg=a($);k(_.$$.fragment,jg),jg.forEach(t),qg.forEach(t),m=d(_c),B=r(_c,"SPAN",{});var Cg=a(B);me=n(Cg,"BERT"),Cg.forEach(t),_c.forEach(t),X=d(i),M=r(i,"H2",{class:!0});var Tc=a(M);ee=r(Tc,"A",{id:!0,class:!0,href:!0});var Ng=a(ee);D=r(Ng,"SPAN",{});var Og=a(D);k(oe.$$.fragment,Og),Og.forEach(t),Ng.forEach(t),ge=d(Tc),L=r(Tc,"SPAN",{});var Ig=a(L);_e=n(Ig,"Overview"),Ig.forEach(t),Tc.forEach(t),ce=d(i),J=r(i,"P",{});var yc=a(J);O=n(yc,"The BERT model was proposed in "),ne=r(yc,"A",{href:!0,rel:!0});var Ag=a(ne);Y=n(Ag,"BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding"),Ag.forEach(t),z=n(yc,` 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.`),yc.forEach(t),q=d(i),se=r(i,"P",{});var Dg=a(se);H=n(Dg,"The abstract from the paper is the following:"),Dg.forEach(t),pe=d(i),re=r(i,"P",{});var Lg=a(re);S=r(Lg,"EM",{});var Sg=a(S);Te=n(Sg,`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.`),Sg.forEach(t),Lg.forEach(t),he=d(i),P=r(i,"P",{});var Ug=a(P);ie=r(Ug,"EM",{});var Wg=a(ie);R=n(Wg,`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).`),Wg.forEach(t),Ug.forEach(t),fe=d(i),ae=r(i,"P",{});var Hg=a(ae);Q=n(Hg,"Tips:"),Hg.forEach(t),ue=d(i),te=r(i,"UL",{});var kc=a(te);N=r(kc,"LI",{});var Rg=a(N);ye=n(Rg,`BERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),Rg.forEach(t),V=d(kc),le=r(kc,"LI",{});var Qg=a(le);h=n(Qg,`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.`),Qg.forEach(t),kc.forEach(t),E=d(i),K=r(i,"P",{});var hs=a(K);Ee=n(hs,"This model was contributed by "),Fe=r(hs,"A",{href:!0,rel:!0});var Vg=a(Fe);I=n(Vg,"thomwolf"),Vg.forEach(t),Me=n(hs,". The original code can be found "),$e=r(hs,"A",{href:!0,rel:!0});var Kg=a($e);ze=n(Kg,"here"),Kg.forEach(t),A=n(hs,"."),hs.forEach(t),W=d(i),ke=r(i,"H2",{class:!0});var bc=a(ke);ve=r(bc,"A",{id:!0,class:!0,href:!0});var Jg=a(ve);U=r(Jg,"SPAN",{});var Gg=a(U);k(xe.$$.fragment,Gg),Gg.forEach(t),Jg.forEach(t),Pe=d(bc),de=r(bc,"SPAN",{});var Xg=a(de);qe=n(Xg,"BertConfig"),Xg.forEach(t),bc.forEach(t),o_=d(i),ot=r(i,"DIV",{class:!0});var Kt=a(ot);k(Cr.$$.fragment,Kt),ak=d(Kt),ao=r(Kt,"P",{});var _o=a(ao);ik=n(_o,"This is the configuration class to store the configuration of a "),vc=r(_o,"A",{href:!0});var Yg=a(vc);lk=n(Yg,"BertModel"),Yg.forEach(t),dk=n(_o," or a "),wc=r(_o,"A",{href:!0});var Zg=a(wc);ck=n(Zg,"TFBertModel"),Zg.forEach(t),pk=n(_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
`),Nr=r(_o,"A",{href:!0,rel:!0});var e_=a(Nr);hk=n(e_,"bert-base-uncased"),e_.forEach(t),fk=n(_o," architecture."),_o.forEach(t),uk=d(Kt),Zo=r(Kt,"P",{});var fs=a(Zo);mk=n(fs,"Configuration objects inherit from "),Fc=r(fs,"A",{href:!0});var t_=a(Fc);gk=n(t_,"PretrainedConfig"),t_.forEach(t),_k=n(fs,` and can be used to control the model outputs. Read the
documentation from `),$c=r(fs,"A",{href:!0});var OP=a($c);Tk=n(OP,"PretrainedConfig"),OP.forEach(t),yk=n(fs," for more information."),fs.forEach(t),kk=d(Kt),ah=r(Kt,"P",{});var IP=a(ah);bk=n(IP,"Examples:"),IP.forEach(t),vk=d(Kt),k(Or.$$.fragment,Kt),Kt.forEach(t),n_=d(i),en=r(i,"H2",{class:!0});var cT=a(en);us=r(cT,"A",{id:!0,class:!0,href:!0});var AP=a(us);ih=r(AP,"SPAN",{});var DP=a(ih);k(Ir.$$.fragment,DP),DP.forEach(t),AP.forEach(t),wk=d(cT),lh=r(cT,"SPAN",{});var LP=a(lh);Fk=n(LP,"BertTokenizer"),LP.forEach(t),cT.forEach(t),s_=d(i),je=r(i,"DIV",{class:!0});var Ot=a(je);k(Ar.$$.fragment,Ot),$k=d(Ot),dh=r(Ot,"P",{});var SP=a(dh);xk=n(SP,"Construct a BERT tokenizer. Based on WordPiece."),SP.forEach(t),Bk=d(Ot),Dr=r(Ot,"P",{});var pT=a(Dr);Ek=n(pT,"This tokenizer inherits from "),xc=r(pT,"A",{href:!0});var UP=a(xc);Mk=n(UP,"PreTrainedTokenizer"),UP.forEach(t),zk=n(pT,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),pT.forEach(t),Pk=d(Ot),To=r(Ot,"DIV",{class:!0});var Fp=a(To);k(Lr.$$.fragment,Fp),qk=d(Fp),ch=r(Fp,"P",{});var WP=a(ch);jk=n(WP,`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:`),WP.forEach(t),Ck=d(Fp),Sr=r(Fp,"UL",{});var hT=a(Sr);Bc=r(hT,"LI",{});var qP=a(Bc);Nk=n(qP,"single sequence: "),ph=r(qP,"CODE",{});var HP=a(ph);Ok=n(HP,"[CLS] X [SEP]"),HP.forEach(t),qP.forEach(t),Ik=d(hT),Ec=r(hT,"LI",{});var jP=a(Ec);Ak=n(jP,"pair of sequences: "),hh=r(jP,"CODE",{});var RP=a(hh);Dk=n(RP,"[CLS] A [SEP] B [SEP]"),RP.forEach(t),jP.forEach(t),hT.forEach(t),Fp.forEach(t),Lk=d(Ot),ms=r(Ot,"DIV",{class:!0});var fT=a(ms);k(Ur.$$.fragment,fT),Sk=d(fT),Wr=r(fT,"P",{});var uT=a(Wr);Uk=n(uT,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),fh=r(uT,"CODE",{});var QP=a(fh);Wk=n(QP,"prepare_for_model"),QP.forEach(t),Hk=n(uT," method."),uT.forEach(t),fT.forEach(t),Rk=d(Ot),Jt=r(Ot,"DIV",{class:!0});var Fr=a(Jt);k(Hr.$$.fragment,Fr),Qk=d(Fr),uh=r(Fr,"P",{});var VP=a(uh);Vk=n(VP,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence
pair mask has the following format:`),VP.forEach(t),Kk=d(Fr),k(Rr.$$.fragment,Fr),Jk=d(Fr),tn=r(Fr,"P",{});var $p=a(tn);Gk=n($p,"If "),mh=r($p,"CODE",{});var KP=a(mh);Xk=n(KP,"token_ids_1"),KP.forEach(t),Yk=n($p," is "),gh=r($p,"CODE",{});var JP=a(gh);Zk=n(JP,"None"),JP.forEach(t),eb=n($p,", this method only returns the first portion of the mask (0s)."),$p.forEach(t),Fr.forEach(t),tb=d(Ot),Mc=r(Ot,"DIV",{class:!0});var GP=a(Mc);k(Qr.$$.fragment,GP),GP.forEach(t),Ot.forEach(t),r_=d(i),on=r(i,"H2",{class:!0});var mT=a(on);gs=r(mT,"A",{id:!0,class:!0,href:!0});var XP=a(gs);_h=r(XP,"SPAN",{});var YP=a(_h);k(Vr.$$.fragment,YP),YP.forEach(t),XP.forEach(t),ob=d(mT),Th=r(mT,"SPAN",{});var ZP=a(Th);nb=n(ZP,"BertTokenizerFast"),ZP.forEach(t),mT.forEach(t),a_=d(i),nt=r(i,"DIV",{class:!0});var ko=a(nt);k(Kr.$$.fragment,ko),sb=d(ko),Jr=r(ko,"P",{});var gT=a(Jr);rb=n(gT,"Construct a \u201Cfast\u201D BERT tokenizer (backed by HuggingFace\u2019s "),yh=r(gT,"EM",{});var e4=a(yh);ab=n(e4,"tokenizers"),e4.forEach(t),ib=n(gT," library). Based on WordPiece."),gT.forEach(t),lb=d(ko),Gr=r(ko,"P",{});var _T=a(Gr);db=n(_T,"This tokenizer inherits from "),zc=r(_T,"A",{href:!0});var t4=a(zc);cb=n(t4,"PreTrainedTokenizerFast"),t4.forEach(t),pb=n(_T,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),_T.forEach(t),hb=d(ko),yo=r(ko,"DIV",{class:!0});var xp=a(yo);k(Xr.$$.fragment,xp),fb=d(xp),kh=r(xp,"P",{});var o4=a(kh);ub=n(o4,`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:`),o4.forEach(t),mb=d(xp),Yr=r(xp,"UL",{});var TT=a(Yr);Pc=r(TT,"LI",{});var CP=a(Pc);gb=n(CP,"single sequence: "),bh=r(CP,"CODE",{});var n4=a(bh);_b=n(n4,"[CLS] X [SEP]"),n4.forEach(t),CP.forEach(t),Tb=d(TT),qc=r(TT,"LI",{});var NP=a(qc);yb=n(NP,"pair of sequences: "),vh=r(NP,"CODE",{});var s4=a(vh);kb=n(s4,"[CLS] A [SEP] B [SEP]"),s4.forEach(t),NP.forEach(t),TT.forEach(t),xp.forEach(t),bb=d(ko),Gt=r(ko,"DIV",{class:!0});var $r=a(Gt);k(Zr.$$.fragment,$r),vb=d($r),wh=r($r,"P",{});var r4=a(wh);wb=n(r4,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence
pair mask has the following format:`),r4.forEach(t),Fb=d($r),k(ea.$$.fragment,$r),$b=d($r),nn=r($r,"P",{});var Bp=a(nn);xb=n(Bp,"If "),Fh=r(Bp,"CODE",{});var a4=a(Fh);Bb=n(a4,"token_ids_1"),a4.forEach(t),Eb=n(Bp," is "),$h=r(Bp,"CODE",{});var i4=a($h);Mb=n(i4,"None"),i4.forEach(t),zb=n(Bp,", this method only returns the first portion of the mask (0s)."),Bp.forEach(t),$r.forEach(t),ko.forEach(t),i_=d(i),sn=r(i,"H2",{class:!0});var yT=a(sn);_s=r(yT,"A",{id:!0,class:!0,href:!0});var l4=a(_s);xh=r(l4,"SPAN",{});var d4=a(xh);k(ta.$$.fragment,d4),d4.forEach(t),l4.forEach(t),Pb=d(yT),Bh=r(yT,"SPAN",{});var c4=a(Bh);qb=n(c4,"Bert specific outputs"),c4.forEach(t),yT.forEach(t),l_=d(i),rn=r(i,"DIV",{class:!0});var kT=a(rn);k(oa.$$.fragment,kT),jb=d(kT),na=r(kT,"P",{});var bT=a(na);Cb=n(bT,"Output type of "),jc=r(bT,"A",{href:!0});var p4=a(jc);Nb=n(p4,"BertForPreTraining"),p4.forEach(t),Ob=n(bT,"."),bT.forEach(t),kT.forEach(t),d_=d(i),an=r(i,"DIV",{class:!0});var vT=a(an);k(sa.$$.fragment,vT),Ib=d(vT),ra=r(vT,"P",{});var wT=a(ra);Ab=n(wT,"Output type of "),Cc=r(wT,"A",{href:!0});var h4=a(Cc);Db=n(h4,"TFBertForPreTraining"),h4.forEach(t),Lb=n(wT,"."),wT.forEach(t),vT.forEach(t),c_=d(i),io=r(i,"DIV",{class:!0});var Ep=a(io);k(aa.$$.fragment,Ep),Sb=d(Ep),ia=r(Ep,"P",{});var FT=a(ia);Ub=n(FT,"Output type of "),Nc=r(FT,"A",{href:!0});var f4=a(Nc);Wb=n(f4,"BertForPreTraining"),f4.forEach(t),Hb=n(FT,"."),FT.forEach(t),Rb=d(Ep),Ts=r(Ep,"DIV",{class:!0});var $T=a(Ts);k(la.$$.fragment,$T),Qb=d($T),Eh=r($T,"P",{});var u4=a(Eh);Vb=n(u4,"\u201CReturns a new object replacing the specified fields with new values."),u4.forEach(t),$T.forEach(t),Ep.forEach(t),p_=d(i),ln=r(i,"H2",{class:!0});var xT=a(ln);ys=r(xT,"A",{id:!0,class:!0,href:!0});var m4=a(ys);Mh=r(m4,"SPAN",{});var g4=a(Mh);k(da.$$.fragment,g4),g4.forEach(t),m4.forEach(t),Kb=d(xT),zh=r(xT,"SPAN",{});var _4=a(zh);Jb=n(_4,"BertModel"),_4.forEach(t),xT.forEach(t),h_=d(i),Ce=r(i,"DIV",{class:!0});var It=a(Ce);k(ca.$$.fragment,It),Gb=d(It),Ph=r(It,"P",{});var T4=a(Ph);Xb=n(T4,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),T4.forEach(t),Yb=d(It),pa=r(It,"P",{});var BT=a(pa);Zb=n(BT,"This model inherits from "),Oc=r(BT,"A",{href:!0});var y4=a(Oc);ev=n(y4,"PreTrainedModel"),y4.forEach(t),tv=n(BT,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),BT.forEach(t),ov=d(It),ha=r(It,"P",{});var ET=a(ha);nv=n(ET,"This model is also a PyTorch "),fa=r(ET,"A",{href:!0,rel:!0});var k4=a(fa);sv=n(k4,"torch.nn.Module"),k4.forEach(t),rv=n(ET,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ET.forEach(t),av=d(It),ua=r(It,"P",{});var MT=a(ua);iv=n(MT,`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 `),ma=r(MT,"A",{href:!0,rel:!0});var b4=a(ma);lv=n(b4,`Attention is
all you need`),b4.forEach(t),dv=n(MT,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),MT.forEach(t),cv=d(It),Re=r(It,"P",{});var At=a(Re);pv=n(At,"To behave as an decoder the model needs to be initialized with the "),qh=r(At,"CODE",{});var v4=a(qh);hv=n(v4,"is_decoder"),v4.forEach(t),fv=n(At,` argument of the configuration set
to `),jh=r(At,"CODE",{});var w4=a(jh);uv=n(w4,"True"),w4.forEach(t),mv=n(At,". To be used in a Seq2Seq model, the model needs to initialized with both "),Ch=r(At,"CODE",{});var F4=a(Ch);gv=n(F4,"is_decoder"),F4.forEach(t),_v=n(At,` argument and
`),Nh=r(At,"CODE",{});var $4=a(Nh);Tv=n($4,"add_cross_attention"),$4.forEach(t),yv=n(At," set to "),Oh=r(At,"CODE",{});var x4=a(Oh);kv=n(x4,"True"),x4.forEach(t),bv=n(At,"; an "),Ih=r(At,"CODE",{});var B4=a(Ih);vv=n(B4,"encoder_hidden_states"),B4.forEach(t),wv=n(At," is then expected as an input to the forward pass."),At.forEach(t),Fv=d(It),ht=r(It,"DIV",{class:!0});var bo=a(ht);k(ga.$$.fragment,bo),$v=d(bo),dn=r(bo,"P",{});var Mp=a(dn);xv=n(Mp,"The "),Ic=r(Mp,"A",{href:!0});var E4=a(Ic);Bv=n(E4,"BertModel"),E4.forEach(t),Ev=n(Mp," forward method, overrides the "),Ah=r(Mp,"CODE",{});var M4=a(Ah);Mv=n(M4,"__call__"),M4.forEach(t),zv=n(Mp," special method."),Mp.forEach(t),Pv=d(bo),k(ks.$$.fragment,bo),qv=d(bo),Dh=r(bo,"P",{});var z4=a(Dh);jv=n(z4,"Example:"),z4.forEach(t),Cv=d(bo),k(_a.$$.fragment,bo),bo.forEach(t),It.forEach(t),f_=d(i),cn=r(i,"H2",{class:!0});var zT=a(cn);bs=r(zT,"A",{id:!0,class:!0,href:!0});var P4=a(bs);Lh=r(P4,"SPAN",{});var q4=a(Lh);k(Ta.$$.fragment,q4),q4.forEach(t),P4.forEach(t),Nv=d(zT),Sh=r(zT,"SPAN",{});var j4=a(Sh);Ov=n(j4,"BertForPreTraining"),j4.forEach(t),zT.forEach(t),u_=d(i),st=r(i,"DIV",{class:!0});var vo=a(st);k(ya.$$.fragment,vo),Iv=d(vo),pn=r(vo,"P",{});var zp=a(pn);Av=n(zp,"Bert Model with two heads on top as done during the pretraining: a "),Uh=r(zp,"CODE",{});var C4=a(Uh);Dv=n(C4,"masked language modeling"),C4.forEach(t),Lv=n(zp," head and a "),Wh=r(zp,"CODE",{});var N4=a(Wh);Sv=n(N4,"next sentence prediction (classification)"),N4.forEach(t),Uv=n(zp," head."),zp.forEach(t),Wv=d(vo),ka=r(vo,"P",{});var PT=a(ka);Hv=n(PT,"This model inherits from "),Ac=r(PT,"A",{href:!0});var O4=a(Ac);Rv=n(O4,"PreTrainedModel"),O4.forEach(t),Qv=n(PT,`. 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.)`),PT.forEach(t),Vv=d(vo),ba=r(vo,"P",{});var qT=a(ba);Kv=n(qT,"This model is also a PyTorch "),va=r(qT,"A",{href:!0,rel:!0});var I4=a(va);Jv=n(I4,"torch.nn.Module"),I4.forEach(t),Gv=n(qT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),qT.forEach(t),Xv=d(vo),ft=r(vo,"DIV",{class:!0});var wo=a(ft);k(wa.$$.fragment,wo),Yv=d(wo),hn=r(wo,"P",{});var Pp=a(hn);Zv=n(Pp,"The "),Dc=r(Pp,"A",{href:!0});var A4=a(Dc);e1=n(A4,"BertForPreTraining"),A4.forEach(t),t1=n(Pp," forward method, overrides the "),Hh=r(Pp,"CODE",{});var D4=a(Hh);o1=n(D4,"__call__"),D4.forEach(t),n1=n(Pp," special method."),Pp.forEach(t),s1=d(wo),k(vs.$$.fragment,wo),r1=d(wo),Rh=r(wo,"P",{});var L4=a(Rh);a1=n(L4,"Example:"),L4.forEach(t),i1=d(wo),k(Fa.$$.fragment,wo),wo.forEach(t),vo.forEach(t),m_=d(i),fn=r(i,"H2",{class:!0});var jT=a(fn);ws=r(jT,"A",{id:!0,class:!0,href:!0});var S4=a(ws);Qh=r(S4,"SPAN",{});var U4=a(Qh);k($a.$$.fragment,U4),U4.forEach(t),S4.forEach(t),l1=d(jT),Vh=r(jT,"SPAN",{});var W4=a(Vh);d1=n(W4,"BertLMHeadModel"),W4.forEach(t),jT.forEach(t),g_=d(i),rt=r(i,"DIV",{class:!0});var Fo=a(rt);k(xa.$$.fragment,Fo),c1=d(Fo),Ba=r(Fo,"P",{});var CT=a(Ba);p1=n(CT,"Bert Model with a "),Kh=r(CT,"CODE",{});var H4=a(Kh);h1=n(H4,"language modeling"),H4.forEach(t),f1=n(CT," head on top for CLM fine-tuning."),CT.forEach(t),u1=d(Fo),Ea=r(Fo,"P",{});var NT=a(Ea);m1=n(NT,"This model inherits from "),Lc=r(NT,"A",{href:!0});var R4=a(Lc);g1=n(R4,"PreTrainedModel"),R4.forEach(t),_1=n(NT,`. 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.)`),NT.forEach(t),T1=d(Fo),Ma=r(Fo,"P",{});var OT=a(Ma);y1=n(OT,"This model is also a PyTorch "),za=r(OT,"A",{href:!0,rel:!0});var Q4=a(za);k1=n(Q4,"torch.nn.Module"),Q4.forEach(t),b1=n(OT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),OT.forEach(t),v1=d(Fo),ut=r(Fo,"DIV",{class:!0});var $o=a(ut);k(Pa.$$.fragment,$o),w1=d($o),un=r($o,"P",{});var qp=a(un);F1=n(qp,"The "),Sc=r(qp,"A",{href:!0});var V4=a(Sc);$1=n(V4,"BertLMHeadModel"),V4.forEach(t),x1=n(qp," forward method, overrides the "),Jh=r(qp,"CODE",{});var K4=a(Jh);B1=n(K4,"__call__"),K4.forEach(t),E1=n(qp," special method."),qp.forEach(t),M1=d($o),k(Fs.$$.fragment,$o),z1=d($o),Gh=r($o,"P",{});var J4=a(Gh);P1=n(J4,"Example:"),J4.forEach(t),q1=d($o),k(qa.$$.fragment,$o),$o.forEach(t),Fo.forEach(t),__=d(i),mn=r(i,"H2",{class:!0});var IT=a(mn);$s=r(IT,"A",{id:!0,class:!0,href:!0});var G4=a($s);Xh=r(G4,"SPAN",{});var X4=a(Xh);k(ja.$$.fragment,X4),X4.forEach(t),G4.forEach(t),j1=d(IT),Yh=r(IT,"SPAN",{});var Y4=a(Yh);C1=n(Y4,"BertForMaskedLM"),Y4.forEach(t),IT.forEach(t),T_=d(i),at=r(i,"DIV",{class:!0});var xo=a(at);k(Ca.$$.fragment,xo),N1=d(xo),Na=r(xo,"P",{});var AT=a(Na);O1=n(AT,"Bert Model with a "),Zh=r(AT,"CODE",{});var Z4=a(Zh);I1=n(Z4,"language modeling"),Z4.forEach(t),A1=n(AT," head on top."),AT.forEach(t),D1=d(xo),Oa=r(xo,"P",{});var DT=a(Oa);L1=n(DT,"This model inherits from "),Uc=r(DT,"A",{href:!0});var eq=a(Uc);S1=n(eq,"PreTrainedModel"),eq.forEach(t),U1=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),W1=d(xo),Ia=r(xo,"P",{});var LT=a(Ia);H1=n(LT,"This model is also a PyTorch "),Aa=r(LT,"A",{href:!0,rel:!0});var tq=a(Aa);R1=n(tq,"torch.nn.Module"),tq.forEach(t),Q1=n(LT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),LT.forEach(t),V1=d(xo),mt=r(xo,"DIV",{class:!0});var Bo=a(mt);k(Da.$$.fragment,Bo),K1=d(Bo),gn=r(Bo,"P",{});var jp=a(gn);J1=n(jp,"The "),Wc=r(jp,"A",{href:!0});var oq=a(Wc);G1=n(oq,"BertForMaskedLM"),oq.forEach(t),X1=n(jp," forward method, overrides the "),ef=r(jp,"CODE",{});var nq=a(ef);Y1=n(nq,"__call__"),nq.forEach(t),Z1=n(jp," special method."),jp.forEach(t),ew=d(Bo),k(xs.$$.fragment,Bo),tw=d(Bo),tf=r(Bo,"P",{});var sq=a(tf);ow=n(sq,"Example:"),sq.forEach(t),nw=d(Bo),k(La.$$.fragment,Bo),Bo.forEach(t),xo.forEach(t),y_=d(i),_n=r(i,"H2",{class:!0});var ST=a(_n);Bs=r(ST,"A",{id:!0,class:!0,href:!0});var rq=a(Bs);of=r(rq,"SPAN",{});var aq=a(of);k(Sa.$$.fragment,aq),aq.forEach(t),rq.forEach(t),sw=d(ST),nf=r(ST,"SPAN",{});var iq=a(nf);rw=n(iq,"BertForNextSentencePrediction"),iq.forEach(t),ST.forEach(t),k_=d(i),it=r(i,"DIV",{class:!0});var Eo=a(it);k(Ua.$$.fragment,Eo),aw=d(Eo),Wa=r(Eo,"P",{});var UT=a(Wa);iw=n(UT,"Bert Model with a "),sf=r(UT,"CODE",{});var lq=a(sf);lw=n(lq,"next sentence prediction (classification)"),lq.forEach(t),dw=n(UT," head on top."),UT.forEach(t),cw=d(Eo),Ha=r(Eo,"P",{});var WT=a(Ha);pw=n(WT,"This model inherits from "),Hc=r(WT,"A",{href:!0});var dq=a(Hc);hw=n(dq,"PreTrainedModel"),dq.forEach(t),fw=n(WT,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),WT.forEach(t),uw=d(Eo),Ra=r(Eo,"P",{});var HT=a(Ra);mw=n(HT,"This model is also a PyTorch "),Qa=r(HT,"A",{href:!0,rel:!0});var cq=a(Qa);gw=n(cq,"torch.nn.Module"),cq.forEach(t),_w=n(HT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),HT.forEach(t),Tw=d(Eo),gt=r(Eo,"DIV",{class:!0});var Mo=a(gt);k(Va.$$.fragment,Mo),yw=d(Mo),Tn=r(Mo,"P",{});var Cp=a(Tn);kw=n(Cp,"The "),Rc=r(Cp,"A",{href:!0});var pq=a(Rc);bw=n(pq,"BertForNextSentencePrediction"),pq.forEach(t),vw=n(Cp," forward method, overrides the "),rf=r(Cp,"CODE",{});var hq=a(rf);ww=n(hq,"__call__"),hq.forEach(t),Fw=n(Cp," special method."),Cp.forEach(t),$w=d(Mo),k(Es.$$.fragment,Mo),xw=d(Mo),af=r(Mo,"P",{});var fq=a(af);Bw=n(fq,"Example:"),fq.forEach(t),Ew=d(Mo),k(Ka.$$.fragment,Mo),Mo.forEach(t),Eo.forEach(t),b_=d(i),yn=r(i,"H2",{class:!0});var RT=a(yn);Ms=r(RT,"A",{id:!0,class:!0,href:!0});var uq=a(Ms);lf=r(uq,"SPAN",{});var mq=a(lf);k(Ja.$$.fragment,mq),mq.forEach(t),uq.forEach(t),Mw=d(RT),df=r(RT,"SPAN",{});var gq=a(df);zw=n(gq,"BertForSequenceClassification"),gq.forEach(t),RT.forEach(t),v_=d(i),lt=r(i,"DIV",{class:!0});var zo=a(lt);k(Ga.$$.fragment,zo),Pw=d(zo),cf=r(zo,"P",{});var _q=a(cf);qw=n(_q,`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.`),_q.forEach(t),jw=d(zo),Xa=r(zo,"P",{});var QT=a(Xa);Cw=n(QT,"This model inherits from "),Qc=r(QT,"A",{href:!0});var Tq=a(Qc);Nw=n(Tq,"PreTrainedModel"),Tq.forEach(t),Ow=n(QT,`. 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.)`),QT.forEach(t),Iw=d(zo),Ya=r(zo,"P",{});var VT=a(Ya);Aw=n(VT,"This model is also a PyTorch "),Za=r(VT,"A",{href:!0,rel:!0});var yq=a(Za);Dw=n(yq,"torch.nn.Module"),yq.forEach(t),Lw=n(VT,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),VT.forEach(t),Sw=d(zo),He=r(zo,"DIV",{class:!0});var Dt=a(He);k(ei.$$.fragment,Dt),Uw=d(Dt),kn=r(Dt,"P",{});var Np=a(kn);Ww=n(Np,"The "),Vc=r(Np,"A",{href:!0});var kq=a(Vc);Hw=n(kq,"BertForSequenceClassification"),kq.forEach(t),Rw=n(Np," forward method, overrides the "),pf=r(Np,"CODE",{});var bq=a(pf);Qw=n(bq,"__call__"),bq.forEach(t),Vw=n(Np," special method."),Np.forEach(t),Kw=d(Dt),k(zs.$$.fragment,Dt),Jw=d(Dt),hf=r(Dt,"P",{});var vq=a(hf);Gw=n(vq,"Example of single-label classification:"),vq.forEach(t),Xw=d(Dt),k(ti.$$.fragment,Dt),Yw=d(Dt),ff=r(Dt,"P",{});var wq=a(ff);Zw=n(wq,"Example of multi-label classification:"),wq.forEach(t),eF=d(Dt),k(oi.$$.fragment,Dt),Dt.forEach(t),zo.forEach(t),w_=d(i),bn=r(i,"H2",{class:!0});var KT=a(bn);Ps=r(KT,"A",{id:!0,class:!0,href:!0});var Fq=a(Ps);uf=r(Fq,"SPAN",{});var $q=a(uf);k(ni.$$.fragment,$q),$q.forEach(t),Fq.forEach(t),tF=d(KT),mf=r(KT,"SPAN",{});var xq=a(mf);oF=n(xq,"BertForMultipleChoice"),xq.forEach(t),KT.forEach(t),F_=d(i),dt=r(i,"DIV",{class:!0});var Po=a(dt);k(si.$$.fragment,Po),nF=d(Po),gf=r(Po,"P",{});var Bq=a(gf);sF=n(Bq,`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.`),Bq.forEach(t),rF=d(Po),ri=r(Po,"P",{});var JT=a(ri);aF=n(JT,"This model inherits from "),Kc=r(JT,"A",{href:!0});var Eq=a(Kc);iF=n(Eq,"PreTrainedModel"),Eq.forEach(t),lF=n(JT,`. 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.)`),JT.forEach(t),dF=d(Po),ai=r(Po,"P",{});var GT=a(ai);cF=n(GT,"This model is also a PyTorch "),ii=r(GT,"A",{href:!0,rel:!0});var Mq=a(ii);pF=n(Mq,"torch.nn.Module"),Mq.forEach(t),hF=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),fF=d(Po),_t=r(Po,"DIV",{class:!0});var qo=a(_t);k(li.$$.fragment,qo),uF=d(qo),vn=r(qo,"P",{});var Op=a(vn);mF=n(Op,"The "),Jc=r(Op,"A",{href:!0});var zq=a(Jc);gF=n(zq,"BertForMultipleChoice"),zq.forEach(t),_F=n(Op," forward method, overrides the "),_f=r(Op,"CODE",{});var Pq=a(_f);TF=n(Pq,"__call__"),Pq.forEach(t),yF=n(Op," special method."),Op.forEach(t),kF=d(qo),k(qs.$$.fragment,qo),bF=d(qo),Tf=r(qo,"P",{});var qq=a(Tf);vF=n(qq,"Example:"),qq.forEach(t),wF=d(qo),k(di.$$.fragment,qo),qo.forEach(t),Po.forEach(t),$_=d(i),wn=r(i,"H2",{class:!0});var XT=a(wn);js=r(XT,"A",{id:!0,class:!0,href:!0});var jq=a(js);yf=r(jq,"SPAN",{});var Cq=a(yf);k(ci.$$.fragment,Cq),Cq.forEach(t),jq.forEach(t),FF=d(XT),kf=r(XT,"SPAN",{});var Nq=a(kf);$F=n(Nq,"BertForTokenClassification"),Nq.forEach(t),XT.forEach(t),x_=d(i),ct=r(i,"DIV",{class:!0});var jo=a(ct);k(pi.$$.fragment,jo),xF=d(jo),bf=r(jo,"P",{});var Oq=a(bf);BF=n(Oq,`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.`),Oq.forEach(t),EF=d(jo),hi=r(jo,"P",{});var YT=a(hi);MF=n(YT,"This model inherits from "),Gc=r(YT,"A",{href:!0});var Iq=a(Gc);zF=n(Iq,"PreTrainedModel"),Iq.forEach(t),PF=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),qF=d(jo),fi=r(jo,"P",{});var ZT=a(fi);jF=n(ZT,"This model is also a PyTorch "),ui=r(ZT,"A",{href:!0,rel:!0});var Aq=a(ui);CF=n(Aq,"torch.nn.Module"),Aq.forEach(t),NF=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),OF=d(jo),Tt=r(jo,"DIV",{class:!0});var Co=a(Tt);k(mi.$$.fragment,Co),IF=d(Co),Fn=r(Co,"P",{});var Ip=a(Fn);AF=n(Ip,"The "),Xc=r(Ip,"A",{href:!0});var Dq=a(Xc);DF=n(Dq,"BertForTokenClassification"),Dq.forEach(t),LF=n(Ip," forward method, overrides the "),vf=r(Ip,"CODE",{});var Lq=a(vf);SF=n(Lq,"__call__"),Lq.forEach(t),UF=n(Ip," special method."),Ip.forEach(t),WF=d(Co),k(Cs.$$.fragment,Co),HF=d(Co),wf=r(Co,"P",{});var Sq=a(wf);RF=n(Sq,"Example:"),Sq.forEach(t),QF=d(Co),k(gi.$$.fragment,Co),Co.forEach(t),jo.forEach(t),B_=d(i),$n=r(i,"H2",{class:!0});var ey=a($n);Ns=r(ey,"A",{id:!0,class:!0,href:!0});var Uq=a(Ns);Ff=r(Uq,"SPAN",{});var Wq=a(Ff);k(_i.$$.fragment,Wq),Wq.forEach(t),Uq.forEach(t),VF=d(ey),$f=r(ey,"SPAN",{});var Hq=a($f);KF=n(Hq,"BertForQuestionAnswering"),Hq.forEach(t),ey.forEach(t),E_=d(i),pt=r(i,"DIV",{class:!0});var No=a(pt);k(Ti.$$.fragment,No),JF=d(No),xn=r(No,"P",{});var Ap=a(xn);GF=n(Ap,`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 `),xf=r(Ap,"CODE",{});var Rq=a(xf);XF=n(Rq,"span start logits"),Rq.forEach(t),YF=n(Ap," and "),Bf=r(Ap,"CODE",{});var Qq=a(Bf);ZF=n(Qq,"span end logits"),Qq.forEach(t),e$=n(Ap,")."),Ap.forEach(t),t$=d(No),yi=r(No,"P",{});var ty=a(yi);o$=n(ty,"This model inherits from "),Yc=r(ty,"A",{href:!0});var Vq=a(Yc);n$=n(Vq,"PreTrainedModel"),Vq.forEach(t),s$=n(ty,`. 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.)`),ty.forEach(t),r$=d(No),ki=r(No,"P",{});var oy=a(ki);a$=n(oy,"This model is also a PyTorch "),bi=r(oy,"A",{href:!0,rel:!0});var Kq=a(bi);i$=n(Kq,"torch.nn.Module"),Kq.forEach(t),l$=n(oy,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),oy.forEach(t),d$=d(No),yt=r(No,"DIV",{class:!0});var Oo=a(yt);k(vi.$$.fragment,Oo),c$=d(Oo),Bn=r(Oo,"P",{});var Dp=a(Bn);p$=n(Dp,"The "),Zc=r(Dp,"A",{href:!0});var Jq=a(Zc);h$=n(Jq,"BertForQuestionAnswering"),Jq.forEach(t),f$=n(Dp," forward method, overrides the "),Ef=r(Dp,"CODE",{});var Gq=a(Ef);u$=n(Gq,"__call__"),Gq.forEach(t),m$=n(Dp," special method."),Dp.forEach(t),g$=d(Oo),k(Os.$$.fragment,Oo),_$=d(Oo),Mf=r(Oo,"P",{});var Xq=a(Mf);T$=n(Xq,"Example:"),Xq.forEach(t),y$=d(Oo),k(wi.$$.fragment,Oo),Oo.forEach(t),No.forEach(t),M_=d(i),En=r(i,"H2",{class:!0});var ny=a(En);Is=r(ny,"A",{id:!0,class:!0,href:!0});var Yq=a(Is);zf=r(Yq,"SPAN",{});var Zq=a(zf);k(Fi.$$.fragment,Zq),Zq.forEach(t),Yq.forEach(t),k$=d(ny),Pf=r(ny,"SPAN",{});var e8=a(Pf);b$=n(e8,"TFBertModel"),e8.forEach(t),ny.forEach(t),z_=d(i),Qe=r(i,"DIV",{class:!0});var Xt=a(Qe);k($i.$$.fragment,Xt),v$=d(Xt),qf=r(Xt,"P",{});var t8=a(qf);w$=n(t8,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),t8.forEach(t),F$=d(Xt),xi=r(Xt,"P",{});var sy=a(xi);$$=n(sy,"This model inherits from "),ep=r(sy,"A",{href:!0});var o8=a(ep);x$=n(o8,"TFPreTrainedModel"),o8.forEach(t),B$=n(sy,`. 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.)`),sy.forEach(t),E$=d(Xt),Bi=r(Xt,"P",{});var ry=a(Bi);M$=n(ry,"This model is also a "),Ei=r(ry,"A",{href:!0,rel:!0});var n8=a(Ei);z$=n(n8,"tf.keras.Model"),n8.forEach(t),P$=n(ry,` 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.`),ry.forEach(t),q$=d(Xt),k(As.$$.fragment,Xt),j$=d(Xt),kt=r(Xt,"DIV",{class:!0});var Io=a(kt);k(Mi.$$.fragment,Io),C$=d(Io),Mn=r(Io,"P",{});var Lp=a(Mn);N$=n(Lp,"The "),tp=r(Lp,"A",{href:!0});var s8=a(tp);O$=n(s8,"TFBertModel"),s8.forEach(t),I$=n(Lp," forward method, overrides the "),jf=r(Lp,"CODE",{});var r8=a(jf);A$=n(r8,"__call__"),r8.forEach(t),D$=n(Lp," special method."),Lp.forEach(t),L$=d(Io),k(Ds.$$.fragment,Io),S$=d(Io),Cf=r(Io,"P",{});var a8=a(Cf);U$=n(a8,"Example:"),a8.forEach(t),W$=d(Io),k(zi.$$.fragment,Io),Io.forEach(t),Xt.forEach(t),P_=d(i),zn=r(i,"H2",{class:!0});var ay=a(zn);Ls=r(ay,"A",{id:!0,class:!0,href:!0});var i8=a(Ls);Nf=r(i8,"SPAN",{});var l8=a(Nf);k(Pi.$$.fragment,l8),l8.forEach(t),i8.forEach(t),H$=d(ay),Of=r(ay,"SPAN",{});var d8=a(Of);R$=n(d8,"TFBertForPreTraining"),d8.forEach(t),ay.forEach(t),q_=d(i),Ve=r(i,"DIV",{class:!0});var Yt=a(Ve);k(qi.$$.fragment,Yt),Q$=d(Yt),Pn=r(Yt,"P",{});var Sp=a(Pn);V$=n(Sp,`Bert Model with two heads on top as done during the pretraining:
a `),If=r(Sp,"CODE",{});var c8=a(If);K$=n(c8,"masked language modeling"),c8.forEach(t),J$=n(Sp," head and a "),Af=r(Sp,"CODE",{});var p8=a(Af);G$=n(p8,"next sentence prediction (classification)"),p8.forEach(t),X$=n(Sp," head."),Sp.forEach(t),Y$=d(Yt),ji=r(Yt,"P",{});var iy=a(ji);Z$=n(iy,"This model inherits from "),op=r(iy,"A",{href:!0});var h8=a(op);e2=n(h8,"TFPreTrainedModel"),h8.forEach(t),t2=n(iy,`. 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.)`),iy.forEach(t),o2=d(Yt),Ci=r(Yt,"P",{});var ly=a(Ci);n2=n(ly,"This model is also a "),Ni=r(ly,"A",{href:!0,rel:!0});var f8=a(Ni);s2=n(f8,"tf.keras.Model"),f8.forEach(t),r2=n(ly,` 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.`),ly.forEach(t),a2=d(Yt),k(Ss.$$.fragment,Yt),i2=d(Yt),bt=r(Yt,"DIV",{class:!0});var Ao=a(bt);k(Oi.$$.fragment,Ao),l2=d(Ao),qn=r(Ao,"P",{});var Up=a(qn);d2=n(Up,"The "),np=r(Up,"A",{href:!0});var u8=a(np);c2=n(u8,"TFBertForPreTraining"),u8.forEach(t),p2=n(Up," forward method, overrides the "),Df=r(Up,"CODE",{});var m8=a(Df);h2=n(m8,"__call__"),m8.forEach(t),f2=n(Up," special method."),Up.forEach(t),u2=d(Ao),k(Us.$$.fragment,Ao),m2=d(Ao),Lf=r(Ao,"P",{});var g8=a(Lf);g2=n(g8,"Examples:"),g8.forEach(t),_2=d(Ao),k(Ii.$$.fragment,Ao),Ao.forEach(t),Yt.forEach(t),j_=d(i),jn=r(i,"H2",{class:!0});var dy=a(jn);Ws=r(dy,"A",{id:!0,class:!0,href:!0});var _8=a(Ws);Sf=r(_8,"SPAN",{});var T8=a(Sf);k(Ai.$$.fragment,T8),T8.forEach(t),_8.forEach(t),T2=d(dy),Uf=r(dy,"SPAN",{});var y8=a(Uf);y2=n(y8,"TFBertModelLMHeadModel"),y8.forEach(t),dy.forEach(t),C_=d(i),Cn=r(i,"DIV",{class:!0});var cy=a(Cn);k(Di.$$.fragment,cy),k2=d(cy),et=r(cy,"DIV",{class:!0});var Zt=a(et);k(Li.$$.fragment,Zt),b2=d(Zt),Ne=r(Zt,"P",{});var tt=a(Ne);v2=n(tt,"encoder_hidden_states  ("),Wf=r(tt,"CODE",{});var k8=a(Wf);w2=n(k8,"tf.Tensor"),k8.forEach(t),F2=n(tt," of shape "),Hf=r(tt,"CODE",{});var b8=a(Hf);$2=n(b8,"(batch_size, sequence_length, hidden_size)"),b8.forEach(t),x2=n(tt,", "),Rf=r(tt,"EM",{});var v8=a(Rf);B2=n(v8,"optional"),v8.forEach(t),E2=n(tt,`):
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 (`),Qf=r(tt,"CODE",{});var w8=a(Qf);M2=n(w8,"tf.Tensor"),w8.forEach(t),z2=n(tt," of shape "),Vf=r(tt,"CODE",{});var F8=a(Vf);P2=n(F8,"(batch_size, sequence_length)"),F8.forEach(t),q2=n(tt,", "),Kf=r(tt,"EM",{});var $8=a(Kf);j2=n($8,"optional"),$8.forEach(t),C2=n(tt,`):
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 `),Jf=r(tt,"CODE",{});var x8=a(Jf);N2=n(x8,"[0, 1]"),x8.forEach(t),O2=n(tt,":"),tt.forEach(t),I2=d(Zt),Si=r(Zt,"UL",{});var py=a(Si);Ui=r(py,"LI",{});var hy=a(Ui);A2=n(hy,"1 for tokens that are "),Gf=r(hy,"STRONG",{});var B8=a(Gf);D2=n(B8,"not masked"),B8.forEach(t),L2=n(hy,","),hy.forEach(t),S2=d(py),Wi=r(py,"LI",{});var fy=a(Wi);U2=n(fy,"0 for tokens that are "),Xf=r(fy,"STRONG",{});var E8=a(Xf);W2=n(E8,"masked"),E8.forEach(t),H2=n(fy,"."),fy.forEach(t),py.forEach(t),R2=d(Zt),G=r(Zt,"P",{});var Z=a(G);Q2=n(Z,"past_key_values ("),Yf=r(Z,"CODE",{});var M8=a(Yf);V2=n(M8,"Tuple[Tuple[tf.Tensor]]"),M8.forEach(t),K2=n(Z," of length "),Zf=r(Z,"CODE",{});var z8=a(Zf);J2=n(z8,"config.n_layers"),z8.forEach(t),G2=n(Z,`)
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),eu=r(Z,"CODE",{});var P8=a(eu);X2=n(P8,"past_key_values"),P8.forEach(t),Y2=n(Z," are used, the user can optionally input only the last "),tu=r(Z,"CODE",{});var q8=a(tu);Z2=n(q8,"decoder_input_ids"),q8.forEach(t),e0=n(Z,` (those that
don\u2019t have their past key value states given to this model) of shape `),ou=r(Z,"CODE",{});var j8=a(ou);t0=n(j8,"(batch_size, 1)"),j8.forEach(t),o0=n(Z,` instead of all
`),nu=r(Z,"CODE",{});var C8=a(nu);n0=n(C8,"decoder_input_ids"),C8.forEach(t),s0=n(Z," of shape "),su=r(Z,"CODE",{});var N8=a(su);r0=n(N8,"(batch_size, sequence_length)"),N8.forEach(t),a0=n(Z,`.
use_cache (`),ru=r(Z,"CODE",{});var O8=a(ru);i0=n(O8,"bool"),O8.forEach(t),l0=n(Z,", "),au=r(Z,"EM",{});var I8=a(au);d0=n(I8,"optional"),I8.forEach(t),c0=n(Z,", defaults to "),iu=r(Z,"CODE",{});var A8=a(iu);p0=n(A8,"True"),A8.forEach(t),h0=n(Z,`):
If set to `),lu=r(Z,"CODE",{});var D8=a(lu);f0=n(D8,"True"),D8.forEach(t),u0=n(Z,", "),du=r(Z,"CODE",{});var L8=a(du);m0=n(L8,"past_key_values"),L8.forEach(t),g0=n(Z,` key value states are returned and can be used to speed up decoding (see
`),cu=r(Z,"CODE",{});var S8=a(cu);_0=n(S8,"past_key_values"),S8.forEach(t),T0=n(Z,"). Set to "),pu=r(Z,"CODE",{});var U8=a(pu);y0=n(U8,"False"),U8.forEach(t),k0=n(Z," during training, "),hu=r(Z,"CODE",{});var W8=a(hu);b0=n(W8,"True"),W8.forEach(t),v0=n(Z,` during generation
labels (`),fu=r(Z,"CODE",{});var H8=a(fu);w0=n(H8,"tf.Tensor"),H8.forEach(t),F0=n(Z," or "),uu=r(Z,"CODE",{});var R8=a(uu);$0=n(R8,"np.ndarray"),R8.forEach(t),x0=n(Z," of shape "),mu=r(Z,"CODE",{});var Q8=a(mu);B0=n(Q8,"(batch_size, sequence_length)"),Q8.forEach(t),E0=n(Z,", "),gu=r(Z,"EM",{});var V8=a(gu);M0=n(V8,"optional"),V8.forEach(t),z0=n(Z,`):
Labels for computing the cross entropy classification loss. Indices should be in `),_u=r(Z,"CODE",{});var K8=a(_u);P0=n(K8,"[0, ..., config.vocab_size - 1]"),K8.forEach(t),q0=n(Z,"."),Z.forEach(t),j0=d(Zt),Tu=r(Zt,"P",{});var J8=a(Tu);C0=n(J8,"Example:"),J8.forEach(t),N0=d(Zt),k(Hi.$$.fragment,Zt),Zt.forEach(t),cy.forEach(t),N_=d(i),Nn=r(i,"H2",{class:!0});var uy=a(Nn);Hs=r(uy,"A",{id:!0,class:!0,href:!0});var G8=a(Hs);yu=r(G8,"SPAN",{});var X8=a(yu);k(Ri.$$.fragment,X8),X8.forEach(t),G8.forEach(t),O0=d(uy),ku=r(uy,"SPAN",{});var Y8=a(ku);I0=n(Y8,"TFBertForMaskedLM"),Y8.forEach(t),uy.forEach(t),O_=d(i),Ke=r(i,"DIV",{class:!0});var eo=a(Ke);k(Qi.$$.fragment,eo),A0=d(eo),Vi=r(eo,"P",{});var my=a(Vi);D0=n(my,"Bert Model with a "),bu=r(my,"CODE",{});var Z8=a(bu);L0=n(Z8,"language modeling"),Z8.forEach(t),S0=n(my," head on top."),my.forEach(t),U0=d(eo),Ki=r(eo,"P",{});var gy=a(Ki);W0=n(gy,"This model inherits from "),sp=r(gy,"A",{href:!0});var e9=a(sp);H0=n(e9,"TFPreTrainedModel"),e9.forEach(t),R0=n(gy,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),gy.forEach(t),Q0=d(eo),Ji=r(eo,"P",{});var _y=a(Ji);V0=n(_y,"This model is also a "),Gi=r(_y,"A",{href:!0,rel:!0});var t9=a(Gi);K0=n(t9,"tf.keras.Model"),t9.forEach(t),J0=n(_y,` 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.`),_y.forEach(t),G0=d(eo),k(Rs.$$.fragment,eo),X0=d(eo),vt=r(eo,"DIV",{class:!0});var Do=a(vt);k(Xi.$$.fragment,Do),Y0=d(Do),On=r(Do,"P",{});var Wp=a(On);Z0=n(Wp,"The "),rp=r(Wp,"A",{href:!0});var o9=a(rp);ex=n(o9,"TFBertForMaskedLM"),o9.forEach(t),tx=n(Wp," forward method, overrides the "),vu=r(Wp,"CODE",{});var n9=a(vu);ox=n(n9,"__call__"),n9.forEach(t),nx=n(Wp," special method."),Wp.forEach(t),sx=d(Do),k(Qs.$$.fragment,Do),rx=d(Do),wu=r(Do,"P",{});var s9=a(wu);ax=n(s9,"Example:"),s9.forEach(t),ix=d(Do),k(Yi.$$.fragment,Do),Do.forEach(t),eo.forEach(t),I_=d(i),In=r(i,"H2",{class:!0});var Ty=a(In);Vs=r(Ty,"A",{id:!0,class:!0,href:!0});var r9=a(Vs);Fu=r(r9,"SPAN",{});var a9=a(Fu);k(Zi.$$.fragment,a9),a9.forEach(t),r9.forEach(t),lx=d(Ty),$u=r(Ty,"SPAN",{});var i9=a($u);dx=n(i9,"TFBertForNextSentencePrediction"),i9.forEach(t),Ty.forEach(t),A_=d(i),Je=r(i,"DIV",{class:!0});var to=a(Je);k(el.$$.fragment,to),cx=d(to),tl=r(to,"P",{});var yy=a(tl);px=n(yy,"Bert Model with a "),xu=r(yy,"CODE",{});var l9=a(xu);hx=n(l9,"next sentence prediction (classification)"),l9.forEach(t),fx=n(yy," head on top."),yy.forEach(t),ux=d(to),ol=r(to,"P",{});var ky=a(ol);mx=n(ky,"This model inherits from "),ap=r(ky,"A",{href:!0});var d9=a(ap);gx=n(d9,"TFPreTrainedModel"),d9.forEach(t),_x=n(ky,`. 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.)`),ky.forEach(t),Tx=d(to),nl=r(to,"P",{});var by=a(nl);yx=n(by,"This model is also a "),sl=r(by,"A",{href:!0,rel:!0});var c9=a(sl);kx=n(c9,"tf.keras.Model"),c9.forEach(t),bx=n(by,` 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.`),by.forEach(t),vx=d(to),k(Ks.$$.fragment,to),wx=d(to),wt=r(to,"DIV",{class:!0});var Lo=a(wt);k(rl.$$.fragment,Lo),Fx=d(Lo),An=r(Lo,"P",{});var Hp=a(An);$x=n(Hp,"The "),ip=r(Hp,"A",{href:!0});var p9=a(ip);xx=n(p9,"TFBertForNextSentencePrediction"),p9.forEach(t),Bx=n(Hp," forward method, overrides the "),Bu=r(Hp,"CODE",{});var h9=a(Bu);Ex=n(h9,"__call__"),h9.forEach(t),Mx=n(Hp," special method."),Hp.forEach(t),zx=d(Lo),k(Js.$$.fragment,Lo),Px=d(Lo),Eu=r(Lo,"P",{});var f9=a(Eu);qx=n(f9,"Examples:"),f9.forEach(t),jx=d(Lo),k(al.$$.fragment,Lo),Lo.forEach(t),to.forEach(t),D_=d(i),Dn=r(i,"H2",{class:!0});var vy=a(Dn);Gs=r(vy,"A",{id:!0,class:!0,href:!0});var u9=a(Gs);Mu=r(u9,"SPAN",{});var m9=a(Mu);k(il.$$.fragment,m9),m9.forEach(t),u9.forEach(t),Cx=d(vy),zu=r(vy,"SPAN",{});var g9=a(zu);Nx=n(g9,"TFBertForSequenceClassification"),g9.forEach(t),vy.forEach(t),L_=d(i),Ge=r(i,"DIV",{class:!0});var oo=a(Ge);k(ll.$$.fragment,oo),Ox=d(oo),Pu=r(oo,"P",{});var _9=a(Pu);Ix=n(_9,`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.`),_9.forEach(t),Ax=d(oo),dl=r(oo,"P",{});var wy=a(dl);Dx=n(wy,"This model inherits from "),lp=r(wy,"A",{href:!0});var T9=a(lp);Lx=n(T9,"TFPreTrainedModel"),T9.forEach(t),Sx=n(wy,`. 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.)`),wy.forEach(t),Ux=d(oo),cl=r(oo,"P",{});var Fy=a(cl);Wx=n(Fy,"This model is also a "),pl=r(Fy,"A",{href:!0,rel:!0});var y9=a(pl);Hx=n(y9,"tf.keras.Model"),y9.forEach(t),Rx=n(Fy,` 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.`),Fy.forEach(t),Qx=d(oo),k(Xs.$$.fragment,oo),Vx=d(oo),Ft=r(oo,"DIV",{class:!0});var So=a(Ft);k(hl.$$.fragment,So),Kx=d(So),Ln=r(So,"P",{});var Rp=a(Ln);Jx=n(Rp,"The "),dp=r(Rp,"A",{href:!0});var k9=a(dp);Gx=n(k9,"TFBertForSequenceClassification"),k9.forEach(t),Xx=n(Rp," forward method, overrides the "),qu=r(Rp,"CODE",{});var b9=a(qu);Yx=n(b9,"__call__"),b9.forEach(t),Zx=n(Rp," special method."),Rp.forEach(t),eB=d(So),k(Ys.$$.fragment,So),tB=d(So),ju=r(So,"P",{});var v9=a(ju);oB=n(v9,"Example:"),v9.forEach(t),nB=d(So),k(fl.$$.fragment,So),So.forEach(t),oo.forEach(t),S_=d(i),Sn=r(i,"H2",{class:!0});var $y=a(Sn);Zs=r($y,"A",{id:!0,class:!0,href:!0});var w9=a(Zs);Cu=r(w9,"SPAN",{});var F9=a(Cu);k(ul.$$.fragment,F9),F9.forEach(t),w9.forEach(t),sB=d($y),Nu=r($y,"SPAN",{});var $9=a(Nu);rB=n($9,"TFBertForMultipleChoice"),$9.forEach(t),$y.forEach(t),U_=d(i),Xe=r(i,"DIV",{class:!0});var no=a(Xe);k(ml.$$.fragment,no),aB=d(no),Ou=r(no,"P",{});var x9=a(Ou);iB=n(x9,`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.`),x9.forEach(t),lB=d(no),gl=r(no,"P",{});var xy=a(gl);dB=n(xy,"This model inherits from "),cp=r(xy,"A",{href:!0});var B9=a(cp);cB=n(B9,"TFPreTrainedModel"),B9.forEach(t),pB=n(xy,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),xy.forEach(t),hB=d(no),_l=r(no,"P",{});var By=a(_l);fB=n(By,"This model is also a "),Tl=r(By,"A",{href:!0,rel:!0});var E9=a(Tl);uB=n(E9,"tf.keras.Model"),E9.forEach(t),mB=n(By,` 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.`),By.forEach(t),gB=d(no),k(er.$$.fragment,no),_B=d(no),$t=r(no,"DIV",{class:!0});var Uo=a($t);k(yl.$$.fragment,Uo),TB=d(Uo),Un=r(Uo,"P",{});var Qp=a(Un);yB=n(Qp,"The "),pp=r(Qp,"A",{href:!0});var M9=a(pp);kB=n(M9,"TFBertForMultipleChoice"),M9.forEach(t),bB=n(Qp," forward method, overrides the "),Iu=r(Qp,"CODE",{});var z9=a(Iu);vB=n(z9,"__call__"),z9.forEach(t),wB=n(Qp," special method."),Qp.forEach(t),FB=d(Uo),k(tr.$$.fragment,Uo),$B=d(Uo),Au=r(Uo,"P",{});var P9=a(Au);xB=n(P9,"Example:"),P9.forEach(t),BB=d(Uo),k(kl.$$.fragment,Uo),Uo.forEach(t),no.forEach(t),W_=d(i),Wn=r(i,"H2",{class:!0});var Ey=a(Wn);or=r(Ey,"A",{id:!0,class:!0,href:!0});var q9=a(or);Du=r(q9,"SPAN",{});var j9=a(Du);k(bl.$$.fragment,j9),j9.forEach(t),q9.forEach(t),EB=d(Ey),Lu=r(Ey,"SPAN",{});var C9=a(Lu);MB=n(C9,"TFBertForTokenClassification"),C9.forEach(t),Ey.forEach(t),H_=d(i),Ye=r(i,"DIV",{class:!0});var so=a(Ye);k(vl.$$.fragment,so),zB=d(so),Su=r(so,"P",{});var N9=a(Su);PB=n(N9,`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.`),N9.forEach(t),qB=d(so),wl=r(so,"P",{});var My=a(wl);jB=n(My,"This model inherits from "),hp=r(My,"A",{href:!0});var O9=a(hp);CB=n(O9,"TFPreTrainedModel"),O9.forEach(t),NB=n(My,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),My.forEach(t),OB=d(so),Fl=r(so,"P",{});var zy=a(Fl);IB=n(zy,"This model is also a "),$l=r(zy,"A",{href:!0,rel:!0});var I9=a($l);AB=n(I9,"tf.keras.Model"),I9.forEach(t),DB=n(zy,` 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.`),zy.forEach(t),LB=d(so),k(nr.$$.fragment,so),SB=d(so),xt=r(so,"DIV",{class:!0});var Wo=a(xt);k(xl.$$.fragment,Wo),UB=d(Wo),Hn=r(Wo,"P",{});var Vp=a(Hn);WB=n(Vp,"The "),fp=r(Vp,"A",{href:!0});var A9=a(fp);HB=n(A9,"TFBertForTokenClassification"),A9.forEach(t),RB=n(Vp," forward method, overrides the "),Uu=r(Vp,"CODE",{});var D9=a(Uu);QB=n(D9,"__call__"),D9.forEach(t),VB=n(Vp," special method."),Vp.forEach(t),KB=d(Wo),k(sr.$$.fragment,Wo),JB=d(Wo),Wu=r(Wo,"P",{});var L9=a(Wu);GB=n(L9,"Example:"),L9.forEach(t),XB=d(Wo),k(Bl.$$.fragment,Wo),Wo.forEach(t),so.forEach(t),R_=d(i),Rn=r(i,"H2",{class:!0});var Py=a(Rn);rr=r(Py,"A",{id:!0,class:!0,href:!0});var S9=a(rr);Hu=r(S9,"SPAN",{});var U9=a(Hu);k(El.$$.fragment,U9),U9.forEach(t),S9.forEach(t),YB=d(Py),Ru=r(Py,"SPAN",{});var W9=a(Ru);ZB=n(W9,"TFBertForQuestionAnswering"),W9.forEach(t),Py.forEach(t),Q_=d(i),Ze=r(i,"DIV",{class:!0});var ro=a(Ze);k(Ml.$$.fragment,ro),eE=d(ro),Qn=r(ro,"P",{});var Kp=a(Qn);tE=n(Kp,`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 `),Qu=r(Kp,"CODE",{});var H9=a(Qu);oE=n(H9,"span start logits"),H9.forEach(t),nE=n(Kp," and "),Vu=r(Kp,"CODE",{});var R9=a(Vu);sE=n(R9,"span end logits"),R9.forEach(t),rE=n(Kp,")."),Kp.forEach(t),aE=d(ro),zl=r(ro,"P",{});var qy=a(zl);iE=n(qy,"This model inherits from "),up=r(qy,"A",{href:!0});var Q9=a(up);lE=n(Q9,"TFPreTrainedModel"),Q9.forEach(t),dE=n(qy,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),qy.forEach(t),cE=d(ro),Pl=r(ro,"P",{});var jy=a(Pl);pE=n(jy,"This model is also a "),ql=r(jy,"A",{href:!0,rel:!0});var V9=a(ql);hE=n(V9,"tf.keras.Model"),V9.forEach(t),fE=n(jy,` 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.`),jy.forEach(t),uE=d(ro),k(ar.$$.fragment,ro),mE=d(ro),Bt=r(ro,"DIV",{class:!0});var Ho=a(Bt);k(jl.$$.fragment,Ho),gE=d(Ho),Vn=r(Ho,"P",{});var Jp=a(Vn);_E=n(Jp,"The "),mp=r(Jp,"A",{href:!0});var K9=a(mp);TE=n(K9,"TFBertForQuestionAnswering"),K9.forEach(t),yE=n(Jp," forward method, overrides the "),Ku=r(Jp,"CODE",{});var J9=a(Ku);kE=n(J9,"__call__"),J9.forEach(t),bE=n(Jp," special method."),Jp.forEach(t),vE=d(Ho),k(ir.$$.fragment,Ho),wE=d(Ho),Ju=r(Ho,"P",{});var G9=a(Ju);FE=n(G9,"Example:"),G9.forEach(t),$E=d(Ho),k(Cl.$$.fragment,Ho),Ho.forEach(t),ro.forEach(t),V_=d(i),Kn=r(i,"H2",{class:!0});var Cy=a(Kn);lr=r(Cy,"A",{id:!0,class:!0,href:!0});var X9=a(lr);Gu=r(X9,"SPAN",{});var Y9=a(Gu);k(Nl.$$.fragment,Y9),Y9.forEach(t),X9.forEach(t),xE=d(Cy),Xu=r(Cy,"SPAN",{});var Z9=a(Xu);BE=n(Z9,"FlaxBertModel"),Z9.forEach(t),Cy.forEach(t),K_=d(i),Oe=r(i,"DIV",{class:!0});var Lt=a(Oe);k(Ol.$$.fragment,Lt),EE=d(Lt),Yu=r(Lt,"P",{});var ej=a(Yu);ME=n(ej,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),ej.forEach(t),zE=d(Lt),Il=r(Lt,"P",{});var Ny=a(Il);PE=n(Ny,"This model inherits from "),gp=r(Ny,"A",{href:!0});var tj=a(gp);qE=n(tj,"FlaxPreTrainedModel"),tj.forEach(t),jE=n(Ny,`. 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)`),Ny.forEach(t),CE=d(Lt),Al=r(Lt,"P",{});var Oy=a(Al);NE=n(Oy,"This model is also a Flax Linen "),Dl=r(Oy,"A",{href:!0,rel:!0});var oj=a(Dl);OE=n(oj,"flax.linen.Module"),oj.forEach(t),IE=n(Oy,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Oy.forEach(t),AE=d(Lt),Zu=r(Lt,"P",{});var nj=a(Zu);DE=n(nj,"Finally, this model supports inherent JAX features such as:"),nj.forEach(t),LE=d(Lt),lo=r(Lt,"UL",{});var xr=a(lo);em=r(xr,"LI",{});var sj=a(em);Ll=r(sj,"A",{href:!0,rel:!0});var rj=a(Ll);SE=n(rj,"Just-In-Time (JIT) compilation"),rj.forEach(t),sj.forEach(t),UE=d(xr),tm=r(xr,"LI",{});var aj=a(tm);Sl=r(aj,"A",{href:!0,rel:!0});var ij=a(Sl);WE=n(ij,"Automatic Differentiation"),ij.forEach(t),aj.forEach(t),HE=d(xr),om=r(xr,"LI",{});var lj=a(om);Ul=r(lj,"A",{href:!0,rel:!0});var dj=a(Ul);RE=n(dj,"Vectorization"),dj.forEach(t),lj.forEach(t),QE=d(xr),nm=r(xr,"LI",{});var cj=a(nm);Wl=r(cj,"A",{href:!0,rel:!0});var pj=a(Wl);VE=n(pj,"Parallelization"),pj.forEach(t),cj.forEach(t),xr.forEach(t),KE=d(Lt),Et=r(Lt,"DIV",{class:!0});var Ro=a(Et);k(Hl.$$.fragment,Ro),JE=d(Ro),Jn=r(Ro,"P",{});var Gp=a(Jn);GE=n(Gp,"The "),sm=r(Gp,"CODE",{});var hj=a(sm);XE=n(hj,"FlaxBertPreTrainedModel"),hj.forEach(t),YE=n(Gp,"forward method, overrides the "),rm=r(Gp,"CODE",{});var fj=a(rm);ZE=n(fj,"__call__"),fj.forEach(t),eM=n(Gp," special method."),Gp.forEach(t),tM=d(Ro),k(dr.$$.fragment,Ro),oM=d(Ro),am=r(Ro,"P",{});var uj=a(am);nM=n(uj,"Example:"),uj.forEach(t),sM=d(Ro),k(Rl.$$.fragment,Ro),Ro.forEach(t),Lt.forEach(t),J_=d(i),Gn=r(i,"H2",{class:!0});var Iy=a(Gn);cr=r(Iy,"A",{id:!0,class:!0,href:!0});var mj=a(cr);im=r(mj,"SPAN",{});var gj=a(im);k(Ql.$$.fragment,gj),gj.forEach(t),mj.forEach(t),rM=d(Iy),lm=r(Iy,"SPAN",{});var _j=a(lm);aM=n(_j,"FlaxBertForPreTraining"),_j.forEach(t),Iy.forEach(t),G_=d(i),Ie=r(i,"DIV",{class:!0});var St=a(Ie);k(Vl.$$.fragment,St),iM=d(St),Xn=r(St,"P",{});var Xp=a(Xn);lM=n(Xp,"Bert Model with two heads on top as done during the pretraining: a "),dm=r(Xp,"CODE",{});var Tj=a(dm);dM=n(Tj,"masked language modeling"),Tj.forEach(t),cM=n(Xp," head and a "),cm=r(Xp,"CODE",{});var yj=a(cm);pM=n(yj,"next sentence prediction (classification)"),yj.forEach(t),hM=n(Xp," head."),Xp.forEach(t),fM=d(St),Kl=r(St,"P",{});var Ay=a(Kl);uM=n(Ay,"This model inherits from "),_p=r(Ay,"A",{href:!0});var kj=a(_p);mM=n(kj,"FlaxPreTrainedModel"),kj.forEach(t),gM=n(Ay,`. 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)`),Ay.forEach(t),_M=d(St),Jl=r(St,"P",{});var Dy=a(Jl);TM=n(Dy,"This model is also a Flax Linen "),Gl=r(Dy,"A",{href:!0,rel:!0});var bj=a(Gl);yM=n(bj,"flax.linen.Module"),bj.forEach(t),kM=n(Dy,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Dy.forEach(t),bM=d(St),pm=r(St,"P",{});var vj=a(pm);vM=n(vj,"Finally, this model supports inherent JAX features such as:"),vj.forEach(t),wM=d(St),co=r(St,"UL",{});var Br=a(co);hm=r(Br,"LI",{});var wj=a(hm);Xl=r(wj,"A",{href:!0,rel:!0});var Fj=a(Xl);FM=n(Fj,"Just-In-Time (JIT) compilation"),Fj.forEach(t),wj.forEach(t),$M=d(Br),fm=r(Br,"LI",{});var $j=a(fm);Yl=r($j,"A",{href:!0,rel:!0});var xj=a(Yl);xM=n(xj,"Automatic Differentiation"),xj.forEach(t),$j.forEach(t),BM=d(Br),um=r(Br,"LI",{});var Bj=a(um);Zl=r(Bj,"A",{href:!0,rel:!0});var Ej=a(Zl);EM=n(Ej,"Vectorization"),Ej.forEach(t),Bj.forEach(t),MM=d(Br),mm=r(Br,"LI",{});var Mj=a(mm);ed=r(Mj,"A",{href:!0,rel:!0});var zj=a(ed);zM=n(zj,"Parallelization"),zj.forEach(t),Mj.forEach(t),Br.forEach(t),PM=d(St),Mt=r(St,"DIV",{class:!0});var Qo=a(Mt);k(td.$$.fragment,Qo),qM=d(Qo),Yn=r(Qo,"P",{});var Yp=a(Yn);jM=n(Yp,"The "),gm=r(Yp,"CODE",{});var Pj=a(gm);CM=n(Pj,"FlaxBertPreTrainedModel"),Pj.forEach(t),NM=n(Yp,"forward method, overrides the "),_m=r(Yp,"CODE",{});var qj=a(_m);OM=n(qj,"__call__"),qj.forEach(t),IM=n(Yp," special method."),Yp.forEach(t),AM=d(Qo),k(pr.$$.fragment,Qo),DM=d(Qo),Tm=r(Qo,"P",{});var jj=a(Tm);LM=n(jj,"Example:"),jj.forEach(t),SM=d(Qo),k(od.$$.fragment,Qo),Qo.forEach(t),St.forEach(t),X_=d(i),Zn=r(i,"H2",{class:!0});var Ly=a(Zn);hr=r(Ly,"A",{id:!0,class:!0,href:!0});var Cj=a(hr);ym=r(Cj,"SPAN",{});var Nj=a(ym);k(nd.$$.fragment,Nj),Nj.forEach(t),Cj.forEach(t),UM=d(Ly),km=r(Ly,"SPAN",{});var Oj=a(km);WM=n(Oj,"FlaxBertForMaskedLM"),Oj.forEach(t),Ly.forEach(t),Y_=d(i),Ae=r(i,"DIV",{class:!0});var Ut=a(Ae);k(sd.$$.fragment,Ut),HM=d(Ut),rd=r(Ut,"P",{});var Sy=a(rd);RM=n(Sy,"Bert Model with a "),bm=r(Sy,"CODE",{});var Ij=a(bm);QM=n(Ij,"language modeling"),Ij.forEach(t),VM=n(Sy," head on top."),Sy.forEach(t),KM=d(Ut),ad=r(Ut,"P",{});var Uy=a(ad);JM=n(Uy,"This model inherits from "),Tp=r(Uy,"A",{href:!0});var Aj=a(Tp);GM=n(Aj,"FlaxPreTrainedModel"),Aj.forEach(t),XM=n(Uy,`. 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)`),Uy.forEach(t),YM=d(Ut),id=r(Ut,"P",{});var Wy=a(id);ZM=n(Wy,"This model is also a Flax Linen "),ld=r(Wy,"A",{href:!0,rel:!0});var Dj=a(ld);e3=n(Dj,"flax.linen.Module"),Dj.forEach(t),t3=n(Wy,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Wy.forEach(t),o3=d(Ut),vm=r(Ut,"P",{});var Lj=a(vm);n3=n(Lj,"Finally, this model supports inherent JAX features such as:"),Lj.forEach(t),s3=d(Ut),po=r(Ut,"UL",{});var Er=a(po);wm=r(Er,"LI",{});var Sj=a(wm);dd=r(Sj,"A",{href:!0,rel:!0});var Uj=a(dd);r3=n(Uj,"Just-In-Time (JIT) compilation"),Uj.forEach(t),Sj.forEach(t),a3=d(Er),Fm=r(Er,"LI",{});var Wj=a(Fm);cd=r(Wj,"A",{href:!0,rel:!0});var Hj=a(cd);i3=n(Hj,"Automatic Differentiation"),Hj.forEach(t),Wj.forEach(t),l3=d(Er),$m=r(Er,"LI",{});var Rj=a($m);pd=r(Rj,"A",{href:!0,rel:!0});var Qj=a(pd);d3=n(Qj,"Vectorization"),Qj.forEach(t),Rj.forEach(t),c3=d(Er),xm=r(Er,"LI",{});var Vj=a(xm);hd=r(Vj,"A",{href:!0,rel:!0});var Kj=a(hd);p3=n(Kj,"Parallelization"),Kj.forEach(t),Vj.forEach(t),Er.forEach(t),h3=d(Ut),zt=r(Ut,"DIV",{class:!0});var Vo=a(zt);k(fd.$$.fragment,Vo),f3=d(Vo),es=r(Vo,"P",{});var Zp=a(es);u3=n(Zp,"The "),Bm=r(Zp,"CODE",{});var Jj=a(Bm);m3=n(Jj,"FlaxBertPreTrainedModel"),Jj.forEach(t),g3=n(Zp,"forward method, overrides the "),Em=r(Zp,"CODE",{});var Gj=a(Em);_3=n(Gj,"__call__"),Gj.forEach(t),T3=n(Zp," special method."),Zp.forEach(t),y3=d(Vo),k(fr.$$.fragment,Vo),k3=d(Vo),Mm=r(Vo,"P",{});var Xj=a(Mm);b3=n(Xj,"Example:"),Xj.forEach(t),v3=d(Vo),k(ud.$$.fragment,Vo),Vo.forEach(t),Ut.forEach(t),Z_=d(i),ts=r(i,"H2",{class:!0});var Hy=a(ts);ur=r(Hy,"A",{id:!0,class:!0,href:!0});var Yj=a(ur);zm=r(Yj,"SPAN",{});var Zj=a(zm);k(md.$$.fragment,Zj),Zj.forEach(t),Yj.forEach(t),w3=d(Hy),Pm=r(Hy,"SPAN",{});var eC=a(Pm);F3=n(eC,"FlaxBertForNextSentencePrediction"),eC.forEach(t),Hy.forEach(t),eT=d(i),De=r(i,"DIV",{class:!0});var Wt=a(De);k(gd.$$.fragment,Wt),$3=d(Wt),_d=r(Wt,"P",{});var Ry=a(_d);x3=n(Ry,"Bert Model with a "),qm=r(Ry,"CODE",{});var tC=a(qm);B3=n(tC,"next sentence prediction (classification)"),tC.forEach(t),E3=n(Ry," head on top."),Ry.forEach(t),M3=d(Wt),Td=r(Wt,"P",{});var Qy=a(Td);z3=n(Qy,"This model inherits from "),yp=r(Qy,"A",{href:!0});var oC=a(yp);P3=n(oC,"FlaxPreTrainedModel"),oC.forEach(t),q3=n(Qy,`. 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)`),Qy.forEach(t),j3=d(Wt),yd=r(Wt,"P",{});var Vy=a(yd);C3=n(Vy,"This model is also a Flax Linen "),kd=r(Vy,"A",{href:!0,rel:!0});var nC=a(kd);N3=n(nC,"flax.linen.Module"),nC.forEach(t),O3=n(Vy,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Vy.forEach(t),I3=d(Wt),jm=r(Wt,"P",{});var sC=a(jm);A3=n(sC,"Finally, this model supports inherent JAX features such as:"),sC.forEach(t),D3=d(Wt),ho=r(Wt,"UL",{});var Mr=a(ho);Cm=r(Mr,"LI",{});var rC=a(Cm);bd=r(rC,"A",{href:!0,rel:!0});var aC=a(bd);L3=n(aC,"Just-In-Time (JIT) compilation"),aC.forEach(t),rC.forEach(t),S3=d(Mr),Nm=r(Mr,"LI",{});var iC=a(Nm);vd=r(iC,"A",{href:!0,rel:!0});var lC=a(vd);U3=n(lC,"Automatic Differentiation"),lC.forEach(t),iC.forEach(t),W3=d(Mr),Om=r(Mr,"LI",{});var dC=a(Om);wd=r(dC,"A",{href:!0,rel:!0});var cC=a(wd);H3=n(cC,"Vectorization"),cC.forEach(t),dC.forEach(t),R3=d(Mr),Im=r(Mr,"LI",{});var pC=a(Im);Fd=r(pC,"A",{href:!0,rel:!0});var hC=a(Fd);Q3=n(hC,"Parallelization"),hC.forEach(t),pC.forEach(t),Mr.forEach(t),V3=d(Wt),Pt=r(Wt,"DIV",{class:!0});var Ko=a(Pt);k($d.$$.fragment,Ko),K3=d(Ko),os=r(Ko,"P",{});var eh=a(os);J3=n(eh,"The "),Am=r(eh,"CODE",{});var fC=a(Am);G3=n(fC,"FlaxBertPreTrainedModel"),fC.forEach(t),X3=n(eh,"forward method, overrides the "),Dm=r(eh,"CODE",{});var uC=a(Dm);Y3=n(uC,"__call__"),uC.forEach(t),Z3=n(eh," special method."),eh.forEach(t),ez=d(Ko),k(mr.$$.fragment,Ko),tz=d(Ko),Lm=r(Ko,"P",{});var mC=a(Lm);oz=n(mC,"Example:"),mC.forEach(t),nz=d(Ko),k(xd.$$.fragment,Ko),Ko.forEach(t),Wt.forEach(t),tT=d(i),ns=r(i,"H2",{class:!0});var Ky=a(ns);gr=r(Ky,"A",{id:!0,class:!0,href:!0});var gC=a(gr);Sm=r(gC,"SPAN",{});var _C=a(Sm);k(Bd.$$.fragment,_C),_C.forEach(t),gC.forEach(t),sz=d(Ky),Um=r(Ky,"SPAN",{});var TC=a(Um);rz=n(TC,"FlaxBertForSequenceClassification"),TC.forEach(t),Ky.forEach(t),oT=d(i),Le=r(i,"DIV",{class:!0});var Ht=a(Le);k(Ed.$$.fragment,Ht),az=d(Ht),Wm=r(Ht,"P",{});var yC=a(Wm);iz=n(yC,`Bert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),yC.forEach(t),lz=d(Ht),Md=r(Ht,"P",{});var Jy=a(Md);dz=n(Jy,"This model inherits from "),kp=r(Jy,"A",{href:!0});var kC=a(kp);cz=n(kC,"FlaxPreTrainedModel"),kC.forEach(t),pz=n(Jy,`. 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)`),Jy.forEach(t),hz=d(Ht),zd=r(Ht,"P",{});var Gy=a(zd);fz=n(Gy,"This model is also a Flax Linen "),Pd=r(Gy,"A",{href:!0,rel:!0});var bC=a(Pd);uz=n(bC,"flax.linen.Module"),bC.forEach(t),mz=n(Gy,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Gy.forEach(t),gz=d(Ht),Hm=r(Ht,"P",{});var vC=a(Hm);_z=n(vC,"Finally, this model supports inherent JAX features such as:"),vC.forEach(t),Tz=d(Ht),fo=r(Ht,"UL",{});var zr=a(fo);Rm=r(zr,"LI",{});var wC=a(Rm);qd=r(wC,"A",{href:!0,rel:!0});var FC=a(qd);yz=n(FC,"Just-In-Time (JIT) compilation"),FC.forEach(t),wC.forEach(t),kz=d(zr),Qm=r(zr,"LI",{});var $C=a(Qm);jd=r($C,"A",{href:!0,rel:!0});var xC=a(jd);bz=n(xC,"Automatic Differentiation"),xC.forEach(t),$C.forEach(t),vz=d(zr),Vm=r(zr,"LI",{});var BC=a(Vm);Cd=r(BC,"A",{href:!0,rel:!0});var EC=a(Cd);wz=n(EC,"Vectorization"),EC.forEach(t),BC.forEach(t),Fz=d(zr),Km=r(zr,"LI",{});var MC=a(Km);Nd=r(MC,"A",{href:!0,rel:!0});var zC=a(Nd);$z=n(zC,"Parallelization"),zC.forEach(t),MC.forEach(t),zr.forEach(t),xz=d(Ht),qt=r(Ht,"DIV",{class:!0});var Jo=a(qt);k(Od.$$.fragment,Jo),Bz=d(Jo),ss=r(Jo,"P",{});var th=a(ss);Ez=n(th,"The "),Jm=r(th,"CODE",{});var PC=a(Jm);Mz=n(PC,"FlaxBertPreTrainedModel"),PC.forEach(t),zz=n(th,"forward method, overrides the "),Gm=r(th,"CODE",{});var qC=a(Gm);Pz=n(qC,"__call__"),qC.forEach(t),qz=n(th," special method."),th.forEach(t),jz=d(Jo),k(_r.$$.fragment,Jo),Cz=d(Jo),Xm=r(Jo,"P",{});var jC=a(Xm);Nz=n(jC,"Example:"),jC.forEach(t),Oz=d(Jo),k(Id.$$.fragment,Jo),Jo.forEach(t),Ht.forEach(t),nT=d(i),rs=r(i,"H2",{class:!0});var Xy=a(rs);Tr=r(Xy,"A",{id:!0,class:!0,href:!0});var CC=a(Tr);Ym=r(CC,"SPAN",{});var NC=a(Ym);k(Ad.$$.fragment,NC),NC.forEach(t),CC.forEach(t),Iz=d(Xy),Zm=r(Xy,"SPAN",{});var OC=a(Zm);Az=n(OC,"FlaxBertForMultipleChoice"),OC.forEach(t),Xy.forEach(t),sT=d(i),Se=r(i,"DIV",{class:!0});var Rt=a(Se);k(Dd.$$.fragment,Rt),Dz=d(Rt),eg=r(Rt,"P",{});var IC=a(eg);Lz=n(IC,`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.`),IC.forEach(t),Sz=d(Rt),Ld=r(Rt,"P",{});var Yy=a(Ld);Uz=n(Yy,"This model inherits from "),bp=r(Yy,"A",{href:!0});var AC=a(bp);Wz=n(AC,"FlaxPreTrainedModel"),AC.forEach(t),Hz=n(Yy,`. 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)`),Yy.forEach(t),Rz=d(Rt),Sd=r(Rt,"P",{});var Zy=a(Sd);Qz=n(Zy,"This model is also a Flax Linen "),Ud=r(Zy,"A",{href:!0,rel:!0});var DC=a(Ud);Vz=n(DC,"flax.linen.Module"),DC.forEach(t),Kz=n(Zy,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Zy.forEach(t),Jz=d(Rt),tg=r(Rt,"P",{});var LC=a(tg);Gz=n(LC,"Finally, this model supports inherent JAX features such as:"),LC.forEach(t),Xz=d(Rt),uo=r(Rt,"UL",{});var Pr=a(uo);og=r(Pr,"LI",{});var SC=a(og);Wd=r(SC,"A",{href:!0,rel:!0});var UC=a(Wd);Yz=n(UC,"Just-In-Time (JIT) compilation"),UC.forEach(t),SC.forEach(t),Zz=d(Pr),ng=r(Pr,"LI",{});var WC=a(ng);Hd=r(WC,"A",{href:!0,rel:!0});var HC=a(Hd);e5=n(HC,"Automatic Differentiation"),HC.forEach(t),WC.forEach(t),t5=d(Pr),sg=r(Pr,"LI",{});var RC=a(sg);Rd=r(RC,"A",{href:!0,rel:!0});var QC=a(Rd);o5=n(QC,"Vectorization"),QC.forEach(t),RC.forEach(t),n5=d(Pr),rg=r(Pr,"LI",{});var VC=a(rg);Qd=r(VC,"A",{href:!0,rel:!0});var KC=a(Qd);s5=n(KC,"Parallelization"),KC.forEach(t),VC.forEach(t),Pr.forEach(t),r5=d(Rt),jt=r(Rt,"DIV",{class:!0});var Go=a(jt);k(Vd.$$.fragment,Go),a5=d(Go),as=r(Go,"P",{});var oh=a(as);i5=n(oh,"The "),ag=r(oh,"CODE",{});var JC=a(ag);l5=n(JC,"FlaxBertPreTrainedModel"),JC.forEach(t),d5=n(oh,"forward method, overrides the "),ig=r(oh,"CODE",{});var GC=a(ig);c5=n(GC,"__call__"),GC.forEach(t),p5=n(oh," special method."),oh.forEach(t),h5=d(Go),k(yr.$$.fragment,Go),f5=d(Go),lg=r(Go,"P",{});var XC=a(lg);u5=n(XC,"Example:"),XC.forEach(t),m5=d(Go),k(Kd.$$.fragment,Go),Go.forEach(t),Rt.forEach(t),rT=d(i),is=r(i,"H2",{class:!0});var ek=a(is);kr=r(ek,"A",{id:!0,class:!0,href:!0});var YC=a(kr);dg=r(YC,"SPAN",{});var ZC=a(dg);k(Jd.$$.fragment,ZC),ZC.forEach(t),YC.forEach(t),g5=d(ek),cg=r(ek,"SPAN",{});var e6=a(cg);_5=n(e6,"FlaxBertForTokenClassification"),e6.forEach(t),ek.forEach(t),aT=d(i),Ue=r(i,"DIV",{class:!0});var Qt=a(Ue);k(Gd.$$.fragment,Qt),T5=d(Qt),pg=r(Qt,"P",{});var t6=a(pg);y5=n(t6,`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.`),t6.forEach(t),k5=d(Qt),Xd=r(Qt,"P",{});var tk=a(Xd);b5=n(tk,"This model inherits from "),vp=r(tk,"A",{href:!0});var o6=a(vp);v5=n(o6,"FlaxPreTrainedModel"),o6.forEach(t),w5=n(tk,`. 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)`),tk.forEach(t),F5=d(Qt),Yd=r(Qt,"P",{});var ok=a(Yd);$5=n(ok,"This model is also a Flax Linen "),Zd=r(ok,"A",{href:!0,rel:!0});var n6=a(Zd);x5=n(n6,"flax.linen.Module"),n6.forEach(t),B5=n(ok,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),ok.forEach(t),E5=d(Qt),hg=r(Qt,"P",{});var s6=a(hg);M5=n(s6,"Finally, this model supports inherent JAX features such as:"),s6.forEach(t),z5=d(Qt),mo=r(Qt,"UL",{});var qr=a(mo);fg=r(qr,"LI",{});var r6=a(fg);ec=r(r6,"A",{href:!0,rel:!0});var a6=a(ec);P5=n(a6,"Just-In-Time (JIT) compilation"),a6.forEach(t),r6.forEach(t),q5=d(qr),ug=r(qr,"LI",{});var i6=a(ug);tc=r(i6,"A",{href:!0,rel:!0});var l6=a(tc);j5=n(l6,"Automatic Differentiation"),l6.forEach(t),i6.forEach(t),C5=d(qr),mg=r(qr,"LI",{});var d6=a(mg);oc=r(d6,"A",{href:!0,rel:!0});var c6=a(oc);N5=n(c6,"Vectorization"),c6.forEach(t),d6.forEach(t),O5=d(qr),gg=r(qr,"LI",{});var p6=a(gg);nc=r(p6,"A",{href:!0,rel:!0});var h6=a(nc);I5=n(h6,"Parallelization"),h6.forEach(t),p6.forEach(t),qr.forEach(t),A5=d(Qt),Ct=r(Qt,"DIV",{class:!0});var Xo=a(Ct);k(sc.$$.fragment,Xo),D5=d(Xo),ls=r(Xo,"P",{});var nh=a(ls);L5=n(nh,"The "),_g=r(nh,"CODE",{});var f6=a(_g);S5=n(f6,"FlaxBertPreTrainedModel"),f6.forEach(t),U5=n(nh,"forward method, overrides the "),Tg=r(nh,"CODE",{});var u6=a(Tg);W5=n(u6,"__call__"),u6.forEach(t),H5=n(nh," special method."),nh.forEach(t),R5=d(Xo),k(br.$$.fragment,Xo),Q5=d(Xo),yg=r(Xo,"P",{});var m6=a(yg);V5=n(m6,"Example:"),m6.forEach(t),K5=d(Xo),k(rc.$$.fragment,Xo),Xo.forEach(t),Qt.forEach(t),iT=d(i),ds=r(i,"H2",{class:!0});var nk=a(ds);vr=r(nk,"A",{id:!0,class:!0,href:!0});var g6=a(vr);kg=r(g6,"SPAN",{});var _6=a(kg);k(ac.$$.fragment,_6),_6.forEach(t),g6.forEach(t),J5=d(nk),bg=r(nk,"SPAN",{});var T6=a(bg);G5=n(T6,"FlaxBertForQuestionAnswering"),T6.forEach(t),nk.forEach(t),lT=d(i),We=r(i,"DIV",{class:!0});var Vt=a(We);k(ic.$$.fragment,Vt),X5=d(Vt),cs=r(Vt,"P",{});var sh=a(cs);Y5=n(sh,`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 `),vg=r(sh,"CODE",{});var y6=a(vg);Z5=n(y6,"span start logits"),y6.forEach(t),eP=n(sh," and "),wg=r(sh,"CODE",{});var k6=a(wg);tP=n(k6,"span end logits"),k6.forEach(t),oP=n(sh,")."),sh.forEach(t),nP=d(Vt),lc=r(Vt,"P",{});var sk=a(lc);sP=n(sk,"This model inherits from "),wp=r(sk,"A",{href:!0});var b6=a(wp);rP=n(b6,"FlaxPreTrainedModel"),b6.forEach(t),aP=n(sk,`. 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)`),sk.forEach(t),iP=d(Vt),dc=r(Vt,"P",{});var rk=a(dc);lP=n(rk,"This model is also a Flax Linen "),cc=r(rk,"A",{href:!0,rel:!0});var v6=a(cc);dP=n(v6,"flax.linen.Module"),v6.forEach(t),cP=n(rk,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),rk.forEach(t),pP=d(Vt),Fg=r(Vt,"P",{});var w6=a(Fg);hP=n(w6,"Finally, this model supports inherent JAX features such as:"),w6.forEach(t),fP=d(Vt),go=r(Vt,"UL",{});var jr=a(go);$g=r(jr,"LI",{});var F6=a($g);pc=r(F6,"A",{href:!0,rel:!0});var $6=a(pc);uP=n($6,"Just-In-Time (JIT) compilation"),$6.forEach(t),F6.forEach(t),mP=d(jr),xg=r(jr,"LI",{});var x6=a(xg);hc=r(x6,"A",{href:!0,rel:!0});var B6=a(hc);gP=n(B6,"Automatic Differentiation"),B6.forEach(t),x6.forEach(t),_P=d(jr),Bg=r(jr,"LI",{});var E6=a(Bg);fc=r(E6,"A",{href:!0,rel:!0});var M6=a(fc);TP=n(M6,"Vectorization"),M6.forEach(t),E6.forEach(t),yP=d(jr),Eg=r(jr,"LI",{});var z6=a(Eg);uc=r(z6,"A",{href:!0,rel:!0});var P6=a(uc);kP=n(P6,"Parallelization"),P6.forEach(t),z6.forEach(t),jr.forEach(t),bP=d(Vt),Nt=r(Vt,"DIV",{class:!0});var Yo=a(Nt);k(mc.$$.fragment,Yo),vP=d(Yo),ps=r(Yo,"P",{});var rh=a(ps);wP=n(rh,"The "),Mg=r(rh,"CODE",{});var q6=a(Mg);FP=n(q6,"FlaxBertPreTrainedModel"),q6.forEach(t),$P=n(rh,"forward method, overrides the "),zg=r(rh,"CODE",{});var j6=a(zg);xP=n(j6,"__call__"),j6.forEach(t),BP=n(rh," special method."),rh.forEach(t),EP=d(Yo),k(wr.$$.fragment,Yo),MP=d(Yo),Pg=r(Yo,"P",{});var C6=a(Pg);zP=n(C6,"Example:"),C6.forEach(t),PP=d(Yo),k(gc.$$.fragment,Yo),Yo.forEach(t),Vt.forEach(t),this.h()},h(){c(p,"name","hf:doc:metadata"),c(p,"content",JSON.stringify(yN)),c(T,"id","bert"),c(T,"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"),c(T,"href","#bert"),c(g,"class","relative group"),c(ee,"id","overview"),c(ee,"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"),c(ee,"href","#overview"),c(M,"class","relative group"),c(ne,"href","https://arxiv.org/abs/1810.04805"),c(ne,"rel","nofollow"),c(Fe,"href","https://huggingface.co/thomwolf"),c(Fe,"rel","nofollow"),c($e,"href","https://github.com/google-research/bert"),c($e,"rel","nofollow"),c(ve,"id","transformers.BertConfig"),c(ve,"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"),c(ve,"href","#transformers.BertConfig"),c(ke,"class","relative group"),c(vc,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertModel"),c(wc,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.TFBertModel"),c(Nr,"href","https://huggingface.co/bert-base-uncased"),c(Nr,"rel","nofollow"),c(Fc,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),c($c,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),c(ot,"class","docstring"),c(us,"id","transformers.BertTokenizer"),c(us,"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"),c(us,"href","#transformers.BertTokenizer"),c(en,"class","relative group"),c(xc,"href","/docs/transformers/pr_15839/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),c(To,"class","docstring"),c(ms,"class","docstring"),c(Jt,"class","docstring"),c(Mc,"class","docstring"),c(je,"class","docstring"),c(gs,"id","transformers.BertTokenizerFast"),c(gs,"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"),c(gs,"href","#transformers.BertTokenizerFast"),c(on,"class","relative group"),c(zc,"href","/docs/transformers/pr_15839/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),c(yo,"class","docstring"),c(Gt,"class","docstring"),c(nt,"class","docstring"),c(_s,"id","transformers.models.bert.modeling_bert.BertForPreTrainingOutput"),c(_s,"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"),c(_s,"href","#transformers.models.bert.modeling_bert.BertForPreTrainingOutput"),c(sn,"class","relative group"),c(jc,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertForPreTraining"),c(rn,"class","docstring"),c(Cc,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.TFBertForPreTraining"),c(an,"class","docstring"),c(Nc,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertForPreTraining"),c(Ts,"class","docstring"),c(io,"class","docstring"),c(ys,"id","transformers.BertModel"),c(ys,"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"),c(ys,"href","#transformers.BertModel"),c(ln,"class","relative group"),c(Oc,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),c(fa,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(fa,"rel","nofollow"),c(ma,"href","https://arxiv.org/abs/1706.03762"),c(ma,"rel","nofollow"),c(Ic,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertModel"),c(ht,"class","docstring"),c(Ce,"class","docstring"),c(bs,"id","transformers.BertForPreTraining"),c(bs,"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"),c(bs,"href","#transformers.BertForPreTraining"),c(cn,"class","relative group"),c(Ac,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),c(va,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(va,"rel","nofollow"),c(Dc,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertForPreTraining"),c(ft,"class","docstring"),c(st,"class","docstring"),c(ws,"id","transformers.BertLMHeadModel"),c(ws,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ws,"href","#transformers.BertLMHeadModel"),c(fn,"class","relative group"),c(Lc,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),c(za,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(za,"rel","nofollow"),c(Sc,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertLMHeadModel"),c(ut,"class","docstring"),c(rt,"class","docstring"),c($s,"id","transformers.BertForMaskedLM"),c($s,"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"),c($s,"href","#transformers.BertForMaskedLM"),c(mn,"class","relative group"),c(Uc,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),c(Aa,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Aa,"rel","nofollow"),c(Wc,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertForMaskedLM"),c(mt,"class","docstring"),c(at,"class","docstring"),c(Bs,"id","transformers.BertForNextSentencePrediction"),c(Bs,"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"),c(Bs,"href","#transformers.BertForNextSentencePrediction"),c(_n,"class","relative group"),c(Hc,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),c(Qa,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Qa,"rel","nofollow"),c(Rc,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertForNextSentencePrediction"),c(gt,"class","docstring"),c(it,"class","docstring"),c(Ms,"id","transformers.BertForSequenceClassification"),c(Ms,"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"),c(Ms,"href","#transformers.BertForSequenceClassification"),c(yn,"class","relative group"),c(Qc,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),c(Za,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Za,"rel","nofollow"),c(Vc,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertForSequenceClassification"),c(He,"class","docstring"),c(lt,"class","docstring"),c(Ps,"id","transformers.BertForMultipleChoice"),c(Ps,"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"),c(Ps,"href","#transformers.BertForMultipleChoice"),c(bn,"class","relative group"),c(Kc,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),c(ii,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ii,"rel","nofollow"),c(Jc,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertForMultipleChoice"),c(_t,"class","docstring"),c(dt,"class","docstring"),c(js,"id","transformers.BertForTokenClassification"),c(js,"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"),c(js,"href","#transformers.BertForTokenClassification"),c(wn,"class","relative group"),c(Gc,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),c(ui,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ui,"rel","nofollow"),c(Xc,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertForTokenClassification"),c(Tt,"class","docstring"),c(ct,"class","docstring"),c(Ns,"id","transformers.BertForQuestionAnswering"),c(Ns,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ns,"href","#transformers.BertForQuestionAnswering"),c($n,"class","relative group"),c(Yc,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),c(bi,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(bi,"rel","nofollow"),c(Zc,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertForQuestionAnswering"),c(yt,"class","docstring"),c(pt,"class","docstring"),c(Is,"id","transformers.TFBertModel"),c(Is,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Is,"href","#transformers.TFBertModel"),c(En,"class","relative group"),c(ep,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),c(Ei,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(Ei,"rel","nofollow"),c(tp,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.TFBertModel"),c(kt,"class","docstring"),c(Qe,"class","docstring"),c(Ls,"id","transformers.TFBertForPreTraining"),c(Ls,"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"),c(Ls,"href","#transformers.TFBertForPreTraining"),c(zn,"class","relative group"),c(op,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),c(Ni,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(Ni,"rel","nofollow"),c(np,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.TFBertForPreTraining"),c(bt,"class","docstring"),c(Ve,"class","docstring"),c(Ws,"id","transformers.TFBertLMHeadModel"),c(Ws,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ws,"href","#transformers.TFBertLMHeadModel"),c(jn,"class","relative group"),c(et,"class","docstring"),c(Cn,"class","docstring"),c(Hs,"id","transformers.TFBertForMaskedLM"),c(Hs,"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"),c(Hs,"href","#transformers.TFBertForMaskedLM"),c(Nn,"class","relative group"),c(sp,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),c(Gi,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(Gi,"rel","nofollow"),c(rp,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.TFBertForMaskedLM"),c(vt,"class","docstring"),c(Ke,"class","docstring"),c(Vs,"id","transformers.TFBertForNextSentencePrediction"),c(Vs,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Vs,"href","#transformers.TFBertForNextSentencePrediction"),c(In,"class","relative group"),c(ap,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),c(sl,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(sl,"rel","nofollow"),c(ip,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.TFBertForNextSentencePrediction"),c(wt,"class","docstring"),c(Je,"class","docstring"),c(Gs,"id","transformers.TFBertForSequenceClassification"),c(Gs,"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"),c(Gs,"href","#transformers.TFBertForSequenceClassification"),c(Dn,"class","relative group"),c(lp,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),c(pl,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(pl,"rel","nofollow"),c(dp,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.TFBertForSequenceClassification"),c(Ft,"class","docstring"),c(Ge,"class","docstring"),c(Zs,"id","transformers.TFBertForMultipleChoice"),c(Zs,"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"),c(Zs,"href","#transformers.TFBertForMultipleChoice"),c(Sn,"class","relative group"),c(cp,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),c(Tl,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(Tl,"rel","nofollow"),c(pp,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.TFBertForMultipleChoice"),c($t,"class","docstring"),c(Xe,"class","docstring"),c(or,"id","transformers.TFBertForTokenClassification"),c(or,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(or,"href","#transformers.TFBertForTokenClassification"),c(Wn,"class","relative group"),c(hp,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),c($l,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c($l,"rel","nofollow"),c(fp,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.TFBertForTokenClassification"),c(xt,"class","docstring"),c(Ye,"class","docstring"),c(rr,"id","transformers.TFBertForQuestionAnswering"),c(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"),c(rr,"href","#transformers.TFBertForQuestionAnswering"),c(Rn,"class","relative group"),c(up,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),c(ql,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(ql,"rel","nofollow"),c(mp,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.TFBertForQuestionAnswering"),c(Bt,"class","docstring"),c(Ze,"class","docstring"),c(lr,"id","transformers.FlaxBertModel"),c(lr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(lr,"href","#transformers.FlaxBertModel"),c(Kn,"class","relative group"),c(gp,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(Dl,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),c(Dl,"rel","nofollow"),c(Ll,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(Ll,"rel","nofollow"),c(Sl,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(Sl,"rel","nofollow"),c(Ul,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(Ul,"rel","nofollow"),c(Wl,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(Wl,"rel","nofollow"),c(Et,"class","docstring"),c(Oe,"class","docstring"),c(cr,"id","transformers.FlaxBertForPreTraining"),c(cr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(cr,"href","#transformers.FlaxBertForPreTraining"),c(Gn,"class","relative group"),c(_p,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(Gl,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),c(Gl,"rel","nofollow"),c(Xl,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(Xl,"rel","nofollow"),c(Yl,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(Yl,"rel","nofollow"),c(Zl,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(Zl,"rel","nofollow"),c(ed,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(ed,"rel","nofollow"),c(Mt,"class","docstring"),c(Ie,"class","docstring"),c(hr,"id","transformers.FlaxBertForMaskedLM"),c(hr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(hr,"href","#transformers.FlaxBertForMaskedLM"),c(Zn,"class","relative group"),c(Tp,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(ld,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),c(ld,"rel","nofollow"),c(dd,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(dd,"rel","nofollow"),c(cd,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(cd,"rel","nofollow"),c(pd,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(pd,"rel","nofollow"),c(hd,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(hd,"rel","nofollow"),c(zt,"class","docstring"),c(Ae,"class","docstring"),c(ur,"id","transformers.FlaxBertForNextSentencePrediction"),c(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"),c(ur,"href","#transformers.FlaxBertForNextSentencePrediction"),c(ts,"class","relative group"),c(yp,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(kd,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),c(kd,"rel","nofollow"),c(bd,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(bd,"rel","nofollow"),c(vd,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(vd,"rel","nofollow"),c(wd,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(wd,"rel","nofollow"),c(Fd,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(Fd,"rel","nofollow"),c(Pt,"class","docstring"),c(De,"class","docstring"),c(gr,"id","transformers.FlaxBertForSequenceClassification"),c(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"),c(gr,"href","#transformers.FlaxBertForSequenceClassification"),c(ns,"class","relative group"),c(kp,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(Pd,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),c(Pd,"rel","nofollow"),c(qd,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(qd,"rel","nofollow"),c(jd,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(jd,"rel","nofollow"),c(Cd,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(Cd,"rel","nofollow"),c(Nd,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(Nd,"rel","nofollow"),c(qt,"class","docstring"),c(Le,"class","docstring"),c(Tr,"id","transformers.FlaxBertForMultipleChoice"),c(Tr,"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"),c(Tr,"href","#transformers.FlaxBertForMultipleChoice"),c(rs,"class","relative group"),c(bp,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(Ud,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),c(Ud,"rel","nofollow"),c(Wd,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(Wd,"rel","nofollow"),c(Hd,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(Hd,"rel","nofollow"),c(Rd,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(Rd,"rel","nofollow"),c(Qd,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(Qd,"rel","nofollow"),c(jt,"class","docstring"),c(Se,"class","docstring"),c(kr,"id","transformers.FlaxBertForTokenClassification"),c(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"),c(kr,"href","#transformers.FlaxBertForTokenClassification"),c(is,"class","relative group"),c(vp,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(Zd,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),c(Zd,"rel","nofollow"),c(ec,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(ec,"rel","nofollow"),c(tc,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(tc,"rel","nofollow"),c(oc,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(oc,"rel","nofollow"),c(nc,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(nc,"rel","nofollow"),c(Ct,"class","docstring"),c(Ue,"class","docstring"),c(vr,"id","transformers.FlaxBertForQuestionAnswering"),c(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"),c(vr,"href","#transformers.FlaxBertForQuestionAnswering"),c(ds,"class","relative group"),c(wp,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(cc,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),c(cc,"rel","nofollow"),c(pc,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(pc,"rel","nofollow"),c(hc,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(hc,"rel","nofollow"),c(fc,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(fc,"rel","nofollow"),c(uc,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(uc,"rel","nofollow"),c(Nt,"class","docstring"),c(We,"class","docstring")},m(i,u){e(document.head,p),f(i,x,u),f(i,g,u),e(g,T),e(T,$),b(_,$,null),e(g,m),e(g,B),e(B,me),f(i,X,u),f(i,M,u),e(M,ee),e(ee,D),b(oe,D,null),e(M,ge),e(M,L),e(L,_e),f(i,ce,u),f(i,J,u),e(J,O),e(J,ne),e(ne,Y),e(J,z),f(i,q,u),f(i,se,u),e(se,H),f(i,pe,u),f(i,re,u),e(re,S),e(S,Te),f(i,he,u),f(i,P,u),e(P,ie),e(ie,R),f(i,fe,u),f(i,ae,u),e(ae,Q),f(i,ue,u),f(i,te,u),e(te,N),e(N,ye),e(te,V),e(te,le),e(le,h),f(i,E,u),f(i,K,u),e(K,Ee),e(K,Fe),e(Fe,I),e(K,Me),e(K,$e),e($e,ze),e(K,A),f(i,W,u),f(i,ke,u),e(ke,ve),e(ve,U),b(xe,U,null),e(ke,Pe),e(ke,de),e(de,qe),f(i,o_,u),f(i,ot,u),b(Cr,ot,null),e(ot,ak),e(ot,ao),e(ao,ik),e(ao,vc),e(vc,lk),e(ao,dk),e(ao,wc),e(wc,ck),e(ao,pk),e(ao,Nr),e(Nr,hk),e(ao,fk),e(ot,uk),e(ot,Zo),e(Zo,mk),e(Zo,Fc),e(Fc,gk),e(Zo,_k),e(Zo,$c),e($c,Tk),e(Zo,yk),e(ot,kk),e(ot,ah),e(ah,bk),e(ot,vk),b(Or,ot,null),f(i,n_,u),f(i,en,u),e(en,us),e(us,ih),b(Ir,ih,null),e(en,wk),e(en,lh),e(lh,Fk),f(i,s_,u),f(i,je,u),b(Ar,je,null),e(je,$k),e(je,dh),e(dh,xk),e(je,Bk),e(je,Dr),e(Dr,Ek),e(Dr,xc),e(xc,Mk),e(Dr,zk),e(je,Pk),e(je,To),b(Lr,To,null),e(To,qk),e(To,ch),e(ch,jk),e(To,Ck),e(To,Sr),e(Sr,Bc),e(Bc,Nk),e(Bc,ph),e(ph,Ok),e(Sr,Ik),e(Sr,Ec),e(Ec,Ak),e(Ec,hh),e(hh,Dk),e(je,Lk),e(je,ms),b(Ur,ms,null),e(ms,Sk),e(ms,Wr),e(Wr,Uk),e(Wr,fh),e(fh,Wk),e(Wr,Hk),e(je,Rk),e(je,Jt),b(Hr,Jt,null),e(Jt,Qk),e(Jt,uh),e(uh,Vk),e(Jt,Kk),b(Rr,Jt,null),e(Jt,Jk),e(Jt,tn),e(tn,Gk),e(tn,mh),e(mh,Xk),e(tn,Yk),e(tn,gh),e(gh,Zk),e(tn,eb),e(je,tb),e(je,Mc),b(Qr,Mc,null),f(i,r_,u),f(i,on,u),e(on,gs),e(gs,_h),b(Vr,_h,null),e(on,ob),e(on,Th),e(Th,nb),f(i,a_,u),f(i,nt,u),b(Kr,nt,null),e(nt,sb),e(nt,Jr),e(Jr,rb),e(Jr,yh),e(yh,ab),e(Jr,ib),e(nt,lb),e(nt,Gr),e(Gr,db),e(Gr,zc),e(zc,cb),e(Gr,pb),e(nt,hb),e(nt,yo),b(Xr,yo,null),e(yo,fb),e(yo,kh),e(kh,ub),e(yo,mb),e(yo,Yr),e(Yr,Pc),e(Pc,gb),e(Pc,bh),e(bh,_b),e(Yr,Tb),e(Yr,qc),e(qc,yb),e(qc,vh),e(vh,kb),e(nt,bb),e(nt,Gt),b(Zr,Gt,null),e(Gt,vb),e(Gt,wh),e(wh,wb),e(Gt,Fb),b(ea,Gt,null),e(Gt,$b),e(Gt,nn),e(nn,xb),e(nn,Fh),e(Fh,Bb),e(nn,Eb),e(nn,$h),e($h,Mb),e(nn,zb),f(i,i_,u),f(i,sn,u),e(sn,_s),e(_s,xh),b(ta,xh,null),e(sn,Pb),e(sn,Bh),e(Bh,qb),f(i,l_,u),f(i,rn,u),b(oa,rn,null),e(rn,jb),e(rn,na),e(na,Cb),e(na,jc),e(jc,Nb),e(na,Ob),f(i,d_,u),f(i,an,u),b(sa,an,null),e(an,Ib),e(an,ra),e(ra,Ab),e(ra,Cc),e(Cc,Db),e(ra,Lb),f(i,c_,u),f(i,io,u),b(aa,io,null),e(io,Sb),e(io,ia),e(ia,Ub),e(ia,Nc),e(Nc,Wb),e(ia,Hb),e(io,Rb),e(io,Ts),b(la,Ts,null),e(Ts,Qb),e(Ts,Eh),e(Eh,Vb),f(i,p_,u),f(i,ln,u),e(ln,ys),e(ys,Mh),b(da,Mh,null),e(ln,Kb),e(ln,zh),e(zh,Jb),f(i,h_,u),f(i,Ce,u),b(ca,Ce,null),e(Ce,Gb),e(Ce,Ph),e(Ph,Xb),e(Ce,Yb),e(Ce,pa),e(pa,Zb),e(pa,Oc),e(Oc,ev),e(pa,tv),e(Ce,ov),e(Ce,ha),e(ha,nv),e(ha,fa),e(fa,sv),e(ha,rv),e(Ce,av),e(Ce,ua),e(ua,iv),e(ua,ma),e(ma,lv),e(ua,dv),e(Ce,cv),e(Ce,Re),e(Re,pv),e(Re,qh),e(qh,hv),e(Re,fv),e(Re,jh),e(jh,uv),e(Re,mv),e(Re,Ch),e(Ch,gv),e(Re,_v),e(Re,Nh),e(Nh,Tv),e(Re,yv),e(Re,Oh),e(Oh,kv),e(Re,bv),e(Re,Ih),e(Ih,vv),e(Re,wv),e(Ce,Fv),e(Ce,ht),b(ga,ht,null),e(ht,$v),e(ht,dn),e(dn,xv),e(dn,Ic),e(Ic,Bv),e(dn,Ev),e(dn,Ah),e(Ah,Mv),e(dn,zv),e(ht,Pv),b(ks,ht,null),e(ht,qv),e(ht,Dh),e(Dh,jv),e(ht,Cv),b(_a,ht,null),f(i,f_,u),f(i,cn,u),e(cn,bs),e(bs,Lh),b(Ta,Lh,null),e(cn,Nv),e(cn,Sh),e(Sh,Ov),f(i,u_,u),f(i,st,u),b(ya,st,null),e(st,Iv),e(st,pn),e(pn,Av),e(pn,Uh),e(Uh,Dv),e(pn,Lv),e(pn,Wh),e(Wh,Sv),e(pn,Uv),e(st,Wv),e(st,ka),e(ka,Hv),e(ka,Ac),e(Ac,Rv),e(ka,Qv),e(st,Vv),e(st,ba),e(ba,Kv),e(ba,va),e(va,Jv),e(ba,Gv),e(st,Xv),e(st,ft),b(wa,ft,null),e(ft,Yv),e(ft,hn),e(hn,Zv),e(hn,Dc),e(Dc,e1),e(hn,t1),e(hn,Hh),e(Hh,o1),e(hn,n1),e(ft,s1),b(vs,ft,null),e(ft,r1),e(ft,Rh),e(Rh,a1),e(ft,i1),b(Fa,ft,null),f(i,m_,u),f(i,fn,u),e(fn,ws),e(ws,Qh),b($a,Qh,null),e(fn,l1),e(fn,Vh),e(Vh,d1),f(i,g_,u),f(i,rt,u),b(xa,rt,null),e(rt,c1),e(rt,Ba),e(Ba,p1),e(Ba,Kh),e(Kh,h1),e(Ba,f1),e(rt,u1),e(rt,Ea),e(Ea,m1),e(Ea,Lc),e(Lc,g1),e(Ea,_1),e(rt,T1),e(rt,Ma),e(Ma,y1),e(Ma,za),e(za,k1),e(Ma,b1),e(rt,v1),e(rt,ut),b(Pa,ut,null),e(ut,w1),e(ut,un),e(un,F1),e(un,Sc),e(Sc,$1),e(un,x1),e(un,Jh),e(Jh,B1),e(un,E1),e(ut,M1),b(Fs,ut,null),e(ut,z1),e(ut,Gh),e(Gh,P1),e(ut,q1),b(qa,ut,null),f(i,__,u),f(i,mn,u),e(mn,$s),e($s,Xh),b(ja,Xh,null),e(mn,j1),e(mn,Yh),e(Yh,C1),f(i,T_,u),f(i,at,u),b(Ca,at,null),e(at,N1),e(at,Na),e(Na,O1),e(Na,Zh),e(Zh,I1),e(Na,A1),e(at,D1),e(at,Oa),e(Oa,L1),e(Oa,Uc),e(Uc,S1),e(Oa,U1),e(at,W1),e(at,Ia),e(Ia,H1),e(Ia,Aa),e(Aa,R1),e(Ia,Q1),e(at,V1),e(at,mt),b(Da,mt,null),e(mt,K1),e(mt,gn),e(gn,J1),e(gn,Wc),e(Wc,G1),e(gn,X1),e(gn,ef),e(ef,Y1),e(gn,Z1),e(mt,ew),b(xs,mt,null),e(mt,tw),e(mt,tf),e(tf,ow),e(mt,nw),b(La,mt,null),f(i,y_,u),f(i,_n,u),e(_n,Bs),e(Bs,of),b(Sa,of,null),e(_n,sw),e(_n,nf),e(nf,rw),f(i,k_,u),f(i,it,u),b(Ua,it,null),e(it,aw),e(it,Wa),e(Wa,iw),e(Wa,sf),e(sf,lw),e(Wa,dw),e(it,cw),e(it,Ha),e(Ha,pw),e(Ha,Hc),e(Hc,hw),e(Ha,fw),e(it,uw),e(it,Ra),e(Ra,mw),e(Ra,Qa),e(Qa,gw),e(Ra,_w),e(it,Tw),e(it,gt),b(Va,gt,null),e(gt,yw),e(gt,Tn),e(Tn,kw),e(Tn,Rc),e(Rc,bw),e(Tn,vw),e(Tn,rf),e(rf,ww),e(Tn,Fw),e(gt,$w),b(Es,gt,null),e(gt,xw),e(gt,af),e(af,Bw),e(gt,Ew),b(Ka,gt,null),f(i,b_,u),f(i,yn,u),e(yn,Ms),e(Ms,lf),b(Ja,lf,null),e(yn,Mw),e(yn,df),e(df,zw),f(i,v_,u),f(i,lt,u),b(Ga,lt,null),e(lt,Pw),e(lt,cf),e(cf,qw),e(lt,jw),e(lt,Xa),e(Xa,Cw),e(Xa,Qc),e(Qc,Nw),e(Xa,Ow),e(lt,Iw),e(lt,Ya),e(Ya,Aw),e(Ya,Za),e(Za,Dw),e(Ya,Lw),e(lt,Sw),e(lt,He),b(ei,He,null),e(He,Uw),e(He,kn),e(kn,Ww),e(kn,Vc),e(Vc,Hw),e(kn,Rw),e(kn,pf),e(pf,Qw),e(kn,Vw),e(He,Kw),b(zs,He,null),e(He,Jw),e(He,hf),e(hf,Gw),e(He,Xw),b(ti,He,null),e(He,Yw),e(He,ff),e(ff,Zw),e(He,eF),b(oi,He,null),f(i,w_,u),f(i,bn,u),e(bn,Ps),e(Ps,uf),b(ni,uf,null),e(bn,tF),e(bn,mf),e(mf,oF),f(i,F_,u),f(i,dt,u),b(si,dt,null),e(dt,nF),e(dt,gf),e(gf,sF),e(dt,rF),e(dt,ri),e(ri,aF),e(ri,Kc),e(Kc,iF),e(ri,lF),e(dt,dF),e(dt,ai),e(ai,cF),e(ai,ii),e(ii,pF),e(ai,hF),e(dt,fF),e(dt,_t),b(li,_t,null),e(_t,uF),e(_t,vn),e(vn,mF),e(vn,Jc),e(Jc,gF),e(vn,_F),e(vn,_f),e(_f,TF),e(vn,yF),e(_t,kF),b(qs,_t,null),e(_t,bF),e(_t,Tf),e(Tf,vF),e(_t,wF),b(di,_t,null),f(i,$_,u),f(i,wn,u),e(wn,js),e(js,yf),b(ci,yf,null),e(wn,FF),e(wn,kf),e(kf,$F),f(i,x_,u),f(i,ct,u),b(pi,ct,null),e(ct,xF),e(ct,bf),e(bf,BF),e(ct,EF),e(ct,hi),e(hi,MF),e(hi,Gc),e(Gc,zF),e(hi,PF),e(ct,qF),e(ct,fi),e(fi,jF),e(fi,ui),e(ui,CF),e(fi,NF),e(ct,OF),e(ct,Tt),b(mi,Tt,null),e(Tt,IF),e(Tt,Fn),e(Fn,AF),e(Fn,Xc),e(Xc,DF),e(Fn,LF),e(Fn,vf),e(vf,SF),e(Fn,UF),e(Tt,WF),b(Cs,Tt,null),e(Tt,HF),e(Tt,wf),e(wf,RF),e(Tt,QF),b(gi,Tt,null),f(i,B_,u),f(i,$n,u),e($n,Ns),e(Ns,Ff),b(_i,Ff,null),e($n,VF),e($n,$f),e($f,KF),f(i,E_,u),f(i,pt,u),b(Ti,pt,null),e(pt,JF),e(pt,xn),e(xn,GF),e(xn,xf),e(xf,XF),e(xn,YF),e(xn,Bf),e(Bf,ZF),e(xn,e$),e(pt,t$),e(pt,yi),e(yi,o$),e(yi,Yc),e(Yc,n$),e(yi,s$),e(pt,r$),e(pt,ki),e(ki,a$),e(ki,bi),e(bi,i$),e(ki,l$),e(pt,d$),e(pt,yt),b(vi,yt,null),e(yt,c$),e(yt,Bn),e(Bn,p$),e(Bn,Zc),e(Zc,h$),e(Bn,f$),e(Bn,Ef),e(Ef,u$),e(Bn,m$),e(yt,g$),b(Os,yt,null),e(yt,_$),e(yt,Mf),e(Mf,T$),e(yt,y$),b(wi,yt,null),f(i,M_,u),f(i,En,u),e(En,Is),e(Is,zf),b(Fi,zf,null),e(En,k$),e(En,Pf),e(Pf,b$),f(i,z_,u),f(i,Qe,u),b($i,Qe,null),e(Qe,v$),e(Qe,qf),e(qf,w$),e(Qe,F$),e(Qe,xi),e(xi,$$),e(xi,ep),e(ep,x$),e(xi,B$),e(Qe,E$),e(Qe,Bi),e(Bi,M$),e(Bi,Ei),e(Ei,z$),e(Bi,P$),e(Qe,q$),b(As,Qe,null),e(Qe,j$),e(Qe,kt),b(Mi,kt,null),e(kt,C$),e(kt,Mn),e(Mn,N$),e(Mn,tp),e(tp,O$),e(Mn,I$),e(Mn,jf),e(jf,A$),e(Mn,D$),e(kt,L$),b(Ds,kt,null),e(kt,S$),e(kt,Cf),e(Cf,U$),e(kt,W$),b(zi,kt,null),f(i,P_,u),f(i,zn,u),e(zn,Ls),e(Ls,Nf),b(Pi,Nf,null),e(zn,H$),e(zn,Of),e(Of,R$),f(i,q_,u),f(i,Ve,u),b(qi,Ve,null),e(Ve,Q$),e(Ve,Pn),e(Pn,V$),e(Pn,If),e(If,K$),e(Pn,J$),e(Pn,Af),e(Af,G$),e(Pn,X$),e(Ve,Y$),e(Ve,ji),e(ji,Z$),e(ji,op),e(op,e2),e(ji,t2),e(Ve,o2),e(Ve,Ci),e(Ci,n2),e(Ci,Ni),e(Ni,s2),e(Ci,r2),e(Ve,a2),b(Ss,Ve,null),e(Ve,i2),e(Ve,bt),b(Oi,bt,null),e(bt,l2),e(bt,qn),e(qn,d2),e(qn,np),e(np,c2),e(qn,p2),e(qn,Df),e(Df,h2),e(qn,f2),e(bt,u2),b(Us,bt,null),e(bt,m2),e(bt,Lf),e(Lf,g2),e(bt,_2),b(Ii,bt,null),f(i,j_,u),f(i,jn,u),e(jn,Ws),e(Ws,Sf),b(Ai,Sf,null),e(jn,T2),e(jn,Uf),e(Uf,y2),f(i,C_,u),f(i,Cn,u),b(Di,Cn,null),e(Cn,k2),e(Cn,et),b(Li,et,null),e(et,b2),e(et,Ne),e(Ne,v2),e(Ne,Wf),e(Wf,w2),e(Ne,F2),e(Ne,Hf),e(Hf,$2),e(Ne,x2),e(Ne,Rf),e(Rf,B2),e(Ne,E2),e(Ne,Qf),e(Qf,M2),e(Ne,z2),e(Ne,Vf),e(Vf,P2),e(Ne,q2),e(Ne,Kf),e(Kf,j2),e(Ne,C2),e(Ne,Jf),e(Jf,N2),e(Ne,O2),e(et,I2),e(et,Si),e(Si,Ui),e(Ui,A2),e(Ui,Gf),e(Gf,D2),e(Ui,L2),e(Si,S2),e(Si,Wi),e(Wi,U2),e(Wi,Xf),e(Xf,W2),e(Wi,H2),e(et,R2),e(et,G),e(G,Q2),e(G,Yf),e(Yf,V2),e(G,K2),e(G,Zf),e(Zf,J2),e(G,G2),e(G,eu),e(eu,X2),e(G,Y2),e(G,tu),e(tu,Z2),e(G,e0),e(G,ou),e(ou,t0),e(G,o0),e(G,nu),e(nu,n0),e(G,s0),e(G,su),e(su,r0),e(G,a0),e(G,ru),e(ru,i0),e(G,l0),e(G,au),e(au,d0),e(G,c0),e(G,iu),e(iu,p0),e(G,h0),e(G,lu),e(lu,f0),e(G,u0),e(G,du),e(du,m0),e(G,g0),e(G,cu),e(cu,_0),e(G,T0),e(G,pu),e(pu,y0),e(G,k0),e(G,hu),e(hu,b0),e(G,v0),e(G,fu),e(fu,w0),e(G,F0),e(G,uu),e(uu,$0),e(G,x0),e(G,mu),e(mu,B0),e(G,E0),e(G,gu),e(gu,M0),e(G,z0),e(G,_u),e(_u,P0),e(G,q0),e(et,j0),e(et,Tu),e(Tu,C0),e(et,N0),b(Hi,et,null),f(i,N_,u),f(i,Nn,u),e(Nn,Hs),e(Hs,yu),b(Ri,yu,null),e(Nn,O0),e(Nn,ku),e(ku,I0),f(i,O_,u),f(i,Ke,u),b(Qi,Ke,null),e(Ke,A0),e(Ke,Vi),e(Vi,D0),e(Vi,bu),e(bu,L0),e(Vi,S0),e(Ke,U0),e(Ke,Ki),e(Ki,W0),e(Ki,sp),e(sp,H0),e(Ki,R0),e(Ke,Q0),e(Ke,Ji),e(Ji,V0),e(Ji,Gi),e(Gi,K0),e(Ji,J0),e(Ke,G0),b(Rs,Ke,null),e(Ke,X0),e(Ke,vt),b(Xi,vt,null),e(vt,Y0),e(vt,On),e(On,Z0),e(On,rp),e(rp,ex),e(On,tx),e(On,vu),e(vu,ox),e(On,nx),e(vt,sx),b(Qs,vt,null),e(vt,rx),e(vt,wu),e(wu,ax),e(vt,ix),b(Yi,vt,null),f(i,I_,u),f(i,In,u),e(In,Vs),e(Vs,Fu),b(Zi,Fu,null),e(In,lx),e(In,$u),e($u,dx),f(i,A_,u),f(i,Je,u),b(el,Je,null),e(Je,cx),e(Je,tl),e(tl,px),e(tl,xu),e(xu,hx),e(tl,fx),e(Je,ux),e(Je,ol),e(ol,mx),e(ol,ap),e(ap,gx),e(ol,_x),e(Je,Tx),e(Je,nl),e(nl,yx),e(nl,sl),e(sl,kx),e(nl,bx),e(Je,vx),b(Ks,Je,null),e(Je,wx),e(Je,wt),b(rl,wt,null),e(wt,Fx),e(wt,An),e(An,$x),e(An,ip),e(ip,xx),e(An,Bx),e(An,Bu),e(Bu,Ex),e(An,Mx),e(wt,zx),b(Js,wt,null),e(wt,Px),e(wt,Eu),e(Eu,qx),e(wt,jx),b(al,wt,null),f(i,D_,u),f(i,Dn,u),e(Dn,Gs),e(Gs,Mu),b(il,Mu,null),e(Dn,Cx),e(Dn,zu),e(zu,Nx),f(i,L_,u),f(i,Ge,u),b(ll,Ge,null),e(Ge,Ox),e(Ge,Pu),e(Pu,Ix),e(Ge,Ax),e(Ge,dl),e(dl,Dx),e(dl,lp),e(lp,Lx),e(dl,Sx),e(Ge,Ux),e(Ge,cl),e(cl,Wx),e(cl,pl),e(pl,Hx),e(cl,Rx),e(Ge,Qx),b(Xs,Ge,null),e(Ge,Vx),e(Ge,Ft),b(hl,Ft,null),e(Ft,Kx),e(Ft,Ln),e(Ln,Jx),e(Ln,dp),e(dp,Gx),e(Ln,Xx),e(Ln,qu),e(qu,Yx),e(Ln,Zx),e(Ft,eB),b(Ys,Ft,null),e(Ft,tB),e(Ft,ju),e(ju,oB),e(Ft,nB),b(fl,Ft,null),f(i,S_,u),f(i,Sn,u),e(Sn,Zs),e(Zs,Cu),b(ul,Cu,null),e(Sn,sB),e(Sn,Nu),e(Nu,rB),f(i,U_,u),f(i,Xe,u),b(ml,Xe,null),e(Xe,aB),e(Xe,Ou),e(Ou,iB),e(Xe,lB),e(Xe,gl),e(gl,dB),e(gl,cp),e(cp,cB),e(gl,pB),e(Xe,hB),e(Xe,_l),e(_l,fB),e(_l,Tl),e(Tl,uB),e(_l,mB),e(Xe,gB),b(er,Xe,null),e(Xe,_B),e(Xe,$t),b(yl,$t,null),e($t,TB),e($t,Un),e(Un,yB),e(Un,pp),e(pp,kB),e(Un,bB),e(Un,Iu),e(Iu,vB),e(Un,wB),e($t,FB),b(tr,$t,null),e($t,$B),e($t,Au),e(Au,xB),e($t,BB),b(kl,$t,null),f(i,W_,u),f(i,Wn,u),e(Wn,or),e(or,Du),b(bl,Du,null),e(Wn,EB),e(Wn,Lu),e(Lu,MB),f(i,H_,u),f(i,Ye,u),b(vl,Ye,null),e(Ye,zB),e(Ye,Su),e(Su,PB),e(Ye,qB),e(Ye,wl),e(wl,jB),e(wl,hp),e(hp,CB),e(wl,NB),e(Ye,OB),e(Ye,Fl),e(Fl,IB),e(Fl,$l),e($l,AB),e(Fl,DB),e(Ye,LB),b(nr,Ye,null),e(Ye,SB),e(Ye,xt),b(xl,xt,null),e(xt,UB),e(xt,Hn),e(Hn,WB),e(Hn,fp),e(fp,HB),e(Hn,RB),e(Hn,Uu),e(Uu,QB),e(Hn,VB),e(xt,KB),b(sr,xt,null),e(xt,JB),e(xt,Wu),e(Wu,GB),e(xt,XB),b(Bl,xt,null),f(i,R_,u),f(i,Rn,u),e(Rn,rr),e(rr,Hu),b(El,Hu,null),e(Rn,YB),e(Rn,Ru),e(Ru,ZB),f(i,Q_,u),f(i,Ze,u),b(Ml,Ze,null),e(Ze,eE),e(Ze,Qn),e(Qn,tE),e(Qn,Qu),e(Qu,oE),e(Qn,nE),e(Qn,Vu),e(Vu,sE),e(Qn,rE),e(Ze,aE),e(Ze,zl),e(zl,iE),e(zl,up),e(up,lE),e(zl,dE),e(Ze,cE),e(Ze,Pl),e(Pl,pE),e(Pl,ql),e(ql,hE),e(Pl,fE),e(Ze,uE),b(ar,Ze,null),e(Ze,mE),e(Ze,Bt),b(jl,Bt,null),e(Bt,gE),e(Bt,Vn),e(Vn,_E),e(Vn,mp),e(mp,TE),e(Vn,yE),e(Vn,Ku),e(Ku,kE),e(Vn,bE),e(Bt,vE),b(ir,Bt,null),e(Bt,wE),e(Bt,Ju),e(Ju,FE),e(Bt,$E),b(Cl,Bt,null),f(i,V_,u),f(i,Kn,u),e(Kn,lr),e(lr,Gu),b(Nl,Gu,null),e(Kn,xE),e(Kn,Xu),e(Xu,BE),f(i,K_,u),f(i,Oe,u),b(Ol,Oe,null),e(Oe,EE),e(Oe,Yu),e(Yu,ME),e(Oe,zE),e(Oe,Il),e(Il,PE),e(Il,gp),e(gp,qE),e(Il,jE),e(Oe,CE),e(Oe,Al),e(Al,NE),e(Al,Dl),e(Dl,OE),e(Al,IE),e(Oe,AE),e(Oe,Zu),e(Zu,DE),e(Oe,LE),e(Oe,lo),e(lo,em),e(em,Ll),e(Ll,SE),e(lo,UE),e(lo,tm),e(tm,Sl),e(Sl,WE),e(lo,HE),e(lo,om),e(om,Ul),e(Ul,RE),e(lo,QE),e(lo,nm),e(nm,Wl),e(Wl,VE),e(Oe,KE),e(Oe,Et),b(Hl,Et,null),e(Et,JE),e(Et,Jn),e(Jn,GE),e(Jn,sm),e(sm,XE),e(Jn,YE),e(Jn,rm),e(rm,ZE),e(Jn,eM),e(Et,tM),b(dr,Et,null),e(Et,oM),e(Et,am),e(am,nM),e(Et,sM),b(Rl,Et,null),f(i,J_,u),f(i,Gn,u),e(Gn,cr),e(cr,im),b(Ql,im,null),e(Gn,rM),e(Gn,lm),e(lm,aM),f(i,G_,u),f(i,Ie,u),b(Vl,Ie,null),e(Ie,iM),e(Ie,Xn),e(Xn,lM),e(Xn,dm),e(dm,dM),e(Xn,cM),e(Xn,cm),e(cm,pM),e(Xn,hM),e(Ie,fM),e(Ie,Kl),e(Kl,uM),e(Kl,_p),e(_p,mM),e(Kl,gM),e(Ie,_M),e(Ie,Jl),e(Jl,TM),e(Jl,Gl),e(Gl,yM),e(Jl,kM),e(Ie,bM),e(Ie,pm),e(pm,vM),e(Ie,wM),e(Ie,co),e(co,hm),e(hm,Xl),e(Xl,FM),e(co,$M),e(co,fm),e(fm,Yl),e(Yl,xM),e(co,BM),e(co,um),e(um,Zl),e(Zl,EM),e(co,MM),e(co,mm),e(mm,ed),e(ed,zM),e(Ie,PM),e(Ie,Mt),b(td,Mt,null),e(Mt,qM),e(Mt,Yn),e(Yn,jM),e(Yn,gm),e(gm,CM),e(Yn,NM),e(Yn,_m),e(_m,OM),e(Yn,IM),e(Mt,AM),b(pr,Mt,null),e(Mt,DM),e(Mt,Tm),e(Tm,LM),e(Mt,SM),b(od,Mt,null),f(i,X_,u),f(i,Zn,u),e(Zn,hr),e(hr,ym),b(nd,ym,null),e(Zn,UM),e(Zn,km),e(km,WM),f(i,Y_,u),f(i,Ae,u),b(sd,Ae,null),e(Ae,HM),e(Ae,rd),e(rd,RM),e(rd,bm),e(bm,QM),e(rd,VM),e(Ae,KM),e(Ae,ad),e(ad,JM),e(ad,Tp),e(Tp,GM),e(ad,XM),e(Ae,YM),e(Ae,id),e(id,ZM),e(id,ld),e(ld,e3),e(id,t3),e(Ae,o3),e(Ae,vm),e(vm,n3),e(Ae,s3),e(Ae,po),e(po,wm),e(wm,dd),e(dd,r3),e(po,a3),e(po,Fm),e(Fm,cd),e(cd,i3),e(po,l3),e(po,$m),e($m,pd),e(pd,d3),e(po,c3),e(po,xm),e(xm,hd),e(hd,p3),e(Ae,h3),e(Ae,zt),b(fd,zt,null),e(zt,f3),e(zt,es),e(es,u3),e(es,Bm),e(Bm,m3),e(es,g3),e(es,Em),e(Em,_3),e(es,T3),e(zt,y3),b(fr,zt,null),e(zt,k3),e(zt,Mm),e(Mm,b3),e(zt,v3),b(ud,zt,null),f(i,Z_,u),f(i,ts,u),e(ts,ur),e(ur,zm),b(md,zm,null),e(ts,w3),e(ts,Pm),e(Pm,F3),f(i,eT,u),f(i,De,u),b(gd,De,null),e(De,$3),e(De,_d),e(_d,x3),e(_d,qm),e(qm,B3),e(_d,E3),e(De,M3),e(De,Td),e(Td,z3),e(Td,yp),e(yp,P3),e(Td,q3),e(De,j3),e(De,yd),e(yd,C3),e(yd,kd),e(kd,N3),e(yd,O3),e(De,I3),e(De,jm),e(jm,A3),e(De,D3),e(De,ho),e(ho,Cm),e(Cm,bd),e(bd,L3),e(ho,S3),e(ho,Nm),e(Nm,vd),e(vd,U3),e(ho,W3),e(ho,Om),e(Om,wd),e(wd,H3),e(ho,R3),e(ho,Im),e(Im,Fd),e(Fd,Q3),e(De,V3),e(De,Pt),b($d,Pt,null),e(Pt,K3),e(Pt,os),e(os,J3),e(os,Am),e(Am,G3),e(os,X3),e(os,Dm),e(Dm,Y3),e(os,Z3),e(Pt,ez),b(mr,Pt,null),e(Pt,tz),e(Pt,Lm),e(Lm,oz),e(Pt,nz),b(xd,Pt,null),f(i,tT,u),f(i,ns,u),e(ns,gr),e(gr,Sm),b(Bd,Sm,null),e(ns,sz),e(ns,Um),e(Um,rz),f(i,oT,u),f(i,Le,u),b(Ed,Le,null),e(Le,az),e(Le,Wm),e(Wm,iz),e(Le,lz),e(Le,Md),e(Md,dz),e(Md,kp),e(kp,cz),e(Md,pz),e(Le,hz),e(Le,zd),e(zd,fz),e(zd,Pd),e(Pd,uz),e(zd,mz),e(Le,gz),e(Le,Hm),e(Hm,_z),e(Le,Tz),e(Le,fo),e(fo,Rm),e(Rm,qd),e(qd,yz),e(fo,kz),e(fo,Qm),e(Qm,jd),e(jd,bz),e(fo,vz),e(fo,Vm),e(Vm,Cd),e(Cd,wz),e(fo,Fz),e(fo,Km),e(Km,Nd),e(Nd,$z),e(Le,xz),e(Le,qt),b(Od,qt,null),e(qt,Bz),e(qt,ss),e(ss,Ez),e(ss,Jm),e(Jm,Mz),e(ss,zz),e(ss,Gm),e(Gm,Pz),e(ss,qz),e(qt,jz),b(_r,qt,null),e(qt,Cz),e(qt,Xm),e(Xm,Nz),e(qt,Oz),b(Id,qt,null),f(i,nT,u),f(i,rs,u),e(rs,Tr),e(Tr,Ym),b(Ad,Ym,null),e(rs,Iz),e(rs,Zm),e(Zm,Az),f(i,sT,u),f(i,Se,u),b(Dd,Se,null),e(Se,Dz),e(Se,eg),e(eg,Lz),e(Se,Sz),e(Se,Ld),e(Ld,Uz),e(Ld,bp),e(bp,Wz),e(Ld,Hz),e(Se,Rz),e(Se,Sd),e(Sd,Qz),e(Sd,Ud),e(Ud,Vz),e(Sd,Kz),e(Se,Jz),e(Se,tg),e(tg,Gz),e(Se,Xz),e(Se,uo),e(uo,og),e(og,Wd),e(Wd,Yz),e(uo,Zz),e(uo,ng),e(ng,Hd),e(Hd,e5),e(uo,t5),e(uo,sg),e(sg,Rd),e(Rd,o5),e(uo,n5),e(uo,rg),e(rg,Qd),e(Qd,s5),e(Se,r5),e(Se,jt),b(Vd,jt,null),e(jt,a5),e(jt,as),e(as,i5),e(as,ag),e(ag,l5),e(as,d5),e(as,ig),e(ig,c5),e(as,p5),e(jt,h5),b(yr,jt,null),e(jt,f5),e(jt,lg),e(lg,u5),e(jt,m5),b(Kd,jt,null),f(i,rT,u),f(i,is,u),e(is,kr),e(kr,dg),b(Jd,dg,null),e(is,g5),e(is,cg),e(cg,_5),f(i,aT,u),f(i,Ue,u),b(Gd,Ue,null),e(Ue,T5),e(Ue,pg),e(pg,y5),e(Ue,k5),e(Ue,Xd),e(Xd,b5),e(Xd,vp),e(vp,v5),e(Xd,w5),e(Ue,F5),e(Ue,Yd),e(Yd,$5),e(Yd,Zd),e(Zd,x5),e(Yd,B5),e(Ue,E5),e(Ue,hg),e(hg,M5),e(Ue,z5),e(Ue,mo),e(mo,fg),e(fg,ec),e(ec,P5),e(mo,q5),e(mo,ug),e(ug,tc),e(tc,j5),e(mo,C5),e(mo,mg),e(mg,oc),e(oc,N5),e(mo,O5),e(mo,gg),e(gg,nc),e(nc,I5),e(Ue,A5),e(Ue,Ct),b(sc,Ct,null),e(Ct,D5),e(Ct,ls),e(ls,L5),e(ls,_g),e(_g,S5),e(ls,U5),e(ls,Tg),e(Tg,W5),e(ls,H5),e(Ct,R5),b(br,Ct,null),e(Ct,Q5),e(Ct,yg),e(yg,V5),e(Ct,K5),b(rc,Ct,null),f(i,iT,u),f(i,ds,u),e(ds,vr),e(vr,kg),b(ac,kg,null),e(ds,J5),e(ds,bg),e(bg,G5),f(i,lT,u),f(i,We,u),b(ic,We,null),e(We,X5),e(We,cs),e(cs,Y5),e(cs,vg),e(vg,Z5),e(cs,eP),e(cs,wg),e(wg,tP),e(cs,oP),e(We,nP),e(We,lc),e(lc,sP),e(lc,wp),e(wp,rP),e(lc,aP),e(We,iP),e(We,dc),e(dc,lP),e(dc,cc),e(cc,dP),e(dc,cP),e(We,pP),e(We,Fg),e(Fg,hP),e(We,fP),e(We,go),e(go,$g),e($g,pc),e(pc,uP),e(go,mP),e(go,xg),e(xg,hc),e(hc,gP),e(go,_P),e(go,Bg),e(Bg,fc),e(fc,TP),e(go,yP),e(go,Eg),e(Eg,uc),e(uc,kP),e(We,bP),e(We,Nt),b(mc,Nt,null),e(Nt,vP),e(Nt,ps),e(ps,wP),e(ps,Mg),e(Mg,FP),e(ps,$P),e(ps,zg),e(zg,xP),e(ps,BP),e(Nt,EP),b(wr,Nt,null),e(Nt,MP),e(Nt,Pg),e(Pg,zP),e(Nt,PP),b(gc,Nt,null),dT=!0},p(i,[u]){const _c={};u&2&&(_c.$$scope={dirty:u,ctx:i}),ks.$set(_c);const qg={};u&2&&(qg.$$scope={dirty:u,ctx:i}),vs.$set(qg);const jg={};u&2&&(jg.$$scope={dirty:u,ctx:i}),Fs.$set(jg);const Cg={};u&2&&(Cg.$$scope={dirty:u,ctx:i}),xs.$set(Cg);const Tc={};u&2&&(Tc.$$scope={dirty:u,ctx:i}),Es.$set(Tc);const Ng={};u&2&&(Ng.$$scope={dirty:u,ctx:i}),zs.$set(Ng);const Og={};u&2&&(Og.$$scope={dirty:u,ctx:i}),qs.$set(Og);const Ig={};u&2&&(Ig.$$scope={dirty:u,ctx:i}),Cs.$set(Ig);const yc={};u&2&&(yc.$$scope={dirty:u,ctx:i}),Os.$set(yc);const Ag={};u&2&&(Ag.$$scope={dirty:u,ctx:i}),As.$set(Ag);const Dg={};u&2&&(Dg.$$scope={dirty:u,ctx:i}),Ds.$set(Dg);const Lg={};u&2&&(Lg.$$scope={dirty:u,ctx:i}),Ss.$set(Lg);const Sg={};u&2&&(Sg.$$scope={dirty:u,ctx:i}),Us.$set(Sg);const Ug={};u&2&&(Ug.$$scope={dirty:u,ctx:i}),Rs.$set(Ug);const Wg={};u&2&&(Wg.$$scope={dirty:u,ctx:i}),Qs.$set(Wg);const Hg={};u&2&&(Hg.$$scope={dirty:u,ctx:i}),Ks.$set(Hg);const kc={};u&2&&(kc.$$scope={dirty:u,ctx:i}),Js.$set(kc);const Rg={};u&2&&(Rg.$$scope={dirty:u,ctx:i}),Xs.$set(Rg);const Qg={};u&2&&(Qg.$$scope={dirty:u,ctx:i}),Ys.$set(Qg);const hs={};u&2&&(hs.$$scope={dirty:u,ctx:i}),er.$set(hs);const Vg={};u&2&&(Vg.$$scope={dirty:u,ctx:i}),tr.$set(Vg);const Kg={};u&2&&(Kg.$$scope={dirty:u,ctx:i}),nr.$set(Kg);const bc={};u&2&&(bc.$$scope={dirty:u,ctx:i}),sr.$set(bc);const Jg={};u&2&&(Jg.$$scope={dirty:u,ctx:i}),ar.$set(Jg);const Gg={};u&2&&(Gg.$$scope={dirty:u,ctx:i}),ir.$set(Gg);const Xg={};u&2&&(Xg.$$scope={dirty:u,ctx:i}),dr.$set(Xg);const Kt={};u&2&&(Kt.$$scope={dirty:u,ctx:i}),pr.$set(Kt);const _o={};u&2&&(_o.$$scope={dirty:u,ctx:i}),fr.$set(_o);const Yg={};u&2&&(Yg.$$scope={dirty:u,ctx:i}),mr.$set(Yg);const Zg={};u&2&&(Zg.$$scope={dirty:u,ctx:i}),_r.$set(Zg);const e_={};u&2&&(e_.$$scope={dirty:u,ctx:i}),yr.$set(e_);const fs={};u&2&&(fs.$$scope={dirty:u,ctx:i}),br.$set(fs);const t_={};u&2&&(t_.$$scope={dirty:u,ctx:i}),wr.$set(t_)},i(i){dT||(v(_.$$.fragment,i),v(oe.$$.fragment,i),v(xe.$$.fragment,i),v(Cr.$$.fragment,i),v(Or.$$.fragment,i),v(Ir.$$.fragment,i),v(Ar.$$.fragment,i),v(Lr.$$.fragment,i),v(Ur.$$.fragment,i),v(Hr.$$.fragment,i),v(Rr.$$.fragment,i),v(Qr.$$.fragment,i),v(Vr.$$.fragment,i),v(Kr.$$.fragment,i),v(Xr.$$.fragment,i),v(Zr.$$.fragment,i),v(ea.$$.fragment,i),v(ta.$$.fragment,i),v(oa.$$.fragment,i),v(sa.$$.fragment,i),v(aa.$$.fragment,i),v(la.$$.fragment,i),v(da.$$.fragment,i),v(ca.$$.fragment,i),v(ga.$$.fragment,i),v(ks.$$.fragment,i),v(_a.$$.fragment,i),v(Ta.$$.fragment,i),v(ya.$$.fragment,i),v(wa.$$.fragment,i),v(vs.$$.fragment,i),v(Fa.$$.fragment,i),v($a.$$.fragment,i),v(xa.$$.fragment,i),v(Pa.$$.fragment,i),v(Fs.$$.fragment,i),v(qa.$$.fragment,i),v(ja.$$.fragment,i),v(Ca.$$.fragment,i),v(Da.$$.fragment,i),v(xs.$$.fragment,i),v(La.$$.fragment,i),v(Sa.$$.fragment,i),v(Ua.$$.fragment,i),v(Va.$$.fragment,i),v(Es.$$.fragment,i),v(Ka.$$.fragment,i),v(Ja.$$.fragment,i),v(Ga.$$.fragment,i),v(ei.$$.fragment,i),v(zs.$$.fragment,i),v(ti.$$.fragment,i),v(oi.$$.fragment,i),v(ni.$$.fragment,i),v(si.$$.fragment,i),v(li.$$.fragment,i),v(qs.$$.fragment,i),v(di.$$.fragment,i),v(ci.$$.fragment,i),v(pi.$$.fragment,i),v(mi.$$.fragment,i),v(Cs.$$.fragment,i),v(gi.$$.fragment,i),v(_i.$$.fragment,i),v(Ti.$$.fragment,i),v(vi.$$.fragment,i),v(Os.$$.fragment,i),v(wi.$$.fragment,i),v(Fi.$$.fragment,i),v($i.$$.fragment,i),v(As.$$.fragment,i),v(Mi.$$.fragment,i),v(Ds.$$.fragment,i),v(zi.$$.fragment,i),v(Pi.$$.fragment,i),v(qi.$$.fragment,i),v(Ss.$$.fragment,i),v(Oi.$$.fragment,i),v(Us.$$.fragment,i),v(Ii.$$.fragment,i),v(Ai.$$.fragment,i),v(Di.$$.fragment,i),v(Li.$$.fragment,i),v(Hi.$$.fragment,i),v(Ri.$$.fragment,i),v(Qi.$$.fragment,i),v(Rs.$$.fragment,i),v(Xi.$$.fragment,i),v(Qs.$$.fragment,i),v(Yi.$$.fragment,i),v(Zi.$$.fragment,i),v(el.$$.fragment,i),v(Ks.$$.fragment,i),v(rl.$$.fragment,i),v(Js.$$.fragment,i),v(al.$$.fragment,i),v(il.$$.fragment,i),v(ll.$$.fragment,i),v(Xs.$$.fragment,i),v(hl.$$.fragment,i),v(Ys.$$.fragment,i),v(fl.$$.fragment,i),v(ul.$$.fragment,i),v(ml.$$.fragment,i),v(er.$$.fragment,i),v(yl.$$.fragment,i),v(tr.$$.fragment,i),v(kl.$$.fragment,i),v(bl.$$.fragment,i),v(vl.$$.fragment,i),v(nr.$$.fragment,i),v(xl.$$.fragment,i),v(sr.$$.fragment,i),v(Bl.$$.fragment,i),v(El.$$.fragment,i),v(Ml.$$.fragment,i),v(ar.$$.fragment,i),v(jl.$$.fragment,i),v(ir.$$.fragment,i),v(Cl.$$.fragment,i),v(Nl.$$.fragment,i),v(Ol.$$.fragment,i),v(Hl.$$.fragment,i),v(dr.$$.fragment,i),v(Rl.$$.fragment,i),v(Ql.$$.fragment,i),v(Vl.$$.fragment,i),v(td.$$.fragment,i),v(pr.$$.fragment,i),v(od.$$.fragment,i),v(nd.$$.fragment,i),v(sd.$$.fragment,i),v(fd.$$.fragment,i),v(fr.$$.fragment,i),v(ud.$$.fragment,i),v(md.$$.fragment,i),v(gd.$$.fragment,i),v($d.$$.fragment,i),v(mr.$$.fragment,i),v(xd.$$.fragment,i),v(Bd.$$.fragment,i),v(Ed.$$.fragment,i),v(Od.$$.fragment,i),v(_r.$$.fragment,i),v(Id.$$.fragment,i),v(Ad.$$.fragment,i),v(Dd.$$.fragment,i),v(Vd.$$.fragment,i),v(yr.$$.fragment,i),v(Kd.$$.fragment,i),v(Jd.$$.fragment,i),v(Gd.$$.fragment,i),v(sc.$$.fragment,i),v(br.$$.fragment,i),v(rc.$$.fragment,i),v(ac.$$.fragment,i),v(ic.$$.fragment,i),v(mc.$$.fragment,i),v(wr.$$.fragment,i),v(gc.$$.fragment,i),dT=!0)},o(i){w(_.$$.fragment,i),w(oe.$$.fragment,i),w(xe.$$.fragment,i),w(Cr.$$.fragment,i),w(Or.$$.fragment,i),w(Ir.$$.fragment,i),w(Ar.$$.fragment,i),w(Lr.$$.fragment,i),w(Ur.$$.fragment,i),w(Hr.$$.fragment,i),w(Rr.$$.fragment,i),w(Qr.$$.fragment,i),w(Vr.$$.fragment,i),w(Kr.$$.fragment,i),w(Xr.$$.fragment,i),w(Zr.$$.fragment,i),w(ea.$$.fragment,i),w(ta.$$.fragment,i),w(oa.$$.fragment,i),w(sa.$$.fragment,i),w(aa.$$.fragment,i),w(la.$$.fragment,i),w(da.$$.fragment,i),w(ca.$$.fragment,i),w(ga.$$.fragment,i),w(ks.$$.fragment,i),w(_a.$$.fragment,i),w(Ta.$$.fragment,i),w(ya.$$.fragment,i),w(wa.$$.fragment,i),w(vs.$$.fragment,i),w(Fa.$$.fragment,i),w($a.$$.fragment,i),w(xa.$$.fragment,i),w(Pa.$$.fragment,i),w(Fs.$$.fragment,i),w(qa.$$.fragment,i),w(ja.$$.fragment,i),w(Ca.$$.fragment,i),w(Da.$$.fragment,i),w(xs.$$.fragment,i),w(La.$$.fragment,i),w(Sa.$$.fragment,i),w(Ua.$$.fragment,i),w(Va.$$.fragment,i),w(Es.$$.fragment,i),w(Ka.$$.fragment,i),w(Ja.$$.fragment,i),w(Ga.$$.fragment,i),w(ei.$$.fragment,i),w(zs.$$.fragment,i),w(ti.$$.fragment,i),w(oi.$$.fragment,i),w(ni.$$.fragment,i),w(si.$$.fragment,i),w(li.$$.fragment,i),w(qs.$$.fragment,i),w(di.$$.fragment,i),w(ci.$$.fragment,i),w(pi.$$.fragment,i),w(mi.$$.fragment,i),w(Cs.$$.fragment,i),w(gi.$$.fragment,i),w(_i.$$.fragment,i),w(Ti.$$.fragment,i),w(vi.$$.fragment,i),w(Os.$$.fragment,i),w(wi.$$.fragment,i),w(Fi.$$.fragment,i),w($i.$$.fragment,i),w(As.$$.fragment,i),w(Mi.$$.fragment,i),w(Ds.$$.fragment,i),w(zi.$$.fragment,i),w(Pi.$$.fragment,i),w(qi.$$.fragment,i),w(Ss.$$.fragment,i),w(Oi.$$.fragment,i),w(Us.$$.fragment,i),w(Ii.$$.fragment,i),w(Ai.$$.fragment,i),w(Di.$$.fragment,i),w(Li.$$.fragment,i),w(Hi.$$.fragment,i),w(Ri.$$.fragment,i),w(Qi.$$.fragment,i),w(Rs.$$.fragment,i),w(Xi.$$.fragment,i),w(Qs.$$.fragment,i),w(Yi.$$.fragment,i),w(Zi.$$.fragment,i),w(el.$$.fragment,i),w(Ks.$$.fragment,i),w(rl.$$.fragment,i),w(Js.$$.fragment,i),w(al.$$.fragment,i),w(il.$$.fragment,i),w(ll.$$.fragment,i),w(Xs.$$.fragment,i),w(hl.$$.fragment,i),w(Ys.$$.fragment,i),w(fl.$$.fragment,i),w(ul.$$.fragment,i),w(ml.$$.fragment,i),w(er.$$.fragment,i),w(yl.$$.fragment,i),w(tr.$$.fragment,i),w(kl.$$.fragment,i),w(bl.$$.fragment,i),w(vl.$$.fragment,i),w(nr.$$.fragment,i),w(xl.$$.fragment,i),w(sr.$$.fragment,i),w(Bl.$$.fragment,i),w(El.$$.fragment,i),w(Ml.$$.fragment,i),w(ar.$$.fragment,i),w(jl.$$.fragment,i),w(ir.$$.fragment,i),w(Cl.$$.fragment,i),w(Nl.$$.fragment,i),w(Ol.$$.fragment,i),w(Hl.$$.fragment,i),w(dr.$$.fragment,i),w(Rl.$$.fragment,i),w(Ql.$$.fragment,i),w(Vl.$$.fragment,i),w(td.$$.fragment,i),w(pr.$$.fragment,i),w(od.$$.fragment,i),w(nd.$$.fragment,i),w(sd.$$.fragment,i),w(fd.$$.fragment,i),w(fr.$$.fragment,i),w(ud.$$.fragment,i),w(md.$$.fragment,i),w(gd.$$.fragment,i),w($d.$$.fragment,i),w(mr.$$.fragment,i),w(xd.$$.fragment,i),w(Bd.$$.fragment,i),w(Ed.$$.fragment,i),w(Od.$$.fragment,i),w(_r.$$.fragment,i),w(Id.$$.fragment,i),w(Ad.$$.fragment,i),w(Dd.$$.fragment,i),w(Vd.$$.fragment,i),w(yr.$$.fragment,i),w(Kd.$$.fragment,i),w(Jd.$$.fragment,i),w(Gd.$$.fragment,i),w(sc.$$.fragment,i),w(br.$$.fragment,i),w(rc.$$.fragment,i),w(ac.$$.fragment,i),w(ic.$$.fragment,i),w(mc.$$.fragment,i),w(wr.$$.fragment,i),w(gc.$$.fragment,i),dT=!1},d(i){t(p),i&&t(x),i&&t(g),F(_),i&&t(X),i&&t(M),F(oe),i&&t(ce),i&&t(J),i&&t(q),i&&t(se),i&&t(pe),i&&t(re),i&&t(he),i&&t(P),i&&t(fe),i&&t(ae),i&&t(ue),i&&t(te),i&&t(E),i&&t(K),i&&t(W),i&&t(ke),F(xe),i&&t(o_),i&&t(ot),F(Cr),F(Or),i&&t(n_),i&&t(en),F(Ir),i&&t(s_),i&&t(je),F(Ar),F(Lr),F(Ur),F(Hr),F(Rr),F(Qr),i&&t(r_),i&&t(on),F(Vr),i&&t(a_),i&&t(nt),F(Kr),F(Xr),F(Zr),F(ea),i&&t(i_),i&&t(sn),F(ta),i&&t(l_),i&&t(rn),F(oa),i&&t(d_),i&&t(an),F(sa),i&&t(c_),i&&t(io),F(aa),F(la),i&&t(p_),i&&t(ln),F(da),i&&t(h_),i&&t(Ce),F(ca),F(ga),F(ks),F(_a),i&&t(f_),i&&t(cn),F(Ta),i&&t(u_),i&&t(st),F(ya),F(wa),F(vs),F(Fa),i&&t(m_),i&&t(fn),F($a),i&&t(g_),i&&t(rt),F(xa),F(Pa),F(Fs),F(qa),i&&t(__),i&&t(mn),F(ja),i&&t(T_),i&&t(at),F(Ca),F(Da),F(xs),F(La),i&&t(y_),i&&t(_n),F(Sa),i&&t(k_),i&&t(it),F(Ua),F(Va),F(Es),F(Ka),i&&t(b_),i&&t(yn),F(Ja),i&&t(v_),i&&t(lt),F(Ga),F(ei),F(zs),F(ti),F(oi),i&&t(w_),i&&t(bn),F(ni),i&&t(F_),i&&t(dt),F(si),F(li),F(qs),F(di),i&&t($_),i&&t(wn),F(ci),i&&t(x_),i&&t(ct),F(pi),F(mi),F(Cs),F(gi),i&&t(B_),i&&t($n),F(_i),i&&t(E_),i&&t(pt),F(Ti),F(vi),F(Os),F(wi),i&&t(M_),i&&t(En),F(Fi),i&&t(z_),i&&t(Qe),F($i),F(As),F(Mi),F(Ds),F(zi),i&&t(P_),i&&t(zn),F(Pi),i&&t(q_),i&&t(Ve),F(qi),F(Ss),F(Oi),F(Us),F(Ii),i&&t(j_),i&&t(jn),F(Ai),i&&t(C_),i&&t(Cn),F(Di),F(Li),F(Hi),i&&t(N_),i&&t(Nn),F(Ri),i&&t(O_),i&&t(Ke),F(Qi),F(Rs),F(Xi),F(Qs),F(Yi),i&&t(I_),i&&t(In),F(Zi),i&&t(A_),i&&t(Je),F(el),F(Ks),F(rl),F(Js),F(al),i&&t(D_),i&&t(Dn),F(il),i&&t(L_),i&&t(Ge),F(ll),F(Xs),F(hl),F(Ys),F(fl),i&&t(S_),i&&t(Sn),F(ul),i&&t(U_),i&&t(Xe),F(ml),F(er),F(yl),F(tr),F(kl),i&&t(W_),i&&t(Wn),F(bl),i&&t(H_),i&&t(Ye),F(vl),F(nr),F(xl),F(sr),F(Bl),i&&t(R_),i&&t(Rn),F(El),i&&t(Q_),i&&t(Ze),F(Ml),F(ar),F(jl),F(ir),F(Cl),i&&t(V_),i&&t(Kn),F(Nl),i&&t(K_),i&&t(Oe),F(Ol),F(Hl),F(dr),F(Rl),i&&t(J_),i&&t(Gn),F(Ql),i&&t(G_),i&&t(Ie),F(Vl),F(td),F(pr),F(od),i&&t(X_),i&&t(Zn),F(nd),i&&t(Y_),i&&t(Ae),F(sd),F(fd),F(fr),F(ud),i&&t(Z_),i&&t(ts),F(md),i&&t(eT),i&&t(De),F(gd),F($d),F(mr),F(xd),i&&t(tT),i&&t(ns),F(Bd),i&&t(oT),i&&t(Le),F(Ed),F(Od),F(_r),F(Id),i&&t(nT),i&&t(rs),F(Ad),i&&t(sT),i&&t(Se),F(Dd),F(Vd),F(yr),F(Kd),i&&t(rT),i&&t(is),F(Jd),i&&t(aT),i&&t(Ue),F(Gd),F(sc),F(br),F(rc),i&&t(iT),i&&t(ds),F(ac),i&&t(lT),i&&t(We),F(ic),F(mc),F(wr),F(gc)}}}const yN={local:"bert",sections:[{local:"overview",title:"Overview"},{local:"transformers.BertConfig",title:"BertConfig"},{local:"transformers.BertTokenizer",title:"BertTokenizer"},{local:"transformers.BertTokenizerFast",title:"BertTokenizerFast"},{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.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 kN(j,p,x){let{fw:g}=p;return j.$$set=T=>{"fw"in T&&x(0,g=T.fw)},[g]}class BN extends N6{constructor(p){super();O6(this,p,kN,TN,I6,{fw:0})}}export{BN as default,yN as metadata};
