import{S as rM,i as aM,s as iM,e as r,k as l,w,t as n,M as lM,c as a,d as t,m as d,a as i,x as y,h as s,b as p,F as e,g as m,y as $,q as F,o as B,B as E}from"../../chunks/vendor-4833417e.js";import{T as Ee}from"../../chunks/Tip-fffd6df1.js";import{D as ie}from"../../chunks/Docstring-4f315ed9.js";import{C as qe}from"../../chunks/CodeBlock-6a3d1b46.js";import{I as ze}from"../../chunks/IconCopyLink-4b81c553.js";import"../../chunks/CopyButton-dacfbfaf.js";function dM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function cM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function pM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function hM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function mM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function uM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function fM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function gM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function _M(R){let h,k,f,g,T,b,_,M,he,K,z,Z,I,ee,me,D,ue,le,V,j,te,G,P,x,ne,H,de,se,L,fe,ce,q,ge,W,X,re,Q,_e,ae,N,pe,A,be;return{c(){h=r("p"),k=n("TF 2.0 models accepts two formats as inputs:"),f=l(),g=r("ul"),T=r("li"),b=n("having all inputs as keyword arguments (like PyTorch models), or"),_=l(),M=r("li"),he=n("having all inputs as a list, tuple or dict in the first positional arguments."),K=l(),z=r("p"),Z=n("This second option is useful when using "),I=r("code"),ee=n("tf.keras.Model.fit"),me=n(` method which currently requires having all the
tensors in the first argument of the model call function: `),D=r("code"),ue=n("model(inputs)"),le=n("."),V=l(),j=r("p"),te=n(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),G=l(),P=r("ul"),x=r("li"),ne=n("a single Tensor with "),H=r("code"),de=n("input_ids"),se=n(" only and nothing else: "),L=r("code"),fe=n("model(inputs_ids)"),ce=l(),q=r("li"),ge=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=r("code"),X=n("model([input_ids, attention_mask])"),re=n(" or "),Q=r("code"),_e=n("model([input_ids, attention_mask, token_type_ids])"),ae=l(),N=r("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=r("code"),be=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(c){h=a(c,"P",{});var v=i(h);k=s(v,"TF 2.0 models accepts two formats as inputs:"),v.forEach(t),f=d(c),g=a(c,"UL",{});var J=i(g);T=a(J,"LI",{});var ke=i(T);b=s(ke,"having all inputs as keyword arguments (like PyTorch models), or"),ke.forEach(t),_=d(J),M=a(J,"LI",{});var $e=i(M);he=s($e,"having all inputs as a list, tuple or dict in the first positional arguments."),$e.forEach(t),J.forEach(t),K=d(c),z=a(c,"P",{});var S=i(z);Z=s(S,"This second option is useful when using "),I=a(S,"CODE",{});var we=i(I);ee=s(we,"tf.keras.Model.fit"),we.forEach(t),me=s(S,` method which currently requires having all the
tensors in the first argument of the model call function: `),D=a(S,"CODE",{});var Te=i(D);ue=s(Te,"model(inputs)"),Te.forEach(t),le=s(S,"."),S.forEach(t),V=d(c),j=a(c,"P",{});var ve=i(j);te=s(ve,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ve.forEach(t),G=d(c),P=a(c,"UL",{});var C=i(P);x=a(C,"LI",{});var O=i(x);ne=s(O,"a single Tensor with "),H=a(O,"CODE",{});var Fe=i(H);de=s(Fe,"input_ids"),Fe.forEach(t),se=s(O," only and nothing else: "),L=a(O,"CODE",{});var Me=i(L);fe=s(Me,"model(inputs_ids)"),Me.forEach(t),O.forEach(t),ce=d(C),q=a(C,"LI",{});var U=i(q);ge=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=a(U,"CODE",{});var ye=i(W);X=s(ye,"model([input_ids, attention_mask])"),ye.forEach(t),re=s(U," or "),Q=a(U,"CODE",{});var Y=i(Q);_e=s(Y,"model([input_ids, attention_mask, token_type_ids])"),Y.forEach(t),U.forEach(t),ae=d(C),N=a(C,"LI",{});var oe=i(N);pe=s(oe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=a(oe,"CODE",{});var Be=i(A);be=s(Be,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Be.forEach(t),oe.forEach(t),C.forEach(t)},m(c,v){m(c,h,v),e(h,k),m(c,f,v),m(c,g,v),e(g,T),e(T,b),e(g,_),e(g,M),e(M,he),m(c,K,v),m(c,z,v),e(z,Z),e(z,I),e(I,ee),e(z,me),e(z,D),e(D,ue),e(z,le),m(c,V,v),m(c,j,v),e(j,te),m(c,G,v),m(c,P,v),e(P,x),e(x,ne),e(x,H),e(H,de),e(x,se),e(x,L),e(L,fe),e(P,ce),e(P,q),e(q,ge),e(q,W),e(W,X),e(q,re),e(q,Q),e(Q,_e),e(P,ae),e(P,N),e(N,pe),e(N,A),e(A,be)},d(c){c&&t(h),c&&t(f),c&&t(g),c&&t(K),c&&t(z),c&&t(V),c&&t(j),c&&t(G),c&&t(P)}}}function bM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function TM(R){let h,k,f,g,T,b,_,M,he,K,z,Z,I,ee,me,D,ue,le,V,j,te,G,P,x,ne,H,de,se,L,fe,ce,q,ge,W,X,re,Q,_e,ae,N,pe,A,be;return{c(){h=r("p"),k=n("TF 2.0 models accepts two formats as inputs:"),f=l(),g=r("ul"),T=r("li"),b=n("having all inputs as keyword arguments (like PyTorch models), or"),_=l(),M=r("li"),he=n("having all inputs as a list, tuple or dict in the first positional arguments."),K=l(),z=r("p"),Z=n("This second option is useful when using "),I=r("code"),ee=n("tf.keras.Model.fit"),me=n(` method which currently requires having all the
tensors in the first argument of the model call function: `),D=r("code"),ue=n("model(inputs)"),le=n("."),V=l(),j=r("p"),te=n(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),G=l(),P=r("ul"),x=r("li"),ne=n("a single Tensor with "),H=r("code"),de=n("input_ids"),se=n(" only and nothing else: "),L=r("code"),fe=n("model(inputs_ids)"),ce=l(),q=r("li"),ge=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=r("code"),X=n("model([input_ids, attention_mask])"),re=n(" or "),Q=r("code"),_e=n("model([input_ids, attention_mask, token_type_ids])"),ae=l(),N=r("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=r("code"),be=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(c){h=a(c,"P",{});var v=i(h);k=s(v,"TF 2.0 models accepts two formats as inputs:"),v.forEach(t),f=d(c),g=a(c,"UL",{});var J=i(g);T=a(J,"LI",{});var ke=i(T);b=s(ke,"having all inputs as keyword arguments (like PyTorch models), or"),ke.forEach(t),_=d(J),M=a(J,"LI",{});var $e=i(M);he=s($e,"having all inputs as a list, tuple or dict in the first positional arguments."),$e.forEach(t),J.forEach(t),K=d(c),z=a(c,"P",{});var S=i(z);Z=s(S,"This second option is useful when using "),I=a(S,"CODE",{});var we=i(I);ee=s(we,"tf.keras.Model.fit"),we.forEach(t),me=s(S,` method which currently requires having all the
tensors in the first argument of the model call function: `),D=a(S,"CODE",{});var Te=i(D);ue=s(Te,"model(inputs)"),Te.forEach(t),le=s(S,"."),S.forEach(t),V=d(c),j=a(c,"P",{});var ve=i(j);te=s(ve,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ve.forEach(t),G=d(c),P=a(c,"UL",{});var C=i(P);x=a(C,"LI",{});var O=i(x);ne=s(O,"a single Tensor with "),H=a(O,"CODE",{});var Fe=i(H);de=s(Fe,"input_ids"),Fe.forEach(t),se=s(O," only and nothing else: "),L=a(O,"CODE",{});var Me=i(L);fe=s(Me,"model(inputs_ids)"),Me.forEach(t),O.forEach(t),ce=d(C),q=a(C,"LI",{});var U=i(q);ge=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=a(U,"CODE",{});var ye=i(W);X=s(ye,"model([input_ids, attention_mask])"),ye.forEach(t),re=s(U," or "),Q=a(U,"CODE",{});var Y=i(Q);_e=s(Y,"model([input_ids, attention_mask, token_type_ids])"),Y.forEach(t),U.forEach(t),ae=d(C),N=a(C,"LI",{});var oe=i(N);pe=s(oe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=a(oe,"CODE",{});var Be=i(A);be=s(Be,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Be.forEach(t),oe.forEach(t),C.forEach(t)},m(c,v){m(c,h,v),e(h,k),m(c,f,v),m(c,g,v),e(g,T),e(T,b),e(g,_),e(g,M),e(M,he),m(c,K,v),m(c,z,v),e(z,Z),e(z,I),e(I,ee),e(z,me),e(z,D),e(D,ue),e(z,le),m(c,V,v),m(c,j,v),e(j,te),m(c,G,v),m(c,P,v),e(P,x),e(x,ne),e(x,H),e(H,de),e(x,se),e(x,L),e(L,fe),e(P,ce),e(P,q),e(q,ge),e(q,W),e(W,X),e(q,re),e(q,Q),e(Q,_e),e(P,ae),e(P,N),e(N,pe),e(N,A),e(A,be)},d(c){c&&t(h),c&&t(f),c&&t(g),c&&t(K),c&&t(z),c&&t(V),c&&t(j),c&&t(G),c&&t(P)}}}function vM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function kM(R){let h,k,f,g,T,b,_,M,he,K,z,Z,I,ee,me,D,ue,le,V,j,te,G,P,x,ne,H,de,se,L,fe,ce,q,ge,W,X,re,Q,_e,ae,N,pe,A,be;return{c(){h=r("p"),k=n("TF 2.0 models accepts two formats as inputs:"),f=l(),g=r("ul"),T=r("li"),b=n("having all inputs as keyword arguments (like PyTorch models), or"),_=l(),M=r("li"),he=n("having all inputs as a list, tuple or dict in the first positional arguments."),K=l(),z=r("p"),Z=n("This second option is useful when using "),I=r("code"),ee=n("tf.keras.Model.fit"),me=n(` method which currently requires having all the
tensors in the first argument of the model call function: `),D=r("code"),ue=n("model(inputs)"),le=n("."),V=l(),j=r("p"),te=n(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),G=l(),P=r("ul"),x=r("li"),ne=n("a single Tensor with "),H=r("code"),de=n("input_ids"),se=n(" only and nothing else: "),L=r("code"),fe=n("model(inputs_ids)"),ce=l(),q=r("li"),ge=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=r("code"),X=n("model([input_ids, attention_mask])"),re=n(" or "),Q=r("code"),_e=n("model([input_ids, attention_mask, token_type_ids])"),ae=l(),N=r("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=r("code"),be=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(c){h=a(c,"P",{});var v=i(h);k=s(v,"TF 2.0 models accepts two formats as inputs:"),v.forEach(t),f=d(c),g=a(c,"UL",{});var J=i(g);T=a(J,"LI",{});var ke=i(T);b=s(ke,"having all inputs as keyword arguments (like PyTorch models), or"),ke.forEach(t),_=d(J),M=a(J,"LI",{});var $e=i(M);he=s($e,"having all inputs as a list, tuple or dict in the first positional arguments."),$e.forEach(t),J.forEach(t),K=d(c),z=a(c,"P",{});var S=i(z);Z=s(S,"This second option is useful when using "),I=a(S,"CODE",{});var we=i(I);ee=s(we,"tf.keras.Model.fit"),we.forEach(t),me=s(S,` method which currently requires having all the
tensors in the first argument of the model call function: `),D=a(S,"CODE",{});var Te=i(D);ue=s(Te,"model(inputs)"),Te.forEach(t),le=s(S,"."),S.forEach(t),V=d(c),j=a(c,"P",{});var ve=i(j);te=s(ve,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ve.forEach(t),G=d(c),P=a(c,"UL",{});var C=i(P);x=a(C,"LI",{});var O=i(x);ne=s(O,"a single Tensor with "),H=a(O,"CODE",{});var Fe=i(H);de=s(Fe,"input_ids"),Fe.forEach(t),se=s(O," only and nothing else: "),L=a(O,"CODE",{});var Me=i(L);fe=s(Me,"model(inputs_ids)"),Me.forEach(t),O.forEach(t),ce=d(C),q=a(C,"LI",{});var U=i(q);ge=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=a(U,"CODE",{});var ye=i(W);X=s(ye,"model([input_ids, attention_mask])"),ye.forEach(t),re=s(U," or "),Q=a(U,"CODE",{});var Y=i(Q);_e=s(Y,"model([input_ids, attention_mask, token_type_ids])"),Y.forEach(t),U.forEach(t),ae=d(C),N=a(C,"LI",{});var oe=i(N);pe=s(oe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=a(oe,"CODE",{});var Be=i(A);be=s(Be,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Be.forEach(t),oe.forEach(t),C.forEach(t)},m(c,v){m(c,h,v),e(h,k),m(c,f,v),m(c,g,v),e(g,T),e(T,b),e(g,_),e(g,M),e(M,he),m(c,K,v),m(c,z,v),e(z,Z),e(z,I),e(I,ee),e(z,me),e(z,D),e(D,ue),e(z,le),m(c,V,v),m(c,j,v),e(j,te),m(c,G,v),m(c,P,v),e(P,x),e(x,ne),e(x,H),e(H,de),e(x,se),e(x,L),e(L,fe),e(P,ce),e(P,q),e(q,ge),e(q,W),e(W,X),e(q,re),e(q,Q),e(Q,_e),e(P,ae),e(P,N),e(N,pe),e(N,A),e(A,be)},d(c){c&&t(h),c&&t(f),c&&t(g),c&&t(K),c&&t(z),c&&t(V),c&&t(j),c&&t(G),c&&t(P)}}}function MM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function wM(R){let h,k,f,g,T,b,_,M,he,K,z,Z,I,ee,me,D,ue,le,V,j,te,G,P,x,ne,H,de,se,L,fe,ce,q,ge,W,X,re,Q,_e,ae,N,pe,A,be;return{c(){h=r("p"),k=n("TF 2.0 models accepts two formats as inputs:"),f=l(),g=r("ul"),T=r("li"),b=n("having all inputs as keyword arguments (like PyTorch models), or"),_=l(),M=r("li"),he=n("having all inputs as a list, tuple or dict in the first positional arguments."),K=l(),z=r("p"),Z=n("This second option is useful when using "),I=r("code"),ee=n("tf.keras.Model.fit"),me=n(` method which currently requires having all the
tensors in the first argument of the model call function: `),D=r("code"),ue=n("model(inputs)"),le=n("."),V=l(),j=r("p"),te=n(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),G=l(),P=r("ul"),x=r("li"),ne=n("a single Tensor with "),H=r("code"),de=n("input_ids"),se=n(" only and nothing else: "),L=r("code"),fe=n("model(inputs_ids)"),ce=l(),q=r("li"),ge=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=r("code"),X=n("model([input_ids, attention_mask])"),re=n(" or "),Q=r("code"),_e=n("model([input_ids, attention_mask, token_type_ids])"),ae=l(),N=r("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=r("code"),be=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(c){h=a(c,"P",{});var v=i(h);k=s(v,"TF 2.0 models accepts two formats as inputs:"),v.forEach(t),f=d(c),g=a(c,"UL",{});var J=i(g);T=a(J,"LI",{});var ke=i(T);b=s(ke,"having all inputs as keyword arguments (like PyTorch models), or"),ke.forEach(t),_=d(J),M=a(J,"LI",{});var $e=i(M);he=s($e,"having all inputs as a list, tuple or dict in the first positional arguments."),$e.forEach(t),J.forEach(t),K=d(c),z=a(c,"P",{});var S=i(z);Z=s(S,"This second option is useful when using "),I=a(S,"CODE",{});var we=i(I);ee=s(we,"tf.keras.Model.fit"),we.forEach(t),me=s(S,` method which currently requires having all the
tensors in the first argument of the model call function: `),D=a(S,"CODE",{});var Te=i(D);ue=s(Te,"model(inputs)"),Te.forEach(t),le=s(S,"."),S.forEach(t),V=d(c),j=a(c,"P",{});var ve=i(j);te=s(ve,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ve.forEach(t),G=d(c),P=a(c,"UL",{});var C=i(P);x=a(C,"LI",{});var O=i(x);ne=s(O,"a single Tensor with "),H=a(O,"CODE",{});var Fe=i(H);de=s(Fe,"input_ids"),Fe.forEach(t),se=s(O," only and nothing else: "),L=a(O,"CODE",{});var Me=i(L);fe=s(Me,"model(inputs_ids)"),Me.forEach(t),O.forEach(t),ce=d(C),q=a(C,"LI",{});var U=i(q);ge=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=a(U,"CODE",{});var ye=i(W);X=s(ye,"model([input_ids, attention_mask])"),ye.forEach(t),re=s(U," or "),Q=a(U,"CODE",{});var Y=i(Q);_e=s(Y,"model([input_ids, attention_mask, token_type_ids])"),Y.forEach(t),U.forEach(t),ae=d(C),N=a(C,"LI",{});var oe=i(N);pe=s(oe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=a(oe,"CODE",{});var Be=i(A);be=s(Be,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Be.forEach(t),oe.forEach(t),C.forEach(t)},m(c,v){m(c,h,v),e(h,k),m(c,f,v),m(c,g,v),e(g,T),e(T,b),e(g,_),e(g,M),e(M,he),m(c,K,v),m(c,z,v),e(z,Z),e(z,I),e(I,ee),e(z,me),e(z,D),e(D,ue),e(z,le),m(c,V,v),m(c,j,v),e(j,te),m(c,G,v),m(c,P,v),e(P,x),e(x,ne),e(x,H),e(H,de),e(x,se),e(x,L),e(L,fe),e(P,ce),e(P,q),e(q,ge),e(q,W),e(W,X),e(q,re),e(q,Q),e(Q,_e),e(P,ae),e(P,N),e(N,pe),e(N,A),e(A,be)},d(c){c&&t(h),c&&t(f),c&&t(g),c&&t(K),c&&t(z),c&&t(V),c&&t(j),c&&t(G),c&&t(P)}}}function yM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function $M(R){let h,k,f,g,T,b,_,M,he,K,z,Z,I,ee,me,D,ue,le,V,j,te,G,P,x,ne,H,de,se,L,fe,ce,q,ge,W,X,re,Q,_e,ae,N,pe,A,be;return{c(){h=r("p"),k=n("TF 2.0 models accepts two formats as inputs:"),f=l(),g=r("ul"),T=r("li"),b=n("having all inputs as keyword arguments (like PyTorch models), or"),_=l(),M=r("li"),he=n("having all inputs as a list, tuple or dict in the first positional arguments."),K=l(),z=r("p"),Z=n("This second option is useful when using "),I=r("code"),ee=n("tf.keras.Model.fit"),me=n(` method which currently requires having all the
tensors in the first argument of the model call function: `),D=r("code"),ue=n("model(inputs)"),le=n("."),V=l(),j=r("p"),te=n(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),G=l(),P=r("ul"),x=r("li"),ne=n("a single Tensor with "),H=r("code"),de=n("input_ids"),se=n(" only and nothing else: "),L=r("code"),fe=n("model(inputs_ids)"),ce=l(),q=r("li"),ge=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=r("code"),X=n("model([input_ids, attention_mask])"),re=n(" or "),Q=r("code"),_e=n("model([input_ids, attention_mask, token_type_ids])"),ae=l(),N=r("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=r("code"),be=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(c){h=a(c,"P",{});var v=i(h);k=s(v,"TF 2.0 models accepts two formats as inputs:"),v.forEach(t),f=d(c),g=a(c,"UL",{});var J=i(g);T=a(J,"LI",{});var ke=i(T);b=s(ke,"having all inputs as keyword arguments (like PyTorch models), or"),ke.forEach(t),_=d(J),M=a(J,"LI",{});var $e=i(M);he=s($e,"having all inputs as a list, tuple or dict in the first positional arguments."),$e.forEach(t),J.forEach(t),K=d(c),z=a(c,"P",{});var S=i(z);Z=s(S,"This second option is useful when using "),I=a(S,"CODE",{});var we=i(I);ee=s(we,"tf.keras.Model.fit"),we.forEach(t),me=s(S,` method which currently requires having all the
tensors in the first argument of the model call function: `),D=a(S,"CODE",{});var Te=i(D);ue=s(Te,"model(inputs)"),Te.forEach(t),le=s(S,"."),S.forEach(t),V=d(c),j=a(c,"P",{});var ve=i(j);te=s(ve,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ve.forEach(t),G=d(c),P=a(c,"UL",{});var C=i(P);x=a(C,"LI",{});var O=i(x);ne=s(O,"a single Tensor with "),H=a(O,"CODE",{});var Fe=i(H);de=s(Fe,"input_ids"),Fe.forEach(t),se=s(O," only and nothing else: "),L=a(O,"CODE",{});var Me=i(L);fe=s(Me,"model(inputs_ids)"),Me.forEach(t),O.forEach(t),ce=d(C),q=a(C,"LI",{});var U=i(q);ge=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=a(U,"CODE",{});var ye=i(W);X=s(ye,"model([input_ids, attention_mask])"),ye.forEach(t),re=s(U," or "),Q=a(U,"CODE",{});var Y=i(Q);_e=s(Y,"model([input_ids, attention_mask, token_type_ids])"),Y.forEach(t),U.forEach(t),ae=d(C),N=a(C,"LI",{});var oe=i(N);pe=s(oe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=a(oe,"CODE",{});var Be=i(A);be=s(Be,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Be.forEach(t),oe.forEach(t),C.forEach(t)},m(c,v){m(c,h,v),e(h,k),m(c,f,v),m(c,g,v),e(g,T),e(T,b),e(g,_),e(g,M),e(M,he),m(c,K,v),m(c,z,v),e(z,Z),e(z,I),e(I,ee),e(z,me),e(z,D),e(D,ue),e(z,le),m(c,V,v),m(c,j,v),e(j,te),m(c,G,v),m(c,P,v),e(P,x),e(x,ne),e(x,H),e(H,de),e(x,se),e(x,L),e(L,fe),e(P,ce),e(P,q),e(q,ge),e(q,W),e(W,X),e(q,re),e(q,Q),e(Q,_e),e(P,ae),e(P,N),e(N,pe),e(N,A),e(A,be)},d(c){c&&t(h),c&&t(f),c&&t(g),c&&t(K),c&&t(z),c&&t(V),c&&t(j),c&&t(G),c&&t(P)}}}function FM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function BM(R){let h,k,f,g,T,b,_,M,he,K,z,Z,I,ee,me,D,ue,le,V,j,te,G,P,x,ne,H,de,se,L,fe,ce,q,ge,W,X,re,Q,_e,ae,N,pe,A,be;return{c(){h=r("p"),k=n("TF 2.0 models accepts two formats as inputs:"),f=l(),g=r("ul"),T=r("li"),b=n("having all inputs as keyword arguments (like PyTorch models), or"),_=l(),M=r("li"),he=n("having all inputs as a list, tuple or dict in the first positional arguments."),K=l(),z=r("p"),Z=n("This second option is useful when using "),I=r("code"),ee=n("tf.keras.Model.fit"),me=n(` method which currently requires having all the
tensors in the first argument of the model call function: `),D=r("code"),ue=n("model(inputs)"),le=n("."),V=l(),j=r("p"),te=n(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),G=l(),P=r("ul"),x=r("li"),ne=n("a single Tensor with "),H=r("code"),de=n("input_ids"),se=n(" only and nothing else: "),L=r("code"),fe=n("model(inputs_ids)"),ce=l(),q=r("li"),ge=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=r("code"),X=n("model([input_ids, attention_mask])"),re=n(" or "),Q=r("code"),_e=n("model([input_ids, attention_mask, token_type_ids])"),ae=l(),N=r("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=r("code"),be=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(c){h=a(c,"P",{});var v=i(h);k=s(v,"TF 2.0 models accepts two formats as inputs:"),v.forEach(t),f=d(c),g=a(c,"UL",{});var J=i(g);T=a(J,"LI",{});var ke=i(T);b=s(ke,"having all inputs as keyword arguments (like PyTorch models), or"),ke.forEach(t),_=d(J),M=a(J,"LI",{});var $e=i(M);he=s($e,"having all inputs as a list, tuple or dict in the first positional arguments."),$e.forEach(t),J.forEach(t),K=d(c),z=a(c,"P",{});var S=i(z);Z=s(S,"This second option is useful when using "),I=a(S,"CODE",{});var we=i(I);ee=s(we,"tf.keras.Model.fit"),we.forEach(t),me=s(S,` method which currently requires having all the
tensors in the first argument of the model call function: `),D=a(S,"CODE",{});var Te=i(D);ue=s(Te,"model(inputs)"),Te.forEach(t),le=s(S,"."),S.forEach(t),V=d(c),j=a(c,"P",{});var ve=i(j);te=s(ve,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ve.forEach(t),G=d(c),P=a(c,"UL",{});var C=i(P);x=a(C,"LI",{});var O=i(x);ne=s(O,"a single Tensor with "),H=a(O,"CODE",{});var Fe=i(H);de=s(Fe,"input_ids"),Fe.forEach(t),se=s(O," only and nothing else: "),L=a(O,"CODE",{});var Me=i(L);fe=s(Me,"model(inputs_ids)"),Me.forEach(t),O.forEach(t),ce=d(C),q=a(C,"LI",{});var U=i(q);ge=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=a(U,"CODE",{});var ye=i(W);X=s(ye,"model([input_ids, attention_mask])"),ye.forEach(t),re=s(U," or "),Q=a(U,"CODE",{});var Y=i(Q);_e=s(Y,"model([input_ids, attention_mask, token_type_ids])"),Y.forEach(t),U.forEach(t),ae=d(C),N=a(C,"LI",{});var oe=i(N);pe=s(oe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=a(oe,"CODE",{});var Be=i(A);be=s(Be,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Be.forEach(t),oe.forEach(t),C.forEach(t)},m(c,v){m(c,h,v),e(h,k),m(c,f,v),m(c,g,v),e(g,T),e(T,b),e(g,_),e(g,M),e(M,he),m(c,K,v),m(c,z,v),e(z,Z),e(z,I),e(I,ee),e(z,me),e(z,D),e(D,ue),e(z,le),m(c,V,v),m(c,j,v),e(j,te),m(c,G,v),m(c,P,v),e(P,x),e(x,ne),e(x,H),e(H,de),e(x,se),e(x,L),e(L,fe),e(P,ce),e(P,q),e(q,ge),e(q,W),e(W,X),e(q,re),e(q,Q),e(Q,_e),e(P,ae),e(P,N),e(N,pe),e(N,A),e(A,be)},d(c){c&&t(h),c&&t(f),c&&t(g),c&&t(K),c&&t(z),c&&t(V),c&&t(j),c&&t(G),c&&t(P)}}}function EM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function zM(R){let h,k,f,g,T,b,_,M,he,K,z,Z,I,ee,me,D,ue,le,V,j,te,G,P,x,ne,H,de,se,L,fe,ce,q,ge,W,X,re,Q,_e,ae,N,pe,A,be;return{c(){h=r("p"),k=n("TF 2.0 models accepts two formats as inputs:"),f=l(),g=r("ul"),T=r("li"),b=n("having all inputs as keyword arguments (like PyTorch models), or"),_=l(),M=r("li"),he=n("having all inputs as a list, tuple or dict in the first positional arguments."),K=l(),z=r("p"),Z=n("This second option is useful when using "),I=r("code"),ee=n("tf.keras.Model.fit"),me=n(` method which currently requires having all the
tensors in the first argument of the model call function: `),D=r("code"),ue=n("model(inputs)"),le=n("."),V=l(),j=r("p"),te=n(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),G=l(),P=r("ul"),x=r("li"),ne=n("a single Tensor with "),H=r("code"),de=n("input_ids"),se=n(" only and nothing else: "),L=r("code"),fe=n("model(inputs_ids)"),ce=l(),q=r("li"),ge=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=r("code"),X=n("model([input_ids, attention_mask])"),re=n(" or "),Q=r("code"),_e=n("model([input_ids, attention_mask, token_type_ids])"),ae=l(),N=r("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=r("code"),be=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(c){h=a(c,"P",{});var v=i(h);k=s(v,"TF 2.0 models accepts two formats as inputs:"),v.forEach(t),f=d(c),g=a(c,"UL",{});var J=i(g);T=a(J,"LI",{});var ke=i(T);b=s(ke,"having all inputs as keyword arguments (like PyTorch models), or"),ke.forEach(t),_=d(J),M=a(J,"LI",{});var $e=i(M);he=s($e,"having all inputs as a list, tuple or dict in the first positional arguments."),$e.forEach(t),J.forEach(t),K=d(c),z=a(c,"P",{});var S=i(z);Z=s(S,"This second option is useful when using "),I=a(S,"CODE",{});var we=i(I);ee=s(we,"tf.keras.Model.fit"),we.forEach(t),me=s(S,` method which currently requires having all the
tensors in the first argument of the model call function: `),D=a(S,"CODE",{});var Te=i(D);ue=s(Te,"model(inputs)"),Te.forEach(t),le=s(S,"."),S.forEach(t),V=d(c),j=a(c,"P",{});var ve=i(j);te=s(ve,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ve.forEach(t),G=d(c),P=a(c,"UL",{});var C=i(P);x=a(C,"LI",{});var O=i(x);ne=s(O,"a single Tensor with "),H=a(O,"CODE",{});var Fe=i(H);de=s(Fe,"input_ids"),Fe.forEach(t),se=s(O," only and nothing else: "),L=a(O,"CODE",{});var Me=i(L);fe=s(Me,"model(inputs_ids)"),Me.forEach(t),O.forEach(t),ce=d(C),q=a(C,"LI",{});var U=i(q);ge=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=a(U,"CODE",{});var ye=i(W);X=s(ye,"model([input_ids, attention_mask])"),ye.forEach(t),re=s(U," or "),Q=a(U,"CODE",{});var Y=i(Q);_e=s(Y,"model([input_ids, attention_mask, token_type_ids])"),Y.forEach(t),U.forEach(t),ae=d(C),N=a(C,"LI",{});var oe=i(N);pe=s(oe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=a(oe,"CODE",{});var Be=i(A);be=s(Be,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Be.forEach(t),oe.forEach(t),C.forEach(t)},m(c,v){m(c,h,v),e(h,k),m(c,f,v),m(c,g,v),e(g,T),e(T,b),e(g,_),e(g,M),e(M,he),m(c,K,v),m(c,z,v),e(z,Z),e(z,I),e(I,ee),e(z,me),e(z,D),e(D,ue),e(z,le),m(c,V,v),m(c,j,v),e(j,te),m(c,G,v),m(c,P,v),e(P,x),e(x,ne),e(x,H),e(H,de),e(x,se),e(x,L),e(L,fe),e(P,ce),e(P,q),e(q,ge),e(q,W),e(W,X),e(q,re),e(q,Q),e(Q,_e),e(P,ae),e(P,N),e(N,pe),e(N,A),e(A,be)},d(c){c&&t(h),c&&t(f),c&&t(g),c&&t(K),c&&t(z),c&&t(V),c&&t(j),c&&t(G),c&&t(P)}}}function PM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function qM(R){let h,k,f,g,T,b,_,M,he,K,z,Z,I,ee,me,D,ue,le,V,j,te,G,P,x,ne,H,de,se,L,fe,ce,q,ge,W,X,re,Q,_e,ae,N,pe,A,be;return{c(){h=r("p"),k=n("TF 2.0 models accepts two formats as inputs:"),f=l(),g=r("ul"),T=r("li"),b=n("having all inputs as keyword arguments (like PyTorch models), or"),_=l(),M=r("li"),he=n("having all inputs as a list, tuple or dict in the first positional arguments."),K=l(),z=r("p"),Z=n("This second option is useful when using "),I=r("code"),ee=n("tf.keras.Model.fit"),me=n(` method which currently requires having all the
tensors in the first argument of the model call function: `),D=r("code"),ue=n("model(inputs)"),le=n("."),V=l(),j=r("p"),te=n(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),G=l(),P=r("ul"),x=r("li"),ne=n("a single Tensor with "),H=r("code"),de=n("input_ids"),se=n(" only and nothing else: "),L=r("code"),fe=n("model(inputs_ids)"),ce=l(),q=r("li"),ge=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=r("code"),X=n("model([input_ids, attention_mask])"),re=n(" or "),Q=r("code"),_e=n("model([input_ids, attention_mask, token_type_ids])"),ae=l(),N=r("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=r("code"),be=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(c){h=a(c,"P",{});var v=i(h);k=s(v,"TF 2.0 models accepts two formats as inputs:"),v.forEach(t),f=d(c),g=a(c,"UL",{});var J=i(g);T=a(J,"LI",{});var ke=i(T);b=s(ke,"having all inputs as keyword arguments (like PyTorch models), or"),ke.forEach(t),_=d(J),M=a(J,"LI",{});var $e=i(M);he=s($e,"having all inputs as a list, tuple or dict in the first positional arguments."),$e.forEach(t),J.forEach(t),K=d(c),z=a(c,"P",{});var S=i(z);Z=s(S,"This second option is useful when using "),I=a(S,"CODE",{});var we=i(I);ee=s(we,"tf.keras.Model.fit"),we.forEach(t),me=s(S,` method which currently requires having all the
tensors in the first argument of the model call function: `),D=a(S,"CODE",{});var Te=i(D);ue=s(Te,"model(inputs)"),Te.forEach(t),le=s(S,"."),S.forEach(t),V=d(c),j=a(c,"P",{});var ve=i(j);te=s(ve,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),ve.forEach(t),G=d(c),P=a(c,"UL",{});var C=i(P);x=a(C,"LI",{});var O=i(x);ne=s(O,"a single Tensor with "),H=a(O,"CODE",{});var Fe=i(H);de=s(Fe,"input_ids"),Fe.forEach(t),se=s(O," only and nothing else: "),L=a(O,"CODE",{});var Me=i(L);fe=s(Me,"model(inputs_ids)"),Me.forEach(t),O.forEach(t),ce=d(C),q=a(C,"LI",{});var U=i(q);ge=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=a(U,"CODE",{});var ye=i(W);X=s(ye,"model([input_ids, attention_mask])"),ye.forEach(t),re=s(U," or "),Q=a(U,"CODE",{});var Y=i(Q);_e=s(Y,"model([input_ids, attention_mask, token_type_ids])"),Y.forEach(t),U.forEach(t),ae=d(C),N=a(C,"LI",{});var oe=i(N);pe=s(oe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),A=a(oe,"CODE",{});var Be=i(A);be=s(Be,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Be.forEach(t),oe.forEach(t),C.forEach(t)},m(c,v){m(c,h,v),e(h,k),m(c,f,v),m(c,g,v),e(g,T),e(T,b),e(g,_),e(g,M),e(M,he),m(c,K,v),m(c,z,v),e(z,Z),e(z,I),e(I,ee),e(z,me),e(z,D),e(D,ue),e(z,le),m(c,V,v),m(c,j,v),e(j,te),m(c,G,v),m(c,P,v),e(P,x),e(x,ne),e(x,H),e(H,de),e(x,se),e(x,L),e(L,fe),e(P,ce),e(P,q),e(q,ge),e(q,W),e(W,X),e(q,re),e(q,Q),e(Q,_e),e(P,ae),e(P,N),e(N,pe),e(N,A),e(A,be)},d(c){c&&t(h),c&&t(f),c&&t(g),c&&t(K),c&&t(z),c&&t(V),c&&t(j),c&&t(G),c&&t(P)}}}function xM(R){let h,k,f,g,T;return{c(){h=r("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),g=n("Module"),T=n(`
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(b){h=a(b,"P",{});var _=i(h);k=s(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(_,"CODE",{});var M=i(f);g=s(M,"Module"),M.forEach(t),T=s(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(b,_){m(b,h,_),e(h,k),e(h,f),e(f,g),e(h,T)},d(b){b&&t(h)}}}function CM(R){let h,k,f,g,T,b,_,M,he,K,z,Z,I,ee,me,D,ue,le,V,j,te,G,P,x,ne,H,de,se,L,fe,ce,q,ge,W,X,re,Q,_e,ae,N,pe,A,be,c,v,J,ke,$e,S,we,Te,ve,C,O,Fe,Me,U,ye,Y,oe,Be,Ht,_p,na,bp,Tp,sa,vp,kp,Mp,Qt,wp,ra,yp,$p,aa,Fp,Bp,Ep,fi,zp,Pp,zn,qp,gi,xp,wd,Ut,No,_i,Pn,Cp,bi,jp,yd,ct,qn,Np,Ti,Sp,Ap,So,ia,Op,Ip,la,Dp,Lp,Wp,xn,Rp,da,Hp,Qp,$d,Vt,Ao,vi,Cn,Up,ki,Vp,Fd,pt,jn,Kp,Nn,Gp,Mi,Jp,Yp,Zp,Oo,ca,Xp,eh,pa,th,oh,nh,Sn,sh,ha,rh,ah,Bd,Kt,Io,wi,An,ih,yi,lh,Ed,Gt,On,dh,In,ch,ma,ph,hh,zd,Jt,Dn,mh,Ln,uh,ua,fh,gh,Pd,Yt,Do,$i,Wn,_h,Fi,bh,qd,xe,Rn,Th,Bi,vh,kh,Hn,Mh,fa,wh,yh,$h,Qn,Fh,Un,Bh,Eh,zh,Ei,Vn,Ph,qh,Ke,Kn,xh,Zt,Ch,ga,jh,Nh,zi,Sh,Ah,Oh,Lo,Ih,Pi,Dh,Lh,Gn,xd,Xt,Wo,qi,Jn,Wh,xi,Rh,Cd,Le,Yn,Hh,eo,Qh,Ci,Uh,Vh,ji,Kh,Gh,Jh,Zn,Yh,_a,Zh,Xh,em,Xn,tm,es,om,nm,sm,Ge,ts,rm,to,am,ba,im,lm,Ni,dm,cm,pm,Ro,hm,Si,mm,um,os,jd,oo,Ho,Ai,ns,fm,Oi,gm,Nd,We,ss,_m,rs,bm,Ii,Tm,vm,km,as,Mm,Ta,wm,ym,$m,is,Fm,ls,Bm,Em,zm,Je,ds,Pm,no,qm,va,xm,Cm,Di,jm,Nm,Sm,Qo,Am,Li,Om,Im,cs,Sd,so,Uo,Wi,ps,Dm,Ri,Lm,Ad,Re,hs,Wm,ms,Rm,Hi,Hm,Qm,Um,us,Vm,ka,Km,Gm,Jm,fs,Ym,gs,Zm,Xm,eu,Ye,_s,tu,ro,ou,Ma,nu,su,Qi,ru,au,iu,Vo,lu,Ui,du,cu,bs,Od,ao,Ko,Vi,Ts,pu,Ki,hu,Id,He,vs,mu,Gi,uu,fu,ks,gu,wa,_u,bu,Tu,Ms,vu,ws,ku,Mu,wu,Pe,ys,yu,io,$u,ya,Fu,Bu,Ji,Eu,zu,Pu,Go,qu,Yi,xu,Cu,$s,ju,Zi,Nu,Su,Fs,Dd,lo,Jo,Xi,Bs,Au,el,Ou,Ld,Qe,Es,Iu,tl,Du,Lu,zs,Wu,$a,Ru,Hu,Qu,Ps,Uu,qs,Vu,Ku,Gu,Ze,xs,Ju,co,Yu,Fa,Zu,Xu,ol,ef,tf,of,Yo,nf,nl,sf,rf,Cs,Wd,po,Zo,sl,js,af,rl,lf,Rd,Ue,Ns,df,al,cf,pf,Ss,hf,Ba,mf,uf,ff,As,gf,Os,_f,bf,Tf,Xe,Is,vf,ho,kf,Ea,Mf,wf,il,yf,$f,Ff,Xo,Bf,ll,Ef,zf,Ds,Hd,mo,en,dl,Ls,Pf,cl,qf,Qd,Ve,Ws,xf,uo,Cf,pl,jf,Nf,hl,Sf,Af,Of,Rs,If,za,Df,Lf,Wf,Hs,Rf,Qs,Hf,Qf,Uf,et,Us,Vf,fo,Kf,Pa,Gf,Jf,ml,Yf,Zf,Xf,tn,eg,ul,tg,og,Vs,Ud,go,on,fl,Ks,ng,gl,sg,Vd,Ce,Gs,rg,_l,ag,ig,Js,lg,qa,dg,cg,pg,Ys,hg,Zs,mg,ug,fg,nn,gg,tt,Xs,_g,_o,bg,xa,Tg,vg,bl,kg,Mg,wg,sn,yg,Tl,$g,Fg,er,Kd,bo,rn,vl,tr,Bg,kl,Eg,Gd,je,or,zg,To,Pg,Ml,qg,xg,wl,Cg,jg,Ng,nr,Sg,Ca,Ag,Og,Ig,sr,Dg,rr,Lg,Wg,Rg,an,Hg,ot,ar,Qg,vo,Ug,ja,Vg,Kg,yl,Gg,Jg,Yg,ln,Zg,$l,Xg,e_,ir,Jd,ko,dn,Fl,lr,t_,Bl,o_,Yd,Ne,dr,n_,cr,s_,El,r_,a_,i_,pr,l_,Na,d_,c_,p_,hr,h_,mr,m_,u_,f_,cn,g_,nt,ur,__,Mo,b_,Sa,T_,v_,zl,k_,M_,w_,pn,y_,Pl,$_,F_,fr,Zd,wo,hn,ql,gr,B_,xl,E_,Xd,Se,_r,z_,br,P_,Cl,q_,x_,C_,Tr,j_,Aa,N_,S_,A_,vr,O_,kr,I_,D_,L_,mn,W_,st,Mr,R_,yo,H_,Oa,Q_,U_,jl,V_,K_,G_,un,J_,Nl,Y_,Z_,wr,ec,$o,fn,Sl,yr,X_,Al,eb,tc,Ae,$r,tb,Ol,ob,nb,Fr,sb,Ia,rb,ab,ib,Br,lb,Er,db,cb,pb,gn,hb,rt,zr,mb,Fo,ub,Da,fb,gb,Il,_b,bb,Tb,_n,vb,Dl,kb,Mb,Pr,oc,Bo,bn,Ll,qr,wb,Wl,yb,nc,Oe,xr,$b,Rl,Fb,Bb,Cr,Eb,La,zb,Pb,qb,jr,xb,Nr,Cb,jb,Nb,Tn,Sb,at,Sr,Ab,Eo,Ob,Wa,Ib,Db,Hl,Lb,Wb,Rb,vn,Hb,Ql,Qb,Ub,Ar,sc,zo,kn,Ul,Or,Vb,Vl,Kb,rc,Ie,Ir,Gb,Kl,Jb,Yb,Dr,Zb,Ra,Xb,eT,tT,Lr,oT,Wr,nT,sT,rT,Mn,aT,it,Rr,iT,Po,lT,Ha,dT,cT,Gl,pT,hT,mT,wn,uT,Jl,fT,gT,Hr,ac,qo,yn,Yl,Qr,_T,Zl,bT,ic,De,Ur,TT,xo,vT,Xl,kT,MT,ed,wT,yT,$T,Vr,FT,Qa,BT,ET,zT,Kr,PT,Gr,qT,xT,CT,$n,jT,lt,Jr,NT,Co,ST,Ua,AT,OT,td,IT,DT,LT,Fn,WT,od,RT,HT,Yr,lc;return b=new ze({}),ee=new ze({}),O=new ze({}),oe=new ie({props:{name:"class transformers.MobileBertConfig",anchor:"transformers.MobileBertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 512"},{name:"num_hidden_layers",val:" = 24"},{name:"num_attention_heads",val:" = 4"},{name:"intermediate_size",val:" = 512"},{name:"hidden_act",val:" = 'relu'"},{name:"hidden_dropout_prob",val:" = 0.0"},{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:"embedding_size",val:" = 128"},{name:"trigram_input",val:" = True"},{name:"use_bottleneck",val:" = True"},{name:"intra_bottleneck_size",val:" = 128"},{name:"use_bottleneck_attention",val:" = False"},{name:"key_query_shared_bottleneck",val:" = True"},{name:"num_feedforward_networks",val:" = 4"},{name:"normalization_type",val:" = 'no_norm'"},{name:"classifier_activation",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/configuration_mobilebert.py#L28",parametersDescription:[{anchor:"transformers.MobileBertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the MobileBERT 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/mobilebert#transformers.MobileBertModel">MobileBertModel</a> or <a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.TFMobileBertModel">TFMobileBertModel</a>.`,name:"vocab_size"},{anchor:"transformers.MobileBertConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.MobileBertConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.MobileBertConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.MobileBertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.MobileBertConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;relu&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.MobileBertConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.MobileBertConfig.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.MobileBertConfig.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.MobileBertConfig.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/mobilebert#transformers.MobileBertModel">MobileBertModel</a> or
<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.TFMobileBertModel">TFMobileBertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.MobileBertConfig.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.MobileBertConfig.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.MobileBertConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The ID of the token in the word embedding to use as padding.`,name:"pad_token_id"},{anchor:"transformers.MobileBertConfig.embedding_size",description:`<strong>embedding_size</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
The dimension of the word embedding vectors.`,name:"embedding_size"},{anchor:"transformers.MobileBertConfig.trigram_input",description:`<strong>trigram_input</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Use a convolution of trigram as input.`,name:"trigram_input"},{anchor:"transformers.MobileBertConfig.use_bottleneck",description:`<strong>use_bottleneck</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use bottleneck in BERT.`,name:"use_bottleneck"},{anchor:"transformers.MobileBertConfig.intra_bottleneck_size",description:`<strong>intra_bottleneck_size</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Size of bottleneck layer output.`,name:"intra_bottleneck_size"},{anchor:"transformers.MobileBertConfig.use_bottleneck_attention",description:`<strong>use_bottleneck_attention</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use attention inputs from the bottleneck transformation.`,name:"use_bottleneck_attention"},{anchor:"transformers.MobileBertConfig.key_query_shared_bottleneck",description:`<strong>key_query_shared_bottleneck</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use the same linear transformation for query&amp;key in the bottleneck.`,name:"key_query_shared_bottleneck"},{anchor:"transformers.MobileBertConfig.num_feedforward_networks",description:`<strong>num_feedforward_networks</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Number of FFNs in a block.`,name:"num_feedforward_networks"},{anchor:"transformers.MobileBertConfig.normalization_type",description:`<strong>normalization_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;no_norm&quot;</code>) &#x2014;
The normalization type in MobileBERT.`,name:"normalization_type"},{anchor:"transformers.MobileBertConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"}]}}),zn=new qe({props:{code:`from transformers import MobileBertModel, MobileBertConfig

# Initializing a MobileBERT configuration
configuration = MobileBertConfig()

# Initializing a model from the configuration above
model = MobileBertModel(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> MobileBertModel, MobileBertConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a MobileBERT configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = MobileBertConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the configuration above</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertModel(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`}}),Pn=new ze({}),qn=new ie({props:{name:"class transformers.MobileBertTokenizer",anchor:"transformers.MobileBertTokenizer",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/mobilebert/tokenization_mobilebert.py#L36"}}),Cn=new ze({}),jn=new ie({props:{name:"class transformers.MobileBertTokenizerFast",anchor:"transformers.MobileBertTokenizerFast",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/mobilebert/tokenization_mobilebert_fast.py#L40"}}),An=new ze({}),On=new ie({props:{name:"class transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput",anchor:"transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput",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/mobilebert/modeling_mobilebert.py#L684",parametersDescription:[{anchor:"transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput.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.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput.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.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput.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.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput.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.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput.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"}]}}),Dn=new ie({props:{name:"class transformers.models.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput",anchor:"transformers.models.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput",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.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L800",parametersDescription:[{anchor:"transformers.models.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput.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.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput.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.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput.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.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput.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"}]}}),Wn=new ze({}),Rn=new ie({props:{name:"class transformers.MobileBertModel",anchor:"transformers.MobileBertModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_mobilebert.py#L787",parametersDescription:[{anchor:"transformers.MobileBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),Kn=new ie({props:{name:"forward",anchor:"transformers.MobileBertModel.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"output_attentions",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_mobilebert.py#L817",parametersDescription:[{anchor:"transformers.MobileBertModel.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.MobileBertModel.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.MobileBertModel.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.MobileBertModel.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.MobileBertModel.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.MobileBertModel.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.MobileBertModel.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.MobileBertModel.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.MobileBertModel.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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Lo=new Ee({props:{$$slots:{default:[dM]},$$scope:{ctx:R}}}),Gn=new qe({props:{code:`from transformers import MobileBertTokenizer, MobileBertModel
import torch

tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = MobileBertModel.from_pretrained("google/mobilebert-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> MobileBertTokenizer, MobileBertModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertModel.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-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`}}),Jn=new ze({}),Yn=new ie({props:{name:"class transformers.MobileBertForPreTraining",anchor:"transformers.MobileBertForPreTraining",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_mobilebert.py#L903",parametersDescription:[{anchor:"transformers.MobileBertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),ts=new ie({props:{name:"forward",anchor:"transformers.MobileBertForPreTraining.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"next_sentence_label",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_mobilebert.py#L926",parametersDescription:[{anchor:"transformers.MobileBertForPreTraining.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.MobileBertForPreTraining.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.MobileBertForPreTraining.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.MobileBertForPreTraining.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.MobileBertForPreTraining.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.MobileBertForPreTraining.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.MobileBertForPreTraining.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.MobileBertForPreTraining.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.MobileBertForPreTraining.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.MobileBertForPreTraining.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"},{anchor:"transformers.MobileBertForPreTraining.forward.next_sentence_label",description:`<strong>next_sentence_label</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:"next_sentence_label"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput"
>transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput</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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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/mobilebert#transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput"
>transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ro=new Ee({props:{$$slots:{default:[cM]},$$scope:{ctx:R}}}),os=new qe({props:{code:`from transformers import MobileBertTokenizer, MobileBertForPreTraining
import torch

tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = MobileBertForPreTraining.from_pretrained("google/mobilebert-uncased")

input_ids = torch.tensor(tokenizer.encode("Hello, my dog is cute", add_special_tokens=True)).unsqueeze(
    0
)  # Batch size 1
outputs = model(input_ids)

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> MobileBertTokenizer, MobileBertForPreTraining
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertForPreTraining.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = torch.tensor(tokenizer.encode(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, add_special_tokens=<span class="hljs-literal">True</span>)).unsqueeze(
<span class="hljs-meta">... </span>    <span class="hljs-number">0</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>)  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids)

<span class="hljs-meta">&gt;&gt;&gt; </span>prediction_logits = outputs.prediction_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>seq_relationship_logits = outputs.seq_relationship_logits`}}),ns=new ze({}),ss=new ie({props:{name:"class transformers.MobileBertForMaskedLM",anchor:"transformers.MobileBertForMaskedLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_mobilebert.py#L1010",parametersDescription:[{anchor:"transformers.MobileBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),ds=new ie({props:{name:"forward",anchor:"transformers.MobileBertForMaskedLM.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_mobilebert.py#L1036",parametersDescription:[{anchor:"transformers.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>
`}}),Qo=new Ee({props:{$$slots:{default:[pM]},$$scope:{ctx:R}}}),cs=new qe({props:{code:`from transformers import MobileBertTokenizer, MobileBertForMaskedLM
import torch

tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = MobileBertForMaskedLM.from_pretrained("google/mobilebert-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> MobileBertTokenizer, MobileBertForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-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`}}),ps=new ze({}),hs=new ie({props:{name:"class transformers.MobileBertForNextSentencePrediction",anchor:"transformers.MobileBertForNextSentencePrediction",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_mobilebert.py#L1110",parametersDescription:[{anchor:"transformers.MobileBertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),_s=new ie({props:{name:"forward",anchor:"transformers.MobileBertForNextSentencePrediction.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_mobilebert.py#L1120",parametersDescription:[{anchor:"transformers.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>
`}}),Vo=new Ee({props:{$$slots:{default:[hM]},$$scope:{ctx:R}}}),bs=new qe({props:{code:`from transformers import MobileBertTokenizer, MobileBertForNextSentencePrediction
import torch

tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = MobileBertForNextSentencePrediction.from_pretrained("google/mobilebert-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]))
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> MobileBertTokenizer, MobileBertForNextSentencePrediction
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertForNextSentencePrediction.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-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>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),Ts=new ze({}),vs=new ie({props:{name:"class transformers.MobileBertForSequenceClassification",anchor:"transformers.MobileBertForSequenceClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_mobilebert.py#L1213",parametersDescription:[{anchor:"transformers.MobileBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),ys=new ie({props:{name:"forward",anchor:"transformers.MobileBertForSequenceClassification.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/mobilebert/modeling_mobilebert.py#L1229",parametersDescription:[{anchor:"transformers.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>
`}}),Go=new Ee({props:{$$slots:{default:[mM]},$$scope:{ctx:R}}}),$s=new qe({props:{code:`import torch
from transformers import MobileBertTokenizer, MobileBertForSequenceClassification

torch.manual_seed(0)
tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = MobileBertForSequenceClassification.from_pretrained("google/mobilebert-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> MobileBertTokenizer, MobileBertForSequenceClassification

<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 = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-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)
`}}),Fs=new qe({props:{code:`import torch
from transformers import MobileBertTokenizer, MobileBertForSequenceClassification

torch.manual_seed(0)
tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = MobileBertForSequenceClassification.from_pretrained("google/mobilebert-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> MobileBertTokenizer, MobileBertForSequenceClassification

<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 = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-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)
`}}),Bs=new ze({}),Es=new ie({props:{name:"class transformers.MobileBertForMultipleChoice",anchor:"transformers.MobileBertForMultipleChoice",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_mobilebert.py#L1420",parametersDescription:[{anchor:"transformers.MobileBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),xs=new ie({props:{name:"forward",anchor:"transformers.MobileBertForMultipleChoice.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/mobilebert/modeling_mobilebert.py#L1434",parametersDescription:[{anchor:"transformers.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>
`}}),Yo=new Ee({props:{$$slots:{default:[uM]},$$scope:{ctx:R}}}),Cs=new qe({props:{code:`from transformers import MobileBertTokenizer, MobileBertForMultipleChoice
import torch

tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = MobileBertForMultipleChoice.from_pretrained("google/mobilebert-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> MobileBertTokenizer, MobileBertForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-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`}}),js=new ze({}),Ns=new ie({props:{name:"class transformers.MobileBertForTokenClassification",anchor:"transformers.MobileBertForTokenClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_mobilebert.py#L1518",parametersDescription:[{anchor:"transformers.MobileBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),Is=new ie({props:{name:"forward",anchor:"transformers.MobileBertForTokenClassification.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/mobilebert/modeling_mobilebert.py#L1536",parametersDescription:[{anchor:"transformers.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>
`}}),Xo=new Ee({props:{$$slots:{default:[fM]},$$scope:{ctx:R}}}),Ds=new qe({props:{code:`from transformers import MobileBertTokenizer, MobileBertForTokenClassification
import torch

tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = MobileBertForTokenClassification.from_pretrained("google/mobilebert-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> MobileBertTokenizer, MobileBertForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-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`}}),Ls=new ze({}),Ws=new ie({props:{name:"class transformers.MobileBertForQuestionAnswering",anchor:"transformers.MobileBertForQuestionAnswering",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_mobilebert.py#L1316",parametersDescription:[{anchor:"transformers.MobileBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),Us=new ie({props:{name:"forward",anchor:"transformers.MobileBertForQuestionAnswering.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/mobilebert/modeling_mobilebert.py#L1330",parametersDescription:[{anchor:"transformers.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>
`}}),tn=new Ee({props:{$$slots:{default:[gM]},$$scope:{ctx:R}}}),Vs=new qe({props:{code:`from transformers import MobileBertTokenizer, MobileBertForQuestionAnswering
import torch

torch.manual_seed(0)
tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = MobileBertForQuestionAnswering.from_pretrained("google/mobilebert-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> MobileBertTokenizer, MobileBertForQuestionAnswering
<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 = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-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)
`}}),Ks=new ze({}),Gs=new ie({props:{name:"class transformers.TFMobileBertModel",anchor:"transformers.TFMobileBertModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L927",parametersDescription:[{anchor:"transformers.TFMobileBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),nn=new Ee({props:{$$slots:{default:[_M]},$$scope:{ctx:R}}}),Xs=new ie({props:{name:"call",anchor:"transformers.TFMobileBertModel.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"training",val:" = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L932",parametersDescription:[{anchor:"transformers.TFMobileBertModel.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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/mobilebert#transformers.MobileBertTokenizer">MobileBertTokenizer</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.TFMobileBertModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</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.TFMobileBertModel.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</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.TFMobileBertModel.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</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.TFMobileBertModel.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</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.TFMobileBertModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<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.TFMobileBertModel.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.TFMobileBertModel.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.TFMobileBertModel.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.TFMobileBertModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#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.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>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.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),sn=new Ee({props:{$$slots:{default:[bM]},$$scope:{ctx:R}}}),er=new qe({props:{code:`from transformers import MobileBertTokenizer, TFMobileBertModel
import tensorflow as tf

tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = TFMobileBertModel.from_pretrained("google/mobilebert-uncased")

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

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MobileBertTokenizer, TFMobileBertModel
<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 = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMobileBertModel.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),tr=new ze({}),or=new ie({props:{name:"class transformers.TFMobileBertForPreTraining",anchor:"transformers.TFMobileBertForPreTraining",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1002",parametersDescription:[{anchor:"transformers.TFMobileBertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),an=new Ee({props:{$$slots:{default:[TM]},$$scope:{ctx:R}}}),ar=new ie({props:{name:"call",anchor:"transformers.TFMobileBertForPreTraining.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"training",val:" = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1016",parametersDescription:[{anchor:"transformers.TFMobileBertForPreTraining.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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/mobilebert#transformers.MobileBertTokenizer">MobileBertTokenizer</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.TFMobileBertForPreTraining.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</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.TFMobileBertForPreTraining.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</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.TFMobileBertForPreTraining.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</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.TFMobileBertForPreTraining.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</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.TFMobileBertForPreTraining.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<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.TFMobileBertForPreTraining.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.TFMobileBertForPreTraining.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.TFMobileBertForPreTraining.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.TFMobileBertForPreTraining.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#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/model_doc/mobilebert#transformers.models.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput"
>transformers.models.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput</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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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/mobilebert#transformers.models.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput"
>transformers.models.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ln=new Ee({props:{$$slots:{default:[vM]},$$scope:{ctx:R}}}),ir=new qe({props:{code:`import tensorflow as tf
from transformers import MobileBertTokenizer, TFMobileBertForPreTraining

tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = TFMobileBertForPreTraining.from_pretrained("google/mobilebert-uncased")
input_ids = tf.constant(tokenizer.encode("Hello, my dog is cute"))[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> MobileBertTokenizer, TFMobileBertForPreTraining

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMobileBertForPreTraining.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-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>))[<span class="hljs-literal">None</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>]`}}),lr=new ze({}),dr=new ie({props:{name:"class transformers.TFMobileBertForMaskedLM",anchor:"transformers.TFMobileBertForMaskedLM",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1102",parametersDescription:[{anchor:"transformers.TFMobileBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),cn=new Ee({props:{$$slots:{default:[kM]},$$scope:{ctx:R}}}),ur=new ie({props:{name:"call",anchor:"transformers.TFMobileBertForMaskedLM.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"labels",val:" = None"},{name:"training",val:" = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1123",parametersDescription:[{anchor:"transformers.TFMobileBertForMaskedLM.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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/mobilebert#transformers.MobileBertTokenizer">MobileBertTokenizer</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.TFMobileBertForMaskedLM.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</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.TFMobileBertForMaskedLM.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</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.TFMobileBertForMaskedLM.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</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.TFMobileBertForMaskedLM.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</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.TFMobileBertForMaskedLM.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<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.TFMobileBertForMaskedLM.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.TFMobileBertForMaskedLM.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.TFMobileBertForMaskedLM.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.TFMobileBertForMaskedLM.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#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.TFMobileBertForMaskedLM.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`,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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>
`}}),pn=new Ee({props:{$$slots:{default:[MM]},$$scope:{ctx:R}}}),fr=new qe({props:{code:`from transformers import MobileBertTokenizer, TFMobileBertForMaskedLM
import tensorflow as tf

tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = TFMobileBertForMaskedLM.from_pretrained("google/mobilebert-uncased")

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> MobileBertTokenizer, TFMobileBertForMaskedLM
<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 = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMobileBertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is [MASK].&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>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`}}),gr=new ze({}),_r=new ie({props:{name:"class transformers.TFMobileBertForNextSentencePrediction",anchor:"transformers.TFMobileBertForNextSentencePrediction",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1217",parametersDescription:[{anchor:"transformers.TFMobileBertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),mn=new Ee({props:{$$slots:{default:[wM]},$$scope:{ctx:R}}}),Mr=new ie({props:{name:"call",anchor:"transformers.TFMobileBertForNextSentencePrediction.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"next_sentence_label",val:" = None"},{name:"training",val:" = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1227",parametersDescription:[{anchor:"transformers.TFMobileBertForNextSentencePrediction.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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/mobilebert#transformers.MobileBertTokenizer">MobileBertTokenizer</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.TFMobileBertForNextSentencePrediction.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</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.TFMobileBertForNextSentencePrediction.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</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.TFMobileBertForNextSentencePrediction.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</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.TFMobileBertForNextSentencePrediction.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</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.TFMobileBertForNextSentencePrediction.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<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.TFMobileBertForNextSentencePrediction.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.TFMobileBertForNextSentencePrediction.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.TFMobileBertForNextSentencePrediction.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.TFMobileBertForNextSentencePrediction.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>
`}}),un=new Ee({props:{$$slots:{default:[yM]},$$scope:{ctx:R}}}),wr=new qe({props:{code:`import tensorflow as tf
from transformers import MobileBertTokenizer, TFMobileBertForNextSentencePrediction

tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = TFMobileBertForNextSentencePrediction.from_pretrained("google/mobilebert-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]`,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> MobileBertTokenizer, TFMobileBertForNextSentencePrediction

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMobileBertForNextSentencePrediction.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-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>]`}}),yr=new ze({}),$r=new ie({props:{name:"class transformers.TFMobileBertForSequenceClassification",anchor:"transformers.TFMobileBertForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1325",parametersDescription:[{anchor:"transformers.TFMobileBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),gn=new Ee({props:{$$slots:{default:[$M]},$$scope:{ctx:R}}}),zr=new ie({props:{name:"call",anchor:"transformers.TFMobileBertForSequenceClassification.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"labels",val:" = None"},{name:"training",val:" = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1348",parametersDescription:[{anchor:"transformers.TFMobileBertForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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/mobilebert#transformers.MobileBertTokenizer">MobileBertTokenizer</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.TFMobileBertForSequenceClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</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.TFMobileBertForSequenceClassification.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</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.TFMobileBertForSequenceClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</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.TFMobileBertForSequenceClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</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.TFMobileBertForSequenceClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<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.TFMobileBertForSequenceClassification.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.TFMobileBertForSequenceClassification.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.TFMobileBertForSequenceClassification.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.TFMobileBertForSequenceClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#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.TFMobileBertForSequenceClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>
`}}),_n=new Ee({props:{$$slots:{default:[FM]},$$scope:{ctx:R}}}),Pr=new qe({props:{code:`from transformers import MobileBertTokenizer, TFMobileBertForSequenceClassification
import tensorflow as tf

tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = TFMobileBertForSequenceClassification.from_pretrained("google/mobilebert-uncased")

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> MobileBertTokenizer, TFMobileBertForSequenceClassification
<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 = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMobileBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>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`}}),qr=new ze({}),xr=new ie({props:{name:"class transformers.TFMobileBertForMultipleChoice",anchor:"transformers.TFMobileBertForMultipleChoice",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1560",parametersDescription:[{anchor:"transformers.TFMobileBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),Tn=new Ee({props:{$$slots:{default:[BM]},$$scope:{ctx:R}}}),Sr=new ie({props:{name:"call",anchor:"transformers.TFMobileBertForMultipleChoice.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"labels",val:" = None"},{name:"training",val:" = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1589",parametersDescription:[{anchor:"transformers.TFMobileBertForMultipleChoice.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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/mobilebert#transformers.MobileBertTokenizer">MobileBertTokenizer</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.TFMobileBertForMultipleChoice.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</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.TFMobileBertForMultipleChoice.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</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.TFMobileBertForMultipleChoice.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</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.TFMobileBertForMultipleChoice.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</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.TFMobileBertForMultipleChoice.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<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.TFMobileBertForMultipleChoice.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.TFMobileBertForMultipleChoice.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.TFMobileBertForMultipleChoice.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.TFMobileBertForMultipleChoice.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#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.TFMobileBertForMultipleChoice.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>
`}}),vn=new Ee({props:{$$slots:{default:[EM]},$$scope:{ctx:R}}}),Ar=new qe({props:{code:`from transformers import MobileBertTokenizer, TFMobileBertForMultipleChoice
import tensorflow as tf

tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = TFMobileBertForMultipleChoice.from_pretrained("google/mobilebert-uncased")

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

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

# the linear classifier still needs to be trained
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MobileBertTokenizer, TFMobileBertForMultipleChoice
<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 = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMobileBertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the linear classifier still needs to be trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),Or=new ze({}),Ir=new ie({props:{name:"class transformers.TFMobileBertForTokenClassification",anchor:"transformers.TFMobileBertForTokenClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1717",parametersDescription:[{anchor:"transformers.TFMobileBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),Mn=new Ee({props:{$$slots:{default:[zM]},$$scope:{ctx:R}}}),Rr=new ie({props:{name:"call",anchor:"transformers.TFMobileBertForTokenClassification.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"labels",val:" = None"},{name:"training",val:" = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1741",parametersDescription:[{anchor:"transformers.TFMobileBertForTokenClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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/mobilebert#transformers.MobileBertTokenizer">MobileBertTokenizer</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.TFMobileBertForTokenClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</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.TFMobileBertForTokenClassification.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</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.TFMobileBertForTokenClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</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.TFMobileBertForTokenClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</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.TFMobileBertForTokenClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<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.TFMobileBertForTokenClassification.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.TFMobileBertForTokenClassification.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.TFMobileBertForTokenClassification.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.TFMobileBertForTokenClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#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.TFMobileBertForTokenClassification.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 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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>
`}}),wn=new Ee({props:{$$slots:{default:[PM]},$$scope:{ctx:R}}}),Hr=new qe({props:{code:`from transformers import MobileBertTokenizer, TFMobileBertForTokenClassification
import tensorflow as tf

tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = TFMobileBertForTokenClassification.from_pretrained("google/mobilebert-uncased")

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> MobileBertTokenizer, TFMobileBertForTokenClassification
<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 = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMobileBertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>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`}}),Qr=new ze({}),Ur=new ie({props:{name:"class transformers.TFMobileBertForQuestionAnswering",anchor:"transformers.TFMobileBertForQuestionAnswering",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1437",parametersDescription:[{anchor:"transformers.TFMobileBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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"}]}}),$n=new Ee({props:{$$slots:{default:[qM]},$$scope:{ctx:R}}}),Jr=new ie({props:{name:"call",anchor:"transformers.TFMobileBertForQuestionAnswering.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"start_positions",val:" = None"},{name:"end_positions",val:" = None"},{name:"training",val:" = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1456",parametersDescription:[{anchor:"transformers.TFMobileBertForQuestionAnswering.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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/mobilebert#transformers.MobileBertTokenizer">MobileBertTokenizer</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.TFMobileBertForQuestionAnswering.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</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.TFMobileBertForQuestionAnswering.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</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.TFMobileBertForQuestionAnswering.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</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.TFMobileBertForQuestionAnswering.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</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.TFMobileBertForQuestionAnswering.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<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.TFMobileBertForQuestionAnswering.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.TFMobileBertForQuestionAnswering.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.TFMobileBertForQuestionAnswering.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.TFMobileBertForQuestionAnswering.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#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.TFMobileBertForQuestionAnswering.call.start_positions",description:`<strong>start_positions</strong> (<code>tf.Tensor</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.TFMobileBertForQuestionAnswering.call.end_positions",description:`<strong>end_positions</strong> (<code>tf.Tensor</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/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>
`}}),Fn=new Ee({props:{$$slots:{default:[xM]},$$scope:{ctx:R}}}),Yr=new qe({props:{code:`from transformers import MobileBertTokenizer, TFMobileBertForQuestionAnswering
import tensorflow as tf

tokenizer = MobileBertTokenizer.from_pretrained("google/mobilebert-uncased")
model = TFMobileBertForQuestionAnswering.from_pretrained("google/mobilebert-uncased")

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> MobileBertTokenizer, TFMobileBertForQuestionAnswering
<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 = MobileBertTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMobileBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-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>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>])`}}),{c(){h=r("meta"),k=l(),f=r("h1"),g=r("a"),T=r("span"),w(b.$$.fragment),_=l(),M=r("span"),he=n("MobileBERT"),K=l(),z=r("h2"),Z=r("a"),I=r("span"),w(ee.$$.fragment),me=l(),D=r("span"),ue=n("Overview"),le=l(),V=r("p"),j=n("The MobileBERT model was proposed in "),te=r("a"),G=n("MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices"),P=n(` by Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny
Zhou. It\u2019s a bidirectional transformer based on the BERT model, which is compressed and accelerated using several
approaches.`),x=l(),ne=r("p"),H=n("The abstract from the paper is the following:"),de=l(),se=r("p"),L=r("em"),fe=n(`Natural Language Processing (NLP) has recently achieved great success by using huge pre-trained models with hundreds
of millions of parameters. However, these models suffer from heavy model sizes and high latency such that they cannot
be deployed to resource-limited mobile devices. In this paper, we propose MobileBERT for compressing and accelerating
the popular BERT model. Like the original BERT, MobileBERT is task-agnostic, that is, it can be generically applied to
various downstream NLP tasks via simple fine-tuning. Basically, MobileBERT is a thin version of BERT_LARGE, while
equipped with bottleneck structures and a carefully designed balance between self-attentions and feed-forward networks.
To train MobileBERT, we first train a specially designed teacher model, an inverted-bottleneck incorporated BERT_LARGE
model. Then, we conduct knowledge transfer from this teacher to MobileBERT. Empirical studies show that MobileBERT is
4.3x smaller and 5.5x faster than BERT_BASE while achieving competitive results on well-known benchmarks. On the
natural language inference tasks of GLUE, MobileBERT achieves a GLUEscore o 77.7 (0.6 lower than BERT_BASE), and 62 ms
latency on a Pixel 4 phone. On the SQuAD v1.1/v2.0 question answering task, MobileBERT achieves a dev F1 score of
90.0/79.2 (1.5/2.1 higher than BERT_BASE).`),ce=l(),q=r("p"),ge=n("Tips:"),W=l(),X=r("ul"),re=r("li"),Q=n(`MobileBERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather
than the left.`),_e=l(),ae=r("li"),N=n(`MobileBERT is similar to BERT and therefore relies on the masked language modeling (MLM) objective. It is therefore
efficient at predicting masked tokens and at NLU in general, but is not optimal for text generation. Models trained
with a causal language modeling (CLM) objective are better in that regard.`),pe=l(),A=r("p"),be=n("This model was contributed by "),c=r("a"),v=n("vshampor"),J=n(". The original code can be found "),ke=r("a"),$e=n("here"),S=n("."),we=l(),Te=r("h2"),ve=r("a"),C=r("span"),w(O.$$.fragment),Fe=l(),Me=r("span"),U=n("MobileBertConfig"),ye=l(),Y=r("div"),w(oe.$$.fragment),Be=l(),Ht=r("p"),_p=n("This is the configuration class to store the configuration of a "),na=r("a"),bp=n("MobileBertModel"),Tp=n(" or a "),sa=r("a"),vp=n("TFMobileBertModel"),kp=n(`. It
is used to instantiate a MobileBERT model according to the specified arguments, defining the model architecture.`),Mp=l(),Qt=r("p"),wp=n("Configuration objects inherit from "),ra=r("a"),yp=n("PretrainedConfig"),$p=n(` and can be used to control the model outputs. Read the
documentation from `),aa=r("a"),Fp=n("PretrainedConfig"),Bp=n(" for more information."),Ep=l(),fi=r("p"),zp=n("Examples:"),Pp=l(),w(zn.$$.fragment),qp=l(),gi=r("p"),xp=n(`Attributes: pretrained_config_archive_map (Dict[str, str]): A dictionary containing all the available pre-trained
checkpoints.`),wd=l(),Ut=r("h2"),No=r("a"),_i=r("span"),w(Pn.$$.fragment),Cp=l(),bi=r("span"),jp=n("MobileBertTokenizer"),yd=l(),ct=r("div"),w(qn.$$.fragment),Np=l(),Ti=r("p"),Sp=n("Construct a MobileBERT tokenizer."),Ap=l(),So=r("p"),ia=r("a"),Op=n("MobileBertTokenizer"),Ip=n(" is identical to "),la=r("a"),Dp=n("BertTokenizer"),Lp=n(` and runs end-to-end tokenization: punctuation splitting
and wordpiece.`),Wp=l(),xn=r("p"),Rp=n("Refer to superclass "),da=r("a"),Hp=n("BertTokenizer"),Qp=n(" for usage examples and documentation concerning parameters."),$d=l(),Vt=r("h2"),Ao=r("a"),vi=r("span"),w(Cn.$$.fragment),Up=l(),ki=r("span"),Vp=n("MobileBertTokenizerFast"),Fd=l(),pt=r("div"),w(jn.$$.fragment),Kp=l(),Nn=r("p"),Gp=n("Construct a \u201Cfast\u201D MobileBERT tokenizer (backed by HuggingFace\u2019s "),Mi=r("em"),Jp=n("tokenizers"),Yp=n(" library)."),Zp=l(),Oo=r("p"),ca=r("a"),Xp=n("MobileBertTokenizerFast"),eh=n(" is identical to "),pa=r("a"),th=n("BertTokenizerFast"),oh=n(` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),nh=l(),Sn=r("p"),sh=n("Refer to superclass "),ha=r("a"),rh=n("BertTokenizerFast"),ah=n(" for usage examples and documentation concerning parameters."),Bd=l(),Kt=r("h2"),Io=r("a"),wi=r("span"),w(An.$$.fragment),ih=l(),yi=r("span"),lh=n("MobileBert specific outputs"),Ed=l(),Gt=r("div"),w(On.$$.fragment),dh=l(),In=r("p"),ch=n("Output type of "),ma=r("a"),ph=n("MobileBertForPreTraining"),hh=n("."),zd=l(),Jt=r("div"),w(Dn.$$.fragment),mh=l(),Ln=r("p"),uh=n("Output type of "),ua=r("a"),fh=n("TFMobileBertForPreTraining"),gh=n("."),Pd=l(),Yt=r("h2"),Do=r("a"),$i=r("span"),w(Wn.$$.fragment),_h=l(),Fi=r("span"),bh=n("MobileBertModel"),qd=l(),xe=r("div"),w(Rn.$$.fragment),Th=l(),Bi=r("p"),vh=n("The bare MobileBert Model transformer outputting raw hidden-states without any specific head on top."),kh=l(),Hn=r("p"),Mh=n("This model inherits from "),fa=r("a"),wh=n("PreTrainedModel"),yh=n(`. 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.)`),$h=l(),Qn=r("p"),Fh=n("This model is also a PyTorch "),Un=r("a"),Bh=n("torch.nn.Module"),Eh=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),zh=l(),Ei=r("p"),Vn=r("a"),Ph=n("https://arxiv.org/pdf/2004.02984.pdf"),qh=l(),Ke=r("div"),w(Kn.$$.fragment),xh=l(),Zt=r("p"),Ch=n("The "),ga=r("a"),jh=n("MobileBertModel"),Nh=n(" forward method, overrides the "),zi=r("code"),Sh=n("__call__"),Ah=n(" special method."),Oh=l(),w(Lo.$$.fragment),Ih=l(),Pi=r("p"),Dh=n("Example:"),Lh=l(),w(Gn.$$.fragment),xd=l(),Xt=r("h2"),Wo=r("a"),qi=r("span"),w(Jn.$$.fragment),Wh=l(),xi=r("span"),Rh=n("MobileBertForPreTraining"),Cd=l(),Le=r("div"),w(Yn.$$.fragment),Hh=l(),eo=r("p"),Qh=n("MobileBert Model with two heads on top as done during the pretraining: a "),Ci=r("code"),Uh=n("masked language modeling"),Vh=n(` head and a
`),ji=r("code"),Kh=n("next sentence prediction (classification)"),Gh=n(" head."),Jh=l(),Zn=r("p"),Yh=n("This model inherits from "),_a=r("a"),Zh=n("PreTrainedModel"),Xh=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),em=l(),Xn=r("p"),tm=n("This model is also a PyTorch "),es=r("a"),om=n("torch.nn.Module"),nm=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),sm=l(),Ge=r("div"),w(ts.$$.fragment),rm=l(),to=r("p"),am=n("The "),ba=r("a"),im=n("MobileBertForPreTraining"),lm=n(" forward method, overrides the "),Ni=r("code"),dm=n("__call__"),cm=n(" special method."),pm=l(),w(Ro.$$.fragment),hm=l(),Si=r("p"),mm=n("Examples:"),um=l(),w(os.$$.fragment),jd=l(),oo=r("h2"),Ho=r("a"),Ai=r("span"),w(ns.$$.fragment),fm=l(),Oi=r("span"),gm=n("MobileBertForMaskedLM"),Nd=l(),We=r("div"),w(ss.$$.fragment),_m=l(),rs=r("p"),bm=n("MobileBert Model with a "),Ii=r("code"),Tm=n("language modeling"),vm=n(" head on top."),km=l(),as=r("p"),Mm=n("This model inherits from "),Ta=r("a"),wm=n("PreTrainedModel"),ym=n(`. 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.)`),$m=l(),is=r("p"),Fm=n("This model is also a PyTorch "),ls=r("a"),Bm=n("torch.nn.Module"),Em=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),zm=l(),Je=r("div"),w(ds.$$.fragment),Pm=l(),no=r("p"),qm=n("The "),va=r("a"),xm=n("MobileBertForMaskedLM"),Cm=n(" forward method, overrides the "),Di=r("code"),jm=n("__call__"),Nm=n(" special method."),Sm=l(),w(Qo.$$.fragment),Am=l(),Li=r("p"),Om=n("Example:"),Im=l(),w(cs.$$.fragment),Sd=l(),so=r("h2"),Uo=r("a"),Wi=r("span"),w(ps.$$.fragment),Dm=l(),Ri=r("span"),Lm=n("MobileBertForNextSentencePrediction"),Ad=l(),Re=r("div"),w(hs.$$.fragment),Wm=l(),ms=r("p"),Rm=n("MobileBert Model with a "),Hi=r("code"),Hm=n("next sentence prediction (classification)"),Qm=n(" head on top."),Um=l(),us=r("p"),Vm=n("This model inherits from "),ka=r("a"),Km=n("PreTrainedModel"),Gm=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Jm=l(),fs=r("p"),Ym=n("This model is also a PyTorch "),gs=r("a"),Zm=n("torch.nn.Module"),Xm=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),eu=l(),Ye=r("div"),w(_s.$$.fragment),tu=l(),ro=r("p"),ou=n("The "),Ma=r("a"),nu=n("MobileBertForNextSentencePrediction"),su=n(" forward method, overrides the "),Qi=r("code"),ru=n("__call__"),au=n(" special method."),iu=l(),w(Vo.$$.fragment),lu=l(),Ui=r("p"),du=n("Examples:"),cu=l(),w(bs.$$.fragment),Od=l(),ao=r("h2"),Ko=r("a"),Vi=r("span"),w(Ts.$$.fragment),pu=l(),Ki=r("span"),hu=n("MobileBertForSequenceClassification"),Id=l(),He=r("div"),w(vs.$$.fragment),mu=l(),Gi=r("p"),uu=n(`MobileBert Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),fu=l(),ks=r("p"),gu=n("This model inherits from "),wa=r("a"),_u=n("PreTrainedModel"),bu=n(`. 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.)`),Tu=l(),Ms=r("p"),vu=n("This model is also a PyTorch "),ws=r("a"),ku=n("torch.nn.Module"),Mu=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),wu=l(),Pe=r("div"),w(ys.$$.fragment),yu=l(),io=r("p"),$u=n("The "),ya=r("a"),Fu=n("MobileBertForSequenceClassification"),Bu=n(" forward method, overrides the "),Ji=r("code"),Eu=n("__call__"),zu=n(" special method."),Pu=l(),w(Go.$$.fragment),qu=l(),Yi=r("p"),xu=n("Example of single-label classification:"),Cu=l(),w($s.$$.fragment),ju=l(),Zi=r("p"),Nu=n("Example of multi-label classification:"),Su=l(),w(Fs.$$.fragment),Dd=l(),lo=r("h2"),Jo=r("a"),Xi=r("span"),w(Bs.$$.fragment),Au=l(),el=r("span"),Ou=n("MobileBertForMultipleChoice"),Ld=l(),Qe=r("div"),w(Es.$$.fragment),Iu=l(),tl=r("p"),Du=n(`MobileBert Model with a multiple choice classification head on top (a linear layer on top of the pooled output and
a softmax) e.g. for RocStories/SWAG tasks.`),Lu=l(),zs=r("p"),Wu=n("This model inherits from "),$a=r("a"),Ru=n("PreTrainedModel"),Hu=n(`. 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.)`),Qu=l(),Ps=r("p"),Uu=n("This model is also a PyTorch "),qs=r("a"),Vu=n("torch.nn.Module"),Ku=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Gu=l(),Ze=r("div"),w(xs.$$.fragment),Ju=l(),co=r("p"),Yu=n("The "),Fa=r("a"),Zu=n("MobileBertForMultipleChoice"),Xu=n(" forward method, overrides the "),ol=r("code"),ef=n("__call__"),tf=n(" special method."),of=l(),w(Yo.$$.fragment),nf=l(),nl=r("p"),sf=n("Example:"),rf=l(),w(Cs.$$.fragment),Wd=l(),po=r("h2"),Zo=r("a"),sl=r("span"),w(js.$$.fragment),af=l(),rl=r("span"),lf=n("MobileBertForTokenClassification"),Rd=l(),Ue=r("div"),w(Ns.$$.fragment),df=l(),al=r("p"),cf=n(`MobileBert 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.`),pf=l(),Ss=r("p"),hf=n("This model inherits from "),Ba=r("a"),mf=n("PreTrainedModel"),uf=n(`. 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.)`),ff=l(),As=r("p"),gf=n("This model is also a PyTorch "),Os=r("a"),_f=n("torch.nn.Module"),bf=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Tf=l(),Xe=r("div"),w(Is.$$.fragment),vf=l(),ho=r("p"),kf=n("The "),Ea=r("a"),Mf=n("MobileBertForTokenClassification"),wf=n(" forward method, overrides the "),il=r("code"),yf=n("__call__"),$f=n(" special method."),Ff=l(),w(Xo.$$.fragment),Bf=l(),ll=r("p"),Ef=n("Example:"),zf=l(),w(Ds.$$.fragment),Hd=l(),mo=r("h2"),en=r("a"),dl=r("span"),w(Ls.$$.fragment),Pf=l(),cl=r("span"),qf=n("MobileBertForQuestionAnswering"),Qd=l(),Ve=r("div"),w(Ws.$$.fragment),xf=l(),uo=r("p"),Cf=n(`MobileBert 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 `),pl=r("code"),jf=n("span start logits"),Nf=n(" and "),hl=r("code"),Sf=n("span end logits"),Af=n(")."),Of=l(),Rs=r("p"),If=n("This model inherits from "),za=r("a"),Df=n("PreTrainedModel"),Lf=n(`. 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.)`),Wf=l(),Hs=r("p"),Rf=n("This model is also a PyTorch "),Qs=r("a"),Hf=n("torch.nn.Module"),Qf=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Uf=l(),et=r("div"),w(Us.$$.fragment),Vf=l(),fo=r("p"),Kf=n("The "),Pa=r("a"),Gf=n("MobileBertForQuestionAnswering"),Jf=n(" forward method, overrides the "),ml=r("code"),Yf=n("__call__"),Zf=n(" special method."),Xf=l(),w(tn.$$.fragment),eg=l(),ul=r("p"),tg=n("Example:"),og=l(),w(Vs.$$.fragment),Ud=l(),go=r("h2"),on=r("a"),fl=r("span"),w(Ks.$$.fragment),ng=l(),gl=r("span"),sg=n("TFMobileBertModel"),Vd=l(),Ce=r("div"),w(Gs.$$.fragment),rg=l(),_l=r("p"),ag=n("The bare MobileBert Model transformer outputting raw hidden-states without any specific head on top."),ig=l(),Js=r("p"),lg=n("This model inherits from "),qa=r("a"),dg=n("TFPreTrainedModel"),cg=n(`. 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.)`),pg=l(),Ys=r("p"),hg=n("This model is also a "),Zs=r("a"),mg=n("tf.keras.Model"),ug=n(` 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.`),fg=l(),w(nn.$$.fragment),gg=l(),tt=r("div"),w(Xs.$$.fragment),_g=l(),_o=r("p"),bg=n("The "),xa=r("a"),Tg=n("TFMobileBertModel"),vg=n(" forward method, overrides the "),bl=r("code"),kg=n("__call__"),Mg=n(" special method."),wg=l(),w(sn.$$.fragment),yg=l(),Tl=r("p"),$g=n("Example:"),Fg=l(),w(er.$$.fragment),Kd=l(),bo=r("h2"),rn=r("a"),vl=r("span"),w(tr.$$.fragment),Bg=l(),kl=r("span"),Eg=n("TFMobileBertForPreTraining"),Gd=l(),je=r("div"),w(or.$$.fragment),zg=l(),To=r("p"),Pg=n("MobileBert Model with two heads on top as done during the pretraining: a "),Ml=r("code"),qg=n("masked language modeling"),xg=n(` head and a
`),wl=r("code"),Cg=n("next sentence prediction (classification)"),jg=n(" head."),Ng=l(),nr=r("p"),Sg=n("This model inherits from "),Ca=r("a"),Ag=n("TFPreTrainedModel"),Og=n(`. 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.)`),Ig=l(),sr=r("p"),Dg=n("This model is also a "),rr=r("a"),Lg=n("tf.keras.Model"),Wg=n(` 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.`),Rg=l(),w(an.$$.fragment),Hg=l(),ot=r("div"),w(ar.$$.fragment),Qg=l(),vo=r("p"),Ug=n("The "),ja=r("a"),Vg=n("TFMobileBertForPreTraining"),Kg=n(" forward method, overrides the "),yl=r("code"),Gg=n("__call__"),Jg=n(" special method."),Yg=l(),w(ln.$$.fragment),Zg=l(),$l=r("p"),Xg=n("Examples:"),e_=l(),w(ir.$$.fragment),Jd=l(),ko=r("h2"),dn=r("a"),Fl=r("span"),w(lr.$$.fragment),t_=l(),Bl=r("span"),o_=n("TFMobileBertForMaskedLM"),Yd=l(),Ne=r("div"),w(dr.$$.fragment),n_=l(),cr=r("p"),s_=n("MobileBert Model with a "),El=r("code"),r_=n("language modeling"),a_=n(" head on top."),i_=l(),pr=r("p"),l_=n("This model inherits from "),Na=r("a"),d_=n("TFPreTrainedModel"),c_=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),p_=l(),hr=r("p"),h_=n("This model is also a "),mr=r("a"),m_=n("tf.keras.Model"),u_=n(` 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.`),f_=l(),w(cn.$$.fragment),g_=l(),nt=r("div"),w(ur.$$.fragment),__=l(),Mo=r("p"),b_=n("The "),Sa=r("a"),T_=n("TFMobileBertForMaskedLM"),v_=n(" forward method, overrides the "),zl=r("code"),k_=n("__call__"),M_=n(" special method."),w_=l(),w(pn.$$.fragment),y_=l(),Pl=r("p"),$_=n("Example:"),F_=l(),w(fr.$$.fragment),Zd=l(),wo=r("h2"),hn=r("a"),ql=r("span"),w(gr.$$.fragment),B_=l(),xl=r("span"),E_=n("TFMobileBertForNextSentencePrediction"),Xd=l(),Se=r("div"),w(_r.$$.fragment),z_=l(),br=r("p"),P_=n("MobileBert Model with a "),Cl=r("code"),q_=n("next sentence prediction (classification)"),x_=n(" head on top."),C_=l(),Tr=r("p"),j_=n("This model inherits from "),Aa=r("a"),N_=n("TFPreTrainedModel"),S_=n(`. 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.)`),A_=l(),vr=r("p"),O_=n("This model is also a "),kr=r("a"),I_=n("tf.keras.Model"),D_=n(` 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.`),L_=l(),w(mn.$$.fragment),W_=l(),st=r("div"),w(Mr.$$.fragment),R_=l(),yo=r("p"),H_=n("The "),Oa=r("a"),Q_=n("TFMobileBertForNextSentencePrediction"),U_=n(" forward method, overrides the "),jl=r("code"),V_=n("__call__"),K_=n(" special method."),G_=l(),w(un.$$.fragment),J_=l(),Nl=r("p"),Y_=n("Examples:"),Z_=l(),w(wr.$$.fragment),ec=l(),$o=r("h2"),fn=r("a"),Sl=r("span"),w(yr.$$.fragment),X_=l(),Al=r("span"),eb=n("TFMobileBertForSequenceClassification"),tc=l(),Ae=r("div"),w($r.$$.fragment),tb=l(),Ol=r("p"),ob=n(`MobileBert Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),nb=l(),Fr=r("p"),sb=n("This model inherits from "),Ia=r("a"),rb=n("TFPreTrainedModel"),ab=n(`. 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.)`),ib=l(),Br=r("p"),lb=n("This model is also a "),Er=r("a"),db=n("tf.keras.Model"),cb=n(` 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.`),pb=l(),w(gn.$$.fragment),hb=l(),rt=r("div"),w(zr.$$.fragment),mb=l(),Fo=r("p"),ub=n("The "),Da=r("a"),fb=n("TFMobileBertForSequenceClassification"),gb=n(" forward method, overrides the "),Il=r("code"),_b=n("__call__"),bb=n(" special method."),Tb=l(),w(_n.$$.fragment),vb=l(),Dl=r("p"),kb=n("Example:"),Mb=l(),w(Pr.$$.fragment),oc=l(),Bo=r("h2"),bn=r("a"),Ll=r("span"),w(qr.$$.fragment),wb=l(),Wl=r("span"),yb=n("TFMobileBertForMultipleChoice"),nc=l(),Oe=r("div"),w(xr.$$.fragment),$b=l(),Rl=r("p"),Fb=n(`MobileBert 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.`),Bb=l(),Cr=r("p"),Eb=n("This model inherits from "),La=r("a"),zb=n("TFPreTrainedModel"),Pb=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),qb=l(),jr=r("p"),xb=n("This model is also a "),Nr=r("a"),Cb=n("tf.keras.Model"),jb=n(` 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.`),Nb=l(),w(Tn.$$.fragment),Sb=l(),at=r("div"),w(Sr.$$.fragment),Ab=l(),Eo=r("p"),Ob=n("The "),Wa=r("a"),Ib=n("TFMobileBertForMultipleChoice"),Db=n(" forward method, overrides the "),Hl=r("code"),Lb=n("__call__"),Wb=n(" special method."),Rb=l(),w(vn.$$.fragment),Hb=l(),Ql=r("p"),Qb=n("Example:"),Ub=l(),w(Ar.$$.fragment),sc=l(),zo=r("h2"),kn=r("a"),Ul=r("span"),w(Or.$$.fragment),Vb=l(),Vl=r("span"),Kb=n("TFMobileBertForTokenClassification"),rc=l(),Ie=r("div"),w(Ir.$$.fragment),Gb=l(),Kl=r("p"),Jb=n(`MobileBert 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.`),Yb=l(),Dr=r("p"),Zb=n("This model inherits from "),Ra=r("a"),Xb=n("TFPreTrainedModel"),eT=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),tT=l(),Lr=r("p"),oT=n("This model is also a "),Wr=r("a"),nT=n("tf.keras.Model"),sT=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),rT=l(),w(Mn.$$.fragment),aT=l(),it=r("div"),w(Rr.$$.fragment),iT=l(),Po=r("p"),lT=n("The "),Ha=r("a"),dT=n("TFMobileBertForTokenClassification"),cT=n(" forward method, overrides the "),Gl=r("code"),pT=n("__call__"),hT=n(" special method."),mT=l(),w(wn.$$.fragment),uT=l(),Jl=r("p"),fT=n("Example:"),gT=l(),w(Hr.$$.fragment),ac=l(),qo=r("h2"),yn=r("a"),Yl=r("span"),w(Qr.$$.fragment),_T=l(),Zl=r("span"),bT=n("TFMobileBertForQuestionAnswering"),ic=l(),De=r("div"),w(Ur.$$.fragment),TT=l(),xo=r("p"),vT=n(`MobileBert 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 `),Xl=r("code"),kT=n("span start logits"),MT=n(" and "),ed=r("code"),wT=n("span end logits"),yT=n(")."),$T=l(),Vr=r("p"),FT=n("This model inherits from "),Qa=r("a"),BT=n("TFPreTrainedModel"),ET=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),zT=l(),Kr=r("p"),PT=n("This model is also a "),Gr=r("a"),qT=n("tf.keras.Model"),xT=n(` 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.`),CT=l(),w($n.$$.fragment),jT=l(),lt=r("div"),w(Jr.$$.fragment),NT=l(),Co=r("p"),ST=n("The "),Ua=r("a"),AT=n("TFMobileBertForQuestionAnswering"),OT=n(" forward method, overrides the "),td=r("code"),IT=n("__call__"),DT=n(" special method."),LT=l(),w(Fn.$$.fragment),WT=l(),od=r("p"),RT=n("Example:"),HT=l(),w(Yr.$$.fragment),this.h()},l(o){const u=lM('[data-svelte="svelte-1phssyn"]',document.head);h=a(u,"META",{name:!0,content:!0}),u.forEach(t),k=d(o),f=a(o,"H1",{class:!0});var Zr=i(f);g=a(Zr,"A",{id:!0,class:!0,href:!0});var nd=i(g);T=a(nd,"SPAN",{});var sd=i(T);y(b.$$.fragment,sd),sd.forEach(t),nd.forEach(t),_=d(Zr),M=a(Zr,"SPAN",{});var rd=i(M);he=s(rd,"MobileBERT"),rd.forEach(t),Zr.forEach(t),K=d(o),z=a(o,"H2",{class:!0});var Xr=i(z);Z=a(Xr,"A",{id:!0,class:!0,href:!0});var ad=i(Z);I=a(ad,"SPAN",{});var id=i(I);y(ee.$$.fragment,id),id.forEach(t),ad.forEach(t),me=d(Xr),D=a(Xr,"SPAN",{});var ld=i(D);ue=s(ld,"Overview"),ld.forEach(t),Xr.forEach(t),le=d(o),V=a(o,"P",{});var ea=i(V);j=s(ea,"The MobileBERT model was proposed in "),te=a(ea,"A",{href:!0,rel:!0});var dd=i(te);G=s(dd,"MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices"),dd.forEach(t),P=s(ea,` by Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny
Zhou. It\u2019s a bidirectional transformer based on the BERT model, which is compressed and accelerated using several
approaches.`),ea.forEach(t),x=d(o),ne=a(o,"P",{});var cd=i(ne);H=s(cd,"The abstract from the paper is the following:"),cd.forEach(t),de=d(o),se=a(o,"P",{});var pd=i(se);L=a(pd,"EM",{});var hd=i(L);fe=s(hd,`Natural Language Processing (NLP) has recently achieved great success by using huge pre-trained models with hundreds
of millions of parameters. However, these models suffer from heavy model sizes and high latency such that they cannot
be deployed to resource-limited mobile devices. In this paper, we propose MobileBERT for compressing and accelerating
the popular BERT model. Like the original BERT, MobileBERT is task-agnostic, that is, it can be generically applied to
various downstream NLP tasks via simple fine-tuning. Basically, MobileBERT is a thin version of BERT_LARGE, while
equipped with bottleneck structures and a carefully designed balance between self-attentions and feed-forward networks.
To train MobileBERT, we first train a specially designed teacher model, an inverted-bottleneck incorporated BERT_LARGE
model. Then, we conduct knowledge transfer from this teacher to MobileBERT. Empirical studies show that MobileBERT is
4.3x smaller and 5.5x faster than BERT_BASE while achieving competitive results on well-known benchmarks. On the
natural language inference tasks of GLUE, MobileBERT achieves a GLUEscore o 77.7 (0.6 lower than BERT_BASE), and 62 ms
latency on a Pixel 4 phone. On the SQuAD v1.1/v2.0 question answering task, MobileBERT achieves a dev F1 score of
90.0/79.2 (1.5/2.1 higher than BERT_BASE).`),hd.forEach(t),pd.forEach(t),ce=d(o),q=a(o,"P",{});var md=i(q);ge=s(md,"Tips:"),md.forEach(t),W=d(o),X=a(o,"UL",{});var ta=i(X);re=a(ta,"LI",{});var ud=i(re);Q=s(ud,`MobileBERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather
than the left.`),ud.forEach(t),_e=d(ta),ae=a(ta,"LI",{});var fd=i(ae);N=s(fd,`MobileBERT is similar to BERT and therefore relies on the masked language modeling (MLM) objective. It is therefore
efficient at predicting masked tokens and at NLU in general, but is not optimal for text generation. Models trained
with a causal language modeling (CLM) objective are better in that regard.`),fd.forEach(t),ta.forEach(t),pe=d(o),A=a(o,"P",{});var jo=i(A);be=s(jo,"This model was contributed by "),c=a(jo,"A",{href:!0,rel:!0});var gd=i(c);v=s(gd,"vshampor"),gd.forEach(t),J=s(jo,". The original code can be found "),ke=a(jo,"A",{href:!0,rel:!0});var _d=i(ke);$e=s(_d,"here"),_d.forEach(t),S=s(jo,"."),jo.forEach(t),we=d(o),Te=a(o,"H2",{class:!0});var oa=i(Te);ve=a(oa,"A",{id:!0,class:!0,href:!0});var bd=i(ve);C=a(bd,"SPAN",{});var Td=i(C);y(O.$$.fragment,Td),Td.forEach(t),bd.forEach(t),Fe=d(oa),Me=a(oa,"SPAN",{});var vd=i(Me);U=s(vd,"MobileBertConfig"),vd.forEach(t),oa.forEach(t),ye=d(o),Y=a(o,"DIV",{class:!0});var ht=i(Y);y(oe.$$.fragment,ht),Be=d(ht),Ht=a(ht,"P",{});var Va=i(Ht);_p=s(Va,"This is the configuration class to store the configuration of a "),na=a(Va,"A",{href:!0});var QT=i(na);bp=s(QT,"MobileBertModel"),QT.forEach(t),Tp=s(Va," or a "),sa=a(Va,"A",{href:!0});var UT=i(sa);vp=s(UT,"TFMobileBertModel"),UT.forEach(t),kp=s(Va,`. It
is used to instantiate a MobileBERT model according to the specified arguments, defining the model architecture.`),Va.forEach(t),Mp=d(ht),Qt=a(ht,"P",{});var Ka=i(Qt);wp=s(Ka,"Configuration objects inherit from "),ra=a(Ka,"A",{href:!0});var VT=i(ra);yp=s(VT,"PretrainedConfig"),VT.forEach(t),$p=s(Ka,` and can be used to control the model outputs. Read the
documentation from `),aa=a(Ka,"A",{href:!0});var KT=i(aa);Fp=s(KT,"PretrainedConfig"),KT.forEach(t),Bp=s(Ka," for more information."),Ka.forEach(t),Ep=d(ht),fi=a(ht,"P",{});var GT=i(fi);zp=s(GT,"Examples:"),GT.forEach(t),Pp=d(ht),y(zn.$$.fragment,ht),qp=d(ht),gi=a(ht,"P",{});var JT=i(gi);xp=s(JT,`Attributes: pretrained_config_archive_map (Dict[str, str]): A dictionary containing all the available pre-trained
checkpoints.`),JT.forEach(t),ht.forEach(t),wd=d(o),Ut=a(o,"H2",{class:!0});var dc=i(Ut);No=a(dc,"A",{id:!0,class:!0,href:!0});var YT=i(No);_i=a(YT,"SPAN",{});var ZT=i(_i);y(Pn.$$.fragment,ZT),ZT.forEach(t),YT.forEach(t),Cp=d(dc),bi=a(dc,"SPAN",{});var XT=i(bi);jp=s(XT,"MobileBertTokenizer"),XT.forEach(t),dc.forEach(t),yd=d(o),ct=a(o,"DIV",{class:!0});var Bn=i(ct);y(qn.$$.fragment,Bn),Np=d(Bn),Ti=a(Bn,"P",{});var ev=i(Ti);Sp=s(ev,"Construct a MobileBERT tokenizer."),ev.forEach(t),Ap=d(Bn),So=a(Bn,"P",{});var kd=i(So);ia=a(kd,"A",{href:!0});var tv=i(ia);Op=s(tv,"MobileBertTokenizer"),tv.forEach(t),Ip=s(kd," is identical to "),la=a(kd,"A",{href:!0});var ov=i(la);Dp=s(ov,"BertTokenizer"),ov.forEach(t),Lp=s(kd,` and runs end-to-end tokenization: punctuation splitting
and wordpiece.`),kd.forEach(t),Wp=d(Bn),xn=a(Bn,"P",{});var cc=i(xn);Rp=s(cc,"Refer to superclass "),da=a(cc,"A",{href:!0});var nv=i(da);Hp=s(nv,"BertTokenizer"),nv.forEach(t),Qp=s(cc," for usage examples and documentation concerning parameters."),cc.forEach(t),Bn.forEach(t),$d=d(o),Vt=a(o,"H2",{class:!0});var pc=i(Vt);Ao=a(pc,"A",{id:!0,class:!0,href:!0});var sv=i(Ao);vi=a(sv,"SPAN",{});var rv=i(vi);y(Cn.$$.fragment,rv),rv.forEach(t),sv.forEach(t),Up=d(pc),ki=a(pc,"SPAN",{});var av=i(ki);Vp=s(av,"MobileBertTokenizerFast"),av.forEach(t),pc.forEach(t),Fd=d(o),pt=a(o,"DIV",{class:!0});var En=i(pt);y(jn.$$.fragment,En),Kp=d(En),Nn=a(En,"P",{});var hc=i(Nn);Gp=s(hc,"Construct a \u201Cfast\u201D MobileBERT tokenizer (backed by HuggingFace\u2019s "),Mi=a(hc,"EM",{});var iv=i(Mi);Jp=s(iv,"tokenizers"),iv.forEach(t),Yp=s(hc," library)."),hc.forEach(t),Zp=d(En),Oo=a(En,"P",{});var Md=i(Oo);ca=a(Md,"A",{href:!0});var lv=i(ca);Xp=s(lv,"MobileBertTokenizerFast"),lv.forEach(t),eh=s(Md," is identical to "),pa=a(Md,"A",{href:!0});var dv=i(pa);th=s(dv,"BertTokenizerFast"),dv.forEach(t),oh=s(Md,` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),Md.forEach(t),nh=d(En),Sn=a(En,"P",{});var mc=i(Sn);sh=s(mc,"Refer to superclass "),ha=a(mc,"A",{href:!0});var cv=i(ha);rh=s(cv,"BertTokenizerFast"),cv.forEach(t),ah=s(mc," for usage examples and documentation concerning parameters."),mc.forEach(t),En.forEach(t),Bd=d(o),Kt=a(o,"H2",{class:!0});var uc=i(Kt);Io=a(uc,"A",{id:!0,class:!0,href:!0});var pv=i(Io);wi=a(pv,"SPAN",{});var hv=i(wi);y(An.$$.fragment,hv),hv.forEach(t),pv.forEach(t),ih=d(uc),yi=a(uc,"SPAN",{});var mv=i(yi);lh=s(mv,"MobileBert specific outputs"),mv.forEach(t),uc.forEach(t),Ed=d(o),Gt=a(o,"DIV",{class:!0});var fc=i(Gt);y(On.$$.fragment,fc),dh=d(fc),In=a(fc,"P",{});var gc=i(In);ch=s(gc,"Output type of "),ma=a(gc,"A",{href:!0});var uv=i(ma);ph=s(uv,"MobileBertForPreTraining"),uv.forEach(t),hh=s(gc,"."),gc.forEach(t),fc.forEach(t),zd=d(o),Jt=a(o,"DIV",{class:!0});var _c=i(Jt);y(Dn.$$.fragment,_c),mh=d(_c),Ln=a(_c,"P",{});var bc=i(Ln);uh=s(bc,"Output type of "),ua=a(bc,"A",{href:!0});var fv=i(ua);fh=s(fv,"TFMobileBertForPreTraining"),fv.forEach(t),gh=s(bc,"."),bc.forEach(t),_c.forEach(t),Pd=d(o),Yt=a(o,"H2",{class:!0});var Tc=i(Yt);Do=a(Tc,"A",{id:!0,class:!0,href:!0});var gv=i(Do);$i=a(gv,"SPAN",{});var _v=i($i);y(Wn.$$.fragment,_v),_v.forEach(t),gv.forEach(t),_h=d(Tc),Fi=a(Tc,"SPAN",{});var bv=i(Fi);bh=s(bv,"MobileBertModel"),bv.forEach(t),Tc.forEach(t),qd=d(o),xe=a(o,"DIV",{class:!0});var mt=i(xe);y(Rn.$$.fragment,mt),Th=d(mt),Bi=a(mt,"P",{});var Tv=i(Bi);vh=s(Tv,"The bare MobileBert Model transformer outputting raw hidden-states without any specific head on top."),Tv.forEach(t),kh=d(mt),Hn=a(mt,"P",{});var vc=i(Hn);Mh=s(vc,"This model inherits from "),fa=a(vc,"A",{href:!0});var vv=i(fa);wh=s(vv,"PreTrainedModel"),vv.forEach(t),yh=s(vc,`. 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.)`),vc.forEach(t),$h=d(mt),Qn=a(mt,"P",{});var kc=i(Qn);Fh=s(kc,"This model is also a PyTorch "),Un=a(kc,"A",{href:!0,rel:!0});var kv=i(Un);Bh=s(kv,"torch.nn.Module"),kv.forEach(t),Eh=s(kc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),kc.forEach(t),zh=d(mt),Ei=a(mt,"P",{});var Mv=i(Ei);Vn=a(Mv,"A",{href:!0,rel:!0});var wv=i(Vn);Ph=s(wv,"https://arxiv.org/pdf/2004.02984.pdf"),wv.forEach(t),Mv.forEach(t),qh=d(mt),Ke=a(mt,"DIV",{class:!0});var Mt=i(Ke);y(Kn.$$.fragment,Mt),xh=d(Mt),Zt=a(Mt,"P",{});var Ga=i(Zt);Ch=s(Ga,"The "),ga=a(Ga,"A",{href:!0});var yv=i(ga);jh=s(yv,"MobileBertModel"),yv.forEach(t),Nh=s(Ga," forward method, overrides the "),zi=a(Ga,"CODE",{});var $v=i(zi);Sh=s($v,"__call__"),$v.forEach(t),Ah=s(Ga," special method."),Ga.forEach(t),Oh=d(Mt),y(Lo.$$.fragment,Mt),Ih=d(Mt),Pi=a(Mt,"P",{});var Fv=i(Pi);Dh=s(Fv,"Example:"),Fv.forEach(t),Lh=d(Mt),y(Gn.$$.fragment,Mt),Mt.forEach(t),mt.forEach(t),xd=d(o),Xt=a(o,"H2",{class:!0});var Mc=i(Xt);Wo=a(Mc,"A",{id:!0,class:!0,href:!0});var Bv=i(Wo);qi=a(Bv,"SPAN",{});var Ev=i(qi);y(Jn.$$.fragment,Ev),Ev.forEach(t),Bv.forEach(t),Wh=d(Mc),xi=a(Mc,"SPAN",{});var zv=i(xi);Rh=s(zv,"MobileBertForPreTraining"),zv.forEach(t),Mc.forEach(t),Cd=d(o),Le=a(o,"DIV",{class:!0});var wt=i(Le);y(Yn.$$.fragment,wt),Hh=d(wt),eo=a(wt,"P",{});var Ja=i(eo);Qh=s(Ja,"MobileBert Model with two heads on top as done during the pretraining: a "),Ci=a(Ja,"CODE",{});var Pv=i(Ci);Uh=s(Pv,"masked language modeling"),Pv.forEach(t),Vh=s(Ja,` head and a
`),ji=a(Ja,"CODE",{});var qv=i(ji);Kh=s(qv,"next sentence prediction (classification)"),qv.forEach(t),Gh=s(Ja," head."),Ja.forEach(t),Jh=d(wt),Zn=a(wt,"P",{});var wc=i(Zn);Yh=s(wc,"This model inherits from "),_a=a(wc,"A",{href:!0});var xv=i(_a);Zh=s(xv,"PreTrainedModel"),xv.forEach(t),Xh=s(wc,`. 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.)`),wc.forEach(t),em=d(wt),Xn=a(wt,"P",{});var yc=i(Xn);tm=s(yc,"This model is also a PyTorch "),es=a(yc,"A",{href:!0,rel:!0});var Cv=i(es);om=s(Cv,"torch.nn.Module"),Cv.forEach(t),nm=s(yc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),yc.forEach(t),sm=d(wt),Ge=a(wt,"DIV",{class:!0});var yt=i(Ge);y(ts.$$.fragment,yt),rm=d(yt),to=a(yt,"P",{});var Ya=i(to);am=s(Ya,"The "),ba=a(Ya,"A",{href:!0});var jv=i(ba);im=s(jv,"MobileBertForPreTraining"),jv.forEach(t),lm=s(Ya," forward method, overrides the "),Ni=a(Ya,"CODE",{});var Nv=i(Ni);dm=s(Nv,"__call__"),Nv.forEach(t),cm=s(Ya," special method."),Ya.forEach(t),pm=d(yt),y(Ro.$$.fragment,yt),hm=d(yt),Si=a(yt,"P",{});var Sv=i(Si);mm=s(Sv,"Examples:"),Sv.forEach(t),um=d(yt),y(os.$$.fragment,yt),yt.forEach(t),wt.forEach(t),jd=d(o),oo=a(o,"H2",{class:!0});var $c=i(oo);Ho=a($c,"A",{id:!0,class:!0,href:!0});var Av=i(Ho);Ai=a(Av,"SPAN",{});var Ov=i(Ai);y(ns.$$.fragment,Ov),Ov.forEach(t),Av.forEach(t),fm=d($c),Oi=a($c,"SPAN",{});var Iv=i(Oi);gm=s(Iv,"MobileBertForMaskedLM"),Iv.forEach(t),$c.forEach(t),Nd=d(o),We=a(o,"DIV",{class:!0});var $t=i(We);y(ss.$$.fragment,$t),_m=d($t),rs=a($t,"P",{});var Fc=i(rs);bm=s(Fc,"MobileBert Model with a "),Ii=a(Fc,"CODE",{});var Dv=i(Ii);Tm=s(Dv,"language modeling"),Dv.forEach(t),vm=s(Fc," head on top."),Fc.forEach(t),km=d($t),as=a($t,"P",{});var Bc=i(as);Mm=s(Bc,"This model inherits from "),Ta=a(Bc,"A",{href:!0});var Lv=i(Ta);wm=s(Lv,"PreTrainedModel"),Lv.forEach(t),ym=s(Bc,`. 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.)`),Bc.forEach(t),$m=d($t),is=a($t,"P",{});var Ec=i(is);Fm=s(Ec,"This model is also a PyTorch "),ls=a(Ec,"A",{href:!0,rel:!0});var Wv=i(ls);Bm=s(Wv,"torch.nn.Module"),Wv.forEach(t),Em=s(Ec,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ec.forEach(t),zm=d($t),Je=a($t,"DIV",{class:!0});var Ft=i(Je);y(ds.$$.fragment,Ft),Pm=d(Ft),no=a(Ft,"P",{});var Za=i(no);qm=s(Za,"The "),va=a(Za,"A",{href:!0});var Rv=i(va);xm=s(Rv,"MobileBertForMaskedLM"),Rv.forEach(t),Cm=s(Za," forward method, overrides the "),Di=a(Za,"CODE",{});var Hv=i(Di);jm=s(Hv,"__call__"),Hv.forEach(t),Nm=s(Za," special method."),Za.forEach(t),Sm=d(Ft),y(Qo.$$.fragment,Ft),Am=d(Ft),Li=a(Ft,"P",{});var Qv=i(Li);Om=s(Qv,"Example:"),Qv.forEach(t),Im=d(Ft),y(cs.$$.fragment,Ft),Ft.forEach(t),$t.forEach(t),Sd=d(o),so=a(o,"H2",{class:!0});var zc=i(so);Uo=a(zc,"A",{id:!0,class:!0,href:!0});var Uv=i(Uo);Wi=a(Uv,"SPAN",{});var Vv=i(Wi);y(ps.$$.fragment,Vv),Vv.forEach(t),Uv.forEach(t),Dm=d(zc),Ri=a(zc,"SPAN",{});var Kv=i(Ri);Lm=s(Kv,"MobileBertForNextSentencePrediction"),Kv.forEach(t),zc.forEach(t),Ad=d(o),Re=a(o,"DIV",{class:!0});var Bt=i(Re);y(hs.$$.fragment,Bt),Wm=d(Bt),ms=a(Bt,"P",{});var Pc=i(ms);Rm=s(Pc,"MobileBert Model with a "),Hi=a(Pc,"CODE",{});var Gv=i(Hi);Hm=s(Gv,"next sentence prediction (classification)"),Gv.forEach(t),Qm=s(Pc," head on top."),Pc.forEach(t),Um=d(Bt),us=a(Bt,"P",{});var qc=i(us);Vm=s(qc,"This model inherits from "),ka=a(qc,"A",{href:!0});var Jv=i(ka);Km=s(Jv,"PreTrainedModel"),Jv.forEach(t),Gm=s(qc,`. 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.)`),qc.forEach(t),Jm=d(Bt),fs=a(Bt,"P",{});var xc=i(fs);Ym=s(xc,"This model is also a PyTorch "),gs=a(xc,"A",{href:!0,rel:!0});var Yv=i(gs);Zm=s(Yv,"torch.nn.Module"),Yv.forEach(t),Xm=s(xc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xc.forEach(t),eu=d(Bt),Ye=a(Bt,"DIV",{class:!0});var Et=i(Ye);y(_s.$$.fragment,Et),tu=d(Et),ro=a(Et,"P",{});var Xa=i(ro);ou=s(Xa,"The "),Ma=a(Xa,"A",{href:!0});var Zv=i(Ma);nu=s(Zv,"MobileBertForNextSentencePrediction"),Zv.forEach(t),su=s(Xa," forward method, overrides the "),Qi=a(Xa,"CODE",{});var Xv=i(Qi);ru=s(Xv,"__call__"),Xv.forEach(t),au=s(Xa," special method."),Xa.forEach(t),iu=d(Et),y(Vo.$$.fragment,Et),lu=d(Et),Ui=a(Et,"P",{});var ek=i(Ui);du=s(ek,"Examples:"),ek.forEach(t),cu=d(Et),y(bs.$$.fragment,Et),Et.forEach(t),Bt.forEach(t),Od=d(o),ao=a(o,"H2",{class:!0});var Cc=i(ao);Ko=a(Cc,"A",{id:!0,class:!0,href:!0});var tk=i(Ko);Vi=a(tk,"SPAN",{});var ok=i(Vi);y(Ts.$$.fragment,ok),ok.forEach(t),tk.forEach(t),pu=d(Cc),Ki=a(Cc,"SPAN",{});var nk=i(Ki);hu=s(nk,"MobileBertForSequenceClassification"),nk.forEach(t),Cc.forEach(t),Id=d(o),He=a(o,"DIV",{class:!0});var zt=i(He);y(vs.$$.fragment,zt),mu=d(zt),Gi=a(zt,"P",{});var sk=i(Gi);uu=s(sk,`MobileBert Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),sk.forEach(t),fu=d(zt),ks=a(zt,"P",{});var jc=i(ks);gu=s(jc,"This model inherits from "),wa=a(jc,"A",{href:!0});var rk=i(wa);_u=s(rk,"PreTrainedModel"),rk.forEach(t),bu=s(jc,`. 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.)`),jc.forEach(t),Tu=d(zt),Ms=a(zt,"P",{});var Nc=i(Ms);vu=s(Nc,"This model is also a PyTorch "),ws=a(Nc,"A",{href:!0,rel:!0});var ak=i(ws);ku=s(ak,"torch.nn.Module"),ak.forEach(t),Mu=s(Nc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Nc.forEach(t),wu=d(zt),Pe=a(zt,"DIV",{class:!0});var dt=i(Pe);y(ys.$$.fragment,dt),yu=d(dt),io=a(dt,"P",{});var ei=i(io);$u=s(ei,"The "),ya=a(ei,"A",{href:!0});var ik=i(ya);Fu=s(ik,"MobileBertForSequenceClassification"),ik.forEach(t),Bu=s(ei," forward method, overrides the "),Ji=a(ei,"CODE",{});var lk=i(Ji);Eu=s(lk,"__call__"),lk.forEach(t),zu=s(ei," special method."),ei.forEach(t),Pu=d(dt),y(Go.$$.fragment,dt),qu=d(dt),Yi=a(dt,"P",{});var dk=i(Yi);xu=s(dk,"Example of single-label classification:"),dk.forEach(t),Cu=d(dt),y($s.$$.fragment,dt),ju=d(dt),Zi=a(dt,"P",{});var ck=i(Zi);Nu=s(ck,"Example of multi-label classification:"),ck.forEach(t),Su=d(dt),y(Fs.$$.fragment,dt),dt.forEach(t),zt.forEach(t),Dd=d(o),lo=a(o,"H2",{class:!0});var Sc=i(lo);Jo=a(Sc,"A",{id:!0,class:!0,href:!0});var pk=i(Jo);Xi=a(pk,"SPAN",{});var hk=i(Xi);y(Bs.$$.fragment,hk),hk.forEach(t),pk.forEach(t),Au=d(Sc),el=a(Sc,"SPAN",{});var mk=i(el);Ou=s(mk,"MobileBertForMultipleChoice"),mk.forEach(t),Sc.forEach(t),Ld=d(o),Qe=a(o,"DIV",{class:!0});var Pt=i(Qe);y(Es.$$.fragment,Pt),Iu=d(Pt),tl=a(Pt,"P",{});var uk=i(tl);Du=s(uk,`MobileBert 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.`),uk.forEach(t),Lu=d(Pt),zs=a(Pt,"P",{});var Ac=i(zs);Wu=s(Ac,"This model inherits from "),$a=a(Ac,"A",{href:!0});var fk=i($a);Ru=s(fk,"PreTrainedModel"),fk.forEach(t),Hu=s(Ac,`. 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.)`),Ac.forEach(t),Qu=d(Pt),Ps=a(Pt,"P",{});var Oc=i(Ps);Uu=s(Oc,"This model is also a PyTorch "),qs=a(Oc,"A",{href:!0,rel:!0});var gk=i(qs);Vu=s(gk,"torch.nn.Module"),gk.forEach(t),Ku=s(Oc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Oc.forEach(t),Gu=d(Pt),Ze=a(Pt,"DIV",{class:!0});var qt=i(Ze);y(xs.$$.fragment,qt),Ju=d(qt),co=a(qt,"P",{});var ti=i(co);Yu=s(ti,"The "),Fa=a(ti,"A",{href:!0});var _k=i(Fa);Zu=s(_k,"MobileBertForMultipleChoice"),_k.forEach(t),Xu=s(ti," forward method, overrides the "),ol=a(ti,"CODE",{});var bk=i(ol);ef=s(bk,"__call__"),bk.forEach(t),tf=s(ti," special method."),ti.forEach(t),of=d(qt),y(Yo.$$.fragment,qt),nf=d(qt),nl=a(qt,"P",{});var Tk=i(nl);sf=s(Tk,"Example:"),Tk.forEach(t),rf=d(qt),y(Cs.$$.fragment,qt),qt.forEach(t),Pt.forEach(t),Wd=d(o),po=a(o,"H2",{class:!0});var Ic=i(po);Zo=a(Ic,"A",{id:!0,class:!0,href:!0});var vk=i(Zo);sl=a(vk,"SPAN",{});var kk=i(sl);y(js.$$.fragment,kk),kk.forEach(t),vk.forEach(t),af=d(Ic),rl=a(Ic,"SPAN",{});var Mk=i(rl);lf=s(Mk,"MobileBertForTokenClassification"),Mk.forEach(t),Ic.forEach(t),Rd=d(o),Ue=a(o,"DIV",{class:!0});var xt=i(Ue);y(Ns.$$.fragment,xt),df=d(xt),al=a(xt,"P",{});var wk=i(al);cf=s(wk,`MobileBert 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.`),wk.forEach(t),pf=d(xt),Ss=a(xt,"P",{});var Dc=i(Ss);hf=s(Dc,"This model inherits from "),Ba=a(Dc,"A",{href:!0});var yk=i(Ba);mf=s(yk,"PreTrainedModel"),yk.forEach(t),uf=s(Dc,`. 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.)`),Dc.forEach(t),ff=d(xt),As=a(xt,"P",{});var Lc=i(As);gf=s(Lc,"This model is also a PyTorch "),Os=a(Lc,"A",{href:!0,rel:!0});var $k=i(Os);_f=s($k,"torch.nn.Module"),$k.forEach(t),bf=s(Lc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Lc.forEach(t),Tf=d(xt),Xe=a(xt,"DIV",{class:!0});var Ct=i(Xe);y(Is.$$.fragment,Ct),vf=d(Ct),ho=a(Ct,"P",{});var oi=i(ho);kf=s(oi,"The "),Ea=a(oi,"A",{href:!0});var Fk=i(Ea);Mf=s(Fk,"MobileBertForTokenClassification"),Fk.forEach(t),wf=s(oi," forward method, overrides the "),il=a(oi,"CODE",{});var Bk=i(il);yf=s(Bk,"__call__"),Bk.forEach(t),$f=s(oi," special method."),oi.forEach(t),Ff=d(Ct),y(Xo.$$.fragment,Ct),Bf=d(Ct),ll=a(Ct,"P",{});var Ek=i(ll);Ef=s(Ek,"Example:"),Ek.forEach(t),zf=d(Ct),y(Ds.$$.fragment,Ct),Ct.forEach(t),xt.forEach(t),Hd=d(o),mo=a(o,"H2",{class:!0});var Wc=i(mo);en=a(Wc,"A",{id:!0,class:!0,href:!0});var zk=i(en);dl=a(zk,"SPAN",{});var Pk=i(dl);y(Ls.$$.fragment,Pk),Pk.forEach(t),zk.forEach(t),Pf=d(Wc),cl=a(Wc,"SPAN",{});var qk=i(cl);qf=s(qk,"MobileBertForQuestionAnswering"),qk.forEach(t),Wc.forEach(t),Qd=d(o),Ve=a(o,"DIV",{class:!0});var jt=i(Ve);y(Ws.$$.fragment,jt),xf=d(jt),uo=a(jt,"P",{});var ni=i(uo);Cf=s(ni,`MobileBert 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 `),pl=a(ni,"CODE",{});var xk=i(pl);jf=s(xk,"span start logits"),xk.forEach(t),Nf=s(ni," and "),hl=a(ni,"CODE",{});var Ck=i(hl);Sf=s(Ck,"span end logits"),Ck.forEach(t),Af=s(ni,")."),ni.forEach(t),Of=d(jt),Rs=a(jt,"P",{});var Rc=i(Rs);If=s(Rc,"This model inherits from "),za=a(Rc,"A",{href:!0});var jk=i(za);Df=s(jk,"PreTrainedModel"),jk.forEach(t),Lf=s(Rc,`. 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.)`),Rc.forEach(t),Wf=d(jt),Hs=a(jt,"P",{});var Hc=i(Hs);Rf=s(Hc,"This model is also a PyTorch "),Qs=a(Hc,"A",{href:!0,rel:!0});var Nk=i(Qs);Hf=s(Nk,"torch.nn.Module"),Nk.forEach(t),Qf=s(Hc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Hc.forEach(t),Uf=d(jt),et=a(jt,"DIV",{class:!0});var Nt=i(et);y(Us.$$.fragment,Nt),Vf=d(Nt),fo=a(Nt,"P",{});var si=i(fo);Kf=s(si,"The "),Pa=a(si,"A",{href:!0});var Sk=i(Pa);Gf=s(Sk,"MobileBertForQuestionAnswering"),Sk.forEach(t),Jf=s(si," forward method, overrides the "),ml=a(si,"CODE",{});var Ak=i(ml);Yf=s(Ak,"__call__"),Ak.forEach(t),Zf=s(si," special method."),si.forEach(t),Xf=d(Nt),y(tn.$$.fragment,Nt),eg=d(Nt),ul=a(Nt,"P",{});var Ok=i(ul);tg=s(Ok,"Example:"),Ok.forEach(t),og=d(Nt),y(Vs.$$.fragment,Nt),Nt.forEach(t),jt.forEach(t),Ud=d(o),go=a(o,"H2",{class:!0});var Qc=i(go);on=a(Qc,"A",{id:!0,class:!0,href:!0});var Ik=i(on);fl=a(Ik,"SPAN",{});var Dk=i(fl);y(Ks.$$.fragment,Dk),Dk.forEach(t),Ik.forEach(t),ng=d(Qc),gl=a(Qc,"SPAN",{});var Lk=i(gl);sg=s(Lk,"TFMobileBertModel"),Lk.forEach(t),Qc.forEach(t),Vd=d(o),Ce=a(o,"DIV",{class:!0});var ut=i(Ce);y(Gs.$$.fragment,ut),rg=d(ut),_l=a(ut,"P",{});var Wk=i(_l);ag=s(Wk,"The bare MobileBert Model transformer outputting raw hidden-states without any specific head on top."),Wk.forEach(t),ig=d(ut),Js=a(ut,"P",{});var Uc=i(Js);lg=s(Uc,"This model inherits from "),qa=a(Uc,"A",{href:!0});var Rk=i(qa);dg=s(Rk,"TFPreTrainedModel"),Rk.forEach(t),cg=s(Uc,`. 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.)`),Uc.forEach(t),pg=d(ut),Ys=a(ut,"P",{});var Vc=i(Ys);hg=s(Vc,"This model is also a "),Zs=a(Vc,"A",{href:!0,rel:!0});var Hk=i(Zs);mg=s(Hk,"tf.keras.Model"),Hk.forEach(t),ug=s(Vc,` 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.`),Vc.forEach(t),fg=d(ut),y(nn.$$.fragment,ut),gg=d(ut),tt=a(ut,"DIV",{class:!0});var St=i(tt);y(Xs.$$.fragment,St),_g=d(St),_o=a(St,"P",{});var ri=i(_o);bg=s(ri,"The "),xa=a(ri,"A",{href:!0});var Qk=i(xa);Tg=s(Qk,"TFMobileBertModel"),Qk.forEach(t),vg=s(ri," forward method, overrides the "),bl=a(ri,"CODE",{});var Uk=i(bl);kg=s(Uk,"__call__"),Uk.forEach(t),Mg=s(ri," special method."),ri.forEach(t),wg=d(St),y(sn.$$.fragment,St),yg=d(St),Tl=a(St,"P",{});var Vk=i(Tl);$g=s(Vk,"Example:"),Vk.forEach(t),Fg=d(St),y(er.$$.fragment,St),St.forEach(t),ut.forEach(t),Kd=d(o),bo=a(o,"H2",{class:!0});var Kc=i(bo);rn=a(Kc,"A",{id:!0,class:!0,href:!0});var Kk=i(rn);vl=a(Kk,"SPAN",{});var Gk=i(vl);y(tr.$$.fragment,Gk),Gk.forEach(t),Kk.forEach(t),Bg=d(Kc),kl=a(Kc,"SPAN",{});var Jk=i(kl);Eg=s(Jk,"TFMobileBertForPreTraining"),Jk.forEach(t),Kc.forEach(t),Gd=d(o),je=a(o,"DIV",{class:!0});var ft=i(je);y(or.$$.fragment,ft),zg=d(ft),To=a(ft,"P",{});var ai=i(To);Pg=s(ai,"MobileBert Model with two heads on top as done during the pretraining: a "),Ml=a(ai,"CODE",{});var Yk=i(Ml);qg=s(Yk,"masked language modeling"),Yk.forEach(t),xg=s(ai,` head and a
`),wl=a(ai,"CODE",{});var Zk=i(wl);Cg=s(Zk,"next sentence prediction (classification)"),Zk.forEach(t),jg=s(ai," head."),ai.forEach(t),Ng=d(ft),nr=a(ft,"P",{});var Gc=i(nr);Sg=s(Gc,"This model inherits from "),Ca=a(Gc,"A",{href:!0});var Xk=i(Ca);Ag=s(Xk,"TFPreTrainedModel"),Xk.forEach(t),Og=s(Gc,`. 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.)`),Gc.forEach(t),Ig=d(ft),sr=a(ft,"P",{});var Jc=i(sr);Dg=s(Jc,"This model is also a "),rr=a(Jc,"A",{href:!0,rel:!0});var e1=i(rr);Lg=s(e1,"tf.keras.Model"),e1.forEach(t),Wg=s(Jc,` 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.`),Jc.forEach(t),Rg=d(ft),y(an.$$.fragment,ft),Hg=d(ft),ot=a(ft,"DIV",{class:!0});var At=i(ot);y(ar.$$.fragment,At),Qg=d(At),vo=a(At,"P",{});var ii=i(vo);Ug=s(ii,"The "),ja=a(ii,"A",{href:!0});var t1=i(ja);Vg=s(t1,"TFMobileBertForPreTraining"),t1.forEach(t),Kg=s(ii," forward method, overrides the "),yl=a(ii,"CODE",{});var o1=i(yl);Gg=s(o1,"__call__"),o1.forEach(t),Jg=s(ii," special method."),ii.forEach(t),Yg=d(At),y(ln.$$.fragment,At),Zg=d(At),$l=a(At,"P",{});var n1=i($l);Xg=s(n1,"Examples:"),n1.forEach(t),e_=d(At),y(ir.$$.fragment,At),At.forEach(t),ft.forEach(t),Jd=d(o),ko=a(o,"H2",{class:!0});var Yc=i(ko);dn=a(Yc,"A",{id:!0,class:!0,href:!0});var s1=i(dn);Fl=a(s1,"SPAN",{});var r1=i(Fl);y(lr.$$.fragment,r1),r1.forEach(t),s1.forEach(t),t_=d(Yc),Bl=a(Yc,"SPAN",{});var a1=i(Bl);o_=s(a1,"TFMobileBertForMaskedLM"),a1.forEach(t),Yc.forEach(t),Yd=d(o),Ne=a(o,"DIV",{class:!0});var gt=i(Ne);y(dr.$$.fragment,gt),n_=d(gt),cr=a(gt,"P",{});var Zc=i(cr);s_=s(Zc,"MobileBert Model with a "),El=a(Zc,"CODE",{});var i1=i(El);r_=s(i1,"language modeling"),i1.forEach(t),a_=s(Zc," head on top."),Zc.forEach(t),i_=d(gt),pr=a(gt,"P",{});var Xc=i(pr);l_=s(Xc,"This model inherits from "),Na=a(Xc,"A",{href:!0});var l1=i(Na);d_=s(l1,"TFPreTrainedModel"),l1.forEach(t),c_=s(Xc,`. 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.)`),Xc.forEach(t),p_=d(gt),hr=a(gt,"P",{});var ep=i(hr);h_=s(ep,"This model is also a "),mr=a(ep,"A",{href:!0,rel:!0});var d1=i(mr);m_=s(d1,"tf.keras.Model"),d1.forEach(t),u_=s(ep,` 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.`),ep.forEach(t),f_=d(gt),y(cn.$$.fragment,gt),g_=d(gt),nt=a(gt,"DIV",{class:!0});var Ot=i(nt);y(ur.$$.fragment,Ot),__=d(Ot),Mo=a(Ot,"P",{});var li=i(Mo);b_=s(li,"The "),Sa=a(li,"A",{href:!0});var c1=i(Sa);T_=s(c1,"TFMobileBertForMaskedLM"),c1.forEach(t),v_=s(li," forward method, overrides the "),zl=a(li,"CODE",{});var p1=i(zl);k_=s(p1,"__call__"),p1.forEach(t),M_=s(li," special method."),li.forEach(t),w_=d(Ot),y(pn.$$.fragment,Ot),y_=d(Ot),Pl=a(Ot,"P",{});var h1=i(Pl);$_=s(h1,"Example:"),h1.forEach(t),F_=d(Ot),y(fr.$$.fragment,Ot),Ot.forEach(t),gt.forEach(t),Zd=d(o),wo=a(o,"H2",{class:!0});var tp=i(wo);hn=a(tp,"A",{id:!0,class:!0,href:!0});var m1=i(hn);ql=a(m1,"SPAN",{});var u1=i(ql);y(gr.$$.fragment,u1),u1.forEach(t),m1.forEach(t),B_=d(tp),xl=a(tp,"SPAN",{});var f1=i(xl);E_=s(f1,"TFMobileBertForNextSentencePrediction"),f1.forEach(t),tp.forEach(t),Xd=d(o),Se=a(o,"DIV",{class:!0});var _t=i(Se);y(_r.$$.fragment,_t),z_=d(_t),br=a(_t,"P",{});var op=i(br);P_=s(op,"MobileBert Model with a "),Cl=a(op,"CODE",{});var g1=i(Cl);q_=s(g1,"next sentence prediction (classification)"),g1.forEach(t),x_=s(op," head on top."),op.forEach(t),C_=d(_t),Tr=a(_t,"P",{});var np=i(Tr);j_=s(np,"This model inherits from "),Aa=a(np,"A",{href:!0});var _1=i(Aa);N_=s(_1,"TFPreTrainedModel"),_1.forEach(t),S_=s(np,`. 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.)`),np.forEach(t),A_=d(_t),vr=a(_t,"P",{});var sp=i(vr);O_=s(sp,"This model is also a "),kr=a(sp,"A",{href:!0,rel:!0});var b1=i(kr);I_=s(b1,"tf.keras.Model"),b1.forEach(t),D_=s(sp,` 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.`),sp.forEach(t),L_=d(_t),y(mn.$$.fragment,_t),W_=d(_t),st=a(_t,"DIV",{class:!0});var It=i(st);y(Mr.$$.fragment,It),R_=d(It),yo=a(It,"P",{});var di=i(yo);H_=s(di,"The "),Oa=a(di,"A",{href:!0});var T1=i(Oa);Q_=s(T1,"TFMobileBertForNextSentencePrediction"),T1.forEach(t),U_=s(di," forward method, overrides the "),jl=a(di,"CODE",{});var v1=i(jl);V_=s(v1,"__call__"),v1.forEach(t),K_=s(di," special method."),di.forEach(t),G_=d(It),y(un.$$.fragment,It),J_=d(It),Nl=a(It,"P",{});var k1=i(Nl);Y_=s(k1,"Examples:"),k1.forEach(t),Z_=d(It),y(wr.$$.fragment,It),It.forEach(t),_t.forEach(t),ec=d(o),$o=a(o,"H2",{class:!0});var rp=i($o);fn=a(rp,"A",{id:!0,class:!0,href:!0});var M1=i(fn);Sl=a(M1,"SPAN",{});var w1=i(Sl);y(yr.$$.fragment,w1),w1.forEach(t),M1.forEach(t),X_=d(rp),Al=a(rp,"SPAN",{});var y1=i(Al);eb=s(y1,"TFMobileBertForSequenceClassification"),y1.forEach(t),rp.forEach(t),tc=d(o),Ae=a(o,"DIV",{class:!0});var bt=i(Ae);y($r.$$.fragment,bt),tb=d(bt),Ol=a(bt,"P",{});var $1=i(Ol);ob=s($1,`MobileBert Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),$1.forEach(t),nb=d(bt),Fr=a(bt,"P",{});var ap=i(Fr);sb=s(ap,"This model inherits from "),Ia=a(ap,"A",{href:!0});var F1=i(Ia);rb=s(F1,"TFPreTrainedModel"),F1.forEach(t),ab=s(ap,`. 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.)`),ap.forEach(t),ib=d(bt),Br=a(bt,"P",{});var ip=i(Br);lb=s(ip,"This model is also a "),Er=a(ip,"A",{href:!0,rel:!0});var B1=i(Er);db=s(B1,"tf.keras.Model"),B1.forEach(t),cb=s(ip,` 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.`),ip.forEach(t),pb=d(bt),y(gn.$$.fragment,bt),hb=d(bt),rt=a(bt,"DIV",{class:!0});var Dt=i(rt);y(zr.$$.fragment,Dt),mb=d(Dt),Fo=a(Dt,"P",{});var ci=i(Fo);ub=s(ci,"The "),Da=a(ci,"A",{href:!0});var E1=i(Da);fb=s(E1,"TFMobileBertForSequenceClassification"),E1.forEach(t),gb=s(ci," forward method, overrides the "),Il=a(ci,"CODE",{});var z1=i(Il);_b=s(z1,"__call__"),z1.forEach(t),bb=s(ci," special method."),ci.forEach(t),Tb=d(Dt),y(_n.$$.fragment,Dt),vb=d(Dt),Dl=a(Dt,"P",{});var P1=i(Dl);kb=s(P1,"Example:"),P1.forEach(t),Mb=d(Dt),y(Pr.$$.fragment,Dt),Dt.forEach(t),bt.forEach(t),oc=d(o),Bo=a(o,"H2",{class:!0});var lp=i(Bo);bn=a(lp,"A",{id:!0,class:!0,href:!0});var q1=i(bn);Ll=a(q1,"SPAN",{});var x1=i(Ll);y(qr.$$.fragment,x1),x1.forEach(t),q1.forEach(t),wb=d(lp),Wl=a(lp,"SPAN",{});var C1=i(Wl);yb=s(C1,"TFMobileBertForMultipleChoice"),C1.forEach(t),lp.forEach(t),nc=d(o),Oe=a(o,"DIV",{class:!0});var Tt=i(Oe);y(xr.$$.fragment,Tt),$b=d(Tt),Rl=a(Tt,"P",{});var j1=i(Rl);Fb=s(j1,`MobileBert 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.`),j1.forEach(t),Bb=d(Tt),Cr=a(Tt,"P",{});var dp=i(Cr);Eb=s(dp,"This model inherits from "),La=a(dp,"A",{href:!0});var N1=i(La);zb=s(N1,"TFPreTrainedModel"),N1.forEach(t),Pb=s(dp,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),dp.forEach(t),qb=d(Tt),jr=a(Tt,"P",{});var cp=i(jr);xb=s(cp,"This model is also a "),Nr=a(cp,"A",{href:!0,rel:!0});var S1=i(Nr);Cb=s(S1,"tf.keras.Model"),S1.forEach(t),jb=s(cp,` 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.`),cp.forEach(t),Nb=d(Tt),y(Tn.$$.fragment,Tt),Sb=d(Tt),at=a(Tt,"DIV",{class:!0});var Lt=i(at);y(Sr.$$.fragment,Lt),Ab=d(Lt),Eo=a(Lt,"P",{});var pi=i(Eo);Ob=s(pi,"The "),Wa=a(pi,"A",{href:!0});var A1=i(Wa);Ib=s(A1,"TFMobileBertForMultipleChoice"),A1.forEach(t),Db=s(pi," forward method, overrides the "),Hl=a(pi,"CODE",{});var O1=i(Hl);Lb=s(O1,"__call__"),O1.forEach(t),Wb=s(pi," special method."),pi.forEach(t),Rb=d(Lt),y(vn.$$.fragment,Lt),Hb=d(Lt),Ql=a(Lt,"P",{});var I1=i(Ql);Qb=s(I1,"Example:"),I1.forEach(t),Ub=d(Lt),y(Ar.$$.fragment,Lt),Lt.forEach(t),Tt.forEach(t),sc=d(o),zo=a(o,"H2",{class:!0});var pp=i(zo);kn=a(pp,"A",{id:!0,class:!0,href:!0});var D1=i(kn);Ul=a(D1,"SPAN",{});var L1=i(Ul);y(Or.$$.fragment,L1),L1.forEach(t),D1.forEach(t),Vb=d(pp),Vl=a(pp,"SPAN",{});var W1=i(Vl);Kb=s(W1,"TFMobileBertForTokenClassification"),W1.forEach(t),pp.forEach(t),rc=d(o),Ie=a(o,"DIV",{class:!0});var vt=i(Ie);y(Ir.$$.fragment,vt),Gb=d(vt),Kl=a(vt,"P",{});var R1=i(Kl);Jb=s(R1,`MobileBert 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.`),R1.forEach(t),Yb=d(vt),Dr=a(vt,"P",{});var hp=i(Dr);Zb=s(hp,"This model inherits from "),Ra=a(hp,"A",{href:!0});var H1=i(Ra);Xb=s(H1,"TFPreTrainedModel"),H1.forEach(t),eT=s(hp,`. 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.)`),hp.forEach(t),tT=d(vt),Lr=a(vt,"P",{});var mp=i(Lr);oT=s(mp,"This model is also a "),Wr=a(mp,"A",{href:!0,rel:!0});var Q1=i(Wr);nT=s(Q1,"tf.keras.Model"),Q1.forEach(t),sT=s(mp,` 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.`),mp.forEach(t),rT=d(vt),y(Mn.$$.fragment,vt),aT=d(vt),it=a(vt,"DIV",{class:!0});var Wt=i(it);y(Rr.$$.fragment,Wt),iT=d(Wt),Po=a(Wt,"P",{});var hi=i(Po);lT=s(hi,"The "),Ha=a(hi,"A",{href:!0});var U1=i(Ha);dT=s(U1,"TFMobileBertForTokenClassification"),U1.forEach(t),cT=s(hi," forward method, overrides the "),Gl=a(hi,"CODE",{});var V1=i(Gl);pT=s(V1,"__call__"),V1.forEach(t),hT=s(hi," special method."),hi.forEach(t),mT=d(Wt),y(wn.$$.fragment,Wt),uT=d(Wt),Jl=a(Wt,"P",{});var K1=i(Jl);fT=s(K1,"Example:"),K1.forEach(t),gT=d(Wt),y(Hr.$$.fragment,Wt),Wt.forEach(t),vt.forEach(t),ac=d(o),qo=a(o,"H2",{class:!0});var up=i(qo);yn=a(up,"A",{id:!0,class:!0,href:!0});var G1=i(yn);Yl=a(G1,"SPAN",{});var J1=i(Yl);y(Qr.$$.fragment,J1),J1.forEach(t),G1.forEach(t),_T=d(up),Zl=a(up,"SPAN",{});var Y1=i(Zl);bT=s(Y1,"TFMobileBertForQuestionAnswering"),Y1.forEach(t),up.forEach(t),ic=d(o),De=a(o,"DIV",{class:!0});var kt=i(De);y(Ur.$$.fragment,kt),TT=d(kt),xo=a(kt,"P",{});var mi=i(xo);vT=s(mi,`MobileBert 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 `),Xl=a(mi,"CODE",{});var Z1=i(Xl);kT=s(Z1,"span start logits"),Z1.forEach(t),MT=s(mi," and "),ed=a(mi,"CODE",{});var X1=i(ed);wT=s(X1,"span end logits"),X1.forEach(t),yT=s(mi,")."),mi.forEach(t),$T=d(kt),Vr=a(kt,"P",{});var fp=i(Vr);FT=s(fp,"This model inherits from "),Qa=a(fp,"A",{href:!0});var eM=i(Qa);BT=s(eM,"TFPreTrainedModel"),eM.forEach(t),ET=s(fp,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),fp.forEach(t),zT=d(kt),Kr=a(kt,"P",{});var gp=i(Kr);PT=s(gp,"This model is also a "),Gr=a(gp,"A",{href:!0,rel:!0});var tM=i(Gr);qT=s(tM,"tf.keras.Model"),tM.forEach(t),xT=s(gp,` 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.`),gp.forEach(t),CT=d(kt),y($n.$$.fragment,kt),jT=d(kt),lt=a(kt,"DIV",{class:!0});var Rt=i(lt);y(Jr.$$.fragment,Rt),NT=d(Rt),Co=a(Rt,"P",{});var ui=i(Co);ST=s(ui,"The "),Ua=a(ui,"A",{href:!0});var oM=i(Ua);AT=s(oM,"TFMobileBertForQuestionAnswering"),oM.forEach(t),OT=s(ui," forward method, overrides the "),td=a(ui,"CODE",{});var nM=i(td);IT=s(nM,"__call__"),nM.forEach(t),DT=s(ui," special method."),ui.forEach(t),LT=d(Rt),y(Fn.$$.fragment,Rt),WT=d(Rt),od=a(Rt,"P",{});var sM=i(od);RT=s(sM,"Example:"),sM.forEach(t),HT=d(Rt),y(Yr.$$.fragment,Rt),Rt.forEach(t),kt.forEach(t),this.h()},h(){p(h,"name","hf:doc:metadata"),p(h,"content",JSON.stringify(jM)),p(g,"id","mobilebert"),p(g,"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"),p(g,"href","#mobilebert"),p(f,"class","relative group"),p(Z,"id","overview"),p(Z,"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"),p(Z,"href","#overview"),p(z,"class","relative group"),p(te,"href","https://arxiv.org/abs/2004.02984"),p(te,"rel","nofollow"),p(c,"href","https://huggingface.co/vshampor"),p(c,"rel","nofollow"),p(ke,"href","https://github.com/google-research/mobilebert"),p(ke,"rel","nofollow"),p(ve,"id","transformers.MobileBertConfig"),p(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"),p(ve,"href","#transformers.MobileBertConfig"),p(Te,"class","relative group"),p(na,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertModel"),p(sa,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.TFMobileBertModel"),p(ra,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),p(aa,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),p(Y,"class","docstring"),p(No,"id","transformers.MobileBertTokenizer"),p(No,"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"),p(No,"href","#transformers.MobileBertTokenizer"),p(Ut,"class","relative group"),p(ia,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertTokenizer"),p(la,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer"),p(da,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer"),p(ct,"class","docstring"),p(Ao,"id","transformers.MobileBertTokenizerFast"),p(Ao,"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"),p(Ao,"href","#transformers.MobileBertTokenizerFast"),p(Vt,"class","relative group"),p(ca,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertTokenizerFast"),p(pa,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizerFast"),p(ha,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizerFast"),p(pt,"class","docstring"),p(Io,"id","transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput"),p(Io,"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"),p(Io,"href","#transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput"),p(Kt,"class","relative group"),p(ma,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertForPreTraining"),p(Gt,"class","docstring"),p(ua,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.TFMobileBertForPreTraining"),p(Jt,"class","docstring"),p(Do,"id","transformers.MobileBertModel"),p(Do,"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"),p(Do,"href","#transformers.MobileBertModel"),p(Yt,"class","relative group"),p(fa,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),p(Un,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Un,"rel","nofollow"),p(Vn,"href","https://arxiv.org/pdf/2004.02984.pdf"),p(Vn,"rel","nofollow"),p(ga,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertModel"),p(Ke,"class","docstring"),p(xe,"class","docstring"),p(Wo,"id","transformers.MobileBertForPreTraining"),p(Wo,"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"),p(Wo,"href","#transformers.MobileBertForPreTraining"),p(Xt,"class","relative group"),p(_a,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),p(es,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(es,"rel","nofollow"),p(ba,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertForPreTraining"),p(Ge,"class","docstring"),p(Le,"class","docstring"),p(Ho,"id","transformers.MobileBertForMaskedLM"),p(Ho,"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"),p(Ho,"href","#transformers.MobileBertForMaskedLM"),p(oo,"class","relative group"),p(Ta,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),p(ls,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(ls,"rel","nofollow"),p(va,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertForMaskedLM"),p(Je,"class","docstring"),p(We,"class","docstring"),p(Uo,"id","transformers.MobileBertForNextSentencePrediction"),p(Uo,"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"),p(Uo,"href","#transformers.MobileBertForNextSentencePrediction"),p(so,"class","relative group"),p(ka,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),p(gs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(gs,"rel","nofollow"),p(Ma,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertForNextSentencePrediction"),p(Ye,"class","docstring"),p(Re,"class","docstring"),p(Ko,"id","transformers.MobileBertForSequenceClassification"),p(Ko,"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"),p(Ko,"href","#transformers.MobileBertForSequenceClassification"),p(ao,"class","relative group"),p(wa,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),p(ws,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(ws,"rel","nofollow"),p(ya,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertForSequenceClassification"),p(Pe,"class","docstring"),p(He,"class","docstring"),p(Jo,"id","transformers.MobileBertForMultipleChoice"),p(Jo,"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"),p(Jo,"href","#transformers.MobileBertForMultipleChoice"),p(lo,"class","relative group"),p($a,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),p(qs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(qs,"rel","nofollow"),p(Fa,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertForMultipleChoice"),p(Ze,"class","docstring"),p(Qe,"class","docstring"),p(Zo,"id","transformers.MobileBertForTokenClassification"),p(Zo,"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"),p(Zo,"href","#transformers.MobileBertForTokenClassification"),p(po,"class","relative group"),p(Ba,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),p(Os,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Os,"rel","nofollow"),p(Ea,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertForTokenClassification"),p(Xe,"class","docstring"),p(Ue,"class","docstring"),p(en,"id","transformers.MobileBertForQuestionAnswering"),p(en,"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"),p(en,"href","#transformers.MobileBertForQuestionAnswering"),p(mo,"class","relative group"),p(za,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),p(Qs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Qs,"rel","nofollow"),p(Pa,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.MobileBertForQuestionAnswering"),p(et,"class","docstring"),p(Ve,"class","docstring"),p(on,"id","transformers.TFMobileBertModel"),p(on,"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"),p(on,"href","#transformers.TFMobileBertModel"),p(go,"class","relative group"),p(qa,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),p(Zs,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(Zs,"rel","nofollow"),p(xa,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.TFMobileBertModel"),p(tt,"class","docstring"),p(Ce,"class","docstring"),p(rn,"id","transformers.TFMobileBertForPreTraining"),p(rn,"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"),p(rn,"href","#transformers.TFMobileBertForPreTraining"),p(bo,"class","relative group"),p(Ca,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),p(rr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(rr,"rel","nofollow"),p(ja,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.TFMobileBertForPreTraining"),p(ot,"class","docstring"),p(je,"class","docstring"),p(dn,"id","transformers.TFMobileBertForMaskedLM"),p(dn,"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"),p(dn,"href","#transformers.TFMobileBertForMaskedLM"),p(ko,"class","relative group"),p(Na,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),p(mr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(mr,"rel","nofollow"),p(Sa,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.TFMobileBertForMaskedLM"),p(nt,"class","docstring"),p(Ne,"class","docstring"),p(hn,"id","transformers.TFMobileBertForNextSentencePrediction"),p(hn,"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"),p(hn,"href","#transformers.TFMobileBertForNextSentencePrediction"),p(wo,"class","relative group"),p(Aa,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),p(kr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(kr,"rel","nofollow"),p(Oa,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.TFMobileBertForNextSentencePrediction"),p(st,"class","docstring"),p(Se,"class","docstring"),p(fn,"id","transformers.TFMobileBertForSequenceClassification"),p(fn,"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"),p(fn,"href","#transformers.TFMobileBertForSequenceClassification"),p($o,"class","relative group"),p(Ia,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),p(Er,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(Er,"rel","nofollow"),p(Da,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.TFMobileBertForSequenceClassification"),p(rt,"class","docstring"),p(Ae,"class","docstring"),p(bn,"id","transformers.TFMobileBertForMultipleChoice"),p(bn,"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"),p(bn,"href","#transformers.TFMobileBertForMultipleChoice"),p(Bo,"class","relative group"),p(La,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),p(Nr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(Nr,"rel","nofollow"),p(Wa,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.TFMobileBertForMultipleChoice"),p(at,"class","docstring"),p(Oe,"class","docstring"),p(kn,"id","transformers.TFMobileBertForTokenClassification"),p(kn,"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"),p(kn,"href","#transformers.TFMobileBertForTokenClassification"),p(zo,"class","relative group"),p(Ra,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),p(Wr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(Wr,"rel","nofollow"),p(Ha,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.TFMobileBertForTokenClassification"),p(it,"class","docstring"),p(Ie,"class","docstring"),p(yn,"id","transformers.TFMobileBertForQuestionAnswering"),p(yn,"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"),p(yn,"href","#transformers.TFMobileBertForQuestionAnswering"),p(qo,"class","relative group"),p(Qa,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),p(Gr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(Gr,"rel","nofollow"),p(Ua,"href","/docs/transformers/pr_15839/en/model_doc/mobilebert#transformers.TFMobileBertForQuestionAnswering"),p(lt,"class","docstring"),p(De,"class","docstring")},m(o,u){e(document.head,h),m(o,k,u),m(o,f,u),e(f,g),e(g,T),$(b,T,null),e(f,_),e(f,M),e(M,he),m(o,K,u),m(o,z,u),e(z,Z),e(Z,I),$(ee,I,null),e(z,me),e(z,D),e(D,ue),m(o,le,u),m(o,V,u),e(V,j),e(V,te),e(te,G),e(V,P),m(o,x,u),m(o,ne,u),e(ne,H),m(o,de,u),m(o,se,u),e(se,L),e(L,fe),m(o,ce,u),m(o,q,u),e(q,ge),m(o,W,u),m(o,X,u),e(X,re),e(re,Q),e(X,_e),e(X,ae),e(ae,N),m(o,pe,u),m(o,A,u),e(A,be),e(A,c),e(c,v),e(A,J),e(A,ke),e(ke,$e),e(A,S),m(o,we,u),m(o,Te,u),e(Te,ve),e(ve,C),$(O,C,null),e(Te,Fe),e(Te,Me),e(Me,U),m(o,ye,u),m(o,Y,u),$(oe,Y,null),e(Y,Be),e(Y,Ht),e(Ht,_p),e(Ht,na),e(na,bp),e(Ht,Tp),e(Ht,sa),e(sa,vp),e(Ht,kp),e(Y,Mp),e(Y,Qt),e(Qt,wp),e(Qt,ra),e(ra,yp),e(Qt,$p),e(Qt,aa),e(aa,Fp),e(Qt,Bp),e(Y,Ep),e(Y,fi),e(fi,zp),e(Y,Pp),$(zn,Y,null),e(Y,qp),e(Y,gi),e(gi,xp),m(o,wd,u),m(o,Ut,u),e(Ut,No),e(No,_i),$(Pn,_i,null),e(Ut,Cp),e(Ut,bi),e(bi,jp),m(o,yd,u),m(o,ct,u),$(qn,ct,null),e(ct,Np),e(ct,Ti),e(Ti,Sp),e(ct,Ap),e(ct,So),e(So,ia),e(ia,Op),e(So,Ip),e(So,la),e(la,Dp),e(So,Lp),e(ct,Wp),e(ct,xn),e(xn,Rp),e(xn,da),e(da,Hp),e(xn,Qp),m(o,$d,u),m(o,Vt,u),e(Vt,Ao),e(Ao,vi),$(Cn,vi,null),e(Vt,Up),e(Vt,ki),e(ki,Vp),m(o,Fd,u),m(o,pt,u),$(jn,pt,null),e(pt,Kp),e(pt,Nn),e(Nn,Gp),e(Nn,Mi),e(Mi,Jp),e(Nn,Yp),e(pt,Zp),e(pt,Oo),e(Oo,ca),e(ca,Xp),e(Oo,eh),e(Oo,pa),e(pa,th),e(Oo,oh),e(pt,nh),e(pt,Sn),e(Sn,sh),e(Sn,ha),e(ha,rh),e(Sn,ah),m(o,Bd,u),m(o,Kt,u),e(Kt,Io),e(Io,wi),$(An,wi,null),e(Kt,ih),e(Kt,yi),e(yi,lh),m(o,Ed,u),m(o,Gt,u),$(On,Gt,null),e(Gt,dh),e(Gt,In),e(In,ch),e(In,ma),e(ma,ph),e(In,hh),m(o,zd,u),m(o,Jt,u),$(Dn,Jt,null),e(Jt,mh),e(Jt,Ln),e(Ln,uh),e(Ln,ua),e(ua,fh),e(Ln,gh),m(o,Pd,u),m(o,Yt,u),e(Yt,Do),e(Do,$i),$(Wn,$i,null),e(Yt,_h),e(Yt,Fi),e(Fi,bh),m(o,qd,u),m(o,xe,u),$(Rn,xe,null),e(xe,Th),e(xe,Bi),e(Bi,vh),e(xe,kh),e(xe,Hn),e(Hn,Mh),e(Hn,fa),e(fa,wh),e(Hn,yh),e(xe,$h),e(xe,Qn),e(Qn,Fh),e(Qn,Un),e(Un,Bh),e(Qn,Eh),e(xe,zh),e(xe,Ei),e(Ei,Vn),e(Vn,Ph),e(xe,qh),e(xe,Ke),$(Kn,Ke,null),e(Ke,xh),e(Ke,Zt),e(Zt,Ch),e(Zt,ga),e(ga,jh),e(Zt,Nh),e(Zt,zi),e(zi,Sh),e(Zt,Ah),e(Ke,Oh),$(Lo,Ke,null),e(Ke,Ih),e(Ke,Pi),e(Pi,Dh),e(Ke,Lh),$(Gn,Ke,null),m(o,xd,u),m(o,Xt,u),e(Xt,Wo),e(Wo,qi),$(Jn,qi,null),e(Xt,Wh),e(Xt,xi),e(xi,Rh),m(o,Cd,u),m(o,Le,u),$(Yn,Le,null),e(Le,Hh),e(Le,eo),e(eo,Qh),e(eo,Ci),e(Ci,Uh),e(eo,Vh),e(eo,ji),e(ji,Kh),e(eo,Gh),e(Le,Jh),e(Le,Zn),e(Zn,Yh),e(Zn,_a),e(_a,Zh),e(Zn,Xh),e(Le,em),e(Le,Xn),e(Xn,tm),e(Xn,es),e(es,om),e(Xn,nm),e(Le,sm),e(Le,Ge),$(ts,Ge,null),e(Ge,rm),e(Ge,to),e(to,am),e(to,ba),e(ba,im),e(to,lm),e(to,Ni),e(Ni,dm),e(to,cm),e(Ge,pm),$(Ro,Ge,null),e(Ge,hm),e(Ge,Si),e(Si,mm),e(Ge,um),$(os,Ge,null),m(o,jd,u),m(o,oo,u),e(oo,Ho),e(Ho,Ai),$(ns,Ai,null),e(oo,fm),e(oo,Oi),e(Oi,gm),m(o,Nd,u),m(o,We,u),$(ss,We,null),e(We,_m),e(We,rs),e(rs,bm),e(rs,Ii),e(Ii,Tm),e(rs,vm),e(We,km),e(We,as),e(as,Mm),e(as,Ta),e(Ta,wm),e(as,ym),e(We,$m),e(We,is),e(is,Fm),e(is,ls),e(ls,Bm),e(is,Em),e(We,zm),e(We,Je),$(ds,Je,null),e(Je,Pm),e(Je,no),e(no,qm),e(no,va),e(va,xm),e(no,Cm),e(no,Di),e(Di,jm),e(no,Nm),e(Je,Sm),$(Qo,Je,null),e(Je,Am),e(Je,Li),e(Li,Om),e(Je,Im),$(cs,Je,null),m(o,Sd,u),m(o,so,u),e(so,Uo),e(Uo,Wi),$(ps,Wi,null),e(so,Dm),e(so,Ri),e(Ri,Lm),m(o,Ad,u),m(o,Re,u),$(hs,Re,null),e(Re,Wm),e(Re,ms),e(ms,Rm),e(ms,Hi),e(Hi,Hm),e(ms,Qm),e(Re,Um),e(Re,us),e(us,Vm),e(us,ka),e(ka,Km),e(us,Gm),e(Re,Jm),e(Re,fs),e(fs,Ym),e(fs,gs),e(gs,Zm),e(fs,Xm),e(Re,eu),e(Re,Ye),$(_s,Ye,null),e(Ye,tu),e(Ye,ro),e(ro,ou),e(ro,Ma),e(Ma,nu),e(ro,su),e(ro,Qi),e(Qi,ru),e(ro,au),e(Ye,iu),$(Vo,Ye,null),e(Ye,lu),e(Ye,Ui),e(Ui,du),e(Ye,cu),$(bs,Ye,null),m(o,Od,u),m(o,ao,u),e(ao,Ko),e(Ko,Vi),$(Ts,Vi,null),e(ao,pu),e(ao,Ki),e(Ki,hu),m(o,Id,u),m(o,He,u),$(vs,He,null),e(He,mu),e(He,Gi),e(Gi,uu),e(He,fu),e(He,ks),e(ks,gu),e(ks,wa),e(wa,_u),e(ks,bu),e(He,Tu),e(He,Ms),e(Ms,vu),e(Ms,ws),e(ws,ku),e(Ms,Mu),e(He,wu),e(He,Pe),$(ys,Pe,null),e(Pe,yu),e(Pe,io),e(io,$u),e(io,ya),e(ya,Fu),e(io,Bu),e(io,Ji),e(Ji,Eu),e(io,zu),e(Pe,Pu),$(Go,Pe,null),e(Pe,qu),e(Pe,Yi),e(Yi,xu),e(Pe,Cu),$($s,Pe,null),e(Pe,ju),e(Pe,Zi),e(Zi,Nu),e(Pe,Su),$(Fs,Pe,null),m(o,Dd,u),m(o,lo,u),e(lo,Jo),e(Jo,Xi),$(Bs,Xi,null),e(lo,Au),e(lo,el),e(el,Ou),m(o,Ld,u),m(o,Qe,u),$(Es,Qe,null),e(Qe,Iu),e(Qe,tl),e(tl,Du),e(Qe,Lu),e(Qe,zs),e(zs,Wu),e(zs,$a),e($a,Ru),e(zs,Hu),e(Qe,Qu),e(Qe,Ps),e(Ps,Uu),e(Ps,qs),e(qs,Vu),e(Ps,Ku),e(Qe,Gu),e(Qe,Ze),$(xs,Ze,null),e(Ze,Ju),e(Ze,co),e(co,Yu),e(co,Fa),e(Fa,Zu),e(co,Xu),e(co,ol),e(ol,ef),e(co,tf),e(Ze,of),$(Yo,Ze,null),e(Ze,nf),e(Ze,nl),e(nl,sf),e(Ze,rf),$(Cs,Ze,null),m(o,Wd,u),m(o,po,u),e(po,Zo),e(Zo,sl),$(js,sl,null),e(po,af),e(po,rl),e(rl,lf),m(o,Rd,u),m(o,Ue,u),$(Ns,Ue,null),e(Ue,df),e(Ue,al),e(al,cf),e(Ue,pf),e(Ue,Ss),e(Ss,hf),e(Ss,Ba),e(Ba,mf),e(Ss,uf),e(Ue,ff),e(Ue,As),e(As,gf),e(As,Os),e(Os,_f),e(As,bf),e(Ue,Tf),e(Ue,Xe),$(Is,Xe,null),e(Xe,vf),e(Xe,ho),e(ho,kf),e(ho,Ea),e(Ea,Mf),e(ho,wf),e(ho,il),e(il,yf),e(ho,$f),e(Xe,Ff),$(Xo,Xe,null),e(Xe,Bf),e(Xe,ll),e(ll,Ef),e(Xe,zf),$(Ds,Xe,null),m(o,Hd,u),m(o,mo,u),e(mo,en),e(en,dl),$(Ls,dl,null),e(mo,Pf),e(mo,cl),e(cl,qf),m(o,Qd,u),m(o,Ve,u),$(Ws,Ve,null),e(Ve,xf),e(Ve,uo),e(uo,Cf),e(uo,pl),e(pl,jf),e(uo,Nf),e(uo,hl),e(hl,Sf),e(uo,Af),e(Ve,Of),e(Ve,Rs),e(Rs,If),e(Rs,za),e(za,Df),e(Rs,Lf),e(Ve,Wf),e(Ve,Hs),e(Hs,Rf),e(Hs,Qs),e(Qs,Hf),e(Hs,Qf),e(Ve,Uf),e(Ve,et),$(Us,et,null),e(et,Vf),e(et,fo),e(fo,Kf),e(fo,Pa),e(Pa,Gf),e(fo,Jf),e(fo,ml),e(ml,Yf),e(fo,Zf),e(et,Xf),$(tn,et,null),e(et,eg),e(et,ul),e(ul,tg),e(et,og),$(Vs,et,null),m(o,Ud,u),m(o,go,u),e(go,on),e(on,fl),$(Ks,fl,null),e(go,ng),e(go,gl),e(gl,sg),m(o,Vd,u),m(o,Ce,u),$(Gs,Ce,null),e(Ce,rg),e(Ce,_l),e(_l,ag),e(Ce,ig),e(Ce,Js),e(Js,lg),e(Js,qa),e(qa,dg),e(Js,cg),e(Ce,pg),e(Ce,Ys),e(Ys,hg),e(Ys,Zs),e(Zs,mg),e(Ys,ug),e(Ce,fg),$(nn,Ce,null),e(Ce,gg),e(Ce,tt),$(Xs,tt,null),e(tt,_g),e(tt,_o),e(_o,bg),e(_o,xa),e(xa,Tg),e(_o,vg),e(_o,bl),e(bl,kg),e(_o,Mg),e(tt,wg),$(sn,tt,null),e(tt,yg),e(tt,Tl),e(Tl,$g),e(tt,Fg),$(er,tt,null),m(o,Kd,u),m(o,bo,u),e(bo,rn),e(rn,vl),$(tr,vl,null),e(bo,Bg),e(bo,kl),e(kl,Eg),m(o,Gd,u),m(o,je,u),$(or,je,null),e(je,zg),e(je,To),e(To,Pg),e(To,Ml),e(Ml,qg),e(To,xg),e(To,wl),e(wl,Cg),e(To,jg),e(je,Ng),e(je,nr),e(nr,Sg),e(nr,Ca),e(Ca,Ag),e(nr,Og),e(je,Ig),e(je,sr),e(sr,Dg),e(sr,rr),e(rr,Lg),e(sr,Wg),e(je,Rg),$(an,je,null),e(je,Hg),e(je,ot),$(ar,ot,null),e(ot,Qg),e(ot,vo),e(vo,Ug),e(vo,ja),e(ja,Vg),e(vo,Kg),e(vo,yl),e(yl,Gg),e(vo,Jg),e(ot,Yg),$(ln,ot,null),e(ot,Zg),e(ot,$l),e($l,Xg),e(ot,e_),$(ir,ot,null),m(o,Jd,u),m(o,ko,u),e(ko,dn),e(dn,Fl),$(lr,Fl,null),e(ko,t_),e(ko,Bl),e(Bl,o_),m(o,Yd,u),m(o,Ne,u),$(dr,Ne,null),e(Ne,n_),e(Ne,cr),e(cr,s_),e(cr,El),e(El,r_),e(cr,a_),e(Ne,i_),e(Ne,pr),e(pr,l_),e(pr,Na),e(Na,d_),e(pr,c_),e(Ne,p_),e(Ne,hr),e(hr,h_),e(hr,mr),e(mr,m_),e(hr,u_),e(Ne,f_),$(cn,Ne,null),e(Ne,g_),e(Ne,nt),$(ur,nt,null),e(nt,__),e(nt,Mo),e(Mo,b_),e(Mo,Sa),e(Sa,T_),e(Mo,v_),e(Mo,zl),e(zl,k_),e(Mo,M_),e(nt,w_),$(pn,nt,null),e(nt,y_),e(nt,Pl),e(Pl,$_),e(nt,F_),$(fr,nt,null),m(o,Zd,u),m(o,wo,u),e(wo,hn),e(hn,ql),$(gr,ql,null),e(wo,B_),e(wo,xl),e(xl,E_),m(o,Xd,u),m(o,Se,u),$(_r,Se,null),e(Se,z_),e(Se,br),e(br,P_),e(br,Cl),e(Cl,q_),e(br,x_),e(Se,C_),e(Se,Tr),e(Tr,j_),e(Tr,Aa),e(Aa,N_),e(Tr,S_),e(Se,A_),e(Se,vr),e(vr,O_),e(vr,kr),e(kr,I_),e(vr,D_),e(Se,L_),$(mn,Se,null),e(Se,W_),e(Se,st),$(Mr,st,null),e(st,R_),e(st,yo),e(yo,H_),e(yo,Oa),e(Oa,Q_),e(yo,U_),e(yo,jl),e(jl,V_),e(yo,K_),e(st,G_),$(un,st,null),e(st,J_),e(st,Nl),e(Nl,Y_),e(st,Z_),$(wr,st,null),m(o,ec,u),m(o,$o,u),e($o,fn),e(fn,Sl),$(yr,Sl,null),e($o,X_),e($o,Al),e(Al,eb),m(o,tc,u),m(o,Ae,u),$($r,Ae,null),e(Ae,tb),e(Ae,Ol),e(Ol,ob),e(Ae,nb),e(Ae,Fr),e(Fr,sb),e(Fr,Ia),e(Ia,rb),e(Fr,ab),e(Ae,ib),e(Ae,Br),e(Br,lb),e(Br,Er),e(Er,db),e(Br,cb),e(Ae,pb),$(gn,Ae,null),e(Ae,hb),e(Ae,rt),$(zr,rt,null),e(rt,mb),e(rt,Fo),e(Fo,ub),e(Fo,Da),e(Da,fb),e(Fo,gb),e(Fo,Il),e(Il,_b),e(Fo,bb),e(rt,Tb),$(_n,rt,null),e(rt,vb),e(rt,Dl),e(Dl,kb),e(rt,Mb),$(Pr,rt,null),m(o,oc,u),m(o,Bo,u),e(Bo,bn),e(bn,Ll),$(qr,Ll,null),e(Bo,wb),e(Bo,Wl),e(Wl,yb),m(o,nc,u),m(o,Oe,u),$(xr,Oe,null),e(Oe,$b),e(Oe,Rl),e(Rl,Fb),e(Oe,Bb),e(Oe,Cr),e(Cr,Eb),e(Cr,La),e(La,zb),e(Cr,Pb),e(Oe,qb),e(Oe,jr),e(jr,xb),e(jr,Nr),e(Nr,Cb),e(jr,jb),e(Oe,Nb),$(Tn,Oe,null),e(Oe,Sb),e(Oe,at),$(Sr,at,null),e(at,Ab),e(at,Eo),e(Eo,Ob),e(Eo,Wa),e(Wa,Ib),e(Eo,Db),e(Eo,Hl),e(Hl,Lb),e(Eo,Wb),e(at,Rb),$(vn,at,null),e(at,Hb),e(at,Ql),e(Ql,Qb),e(at,Ub),$(Ar,at,null),m(o,sc,u),m(o,zo,u),e(zo,kn),e(kn,Ul),$(Or,Ul,null),e(zo,Vb),e(zo,Vl),e(Vl,Kb),m(o,rc,u),m(o,Ie,u),$(Ir,Ie,null),e(Ie,Gb),e(Ie,Kl),e(Kl,Jb),e(Ie,Yb),e(Ie,Dr),e(Dr,Zb),e(Dr,Ra),e(Ra,Xb),e(Dr,eT),e(Ie,tT),e(Ie,Lr),e(Lr,oT),e(Lr,Wr),e(Wr,nT),e(Lr,sT),e(Ie,rT),$(Mn,Ie,null),e(Ie,aT),e(Ie,it),$(Rr,it,null),e(it,iT),e(it,Po),e(Po,lT),e(Po,Ha),e(Ha,dT),e(Po,cT),e(Po,Gl),e(Gl,pT),e(Po,hT),e(it,mT),$(wn,it,null),e(it,uT),e(it,Jl),e(Jl,fT),e(it,gT),$(Hr,it,null),m(o,ac,u),m(o,qo,u),e(qo,yn),e(yn,Yl),$(Qr,Yl,null),e(qo,_T),e(qo,Zl),e(Zl,bT),m(o,ic,u),m(o,De,u),$(Ur,De,null),e(De,TT),e(De,xo),e(xo,vT),e(xo,Xl),e(Xl,kT),e(xo,MT),e(xo,ed),e(ed,wT),e(xo,yT),e(De,$T),e(De,Vr),e(Vr,FT),e(Vr,Qa),e(Qa,BT),e(Vr,ET),e(De,zT),e(De,Kr),e(Kr,PT),e(Kr,Gr),e(Gr,qT),e(Kr,xT),e(De,CT),$($n,De,null),e(De,jT),e(De,lt),$(Jr,lt,null),e(lt,NT),e(lt,Co),e(Co,ST),e(Co,Ua),e(Ua,AT),e(Co,OT),e(Co,td),e(td,IT),e(Co,DT),e(lt,LT),$(Fn,lt,null),e(lt,WT),e(lt,od),e(od,RT),e(lt,HT),$(Yr,lt,null),lc=!0},p(o,[u]){const Zr={};u&2&&(Zr.$$scope={dirty:u,ctx:o}),Lo.$set(Zr);const nd={};u&2&&(nd.$$scope={dirty:u,ctx:o}),Ro.$set(nd);const sd={};u&2&&(sd.$$scope={dirty:u,ctx:o}),Qo.$set(sd);const rd={};u&2&&(rd.$$scope={dirty:u,ctx:o}),Vo.$set(rd);const Xr={};u&2&&(Xr.$$scope={dirty:u,ctx:o}),Go.$set(Xr);const ad={};u&2&&(ad.$$scope={dirty:u,ctx:o}),Yo.$set(ad);const id={};u&2&&(id.$$scope={dirty:u,ctx:o}),Xo.$set(id);const ld={};u&2&&(ld.$$scope={dirty:u,ctx:o}),tn.$set(ld);const ea={};u&2&&(ea.$$scope={dirty:u,ctx:o}),nn.$set(ea);const dd={};u&2&&(dd.$$scope={dirty:u,ctx:o}),sn.$set(dd);const cd={};u&2&&(cd.$$scope={dirty:u,ctx:o}),an.$set(cd);const pd={};u&2&&(pd.$$scope={dirty:u,ctx:o}),ln.$set(pd);const hd={};u&2&&(hd.$$scope={dirty:u,ctx:o}),cn.$set(hd);const md={};u&2&&(md.$$scope={dirty:u,ctx:o}),pn.$set(md);const ta={};u&2&&(ta.$$scope={dirty:u,ctx:o}),mn.$set(ta);const ud={};u&2&&(ud.$$scope={dirty:u,ctx:o}),un.$set(ud);const fd={};u&2&&(fd.$$scope={dirty:u,ctx:o}),gn.$set(fd);const jo={};u&2&&(jo.$$scope={dirty:u,ctx:o}),_n.$set(jo);const gd={};u&2&&(gd.$$scope={dirty:u,ctx:o}),Tn.$set(gd);const _d={};u&2&&(_d.$$scope={dirty:u,ctx:o}),vn.$set(_d);const oa={};u&2&&(oa.$$scope={dirty:u,ctx:o}),Mn.$set(oa);const bd={};u&2&&(bd.$$scope={dirty:u,ctx:o}),wn.$set(bd);const Td={};u&2&&(Td.$$scope={dirty:u,ctx:o}),$n.$set(Td);const vd={};u&2&&(vd.$$scope={dirty:u,ctx:o}),Fn.$set(vd)},i(o){lc||(F(b.$$.fragment,o),F(ee.$$.fragment,o),F(O.$$.fragment,o),F(oe.$$.fragment,o),F(zn.$$.fragment,o),F(Pn.$$.fragment,o),F(qn.$$.fragment,o),F(Cn.$$.fragment,o),F(jn.$$.fragment,o),F(An.$$.fragment,o),F(On.$$.fragment,o),F(Dn.$$.fragment,o),F(Wn.$$.fragment,o),F(Rn.$$.fragment,o),F(Kn.$$.fragment,o),F(Lo.$$.fragment,o),F(Gn.$$.fragment,o),F(Jn.$$.fragment,o),F(Yn.$$.fragment,o),F(ts.$$.fragment,o),F(Ro.$$.fragment,o),F(os.$$.fragment,o),F(ns.$$.fragment,o),F(ss.$$.fragment,o),F(ds.$$.fragment,o),F(Qo.$$.fragment,o),F(cs.$$.fragment,o),F(ps.$$.fragment,o),F(hs.$$.fragment,o),F(_s.$$.fragment,o),F(Vo.$$.fragment,o),F(bs.$$.fragment,o),F(Ts.$$.fragment,o),F(vs.$$.fragment,o),F(ys.$$.fragment,o),F(Go.$$.fragment,o),F($s.$$.fragment,o),F(Fs.$$.fragment,o),F(Bs.$$.fragment,o),F(Es.$$.fragment,o),F(xs.$$.fragment,o),F(Yo.$$.fragment,o),F(Cs.$$.fragment,o),F(js.$$.fragment,o),F(Ns.$$.fragment,o),F(Is.$$.fragment,o),F(Xo.$$.fragment,o),F(Ds.$$.fragment,o),F(Ls.$$.fragment,o),F(Ws.$$.fragment,o),F(Us.$$.fragment,o),F(tn.$$.fragment,o),F(Vs.$$.fragment,o),F(Ks.$$.fragment,o),F(Gs.$$.fragment,o),F(nn.$$.fragment,o),F(Xs.$$.fragment,o),F(sn.$$.fragment,o),F(er.$$.fragment,o),F(tr.$$.fragment,o),F(or.$$.fragment,o),F(an.$$.fragment,o),F(ar.$$.fragment,o),F(ln.$$.fragment,o),F(ir.$$.fragment,o),F(lr.$$.fragment,o),F(dr.$$.fragment,o),F(cn.$$.fragment,o),F(ur.$$.fragment,o),F(pn.$$.fragment,o),F(fr.$$.fragment,o),F(gr.$$.fragment,o),F(_r.$$.fragment,o),F(mn.$$.fragment,o),F(Mr.$$.fragment,o),F(un.$$.fragment,o),F(wr.$$.fragment,o),F(yr.$$.fragment,o),F($r.$$.fragment,o),F(gn.$$.fragment,o),F(zr.$$.fragment,o),F(_n.$$.fragment,o),F(Pr.$$.fragment,o),F(qr.$$.fragment,o),F(xr.$$.fragment,o),F(Tn.$$.fragment,o),F(Sr.$$.fragment,o),F(vn.$$.fragment,o),F(Ar.$$.fragment,o),F(Or.$$.fragment,o),F(Ir.$$.fragment,o),F(Mn.$$.fragment,o),F(Rr.$$.fragment,o),F(wn.$$.fragment,o),F(Hr.$$.fragment,o),F(Qr.$$.fragment,o),F(Ur.$$.fragment,o),F($n.$$.fragment,o),F(Jr.$$.fragment,o),F(Fn.$$.fragment,o),F(Yr.$$.fragment,o),lc=!0)},o(o){B(b.$$.fragment,o),B(ee.$$.fragment,o),B(O.$$.fragment,o),B(oe.$$.fragment,o),B(zn.$$.fragment,o),B(Pn.$$.fragment,o),B(qn.$$.fragment,o),B(Cn.$$.fragment,o),B(jn.$$.fragment,o),B(An.$$.fragment,o),B(On.$$.fragment,o),B(Dn.$$.fragment,o),B(Wn.$$.fragment,o),B(Rn.$$.fragment,o),B(Kn.$$.fragment,o),B(Lo.$$.fragment,o),B(Gn.$$.fragment,o),B(Jn.$$.fragment,o),B(Yn.$$.fragment,o),B(ts.$$.fragment,o),B(Ro.$$.fragment,o),B(os.$$.fragment,o),B(ns.$$.fragment,o),B(ss.$$.fragment,o),B(ds.$$.fragment,o),B(Qo.$$.fragment,o),B(cs.$$.fragment,o),B(ps.$$.fragment,o),B(hs.$$.fragment,o),B(_s.$$.fragment,o),B(Vo.$$.fragment,o),B(bs.$$.fragment,o),B(Ts.$$.fragment,o),B(vs.$$.fragment,o),B(ys.$$.fragment,o),B(Go.$$.fragment,o),B($s.$$.fragment,o),B(Fs.$$.fragment,o),B(Bs.$$.fragment,o),B(Es.$$.fragment,o),B(xs.$$.fragment,o),B(Yo.$$.fragment,o),B(Cs.$$.fragment,o),B(js.$$.fragment,o),B(Ns.$$.fragment,o),B(Is.$$.fragment,o),B(Xo.$$.fragment,o),B(Ds.$$.fragment,o),B(Ls.$$.fragment,o),B(Ws.$$.fragment,o),B(Us.$$.fragment,o),B(tn.$$.fragment,o),B(Vs.$$.fragment,o),B(Ks.$$.fragment,o),B(Gs.$$.fragment,o),B(nn.$$.fragment,o),B(Xs.$$.fragment,o),B(sn.$$.fragment,o),B(er.$$.fragment,o),B(tr.$$.fragment,o),B(or.$$.fragment,o),B(an.$$.fragment,o),B(ar.$$.fragment,o),B(ln.$$.fragment,o),B(ir.$$.fragment,o),B(lr.$$.fragment,o),B(dr.$$.fragment,o),B(cn.$$.fragment,o),B(ur.$$.fragment,o),B(pn.$$.fragment,o),B(fr.$$.fragment,o),B(gr.$$.fragment,o),B(_r.$$.fragment,o),B(mn.$$.fragment,o),B(Mr.$$.fragment,o),B(un.$$.fragment,o),B(wr.$$.fragment,o),B(yr.$$.fragment,o),B($r.$$.fragment,o),B(gn.$$.fragment,o),B(zr.$$.fragment,o),B(_n.$$.fragment,o),B(Pr.$$.fragment,o),B(qr.$$.fragment,o),B(xr.$$.fragment,o),B(Tn.$$.fragment,o),B(Sr.$$.fragment,o),B(vn.$$.fragment,o),B(Ar.$$.fragment,o),B(Or.$$.fragment,o),B(Ir.$$.fragment,o),B(Mn.$$.fragment,o),B(Rr.$$.fragment,o),B(wn.$$.fragment,o),B(Hr.$$.fragment,o),B(Qr.$$.fragment,o),B(Ur.$$.fragment,o),B($n.$$.fragment,o),B(Jr.$$.fragment,o),B(Fn.$$.fragment,o),B(Yr.$$.fragment,o),lc=!1},d(o){t(h),o&&t(k),o&&t(f),E(b),o&&t(K),o&&t(z),E(ee),o&&t(le),o&&t(V),o&&t(x),o&&t(ne),o&&t(de),o&&t(se),o&&t(ce),o&&t(q),o&&t(W),o&&t(X),o&&t(pe),o&&t(A),o&&t(we),o&&t(Te),E(O),o&&t(ye),o&&t(Y),E(oe),E(zn),o&&t(wd),o&&t(Ut),E(Pn),o&&t(yd),o&&t(ct),E(qn),o&&t($d),o&&t(Vt),E(Cn),o&&t(Fd),o&&t(pt),E(jn),o&&t(Bd),o&&t(Kt),E(An),o&&t(Ed),o&&t(Gt),E(On),o&&t(zd),o&&t(Jt),E(Dn),o&&t(Pd),o&&t(Yt),E(Wn),o&&t(qd),o&&t(xe),E(Rn),E(Kn),E(Lo),E(Gn),o&&t(xd),o&&t(Xt),E(Jn),o&&t(Cd),o&&t(Le),E(Yn),E(ts),E(Ro),E(os),o&&t(jd),o&&t(oo),E(ns),o&&t(Nd),o&&t(We),E(ss),E(ds),E(Qo),E(cs),o&&t(Sd),o&&t(so),E(ps),o&&t(Ad),o&&t(Re),E(hs),E(_s),E(Vo),E(bs),o&&t(Od),o&&t(ao),E(Ts),o&&t(Id),o&&t(He),E(vs),E(ys),E(Go),E($s),E(Fs),o&&t(Dd),o&&t(lo),E(Bs),o&&t(Ld),o&&t(Qe),E(Es),E(xs),E(Yo),E(Cs),o&&t(Wd),o&&t(po),E(js),o&&t(Rd),o&&t(Ue),E(Ns),E(Is),E(Xo),E(Ds),o&&t(Hd),o&&t(mo),E(Ls),o&&t(Qd),o&&t(Ve),E(Ws),E(Us),E(tn),E(Vs),o&&t(Ud),o&&t(go),E(Ks),o&&t(Vd),o&&t(Ce),E(Gs),E(nn),E(Xs),E(sn),E(er),o&&t(Kd),o&&t(bo),E(tr),o&&t(Gd),o&&t(je),E(or),E(an),E(ar),E(ln),E(ir),o&&t(Jd),o&&t(ko),E(lr),o&&t(Yd),o&&t(Ne),E(dr),E(cn),E(ur),E(pn),E(fr),o&&t(Zd),o&&t(wo),E(gr),o&&t(Xd),o&&t(Se),E(_r),E(mn),E(Mr),E(un),E(wr),o&&t(ec),o&&t($o),E(yr),o&&t(tc),o&&t(Ae),E($r),E(gn),E(zr),E(_n),E(Pr),o&&t(oc),o&&t(Bo),E(qr),o&&t(nc),o&&t(Oe),E(xr),E(Tn),E(Sr),E(vn),E(Ar),o&&t(sc),o&&t(zo),E(Or),o&&t(rc),o&&t(Ie),E(Ir),E(Mn),E(Rr),E(wn),E(Hr),o&&t(ac),o&&t(qo),E(Qr),o&&t(ic),o&&t(De),E(Ur),E($n),E(Jr),E(Fn),E(Yr)}}}const jM={local:"mobilebert",sections:[{local:"overview",title:"Overview"},{local:"transformers.MobileBertConfig",title:"MobileBertConfig"},{local:"transformers.MobileBertTokenizer",title:"MobileBertTokenizer"},{local:"transformers.MobileBertTokenizerFast",title:"MobileBertTokenizerFast"},{local:"transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput",title:"MobileBert specific outputs"},{local:"transformers.MobileBertModel",title:"MobileBertModel"},{local:"transformers.MobileBertForPreTraining",title:"MobileBertForPreTraining"},{local:"transformers.MobileBertForMaskedLM",title:"MobileBertForMaskedLM"},{local:"transformers.MobileBertForNextSentencePrediction",title:"MobileBertForNextSentencePrediction"},{local:"transformers.MobileBertForSequenceClassification",title:"MobileBertForSequenceClassification"},{local:"transformers.MobileBertForMultipleChoice",title:"MobileBertForMultipleChoice"},{local:"transformers.MobileBertForTokenClassification",title:"MobileBertForTokenClassification"},{local:"transformers.MobileBertForQuestionAnswering",title:"MobileBertForQuestionAnswering"},{local:"transformers.TFMobileBertModel",title:"TFMobileBertModel"},{local:"transformers.TFMobileBertForPreTraining",title:"TFMobileBertForPreTraining"},{local:"transformers.TFMobileBertForMaskedLM",title:"TFMobileBertForMaskedLM"},{local:"transformers.TFMobileBertForNextSentencePrediction",title:"TFMobileBertForNextSentencePrediction"},{local:"transformers.TFMobileBertForSequenceClassification",title:"TFMobileBertForSequenceClassification"},{local:"transformers.TFMobileBertForMultipleChoice",title:"TFMobileBertForMultipleChoice"},{local:"transformers.TFMobileBertForTokenClassification",title:"TFMobileBertForTokenClassification"},{local:"transformers.TFMobileBertForQuestionAnswering",title:"TFMobileBertForQuestionAnswering"}],title:"MobileBERT"};function NM(R,h,k){let{fw:f}=h;return R.$$set=g=>{"fw"in g&&k(0,f=g.fw)},[f]}class WM extends rM{constructor(h){super();aM(this,h,NM,CM,iM,{fw:0})}}export{WM as default,jM as metadata};
