import{S as _T,i as vT,s as kT,e as a,k as l,w as b,t as n,M as TT,c as r,d as t,m as d,a as i,x as M,h as s,b as p,F as e,g as m,y as w,q as y,o as L,B as $}from"../../chunks/vendor-4833417e.js";import{T as xe}from"../../chunks/Tip-fffd6df1.js";import{D as Y}from"../../chunks/Docstring-4f315ed9.js";import{C as Se}from"../../chunks/CodeBlock-6a3d1b46.js";import{I as ze}from"../../chunks/IconCopyLink-4b81c553.js";import"../../chunks/CopyButton-dacfbfaf.js";function bT(S){let h,F,f,_,k;return{c(){h=a("p"),F=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),_=n("Module"),k=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(v){h=r(v,"P",{});var g=i(h);F=s(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(g,"CODE",{});var X=i(f);_=s(X,"Module"),X.forEach(t),k=s(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(v,g){m(v,h,g),e(h,F),e(h,f),e(f,_),e(h,k)},d(v){v&&t(h)}}}function MT(S){let h,F,f,_,k;return{c(){h=a("p"),F=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),_=n("Module"),k=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(v){h=r(v,"P",{});var g=i(h);F=s(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(g,"CODE",{});var X=i(f);_=s(X,"Module"),X.forEach(t),k=s(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(v,g){m(v,h,g),e(h,F),e(h,f),e(f,_),e(h,k)},d(v){v&&t(h)}}}function wT(S){let h,F,f,_,k;return{c(){h=a("p"),F=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),_=n("Module"),k=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(v){h=r(v,"P",{});var g=i(h);F=s(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(g,"CODE",{});var X=i(f);_=s(X,"Module"),X.forEach(t),k=s(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(v,g){m(v,h,g),e(h,F),e(h,f),e(f,_),e(h,k)},d(v){v&&t(h)}}}function yT(S){let h,F,f,_,k;return{c(){h=a("p"),F=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),_=n("Module"),k=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(v){h=r(v,"P",{});var g=i(h);F=s(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(g,"CODE",{});var X=i(f);_=s(X,"Module"),X.forEach(t),k=s(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(v,g){m(v,h,g),e(h,F),e(h,f),e(f,_),e(h,k)},d(v){v&&t(h)}}}function LT(S){let h,F,f,_,k;return{c(){h=a("p"),F=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),_=n("Module"),k=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(v){h=r(v,"P",{});var g=i(h);F=s(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(g,"CODE",{});var X=i(f);_=s(X,"Module"),X.forEach(t),k=s(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(v,g){m(v,h,g),e(h,F),e(h,f),e(f,_),e(h,k)},d(v){v&&t(h)}}}function $T(S){let h,F,f,_,k;return{c(){h=a("p"),F=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),_=n("Module"),k=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(v){h=r(v,"P",{});var g=i(h);F=s(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(g,"CODE",{});var X=i(f);_=s(X,"Module"),X.forEach(t),k=s(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(v,g){m(v,h,g),e(h,F),e(h,f),e(f,_),e(h,k)},d(v){v&&t(h)}}}function FT(S){let h,F,f,_,k;return{c(){h=a("p"),F=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),_=n("Module"),k=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(v){h=r(v,"P",{});var g=i(h);F=s(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(g,"CODE",{});var X=i(f);_=s(X,"Module"),X.forEach(t),k=s(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(v,g){m(v,h,g),e(h,F),e(h,f),e(f,_),e(h,k)},d(v){v&&t(h)}}}function XT(S){let h,F,f,_,k,v,g,X,de,G,x,Z,I,ee,ce,D,pe,re,R,j,te,J,E,q,K,W,he,me,H,ue,fe,z,ge,Q,ne,_e,B,se,ae,P,ie,O,ve;return{c(){h=a("p"),F=n("TF 2.0 models accepts two formats as inputs:"),f=l(),_=a("ul"),k=a("li"),v=n("having all inputs as keyword arguments (like PyTorch models), or"),g=l(),X=a("li"),de=n("having all inputs as a list, tuple or dict in the first positional arguments."),G=l(),x=a("p"),Z=n("This second option is useful when using "),I=a("code"),ee=n("tf.keras.Model.fit"),ce=n(` method which currently requires having all the
tensors in the first argument of the model call function: `),D=a("code"),pe=n("model(inputs)"),re=n("."),R=l(),j=a("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 :`),J=l(),E=a("ul"),q=a("li"),K=n("a single Tensor with "),W=a("code"),he=n("input_ids"),me=n(" only and nothing else: "),H=a("code"),ue=n("model(inputs_ids)"),fe=l(),z=a("li"),ge=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=a("code"),ne=n("model([input_ids, attention_mask])"),_e=n(" or "),B=a("code"),se=n("model([input_ids, attention_mask, token_type_ids])"),ae=l(),P=a("li"),ie=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),O=a("code"),ve=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(c){h=r(c,"P",{});var T=i(h);F=s(T,"TF 2.0 models accepts two formats as inputs:"),T.forEach(t),f=d(c),_=r(c,"UL",{});var V=i(_);k=r(V,"LI",{});var Te=i(k);v=s(Te,"having all inputs as keyword arguments (like PyTorch models), or"),Te.forEach(t),g=d(V),X=r(V,"LI",{});var be=i(X);de=s(be,"having all inputs as a list, tuple or dict in the first positional arguments."),be.forEach(t),V.forEach(t),G=d(c),x=r(c,"P",{});var C=i(x);Z=s(C,"This second option is useful when using "),I=r(C,"CODE",{});var Me=i(I);ee=s(Me,"tf.keras.Model.fit"),Me.forEach(t),ce=s(C,` method which currently requires having all the
tensors in the first argument of the model call function: `),D=r(C,"CODE",{});var ke=i(D);pe=s(ke,"model(inputs)"),ke.forEach(t),re=s(C,"."),C.forEach(t),R=d(c),j=r(c,"P",{});var we=i(j);te=s(we,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),we.forEach(t),J=d(c),E=r(c,"UL",{});var A=i(E);q=r(A,"LI",{});var N=i(q);K=s(N,"a single Tensor with "),W=r(N,"CODE",{});var ye=i(W);he=s(ye,"input_ids"),ye.forEach(t),me=s(N," only and nothing else: "),H=r(N,"CODE",{});var Le=i(H);ue=s(Le,"model(inputs_ids)"),Le.forEach(t),N.forEach(t),fe=d(A),z=r(A,"LI",{});var U=i(z);ge=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=r(U,"CODE",{});var le=i(Q);ne=s(le,"model([input_ids, attention_mask])"),le.forEach(t),_e=s(U," or "),B=r(U,"CODE",{});var $e=i(B);se=s($e,"model([input_ids, attention_mask, token_type_ids])"),$e.forEach(t),U.forEach(t),ae=d(A),P=r(A,"LI",{});var oe=i(P);ie=s(oe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),O=r(oe,"CODE",{});var Fe=i(O);ve=s(Fe,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Fe.forEach(t),oe.forEach(t),A.forEach(t)},m(c,T){m(c,h,T),e(h,F),m(c,f,T),m(c,_,T),e(_,k),e(k,v),e(_,g),e(_,X),e(X,de),m(c,G,T),m(c,x,T),e(x,Z),e(x,I),e(I,ee),e(x,ce),e(x,D),e(D,pe),e(x,re),m(c,R,T),m(c,j,T),e(j,te),m(c,J,T),m(c,E,T),e(E,q),e(q,K),e(q,W),e(W,he),e(q,me),e(q,H),e(H,ue),e(E,fe),e(E,z),e(z,ge),e(z,Q),e(Q,ne),e(z,_e),e(z,B),e(B,se),e(E,ae),e(E,P),e(P,ie),e(P,O),e(O,ve)},d(c){c&&t(h),c&&t(f),c&&t(_),c&&t(G),c&&t(x),c&&t(R),c&&t(j),c&&t(J),c&&t(E)}}}function xT(S){let h,F,f,_,k;return{c(){h=a("p"),F=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),_=n("Module"),k=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(v){h=r(v,"P",{});var g=i(h);F=s(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(g,"CODE",{});var X=i(f);_=s(X,"Module"),X.forEach(t),k=s(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(v,g){m(v,h,g),e(h,F),e(h,f),e(f,_),e(h,k)},d(v){v&&t(h)}}}function ET(S){let h,F,f,_,k,v,g,X,de,G,x,Z,I,ee,ce,D,pe,re,R,j,te,J,E,q,K,W,he,me,H,ue,fe,z,ge,Q,ne,_e,B,se,ae,P,ie,O,ve;return{c(){h=a("p"),F=n("TF 2.0 models accepts two formats as inputs:"),f=l(),_=a("ul"),k=a("li"),v=n("having all inputs as keyword arguments (like PyTorch models), or"),g=l(),X=a("li"),de=n("having all inputs as a list, tuple or dict in the first positional arguments."),G=l(),x=a("p"),Z=n("This second option is useful when using "),I=a("code"),ee=n("tf.keras.Model.fit"),ce=n(` method which currently requires having all the
tensors in the first argument of the model call function: `),D=a("code"),pe=n("model(inputs)"),re=n("."),R=l(),j=a("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 :`),J=l(),E=a("ul"),q=a("li"),K=n("a single Tensor with "),W=a("code"),he=n("input_ids"),me=n(" only and nothing else: "),H=a("code"),ue=n("model(inputs_ids)"),fe=l(),z=a("li"),ge=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=a("code"),ne=n("model([input_ids, attention_mask])"),_e=n(" or "),B=a("code"),se=n("model([input_ids, attention_mask, token_type_ids])"),ae=l(),P=a("li"),ie=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),O=a("code"),ve=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(c){h=r(c,"P",{});var T=i(h);F=s(T,"TF 2.0 models accepts two formats as inputs:"),T.forEach(t),f=d(c),_=r(c,"UL",{});var V=i(_);k=r(V,"LI",{});var Te=i(k);v=s(Te,"having all inputs as keyword arguments (like PyTorch models), or"),Te.forEach(t),g=d(V),X=r(V,"LI",{});var be=i(X);de=s(be,"having all inputs as a list, tuple or dict in the first positional arguments."),be.forEach(t),V.forEach(t),G=d(c),x=r(c,"P",{});var C=i(x);Z=s(C,"This second option is useful when using "),I=r(C,"CODE",{});var Me=i(I);ee=s(Me,"tf.keras.Model.fit"),Me.forEach(t),ce=s(C,` method which currently requires having all the
tensors in the first argument of the model call function: `),D=r(C,"CODE",{});var ke=i(D);pe=s(ke,"model(inputs)"),ke.forEach(t),re=s(C,"."),C.forEach(t),R=d(c),j=r(c,"P",{});var we=i(j);te=s(we,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),we.forEach(t),J=d(c),E=r(c,"UL",{});var A=i(E);q=r(A,"LI",{});var N=i(q);K=s(N,"a single Tensor with "),W=r(N,"CODE",{});var ye=i(W);he=s(ye,"input_ids"),ye.forEach(t),me=s(N," only and nothing else: "),H=r(N,"CODE",{});var Le=i(H);ue=s(Le,"model(inputs_ids)"),Le.forEach(t),N.forEach(t),fe=d(A),z=r(A,"LI",{});var U=i(z);ge=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=r(U,"CODE",{});var le=i(Q);ne=s(le,"model([input_ids, attention_mask])"),le.forEach(t),_e=s(U," or "),B=r(U,"CODE",{});var $e=i(B);se=s($e,"model([input_ids, attention_mask, token_type_ids])"),$e.forEach(t),U.forEach(t),ae=d(A),P=r(A,"LI",{});var oe=i(P);ie=s(oe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),O=r(oe,"CODE",{});var Fe=i(O);ve=s(Fe,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Fe.forEach(t),oe.forEach(t),A.forEach(t)},m(c,T){m(c,h,T),e(h,F),m(c,f,T),m(c,_,T),e(_,k),e(k,v),e(_,g),e(_,X),e(X,de),m(c,G,T),m(c,x,T),e(x,Z),e(x,I),e(I,ee),e(x,ce),e(x,D),e(D,pe),e(x,re),m(c,R,T),m(c,j,T),e(j,te),m(c,J,T),m(c,E,T),e(E,q),e(q,K),e(q,W),e(W,he),e(q,me),e(q,H),e(H,ue),e(E,fe),e(E,z),e(z,ge),e(z,Q),e(Q,ne),e(z,_e),e(z,B),e(B,se),e(E,ae),e(E,P),e(P,ie),e(P,O),e(O,ve)},d(c){c&&t(h),c&&t(f),c&&t(_),c&&t(G),c&&t(x),c&&t(R),c&&t(j),c&&t(J),c&&t(E)}}}function zT(S){let h,F,f,_,k;return{c(){h=a("p"),F=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),_=n("Module"),k=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(v){h=r(v,"P",{});var g=i(h);F=s(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(g,"CODE",{});var X=i(f);_=s(X,"Module"),X.forEach(t),k=s(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(v,g){m(v,h,g),e(h,F),e(h,f),e(f,_),e(h,k)},d(v){v&&t(h)}}}function qT(S){let h,F,f,_,k,v,g,X,de,G,x,Z,I,ee,ce,D,pe,re,R,j,te,J,E,q,K,W,he,me,H,ue,fe,z,ge,Q,ne,_e,B,se,ae,P,ie,O,ve;return{c(){h=a("p"),F=n("TF 2.0 models accepts two formats as inputs:"),f=l(),_=a("ul"),k=a("li"),v=n("having all inputs as keyword arguments (like PyTorch models), or"),g=l(),X=a("li"),de=n("having all inputs as a list, tuple or dict in the first positional arguments."),G=l(),x=a("p"),Z=n("This second option is useful when using "),I=a("code"),ee=n("tf.keras.Model.fit"),ce=n(` method which currently requires having all the
tensors in the first argument of the model call function: `),D=a("code"),pe=n("model(inputs)"),re=n("."),R=l(),j=a("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 :`),J=l(),E=a("ul"),q=a("li"),K=n("a single Tensor with "),W=a("code"),he=n("input_ids"),me=n(" only and nothing else: "),H=a("code"),ue=n("model(inputs_ids)"),fe=l(),z=a("li"),ge=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=a("code"),ne=n("model([input_ids, attention_mask])"),_e=n(" or "),B=a("code"),se=n("model([input_ids, attention_mask, token_type_ids])"),ae=l(),P=a("li"),ie=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),O=a("code"),ve=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(c){h=r(c,"P",{});var T=i(h);F=s(T,"TF 2.0 models accepts two formats as inputs:"),T.forEach(t),f=d(c),_=r(c,"UL",{});var V=i(_);k=r(V,"LI",{});var Te=i(k);v=s(Te,"having all inputs as keyword arguments (like PyTorch models), or"),Te.forEach(t),g=d(V),X=r(V,"LI",{});var be=i(X);de=s(be,"having all inputs as a list, tuple or dict in the first positional arguments."),be.forEach(t),V.forEach(t),G=d(c),x=r(c,"P",{});var C=i(x);Z=s(C,"This second option is useful when using "),I=r(C,"CODE",{});var Me=i(I);ee=s(Me,"tf.keras.Model.fit"),Me.forEach(t),ce=s(C,` method which currently requires having all the
tensors in the first argument of the model call function: `),D=r(C,"CODE",{});var ke=i(D);pe=s(ke,"model(inputs)"),ke.forEach(t),re=s(C,"."),C.forEach(t),R=d(c),j=r(c,"P",{});var we=i(j);te=s(we,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),we.forEach(t),J=d(c),E=r(c,"UL",{});var A=i(E);q=r(A,"LI",{});var N=i(q);K=s(N,"a single Tensor with "),W=r(N,"CODE",{});var ye=i(W);he=s(ye,"input_ids"),ye.forEach(t),me=s(N," only and nothing else: "),H=r(N,"CODE",{});var Le=i(H);ue=s(Le,"model(inputs_ids)"),Le.forEach(t),N.forEach(t),fe=d(A),z=r(A,"LI",{});var U=i(z);ge=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=r(U,"CODE",{});var le=i(Q);ne=s(le,"model([input_ids, attention_mask])"),le.forEach(t),_e=s(U," or "),B=r(U,"CODE",{});var $e=i(B);se=s($e,"model([input_ids, attention_mask, token_type_ids])"),$e.forEach(t),U.forEach(t),ae=d(A),P=r(A,"LI",{});var oe=i(P);ie=s(oe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),O=r(oe,"CODE",{});var Fe=i(O);ve=s(Fe,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Fe.forEach(t),oe.forEach(t),A.forEach(t)},m(c,T){m(c,h,T),e(h,F),m(c,f,T),m(c,_,T),e(_,k),e(k,v),e(_,g),e(_,X),e(X,de),m(c,G,T),m(c,x,T),e(x,Z),e(x,I),e(I,ee),e(x,ce),e(x,D),e(D,pe),e(x,re),m(c,R,T),m(c,j,T),e(j,te),m(c,J,T),m(c,E,T),e(E,q),e(q,K),e(q,W),e(W,he),e(q,me),e(q,H),e(H,ue),e(E,fe),e(E,z),e(z,ge),e(z,Q),e(Q,ne),e(z,_e),e(z,B),e(B,se),e(E,ae),e(E,P),e(P,ie),e(P,O),e(O,ve)},d(c){c&&t(h),c&&t(f),c&&t(_),c&&t(G),c&&t(x),c&&t(R),c&&t(j),c&&t(J),c&&t(E)}}}function CT(S){let h,F,f,_,k;return{c(){h=a("p"),F=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),_=n("Module"),k=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(v){h=r(v,"P",{});var g=i(h);F=s(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(g,"CODE",{});var X=i(f);_=s(X,"Module"),X.forEach(t),k=s(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(v,g){m(v,h,g),e(h,F),e(h,f),e(f,_),e(h,k)},d(v){v&&t(h)}}}function jT(S){let h,F,f,_,k,v,g,X,de,G,x,Z,I,ee,ce,D,pe,re,R,j,te,J,E,q,K,W,he,me,H,ue,fe,z,ge,Q,ne,_e,B,se,ae,P,ie,O,ve;return{c(){h=a("p"),F=n("TF 2.0 models accepts two formats as inputs:"),f=l(),_=a("ul"),k=a("li"),v=n("having all inputs as keyword arguments (like PyTorch models), or"),g=l(),X=a("li"),de=n("having all inputs as a list, tuple or dict in the first positional arguments."),G=l(),x=a("p"),Z=n("This second option is useful when using "),I=a("code"),ee=n("tf.keras.Model.fit"),ce=n(` method which currently requires having all the
tensors in the first argument of the model call function: `),D=a("code"),pe=n("model(inputs)"),re=n("."),R=l(),j=a("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 :`),J=l(),E=a("ul"),q=a("li"),K=n("a single Tensor with "),W=a("code"),he=n("input_ids"),me=n(" only and nothing else: "),H=a("code"),ue=n("model(inputs_ids)"),fe=l(),z=a("li"),ge=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=a("code"),ne=n("model([input_ids, attention_mask])"),_e=n(" or "),B=a("code"),se=n("model([input_ids, attention_mask, token_type_ids])"),ae=l(),P=a("li"),ie=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),O=a("code"),ve=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(c){h=r(c,"P",{});var T=i(h);F=s(T,"TF 2.0 models accepts two formats as inputs:"),T.forEach(t),f=d(c),_=r(c,"UL",{});var V=i(_);k=r(V,"LI",{});var Te=i(k);v=s(Te,"having all inputs as keyword arguments (like PyTorch models), or"),Te.forEach(t),g=d(V),X=r(V,"LI",{});var be=i(X);de=s(be,"having all inputs as a list, tuple or dict in the first positional arguments."),be.forEach(t),V.forEach(t),G=d(c),x=r(c,"P",{});var C=i(x);Z=s(C,"This second option is useful when using "),I=r(C,"CODE",{});var Me=i(I);ee=s(Me,"tf.keras.Model.fit"),Me.forEach(t),ce=s(C,` method which currently requires having all the
tensors in the first argument of the model call function: `),D=r(C,"CODE",{});var ke=i(D);pe=s(ke,"model(inputs)"),ke.forEach(t),re=s(C,"."),C.forEach(t),R=d(c),j=r(c,"P",{});var we=i(j);te=s(we,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),we.forEach(t),J=d(c),E=r(c,"UL",{});var A=i(E);q=r(A,"LI",{});var N=i(q);K=s(N,"a single Tensor with "),W=r(N,"CODE",{});var ye=i(W);he=s(ye,"input_ids"),ye.forEach(t),me=s(N," only and nothing else: "),H=r(N,"CODE",{});var Le=i(H);ue=s(Le,"model(inputs_ids)"),Le.forEach(t),N.forEach(t),fe=d(A),z=r(A,"LI",{});var U=i(z);ge=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=r(U,"CODE",{});var le=i(Q);ne=s(le,"model([input_ids, attention_mask])"),le.forEach(t),_e=s(U," or "),B=r(U,"CODE",{});var $e=i(B);se=s($e,"model([input_ids, attention_mask, token_type_ids])"),$e.forEach(t),U.forEach(t),ae=d(A),P=r(A,"LI",{});var oe=i(P);ie=s(oe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),O=r(oe,"CODE",{});var Fe=i(O);ve=s(Fe,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Fe.forEach(t),oe.forEach(t),A.forEach(t)},m(c,T){m(c,h,T),e(h,F),m(c,f,T),m(c,_,T),e(_,k),e(k,v),e(_,g),e(_,X),e(X,de),m(c,G,T),m(c,x,T),e(x,Z),e(x,I),e(I,ee),e(x,ce),e(x,D),e(D,pe),e(x,re),m(c,R,T),m(c,j,T),e(j,te),m(c,J,T),m(c,E,T),e(E,q),e(q,K),e(q,W),e(W,he),e(q,me),e(q,H),e(H,ue),e(E,fe),e(E,z),e(z,ge),e(z,Q),e(Q,ne),e(z,_e),e(z,B),e(B,se),e(E,ae),e(E,P),e(P,ie),e(P,O),e(O,ve)},d(c){c&&t(h),c&&t(f),c&&t(_),c&&t(G),c&&t(x),c&&t(R),c&&t(j),c&&t(J),c&&t(E)}}}function PT(S){let h,F,f,_,k;return{c(){h=a("p"),F=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),_=n("Module"),k=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(v){h=r(v,"P",{});var g=i(h);F=s(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(g,"CODE",{});var X=i(f);_=s(X,"Module"),X.forEach(t),k=s(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(v,g){m(v,h,g),e(h,F),e(h,f),e(f,_),e(h,k)},d(v){v&&t(h)}}}function AT(S){let h,F,f,_,k,v,g,X,de,G,x,Z,I,ee,ce,D,pe,re,R,j,te,J,E,q,K,W,he,me,H,ue,fe,z,ge,Q,ne,_e,B,se,ae,P,ie,O,ve;return{c(){h=a("p"),F=n("TF 2.0 models accepts two formats as inputs:"),f=l(),_=a("ul"),k=a("li"),v=n("having all inputs as keyword arguments (like PyTorch models), or"),g=l(),X=a("li"),de=n("having all inputs as a list, tuple or dict in the first positional arguments."),G=l(),x=a("p"),Z=n("This second option is useful when using "),I=a("code"),ee=n("tf.keras.Model.fit"),ce=n(` method which currently requires having all the
tensors in the first argument of the model call function: `),D=a("code"),pe=n("model(inputs)"),re=n("."),R=l(),j=a("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 :`),J=l(),E=a("ul"),q=a("li"),K=n("a single Tensor with "),W=a("code"),he=n("input_ids"),me=n(" only and nothing else: "),H=a("code"),ue=n("model(inputs_ids)"),fe=l(),z=a("li"),ge=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=a("code"),ne=n("model([input_ids, attention_mask])"),_e=n(" or "),B=a("code"),se=n("model([input_ids, attention_mask, token_type_ids])"),ae=l(),P=a("li"),ie=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),O=a("code"),ve=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(c){h=r(c,"P",{});var T=i(h);F=s(T,"TF 2.0 models accepts two formats as inputs:"),T.forEach(t),f=d(c),_=r(c,"UL",{});var V=i(_);k=r(V,"LI",{});var Te=i(k);v=s(Te,"having all inputs as keyword arguments (like PyTorch models), or"),Te.forEach(t),g=d(V),X=r(V,"LI",{});var be=i(X);de=s(be,"having all inputs as a list, tuple or dict in the first positional arguments."),be.forEach(t),V.forEach(t),G=d(c),x=r(c,"P",{});var C=i(x);Z=s(C,"This second option is useful when using "),I=r(C,"CODE",{});var Me=i(I);ee=s(Me,"tf.keras.Model.fit"),Me.forEach(t),ce=s(C,` method which currently requires having all the
tensors in the first argument of the model call function: `),D=r(C,"CODE",{});var ke=i(D);pe=s(ke,"model(inputs)"),ke.forEach(t),re=s(C,"."),C.forEach(t),R=d(c),j=r(c,"P",{});var we=i(j);te=s(we,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),we.forEach(t),J=d(c),E=r(c,"UL",{});var A=i(E);q=r(A,"LI",{});var N=i(q);K=s(N,"a single Tensor with "),W=r(N,"CODE",{});var ye=i(W);he=s(ye,"input_ids"),ye.forEach(t),me=s(N," only and nothing else: "),H=r(N,"CODE",{});var Le=i(H);ue=s(Le,"model(inputs_ids)"),Le.forEach(t),N.forEach(t),fe=d(A),z=r(A,"LI",{});var U=i(z);ge=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=r(U,"CODE",{});var le=i(Q);ne=s(le,"model([input_ids, attention_mask])"),le.forEach(t),_e=s(U," or "),B=r(U,"CODE",{});var $e=i(B);se=s($e,"model([input_ids, attention_mask, token_type_ids])"),$e.forEach(t),U.forEach(t),ae=d(A),P=r(A,"LI",{});var oe=i(P);ie=s(oe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),O=r(oe,"CODE",{});var Fe=i(O);ve=s(Fe,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Fe.forEach(t),oe.forEach(t),A.forEach(t)},m(c,T){m(c,h,T),e(h,F),m(c,f,T),m(c,_,T),e(_,k),e(k,v),e(_,g),e(_,X),e(X,de),m(c,G,T),m(c,x,T),e(x,Z),e(x,I),e(I,ee),e(x,ce),e(x,D),e(D,pe),e(x,re),m(c,R,T),m(c,j,T),e(j,te),m(c,J,T),m(c,E,T),e(E,q),e(q,K),e(q,W),e(W,he),e(q,me),e(q,H),e(H,ue),e(E,fe),e(E,z),e(z,ge),e(z,Q),e(Q,ne),e(z,_e),e(z,B),e(B,se),e(E,ae),e(E,P),e(P,ie),e(P,O),e(O,ve)},d(c){c&&t(h),c&&t(f),c&&t(_),c&&t(G),c&&t(x),c&&t(R),c&&t(j),c&&t(J),c&&t(E)}}}function OT(S){let h,F,f,_,k;return{c(){h=a("p"),F=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),_=n("Module"),k=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(v){h=r(v,"P",{});var g=i(h);F=s(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(g,"CODE",{});var X=i(f);_=s(X,"Module"),X.forEach(t),k=s(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(v,g){m(v,h,g),e(h,F),e(h,f),e(f,_),e(h,k)},d(v){v&&t(h)}}}function NT(S){let h,F,f,_,k,v,g,X,de,G,x,Z,I,ee,ce,D,pe,re,R,j,te,J,E,q,K,W,he,me,H,ue,fe,z,ge,Q,ne,_e,B,se,ae,P,ie,O,ve;return{c(){h=a("p"),F=n("TF 2.0 models accepts two formats as inputs:"),f=l(),_=a("ul"),k=a("li"),v=n("having all inputs as keyword arguments (like PyTorch models), or"),g=l(),X=a("li"),de=n("having all inputs as a list, tuple or dict in the first positional arguments."),G=l(),x=a("p"),Z=n("This second option is useful when using "),I=a("code"),ee=n("tf.keras.Model.fit"),ce=n(` method which currently requires having all the
tensors in the first argument of the model call function: `),D=a("code"),pe=n("model(inputs)"),re=n("."),R=l(),j=a("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 :`),J=l(),E=a("ul"),q=a("li"),K=n("a single Tensor with "),W=a("code"),he=n("input_ids"),me=n(" only and nothing else: "),H=a("code"),ue=n("model(inputs_ids)"),fe=l(),z=a("li"),ge=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=a("code"),ne=n("model([input_ids, attention_mask])"),_e=n(" or "),B=a("code"),se=n("model([input_ids, attention_mask, token_type_ids])"),ae=l(),P=a("li"),ie=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),O=a("code"),ve=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(c){h=r(c,"P",{});var T=i(h);F=s(T,"TF 2.0 models accepts two formats as inputs:"),T.forEach(t),f=d(c),_=r(c,"UL",{});var V=i(_);k=r(V,"LI",{});var Te=i(k);v=s(Te,"having all inputs as keyword arguments (like PyTorch models), or"),Te.forEach(t),g=d(V),X=r(V,"LI",{});var be=i(X);de=s(be,"having all inputs as a list, tuple or dict in the first positional arguments."),be.forEach(t),V.forEach(t),G=d(c),x=r(c,"P",{});var C=i(x);Z=s(C,"This second option is useful when using "),I=r(C,"CODE",{});var Me=i(I);ee=s(Me,"tf.keras.Model.fit"),Me.forEach(t),ce=s(C,` method which currently requires having all the
tensors in the first argument of the model call function: `),D=r(C,"CODE",{});var ke=i(D);pe=s(ke,"model(inputs)"),ke.forEach(t),re=s(C,"."),C.forEach(t),R=d(c),j=r(c,"P",{});var we=i(j);te=s(we,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),we.forEach(t),J=d(c),E=r(c,"UL",{});var A=i(E);q=r(A,"LI",{});var N=i(q);K=s(N,"a single Tensor with "),W=r(N,"CODE",{});var ye=i(W);he=s(ye,"input_ids"),ye.forEach(t),me=s(N," only and nothing else: "),H=r(N,"CODE",{});var Le=i(H);ue=s(Le,"model(inputs_ids)"),Le.forEach(t),N.forEach(t),fe=d(A),z=r(A,"LI",{});var U=i(z);ge=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=r(U,"CODE",{});var le=i(Q);ne=s(le,"model([input_ids, attention_mask])"),le.forEach(t),_e=s(U," or "),B=r(U,"CODE",{});var $e=i(B);se=s($e,"model([input_ids, attention_mask, token_type_ids])"),$e.forEach(t),U.forEach(t),ae=d(A),P=r(A,"LI",{});var oe=i(P);ie=s(oe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),O=r(oe,"CODE",{});var Fe=i(O);ve=s(Fe,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Fe.forEach(t),oe.forEach(t),A.forEach(t)},m(c,T){m(c,h,T),e(h,F),m(c,f,T),m(c,_,T),e(_,k),e(k,v),e(_,g),e(_,X),e(X,de),m(c,G,T),m(c,x,T),e(x,Z),e(x,I),e(I,ee),e(x,ce),e(x,D),e(D,pe),e(x,re),m(c,R,T),m(c,j,T),e(j,te),m(c,J,T),m(c,E,T),e(E,q),e(q,K),e(q,W),e(W,he),e(q,me),e(q,H),e(H,ue),e(E,fe),e(E,z),e(z,ge),e(z,Q),e(Q,ne),e(z,_e),e(z,B),e(B,se),e(E,ae),e(E,P),e(P,ie),e(P,O),e(O,ve)},d(c){c&&t(h),c&&t(f),c&&t(_),c&&t(G),c&&t(x),c&&t(R),c&&t(j),c&&t(J),c&&t(E)}}}function ST(S){let h,F,f,_,k;return{c(){h=a("p"),F=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),_=n("Module"),k=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(v){h=r(v,"P",{});var g=i(h);F=s(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(g,"CODE",{});var X=i(f);_=s(X,"Module"),X.forEach(t),k=s(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(v,g){m(v,h,g),e(h,F),e(h,f),e(f,_),e(h,k)},d(v){v&&t(h)}}}function IT(S){let h,F,f,_,k,v,g,X,de,G,x,Z,I,ee,ce,D,pe,re,R,j,te,J,E,q,K,W,he,me,H,ue,fe,z,ge,Q,ne,_e,B,se,ae,P,ie,O,ve,c,T,V,Te,be,C,Me,ke,we,A,N,ye,Le,U,le,$e,oe,Fe,Bd,ln,Ud,Rd,gl,St,Mo,_r,dn,Vd,vr,Gd,_l,Ie,cn,Kd,gt,Jd,ga,Yd,Zd,_a,ec,tc,pn,oc,nc,sc,It,ac,va,rc,ic,ka,lc,dc,cc,kr,pc,hc,hn,vl,Dt,wo,Tr,mn,mc,br,uc,kl,Xe,un,fc,Mr,gc,_c,De,wr,vc,kc,yr,Tc,bc,Lr,Mc,wc,_t,yc,$r,Lc,$c,Fr,Fc,Xc,Xr,xc,Ec,zc,fn,qc,xr,Cc,jc,Pc,gn,Ac,Er,Oc,Nc,Sc,_n,Ic,Ta,Dc,Wc,Hc,vt,vn,Qc,zr,Bc,Uc,kn,ba,Rc,qr,Vc,Gc,Ma,Kc,Cr,Jc,Yc,yo,Tn,Zc,bn,ep,jr,tp,op,np,lt,Mn,sp,Pr,ap,rp,wn,ip,Wt,lp,Ar,dp,cp,Or,pp,hp,mp,wa,yn,Tl,Ht,Lo,Nr,Ln,up,Sr,fp,bl,Qt,$n,gp,Fn,_p,Ir,vp,kp,Ml,Bt,$o,Dr,Xn,Tp,Wr,bp,wl,We,xn,Mp,Hr,wp,yp,En,Lp,ya,$p,Fp,Xp,zn,xp,qn,Ep,zp,qp,Ge,Cn,Cp,Ut,jp,La,Pp,Ap,Qr,Op,Np,Sp,Fo,Ip,Br,Dp,Wp,jn,yl,Rt,Xo,Ur,Pn,Hp,Rr,Qp,Ll,He,An,Bp,Vr,Up,Rp,On,Vp,$a,Gp,Kp,Jp,Nn,Yp,Sn,Zp,eh,th,Ke,In,oh,Vt,nh,Fa,sh,ah,Gr,rh,ih,lh,xo,dh,Kr,ch,ph,Dn,$l,Gt,Eo,Jr,Wn,hh,Yr,mh,Fl,Qe,Hn,uh,Zr,fh,gh,Qn,_h,Xa,vh,kh,Th,Bn,bh,Un,Mh,wh,yh,Ee,Rn,Lh,Kt,$h,xa,Fh,Xh,ei,xh,Eh,zh,zo,qh,ti,Ch,jh,Vn,Ph,oi,Ah,Oh,Gn,Xl,Jt,qo,ni,Kn,Nh,si,Sh,xl,Be,Jn,Ih,ai,Dh,Wh,Yn,Hh,Ea,Qh,Bh,Uh,Zn,Rh,es,Vh,Gh,Kh,Je,ts,Jh,Yt,Yh,za,Zh,em,ri,tm,om,nm,Co,sm,ii,am,rm,os,El,Zt,jo,li,ns,im,di,lm,zl,Ue,ss,dm,ci,cm,pm,as,hm,qa,mm,um,fm,rs,gm,is,_m,vm,km,Ye,ls,Tm,eo,bm,Ca,Mm,wm,pi,ym,Lm,$m,Po,Fm,hi,Xm,xm,ds,ql,to,Ao,mi,cs,Em,ui,zm,Cl,Re,ps,qm,oo,Cm,fi,jm,Pm,gi,Am,Om,Nm,hs,Sm,ja,Im,Dm,Wm,ms,Hm,us,Qm,Bm,Um,Ze,fs,Rm,no,Vm,Pa,Gm,Km,_i,Jm,Ym,Zm,Oo,eu,vi,tu,ou,gs,jl,so,No,ki,_s,nu,Ti,su,Pl,Ve,vs,au,ao,ru,bi,iu,lu,Mi,du,cu,pu,ks,hu,Aa,mu,uu,fu,Ts,gu,bs,_u,vu,ku,et,Ms,Tu,ro,bu,Oa,Mu,wu,wi,yu,Lu,$u,So,Fu,yi,Xu,xu,ws,Al,io,Io,Li,ys,Eu,$i,zu,Ol,qe,Ls,qu,Fi,Cu,ju,$s,Pu,Na,Au,Ou,Nu,Fs,Su,Xs,Iu,Du,Wu,Do,Hu,tt,xs,Qu,lo,Bu,Sa,Uu,Ru,Xi,Vu,Gu,Ku,Wo,Ju,xi,Yu,Zu,Es,Nl,co,Ho,Ei,zs,ef,zi,tf,Sl,Ce,qs,of,qi,nf,sf,Cs,af,Ia,rf,lf,df,js,cf,Ps,pf,hf,mf,Qo,uf,ot,As,ff,po,gf,Da,_f,vf,Ci,kf,Tf,bf,Bo,Mf,ji,wf,yf,Os,Il,ho,Uo,Pi,Ns,Lf,Ai,$f,Dl,je,Ss,Ff,Oi,Xf,xf,Is,Ef,Wa,zf,qf,Cf,Ds,jf,Ws,Pf,Af,Of,Ro,Nf,nt,Hs,Sf,mo,If,Ha,Df,Wf,Ni,Hf,Qf,Bf,Vo,Uf,Si,Rf,Vf,Qs,Wl,uo,Go,Ii,Bs,Gf,Di,Kf,Hl,Pe,Us,Jf,Wi,Yf,Zf,Rs,eg,Qa,tg,og,ng,Vs,sg,Gs,ag,rg,ig,Ko,lg,st,Ks,dg,fo,cg,Ba,pg,hg,Hi,mg,ug,fg,Jo,gg,Qi,_g,vg,Js,Ql,go,Yo,Bi,Ys,kg,Ui,Tg,Bl,Ae,Zs,bg,Ri,Mg,wg,ea,yg,Ua,Lg,$g,Fg,ta,Xg,oa,xg,Eg,zg,Zo,qg,at,na,Cg,_o,jg,Ra,Pg,Ag,Vi,Og,Ng,Sg,en,Ig,Gi,Dg,Wg,sa,Ul,vo,tn,Ki,aa,Hg,Ji,Qg,Rl,Oe,ra,Bg,ko,Ug,Yi,Rg,Vg,Zi,Gg,Kg,Jg,ia,Yg,Va,Zg,e_,t_,la,o_,da,n_,s_,a_,on,r_,rt,ca,i_,To,l_,Ga,d_,c_,el,p_,h_,m_,nn,u_,tl,f_,g_,pa,Vl;return v=new ze({}),ee=new ze({}),dn=new ze({}),cn=new Y({props:{name:"class transformers.XLMConfig",anchor:"transformers.XLMConfig",parameters:[{name:"vocab_size",val:" = 30145"},{name:"emb_dim",val:" = 2048"},{name:"n_layers",val:" = 12"},{name:"n_heads",val:" = 16"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.1"},{name:"gelu_activation",val:" = True"},{name:"sinusoidal_embeddings",val:" = False"},{name:"causal",val:" = False"},{name:"asm",val:" = False"},{name:"n_langs",val:" = 1"},{name:"use_lang_emb",val:" = True"},{name:"max_position_embeddings",val:" = 512"},{name:"embed_init_std",val:" = 0.02209708691207961"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"init_std",val:" = 0.02"},{name:"bos_index",val:" = 0"},{name:"eos_index",val:" = 1"},{name:"pad_index",val:" = 2"},{name:"unk_index",val:" = 3"},{name:"mask_index",val:" = 5"},{name:"is_encoder",val:" = True"},{name:"summary_type",val:" = 'first'"},{name:"summary_use_proj",val:" = True"},{name:"summary_activation",val:" = None"},{name:"summary_proj_to_labels",val:" = True"},{name:"summary_first_dropout",val:" = 0.1"},{name:"start_n_top",val:" = 5"},{name:"end_n_top",val:" = 5"},{name:"mask_token_id",val:" = 0"},{name:"lang_id",val:" = 0"},{name:"pad_token_id",val:" = 2"},{name:"bos_token_id",val:" = 0"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/configuration_xlm.py#L37",parametersDescription:[{anchor:"transformers.XLMConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30145) &#x2014;
Vocabulary size of the BERT model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMModel">XLMModel</a> or <a href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.TFXLMModel">TFXLMModel</a>.`,name:"vocab_size"},{anchor:"transformers.XLMConfig.emb_dim",description:`<strong>emb_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"emb_dim"},{anchor:"transformers.XLMConfig.n_layer",description:`<strong>n_layer</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"n_layer"},{anchor:"transformers.XLMConfig.n_head",description:`<strong>n_head</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"n_head"},{anchor:"transformers.XLMConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.XLMConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for the attention mechanism`,name:"attention_dropout"},{anchor:"transformers.XLMConfig.gelu_activation",description:`<strong>gelu_activation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use <em>gelu</em> for the activations instead of <em>relu</em>.`,name:"gelu_activation"},{anchor:"transformers.XLMConfig.sinusoidal_embeddings",description:`<strong>sinusoidal_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use sinusoidal positional embeddings instead of absolute positional embeddings.`,name:"sinusoidal_embeddings"},{anchor:"transformers.XLMConfig.causal",description:`<strong>causal</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should behave in a causal manner. Causal models use a triangular attention mask in
order to only attend to the left-side context instead if a bidirectional context.`,name:"causal"},{anchor:"transformers.XLMConfig.asm",description:`<strong>asm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use an adaptive log softmax projection layer instead of a linear layer for the prediction
layer.`,name:"asm"},{anchor:"transformers.XLMConfig.n_langs",description:`<strong>n_langs</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of languages the model handles. Set to 1 for monolingual models.`,name:"n_langs"},{anchor:"transformers.XLMConfig.use_lang_emb",description:`<strong>use_lang_emb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use language embeddings. Some models use additional language embeddings, see <a href="http://huggingface.co/transformers/multilingual.html#xlm-language-embeddings" rel="nofollow">the multilingual
models page</a> for information
on how to use them.`,name:"use_lang_emb"},{anchor:"transformers.XLMConfig.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.XLMConfig.embed_init_std",description:`<strong>embed_init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 2048^-0.5) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing the embedding matrices.`,name:"embed_init_std"},{anchor:"transformers.XLMConfig.init_std",description:`<strong>init_std</strong> (<code>int</code>, <em>optional</em>, defaults to 50257) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices except the
embedding matrices.`,name:"init_std"},{anchor:"transformers.XLMConfig.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.XLMConfig.bos_index",description:`<strong>bos_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The index of the beginning of sentence token in the vocabulary.`,name:"bos_index"},{anchor:"transformers.XLMConfig.eos_index",description:`<strong>eos_index</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The index of the end of sentence token in the vocabulary.`,name:"eos_index"},{anchor:"transformers.XLMConfig.pad_index",description:`<strong>pad_index</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The index of the padding token in the vocabulary.`,name:"pad_index"},{anchor:"transformers.XLMConfig.unk_index",description:`<strong>unk_index</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The index of the unknown token in the vocabulary.`,name:"unk_index"},{anchor:"transformers.XLMConfig.mask_index",description:`<strong>mask_index</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
The index of the masking token in the vocabulary.`,name:"mask_index"},{anchor:"transformers.XLMConfig.is_encoder(bool,",description:`<strong>is_encoder(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the initialized model should be a transformer encoder or decoder as seen in Vaswani et al.`,name:"is_encoder(bool,"},{anchor:"transformers.XLMConfig.summary_type",description:`<strong>summary_type</strong> (<code>string</code>, <em>optional</em>, defaults to &#x201C;first&#x201D;) &#x2014;
Argument used when doing sequence summary. Used in the sequence classification and multiple choice models.</p>
<p>Has to be one of the following options:</p>
<ul>
<li><code>&quot;last&quot;</code>: Take the last token hidden state (like XLNet).</li>
<li><code>&quot;first&quot;</code>: Take the first token hidden state (like BERT).</li>
<li><code>&quot;mean&quot;</code>: Take the mean of all tokens hidden states.</li>
<li><code>&quot;cls_index&quot;</code>: Supply a Tensor of classification token position (like GPT/GPT-2).</li>
<li><code>&quot;attn&quot;</code>: Not implemented now, use multi-head attention.</li>
</ul>`,name:"summary_type"},{anchor:"transformers.XLMConfig.summary_use_proj",description:`<strong>summary_use_proj</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Argument used when doing sequence summary. Used in the sequence classification and multiple choice models.</p>
<p>Whether or not to add a projection after the vector extraction.`,name:"summary_use_proj"},{anchor:"transformers.XLMConfig.summary_activation",description:`<strong>summary_activation</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Argument used when doing sequence summary. Used in the sequence classification and multiple choice models.</p>
<p>Pass <code>&quot;tanh&quot;</code> for a tanh activation to the output, any other value will result in no activation.`,name:"summary_activation"},{anchor:"transformers.XLMConfig.summary_proj_to_labels",description:`<strong>summary_proj_to_labels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Used in the sequence classification and multiple choice models.</p>
<p>Whether the projection outputs should have <code>config.num_labels</code> or <code>config.hidden_size</code> classes.`,name:"summary_proj_to_labels"},{anchor:"transformers.XLMConfig.summary_first_dropout",description:`<strong>summary_first_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Used in the sequence classification and multiple choice models.</p>
<p>The dropout ratio to be used after the projection and activation.`,name:"summary_first_dropout"},{anchor:"transformers.XLMConfig.start_n_top",description:`<strong>start_n_top</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Used in the SQuAD evaluation script.`,name:"start_n_top"},{anchor:"transformers.XLMConfig.end_n_top",description:`<strong>end_n_top</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Used in the SQuAD evaluation script.`,name:"end_n_top"},{anchor:"transformers.XLMConfig.mask_token_id",description:`<strong>mask_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Model agnostic parameter to identify masked tokens when generating text in an MLM context.`,name:"mask_token_id"},{anchor:"transformers.XLMConfig.lang_id",description:`<strong>lang_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The ID of the language used by the model. This parameter is used when generating text in a given language.`,name:"lang_id"}]}}),hn=new Se({props:{code:`from transformers import XLMConfig, XLMModel

# Initializing a XLM configuration
configuration = XLMConfig()

# Initializing a model from the configuration
model = XLMModel(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> XLMConfig, XLMModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMModel(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`}}),mn=new ze({}),un=new Y({props:{name:"class transformers.XLMTokenizer",anchor:"transformers.XLMTokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"unk_token",val:" = '<unk>'"},{name:"bos_token",val:" = '<s>'"},{name:"sep_token",val:" = '</s>'"},{name:"pad_token",val:" = '<pad>'"},{name:"cls_token",val:" = '</s>'"},{name:"mask_token",val:" = '<special1>'"},{name:"additional_special_tokens",val:" = ['<special0>', '<special1>', '<special2>', '<special3>', '<special4>', '<special5>', '<special6>', '<special7>', '<special8>', '<special9>']"},{name:"lang2id",val:" = None"},{name:"id2lang",val:" = None"},{name:"do_lowercase_and_remove_accent",val:" = True"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/tokenization_xlm.py#L530",parametersDescription:[{anchor:"transformers.XLMTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Vocabulary file.`,name:"vocab_file"},{anchor:"transformers.XLMTokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Merges file.`,name:"merges_file"},{anchor:"transformers.XLMTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.XLMTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the beginning of
sequence. The token used is the <code>cls_token</code>.</p>

					</div>`,name:"bos_token"},{anchor:"transformers.XLMTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.XLMTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.XLMTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.XLMTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;special1&gt;&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.XLMTokenizer.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>, defaults to <code>[&quot;&lt;special0&gt;&quot;,&quot;&lt;special1&gt;&quot;,&quot;&lt;special2&gt;&quot;,&quot;&lt;special3&gt;&quot;,&quot;&lt;special4&gt;&quot;,&quot;&lt;special5&gt;&quot;,&quot;&lt;special6&gt;&quot;,&quot;&lt;special7&gt;&quot;,&quot;&lt;special8&gt;&quot;,&quot;&lt;special9&gt;&quot;]</code>) &#x2014;
List of additional special tokens.`,name:"additional_special_tokens"},{anchor:"transformers.XLMTokenizer.lang2id",description:`<strong>lang2id</strong> (<code>Dict[str, int]</code>, <em>optional</em>) &#x2014;
Dictionary mapping languages string identifiers to their IDs.`,name:"lang2id"},{anchor:"transformers.XLMTokenizer.id2lang",description:`<strong>id2lang</strong> (<code>Dict[int, str]</code>, <em>optional</em>) &#x2014;
Dictionary mapping language IDs to their string identifiers.`,name:"id2lang"},{anchor:"transformers.XLMTokenizer.do_lowercase_and_remove_accent",description:`<strong>do_lowercase_and_remove_accent</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to lowercase and remove accents when tokenizing.`,name:"do_lowercase_and_remove_accent"}]}}),vn=new Y({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.XLMTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/tokenization_xlm.py#L862",parametersDescription:[{anchor:"transformers.XLMTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.XLMTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Tn=new Y({props:{name:"get_special_tokens_mask",anchor:"transformers.XLMTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/tokenization_xlm.py#L889",parametersDescription:[{anchor:"transformers.XLMTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.XLMTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.XLMTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Mn=new Y({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.XLMTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/tokenization_xlm.py#L917",parametersDescription:[{anchor:"transformers.XLMTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.XLMTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),wn=new Se({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),yn=new Y({props:{name:"save_vocabulary",anchor:"transformers.XLMTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/tokenization_xlm.py#L946"}}),Ln=new ze({}),$n=new Y({props:{name:"class transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput",anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_top_log_probs",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_top_index",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_top_log_probs",val:": typing.Optional[torch.FloatTensor] = None"},{name:"end_top_index",val:": typing.Optional[torch.LongTensor] = None"},{name:"cls_logits",val:": typing.Optional[torch.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/xlm/modeling_xlm.py#L270",parametersDescription:[{anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned if both <code>start_positions</code> and <code>end_positions</code> are provided) &#x2014;
Classification loss as the sum of start token, end token (and is_impossible if provided) classification
losses.`,name:"loss"},{anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.start_top_log_probs",description:`<strong>start_top_log_probs</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.start_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) &#x2014;
Log probabilities for the top config.start_n_top start token possibilities (beam-search).`,name:"start_top_log_probs"},{anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.start_top_index",description:`<strong>start_top_index</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, config.start_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) &#x2014;
Indices for the top config.start_n_top start token possibilities (beam-search).`,name:"start_top_index"},{anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.end_top_log_probs",description:`<strong>end_top_log_probs</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.start_n_top * config.end_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) &#x2014;
Log probabilities for the top <code>config.start_n_top * config.end_n_top</code> end token possibilities
(beam-search).`,name:"end_top_log_probs"},{anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.end_top_index",description:`<strong>end_top_index</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, config.start_n_top * config.end_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) &#x2014;
Indices for the top <code>config.start_n_top * config.end_n_top</code> end token possibilities (beam-search).`,name:"end_top_index"},{anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.cls_logits",description:`<strong>cls_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) &#x2014;
Log probabilities for the <code>is_impossible</code> label of the answers.`,name:"cls_logits"},{anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.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.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.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"}]}}),Xn=new ze({}),xn=new Y({props:{name:"class transformers.XLMModel",anchor:"transformers.XLMModel",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/modeling_xlm.py#L401",parametersDescription:[{anchor:"transformers.XLMModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</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 Y({props:{name:"forward",anchor:"transformers.XLMModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"langs",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:"lengths",val:": typing.Optional[torch.Tensor] = None"},{name:"cache",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",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/xlm/modeling_xlm.py#L488",parametersDescription:[{anchor:"transformers.XLMModel.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/xlm#transformers.XLMTokenizer">XLMTokenizer</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.XLMModel.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.XLMModel.forward.langs",description:`<strong>langs</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.XLMModel.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.XLMModel.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.XLMModel.forward.lengths",description:`<strong>lengths</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.XLMModel.forward.cache",description:`<strong>cache</strong> (<code>Dict[str, torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.XLMModel.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.XLMModel.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.XLMModel.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.XLMModel.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.XLMModel.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.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</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/xlm#transformers.XLMConfig"
>XLMConfig</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>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.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fo=new xe({props:{$$slots:{default:[bT]},$$scope:{ctx:S}}}),jn=new Se({props:{code:`from transformers import XLMTokenizer, XLMModel
import torch

tokenizer = XLMTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMModel.from_pretrained("xlm-mlm-en-2048")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = XLMTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMModel.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&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`}}),Pn=new ze({}),An=new Y({props:{name:"class transformers.XLMWithLMHeadModel",anchor:"transformers.XLMWithLMHeadModel",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/modeling_xlm.py#L681",parametersDescription:[{anchor:"transformers.XLMWithLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</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"}]}}),In=new Y({props:{name:"forward",anchor:"transformers.XLMWithLMHeadModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"langs",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:"lengths",val:": typing.Optional[torch.Tensor] = None"},{name:"cache",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = 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/xlm/modeling_xlm.py#L709",parametersDescription:[{anchor:"transformers.XLMWithLMHeadModel.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/xlm#transformers.XLMTokenizer">XLMTokenizer</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.XLMWithLMHeadModel.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.XLMWithLMHeadModel.forward.langs",description:`<strong>langs</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.XLMWithLMHeadModel.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.XLMWithLMHeadModel.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.XLMWithLMHeadModel.forward.lengths",description:`<strong>lengths</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.XLMWithLMHeadModel.forward.cache",description:`<strong>cache</strong> (<code>Dict[str, torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.XLMWithLMHeadModel.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.XLMWithLMHeadModel.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.XLMWithLMHeadModel.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.XLMWithLMHeadModel.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.XLMWithLMHeadModel.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.XLMWithLMHeadModel.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for language modeling. Note that the labels <strong>are shifted</strong> inside the model, i.e. you can set
<code>labels = input_ids</code> Indices are selected in <code>[-100, 0, ..., config.vocab_size]</code> All labels set to <code>-100</code>
are ignored (masked), the loss is only computed for 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/xlm#transformers.XLMConfig"
>XLMConfig</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>
`}}),xo=new xe({props:{$$slots:{default:[MT]},$$scope:{ctx:S}}}),Dn=new Se({props:{code:`from transformers import XLMTokenizer, XLMWithLMHeadModel
import torch

tokenizer = XLMTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMWithLMHeadModel.from_pretrained("xlm-mlm-en-2048")

inputs = tokenizer("The capital of France is <special1>.", 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> XLMTokenizer, XLMWithLMHeadModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = XLMTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMWithLMHeadModel.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is &lt;special1&gt;.&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`}}),Wn=new ze({}),Hn=new Y({props:{name:"class transformers.XLMForSequenceClassification",anchor:"transformers.XLMForSequenceClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/modeling_xlm.py#L777",parametersDescription:[{anchor:"transformers.XLMForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</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"}]}}),Rn=new Y({props:{name:"forward",anchor:"transformers.XLMForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"langs",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:"lengths",val:": typing.Optional[torch.Tensor] = None"},{name:"cache",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = 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/xlm/modeling_xlm.py#L789",parametersDescription:[{anchor:"transformers.XLMForSequenceClassification.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/xlm#transformers.XLMTokenizer">XLMTokenizer</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.XLMForSequenceClassification.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.XLMForSequenceClassification.forward.langs",description:`<strong>langs</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.XLMForSequenceClassification.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.XLMForSequenceClassification.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.XLMForSequenceClassification.forward.lengths",description:`<strong>lengths</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.XLMForSequenceClassification.forward.cache",description:`<strong>cache</strong> (<code>Dict[str, torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.XLMForSequenceClassification.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.XLMForSequenceClassification.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.XLMForSequenceClassification.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.XLMForSequenceClassification.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.XLMForSequenceClassification.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.XLMForSequenceClassification.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/xlm#transformers.XLMConfig"
>XLMConfig</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>
`}}),zo=new xe({props:{$$slots:{default:[wT]},$$scope:{ctx:S}}}),Vn=new Se({props:{code:`import torch
from transformers import XLMTokenizer, XLMForSequenceClassification

torch.manual_seed(0)
tokenizer = XLMTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMForSequenceClassification.from_pretrained("xlm-mlm-en-2048", 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> XLMTokenizer, XLMForSequenceClassification

<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 = XLMTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&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)
`}}),Gn=new Se({props:{code:`import torch
from transformers import XLMTokenizer, XLMForSequenceClassification

torch.manual_seed(0)
tokenizer = XLMTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMForSequenceClassification.from_pretrained("xlm-mlm-en-2048", 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> XLMTokenizer, XLMForSequenceClassification

<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 = XLMTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&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)
`}}),Kn=new ze({}),Jn=new Y({props:{name:"class transformers.XLMForMultipleChoice",anchor:"transformers.XLMForMultipleChoice",parameters:[{name:"config",val:""},{name:"*inputs",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/modeling_xlm.py#L1191",parametersDescription:[{anchor:"transformers.XLMForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</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 Y({props:{name:"forward",anchor:"transformers.XLMForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"langs",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:"lengths",val:": typing.Optional[torch.Tensor] = None"},{name:"cache",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = 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/xlm/modeling_xlm.py#L1202",parametersDescription:[{anchor:"transformers.XLMForMultipleChoice.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/xlm#transformers.XLMTokenizer">XLMTokenizer</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.XLMForMultipleChoice.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.XLMForMultipleChoice.forward.langs",description:`<strong>langs</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.XLMForMultipleChoice.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.XLMForMultipleChoice.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.XLMForMultipleChoice.forward.lengths",description:`<strong>lengths</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.XLMForMultipleChoice.forward.cache",description:`<strong>cache</strong> (<code>Dict[str, torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.XLMForMultipleChoice.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.XLMForMultipleChoice.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.XLMForMultipleChoice.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.XLMForMultipleChoice.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.XLMForMultipleChoice.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.XLMForMultipleChoice.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/xlm#transformers.XLMConfig"
>XLMConfig</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>
`}}),Co=new xe({props:{$$slots:{default:[yT]},$$scope:{ctx:S}}}),os=new Se({props:{code:`from transformers import XLMTokenizer, XLMForMultipleChoice
import torch

tokenizer = XLMTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMForMultipleChoice.from_pretrained("xlm-mlm-en-2048")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = XLMTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&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`}}),ns=new ze({}),ss=new Y({props:{name:"class transformers.XLMForTokenClassification",anchor:"transformers.XLMForTokenClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/modeling_xlm.py#L1106",parametersDescription:[{anchor:"transformers.XLMForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</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"}]}}),ls=new Y({props:{name:"forward",anchor:"transformers.XLMForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"langs",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:"lengths",val:": typing.Optional[torch.Tensor] = None"},{name:"cache",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = 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/xlm/modeling_xlm.py#L1118",parametersDescription:[{anchor:"transformers.XLMForTokenClassification.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/xlm#transformers.XLMTokenizer">XLMTokenizer</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.XLMForTokenClassification.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.XLMForTokenClassification.forward.langs",description:`<strong>langs</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.XLMForTokenClassification.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.XLMForTokenClassification.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.XLMForTokenClassification.forward.lengths",description:`<strong>lengths</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.XLMForTokenClassification.forward.cache",description:`<strong>cache</strong> (<code>Dict[str, torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.XLMForTokenClassification.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.XLMForTokenClassification.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.XLMForTokenClassification.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.XLMForTokenClassification.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.XLMForTokenClassification.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.XLMForTokenClassification.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/xlm#transformers.XLMConfig"
>XLMConfig</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>
`}}),Po=new xe({props:{$$slots:{default:[LT]},$$scope:{ctx:S}}}),ds=new Se({props:{code:`from transformers import XLMTokenizer, XLMForTokenClassification
import torch

tokenizer = XLMTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMForTokenClassification.from_pretrained("xlm-mlm-en-2048")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = XLMTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMForTokenClassification.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&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`}}),cs=new ze({}),ps=new Y({props:{name:"class transformers.XLMForQuestionAnsweringSimple",anchor:"transformers.XLMForQuestionAnsweringSimple",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/modeling_xlm.py#L880",parametersDescription:[{anchor:"transformers.XLMForQuestionAnsweringSimple.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</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"}]}}),fs=new Y({props:{name:"forward",anchor:"transformers.XLMForQuestionAnsweringSimple.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"langs",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:"lengths",val:": typing.Optional[torch.Tensor] = None"},{name:"cache",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = 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/xlm/modeling_xlm.py#L890",parametersDescription:[{anchor:"transformers.XLMForQuestionAnsweringSimple.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/xlm#transformers.XLMTokenizer">XLMTokenizer</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.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.forward.langs",description:`<strong>langs</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.forward.lengths",description:`<strong>lengths</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.XLMForQuestionAnsweringSimple.forward.cache",description:`<strong>cache</strong> (<code>Dict[str, torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.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/xlm#transformers.XLMConfig"
>XLMConfig</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>
`}}),Oo=new xe({props:{$$slots:{default:[$T]},$$scope:{ctx:S}}}),gs=new Se({props:{code:`from transformers import XLMTokenizer, XLMForQuestionAnsweringSimple
import torch

torch.manual_seed(0)
tokenizer = XLMTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMForQuestionAnsweringSimple.from_pretrained("xlm-mlm-en-2048")

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> XLMTokenizer, XLMForQuestionAnsweringSimple
<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 = XLMTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMForQuestionAnsweringSimple.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&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)
`}}),_s=new ze({}),vs=new Y({props:{name:"class transformers.XLMForQuestionAnswering",anchor:"transformers.XLMForQuestionAnswering",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/modeling_xlm.py#L985",parametersDescription:[{anchor:"transformers.XLMForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</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"}]}}),Ms=new Y({props:{name:"forward",anchor:"transformers.XLMForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"langs",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:"lengths",val:": typing.Optional[torch.Tensor] = None"},{name:"cache",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = 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:"is_impossible",val:": typing.Optional[torch.Tensor] = None"},{name:"cls_index",val:": typing.Optional[torch.Tensor] = None"},{name:"p_mask",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/xlm/modeling_xlm.py#L995",parametersDescription:[{anchor:"transformers.XLMForQuestionAnswering.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/xlm#transformers.XLMTokenizer">XLMTokenizer</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.XLMForQuestionAnswering.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.XLMForQuestionAnswering.forward.langs",description:`<strong>langs</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.XLMForQuestionAnswering.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.XLMForQuestionAnswering.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.XLMForQuestionAnswering.forward.lengths",description:`<strong>lengths</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.XLMForQuestionAnswering.forward.cache",description:`<strong>cache</strong> (<code>Dict[str, torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.XLMForQuestionAnswering.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.XLMForQuestionAnswering.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.XLMForQuestionAnswering.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.XLMForQuestionAnswering.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.XLMForQuestionAnswering.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.XLMForQuestionAnswering.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.XLMForQuestionAnswering.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"},{anchor:"transformers.XLMForQuestionAnswering.forward.is_impossible",description:`<strong>is_impossible</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels whether a question has an answer or no answer (SQuAD 2.0)`,name:"is_impossible"},{anchor:"transformers.XLMForQuestionAnswering.forward.cls_index",description:`<strong>cls_index</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the classification token to use as input for computing plausibility of the
answer.`,name:"cls_index"},{anchor:"transformers.XLMForQuestionAnswering.forward.p_mask",description:`<strong>p_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Optional mask of tokens which can&#x2019;t be in answers (e.g. [CLS], [PAD], &#x2026;). 1.0 means token should be
masked. 0.0 mean token is not masked.`,name:"p_mask"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput"
>transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput</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/xlm#transformers.XLMConfig"
>XLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned if both <code>start_positions</code> and <code>end_positions</code> are provided) \u2014 Classification loss as the sum of start token, end token (and is_impossible if provided) classification
losses.</p>
</li>
<li>
<p><strong>start_top_log_probs</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.start_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) \u2014 Log probabilities for the top config.start_n_top start token possibilities (beam-search).</p>
</li>
<li>
<p><strong>start_top_index</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, config.start_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) \u2014 Indices for the top config.start_n_top start token possibilities (beam-search).</p>
</li>
<li>
<p><strong>end_top_log_probs</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.start_n_top * config.end_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) \u2014 Log probabilities for the top <code>config.start_n_top * config.end_n_top</code> end token possibilities
(beam-search).</p>
</li>
<li>
<p><strong>end_top_index</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, config.start_n_top * config.end_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) \u2014 Indices for the top <code>config.start_n_top * config.end_n_top</code> end token possibilities (beam-search).</p>
</li>
<li>
<p><strong>cls_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) \u2014 Log probabilities for the <code>is_impossible</code> label of the answers.</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/xlm#transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput"
>transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),So=new xe({props:{$$slots:{default:[FT]},$$scope:{ctx:S}}}),ws=new Se({props:{code:`from transformers import XLMTokenizer, XLMForQuestionAnswering
import torch

tokenizer = XLMTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMForQuestionAnswering.from_pretrained("xlm-mlm-en-2048")

input_ids = torch.tensor(tokenizer.encode("Hello, my dog is cute", add_special_tokens=True)).unsqueeze(
    0
)  # Batch size 1
start_positions = torch.tensor([1])
end_positions = torch.tensor([3])

outputs = model(input_ids, start_positions=start_positions, end_positions=end_positions)
loss = outputs.loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> XLMTokenizer, XLMForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = XLMTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&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>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(input_ids, start_positions=start_positions, end_positions=end_positions)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),ys=new ze({}),Ls=new Y({props:{name:"class transformers.TFXLMModel",anchor:"transformers.TFXLMModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/modeling_tf_xlm.py#L699",parametersDescription:[{anchor:"transformers.TFXLMModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</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"}]}}),Do=new xe({props:{$$slots:{default:[XT]},$$scope:{ctx:S}}}),xs=new Y({props:{name:"call",anchor:"transformers.TFXLMModel.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"langs",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"lengths",val:" = None"},{name:"cache",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/xlm/modeling_tf_xlm.py#L704",parametersDescription:[{anchor:"transformers.TFXLMModel.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/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLMModel.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.TFXLMModel.call.langs",description:`<strong>langs</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.TFXLMModel.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.TFXLMModel.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.TFXLMModel.call.lengths",description:`<strong>lengths</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.TFXLMModel.call.cache",description:`<strong>cache</strong> (<code>Dict[str, tf.Tensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.TFXLMModel.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.TFXLMModel.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.TFXLMModel.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.TFXLMModel.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.TFXLMModel.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.TFXLMModel.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.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</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/xlm#transformers.XLMConfig"
>XLMConfig</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>hidden_states</strong> (<code>tuple(tf.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>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.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Wo=new xe({props:{$$slots:{default:[xT]},$$scope:{ctx:S}}}),Es=new Se({props:{code:`from transformers import XLMTokenizer, TFXLMModel
import tensorflow as tf

tokenizer = XLMTokenizer.from_pretrained("xlm-mlm-en-2048")
model = TFXLMModel.from_pretrained("xlm-mlm-en-2048")

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> XLMTokenizer, TFXLMModel
<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 = XLMTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLMModel.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&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`}}),zs=new ze({}),qs=new Y({props:{name:"class transformers.TFXLMWithLMHeadModel",anchor:"transformers.TFXLMWithLMHeadModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/modeling_tf_xlm.py#L830",parametersDescription:[{anchor:"transformers.TFXLMWithLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</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"}]}}),Qo=new xe({props:{$$slots:{default:[ET]},$$scope:{ctx:S}}}),As=new Y({props:{name:"call",anchor:"transformers.TFXLMWithLMHeadModel.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"langs",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"lengths",val:" = None"},{name:"cache",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/xlm/modeling_tf_xlm.py#L857",parametersDescription:[{anchor:"transformers.TFXLMWithLMHeadModel.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/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLMWithLMHeadModel.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.TFXLMWithLMHeadModel.call.langs",description:`<strong>langs</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.TFXLMWithLMHeadModel.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.TFXLMWithLMHeadModel.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.TFXLMWithLMHeadModel.call.lengths",description:`<strong>lengths</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.TFXLMWithLMHeadModel.call.cache",description:`<strong>cache</strong> (<code>Dict[str, tf.Tensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.TFXLMWithLMHeadModel.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.TFXLMWithLMHeadModel.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.TFXLMWithLMHeadModel.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.TFXLMWithLMHeadModel.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.TFXLMWithLMHeadModel.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.TFXLMWithLMHeadModel.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 <code>transformers.models.xlm.modeling_tf_xlm.TFXLMWithLMHeadModelOutput</code>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/xlm#transformers.XLMConfig"
>XLMConfig</a>) and inputs.</p>
<ul>
<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><code>transformers.models.xlm.modeling_tf_xlm.TFXLMWithLMHeadModelOutput</code>or <code>tuple(tf.Tensor)</code></p>
`}}),Bo=new xe({props:{$$slots:{default:[zT]},$$scope:{ctx:S}}}),Os=new Se({props:{code:`from transformers import XLMTokenizer, TFXLMWithLMHeadModel
import tensorflow as tf

tokenizer = XLMTokenizer.from_pretrained("xlm-mlm-en-2048")
model = TFXLMWithLMHeadModel.from_pretrained("xlm-mlm-en-2048")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
outputs = model(inputs)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> XLMTokenizer, TFXLMWithLMHeadModel
<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 = XLMTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLMWithLMHeadModel.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),Ns=new ze({}),Ss=new Y({props:{name:"class transformers.TFXLMForSequenceClassification",anchor:"transformers.TFXLMForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/modeling_tf_xlm.py#L939",parametersDescription:[{anchor:"transformers.TFXLMForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</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"}]}}),Ro=new xe({props:{$$slots:{default:[qT]},$$scope:{ctx:S}}}),Hs=new Y({props:{name:"call",anchor:"transformers.TFXLMForSequenceClassification.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"langs",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"lengths",val:" = None"},{name:"cache",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/xlm/modeling_tf_xlm.py#L947",parametersDescription:[{anchor:"transformers.TFXLMForSequenceClassification.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/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLMForSequenceClassification.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.TFXLMForSequenceClassification.call.langs",description:`<strong>langs</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.TFXLMForSequenceClassification.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.TFXLMForSequenceClassification.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.TFXLMForSequenceClassification.call.lengths",description:`<strong>lengths</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.TFXLMForSequenceClassification.call.cache",description:`<strong>cache</strong> (<code>Dict[str, tf.Tensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.TFXLMForSequenceClassification.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.TFXLMForSequenceClassification.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.TFXLMForSequenceClassification.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.TFXLMForSequenceClassification.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.TFXLMForSequenceClassification.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.TFXLMForSequenceClassification.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.TFXLMForSequenceClassification.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/xlm#transformers.XLMConfig"
>XLMConfig</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>
`}}),Vo=new xe({props:{$$slots:{default:[CT]},$$scope:{ctx:S}}}),Qs=new Se({props:{code:`from transformers import XLMTokenizer, TFXLMForSequenceClassification
import tensorflow as tf

tokenizer = XLMTokenizer.from_pretrained("xlm-mlm-en-2048")
model = TFXLMForSequenceClassification.from_pretrained("xlm-mlm-en-2048")

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> XLMTokenizer, TFXLMForSequenceClassification
<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 = XLMTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLMForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&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`}}),Bs=new ze({}),Us=new Y({props:{name:"class transformers.TFXLMForMultipleChoice",anchor:"transformers.TFXLMForMultipleChoice",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/modeling_tf_xlm.py#L1044",parametersDescription:[{anchor:"transformers.TFXLMForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</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"}]}}),Ko=new xe({props:{$$slots:{default:[jT]},$$scope:{ctx:S}}}),Ks=new Y({props:{name:"call",anchor:"transformers.TFXLMForMultipleChoice.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"langs",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"lengths",val:" = None"},{name:"cache",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/xlm/modeling_tf_xlm.py#L1073",parametersDescription:[{anchor:"transformers.TFXLMForMultipleChoice.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/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLMForMultipleChoice.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.TFXLMForMultipleChoice.call.langs",description:`<strong>langs</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.TFXLMForMultipleChoice.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.TFXLMForMultipleChoice.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.TFXLMForMultipleChoice.call.lengths",description:`<strong>lengths</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.TFXLMForMultipleChoice.call.cache",description:`<strong>cache</strong> (<code>Dict[str, tf.Tensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.TFXLMForMultipleChoice.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.TFXLMForMultipleChoice.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.TFXLMForMultipleChoice.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.TFXLMForMultipleChoice.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.TFXLMForMultipleChoice.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.TFXLMForMultipleChoice.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.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/xlm#transformers.XLMConfig"
>XLMConfig</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>
`}}),Jo=new xe({props:{$$slots:{default:[PT]},$$scope:{ctx:S}}}),Js=new Se({props:{code:`from transformers import XLMTokenizer, TFXLMForMultipleChoice
import tensorflow as tf

tokenizer = XLMTokenizer.from_pretrained("xlm-mlm-en-2048")
model = TFXLMForMultipleChoice.from_pretrained("xlm-mlm-en-2048")

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> XLMTokenizer, TFXLMForMultipleChoice
<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 = XLMTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLMForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&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`}}),Ys=new ze({}),Zs=new Y({props:{name:"class transformers.TFXLMForTokenClassification",anchor:"transformers.TFXLMForTokenClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/modeling_tf_xlm.py#L1212",parametersDescription:[{anchor:"transformers.TFXLMForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</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"}]}}),Zo=new xe({props:{$$slots:{default:[AT]},$$scope:{ctx:S}}}),na=new Y({props:{name:"call",anchor:"transformers.TFXLMForTokenClassification.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"langs",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"lengths",val:" = None"},{name:"cache",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/xlm/modeling_tf_xlm.py#L1223",parametersDescription:[{anchor:"transformers.TFXLMForTokenClassification.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/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLMForTokenClassification.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.TFXLMForTokenClassification.call.langs",description:`<strong>langs</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.TFXLMForTokenClassification.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.TFXLMForTokenClassification.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.TFXLMForTokenClassification.call.lengths",description:`<strong>lengths</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.TFXLMForTokenClassification.call.cache",description:`<strong>cache</strong> (<code>Dict[str, tf.Tensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.TFXLMForTokenClassification.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.TFXLMForTokenClassification.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.TFXLMForTokenClassification.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.TFXLMForTokenClassification.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.TFXLMForTokenClassification.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.TFXLMForTokenClassification.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.TFXLMForTokenClassification.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/xlm#transformers.XLMConfig"
>XLMConfig</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>
`}}),en=new xe({props:{$$slots:{default:[OT]},$$scope:{ctx:S}}}),sa=new Se({props:{code:`from transformers import XLMTokenizer, TFXLMForTokenClassification
import tensorflow as tf

tokenizer = XLMTokenizer.from_pretrained("xlm-mlm-en-2048")
model = TFXLMForTokenClassification.from_pretrained("xlm-mlm-en-2048")

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> XLMTokenizer, TFXLMForTokenClassification
<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 = XLMTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLMForTokenClassification.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&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`}}),aa=new ze({}),ra=new Y({props:{name:"class transformers.TFXLMForQuestionAnsweringSimple",anchor:"transformers.TFXLMForQuestionAnsweringSimple",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/xlm/modeling_tf_xlm.py#L1319",parametersDescription:[{anchor:"transformers.TFXLMForQuestionAnsweringSimple.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</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"}]}}),on=new xe({props:{$$slots:{default:[NT]},$$scope:{ctx:S}}}),ca=new Y({props:{name:"call",anchor:"transformers.TFXLMForQuestionAnsweringSimple.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"langs",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"lengths",val:" = None"},{name:"cache",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/xlm/modeling_tf_xlm.py#L1327",parametersDescription:[{anchor:"transformers.TFXLMForQuestionAnsweringSimple.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/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLMForQuestionAnsweringSimple.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.TFXLMForQuestionAnsweringSimple.call.langs",description:`<strong>langs</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.TFXLMForQuestionAnsweringSimple.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.TFXLMForQuestionAnsweringSimple.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.TFXLMForQuestionAnsweringSimple.call.lengths",description:`<strong>lengths</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.TFXLMForQuestionAnsweringSimple.call.cache",description:`<strong>cache</strong> (<code>Dict[str, tf.Tensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.TFXLMForQuestionAnsweringSimple.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.TFXLMForQuestionAnsweringSimple.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.TFXLMForQuestionAnsweringSimple.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.TFXLMForQuestionAnsweringSimple.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.TFXLMForQuestionAnsweringSimple.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.TFXLMForQuestionAnsweringSimple.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.TFXLMForQuestionAnsweringSimple.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.TFXLMForQuestionAnsweringSimple.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/xlm#transformers.XLMConfig"
>XLMConfig</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>
`}}),nn=new xe({props:{$$slots:{default:[ST]},$$scope:{ctx:S}}}),pa=new Se({props:{code:`from transformers import XLMTokenizer, TFXLMForQuestionAnsweringSimple
import tensorflow as tf

tokenizer = XLMTokenizer.from_pretrained("xlm-mlm-en-2048")
model = TFXLMForQuestionAnsweringSimple.from_pretrained("xlm-mlm-en-2048")

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> XLMTokenizer, TFXLMForQuestionAnsweringSimple
<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 = XLMTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLMForQuestionAnsweringSimple.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&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=a("meta"),F=l(),f=a("h1"),_=a("a"),k=a("span"),b(v.$$.fragment),g=l(),X=a("span"),de=n("XLM"),G=l(),x=a("h2"),Z=a("a"),I=a("span"),b(ee.$$.fragment),ce=l(),D=a("span"),pe=n("Overview"),re=l(),R=a("p"),j=n("The XLM model was proposed in "),te=a("a"),J=n("Cross-lingual Language Model Pretraining"),E=n(` by
Guillaume Lample, Alexis Conneau. It\u2019s a transformer pretrained using one of the following objectives:`),q=l(),K=a("ul"),W=a("li"),he=n("a causal language modeling (CLM) objective (next token prediction),"),me=l(),H=a("li"),ue=n("a masked language modeling (MLM) objective (BERT-like), or"),fe=l(),z=a("li"),ge=n("a Translation Language Modeling (TLM) object (extension of BERT\u2019s MLM to multiple language inputs)"),Q=l(),ne=a("p"),_e=n("The abstract from the paper is the following:"),B=l(),se=a("p"),ae=a("em"),P=n(`Recent studies have demonstrated the efficiency of generative pretraining for English natural language understanding.
In this work, we extend this approach to multiple languages and show the effectiveness of cross-lingual pretraining. We
propose two methods to learn cross-lingual language models (XLMs): one unsupervised that only relies on monolingual
data, and one supervised that leverages parallel data with a new cross-lingual language model objective. We obtain
state-of-the-art results on cross-lingual classification, unsupervised and supervised machine translation. On XNLI, our
approach pushes the state of the art by an absolute gain of 4.9% accuracy. On unsupervised machine translation, we
obtain 34.3 BLEU on WMT\u201916 German-English, improving the previous state of the art by more than 9 BLEU. On supervised
machine translation, we obtain a new state of the art of 38.5 BLEU on WMT\u201916 Romanian-English, outperforming the
previous best approach by more than 4 BLEU. Our code and pretrained models will be made publicly available.`),ie=l(),O=a("p"),ve=n("Tips:"),c=l(),T=a("ul"),V=a("li"),Te=n(`XLM has many different checkpoints, which were trained using different objectives: CLM, MLM or TLM. Make sure to
select the correct objective for your task (e.g. MLM checkpoints are not suitable for generation).`),be=l(),C=a("li"),Me=n("XLM has multilingual checkpoints which leverage a specific "),ke=a("code"),we=n("lang"),A=n(" parameter. Check out the "),N=a("a"),ye=n("multi-lingual"),Le=n(" page for more information."),U=l(),le=a("p"),$e=n("This model was contributed by "),oe=a("a"),Fe=n("thomwolf"),Bd=n(". The original code can be found "),ln=a("a"),Ud=n("here"),Rd=n("."),gl=l(),St=a("h2"),Mo=a("a"),_r=a("span"),b(dn.$$.fragment),Vd=l(),vr=a("span"),Gd=n("XLMConfig"),_l=l(),Ie=a("div"),b(cn.$$.fragment),Kd=l(),gt=a("p"),Jd=n("This is the configuration class to store the configuration of a "),ga=a("a"),Yd=n("XLMModel"),Zd=n(" or a "),_a=a("a"),ec=n("TFXLMModel"),tc=n(`. It is used to
instantiate a XLM model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the
`),pn=a("a"),oc=n("xlm-mlm-en-2048"),nc=n(" architecture."),sc=l(),It=a("p"),ac=n("Configuration objects inherit from "),va=a("a"),rc=n("PretrainedConfig"),ic=n(` and can be used to control the model outputs. Read the
documentation from `),ka=a("a"),lc=n("PretrainedConfig"),dc=n(" for more information."),cc=l(),kr=a("p"),pc=n("Examples:"),hc=l(),b(hn.$$.fragment),vl=l(),Dt=a("h2"),wo=a("a"),Tr=a("span"),b(mn.$$.fragment),mc=l(),br=a("span"),uc=n("XLMTokenizer"),kl=l(),Xe=a("div"),b(un.$$.fragment),fc=l(),Mr=a("p"),gc=n("Construct an XLM tokenizer. Based on Byte-Pair Encoding. The tokenization process is the following:"),_c=l(),De=a("ul"),wr=a("li"),vc=n("Moses preprocessing and tokenization for most supported languages."),kc=l(),yr=a("li"),Tc=n("Language specific tokenization for Chinese (Jieba), Japanese (KyTea) and Thai (PyThaiNLP)."),bc=l(),Lr=a("li"),Mc=n("Optionally lowercases and normalizes all inputs text."),wc=l(),_t=a("li"),yc=n("The arguments "),$r=a("code"),Lc=n("special_tokens"),$c=n(" and the function "),Fr=a("code"),Fc=n("set_special_tokens"),Xc=n(`, can be used to add additional symbols (like
\u201D`),Xr=a("strong"),xc=n("classify"),Ec=n("\u201D) to a vocabulary."),zc=l(),fn=a("li"),qc=n("The "),xr=a("code"),Cc=n("lang2id"),jc=n(` attribute maps the languages supported by the model with their IDs if provided (automatically set
for pretrained vocabularies).`),Pc=l(),gn=a("li"),Ac=n("The "),Er=a("code"),Oc=n("id2lang"),Nc=n(" attributes does reverse mapping if provided (automatically set for pretrained vocabularies)."),Sc=l(),_n=a("p"),Ic=n("This tokenizer inherits from "),Ta=a("a"),Dc=n("PreTrainedTokenizer"),Wc=n(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Hc=l(),vt=a("div"),b(vn.$$.fragment),Qc=l(),zr=a("p"),Bc=n(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An XLM sequence has the following format:`),Uc=l(),kn=a("ul"),ba=a("li"),Rc=n("single sequence: "),qr=a("code"),Vc=n("<s> X </s>"),Gc=l(),Ma=a("li"),Kc=n("pair of sequences: "),Cr=a("code"),Jc=n("<s> A </s> B </s>"),Yc=l(),yo=a("div"),b(Tn.$$.fragment),Zc=l(),bn=a("p"),ep=n(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),jr=a("code"),tp=n("prepare_for_model"),op=n(" method."),np=l(),lt=a("div"),b(Mn.$$.fragment),sp=l(),Pr=a("p"),ap=n(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. An XLM sequence
pair mask has the following format:`),rp=l(),b(wn.$$.fragment),ip=l(),Wt=a("p"),lp=n("If "),Ar=a("code"),dp=n("token_ids_1"),cp=n(" is "),Or=a("code"),pp=n("None"),hp=n(", this method only returns the first portion of the mask (0s)."),mp=l(),wa=a("div"),b(yn.$$.fragment),Tl=l(),Ht=a("h2"),Lo=a("a"),Nr=a("span"),b(Ln.$$.fragment),up=l(),Sr=a("span"),fp=n("XLM specific outputs"),bl=l(),Qt=a("div"),b($n.$$.fragment),gp=l(),Fn=a("p"),_p=n("Base class for outputs of question answering models using a "),Ir=a("code"),vp=n("SquadHead"),kp=n("."),Ml=l(),Bt=a("h2"),$o=a("a"),Dr=a("span"),b(Xn.$$.fragment),Tp=l(),Wr=a("span"),bp=n("XLMModel"),wl=l(),We=a("div"),b(xn.$$.fragment),Mp=l(),Hr=a("p"),wp=n("The bare XLM Model transformer outputting raw hidden-states without any specific head on top."),yp=l(),En=a("p"),Lp=n("This model inherits from "),ya=a("a"),$p=n("PreTrainedModel"),Fp=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.)`),Xp=l(),zn=a("p"),xp=n("This model is also a PyTorch "),qn=a("a"),Ep=n("torch.nn.Module"),zp=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),qp=l(),Ge=a("div"),b(Cn.$$.fragment),Cp=l(),Ut=a("p"),jp=n("The "),La=a("a"),Pp=n("XLMModel"),Ap=n(" forward method, overrides the "),Qr=a("code"),Op=n("__call__"),Np=n(" special method."),Sp=l(),b(Fo.$$.fragment),Ip=l(),Br=a("p"),Dp=n("Example:"),Wp=l(),b(jn.$$.fragment),yl=l(),Rt=a("h2"),Xo=a("a"),Ur=a("span"),b(Pn.$$.fragment),Hp=l(),Rr=a("span"),Qp=n("XLMWithLMHeadModel"),Ll=l(),He=a("div"),b(An.$$.fragment),Bp=l(),Vr=a("p"),Up=n(`The XLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Rp=l(),On=a("p"),Vp=n("This model inherits from "),$a=a("a"),Gp=n("PreTrainedModel"),Kp=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.)`),Jp=l(),Nn=a("p"),Yp=n("This model is also a PyTorch "),Sn=a("a"),Zp=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.`),th=l(),Ke=a("div"),b(In.$$.fragment),oh=l(),Vt=a("p"),nh=n("The "),Fa=a("a"),sh=n("XLMWithLMHeadModel"),ah=n(" forward method, overrides the "),Gr=a("code"),rh=n("__call__"),ih=n(" special method."),lh=l(),b(xo.$$.fragment),dh=l(),Kr=a("p"),ch=n("Example:"),ph=l(),b(Dn.$$.fragment),$l=l(),Gt=a("h2"),Eo=a("a"),Jr=a("span"),b(Wn.$$.fragment),hh=l(),Yr=a("span"),mh=n("XLMForSequenceClassification"),Fl=l(),Qe=a("div"),b(Hn.$$.fragment),uh=l(),Zr=a("p"),fh=n(`XLM Model with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),gh=l(),Qn=a("p"),_h=n("This model inherits from "),Xa=a("a"),vh=n("PreTrainedModel"),kh=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.)`),Th=l(),Bn=a("p"),bh=n("This model is also a PyTorch "),Un=a("a"),Mh=n("torch.nn.Module"),wh=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),yh=l(),Ee=a("div"),b(Rn.$$.fragment),Lh=l(),Kt=a("p"),$h=n("The "),xa=a("a"),Fh=n("XLMForSequenceClassification"),Xh=n(" forward method, overrides the "),ei=a("code"),xh=n("__call__"),Eh=n(" special method."),zh=l(),b(zo.$$.fragment),qh=l(),ti=a("p"),Ch=n("Example of single-label classification:"),jh=l(),b(Vn.$$.fragment),Ph=l(),oi=a("p"),Ah=n("Example of multi-label classification:"),Oh=l(),b(Gn.$$.fragment),Xl=l(),Jt=a("h2"),qo=a("a"),ni=a("span"),b(Kn.$$.fragment),Nh=l(),si=a("span"),Sh=n("XLMForMultipleChoice"),xl=l(),Be=a("div"),b(Jn.$$.fragment),Ih=l(),ai=a("p"),Dh=n(`XLM 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.`),Wh=l(),Yn=a("p"),Hh=n("This model inherits from "),Ea=a("a"),Qh=n("PreTrainedModel"),Bh=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.)`),Uh=l(),Zn=a("p"),Rh=n("This model is also a PyTorch "),es=a("a"),Vh=n("torch.nn.Module"),Gh=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Kh=l(),Je=a("div"),b(ts.$$.fragment),Jh=l(),Yt=a("p"),Yh=n("The "),za=a("a"),Zh=n("XLMForMultipleChoice"),em=n(" forward method, overrides the "),ri=a("code"),tm=n("__call__"),om=n(" special method."),nm=l(),b(Co.$$.fragment),sm=l(),ii=a("p"),am=n("Example:"),rm=l(),b(os.$$.fragment),El=l(),Zt=a("h2"),jo=a("a"),li=a("span"),b(ns.$$.fragment),im=l(),di=a("span"),lm=n("XLMForTokenClassification"),zl=l(),Ue=a("div"),b(ss.$$.fragment),dm=l(),ci=a("p"),cm=n(`XLM 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.`),pm=l(),as=a("p"),hm=n("This model inherits from "),qa=a("a"),mm=n("PreTrainedModel"),um=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.)`),fm=l(),rs=a("p"),gm=n("This model is also a PyTorch "),is=a("a"),_m=n("torch.nn.Module"),vm=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),km=l(),Ye=a("div"),b(ls.$$.fragment),Tm=l(),eo=a("p"),bm=n("The "),Ca=a("a"),Mm=n("XLMForTokenClassification"),wm=n(" forward method, overrides the "),pi=a("code"),ym=n("__call__"),Lm=n(" special method."),$m=l(),b(Po.$$.fragment),Fm=l(),hi=a("p"),Xm=n("Example:"),xm=l(),b(ds.$$.fragment),ql=l(),to=a("h2"),Ao=a("a"),mi=a("span"),b(cs.$$.fragment),Em=l(),ui=a("span"),zm=n("XLMForQuestionAnsweringSimple"),Cl=l(),Re=a("div"),b(ps.$$.fragment),qm=l(),oo=a("p"),Cm=n(`XLM 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 `),fi=a("code"),jm=n("span start logits"),Pm=n(" and "),gi=a("code"),Am=n("span end logits"),Om=n(")."),Nm=l(),hs=a("p"),Sm=n("This model inherits from "),ja=a("a"),Im=n("PreTrainedModel"),Dm=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.)`),Wm=l(),ms=a("p"),Hm=n("This model is also a PyTorch "),us=a("a"),Qm=n("torch.nn.Module"),Bm=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Um=l(),Ze=a("div"),b(fs.$$.fragment),Rm=l(),no=a("p"),Vm=n("The "),Pa=a("a"),Gm=n("XLMForQuestionAnsweringSimple"),Km=n(" forward method, overrides the "),_i=a("code"),Jm=n("__call__"),Ym=n(" special method."),Zm=l(),b(Oo.$$.fragment),eu=l(),vi=a("p"),tu=n("Example:"),ou=l(),b(gs.$$.fragment),jl=l(),so=a("h2"),No=a("a"),ki=a("span"),b(_s.$$.fragment),nu=l(),Ti=a("span"),su=n("XLMForQuestionAnswering"),Pl=l(),Ve=a("div"),b(vs.$$.fragment),au=l(),ao=a("p"),ru=n(`XLM Model with a beam-search span classification head on top for extractive question-answering tasks like SQuAD (a
linear layers on top of the hidden-states output to compute `),bi=a("code"),iu=n("span start logits"),lu=n(" and "),Mi=a("code"),du=n("span end logits"),cu=n(")."),pu=l(),ks=a("p"),hu=n("This model inherits from "),Aa=a("a"),mu=n("PreTrainedModel"),uu=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.)`),fu=l(),Ts=a("p"),gu=n("This model is also a PyTorch "),bs=a("a"),_u=n("torch.nn.Module"),vu=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ku=l(),et=a("div"),b(Ms.$$.fragment),Tu=l(),ro=a("p"),bu=n("The "),Oa=a("a"),Mu=n("XLMForQuestionAnswering"),wu=n(" forward method, overrides the "),wi=a("code"),yu=n("__call__"),Lu=n(" special method."),$u=l(),b(So.$$.fragment),Fu=l(),yi=a("p"),Xu=n("Example:"),xu=l(),b(ws.$$.fragment),Al=l(),io=a("h2"),Io=a("a"),Li=a("span"),b(ys.$$.fragment),Eu=l(),$i=a("span"),zu=n("TFXLMModel"),Ol=l(),qe=a("div"),b(Ls.$$.fragment),qu=l(),Fi=a("p"),Cu=n("The bare XLM Model transformer outputting raw hidden-states without any specific head on top."),ju=l(),$s=a("p"),Pu=n("This model inherits from "),Na=a("a"),Au=n("TFPreTrainedModel"),Ou=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.)`),Nu=l(),Fs=a("p"),Su=n("This model is also a "),Xs=a("a"),Iu=n("tf.keras.Model"),Du=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.`),Wu=l(),b(Do.$$.fragment),Hu=l(),tt=a("div"),b(xs.$$.fragment),Qu=l(),lo=a("p"),Bu=n("The "),Sa=a("a"),Uu=n("TFXLMModel"),Ru=n(" forward method, overrides the "),Xi=a("code"),Vu=n("__call__"),Gu=n(" special method."),Ku=l(),b(Wo.$$.fragment),Ju=l(),xi=a("p"),Yu=n("Example:"),Zu=l(),b(Es.$$.fragment),Nl=l(),co=a("h2"),Ho=a("a"),Ei=a("span"),b(zs.$$.fragment),ef=l(),zi=a("span"),tf=n("TFXLMWithLMHeadModel"),Sl=l(),Ce=a("div"),b(qs.$$.fragment),of=l(),qi=a("p"),nf=n(`The XLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),sf=l(),Cs=a("p"),af=n("This model inherits from "),Ia=a("a"),rf=n("TFPreTrainedModel"),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.)`),df=l(),js=a("p"),cf=n("This model is also a "),Ps=a("a"),pf=n("tf.keras.Model"),hf=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.`),mf=l(),b(Qo.$$.fragment),uf=l(),ot=a("div"),b(As.$$.fragment),ff=l(),po=a("p"),gf=n("The "),Da=a("a"),_f=n("TFXLMWithLMHeadModel"),vf=n(" forward method, overrides the "),Ci=a("code"),kf=n("__call__"),Tf=n(" special method."),bf=l(),b(Bo.$$.fragment),Mf=l(),ji=a("p"),wf=n("Example:"),yf=l(),b(Os.$$.fragment),Il=l(),ho=a("h2"),Uo=a("a"),Pi=a("span"),b(Ns.$$.fragment),Lf=l(),Ai=a("span"),$f=n("TFXLMForSequenceClassification"),Dl=l(),je=a("div"),b(Ss.$$.fragment),Ff=l(),Oi=a("p"),Xf=n(`XLM Model with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),xf=l(),Is=a("p"),Ef=n("This model inherits from "),Wa=a("a"),zf=n("TFPreTrainedModel"),qf=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.)`),Cf=l(),Ds=a("p"),jf=n("This model is also a "),Ws=a("a"),Pf=n("tf.keras.Model"),Af=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.`),Of=l(),b(Ro.$$.fragment),Nf=l(),nt=a("div"),b(Hs.$$.fragment),Sf=l(),mo=a("p"),If=n("The "),Ha=a("a"),Df=n("TFXLMForSequenceClassification"),Wf=n(" forward method, overrides the "),Ni=a("code"),Hf=n("__call__"),Qf=n(" special method."),Bf=l(),b(Vo.$$.fragment),Uf=l(),Si=a("p"),Rf=n("Example:"),Vf=l(),b(Qs.$$.fragment),Wl=l(),uo=a("h2"),Go=a("a"),Ii=a("span"),b(Bs.$$.fragment),Gf=l(),Di=a("span"),Kf=n("TFXLMForMultipleChoice"),Hl=l(),Pe=a("div"),b(Us.$$.fragment),Jf=l(),Wi=a("p"),Yf=n(`XLM 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.`),Zf=l(),Rs=a("p"),eg=n("This model inherits from "),Qa=a("a"),tg=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.)`),ng=l(),Vs=a("p"),sg=n("This model is also a "),Gs=a("a"),ag=n("tf.keras.Model"),rg=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.`),ig=l(),b(Ko.$$.fragment),lg=l(),st=a("div"),b(Ks.$$.fragment),dg=l(),fo=a("p"),cg=n("The "),Ba=a("a"),pg=n("TFXLMForMultipleChoice"),hg=n(" forward method, overrides the "),Hi=a("code"),mg=n("__call__"),ug=n(" special method."),fg=l(),b(Jo.$$.fragment),gg=l(),Qi=a("p"),_g=n("Example:"),vg=l(),b(Js.$$.fragment),Ql=l(),go=a("h2"),Yo=a("a"),Bi=a("span"),b(Ys.$$.fragment),kg=l(),Ui=a("span"),Tg=n("TFXLMForTokenClassification"),Bl=l(),Ae=a("div"),b(Zs.$$.fragment),bg=l(),Ri=a("p"),Mg=n(`XLM 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.`),wg=l(),ea=a("p"),yg=n("This model inherits from "),Ua=a("a"),Lg=n("TFPreTrainedModel"),$g=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.)`),Fg=l(),ta=a("p"),Xg=n("This model is also a "),oa=a("a"),xg=n("tf.keras.Model"),Eg=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.`),zg=l(),b(Zo.$$.fragment),qg=l(),at=a("div"),b(na.$$.fragment),Cg=l(),_o=a("p"),jg=n("The "),Ra=a("a"),Pg=n("TFXLMForTokenClassification"),Ag=n(" forward method, overrides the "),Vi=a("code"),Og=n("__call__"),Ng=n(" special method."),Sg=l(),b(en.$$.fragment),Ig=l(),Gi=a("p"),Dg=n("Example:"),Wg=l(),b(sa.$$.fragment),Ul=l(),vo=a("h2"),tn=a("a"),Ki=a("span"),b(aa.$$.fragment),Hg=l(),Ji=a("span"),Qg=n("TFXLMForQuestionAnsweringSimple"),Rl=l(),Oe=a("div"),b(ra.$$.fragment),Bg=l(),ko=a("p"),Ug=n(`XLM Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear layer
on top of the hidden-states output to compute `),Yi=a("code"),Rg=n("span start logits"),Vg=n(" and "),Zi=a("code"),Gg=n("span end logits"),Kg=n(")."),Jg=l(),ia=a("p"),Yg=n("This model inherits from "),Va=a("a"),Zg=n("TFPreTrainedModel"),e_=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.)`),t_=l(),la=a("p"),o_=n("This model is also a "),da=a("a"),n_=n("tf.keras.Model"),s_=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.`),a_=l(),b(on.$$.fragment),r_=l(),rt=a("div"),b(ca.$$.fragment),i_=l(),To=a("p"),l_=n("The "),Ga=a("a"),d_=n("TFXLMForQuestionAnsweringSimple"),c_=n(" forward method, overrides the "),el=a("code"),p_=n("__call__"),h_=n(" special method."),m_=l(),b(nn.$$.fragment),u_=l(),tl=a("p"),f_=n("Example:"),g_=l(),b(pa.$$.fragment),this.h()},l(o){const u=TT('[data-svelte="svelte-1phssyn"]',document.head);h=r(u,"META",{name:!0,content:!0}),u.forEach(t),F=d(o),f=r(o,"H1",{class:!0});var ha=i(f);_=r(ha,"A",{id:!0,class:!0,href:!0});var ol=i(_);k=r(ol,"SPAN",{});var nl=i(k);M(v.$$.fragment,nl),nl.forEach(t),ol.forEach(t),g=d(ha),X=r(ha,"SPAN",{});var sl=i(X);de=s(sl,"XLM"),sl.forEach(t),ha.forEach(t),G=d(o),x=r(o,"H2",{class:!0});var ma=i(x);Z=r(ma,"A",{id:!0,class:!0,href:!0});var al=i(Z);I=r(al,"SPAN",{});var rl=i(I);M(ee.$$.fragment,rl),rl.forEach(t),al.forEach(t),ce=d(ma),D=r(ma,"SPAN",{});var il=i(D);pe=s(il,"Overview"),il.forEach(t),ma.forEach(t),re=d(o),R=r(o,"P",{});var ua=i(R);j=s(ua,"The XLM model was proposed in "),te=r(ua,"A",{href:!0,rel:!0});var ll=i(te);J=s(ll,"Cross-lingual Language Model Pretraining"),ll.forEach(t),E=s(ua,` by
Guillaume Lample, Alexis Conneau. It\u2019s a transformer pretrained using one of the following objectives:`),ua.forEach(t),q=d(o),K=r(o,"UL",{});var bo=i(K);W=r(bo,"LI",{});var dl=i(W);he=s(dl,"a causal language modeling (CLM) objective (next token prediction),"),dl.forEach(t),me=d(bo),H=r(bo,"LI",{});var cl=i(H);ue=s(cl,"a masked language modeling (MLM) objective (BERT-like), or"),cl.forEach(t),fe=d(bo),z=r(bo,"LI",{});var pl=i(z);ge=s(pl,"a Translation Language Modeling (TLM) object (extension of BERT\u2019s MLM to multiple language inputs)"),pl.forEach(t),bo.forEach(t),Q=d(o),ne=r(o,"P",{});var hl=i(ne);_e=s(hl,"The abstract from the paper is the following:"),hl.forEach(t),B=d(o),se=r(o,"P",{});var ml=i(se);ae=r(ml,"EM",{});var ul=i(ae);P=s(ul,`Recent studies have demonstrated the efficiency of generative pretraining for English natural language understanding.
In this work, we extend this approach to multiple languages and show the effectiveness of cross-lingual pretraining. We
propose two methods to learn cross-lingual language models (XLMs): one unsupervised that only relies on monolingual
data, and one supervised that leverages parallel data with a new cross-lingual language model objective. We obtain
state-of-the-art results on cross-lingual classification, unsupervised and supervised machine translation. On XNLI, our
approach pushes the state of the art by an absolute gain of 4.9% accuracy. On unsupervised machine translation, we
obtain 34.3 BLEU on WMT\u201916 German-English, improving the previous state of the art by more than 9 BLEU. On supervised
machine translation, we obtain a new state of the art of 38.5 BLEU on WMT\u201916 Romanian-English, outperforming the
previous best approach by more than 4 BLEU. Our code and pretrained models will be made publicly available.`),ul.forEach(t),ml.forEach(t),ie=d(o),O=r(o,"P",{});var fl=i(O);ve=s(fl,"Tips:"),fl.forEach(t),c=d(o),T=r(o,"UL",{});var fa=i(T);V=r(fa,"LI",{});var k_=i(V);Te=s(k_,`XLM has many different checkpoints, which were trained using different objectives: CLM, MLM or TLM. Make sure to
select the correct objective for your task (e.g. MLM checkpoints are not suitable for generation).`),k_.forEach(t),be=d(fa),C=r(fa,"LI",{});var Ka=i(C);Me=s(Ka,"XLM has multilingual checkpoints which leverage a specific "),ke=r(Ka,"CODE",{});var T_=i(ke);we=s(T_,"lang"),T_.forEach(t),A=s(Ka," parameter. Check out the "),N=r(Ka,"A",{href:!0});var b_=i(N);ye=s(b_,"multi-lingual"),b_.forEach(t),Le=s(Ka," page for more information."),Ka.forEach(t),fa.forEach(t),U=d(o),le=r(o,"P",{});var Ja=i(le);$e=s(Ja,"This model was contributed by "),oe=r(Ja,"A",{href:!0,rel:!0});var M_=i(oe);Fe=s(M_,"thomwolf"),M_.forEach(t),Bd=s(Ja,". The original code can be found "),ln=r(Ja,"A",{href:!0,rel:!0});var w_=i(ln);Ud=s(w_,"here"),w_.forEach(t),Rd=s(Ja,"."),Ja.forEach(t),gl=d(o),St=r(o,"H2",{class:!0});var Gl=i(St);Mo=r(Gl,"A",{id:!0,class:!0,href:!0});var y_=i(Mo);_r=r(y_,"SPAN",{});var L_=i(_r);M(dn.$$.fragment,L_),L_.forEach(t),y_.forEach(t),Vd=d(Gl),vr=r(Gl,"SPAN",{});var $_=i(vr);Gd=s($_,"XLMConfig"),$_.forEach(t),Gl.forEach(t),_l=d(o),Ie=r(o,"DIV",{class:!0});var kt=i(Ie);M(cn.$$.fragment,kt),Kd=d(kt),gt=r(kt,"P",{});var sn=i(gt);Jd=s(sn,"This is the configuration class to store the configuration of a "),ga=r(sn,"A",{href:!0});var F_=i(ga);Yd=s(F_,"XLMModel"),F_.forEach(t),Zd=s(sn," or a "),_a=r(sn,"A",{href:!0});var X_=i(_a);ec=s(X_,"TFXLMModel"),X_.forEach(t),tc=s(sn,`. It is used to
instantiate a XLM model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the
`),pn=r(sn,"A",{href:!0,rel:!0});var x_=i(pn);oc=s(x_,"xlm-mlm-en-2048"),x_.forEach(t),nc=s(sn," architecture."),sn.forEach(t),sc=d(kt),It=r(kt,"P",{});var Ya=i(It);ac=s(Ya,"Configuration objects inherit from "),va=r(Ya,"A",{href:!0});var E_=i(va);rc=s(E_,"PretrainedConfig"),E_.forEach(t),ic=s(Ya,` and can be used to control the model outputs. Read the
documentation from `),ka=r(Ya,"A",{href:!0});var z_=i(ka);lc=s(z_,"PretrainedConfig"),z_.forEach(t),dc=s(Ya," for more information."),Ya.forEach(t),cc=d(kt),kr=r(kt,"P",{});var q_=i(kr);pc=s(q_,"Examples:"),q_.forEach(t),hc=d(kt),M(hn.$$.fragment,kt),kt.forEach(t),vl=d(o),Dt=r(o,"H2",{class:!0});var Kl=i(Dt);wo=r(Kl,"A",{id:!0,class:!0,href:!0});var C_=i(wo);Tr=r(C_,"SPAN",{});var j_=i(Tr);M(mn.$$.fragment,j_),j_.forEach(t),C_.forEach(t),mc=d(Kl),br=r(Kl,"SPAN",{});var P_=i(br);uc=s(P_,"XLMTokenizer"),P_.forEach(t),Kl.forEach(t),kl=d(o),Xe=r(o,"DIV",{class:!0});var Ne=i(Xe);M(un.$$.fragment,Ne),fc=d(Ne),Mr=r(Ne,"P",{});var A_=i(Mr);gc=s(A_,"Construct an XLM tokenizer. Based on Byte-Pair Encoding. The tokenization process is the following:"),A_.forEach(t),_c=d(Ne),De=r(Ne,"UL",{});var dt=i(De);wr=r(dt,"LI",{});var O_=i(wr);vc=s(O_,"Moses preprocessing and tokenization for most supported languages."),O_.forEach(t),kc=d(dt),yr=r(dt,"LI",{});var N_=i(yr);Tc=s(N_,"Language specific tokenization for Chinese (Jieba), Japanese (KyTea) and Thai (PyThaiNLP)."),N_.forEach(t),bc=d(dt),Lr=r(dt,"LI",{});var S_=i(Lr);Mc=s(S_,"Optionally lowercases and normalizes all inputs text."),S_.forEach(t),wc=d(dt),_t=r(dt,"LI",{});var an=i(_t);yc=s(an,"The arguments "),$r=r(an,"CODE",{});var I_=i($r);Lc=s(I_,"special_tokens"),I_.forEach(t),$c=s(an," and the function "),Fr=r(an,"CODE",{});var D_=i(Fr);Fc=s(D_,"set_special_tokens"),D_.forEach(t),Xc=s(an,`, can be used to add additional symbols (like
\u201D`),Xr=r(an,"STRONG",{});var W_=i(Xr);xc=s(W_,"classify"),W_.forEach(t),Ec=s(an,"\u201D) to a vocabulary."),an.forEach(t),zc=d(dt),fn=r(dt,"LI",{});var Jl=i(fn);qc=s(Jl,"The "),xr=r(Jl,"CODE",{});var H_=i(xr);Cc=s(H_,"lang2id"),H_.forEach(t),jc=s(Jl,` attribute maps the languages supported by the model with their IDs if provided (automatically set
for pretrained vocabularies).`),Jl.forEach(t),Pc=d(dt),gn=r(dt,"LI",{});var Yl=i(gn);Ac=s(Yl,"The "),Er=r(Yl,"CODE",{});var Q_=i(Er);Oc=s(Q_,"id2lang"),Q_.forEach(t),Nc=s(Yl," attributes does reverse mapping if provided (automatically set for pretrained vocabularies)."),Yl.forEach(t),dt.forEach(t),Sc=d(Ne),_n=r(Ne,"P",{});var Zl=i(_n);Ic=s(Zl,"This tokenizer inherits from "),Ta=r(Zl,"A",{href:!0});var B_=i(Ta);Dc=s(B_,"PreTrainedTokenizer"),B_.forEach(t),Wc=s(Zl,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Zl.forEach(t),Hc=d(Ne),vt=r(Ne,"DIV",{class:!0});var Za=i(vt);M(vn.$$.fragment,Za),Qc=d(Za),zr=r(Za,"P",{});var U_=i(zr);Bc=s(U_,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An XLM sequence has the following format:`),U_.forEach(t),Uc=d(Za),kn=r(Za,"UL",{});var ed=i(kn);ba=r(ed,"LI",{});var __=i(ba);Rc=s(__,"single sequence: "),qr=r(__,"CODE",{});var R_=i(qr);Vc=s(R_,"<s> X </s>"),R_.forEach(t),__.forEach(t),Gc=d(ed),Ma=r(ed,"LI",{});var v_=i(Ma);Kc=s(v_,"pair of sequences: "),Cr=r(v_,"CODE",{});var V_=i(Cr);Jc=s(V_,"<s> A </s> B </s>"),V_.forEach(t),v_.forEach(t),ed.forEach(t),Za.forEach(t),Yc=d(Ne),yo=r(Ne,"DIV",{class:!0});var td=i(yo);M(Tn.$$.fragment,td),Zc=d(td),bn=r(td,"P",{});var od=i(bn);ep=s(od,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),jr=r(od,"CODE",{});var G_=i(jr);tp=s(G_,"prepare_for_model"),G_.forEach(t),op=s(od," method."),od.forEach(t),td.forEach(t),np=d(Ne),lt=r(Ne,"DIV",{class:!0});var rn=i(lt);M(Mn.$$.fragment,rn),sp=d(rn),Pr=r(rn,"P",{});var K_=i(Pr);ap=s(K_,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. An XLM sequence
pair mask has the following format:`),K_.forEach(t),rp=d(rn),M(wn.$$.fragment,rn),ip=d(rn),Wt=r(rn,"P",{});var er=i(Wt);lp=s(er,"If "),Ar=r(er,"CODE",{});var J_=i(Ar);dp=s(J_,"token_ids_1"),J_.forEach(t),cp=s(er," is "),Or=r(er,"CODE",{});var Y_=i(Or);pp=s(Y_,"None"),Y_.forEach(t),hp=s(er,", this method only returns the first portion of the mask (0s)."),er.forEach(t),rn.forEach(t),mp=d(Ne),wa=r(Ne,"DIV",{class:!0});var Z_=i(wa);M(yn.$$.fragment,Z_),Z_.forEach(t),Ne.forEach(t),Tl=d(o),Ht=r(o,"H2",{class:!0});var nd=i(Ht);Lo=r(nd,"A",{id:!0,class:!0,href:!0});var ev=i(Lo);Nr=r(ev,"SPAN",{});var tv=i(Nr);M(Ln.$$.fragment,tv),tv.forEach(t),ev.forEach(t),up=d(nd),Sr=r(nd,"SPAN",{});var ov=i(Sr);fp=s(ov,"XLM specific outputs"),ov.forEach(t),nd.forEach(t),bl=d(o),Qt=r(o,"DIV",{class:!0});var sd=i(Qt);M($n.$$.fragment,sd),gp=d(sd),Fn=r(sd,"P",{});var ad=i(Fn);_p=s(ad,"Base class for outputs of question answering models using a "),Ir=r(ad,"CODE",{});var nv=i(Ir);vp=s(nv,"SquadHead"),nv.forEach(t),kp=s(ad,"."),ad.forEach(t),sd.forEach(t),Ml=d(o),Bt=r(o,"H2",{class:!0});var rd=i(Bt);$o=r(rd,"A",{id:!0,class:!0,href:!0});var sv=i($o);Dr=r(sv,"SPAN",{});var av=i(Dr);M(Xn.$$.fragment,av),av.forEach(t),sv.forEach(t),Tp=d(rd),Wr=r(rd,"SPAN",{});var rv=i(Wr);bp=s(rv,"XLMModel"),rv.forEach(t),rd.forEach(t),wl=d(o),We=r(o,"DIV",{class:!0});var Tt=i(We);M(xn.$$.fragment,Tt),Mp=d(Tt),Hr=r(Tt,"P",{});var iv=i(Hr);wp=s(iv,"The bare XLM Model transformer outputting raw hidden-states without any specific head on top."),iv.forEach(t),yp=d(Tt),En=r(Tt,"P",{});var id=i(En);Lp=s(id,"This model inherits from "),ya=r(id,"A",{href:!0});var lv=i(ya);$p=s(lv,"PreTrainedModel"),lv.forEach(t),Fp=s(id,`. 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.)`),id.forEach(t),Xp=d(Tt),zn=r(Tt,"P",{});var ld=i(zn);xp=s(ld,"This model is also a PyTorch "),qn=r(ld,"A",{href:!0,rel:!0});var dv=i(qn);Ep=s(dv,"torch.nn.Module"),dv.forEach(t),zp=s(ld,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ld.forEach(t),qp=d(Tt),Ge=r(Tt,"DIV",{class:!0});var bt=i(Ge);M(Cn.$$.fragment,bt),Cp=d(bt),Ut=r(bt,"P",{});var tr=i(Ut);jp=s(tr,"The "),La=r(tr,"A",{href:!0});var cv=i(La);Pp=s(cv,"XLMModel"),cv.forEach(t),Ap=s(tr," forward method, overrides the "),Qr=r(tr,"CODE",{});var pv=i(Qr);Op=s(pv,"__call__"),pv.forEach(t),Np=s(tr," special method."),tr.forEach(t),Sp=d(bt),M(Fo.$$.fragment,bt),Ip=d(bt),Br=r(bt,"P",{});var hv=i(Br);Dp=s(hv,"Example:"),hv.forEach(t),Wp=d(bt),M(jn.$$.fragment,bt),bt.forEach(t),Tt.forEach(t),yl=d(o),Rt=r(o,"H2",{class:!0});var dd=i(Rt);Xo=r(dd,"A",{id:!0,class:!0,href:!0});var mv=i(Xo);Ur=r(mv,"SPAN",{});var uv=i(Ur);M(Pn.$$.fragment,uv),uv.forEach(t),mv.forEach(t),Hp=d(dd),Rr=r(dd,"SPAN",{});var fv=i(Rr);Qp=s(fv,"XLMWithLMHeadModel"),fv.forEach(t),dd.forEach(t),Ll=d(o),He=r(o,"DIV",{class:!0});var Mt=i(He);M(An.$$.fragment,Mt),Bp=d(Mt),Vr=r(Mt,"P",{});var gv=i(Vr);Up=s(gv,`The XLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),gv.forEach(t),Rp=d(Mt),On=r(Mt,"P",{});var cd=i(On);Vp=s(cd,"This model inherits from "),$a=r(cd,"A",{href:!0});var _v=i($a);Gp=s(_v,"PreTrainedModel"),_v.forEach(t),Kp=s(cd,`. 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.)`),cd.forEach(t),Jp=d(Mt),Nn=r(Mt,"P",{});var pd=i(Nn);Yp=s(pd,"This model is also a PyTorch "),Sn=r(pd,"A",{href:!0,rel:!0});var vv=i(Sn);Zp=s(vv,"torch.nn.Module"),vv.forEach(t),eh=s(pd,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pd.forEach(t),th=d(Mt),Ke=r(Mt,"DIV",{class:!0});var wt=i(Ke);M(In.$$.fragment,wt),oh=d(wt),Vt=r(wt,"P",{});var or=i(Vt);nh=s(or,"The "),Fa=r(or,"A",{href:!0});var kv=i(Fa);sh=s(kv,"XLMWithLMHeadModel"),kv.forEach(t),ah=s(or," forward method, overrides the "),Gr=r(or,"CODE",{});var Tv=i(Gr);rh=s(Tv,"__call__"),Tv.forEach(t),ih=s(or," special method."),or.forEach(t),lh=d(wt),M(xo.$$.fragment,wt),dh=d(wt),Kr=r(wt,"P",{});var bv=i(Kr);ch=s(bv,"Example:"),bv.forEach(t),ph=d(wt),M(Dn.$$.fragment,wt),wt.forEach(t),Mt.forEach(t),$l=d(o),Gt=r(o,"H2",{class:!0});var hd=i(Gt);Eo=r(hd,"A",{id:!0,class:!0,href:!0});var Mv=i(Eo);Jr=r(Mv,"SPAN",{});var wv=i(Jr);M(Wn.$$.fragment,wv),wv.forEach(t),Mv.forEach(t),hh=d(hd),Yr=r(hd,"SPAN",{});var yv=i(Yr);mh=s(yv,"XLMForSequenceClassification"),yv.forEach(t),hd.forEach(t),Fl=d(o),Qe=r(o,"DIV",{class:!0});var yt=i(Qe);M(Hn.$$.fragment,yt),uh=d(yt),Zr=r(yt,"P",{});var Lv=i(Zr);fh=s(Lv,`XLM Model with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),Lv.forEach(t),gh=d(yt),Qn=r(yt,"P",{});var md=i(Qn);_h=s(md,"This model inherits from "),Xa=r(md,"A",{href:!0});var $v=i(Xa);vh=s($v,"PreTrainedModel"),$v.forEach(t),kh=s(md,`. 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.)`),md.forEach(t),Th=d(yt),Bn=r(yt,"P",{});var ud=i(Bn);bh=s(ud,"This model is also a PyTorch "),Un=r(ud,"A",{href:!0,rel:!0});var Fv=i(Un);Mh=s(Fv,"torch.nn.Module"),Fv.forEach(t),wh=s(ud,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ud.forEach(t),yh=d(yt),Ee=r(yt,"DIV",{class:!0});var it=i(Ee);M(Rn.$$.fragment,it),Lh=d(it),Kt=r(it,"P",{});var nr=i(Kt);$h=s(nr,"The "),xa=r(nr,"A",{href:!0});var Xv=i(xa);Fh=s(Xv,"XLMForSequenceClassification"),Xv.forEach(t),Xh=s(nr," forward method, overrides the "),ei=r(nr,"CODE",{});var xv=i(ei);xh=s(xv,"__call__"),xv.forEach(t),Eh=s(nr," special method."),nr.forEach(t),zh=d(it),M(zo.$$.fragment,it),qh=d(it),ti=r(it,"P",{});var Ev=i(ti);Ch=s(Ev,"Example of single-label classification:"),Ev.forEach(t),jh=d(it),M(Vn.$$.fragment,it),Ph=d(it),oi=r(it,"P",{});var zv=i(oi);Ah=s(zv,"Example of multi-label classification:"),zv.forEach(t),Oh=d(it),M(Gn.$$.fragment,it),it.forEach(t),yt.forEach(t),Xl=d(o),Jt=r(o,"H2",{class:!0});var fd=i(Jt);qo=r(fd,"A",{id:!0,class:!0,href:!0});var qv=i(qo);ni=r(qv,"SPAN",{});var Cv=i(ni);M(Kn.$$.fragment,Cv),Cv.forEach(t),qv.forEach(t),Nh=d(fd),si=r(fd,"SPAN",{});var jv=i(si);Sh=s(jv,"XLMForMultipleChoice"),jv.forEach(t),fd.forEach(t),xl=d(o),Be=r(o,"DIV",{class:!0});var Lt=i(Be);M(Jn.$$.fragment,Lt),Ih=d(Lt),ai=r(Lt,"P",{});var Pv=i(ai);Dh=s(Pv,`XLM 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.`),Pv.forEach(t),Wh=d(Lt),Yn=r(Lt,"P",{});var gd=i(Yn);Hh=s(gd,"This model inherits from "),Ea=r(gd,"A",{href:!0});var Av=i(Ea);Qh=s(Av,"PreTrainedModel"),Av.forEach(t),Bh=s(gd,`. 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.)`),gd.forEach(t),Uh=d(Lt),Zn=r(Lt,"P",{});var _d=i(Zn);Rh=s(_d,"This model is also a PyTorch "),es=r(_d,"A",{href:!0,rel:!0});var Ov=i(es);Vh=s(Ov,"torch.nn.Module"),Ov.forEach(t),Gh=s(_d,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_d.forEach(t),Kh=d(Lt),Je=r(Lt,"DIV",{class:!0});var $t=i(Je);M(ts.$$.fragment,$t),Jh=d($t),Yt=r($t,"P",{});var sr=i(Yt);Yh=s(sr,"The "),za=r(sr,"A",{href:!0});var Nv=i(za);Zh=s(Nv,"XLMForMultipleChoice"),Nv.forEach(t),em=s(sr," forward method, overrides the "),ri=r(sr,"CODE",{});var Sv=i(ri);tm=s(Sv,"__call__"),Sv.forEach(t),om=s(sr," special method."),sr.forEach(t),nm=d($t),M(Co.$$.fragment,$t),sm=d($t),ii=r($t,"P",{});var Iv=i(ii);am=s(Iv,"Example:"),Iv.forEach(t),rm=d($t),M(os.$$.fragment,$t),$t.forEach(t),Lt.forEach(t),El=d(o),Zt=r(o,"H2",{class:!0});var vd=i(Zt);jo=r(vd,"A",{id:!0,class:!0,href:!0});var Dv=i(jo);li=r(Dv,"SPAN",{});var Wv=i(li);M(ns.$$.fragment,Wv),Wv.forEach(t),Dv.forEach(t),im=d(vd),di=r(vd,"SPAN",{});var Hv=i(di);lm=s(Hv,"XLMForTokenClassification"),Hv.forEach(t),vd.forEach(t),zl=d(o),Ue=r(o,"DIV",{class:!0});var Ft=i(Ue);M(ss.$$.fragment,Ft),dm=d(Ft),ci=r(Ft,"P",{});var Qv=i(ci);cm=s(Qv,`XLM 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.`),Qv.forEach(t),pm=d(Ft),as=r(Ft,"P",{});var kd=i(as);hm=s(kd,"This model inherits from "),qa=r(kd,"A",{href:!0});var Bv=i(qa);mm=s(Bv,"PreTrainedModel"),Bv.forEach(t),um=s(kd,`. 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.)`),kd.forEach(t),fm=d(Ft),rs=r(Ft,"P",{});var Td=i(rs);gm=s(Td,"This model is also a PyTorch "),is=r(Td,"A",{href:!0,rel:!0});var Uv=i(is);_m=s(Uv,"torch.nn.Module"),Uv.forEach(t),vm=s(Td,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Td.forEach(t),km=d(Ft),Ye=r(Ft,"DIV",{class:!0});var Xt=i(Ye);M(ls.$$.fragment,Xt),Tm=d(Xt),eo=r(Xt,"P",{});var ar=i(eo);bm=s(ar,"The "),Ca=r(ar,"A",{href:!0});var Rv=i(Ca);Mm=s(Rv,"XLMForTokenClassification"),Rv.forEach(t),wm=s(ar," forward method, overrides the "),pi=r(ar,"CODE",{});var Vv=i(pi);ym=s(Vv,"__call__"),Vv.forEach(t),Lm=s(ar," special method."),ar.forEach(t),$m=d(Xt),M(Po.$$.fragment,Xt),Fm=d(Xt),hi=r(Xt,"P",{});var Gv=i(hi);Xm=s(Gv,"Example:"),Gv.forEach(t),xm=d(Xt),M(ds.$$.fragment,Xt),Xt.forEach(t),Ft.forEach(t),ql=d(o),to=r(o,"H2",{class:!0});var bd=i(to);Ao=r(bd,"A",{id:!0,class:!0,href:!0});var Kv=i(Ao);mi=r(Kv,"SPAN",{});var Jv=i(mi);M(cs.$$.fragment,Jv),Jv.forEach(t),Kv.forEach(t),Em=d(bd),ui=r(bd,"SPAN",{});var Yv=i(ui);zm=s(Yv,"XLMForQuestionAnsweringSimple"),Yv.forEach(t),bd.forEach(t),Cl=d(o),Re=r(o,"DIV",{class:!0});var xt=i(Re);M(ps.$$.fragment,xt),qm=d(xt),oo=r(xt,"P",{});var rr=i(oo);Cm=s(rr,`XLM 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 `),fi=r(rr,"CODE",{});var Zv=i(fi);jm=s(Zv,"span start logits"),Zv.forEach(t),Pm=s(rr," and "),gi=r(rr,"CODE",{});var ek=i(gi);Am=s(ek,"span end logits"),ek.forEach(t),Om=s(rr,")."),rr.forEach(t),Nm=d(xt),hs=r(xt,"P",{});var Md=i(hs);Sm=s(Md,"This model inherits from "),ja=r(Md,"A",{href:!0});var tk=i(ja);Im=s(tk,"PreTrainedModel"),tk.forEach(t),Dm=s(Md,`. 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.)`),Md.forEach(t),Wm=d(xt),ms=r(xt,"P",{});var wd=i(ms);Hm=s(wd,"This model is also a PyTorch "),us=r(wd,"A",{href:!0,rel:!0});var ok=i(us);Qm=s(ok,"torch.nn.Module"),ok.forEach(t),Bm=s(wd,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),wd.forEach(t),Um=d(xt),Ze=r(xt,"DIV",{class:!0});var Et=i(Ze);M(fs.$$.fragment,Et),Rm=d(Et),no=r(Et,"P",{});var ir=i(no);Vm=s(ir,"The "),Pa=r(ir,"A",{href:!0});var nk=i(Pa);Gm=s(nk,"XLMForQuestionAnsweringSimple"),nk.forEach(t),Km=s(ir," forward method, overrides the "),_i=r(ir,"CODE",{});var sk=i(_i);Jm=s(sk,"__call__"),sk.forEach(t),Ym=s(ir," special method."),ir.forEach(t),Zm=d(Et),M(Oo.$$.fragment,Et),eu=d(Et),vi=r(Et,"P",{});var ak=i(vi);tu=s(ak,"Example:"),ak.forEach(t),ou=d(Et),M(gs.$$.fragment,Et),Et.forEach(t),xt.forEach(t),jl=d(o),so=r(o,"H2",{class:!0});var yd=i(so);No=r(yd,"A",{id:!0,class:!0,href:!0});var rk=i(No);ki=r(rk,"SPAN",{});var ik=i(ki);M(_s.$$.fragment,ik),ik.forEach(t),rk.forEach(t),nu=d(yd),Ti=r(yd,"SPAN",{});var lk=i(Ti);su=s(lk,"XLMForQuestionAnswering"),lk.forEach(t),yd.forEach(t),Pl=d(o),Ve=r(o,"DIV",{class:!0});var zt=i(Ve);M(vs.$$.fragment,zt),au=d(zt),ao=r(zt,"P",{});var lr=i(ao);ru=s(lr,`XLM Model with a beam-search span classification head on top for extractive question-answering tasks like SQuAD (a
linear layers on top of the hidden-states output to compute `),bi=r(lr,"CODE",{});var dk=i(bi);iu=s(dk,"span start logits"),dk.forEach(t),lu=s(lr," and "),Mi=r(lr,"CODE",{});var ck=i(Mi);du=s(ck,"span end logits"),ck.forEach(t),cu=s(lr,")."),lr.forEach(t),pu=d(zt),ks=r(zt,"P",{});var Ld=i(ks);hu=s(Ld,"This model inherits from "),Aa=r(Ld,"A",{href:!0});var pk=i(Aa);mu=s(pk,"PreTrainedModel"),pk.forEach(t),uu=s(Ld,`. 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.)`),Ld.forEach(t),fu=d(zt),Ts=r(zt,"P",{});var $d=i(Ts);gu=s($d,"This model is also a PyTorch "),bs=r($d,"A",{href:!0,rel:!0});var hk=i(bs);_u=s(hk,"torch.nn.Module"),hk.forEach(t),vu=s($d,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),$d.forEach(t),ku=d(zt),et=r(zt,"DIV",{class:!0});var qt=i(et);M(Ms.$$.fragment,qt),Tu=d(qt),ro=r(qt,"P",{});var dr=i(ro);bu=s(dr,"The "),Oa=r(dr,"A",{href:!0});var mk=i(Oa);Mu=s(mk,"XLMForQuestionAnswering"),mk.forEach(t),wu=s(dr," forward method, overrides the "),wi=r(dr,"CODE",{});var uk=i(wi);yu=s(uk,"__call__"),uk.forEach(t),Lu=s(dr," special method."),dr.forEach(t),$u=d(qt),M(So.$$.fragment,qt),Fu=d(qt),yi=r(qt,"P",{});var fk=i(yi);Xu=s(fk,"Example:"),fk.forEach(t),xu=d(qt),M(ws.$$.fragment,qt),qt.forEach(t),zt.forEach(t),Al=d(o),io=r(o,"H2",{class:!0});var Fd=i(io);Io=r(Fd,"A",{id:!0,class:!0,href:!0});var gk=i(Io);Li=r(gk,"SPAN",{});var _k=i(Li);M(ys.$$.fragment,_k),_k.forEach(t),gk.forEach(t),Eu=d(Fd),$i=r(Fd,"SPAN",{});var vk=i($i);zu=s(vk,"TFXLMModel"),vk.forEach(t),Fd.forEach(t),Ol=d(o),qe=r(o,"DIV",{class:!0});var ct=i(qe);M(Ls.$$.fragment,ct),qu=d(ct),Fi=r(ct,"P",{});var kk=i(Fi);Cu=s(kk,"The bare XLM Model transformer outputting raw hidden-states without any specific head on top."),kk.forEach(t),ju=d(ct),$s=r(ct,"P",{});var Xd=i($s);Pu=s(Xd,"This model inherits from "),Na=r(Xd,"A",{href:!0});var Tk=i(Na);Au=s(Tk,"TFPreTrainedModel"),Tk.forEach(t),Ou=s(Xd,`. 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.)`),Xd.forEach(t),Nu=d(ct),Fs=r(ct,"P",{});var xd=i(Fs);Su=s(xd,"This model is also a "),Xs=r(xd,"A",{href:!0,rel:!0});var bk=i(Xs);Iu=s(bk,"tf.keras.Model"),bk.forEach(t),Du=s(xd,` 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.`),xd.forEach(t),Wu=d(ct),M(Do.$$.fragment,ct),Hu=d(ct),tt=r(ct,"DIV",{class:!0});var Ct=i(tt);M(xs.$$.fragment,Ct),Qu=d(Ct),lo=r(Ct,"P",{});var cr=i(lo);Bu=s(cr,"The "),Sa=r(cr,"A",{href:!0});var Mk=i(Sa);Uu=s(Mk,"TFXLMModel"),Mk.forEach(t),Ru=s(cr," forward method, overrides the "),Xi=r(cr,"CODE",{});var wk=i(Xi);Vu=s(wk,"__call__"),wk.forEach(t),Gu=s(cr," special method."),cr.forEach(t),Ku=d(Ct),M(Wo.$$.fragment,Ct),Ju=d(Ct),xi=r(Ct,"P",{});var yk=i(xi);Yu=s(yk,"Example:"),yk.forEach(t),Zu=d(Ct),M(Es.$$.fragment,Ct),Ct.forEach(t),ct.forEach(t),Nl=d(o),co=r(o,"H2",{class:!0});var Ed=i(co);Ho=r(Ed,"A",{id:!0,class:!0,href:!0});var Lk=i(Ho);Ei=r(Lk,"SPAN",{});var $k=i(Ei);M(zs.$$.fragment,$k),$k.forEach(t),Lk.forEach(t),ef=d(Ed),zi=r(Ed,"SPAN",{});var Fk=i(zi);tf=s(Fk,"TFXLMWithLMHeadModel"),Fk.forEach(t),Ed.forEach(t),Sl=d(o),Ce=r(o,"DIV",{class:!0});var pt=i(Ce);M(qs.$$.fragment,pt),of=d(pt),qi=r(pt,"P",{});var Xk=i(qi);nf=s(Xk,`The XLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Xk.forEach(t),sf=d(pt),Cs=r(pt,"P",{});var zd=i(Cs);af=s(zd,"This model inherits from "),Ia=r(zd,"A",{href:!0});var xk=i(Ia);rf=s(xk,"TFPreTrainedModel"),xk.forEach(t),lf=s(zd,`. 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.)`),zd.forEach(t),df=d(pt),js=r(pt,"P",{});var qd=i(js);cf=s(qd,"This model is also a "),Ps=r(qd,"A",{href:!0,rel:!0});var Ek=i(Ps);pf=s(Ek,"tf.keras.Model"),Ek.forEach(t),hf=s(qd,` 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.`),qd.forEach(t),mf=d(pt),M(Qo.$$.fragment,pt),uf=d(pt),ot=r(pt,"DIV",{class:!0});var jt=i(ot);M(As.$$.fragment,jt),ff=d(jt),po=r(jt,"P",{});var pr=i(po);gf=s(pr,"The "),Da=r(pr,"A",{href:!0});var zk=i(Da);_f=s(zk,"TFXLMWithLMHeadModel"),zk.forEach(t),vf=s(pr," forward method, overrides the "),Ci=r(pr,"CODE",{});var qk=i(Ci);kf=s(qk,"__call__"),qk.forEach(t),Tf=s(pr," special method."),pr.forEach(t),bf=d(jt),M(Bo.$$.fragment,jt),Mf=d(jt),ji=r(jt,"P",{});var Ck=i(ji);wf=s(Ck,"Example:"),Ck.forEach(t),yf=d(jt),M(Os.$$.fragment,jt),jt.forEach(t),pt.forEach(t),Il=d(o),ho=r(o,"H2",{class:!0});var Cd=i(ho);Uo=r(Cd,"A",{id:!0,class:!0,href:!0});var jk=i(Uo);Pi=r(jk,"SPAN",{});var Pk=i(Pi);M(Ns.$$.fragment,Pk),Pk.forEach(t),jk.forEach(t),Lf=d(Cd),Ai=r(Cd,"SPAN",{});var Ak=i(Ai);$f=s(Ak,"TFXLMForSequenceClassification"),Ak.forEach(t),Cd.forEach(t),Dl=d(o),je=r(o,"DIV",{class:!0});var ht=i(je);M(Ss.$$.fragment,ht),Ff=d(ht),Oi=r(ht,"P",{});var Ok=i(Oi);Xf=s(Ok,`XLM Model with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),Ok.forEach(t),xf=d(ht),Is=r(ht,"P",{});var jd=i(Is);Ef=s(jd,"This model inherits from "),Wa=r(jd,"A",{href:!0});var Nk=i(Wa);zf=s(Nk,"TFPreTrainedModel"),Nk.forEach(t),qf=s(jd,`. 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.)`),jd.forEach(t),Cf=d(ht),Ds=r(ht,"P",{});var Pd=i(Ds);jf=s(Pd,"This model is also a "),Ws=r(Pd,"A",{href:!0,rel:!0});var Sk=i(Ws);Pf=s(Sk,"tf.keras.Model"),Sk.forEach(t),Af=s(Pd,` 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.`),Pd.forEach(t),Of=d(ht),M(Ro.$$.fragment,ht),Nf=d(ht),nt=r(ht,"DIV",{class:!0});var Pt=i(nt);M(Hs.$$.fragment,Pt),Sf=d(Pt),mo=r(Pt,"P",{});var hr=i(mo);If=s(hr,"The "),Ha=r(hr,"A",{href:!0});var Ik=i(Ha);Df=s(Ik,"TFXLMForSequenceClassification"),Ik.forEach(t),Wf=s(hr," forward method, overrides the "),Ni=r(hr,"CODE",{});var Dk=i(Ni);Hf=s(Dk,"__call__"),Dk.forEach(t),Qf=s(hr," special method."),hr.forEach(t),Bf=d(Pt),M(Vo.$$.fragment,Pt),Uf=d(Pt),Si=r(Pt,"P",{});var Wk=i(Si);Rf=s(Wk,"Example:"),Wk.forEach(t),Vf=d(Pt),M(Qs.$$.fragment,Pt),Pt.forEach(t),ht.forEach(t),Wl=d(o),uo=r(o,"H2",{class:!0});var Ad=i(uo);Go=r(Ad,"A",{id:!0,class:!0,href:!0});var Hk=i(Go);Ii=r(Hk,"SPAN",{});var Qk=i(Ii);M(Bs.$$.fragment,Qk),Qk.forEach(t),Hk.forEach(t),Gf=d(Ad),Di=r(Ad,"SPAN",{});var Bk=i(Di);Kf=s(Bk,"TFXLMForMultipleChoice"),Bk.forEach(t),Ad.forEach(t),Hl=d(o),Pe=r(o,"DIV",{class:!0});var mt=i(Pe);M(Us.$$.fragment,mt),Jf=d(mt),Wi=r(mt,"P",{});var Uk=i(Wi);Yf=s(Uk,`XLM 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),Zf=d(mt),Rs=r(mt,"P",{});var Od=i(Rs);eg=s(Od,"This model inherits from "),Qa=r(Od,"A",{href:!0});var Rk=i(Qa);tg=s(Rk,"TFPreTrainedModel"),Rk.forEach(t),og=s(Od,`. 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.)`),Od.forEach(t),ng=d(mt),Vs=r(mt,"P",{});var Nd=i(Vs);sg=s(Nd,"This model is also a "),Gs=r(Nd,"A",{href:!0,rel:!0});var Vk=i(Gs);ag=s(Vk,"tf.keras.Model"),Vk.forEach(t),rg=s(Nd,` 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.`),Nd.forEach(t),ig=d(mt),M(Ko.$$.fragment,mt),lg=d(mt),st=r(mt,"DIV",{class:!0});var At=i(st);M(Ks.$$.fragment,At),dg=d(At),fo=r(At,"P",{});var mr=i(fo);cg=s(mr,"The "),Ba=r(mr,"A",{href:!0});var Gk=i(Ba);pg=s(Gk,"TFXLMForMultipleChoice"),Gk.forEach(t),hg=s(mr," forward method, overrides the "),Hi=r(mr,"CODE",{});var Kk=i(Hi);mg=s(Kk,"__call__"),Kk.forEach(t),ug=s(mr," special method."),mr.forEach(t),fg=d(At),M(Jo.$$.fragment,At),gg=d(At),Qi=r(At,"P",{});var Jk=i(Qi);_g=s(Jk,"Example:"),Jk.forEach(t),vg=d(At),M(Js.$$.fragment,At),At.forEach(t),mt.forEach(t),Ql=d(o),go=r(o,"H2",{class:!0});var Sd=i(go);Yo=r(Sd,"A",{id:!0,class:!0,href:!0});var Yk=i(Yo);Bi=r(Yk,"SPAN",{});var Zk=i(Bi);M(Ys.$$.fragment,Zk),Zk.forEach(t),Yk.forEach(t),kg=d(Sd),Ui=r(Sd,"SPAN",{});var eT=i(Ui);Tg=s(eT,"TFXLMForTokenClassification"),eT.forEach(t),Sd.forEach(t),Bl=d(o),Ae=r(o,"DIV",{class:!0});var ut=i(Ae);M(Zs.$$.fragment,ut),bg=d(ut),Ri=r(ut,"P",{});var tT=i(Ri);Mg=s(tT,`XLM 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.`),tT.forEach(t),wg=d(ut),ea=r(ut,"P",{});var Id=i(ea);yg=s(Id,"This model inherits from "),Ua=r(Id,"A",{href:!0});var oT=i(Ua);Lg=s(oT,"TFPreTrainedModel"),oT.forEach(t),$g=s(Id,`. 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.)`),Id.forEach(t),Fg=d(ut),ta=r(ut,"P",{});var Dd=i(ta);Xg=s(Dd,"This model is also a "),oa=r(Dd,"A",{href:!0,rel:!0});var nT=i(oa);xg=s(nT,"tf.keras.Model"),nT.forEach(t),Eg=s(Dd,` 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.`),Dd.forEach(t),zg=d(ut),M(Zo.$$.fragment,ut),qg=d(ut),at=r(ut,"DIV",{class:!0});var Ot=i(at);M(na.$$.fragment,Ot),Cg=d(Ot),_o=r(Ot,"P",{});var ur=i(_o);jg=s(ur,"The "),Ra=r(ur,"A",{href:!0});var sT=i(Ra);Pg=s(sT,"TFXLMForTokenClassification"),sT.forEach(t),Ag=s(ur," forward method, overrides the "),Vi=r(ur,"CODE",{});var aT=i(Vi);Og=s(aT,"__call__"),aT.forEach(t),Ng=s(ur," special method."),ur.forEach(t),Sg=d(Ot),M(en.$$.fragment,Ot),Ig=d(Ot),Gi=r(Ot,"P",{});var rT=i(Gi);Dg=s(rT,"Example:"),rT.forEach(t),Wg=d(Ot),M(sa.$$.fragment,Ot),Ot.forEach(t),ut.forEach(t),Ul=d(o),vo=r(o,"H2",{class:!0});var Wd=i(vo);tn=r(Wd,"A",{id:!0,class:!0,href:!0});var iT=i(tn);Ki=r(iT,"SPAN",{});var lT=i(Ki);M(aa.$$.fragment,lT),lT.forEach(t),iT.forEach(t),Hg=d(Wd),Ji=r(Wd,"SPAN",{});var dT=i(Ji);Qg=s(dT,"TFXLMForQuestionAnsweringSimple"),dT.forEach(t),Wd.forEach(t),Rl=d(o),Oe=r(o,"DIV",{class:!0});var ft=i(Oe);M(ra.$$.fragment,ft),Bg=d(ft),ko=r(ft,"P",{});var fr=i(ko);Ug=s(fr,`XLM Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear layer
on top of the hidden-states output to compute `),Yi=r(fr,"CODE",{});var cT=i(Yi);Rg=s(cT,"span start logits"),cT.forEach(t),Vg=s(fr," and "),Zi=r(fr,"CODE",{});var pT=i(Zi);Gg=s(pT,"span end logits"),pT.forEach(t),Kg=s(fr,")."),fr.forEach(t),Jg=d(ft),ia=r(ft,"P",{});var Hd=i(ia);Yg=s(Hd,"This model inherits from "),Va=r(Hd,"A",{href:!0});var hT=i(Va);Zg=s(hT,"TFPreTrainedModel"),hT.forEach(t),e_=s(Hd,`. 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.)`),Hd.forEach(t),t_=d(ft),la=r(ft,"P",{});var Qd=i(la);o_=s(Qd,"This model is also a "),da=r(Qd,"A",{href:!0,rel:!0});var mT=i(da);n_=s(mT,"tf.keras.Model"),mT.forEach(t),s_=s(Qd,` 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.`),Qd.forEach(t),a_=d(ft),M(on.$$.fragment,ft),r_=d(ft),rt=r(ft,"DIV",{class:!0});var Nt=i(rt);M(ca.$$.fragment,Nt),i_=d(Nt),To=r(Nt,"P",{});var gr=i(To);l_=s(gr,"The "),Ga=r(gr,"A",{href:!0});var uT=i(Ga);d_=s(uT,"TFXLMForQuestionAnsweringSimple"),uT.forEach(t),c_=s(gr," forward method, overrides the "),el=r(gr,"CODE",{});var fT=i(el);p_=s(fT,"__call__"),fT.forEach(t),h_=s(gr," special method."),gr.forEach(t),m_=d(Nt),M(nn.$$.fragment,Nt),u_=d(Nt),tl=r(Nt,"P",{});var gT=i(tl);f_=s(gT,"Example:"),gT.forEach(t),g_=d(Nt),M(pa.$$.fragment,Nt),Nt.forEach(t),ft.forEach(t),this.h()},h(){p(h,"name","hf:doc:metadata"),p(h,"content",JSON.stringify(DT)),p(_,"id","xlm"),p(_,"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(_,"href","#xlm"),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(x,"class","relative group"),p(te,"href","https://arxiv.org/abs/1901.07291"),p(te,"rel","nofollow"),p(N,"href","../multilingual"),p(oe,"href","https://huggingface.co/thomwolf"),p(oe,"rel","nofollow"),p(ln,"href","https://github.com/facebookresearch/XLM/"),p(ln,"rel","nofollow"),p(Mo,"id","transformers.XLMConfig"),p(Mo,"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(Mo,"href","#transformers.XLMConfig"),p(St,"class","relative group"),p(ga,"href","/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMModel"),p(_a,"href","/docs/transformers/pr_15839/en/model_doc/xlm#transformers.TFXLMModel"),p(pn,"href","https://huggingface.co/xlm-mlm-en-2048"),p(pn,"rel","nofollow"),p(va,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),p(ka,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),p(Ie,"class","docstring"),p(wo,"id","transformers.XLMTokenizer"),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.XLMTokenizer"),p(Dt,"class","relative group"),p(Ta,"href","/docs/transformers/pr_15839/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),p(vt,"class","docstring"),p(yo,"class","docstring"),p(lt,"class","docstring"),p(wa,"class","docstring"),p(Xe,"class","docstring"),p(Lo,"id","transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput"),p(Lo,"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(Lo,"href","#transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput"),p(Ht,"class","relative group"),p(Qt,"class","docstring"),p($o,"id","transformers.XLMModel"),p($o,"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($o,"href","#transformers.XLMModel"),p(Bt,"class","relative group"),p(ya,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),p(qn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(qn,"rel","nofollow"),p(La,"href","/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMModel"),p(Ge,"class","docstring"),p(We,"class","docstring"),p(Xo,"id","transformers.XLMWithLMHeadModel"),p(Xo,"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(Xo,"href","#transformers.XLMWithLMHeadModel"),p(Rt,"class","relative group"),p($a,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),p(Sn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Sn,"rel","nofollow"),p(Fa,"href","/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMWithLMHeadModel"),p(Ke,"class","docstring"),p(He,"class","docstring"),p(Eo,"id","transformers.XLMForSequenceClassification"),p(Eo,"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(Eo,"href","#transformers.XLMForSequenceClassification"),p(Gt,"class","relative group"),p(Xa,"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(xa,"href","/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMForSequenceClassification"),p(Ee,"class","docstring"),p(Qe,"class","docstring"),p(qo,"id","transformers.XLMForMultipleChoice"),p(qo,"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(qo,"href","#transformers.XLMForMultipleChoice"),p(Jt,"class","relative group"),p(Ea,"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(za,"href","/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMForMultipleChoice"),p(Je,"class","docstring"),p(Be,"class","docstring"),p(jo,"id","transformers.XLMForTokenClassification"),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.XLMForTokenClassification"),p(Zt,"class","relative group"),p(qa,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),p(is,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(is,"rel","nofollow"),p(Ca,"href","/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMForTokenClassification"),p(Ye,"class","docstring"),p(Ue,"class","docstring"),p(Ao,"id","transformers.XLMForQuestionAnsweringSimple"),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.XLMForQuestionAnsweringSimple"),p(to,"class","relative group"),p(ja,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),p(us,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(us,"rel","nofollow"),p(Pa,"href","/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMForQuestionAnsweringSimple"),p(Ze,"class","docstring"),p(Re,"class","docstring"),p(No,"id","transformers.XLMForQuestionAnswering"),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.XLMForQuestionAnswering"),p(so,"class","relative group"),p(Aa,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),p(bs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(bs,"rel","nofollow"),p(Oa,"href","/docs/transformers/pr_15839/en/model_doc/xlm#transformers.XLMForQuestionAnswering"),p(et,"class","docstring"),p(Ve,"class","docstring"),p(Io,"id","transformers.TFXLMModel"),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.TFXLMModel"),p(io,"class","relative group"),p(Na,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),p(Xs,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(Xs,"rel","nofollow"),p(Sa,"href","/docs/transformers/pr_15839/en/model_doc/xlm#transformers.TFXLMModel"),p(tt,"class","docstring"),p(qe,"class","docstring"),p(Ho,"id","transformers.TFXLMWithLMHeadModel"),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.TFXLMWithLMHeadModel"),p(co,"class","relative group"),p(Ia,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),p(Ps,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(Ps,"rel","nofollow"),p(Da,"href","/docs/transformers/pr_15839/en/model_doc/xlm#transformers.TFXLMWithLMHeadModel"),p(ot,"class","docstring"),p(Ce,"class","docstring"),p(Uo,"id","transformers.TFXLMForSequenceClassification"),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.TFXLMForSequenceClassification"),p(ho,"class","relative group"),p(Wa,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),p(Ws,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(Ws,"rel","nofollow"),p(Ha,"href","/docs/transformers/pr_15839/en/model_doc/xlm#transformers.TFXLMForSequenceClassification"),p(nt,"class","docstring"),p(je,"class","docstring"),p(Go,"id","transformers.TFXLMForMultipleChoice"),p(Go,"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(Go,"href","#transformers.TFXLMForMultipleChoice"),p(uo,"class","relative group"),p(Qa,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),p(Gs,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(Gs,"rel","nofollow"),p(Ba,"href","/docs/transformers/pr_15839/en/model_doc/xlm#transformers.TFXLMForMultipleChoice"),p(st,"class","docstring"),p(Pe,"class","docstring"),p(Yo,"id","transformers.TFXLMForTokenClassification"),p(Yo,"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(Yo,"href","#transformers.TFXLMForTokenClassification"),p(go,"class","relative group"),p(Ua,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),p(oa,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(oa,"rel","nofollow"),p(Ra,"href","/docs/transformers/pr_15839/en/model_doc/xlm#transformers.TFXLMForTokenClassification"),p(at,"class","docstring"),p(Ae,"class","docstring"),p(tn,"id","transformers.TFXLMForQuestionAnsweringSimple"),p(tn,"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(tn,"href","#transformers.TFXLMForQuestionAnsweringSimple"),p(vo,"class","relative group"),p(Va,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.TFPreTrainedModel"),p(da,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(da,"rel","nofollow"),p(Ga,"href","/docs/transformers/pr_15839/en/model_doc/xlm#transformers.TFXLMForQuestionAnsweringSimple"),p(rt,"class","docstring"),p(Oe,"class","docstring")},m(o,u){e(document.head,h),m(o,F,u),m(o,f,u),e(f,_),e(_,k),w(v,k,null),e(f,g),e(f,X),e(X,de),m(o,G,u),m(o,x,u),e(x,Z),e(Z,I),w(ee,I,null),e(x,ce),e(x,D),e(D,pe),m(o,re,u),m(o,R,u),e(R,j),e(R,te),e(te,J),e(R,E),m(o,q,u),m(o,K,u),e(K,W),e(W,he),e(K,me),e(K,H),e(H,ue),e(K,fe),e(K,z),e(z,ge),m(o,Q,u),m(o,ne,u),e(ne,_e),m(o,B,u),m(o,se,u),e(se,ae),e(ae,P),m(o,ie,u),m(o,O,u),e(O,ve),m(o,c,u),m(o,T,u),e(T,V),e(V,Te),e(T,be),e(T,C),e(C,Me),e(C,ke),e(ke,we),e(C,A),e(C,N),e(N,ye),e(C,Le),m(o,U,u),m(o,le,u),e(le,$e),e(le,oe),e(oe,Fe),e(le,Bd),e(le,ln),e(ln,Ud),e(le,Rd),m(o,gl,u),m(o,St,u),e(St,Mo),e(Mo,_r),w(dn,_r,null),e(St,Vd),e(St,vr),e(vr,Gd),m(o,_l,u),m(o,Ie,u),w(cn,Ie,null),e(Ie,Kd),e(Ie,gt),e(gt,Jd),e(gt,ga),e(ga,Yd),e(gt,Zd),e(gt,_a),e(_a,ec),e(gt,tc),e(gt,pn),e(pn,oc),e(gt,nc),e(Ie,sc),e(Ie,It),e(It,ac),e(It,va),e(va,rc),e(It,ic),e(It,ka),e(ka,lc),e(It,dc),e(Ie,cc),e(Ie,kr),e(kr,pc),e(Ie,hc),w(hn,Ie,null),m(o,vl,u),m(o,Dt,u),e(Dt,wo),e(wo,Tr),w(mn,Tr,null),e(Dt,mc),e(Dt,br),e(br,uc),m(o,kl,u),m(o,Xe,u),w(un,Xe,null),e(Xe,fc),e(Xe,Mr),e(Mr,gc),e(Xe,_c),e(Xe,De),e(De,wr),e(wr,vc),e(De,kc),e(De,yr),e(yr,Tc),e(De,bc),e(De,Lr),e(Lr,Mc),e(De,wc),e(De,_t),e(_t,yc),e(_t,$r),e($r,Lc),e(_t,$c),e(_t,Fr),e(Fr,Fc),e(_t,Xc),e(_t,Xr),e(Xr,xc),e(_t,Ec),e(De,zc),e(De,fn),e(fn,qc),e(fn,xr),e(xr,Cc),e(fn,jc),e(De,Pc),e(De,gn),e(gn,Ac),e(gn,Er),e(Er,Oc),e(gn,Nc),e(Xe,Sc),e(Xe,_n),e(_n,Ic),e(_n,Ta),e(Ta,Dc),e(_n,Wc),e(Xe,Hc),e(Xe,vt),w(vn,vt,null),e(vt,Qc),e(vt,zr),e(zr,Bc),e(vt,Uc),e(vt,kn),e(kn,ba),e(ba,Rc),e(ba,qr),e(qr,Vc),e(kn,Gc),e(kn,Ma),e(Ma,Kc),e(Ma,Cr),e(Cr,Jc),e(Xe,Yc),e(Xe,yo),w(Tn,yo,null),e(yo,Zc),e(yo,bn),e(bn,ep),e(bn,jr),e(jr,tp),e(bn,op),e(Xe,np),e(Xe,lt),w(Mn,lt,null),e(lt,sp),e(lt,Pr),e(Pr,ap),e(lt,rp),w(wn,lt,null),e(lt,ip),e(lt,Wt),e(Wt,lp),e(Wt,Ar),e(Ar,dp),e(Wt,cp),e(Wt,Or),e(Or,pp),e(Wt,hp),e(Xe,mp),e(Xe,wa),w(yn,wa,null),m(o,Tl,u),m(o,Ht,u),e(Ht,Lo),e(Lo,Nr),w(Ln,Nr,null),e(Ht,up),e(Ht,Sr),e(Sr,fp),m(o,bl,u),m(o,Qt,u),w($n,Qt,null),e(Qt,gp),e(Qt,Fn),e(Fn,_p),e(Fn,Ir),e(Ir,vp),e(Fn,kp),m(o,Ml,u),m(o,Bt,u),e(Bt,$o),e($o,Dr),w(Xn,Dr,null),e(Bt,Tp),e(Bt,Wr),e(Wr,bp),m(o,wl,u),m(o,We,u),w(xn,We,null),e(We,Mp),e(We,Hr),e(Hr,wp),e(We,yp),e(We,En),e(En,Lp),e(En,ya),e(ya,$p),e(En,Fp),e(We,Xp),e(We,zn),e(zn,xp),e(zn,qn),e(qn,Ep),e(zn,zp),e(We,qp),e(We,Ge),w(Cn,Ge,null),e(Ge,Cp),e(Ge,Ut),e(Ut,jp),e(Ut,La),e(La,Pp),e(Ut,Ap),e(Ut,Qr),e(Qr,Op),e(Ut,Np),e(Ge,Sp),w(Fo,Ge,null),e(Ge,Ip),e(Ge,Br),e(Br,Dp),e(Ge,Wp),w(jn,Ge,null),m(o,yl,u),m(o,Rt,u),e(Rt,Xo),e(Xo,Ur),w(Pn,Ur,null),e(Rt,Hp),e(Rt,Rr),e(Rr,Qp),m(o,Ll,u),m(o,He,u),w(An,He,null),e(He,Bp),e(He,Vr),e(Vr,Up),e(He,Rp),e(He,On),e(On,Vp),e(On,$a),e($a,Gp),e(On,Kp),e(He,Jp),e(He,Nn),e(Nn,Yp),e(Nn,Sn),e(Sn,Zp),e(Nn,eh),e(He,th),e(He,Ke),w(In,Ke,null),e(Ke,oh),e(Ke,Vt),e(Vt,nh),e(Vt,Fa),e(Fa,sh),e(Vt,ah),e(Vt,Gr),e(Gr,rh),e(Vt,ih),e(Ke,lh),w(xo,Ke,null),e(Ke,dh),e(Ke,Kr),e(Kr,ch),e(Ke,ph),w(Dn,Ke,null),m(o,$l,u),m(o,Gt,u),e(Gt,Eo),e(Eo,Jr),w(Wn,Jr,null),e(Gt,hh),e(Gt,Yr),e(Yr,mh),m(o,Fl,u),m(o,Qe,u),w(Hn,Qe,null),e(Qe,uh),e(Qe,Zr),e(Zr,fh),e(Qe,gh),e(Qe,Qn),e(Qn,_h),e(Qn,Xa),e(Xa,vh),e(Qn,kh),e(Qe,Th),e(Qe,Bn),e(Bn,bh),e(Bn,Un),e(Un,Mh),e(Bn,wh),e(Qe,yh),e(Qe,Ee),w(Rn,Ee,null),e(Ee,Lh),e(Ee,Kt),e(Kt,$h),e(Kt,xa),e(xa,Fh),e(Kt,Xh),e(Kt,ei),e(ei,xh),e(Kt,Eh),e(Ee,zh),w(zo,Ee,null),e(Ee,qh),e(Ee,ti),e(ti,Ch),e(Ee,jh),w(Vn,Ee,null),e(Ee,Ph),e(Ee,oi),e(oi,Ah),e(Ee,Oh),w(Gn,Ee,null),m(o,Xl,u),m(o,Jt,u),e(Jt,qo),e(qo,ni),w(Kn,ni,null),e(Jt,Nh),e(Jt,si),e(si,Sh),m(o,xl,u),m(o,Be,u),w(Jn,Be,null),e(Be,Ih),e(Be,ai),e(ai,Dh),e(Be,Wh),e(Be,Yn),e(Yn,Hh),e(Yn,Ea),e(Ea,Qh),e(Yn,Bh),e(Be,Uh),e(Be,Zn),e(Zn,Rh),e(Zn,es),e(es,Vh),e(Zn,Gh),e(Be,Kh),e(Be,Je),w(ts,Je,null),e(Je,Jh),e(Je,Yt),e(Yt,Yh),e(Yt,za),e(za,Zh),e(Yt,em),e(Yt,ri),e(ri,tm),e(Yt,om),e(Je,nm),w(Co,Je,null),e(Je,sm),e(Je,ii),e(ii,am),e(Je,rm),w(os,Je,null),m(o,El,u),m(o,Zt,u),e(Zt,jo),e(jo,li),w(ns,li,null),e(Zt,im),e(Zt,di),e(di,lm),m(o,zl,u),m(o,Ue,u),w(ss,Ue,null),e(Ue,dm),e(Ue,ci),e(ci,cm),e(Ue,pm),e(Ue,as),e(as,hm),e(as,qa),e(qa,mm),e(as,um),e(Ue,fm),e(Ue,rs),e(rs,gm),e(rs,is),e(is,_m),e(rs,vm),e(Ue,km),e(Ue,Ye),w(ls,Ye,null),e(Ye,Tm),e(Ye,eo),e(eo,bm),e(eo,Ca),e(Ca,Mm),e(eo,wm),e(eo,pi),e(pi,ym),e(eo,Lm),e(Ye,$m),w(Po,Ye,null),e(Ye,Fm),e(Ye,hi),e(hi,Xm),e(Ye,xm),w(ds,Ye,null),m(o,ql,u),m(o,to,u),e(to,Ao),e(Ao,mi),w(cs,mi,null),e(to,Em),e(to,ui),e(ui,zm),m(o,Cl,u),m(o,Re,u),w(ps,Re,null),e(Re,qm),e(Re,oo),e(oo,Cm),e(oo,fi),e(fi,jm),e(oo,Pm),e(oo,gi),e(gi,Am),e(oo,Om),e(Re,Nm),e(Re,hs),e(hs,Sm),e(hs,ja),e(ja,Im),e(hs,Dm),e(Re,Wm),e(Re,ms),e(ms,Hm),e(ms,us),e(us,Qm),e(ms,Bm),e(Re,Um),e(Re,Ze),w(fs,Ze,null),e(Ze,Rm),e(Ze,no),e(no,Vm),e(no,Pa),e(Pa,Gm),e(no,Km),e(no,_i),e(_i,Jm),e(no,Ym),e(Ze,Zm),w(Oo,Ze,null),e(Ze,eu),e(Ze,vi),e(vi,tu),e(Ze,ou),w(gs,Ze,null),m(o,jl,u),m(o,so,u),e(so,No),e(No,ki),w(_s,ki,null),e(so,nu),e(so,Ti),e(Ti,su),m(o,Pl,u),m(o,Ve,u),w(vs,Ve,null),e(Ve,au),e(Ve,ao),e(ao,ru),e(ao,bi),e(bi,iu),e(ao,lu),e(ao,Mi),e(Mi,du),e(ao,cu),e(Ve,pu),e(Ve,ks),e(ks,hu),e(ks,Aa),e(Aa,mu),e(ks,uu),e(Ve,fu),e(Ve,Ts),e(Ts,gu),e(Ts,bs),e(bs,_u),e(Ts,vu),e(Ve,ku),e(Ve,et),w(Ms,et,null),e(et,Tu),e(et,ro),e(ro,bu),e(ro,Oa),e(Oa,Mu),e(ro,wu),e(ro,wi),e(wi,yu),e(ro,Lu),e(et,$u),w(So,et,null),e(et,Fu),e(et,yi),e(yi,Xu),e(et,xu),w(ws,et,null),m(o,Al,u),m(o,io,u),e(io,Io),e(Io,Li),w(ys,Li,null),e(io,Eu),e(io,$i),e($i,zu),m(o,Ol,u),m(o,qe,u),w(Ls,qe,null),e(qe,qu),e(qe,Fi),e(Fi,Cu),e(qe,ju),e(qe,$s),e($s,Pu),e($s,Na),e(Na,Au),e($s,Ou),e(qe,Nu),e(qe,Fs),e(Fs,Su),e(Fs,Xs),e(Xs,Iu),e(Fs,Du),e(qe,Wu),w(Do,qe,null),e(qe,Hu),e(qe,tt),w(xs,tt,null),e(tt,Qu),e(tt,lo),e(lo,Bu),e(lo,Sa),e(Sa,Uu),e(lo,Ru),e(lo,Xi),e(Xi,Vu),e(lo,Gu),e(tt,Ku),w(Wo,tt,null),e(tt,Ju),e(tt,xi),e(xi,Yu),e(tt,Zu),w(Es,tt,null),m(o,Nl,u),m(o,co,u),e(co,Ho),e(Ho,Ei),w(zs,Ei,null),e(co,ef),e(co,zi),e(zi,tf),m(o,Sl,u),m(o,Ce,u),w(qs,Ce,null),e(Ce,of),e(Ce,qi),e(qi,nf),e(Ce,sf),e(Ce,Cs),e(Cs,af),e(Cs,Ia),e(Ia,rf),e(Cs,lf),e(Ce,df),e(Ce,js),e(js,cf),e(js,Ps),e(Ps,pf),e(js,hf),e(Ce,mf),w(Qo,Ce,null),e(Ce,uf),e(Ce,ot),w(As,ot,null),e(ot,ff),e(ot,po),e(po,gf),e(po,Da),e(Da,_f),e(po,vf),e(po,Ci),e(Ci,kf),e(po,Tf),e(ot,bf),w(Bo,ot,null),e(ot,Mf),e(ot,ji),e(ji,wf),e(ot,yf),w(Os,ot,null),m(o,Il,u),m(o,ho,u),e(ho,Uo),e(Uo,Pi),w(Ns,Pi,null),e(ho,Lf),e(ho,Ai),e(Ai,$f),m(o,Dl,u),m(o,je,u),w(Ss,je,null),e(je,Ff),e(je,Oi),e(Oi,Xf),e(je,xf),e(je,Is),e(Is,Ef),e(Is,Wa),e(Wa,zf),e(Is,qf),e(je,Cf),e(je,Ds),e(Ds,jf),e(Ds,Ws),e(Ws,Pf),e(Ds,Af),e(je,Of),w(Ro,je,null),e(je,Nf),e(je,nt),w(Hs,nt,null),e(nt,Sf),e(nt,mo),e(mo,If),e(mo,Ha),e(Ha,Df),e(mo,Wf),e(mo,Ni),e(Ni,Hf),e(mo,Qf),e(nt,Bf),w(Vo,nt,null),e(nt,Uf),e(nt,Si),e(Si,Rf),e(nt,Vf),w(Qs,nt,null),m(o,Wl,u),m(o,uo,u),e(uo,Go),e(Go,Ii),w(Bs,Ii,null),e(uo,Gf),e(uo,Di),e(Di,Kf),m(o,Hl,u),m(o,Pe,u),w(Us,Pe,null),e(Pe,Jf),e(Pe,Wi),e(Wi,Yf),e(Pe,Zf),e(Pe,Rs),e(Rs,eg),e(Rs,Qa),e(Qa,tg),e(Rs,og),e(Pe,ng),e(Pe,Vs),e(Vs,sg),e(Vs,Gs),e(Gs,ag),e(Vs,rg),e(Pe,ig),w(Ko,Pe,null),e(Pe,lg),e(Pe,st),w(Ks,st,null),e(st,dg),e(st,fo),e(fo,cg),e(fo,Ba),e(Ba,pg),e(fo,hg),e(fo,Hi),e(Hi,mg),e(fo,ug),e(st,fg),w(Jo,st,null),e(st,gg),e(st,Qi),e(Qi,_g),e(st,vg),w(Js,st,null),m(o,Ql,u),m(o,go,u),e(go,Yo),e(Yo,Bi),w(Ys,Bi,null),e(go,kg),e(go,Ui),e(Ui,Tg),m(o,Bl,u),m(o,Ae,u),w(Zs,Ae,null),e(Ae,bg),e(Ae,Ri),e(Ri,Mg),e(Ae,wg),e(Ae,ea),e(ea,yg),e(ea,Ua),e(Ua,Lg),e(ea,$g),e(Ae,Fg),e(Ae,ta),e(ta,Xg),e(ta,oa),e(oa,xg),e(ta,Eg),e(Ae,zg),w(Zo,Ae,null),e(Ae,qg),e(Ae,at),w(na,at,null),e(at,Cg),e(at,_o),e(_o,jg),e(_o,Ra),e(Ra,Pg),e(_o,Ag),e(_o,Vi),e(Vi,Og),e(_o,Ng),e(at,Sg),w(en,at,null),e(at,Ig),e(at,Gi),e(Gi,Dg),e(at,Wg),w(sa,at,null),m(o,Ul,u),m(o,vo,u),e(vo,tn),e(tn,Ki),w(aa,Ki,null),e(vo,Hg),e(vo,Ji),e(Ji,Qg),m(o,Rl,u),m(o,Oe,u),w(ra,Oe,null),e(Oe,Bg),e(Oe,ko),e(ko,Ug),e(ko,Yi),e(Yi,Rg),e(ko,Vg),e(ko,Zi),e(Zi,Gg),e(ko,Kg),e(Oe,Jg),e(Oe,ia),e(ia,Yg),e(ia,Va),e(Va,Zg),e(ia,e_),e(Oe,t_),e(Oe,la),e(la,o_),e(la,da),e(da,n_),e(la,s_),e(Oe,a_),w(on,Oe,null),e(Oe,r_),e(Oe,rt),w(ca,rt,null),e(rt,i_),e(rt,To),e(To,l_),e(To,Ga),e(Ga,d_),e(To,c_),e(To,el),e(el,p_),e(To,h_),e(rt,m_),w(nn,rt,null),e(rt,u_),e(rt,tl),e(tl,f_),e(rt,g_),w(pa,rt,null),Vl=!0},p(o,[u]){const ha={};u&2&&(ha.$$scope={dirty:u,ctx:o}),Fo.$set(ha);const ol={};u&2&&(ol.$$scope={dirty:u,ctx:o}),xo.$set(ol);const nl={};u&2&&(nl.$$scope={dirty:u,ctx:o}),zo.$set(nl);const sl={};u&2&&(sl.$$scope={dirty:u,ctx:o}),Co.$set(sl);const ma={};u&2&&(ma.$$scope={dirty:u,ctx:o}),Po.$set(ma);const al={};u&2&&(al.$$scope={dirty:u,ctx:o}),Oo.$set(al);const rl={};u&2&&(rl.$$scope={dirty:u,ctx:o}),So.$set(rl);const il={};u&2&&(il.$$scope={dirty:u,ctx:o}),Do.$set(il);const ua={};u&2&&(ua.$$scope={dirty:u,ctx:o}),Wo.$set(ua);const ll={};u&2&&(ll.$$scope={dirty:u,ctx:o}),Qo.$set(ll);const bo={};u&2&&(bo.$$scope={dirty:u,ctx:o}),Bo.$set(bo);const dl={};u&2&&(dl.$$scope={dirty:u,ctx:o}),Ro.$set(dl);const cl={};u&2&&(cl.$$scope={dirty:u,ctx:o}),Vo.$set(cl);const pl={};u&2&&(pl.$$scope={dirty:u,ctx:o}),Ko.$set(pl);const hl={};u&2&&(hl.$$scope={dirty:u,ctx:o}),Jo.$set(hl);const ml={};u&2&&(ml.$$scope={dirty:u,ctx:o}),Zo.$set(ml);const ul={};u&2&&(ul.$$scope={dirty:u,ctx:o}),en.$set(ul);const fl={};u&2&&(fl.$$scope={dirty:u,ctx:o}),on.$set(fl);const fa={};u&2&&(fa.$$scope={dirty:u,ctx:o}),nn.$set(fa)},i(o){Vl||(y(v.$$.fragment,o),y(ee.$$.fragment,o),y(dn.$$.fragment,o),y(cn.$$.fragment,o),y(hn.$$.fragment,o),y(mn.$$.fragment,o),y(un.$$.fragment,o),y(vn.$$.fragment,o),y(Tn.$$.fragment,o),y(Mn.$$.fragment,o),y(wn.$$.fragment,o),y(yn.$$.fragment,o),y(Ln.$$.fragment,o),y($n.$$.fragment,o),y(Xn.$$.fragment,o),y(xn.$$.fragment,o),y(Cn.$$.fragment,o),y(Fo.$$.fragment,o),y(jn.$$.fragment,o),y(Pn.$$.fragment,o),y(An.$$.fragment,o),y(In.$$.fragment,o),y(xo.$$.fragment,o),y(Dn.$$.fragment,o),y(Wn.$$.fragment,o),y(Hn.$$.fragment,o),y(Rn.$$.fragment,o),y(zo.$$.fragment,o),y(Vn.$$.fragment,o),y(Gn.$$.fragment,o),y(Kn.$$.fragment,o),y(Jn.$$.fragment,o),y(ts.$$.fragment,o),y(Co.$$.fragment,o),y(os.$$.fragment,o),y(ns.$$.fragment,o),y(ss.$$.fragment,o),y(ls.$$.fragment,o),y(Po.$$.fragment,o),y(ds.$$.fragment,o),y(cs.$$.fragment,o),y(ps.$$.fragment,o),y(fs.$$.fragment,o),y(Oo.$$.fragment,o),y(gs.$$.fragment,o),y(_s.$$.fragment,o),y(vs.$$.fragment,o),y(Ms.$$.fragment,o),y(So.$$.fragment,o),y(ws.$$.fragment,o),y(ys.$$.fragment,o),y(Ls.$$.fragment,o),y(Do.$$.fragment,o),y(xs.$$.fragment,o),y(Wo.$$.fragment,o),y(Es.$$.fragment,o),y(zs.$$.fragment,o),y(qs.$$.fragment,o),y(Qo.$$.fragment,o),y(As.$$.fragment,o),y(Bo.$$.fragment,o),y(Os.$$.fragment,o),y(Ns.$$.fragment,o),y(Ss.$$.fragment,o),y(Ro.$$.fragment,o),y(Hs.$$.fragment,o),y(Vo.$$.fragment,o),y(Qs.$$.fragment,o),y(Bs.$$.fragment,o),y(Us.$$.fragment,o),y(Ko.$$.fragment,o),y(Ks.$$.fragment,o),y(Jo.$$.fragment,o),y(Js.$$.fragment,o),y(Ys.$$.fragment,o),y(Zs.$$.fragment,o),y(Zo.$$.fragment,o),y(na.$$.fragment,o),y(en.$$.fragment,o),y(sa.$$.fragment,o),y(aa.$$.fragment,o),y(ra.$$.fragment,o),y(on.$$.fragment,o),y(ca.$$.fragment,o),y(nn.$$.fragment,o),y(pa.$$.fragment,o),Vl=!0)},o(o){L(v.$$.fragment,o),L(ee.$$.fragment,o),L(dn.$$.fragment,o),L(cn.$$.fragment,o),L(hn.$$.fragment,o),L(mn.$$.fragment,o),L(un.$$.fragment,o),L(vn.$$.fragment,o),L(Tn.$$.fragment,o),L(Mn.$$.fragment,o),L(wn.$$.fragment,o),L(yn.$$.fragment,o),L(Ln.$$.fragment,o),L($n.$$.fragment,o),L(Xn.$$.fragment,o),L(xn.$$.fragment,o),L(Cn.$$.fragment,o),L(Fo.$$.fragment,o),L(jn.$$.fragment,o),L(Pn.$$.fragment,o),L(An.$$.fragment,o),L(In.$$.fragment,o),L(xo.$$.fragment,o),L(Dn.$$.fragment,o),L(Wn.$$.fragment,o),L(Hn.$$.fragment,o),L(Rn.$$.fragment,o),L(zo.$$.fragment,o),L(Vn.$$.fragment,o),L(Gn.$$.fragment,o),L(Kn.$$.fragment,o),L(Jn.$$.fragment,o),L(ts.$$.fragment,o),L(Co.$$.fragment,o),L(os.$$.fragment,o),L(ns.$$.fragment,o),L(ss.$$.fragment,o),L(ls.$$.fragment,o),L(Po.$$.fragment,o),L(ds.$$.fragment,o),L(cs.$$.fragment,o),L(ps.$$.fragment,o),L(fs.$$.fragment,o),L(Oo.$$.fragment,o),L(gs.$$.fragment,o),L(_s.$$.fragment,o),L(vs.$$.fragment,o),L(Ms.$$.fragment,o),L(So.$$.fragment,o),L(ws.$$.fragment,o),L(ys.$$.fragment,o),L(Ls.$$.fragment,o),L(Do.$$.fragment,o),L(xs.$$.fragment,o),L(Wo.$$.fragment,o),L(Es.$$.fragment,o),L(zs.$$.fragment,o),L(qs.$$.fragment,o),L(Qo.$$.fragment,o),L(As.$$.fragment,o),L(Bo.$$.fragment,o),L(Os.$$.fragment,o),L(Ns.$$.fragment,o),L(Ss.$$.fragment,o),L(Ro.$$.fragment,o),L(Hs.$$.fragment,o),L(Vo.$$.fragment,o),L(Qs.$$.fragment,o),L(Bs.$$.fragment,o),L(Us.$$.fragment,o),L(Ko.$$.fragment,o),L(Ks.$$.fragment,o),L(Jo.$$.fragment,o),L(Js.$$.fragment,o),L(Ys.$$.fragment,o),L(Zs.$$.fragment,o),L(Zo.$$.fragment,o),L(na.$$.fragment,o),L(en.$$.fragment,o),L(sa.$$.fragment,o),L(aa.$$.fragment,o),L(ra.$$.fragment,o),L(on.$$.fragment,o),L(ca.$$.fragment,o),L(nn.$$.fragment,o),L(pa.$$.fragment,o),Vl=!1},d(o){t(h),o&&t(F),o&&t(f),$(v),o&&t(G),o&&t(x),$(ee),o&&t(re),o&&t(R),o&&t(q),o&&t(K),o&&t(Q),o&&t(ne),o&&t(B),o&&t(se),o&&t(ie),o&&t(O),o&&t(c),o&&t(T),o&&t(U),o&&t(le),o&&t(gl),o&&t(St),$(dn),o&&t(_l),o&&t(Ie),$(cn),$(hn),o&&t(vl),o&&t(Dt),$(mn),o&&t(kl),o&&t(Xe),$(un),$(vn),$(Tn),$(Mn),$(wn),$(yn),o&&t(Tl),o&&t(Ht),$(Ln),o&&t(bl),o&&t(Qt),$($n),o&&t(Ml),o&&t(Bt),$(Xn),o&&t(wl),o&&t(We),$(xn),$(Cn),$(Fo),$(jn),o&&t(yl),o&&t(Rt),$(Pn),o&&t(Ll),o&&t(He),$(An),$(In),$(xo),$(Dn),o&&t($l),o&&t(Gt),$(Wn),o&&t(Fl),o&&t(Qe),$(Hn),$(Rn),$(zo),$(Vn),$(Gn),o&&t(Xl),o&&t(Jt),$(Kn),o&&t(xl),o&&t(Be),$(Jn),$(ts),$(Co),$(os),o&&t(El),o&&t(Zt),$(ns),o&&t(zl),o&&t(Ue),$(ss),$(ls),$(Po),$(ds),o&&t(ql),o&&t(to),$(cs),o&&t(Cl),o&&t(Re),$(ps),$(fs),$(Oo),$(gs),o&&t(jl),o&&t(so),$(_s),o&&t(Pl),o&&t(Ve),$(vs),$(Ms),$(So),$(ws),o&&t(Al),o&&t(io),$(ys),o&&t(Ol),o&&t(qe),$(Ls),$(Do),$(xs),$(Wo),$(Es),o&&t(Nl),o&&t(co),$(zs),o&&t(Sl),o&&t(Ce),$(qs),$(Qo),$(As),$(Bo),$(Os),o&&t(Il),o&&t(ho),$(Ns),o&&t(Dl),o&&t(je),$(Ss),$(Ro),$(Hs),$(Vo),$(Qs),o&&t(Wl),o&&t(uo),$(Bs),o&&t(Hl),o&&t(Pe),$(Us),$(Ko),$(Ks),$(Jo),$(Js),o&&t(Ql),o&&t(go),$(Ys),o&&t(Bl),o&&t(Ae),$(Zs),$(Zo),$(na),$(en),$(sa),o&&t(Ul),o&&t(vo),$(aa),o&&t(Rl),o&&t(Oe),$(ra),$(on),$(ca),$(nn),$(pa)}}}const DT={local:"xlm",sections:[{local:"overview",title:"Overview"},{local:"transformers.XLMConfig",title:"XLMConfig"},{local:"transformers.XLMTokenizer",title:"XLMTokenizer"},{local:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput",title:"XLM specific outputs"},{local:"transformers.XLMModel",title:"XLMModel"},{local:"transformers.XLMWithLMHeadModel",title:"XLMWithLMHeadModel"},{local:"transformers.XLMForSequenceClassification",title:"XLMForSequenceClassification"},{local:"transformers.XLMForMultipleChoice",title:"XLMForMultipleChoice"},{local:"transformers.XLMForTokenClassification",title:"XLMForTokenClassification"},{local:"transformers.XLMForQuestionAnsweringSimple",title:"XLMForQuestionAnsweringSimple"},{local:"transformers.XLMForQuestionAnswering",title:"XLMForQuestionAnswering"},{local:"transformers.TFXLMModel",title:"TFXLMModel"},{local:"transformers.TFXLMWithLMHeadModel",title:"TFXLMWithLMHeadModel"},{local:"transformers.TFXLMForSequenceClassification",title:"TFXLMForSequenceClassification"},{local:"transformers.TFXLMForMultipleChoice",title:"TFXLMForMultipleChoice"},{local:"transformers.TFXLMForTokenClassification",title:"TFXLMForTokenClassification"},{local:"transformers.TFXLMForQuestionAnsweringSimple",title:"TFXLMForQuestionAnsweringSimple"}],title:"XLM"};function WT(S,h,F){let{fw:f}=h;return S.$$set=_=>{"fw"in _&&F(0,f=_.fw)},[f]}class GT extends _T{constructor(h){super();vT(this,h,WT,IT,kT,{fw:0})}}export{GT as default,DT as metadata};
