import{S as Qp,i as Yp,s as eh,e as n,k as d,w as b,t as r,M as th,c as s,d as t,m as c,a,x as T,h as i,b as h,G as e,g,y as w,q as M,o as L,B as $,v as oh,L as En}from"../../chunks/vendor-hf-doc-builder.js";import{T as vo}from"../../chunks/Tip-hf-doc-builder.js";import{D as N}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Gn}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ct}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Xn}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function nh(X){let p,y,f,m,k;return m=new Gn({props:{code:`from transformers import XGLMModel, XGLMConfig

# Initializing a XGLM facebook/xglm-564M style configuration
configuration = XGLMConfig()

# Initializing a model from the facebook/xglm-564M style configuration
model = XGLMModel(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> XGLMModel, XGLMConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a XGLM facebook/xglm-564M style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = XGLMConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the facebook/xglm-564M style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XGLMModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){p=n("p"),y=r("Example:"),f=d(),b(m.$$.fragment)},l(l){p=s(l,"P",{});var u=a(p);y=i(u,"Example:"),u.forEach(t),f=c(l),T(m.$$.fragment,l)},m(l,u){g(l,p,u),e(p,y),g(l,f,u),w(m,l,u),k=!0},p:En,i(l){k||(M(m.$$.fragment,l),k=!0)},o(l){L(m.$$.fragment,l),k=!1},d(l){l&&t(p),l&&t(f),$(m,l)}}}function sh(X){let p,y,f,m,k;return{c(){p=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=r("Module"),k=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){p=s(l,"P",{});var u=a(p);y=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(u,"CODE",{});var z=a(f);m=i(z,"Module"),z.forEach(t),k=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){g(l,p,u),e(p,y),e(p,f),e(f,m),e(p,k)},d(l){l&&t(p)}}}function ah(X){let p,y,f,m,k;return m=new Gn({props:{code:`from transformers import AutoTokenizer, XGLMModel
import torch

tokenizer = AutoTokenizer.from_pretrained("facebook/xglm-564M")
model = XGLMModel.from_pretrained("facebook/xglm-564M")

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/xglm-564M&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XGLMModel.from_pretrained(<span class="hljs-string">&quot;facebook/xglm-564M&quot;</span>)

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

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

tokenizer = AutoTokenizer.from_pretrained("facebook/xglm-564M")
model = XGLMForCausalLM.from_pretrained("facebook/xglm-564M")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/xglm-564M&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XGLMForCausalLM.from_pretrained(<span class="hljs-string">&quot;facebook/xglm-564M&quot;</span>)

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

tokenizer = AutoTokenizer.from_pretrained("facebook/xglm-564M")
model = TFXGLMModel.from_pretrained("facebook/xglm-564M")

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/xglm-564M&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXGLMModel.from_pretrained(<span class="hljs-string">&quot;facebook/xglm-564M&quot;</span>)

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

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

tokenizer = AutoTokenizer.from_pretrained("facebook/xglm-564M")
model = TFXGLMForCausalLM.from_pretrained("facebook/xglm-564M")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/xglm-564M&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXGLMForCausalLM.from_pretrained(<span class="hljs-string">&quot;facebook/xglm-564M&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){p=n("p"),y=r("Example:"),f=d(),b(m.$$.fragment)},l(l){p=s(l,"P",{});var u=a(p);y=i(u,"Example:"),u.forEach(t),f=c(l),T(m.$$.fragment,l)},m(l,u){g(l,p,u),e(p,y),g(l,f,u),w(m,l,u),k=!0},p:En,i(l){k||(M(m.$$.fragment,l),k=!0)},o(l){L(m.$$.fragment,l),k=!1},d(l){l&&t(p),l&&t(f),$(m,l)}}}function mh(X){let p,y,f,m,k;return{c(){p=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=r("Module"),k=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){p=s(l,"P",{});var u=a(p);y=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(u,"CODE",{});var z=a(f);m=i(z,"Module"),z.forEach(t),k=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){g(l,p,u),e(p,y),e(p,f),e(f,m),e(p,k)},d(l){l&&t(p)}}}function fh(X){let p,y,f,m,k;return m=new Gn({props:{code:`from transformers import AutoTokenizer, FlaxXGLMModel

tokenizer = AutoTokenizer.from_pretrained("facebook/xglm-564M")
model = FlaxXGLMModel.from_pretrained("facebook/xglm-564M")

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/xglm-564M&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxXGLMModel.from_pretrained(<span class="hljs-string">&quot;facebook/xglm-564M&quot;</span>)

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

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

tokenizer = AutoTokenizer.from_pretrained("facebook/xglm-564M")
model = FlaxXGLMForCausalLM.from_pretrained("facebook/xglm-564M")

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/xglm-564M&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxXGLMForCausalLM.from_pretrained(<span class="hljs-string">&quot;facebook/xglm-564M&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve logts for next token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_token_logits = outputs.logits[:, -<span class="hljs-number">1</span>]`}}),{c(){p=n("p"),y=r("Example:"),f=d(),b(m.$$.fragment)},l(l){p=s(l,"P",{});var u=a(p);y=i(u,"Example:"),u.forEach(t),f=c(l),T(m.$$.fragment,l)},m(l,u){g(l,p,u),e(p,y),g(l,f,u),w(m,l,u),k=!0},p:En,i(l){k||(M(m.$$.fragment,l),k=!0)},o(l){L(m.$$.fragment,l),k=!1},d(l){l&&t(p),l&&t(f),$(m,l)}}}function kh(X){let p,y,f,m,k,l,u,z,Ue,ze,j,te,ne,x,Re,V,He,Fe,I,Ve,se,ae,Ke,Xe,U,Je,Ee,R,we,Ze,ke,E,O,re,ie,Qe,le,de,Ye,Ge,C,oe,K,ce,et,J,tt,qe,P,pe,he,Z,Me,A,ot,S,ue,nt,v,F,me,Le,Ce,kt,G,Pe,yt,vt,bt,ye,H,D,ve,st,W,Tt,at,rt,pt,q,$e,lr,it,dr,qn,cr,pr,Cn,hr,ur,bo,mr,fr,gr,To,_r,Pn,kr,yr,vr,ht,wo,br,cs,Tr,wr,Mo,An,Mr,ps,Lr,$r,jn,xr,hs,zr,Fr,jt,Lo,Xr,$o,Er,us,Gr,qr,Cr,Ot,xo,Pr,ms,Ar,jr,On,zo,ka,wt,Dt,fs,Fo,Or,gs,Dr,ya,fe,Xo,Nr,xe,Ir,_s,Sr,Wr,Dn,Br,Ur,Nn,Rr,Hr,Eo,Vr,Kr,Jr,Go,Zr,In,Qr,Yr,ei,ut,qo,ti,ks,oi,ni,Co,Sn,si,ys,ai,ri,Wn,ii,vs,li,di,Nt,Po,ci,bs,pi,va,Mt,It,Ts,Ao,hi,ws,ui,ba,ge,jo,mi,Oo,fi,Bn,gi,_i,ki,Do,yi,No,vi,bi,Ti,St,wi,Ms,Mi,Li,Ls,$i,xi,Ae,Io,zi,Lt,Fi,Un,Xi,Ei,$s,Gi,qi,Ci,Wt,Pi,Bt,Ta,$t,Ut,xs,So,Ai,zs,ji,wa,_e,Wo,Oi,Fs,Di,Ni,Bo,Ii,Rn,Si,Wi,Bi,Uo,Ui,Ro,Ri,Hi,Vi,je,Ho,Ki,xt,Ji,Hn,Zi,Qi,Xs,Yi,el,tl,Rt,ol,Ht,Ma,zt,Vt,Es,Vo,nl,Gs,sl,La,Q,Ko,al,Jo,rl,Vn,il,ll,dl,Zo,cl,Qo,pl,hl,ul,Kt,ml,Jt,fl,qs,gl,_l,Cs,kl,yl,Oe,Yo,vl,Ft,bl,Kn,Tl,wl,Ps,Ml,Ll,$l,Zt,xl,Qt,$a,Xt,Yt,As,en,zl,js,Fl,xa,Y,tn,Xl,Os,El,Gl,on,ql,Jn,Cl,Pl,Al,nn,jl,sn,Ol,Dl,Nl,eo,Il,De,an,Sl,Et,Wl,Zn,Bl,Ul,Ds,Rl,Hl,Vl,to,Kl,oo,za,Gt,no,Ns,rn,Jl,Is,Zl,Fa,ee,ln,Ql,dn,Yl,Qn,ed,td,od,cn,nd,pn,sd,ad,rd,Ss,id,ld,lt,Ws,hn,dd,cd,Bs,un,pd,hd,Us,mn,ud,md,Rs,fn,fd,gd,Ne,gn,_d,qt,kd,Hs,yd,vd,Vs,bd,Td,wd,so,Md,ao,Xa,Ct,ro,Ks,_n,Ld,Js,$d,Ea,B,kn,xd,Zs,zd,Fd,yn,Xd,Yn,Ed,Gd,qd,vn,Cd,bn,Pd,Ad,jd,Qs,Od,Dd,dt,Ys,Tn,Nd,Id,ea,wn,Sd,Wd,ta,Mn,Bd,Ud,oa,Ln,Rd,Hd,Ie,$n,Vd,Pt,Kd,na,Jd,Zd,sa,Qd,Yd,ec,io,tc,lo,Ga;return l=new ct({}),x=new ct({}),ce=new ct({}),pe=new N({props:{name:"class transformers.XGLMConfig",anchor:"transformers.XGLMConfig",parameters:[{name:"vocab_size",val:" = 256008"},{name:"max_position_embeddings",val:" = 2048"},{name:"d_model",val:" = 1024"},{name:"ffn_dim",val:" = 4096"},{name:"num_layers",val:" = 24"},{name:"attention_heads",val:" = 16"},{name:"activation_function",val:" = 'gelu'"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.1"},{name:"activation_dropout",val:" = 0.0"},{name:"layerdrop",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"scale_embedding",val:" = True"},{name:"use_cache",val:" = True"},{name:"decoder_start_token_id",val:" = 2"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XGLMConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256008) &#x2014;
Vocabulary size of the XGLM model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/xglm#transformers.XGLMModel">XGLMModel</a> or <a href="/docs/transformers/main/en/model_doc/xglm#transformers.FlaxXGLMModel">FlaxXGLMModel</a>.`,name:"vocab_size"},{anchor:"transformers.XGLMConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#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.XGLMConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimension of the layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.XGLMConfig.ffn_dim",description:`<strong>ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"ffn_dim"},{anchor:"transformers.XGLMConfig.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014;
Number of hidden layers Transformer decoder.`,name:"num_layers"},{anchor:"transformers.XGLMConfig.attention_heads",description:`<strong>attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"attention_heads"},{anchor:"transformers.XGLMConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"activation_function"},{anchor:"transformers.XGLMConfig.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, dencoder, and pooler.`,name:"dropout"},{anchor:"transformers.XGLMConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.XGLMConfig.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for activations inside the fully connected layer.`,name:"activation_dropout"},{anchor:"transformers.XGLMConfig.layerdrop",description:`<strong>layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the encoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"layerdrop"},{anchor:"transformers.XGLMConfig.init_std",description:`<strong>init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"init_std"},{anchor:"transformers.XGLMConfig.scale_embedding",description:`<strong>scale_embedding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Scale embeddings by diving by sqrt(d_model).`,name:"scale_embedding"},{anchor:"transformers.XGLMConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/configuration_xglm.py#L29"}}),ye=new Xn({props:{anchor:"transformers.XGLMConfig.example",$$slots:{default:[nh]},$$scope:{ctx:X}}}),W=new ct({}),$e=new N({props:{name:"class transformers.XGLMTokenizer",anchor:"transformers.XGLMTokenizer",parameters:[{name:"vocab_file",val:""},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XGLMTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.XGLMTokenizer.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.XGLMTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence 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 end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.XGLMTokenizer.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.XGLMTokenizer.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.XGLMTokenizer.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.XGLMTokenizer.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.XGLMTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&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.XGLMTokenizer.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>, defaults to <code>[&quot;&lt;s&gt;NOTUSED&quot;, &quot;&lt;/s&gt;NOTUSED&quot;]</code>) &#x2014;
Additional special tokens used by the tokenizer.`,name:"additional_special_tokens"},{anchor:"transformers.XGLMTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:</p>
<ul>
<li>
<p><code>enable_sampling</code>: Enable subword regularization.</p>
</li>
<li>
<p><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.</p>
<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul>
</li>
<li>
<p><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</p>
</li>
</ul>`,name:"sp_model_kwargs"},{anchor:"transformers.XGLMTokenizer.sp_model",description:`<strong>sp_model</strong> (<code>SentencePieceProcessor</code>) &#x2014;
The <em>SentencePiece</em> processor that is used for every conversion (string, tokens and IDs).`,name:"sp_model"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/tokenization_xglm.py#L43"}}),wo=new N({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.XGLMTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.XGLMTokenizer.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.XGLMTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/tokenization_xglm.py#L189",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>
`}}),Lo=new N({props:{name:"get_special_tokens_mask",anchor:"transformers.XGLMTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.XGLMTokenizer.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.XGLMTokenizer.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.XGLMTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/tokenization_xglm.py#L214",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>
`}}),xo=new N({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.XGLMTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.XGLMTokenizer.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.XGLMTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/tokenization_xglm.py#L242",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),zo=new N({props:{name:"save_vocabulary",anchor:"transformers.XGLMTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/tokenization_xglm.py#L298"}}),Fo=new ct({}),Xo=new N({props:{name:"class transformers.XGLMTokenizerFast",anchor:"transformers.XGLMTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XGLMTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.XGLMTokenizerFast.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.XGLMTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence 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 end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.XGLMTokenizerFast.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.XGLMTokenizerFast.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.XGLMTokenizerFast.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.XGLMTokenizerFast.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.XGLMTokenizerFast.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>, defaults to <code>[&quot;&lt;s&gt;NOTUSED&quot;, &quot;&lt;/s&gt;NOTUSED&quot;]</code>) &#x2014;
Additional special tokens used by the tokenizer.`,name:"additional_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/tokenization_xglm_fast.py#L49"}}),qo=new N({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.XGLMTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.XGLMTokenizerFast.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.XGLMTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/tokenization_xglm_fast.py#L139",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>
`}}),Po=new N({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.XGLMTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.XGLMTokenizerFast.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.XGLMTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/tokenization_xglm_fast.py#L164",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Ao=new ct({}),jo=new N({props:{name:"class transformers.XGLMModel",anchor:"transformers.XGLMModel",parameters:[{name:"config",val:": XGLMConfig"},{name:"embed_tokens",val:": typing.Optional[torch.nn.modules.sparse.Embedding] = None"}],parametersDescription:[{anchor:"transformers.XGLMModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xglm#transformers.XGLMConfig">XGLMConfig</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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.
config &#x2014; XGLMConfig`,name:"config"},{anchor:"transformers.XGLMModel.embed_tokens",description:"<strong>embed_tokens</strong> (nn.Embedding) &#x2014; output embedding",name:"embed_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/modeling_xglm.py#L534"}}),Io=new N({props:{name:"forward",anchor:"transformers.XGLMModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XGLMModel.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. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.XGLMModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.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.XGLMModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. 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.XGLMModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>. inputs_embeds (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): 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:"past_key_values"},{anchor:"transformers.XGLMModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_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. If
<code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>). 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.XGLMModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.XGLMModel.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.XGLMModel.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.XGLMModel.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>Args &#x2014;
input_ids (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>):
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you
provide it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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>
attention_mask (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
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>
encoder_hidden_states (<code>torch.FloatTensor</code> of shape <code>(batch_size, encoder_sequence_length, hidden_size)</code>, <em>optional</em>):
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention
of the decoder.
encoder_attention_mask (<code>torch.LongTensor</code> of shape <code>(batch_size, encoder_sequence_length)</code>, <em>optional</em>):
Mask to avoid performing cross-attention on padding tokens indices of encoder input_ids. 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>
head_mask (<code>torch.Tensor</code> of shape <code>(num_layers, attention_heads)</code>, <em>optional</em>):
Mask to nullify selected heads of the 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>
<p>cross_attn_head_mask (<code>torch.Tensor</code> of shape <code>(num_layers, attention_heads)</code>, <em>optional</em>):
Mask to nullify selected heads of the cross-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>
<p>past_key_values (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>):
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of
shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the
cross-attention blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those
that don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of
all <code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>. inputs_embeds (<code>torch.FloatTensor</code> of
shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): 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.
output_attentions (<code>bool</code>, <em>optional</em>):
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under
returned tensors for more detail.
output_hidden_states (<code>bool</code>, <em>optional</em>):
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors
for more detail.
return_dict (<code>bool</code>, <em>optional</em>):
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/modeling_xglm.py#L592",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</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/main/en/model_doc/xglm#transformers.XGLMConfig"
>XGLMConfig</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>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Wt=new vo({props:{$$slots:{default:[sh]},$$scope:{ctx:X}}}),Bt=new Xn({props:{anchor:"transformers.XGLMModel.forward.example",$$slots:{default:[ah]},$$scope:{ctx:X}}}),So=new ct({}),Wo=new N({props:{name:"class transformers.XGLMForCausalLM",anchor:"transformers.XGLMForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XGLMForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xglm#transformers.XGLMConfig">XGLMConfig</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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/modeling_xglm.py#L822"}}),Ho=new N({props:{name:"forward",anchor:"transformers.XGLMForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XGLMForCausalLM.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. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.XGLMForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.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.XGLMForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. 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.XGLMForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>. inputs_embeds (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): 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:"past_key_values"},{anchor:"transformers.XGLMForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_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. If
<code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>). 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.XGLMForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.XGLMForCausalLM.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.XGLMForCausalLM.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.XGLMForCausalLM.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XGLMForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/modeling_xglm.py#L853",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/xglm#transformers.XGLMConfig"
>XGLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Rt=new vo({props:{$$slots:{default:[rh]},$$scope:{ctx:X}}}),Ht=new Xn({props:{anchor:"transformers.XGLMForCausalLM.forward.example",$$slots:{default:[ih]},$$scope:{ctx:X}}}),Vo=new ct({}),Ko=new N({props:{name:"class transformers.TFXGLMModel",anchor:"transformers.TFXGLMModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFXGLMModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xglm#transformers.XGLMConfig">XGLMConfig</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/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.
config &#x2014; XGLMConfig
embed_tokens &#x2014; [TFSharedEmbeddings]: output embedding`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/modeling_tf_xglm.py#L772"}}),Kt=new vo({props:{$$slots:{default:[lh]},$$scope:{ctx:X}}}),Yo=new N({props:{name:"call",anchor:"transformers.TFXGLMModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_hidden_states",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"cross_attn_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:": typing.Any"}],parametersDescription:[{anchor:"transformers.TFXGLMModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.TFXGLMModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>({0})</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.TFXGLMModel.call.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, encoder_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention of
the decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.TFXGLMModel.call.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, encoder_sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing cross-attention on padding tokens indices of encoder input_ids. 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:"encoder_attention_mask"},{anchor:"transformers.TFXGLMModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_layers, attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. 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.TFXGLMModel.call.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_layers, attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-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:"cross_attn_head_mask"},{anchor:"transformers.TFXGLMModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.num_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFXGLMModel.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.TFXGLMModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"},{anchor:"transformers.TFXGLMModel.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.TFXGLMModel.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.TFXGLMModel.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFXGLMModel.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/modeling_tf_xglm.py#L788",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPastAndCrossAttentions</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/main/en/model_doc/xglm#transformers.XGLMConfig"
>XGLMConfig</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>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.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>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Zt=new vo({props:{$$slots:{default:[dh]},$$scope:{ctx:X}}}),Qt=new Xn({props:{anchor:"transformers.TFXGLMModel.call.example",$$slots:{default:[ch]},$$scope:{ctx:X}}}),en=new ct({}),tn=new N({props:{name:"class transformers.TFXGLMForCausalLM",anchor:"transformers.TFXGLMForCausalLM",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFXGLMForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xglm#transformers.XGLMConfig">XGLMConfig</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/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/modeling_tf_xglm.py#L857"}}),eo=new vo({props:{$$slots:{default:[ph]},$$scope:{ctx:X}}}),an=new N({props:{name:"call",anchor:"transformers.TFXGLMForCausalLM.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_hidden_states",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"cross_attn_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:": typing.Any"}],parametersDescription:[{anchor:"transformers.TFXGLMForCausalLM.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.TFXGLMForCausalLM.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>({0})</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.TFXGLMForCausalLM.call.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, encoder_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention of
the decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.TFXGLMForCausalLM.call.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, encoder_sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing cross-attention on padding tokens indices of encoder input_ids. 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:"encoder_attention_mask"},{anchor:"transformers.TFXGLMForCausalLM.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_layers, attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. 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.TFXGLMForCausalLM.call.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_layers, attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-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:"cross_attn_head_mask"},{anchor:"transformers.TFXGLMForCausalLM.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.num_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFXGLMForCausalLM.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.TFXGLMForCausalLM.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"},{anchor:"transformers.TFXGLMForCausalLM.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.TFXGLMForCausalLM.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.TFXGLMForCausalLM.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFXGLMForCausalLM.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.TFXGLMForCausalLM.call.labels",description:`<strong>labels</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/modeling_tf_xglm.py#L903",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/xglm#transformers.XGLMConfig"
>XGLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or <code>tuple(tf.Tensor)</code>: A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/xglm#transformers.XGLMConfig"
>XGLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),to=new vo({props:{$$slots:{default:[hh]},$$scope:{ctx:X}}}),oo=new Xn({props:{anchor:"transformers.TFXGLMForCausalLM.call.example",$$slots:{default:[uh]},$$scope:{ctx:X}}}),rn=new ct({}),ln=new N({props:{name:"class transformers.FlaxXGLMModel",anchor:"transformers.FlaxXGLMModel",parameters:[{name:"config",val:": XGLMConfig"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxXGLMModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xglm#transformers.XGLMConfig">XGLMConfig</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/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxXGLMModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/modeling_flax_xglm.py#L702"}}),gn=new N({props:{name:"__call__",anchor:"transformers.FlaxXGLMModel.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"encoder_hidden_states",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"encoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"past_key_values",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxXGLMModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.FlaxXGLMModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxXGLMModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxXGLMModel.__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.`,name:"output_attentions"},{anchor:"transformers.FlaxXGLMModel.__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.`,name:"output_hidden_states"},{anchor:"transformers.FlaxXGLMModel.__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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/modeling_flax_xglm.py#L624",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</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/main/en/model_doc/xglm#transformers.XGLMConfig"
>XGLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),so=new vo({props:{$$slots:{default:[mh]},$$scope:{ctx:X}}}),ao=new Xn({props:{anchor:"transformers.FlaxXGLMModel.__call__.example",$$slots:{default:[fh]},$$scope:{ctx:X}}}),_n=new ct({}),kn=new N({props:{name:"class transformers.FlaxXGLMForCausalLM",anchor:"transformers.FlaxXGLMForCausalLM",parameters:[{name:"config",val:": XGLMConfig"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxXGLMForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xglm#transformers.XGLMConfig">XGLMConfig</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/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxXGLMForCausalLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/modeling_flax_xglm.py#L780"}}),$n=new N({props:{name:"__call__",anchor:"transformers.FlaxXGLMForCausalLM.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"encoder_hidden_states",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"encoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"past_key_values",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxXGLMForCausalLM.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.FlaxXGLMForCausalLM.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxXGLMForCausalLM.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxXGLMForCausalLM.__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.`,name:"output_attentions"},{anchor:"transformers.FlaxXGLMForCausalLM.__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.`,name:"output_hidden_states"},{anchor:"transformers.FlaxXGLMForCausalLM.__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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xglm/modeling_flax_xglm.py#L624",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/xglm#transformers.XGLMConfig"
>XGLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key, value
states of the self-attention and the cross-attention layers if model is used in encoder-decoder setting.
Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),io=new vo({props:{$$slots:{default:[gh]},$$scope:{ctx:X}}}),lo=new Xn({props:{anchor:"transformers.FlaxXGLMForCausalLM.__call__.example",$$slots:{default:[_h]},$$scope:{ctx:X}}}),{c(){p=n("meta"),y=d(),f=n("h1"),m=n("a"),k=n("span"),b(l.$$.fragment),u=d(),z=n("span"),Ue=r("XGLM"),ze=d(),j=n("h2"),te=n("a"),ne=n("span"),b(x.$$.fragment),Re=d(),V=n("span"),He=r("Overview"),Fe=d(),I=n("p"),Ve=r("The XGLM model was proposed in "),se=n("a"),ae=r("Few-shot Learning with Multilingual Language Models"),Ke=r(`
by Xi Victoria Lin, Todor Mihaylov, Mikel Artetxe, Tianlu Wang, Shuohui Chen, Daniel Simig, Myle Ott, Naman Goyal,
Shruti Bhosale, Jingfei Du, Ramakanth Pasunuru, Sam Shleifer, Punit Singh Koura, Vishrav Chaudhary, Brian O\u2019Horo,
Jeff Wang, Luke Zettlemoyer, Zornitsa Kozareva, Mona Diab, Veselin Stoyanov, Xian Li.`),Xe=d(),U=n("p"),Je=r("The abstract from the paper is the following:"),Ee=d(),R=n("p"),we=n("em"),Ze=r(`Large-scale autoregressive language models such as GPT-3 are few-shot learners that can perform a wide range of language
tasks without fine-tuning. While these models are known to be able to jointly represent many different languages,
their training data is dominated by English, potentially limiting their cross-lingual generalization.
In this work, we train multilingual autoregressive language models on a balanced corpus covering a diverse set of languages,
and study their few- and zero-shot learning capabilities in a wide range of tasks. Our largest model with 7.5 billion parameters
sets new state of the art in few-shot learning in more than 20 representative languages, outperforming GPT-3 of comparable size
in multilingual commonsense reasoning (with +7.4% absolute accuracy improvement in 0-shot settings and +9.4% in 4-shot settings)
and natural language inference (+5.4% in each of 0-shot and 4-shot settings). On the FLORES-101 machine translation benchmark,
our model outperforms GPT-3 on 171 out of 182 translation directions with 32 training examples, while surpassing the
official supervised baseline in 45 directions. We present a detailed analysis of where the model succeeds and fails,
showing in particular that it enables cross-lingual in-context learning on some tasks, while there is still room for improvement
on surface form robustness and adaptation to tasks that do not have a natural cloze form. Finally, we evaluate our models
in social value tasks such as hate speech detection in five languages and find it has limitations similar to comparable sized GPT-3 models.`),ke=d(),E=n("p"),O=r("This model was contributed by "),re=n("a"),ie=r("Suraj"),Qe=r(". The original code can be found "),le=n("a"),de=r("here"),Ye=r("."),Ge=d(),C=n("h2"),oe=n("a"),K=n("span"),b(ce.$$.fragment),et=d(),J=n("span"),tt=r("XGLMConfig"),qe=d(),P=n("div"),b(pe.$$.fragment),he=d(),Z=n("p"),Me=r("This is the configuration class to store the configuration of a "),A=n("a"),ot=r("XGLMModel"),S=r(`. It is used to instantiate an XGLM
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 XGLM
`),ue=n("a"),nt=r("facebook/xglm-564M"),v=r(" architecture."),F=d(),me=n("p"),Le=r("Configuration objects inherit from "),Ce=n("a"),kt=r("PretrainedConfig"),G=r(` and can be used to control the model outputs. Read the
documentation from `),Pe=n("a"),yt=r("PretrainedConfig"),vt=r(" for more information."),bt=d(),b(ye.$$.fragment),H=d(),D=n("h2"),ve=n("a"),st=n("span"),b(W.$$.fragment),Tt=d(),at=n("span"),rt=r("XGLMTokenizer"),pt=d(),q=n("div"),b($e.$$.fragment),lr=d(),it=n("p"),dr=r("Adapted from "),qn=n("a"),cr=r("RobertaTokenizer"),pr=r(" and "),Cn=n("a"),hr=r("XLNetTokenizer"),ur=r(`. Based on
`),bo=n("a"),mr=r("SentencePiece"),fr=r("."),gr=d(),To=n("p"),_r=r("This tokenizer inherits from "),Pn=n("a"),kr=r("PreTrainedTokenizer"),yr=r(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),vr=d(),ht=n("div"),b(wo.$$.fragment),br=d(),cs=n("p"),Tr=r(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An XLM-RoBERTa sequence has the following format:`),wr=d(),Mo=n("ul"),An=n("li"),Mr=r("single sequence: "),ps=n("code"),Lr=r("<s> X </s>"),$r=d(),jn=n("li"),xr=r("pair of sequences: "),hs=n("code"),zr=r("<s> A </s></s> B </s>"),Fr=d(),jt=n("div"),b(Lo.$$.fragment),Xr=d(),$o=n("p"),Er=r(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),us=n("code"),Gr=r("prepare_for_model"),qr=r(" method."),Cr=d(),Ot=n("div"),b(xo.$$.fragment),Pr=d(),ms=n("p"),Ar=r(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. XLM-RoBERTa does
not make use of token type ids, therefore a list of zeros is returned.`),jr=d(),On=n("div"),b(zo.$$.fragment),ka=d(),wt=n("h2"),Dt=n("a"),fs=n("span"),b(Fo.$$.fragment),Or=d(),gs=n("span"),Dr=r("XGLMTokenizerFast"),ya=d(),fe=n("div"),b(Xo.$$.fragment),Nr=d(),xe=n("p"),Ir=r("Construct a \u201Cfast\u201D XGLM tokenizer (backed by HuggingFace\u2019s "),_s=n("em"),Sr=r("tokenizers"),Wr=r(" library). Adapted from "),Dn=n("a"),Br=r("RobertaTokenizer"),Ur=r(`
and `),Nn=n("a"),Rr=r("XLNetTokenizer"),Hr=r(`. Based on
`),Eo=n("a"),Vr=r("BPE"),Kr=r("."),Jr=d(),Go=n("p"),Zr=r("This tokenizer inherits from "),In=n("a"),Qr=r("PreTrainedTokenizerFast"),Yr=r(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),ei=d(),ut=n("div"),b(qo.$$.fragment),ti=d(),ks=n("p"),oi=r(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An XLM-RoBERTa sequence has the following format:`),ni=d(),Co=n("ul"),Sn=n("li"),si=r("single sequence: "),ys=n("code"),ai=r("<s> X </s>"),ri=d(),Wn=n("li"),ii=r("pair of sequences: "),vs=n("code"),li=r("<s> A </s></s> B </s>"),di=d(),Nt=n("div"),b(Po.$$.fragment),ci=d(),bs=n("p"),pi=r(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. XLM-RoBERTa does
not make use of token type ids, therefore a list of zeros is returned.`),va=d(),Mt=n("h2"),It=n("a"),Ts=n("span"),b(Ao.$$.fragment),hi=d(),ws=n("span"),ui=r("XGLMModel"),ba=d(),ge=n("div"),b(jo.$$.fragment),mi=d(),Oo=n("p"),fi=r(`The bare XGLM Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Bn=n("a"),gi=r("PreTrainedModel"),_i=r(`. 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.)`),ki=d(),Do=n("p"),yi=r("This model is also a PyTorch "),No=n("a"),vi=r("torch.nn.Module"),bi=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ti=d(),St=n("p"),wi=r("Transformer decoder consisting of "),Ms=n("em"),Mi=r("config.num_layers"),Li=r(" layers. Each layer is a "),Ls=n("code"),$i=r("XGLMDecoderLayer"),xi=d(),Ae=n("div"),b(Io.$$.fragment),zi=d(),Lt=n("p"),Fi=r("The "),Un=n("a"),Xi=r("XGLMModel"),Ei=r(" forward method, overrides the "),$s=n("code"),Gi=r("__call__"),qi=r(" special method."),Ci=d(),b(Wt.$$.fragment),Pi=d(),b(Bt.$$.fragment),Ta=d(),$t=n("h2"),Ut=n("a"),xs=n("span"),b(So.$$.fragment),Ai=d(),zs=n("span"),ji=r("XGLMForCausalLM"),wa=d(),_e=n("div"),b(Wo.$$.fragment),Oi=d(),Fs=n("p"),Di=r(`The XGLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Ni=d(),Bo=n("p"),Ii=r("This model inherits from "),Rn=n("a"),Si=r("PreTrainedModel"),Wi=r(`. 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.)`),Bi=d(),Uo=n("p"),Ui=r("This model is also a PyTorch "),Ro=n("a"),Ri=r("torch.nn.Module"),Hi=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Vi=d(),je=n("div"),b(Ho.$$.fragment),Ki=d(),xt=n("p"),Ji=r("The "),Hn=n("a"),Zi=r("XGLMForCausalLM"),Qi=r(" forward method, overrides the "),Xs=n("code"),Yi=r("__call__"),el=r(" special method."),tl=d(),b(Rt.$$.fragment),ol=d(),b(Ht.$$.fragment),Ma=d(),zt=n("h2"),Vt=n("a"),Es=n("span"),b(Vo.$$.fragment),nl=d(),Gs=n("span"),sl=r("TFXGLMModel"),La=d(),Q=n("div"),b(Ko.$$.fragment),al=d(),Jo=n("p"),rl=r(`The bare XGLM Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Vn=n("a"),il=r("TFPreTrainedModel"),ll=r(`. 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.)`),dl=d(),Zo=n("p"),cl=r("This model is also a "),Qo=n("a"),pl=r("tf.keras.Model"),hl=r(` 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.`),ul=d(),b(Kt.$$.fragment),ml=d(),Jt=n("p"),fl=r("Transformer decoder consisting of "),qs=n("em"),gl=r("config.num_layers"),_l=r(" layers. Each layer is a "),Cs=n("code"),kl=r("TFXGLMDecoderLayer"),yl=d(),Oe=n("div"),b(Yo.$$.fragment),vl=d(),Ft=n("p"),bl=r("The "),Kn=n("a"),Tl=r("TFXGLMModel"),wl=r(" forward method, overrides the "),Ps=n("code"),Ml=r("__call__"),Ll=r(" special method."),$l=d(),b(Zt.$$.fragment),xl=d(),b(Qt.$$.fragment),$a=d(),Xt=n("h2"),Yt=n("a"),As=n("span"),b(en.$$.fragment),zl=d(),js=n("span"),Fl=r("TFXGLMForCausalLM"),xa=d(),Y=n("div"),b(tn.$$.fragment),Xl=d(),Os=n("p"),El=r(`The XGLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Gl=d(),on=n("p"),ql=r("This model inherits from "),Jn=n("a"),Cl=r("TFPreTrainedModel"),Pl=r(`. 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.)`),Al=d(),nn=n("p"),jl=r("This model is also a "),sn=n("a"),Ol=r("tf.keras.Model"),Dl=r(` 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.`),Nl=d(),b(eo.$$.fragment),Il=d(),De=n("div"),b(an.$$.fragment),Sl=d(),Et=n("p"),Wl=r("The "),Zn=n("a"),Bl=r("TFXGLMForCausalLM"),Ul=r(" forward method, overrides the "),Ds=n("code"),Rl=r("__call__"),Hl=r(" special method."),Vl=d(),b(to.$$.fragment),Kl=d(),b(oo.$$.fragment),za=d(),Gt=n("h2"),no=n("a"),Ns=n("span"),b(rn.$$.fragment),Jl=d(),Is=n("span"),Zl=r("FlaxXGLMModel"),Fa=d(),ee=n("div"),b(ln.$$.fragment),Ql=d(),dn=n("p"),Yl=r(`The bare XGLM Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Qn=n("a"),ed=r("FlaxPreTrainedModel"),td=r(`. 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=d(),cn=n("p"),nd=r(`This model is also a Flax Linen
`),pn=n("a"),sd=r("flax.nn.Module"),ad=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),rd=d(),Ss=n("p"),id=r("Finally, this model supports inherent JAX features such as:"),ld=d(),lt=n("ul"),Ws=n("li"),hn=n("a"),dd=r("Just-In-Time (JIT) compilation"),cd=d(),Bs=n("li"),un=n("a"),pd=r("Automatic Differentiation"),hd=d(),Us=n("li"),mn=n("a"),ud=r("Vectorization"),md=d(),Rs=n("li"),fn=n("a"),fd=r("Parallelization"),gd=d(),Ne=n("div"),b(gn.$$.fragment),_d=d(),qt=n("p"),kd=r("The "),Hs=n("code"),yd=r("FlaxXGLMPreTrainedModel"),vd=r(" forward method, overrides the "),Vs=n("code"),bd=r("__call__"),Td=r(" special method."),wd=d(),b(so.$$.fragment),Md=d(),b(ao.$$.fragment),Xa=d(),Ct=n("h2"),ro=n("a"),Ks=n("span"),b(_n.$$.fragment),Ld=d(),Js=n("span"),$d=r("FlaxXGLMForCausalLM"),Ea=d(),B=n("div"),b(kn.$$.fragment),xd=d(),Zs=n("p"),zd=r(`The XGLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Fd=d(),yn=n("p"),Xd=r("This model inherits from "),Yn=n("a"),Ed=r("FlaxPreTrainedModel"),Gd=r(`. 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.)`),qd=d(),vn=n("p"),Cd=r(`This model is also a Flax Linen
`),bn=n("a"),Pd=r("flax.nn.Module"),Ad=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),jd=d(),Qs=n("p"),Od=r("Finally, this model supports inherent JAX features such as:"),Dd=d(),dt=n("ul"),Ys=n("li"),Tn=n("a"),Nd=r("Just-In-Time (JIT) compilation"),Id=d(),ea=n("li"),wn=n("a"),Sd=r("Automatic Differentiation"),Wd=d(),ta=n("li"),Mn=n("a"),Bd=r("Vectorization"),Ud=d(),oa=n("li"),Ln=n("a"),Rd=r("Parallelization"),Hd=d(),Ie=n("div"),b($n.$$.fragment),Vd=d(),Pt=n("p"),Kd=r("The "),na=n("code"),Jd=r("FlaxXGLMPreTrainedModel"),Zd=r(" forward method, overrides the "),sa=n("code"),Qd=r("__call__"),Yd=r(" special method."),ec=d(),b(io.$$.fragment),tc=d(),b(lo.$$.fragment),this.h()},l(o){const _=th('[data-svelte="svelte-1phssyn"]',document.head);p=s(_,"META",{name:!0,content:!0}),_.forEach(t),y=c(o),f=s(o,"H1",{class:!0});var xn=a(f);m=s(xn,"A",{id:!0,class:!0,href:!0});var aa=a(m);k=s(aa,"SPAN",{});var ra=a(k);T(l.$$.fragment,ra),ra.forEach(t),aa.forEach(t),u=c(xn),z=s(xn,"SPAN",{});var ia=a(z);Ue=i(ia,"XGLM"),ia.forEach(t),xn.forEach(t),ze=c(o),j=s(o,"H2",{class:!0});var zn=a(j);te=s(zn,"A",{id:!0,class:!0,href:!0});var la=a(te);ne=s(la,"SPAN",{});var da=a(ne);T(x.$$.fragment,da),da.forEach(t),la.forEach(t),Re=c(zn),V=s(zn,"SPAN",{});var ca=a(V);He=i(ca,"Overview"),ca.forEach(t),zn.forEach(t),Fe=c(o),I=s(o,"P",{});var Fn=a(I);Ve=i(Fn,"The XGLM model was proposed in "),se=s(Fn,"A",{href:!0,rel:!0});var pa=a(se);ae=i(pa,"Few-shot Learning with Multilingual Language Models"),pa.forEach(t),Ke=i(Fn,`
by Xi Victoria Lin, Todor Mihaylov, Mikel Artetxe, Tianlu Wang, Shuohui Chen, Daniel Simig, Myle Ott, Naman Goyal,
Shruti Bhosale, Jingfei Du, Ramakanth Pasunuru, Sam Shleifer, Punit Singh Koura, Vishrav Chaudhary, Brian O\u2019Horo,
Jeff Wang, Luke Zettlemoyer, Zornitsa Kozareva, Mona Diab, Veselin Stoyanov, Xian Li.`),Fn.forEach(t),Xe=c(o),U=s(o,"P",{});var ha=a(U);Je=i(ha,"The abstract from the paper is the following:"),ha.forEach(t),Ee=c(o),R=s(o,"P",{});var ua=a(R);we=s(ua,"EM",{});var ma=a(we);Ze=i(ma,`Large-scale autoregressive language models such as GPT-3 are few-shot learners that can perform a wide range of language
tasks without fine-tuning. While these models are known to be able to jointly represent many different languages,
their training data is dominated by English, potentially limiting their cross-lingual generalization.
In this work, we train multilingual autoregressive language models on a balanced corpus covering a diverse set of languages,
and study their few- and zero-shot learning capabilities in a wide range of tasks. Our largest model with 7.5 billion parameters
sets new state of the art in few-shot learning in more than 20 representative languages, outperforming GPT-3 of comparable size
in multilingual commonsense reasoning (with +7.4% absolute accuracy improvement in 0-shot settings and +9.4% in 4-shot settings)
and natural language inference (+5.4% in each of 0-shot and 4-shot settings). On the FLORES-101 machine translation benchmark,
our model outperforms GPT-3 on 171 out of 182 translation directions with 32 training examples, while surpassing the
official supervised baseline in 45 directions. We present a detailed analysis of where the model succeeds and fails,
showing in particular that it enables cross-lingual in-context learning on some tasks, while there is still room for improvement
on surface form robustness and adaptation to tasks that do not have a natural cloze form. Finally, we evaluate our models
in social value tasks such as hate speech detection in five languages and find it has limitations similar to comparable sized GPT-3 models.`),ma.forEach(t),ua.forEach(t),ke=c(o),E=s(o,"P",{});var At=a(E);O=i(At,"This model was contributed by "),re=s(At,"A",{href:!0,rel:!0});var fa=a(re);ie=i(fa,"Suraj"),fa.forEach(t),Qe=i(At,". The original code can be found "),le=s(At,"A",{href:!0,rel:!0});var rc=a(le);de=i(rc,"here"),rc.forEach(t),Ye=i(At,"."),At.forEach(t),Ge=c(o),C=s(o,"H2",{class:!0});var qa=a(C);oe=s(qa,"A",{id:!0,class:!0,href:!0});var ic=a(oe);K=s(ic,"SPAN",{});var lc=a(K);T(ce.$$.fragment,lc),lc.forEach(t),ic.forEach(t),et=c(qa),J=s(qa,"SPAN",{});var dc=a(J);tt=i(dc,"XGLMConfig"),dc.forEach(t),qa.forEach(t),qe=c(o),P=s(o,"DIV",{class:!0});var co=a(P);T(pe.$$.fragment,co),he=c(co),Z=s(co,"P",{});var es=a(Z);Me=i(es,"This is the configuration class to store the configuration of a "),A=s(es,"A",{href:!0});var cc=a(A);ot=i(cc,"XGLMModel"),cc.forEach(t),S=i(es,`. It is used to instantiate an XGLM
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 XGLM
`),ue=s(es,"A",{href:!0,rel:!0});var pc=a(ue);nt=i(pc,"facebook/xglm-564M"),pc.forEach(t),v=i(es," architecture."),es.forEach(t),F=c(co),me=s(co,"P",{});var ts=a(me);Le=i(ts,"Configuration objects inherit from "),Ce=s(ts,"A",{href:!0});var hc=a(Ce);kt=i(hc,"PretrainedConfig"),hc.forEach(t),G=i(ts,` and can be used to control the model outputs. Read the
documentation from `),Pe=s(ts,"A",{href:!0});var uc=a(Pe);yt=i(uc,"PretrainedConfig"),uc.forEach(t),vt=i(ts," for more information."),ts.forEach(t),bt=c(co),T(ye.$$.fragment,co),co.forEach(t),H=c(o),D=s(o,"H2",{class:!0});var Ca=a(D);ve=s(Ca,"A",{id:!0,class:!0,href:!0});var mc=a(ve);st=s(mc,"SPAN",{});var fc=a(st);T(W.$$.fragment,fc),fc.forEach(t),mc.forEach(t),Tt=c(Ca),at=s(Ca,"SPAN",{});var gc=a(at);rt=i(gc,"XGLMTokenizer"),gc.forEach(t),Ca.forEach(t),pt=c(o),q=s(o,"DIV",{class:!0});var be=a(q);T($e.$$.fragment,be),lr=c(be),it=s(be,"P",{});var po=a(it);dr=i(po,"Adapted from "),qn=s(po,"A",{href:!0});var _c=a(qn);cr=i(_c,"RobertaTokenizer"),_c.forEach(t),pr=i(po," and "),Cn=s(po,"A",{href:!0});var kc=a(Cn);hr=i(kc,"XLNetTokenizer"),kc.forEach(t),ur=i(po,`. Based on
`),bo=s(po,"A",{href:!0,rel:!0});var yc=a(bo);mr=i(yc,"SentencePiece"),yc.forEach(t),fr=i(po,"."),po.forEach(t),gr=c(be),To=s(be,"P",{});var Pa=a(To);_r=i(Pa,"This tokenizer inherits from "),Pn=s(Pa,"A",{href:!0});var vc=a(Pn);kr=i(vc,"PreTrainedTokenizer"),vc.forEach(t),yr=i(Pa,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Pa.forEach(t),vr=c(be),ht=s(be,"DIV",{class:!0});var os=a(ht);T(wo.$$.fragment,os),br=c(os),cs=s(os,"P",{});var bc=a(cs);Tr=i(bc,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An XLM-RoBERTa sequence has the following format:`),bc.forEach(t),wr=c(os),Mo=s(os,"UL",{});var Aa=a(Mo);An=s(Aa,"LI",{});var oc=a(An);Mr=i(oc,"single sequence: "),ps=s(oc,"CODE",{});var Tc=a(ps);Lr=i(Tc,"<s> X </s>"),Tc.forEach(t),oc.forEach(t),$r=c(Aa),jn=s(Aa,"LI",{});var nc=a(jn);xr=i(nc,"pair of sequences: "),hs=s(nc,"CODE",{});var wc=a(hs);zr=i(wc,"<s> A </s></s> B </s>"),wc.forEach(t),nc.forEach(t),Aa.forEach(t),os.forEach(t),Fr=c(be),jt=s(be,"DIV",{class:!0});var ja=a(jt);T(Lo.$$.fragment,ja),Xr=c(ja),$o=s(ja,"P",{});var Oa=a($o);Er=i(Oa,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),us=s(Oa,"CODE",{});var Mc=a(us);Gr=i(Mc,"prepare_for_model"),Mc.forEach(t),qr=i(Oa," method."),Oa.forEach(t),ja.forEach(t),Cr=c(be),Ot=s(be,"DIV",{class:!0});var Da=a(Ot);T(xo.$$.fragment,Da),Pr=c(Da),ms=s(Da,"P",{});var Lc=a(ms);Ar=i(Lc,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. XLM-RoBERTa does
not make use of token type ids, therefore a list of zeros is returned.`),Lc.forEach(t),Da.forEach(t),jr=c(be),On=s(be,"DIV",{class:!0});var $c=a(On);T(zo.$$.fragment,$c),$c.forEach(t),be.forEach(t),ka=c(o),wt=s(o,"H2",{class:!0});var Na=a(wt);Dt=s(Na,"A",{id:!0,class:!0,href:!0});var xc=a(Dt);fs=s(xc,"SPAN",{});var zc=a(fs);T(Fo.$$.fragment,zc),zc.forEach(t),xc.forEach(t),Or=c(Na),gs=s(Na,"SPAN",{});var Fc=a(gs);Dr=i(Fc,"XGLMTokenizerFast"),Fc.forEach(t),Na.forEach(t),ya=c(o),fe=s(o,"DIV",{class:!0});var mt=a(fe);T(Xo.$$.fragment,mt),Nr=c(mt),xe=s(mt,"P",{});var ft=a(xe);Ir=i(ft,"Construct a \u201Cfast\u201D XGLM tokenizer (backed by HuggingFace\u2019s "),_s=s(ft,"EM",{});var Xc=a(_s);Sr=i(Xc,"tokenizers"),Xc.forEach(t),Wr=i(ft," library). Adapted from "),Dn=s(ft,"A",{href:!0});var Ec=a(Dn);Br=i(Ec,"RobertaTokenizer"),Ec.forEach(t),Ur=i(ft,`
and `),Nn=s(ft,"A",{href:!0});var Gc=a(Nn);Rr=i(Gc,"XLNetTokenizer"),Gc.forEach(t),Hr=i(ft,`. Based on
`),Eo=s(ft,"A",{href:!0,rel:!0});var qc=a(Eo);Vr=i(qc,"BPE"),qc.forEach(t),Kr=i(ft,"."),ft.forEach(t),Jr=c(mt),Go=s(mt,"P",{});var Ia=a(Go);Zr=i(Ia,"This tokenizer inherits from "),In=s(Ia,"A",{href:!0});var Cc=a(In);Qr=i(Cc,"PreTrainedTokenizerFast"),Cc.forEach(t),Yr=i(Ia,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Ia.forEach(t),ei=c(mt),ut=s(mt,"DIV",{class:!0});var ns=a(ut);T(qo.$$.fragment,ns),ti=c(ns),ks=s(ns,"P",{});var Pc=a(ks);oi=i(Pc,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An XLM-RoBERTa sequence has the following format:`),Pc.forEach(t),ni=c(ns),Co=s(ns,"UL",{});var Sa=a(Co);Sn=s(Sa,"LI",{});var sc=a(Sn);si=i(sc,"single sequence: "),ys=s(sc,"CODE",{});var Ac=a(ys);ai=i(Ac,"<s> X </s>"),Ac.forEach(t),sc.forEach(t),ri=c(Sa),Wn=s(Sa,"LI",{});var ac=a(Wn);ii=i(ac,"pair of sequences: "),vs=s(ac,"CODE",{});var jc=a(vs);li=i(jc,"<s> A </s></s> B </s>"),jc.forEach(t),ac.forEach(t),Sa.forEach(t),ns.forEach(t),di=c(mt),Nt=s(mt,"DIV",{class:!0});var Wa=a(Nt);T(Po.$$.fragment,Wa),ci=c(Wa),bs=s(Wa,"P",{});var Oc=a(bs);pi=i(Oc,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. XLM-RoBERTa does
not make use of token type ids, therefore a list of zeros is returned.`),Oc.forEach(t),Wa.forEach(t),mt.forEach(t),va=c(o),Mt=s(o,"H2",{class:!0});var Ba=a(Mt);It=s(Ba,"A",{id:!0,class:!0,href:!0});var Dc=a(It);Ts=s(Dc,"SPAN",{});var Nc=a(Ts);T(Ao.$$.fragment,Nc),Nc.forEach(t),Dc.forEach(t),hi=c(Ba),ws=s(Ba,"SPAN",{});var Ic=a(ws);ui=i(Ic,"XGLMModel"),Ic.forEach(t),Ba.forEach(t),ba=c(o),ge=s(o,"DIV",{class:!0});var gt=a(ge);T(jo.$$.fragment,gt),mi=c(gt),Oo=s(gt,"P",{});var Ua=a(Oo);fi=i(Ua,`The bare XGLM Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Bn=s(Ua,"A",{href:!0});var Sc=a(Bn);gi=i(Sc,"PreTrainedModel"),Sc.forEach(t),_i=i(Ua,`. 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.)`),Ua.forEach(t),ki=c(gt),Do=s(gt,"P",{});var Ra=a(Do);yi=i(Ra,"This model is also a PyTorch "),No=s(Ra,"A",{href:!0,rel:!0});var Wc=a(No);vi=i(Wc,"torch.nn.Module"),Wc.forEach(t),bi=i(Ra,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ra.forEach(t),Ti=c(gt),St=s(gt,"P",{});var ga=a(St);wi=i(ga,"Transformer decoder consisting of "),Ms=s(ga,"EM",{});var Bc=a(Ms);Mi=i(Bc,"config.num_layers"),Bc.forEach(t),Li=i(ga," layers. Each layer is a "),Ls=s(ga,"CODE",{});var Uc=a(Ls);$i=i(Uc,"XGLMDecoderLayer"),Uc.forEach(t),ga.forEach(t),xi=c(gt),Ae=s(gt,"DIV",{class:!0});var ho=a(Ae);T(Io.$$.fragment,ho),zi=c(ho),Lt=s(ho,"P",{});var ss=a(Lt);Fi=i(ss,"The "),Un=s(ss,"A",{href:!0});var Rc=a(Un);Xi=i(Rc,"XGLMModel"),Rc.forEach(t),Ei=i(ss," forward method, overrides the "),$s=s(ss,"CODE",{});var Hc=a($s);Gi=i(Hc,"__call__"),Hc.forEach(t),qi=i(ss," special method."),ss.forEach(t),Ci=c(ho),T(Wt.$$.fragment,ho),Pi=c(ho),T(Bt.$$.fragment,ho),ho.forEach(t),gt.forEach(t),Ta=c(o),$t=s(o,"H2",{class:!0});var Ha=a($t);Ut=s(Ha,"A",{id:!0,class:!0,href:!0});var Vc=a(Ut);xs=s(Vc,"SPAN",{});var Kc=a(xs);T(So.$$.fragment,Kc),Kc.forEach(t),Vc.forEach(t),Ai=c(Ha),zs=s(Ha,"SPAN",{});var Jc=a(zs);ji=i(Jc,"XGLMForCausalLM"),Jc.forEach(t),Ha.forEach(t),wa=c(o),_e=s(o,"DIV",{class:!0});var _t=a(_e);T(Wo.$$.fragment,_t),Oi=c(_t),Fs=s(_t,"P",{});var Zc=a(Fs);Di=i(Zc,`The XGLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Zc.forEach(t),Ni=c(_t),Bo=s(_t,"P",{});var Va=a(Bo);Ii=i(Va,"This model inherits from "),Rn=s(Va,"A",{href:!0});var Qc=a(Rn);Si=i(Qc,"PreTrainedModel"),Qc.forEach(t),Wi=i(Va,`. 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.)`),Va.forEach(t),Bi=c(_t),Uo=s(_t,"P",{});var Ka=a(Uo);Ui=i(Ka,"This model is also a PyTorch "),Ro=s(Ka,"A",{href:!0,rel:!0});var Yc=a(Ro);Ri=i(Yc,"torch.nn.Module"),Yc.forEach(t),Hi=i(Ka,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ka.forEach(t),Vi=c(_t),je=s(_t,"DIV",{class:!0});var uo=a(je);T(Ho.$$.fragment,uo),Ki=c(uo),xt=s(uo,"P",{});var as=a(xt);Ji=i(as,"The "),Hn=s(as,"A",{href:!0});var ep=a(Hn);Zi=i(ep,"XGLMForCausalLM"),ep.forEach(t),Qi=i(as," forward method, overrides the "),Xs=s(as,"CODE",{});var tp=a(Xs);Yi=i(tp,"__call__"),tp.forEach(t),el=i(as," special method."),as.forEach(t),tl=c(uo),T(Rt.$$.fragment,uo),ol=c(uo),T(Ht.$$.fragment,uo),uo.forEach(t),_t.forEach(t),Ma=c(o),zt=s(o,"H2",{class:!0});var Ja=a(zt);Vt=s(Ja,"A",{id:!0,class:!0,href:!0});var op=a(Vt);Es=s(op,"SPAN",{});var np=a(Es);T(Vo.$$.fragment,np),np.forEach(t),op.forEach(t),nl=c(Ja),Gs=s(Ja,"SPAN",{});var sp=a(Gs);sl=i(sp,"TFXGLMModel"),sp.forEach(t),Ja.forEach(t),La=c(o),Q=s(o,"DIV",{class:!0});var Se=a(Q);T(Ko.$$.fragment,Se),al=c(Se),Jo=s(Se,"P",{});var Za=a(Jo);rl=i(Za,`The bare XGLM Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Vn=s(Za,"A",{href:!0});var ap=a(Vn);il=i(ap,"TFPreTrainedModel"),ap.forEach(t),ll=i(Za,`. 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.)`),Za.forEach(t),dl=c(Se),Zo=s(Se,"P",{});var Qa=a(Zo);cl=i(Qa,"This model is also a "),Qo=s(Qa,"A",{href:!0,rel:!0});var rp=a(Qo);pl=i(rp,"tf.keras.Model"),rp.forEach(t),hl=i(Qa,` 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.`),Qa.forEach(t),ul=c(Se),T(Kt.$$.fragment,Se),ml=c(Se),Jt=s(Se,"P",{});var _a=a(Jt);fl=i(_a,"Transformer decoder consisting of "),qs=s(_a,"EM",{});var ip=a(qs);gl=i(ip,"config.num_layers"),ip.forEach(t),_l=i(_a," layers. Each layer is a "),Cs=s(_a,"CODE",{});var lp=a(Cs);kl=i(lp,"TFXGLMDecoderLayer"),lp.forEach(t),_a.forEach(t),yl=c(Se),Oe=s(Se,"DIV",{class:!0});var mo=a(Oe);T(Yo.$$.fragment,mo),vl=c(mo),Ft=s(mo,"P",{});var rs=a(Ft);bl=i(rs,"The "),Kn=s(rs,"A",{href:!0});var dp=a(Kn);Tl=i(dp,"TFXGLMModel"),dp.forEach(t),wl=i(rs," forward method, overrides the "),Ps=s(rs,"CODE",{});var cp=a(Ps);Ml=i(cp,"__call__"),cp.forEach(t),Ll=i(rs," special method."),rs.forEach(t),$l=c(mo),T(Zt.$$.fragment,mo),xl=c(mo),T(Qt.$$.fragment,mo),mo.forEach(t),Se.forEach(t),$a=c(o),Xt=s(o,"H2",{class:!0});var Ya=a(Xt);Yt=s(Ya,"A",{id:!0,class:!0,href:!0});var pp=a(Yt);As=s(pp,"SPAN",{});var hp=a(As);T(en.$$.fragment,hp),hp.forEach(t),pp.forEach(t),zl=c(Ya),js=s(Ya,"SPAN",{});var up=a(js);Fl=i(up,"TFXGLMForCausalLM"),up.forEach(t),Ya.forEach(t),xa=c(o),Y=s(o,"DIV",{class:!0});var We=a(Y);T(tn.$$.fragment,We),Xl=c(We),Os=s(We,"P",{});var mp=a(Os);El=i(mp,`The XGLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),mp.forEach(t),Gl=c(We),on=s(We,"P",{});var er=a(on);ql=i(er,"This model inherits from "),Jn=s(er,"A",{href:!0});var fp=a(Jn);Cl=i(fp,"TFPreTrainedModel"),fp.forEach(t),Pl=i(er,`. 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.)`),er.forEach(t),Al=c(We),nn=s(We,"P",{});var tr=a(nn);jl=i(tr,"This model is also a "),sn=s(tr,"A",{href:!0,rel:!0});var gp=a(sn);Ol=i(gp,"tf.keras.Model"),gp.forEach(t),Dl=i(tr,` 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.`),tr.forEach(t),Nl=c(We),T(eo.$$.fragment,We),Il=c(We),De=s(We,"DIV",{class:!0});var fo=a(De);T(an.$$.fragment,fo),Sl=c(fo),Et=s(fo,"P",{});var is=a(Et);Wl=i(is,"The "),Zn=s(is,"A",{href:!0});var _p=a(Zn);Bl=i(_p,"TFXGLMForCausalLM"),_p.forEach(t),Ul=i(is," forward method, overrides the "),Ds=s(is,"CODE",{});var kp=a(Ds);Rl=i(kp,"__call__"),kp.forEach(t),Hl=i(is," special method."),is.forEach(t),Vl=c(fo),T(to.$$.fragment,fo),Kl=c(fo),T(oo.$$.fragment,fo),fo.forEach(t),We.forEach(t),za=c(o),Gt=s(o,"H2",{class:!0});var or=a(Gt);no=s(or,"A",{id:!0,class:!0,href:!0});var yp=a(no);Ns=s(yp,"SPAN",{});var vp=a(Ns);T(rn.$$.fragment,vp),vp.forEach(t),yp.forEach(t),Jl=c(or),Is=s(or,"SPAN",{});var bp=a(Is);Zl=i(bp,"FlaxXGLMModel"),bp.forEach(t),or.forEach(t),Fa=c(o),ee=s(o,"DIV",{class:!0});var Be=a(ee);T(ln.$$.fragment,Be),Ql=c(Be),dn=s(Be,"P",{});var nr=a(dn);Yl=i(nr,`The bare XGLM Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Qn=s(nr,"A",{href:!0});var Tp=a(Qn);ed=i(Tp,"FlaxPreTrainedModel"),Tp.forEach(t),td=i(nr,`. 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.)`),nr.forEach(t),od=c(Be),cn=s(Be,"P",{});var sr=a(cn);nd=i(sr,`This model is also a Flax Linen
`),pn=s(sr,"A",{href:!0,rel:!0});var wp=a(pn);sd=i(wp,"flax.nn.Module"),wp.forEach(t),ad=i(sr,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),sr.forEach(t),rd=c(Be),Ss=s(Be,"P",{});var Mp=a(Ss);id=i(Mp,"Finally, this model supports inherent JAX features such as:"),Mp.forEach(t),ld=c(Be),lt=s(Be,"UL",{});var go=a(lt);Ws=s(go,"LI",{});var Lp=a(Ws);hn=s(Lp,"A",{href:!0,rel:!0});var $p=a(hn);dd=i($p,"Just-In-Time (JIT) compilation"),$p.forEach(t),Lp.forEach(t),cd=c(go),Bs=s(go,"LI",{});var xp=a(Bs);un=s(xp,"A",{href:!0,rel:!0});var zp=a(un);pd=i(zp,"Automatic Differentiation"),zp.forEach(t),xp.forEach(t),hd=c(go),Us=s(go,"LI",{});var Fp=a(Us);mn=s(Fp,"A",{href:!0,rel:!0});var Xp=a(mn);ud=i(Xp,"Vectorization"),Xp.forEach(t),Fp.forEach(t),md=c(go),Rs=s(go,"LI",{});var Ep=a(Rs);fn=s(Ep,"A",{href:!0,rel:!0});var Gp=a(fn);fd=i(Gp,"Parallelization"),Gp.forEach(t),Ep.forEach(t),go.forEach(t),gd=c(Be),Ne=s(Be,"DIV",{class:!0});var _o=a(Ne);T(gn.$$.fragment,_o),_d=c(_o),qt=s(_o,"P",{});var ls=a(qt);kd=i(ls,"The "),Hs=s(ls,"CODE",{});var qp=a(Hs);yd=i(qp,"FlaxXGLMPreTrainedModel"),qp.forEach(t),vd=i(ls," forward method, overrides the "),Vs=s(ls,"CODE",{});var Cp=a(Vs);bd=i(Cp,"__call__"),Cp.forEach(t),Td=i(ls," special method."),ls.forEach(t),wd=c(_o),T(so.$$.fragment,_o),Md=c(_o),T(ao.$$.fragment,_o),_o.forEach(t),Be.forEach(t),Xa=c(o),Ct=s(o,"H2",{class:!0});var ar=a(Ct);ro=s(ar,"A",{id:!0,class:!0,href:!0});var Pp=a(ro);Ks=s(Pp,"SPAN",{});var Ap=a(Ks);T(_n.$$.fragment,Ap),Ap.forEach(t),Pp.forEach(t),Ld=c(ar),Js=s(ar,"SPAN",{});var jp=a(Js);$d=i(jp,"FlaxXGLMForCausalLM"),jp.forEach(t),ar.forEach(t),Ea=c(o),B=s(o,"DIV",{class:!0});var Te=a(B);T(kn.$$.fragment,Te),xd=c(Te),Zs=s(Te,"P",{});var Op=a(Zs);zd=i(Op,`The XGLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Op.forEach(t),Fd=c(Te),yn=s(Te,"P",{});var rr=a(yn);Xd=i(rr,"This model inherits from "),Yn=s(rr,"A",{href:!0});var Dp=a(Yn);Ed=i(Dp,"FlaxPreTrainedModel"),Dp.forEach(t),Gd=i(rr,`. 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.)`),rr.forEach(t),qd=c(Te),vn=s(Te,"P",{});var ir=a(vn);Cd=i(ir,`This model is also a Flax Linen
`),bn=s(ir,"A",{href:!0,rel:!0});var Np=a(bn);Pd=i(Np,"flax.nn.Module"),Np.forEach(t),Ad=i(ir,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),ir.forEach(t),jd=c(Te),Qs=s(Te,"P",{});var Ip=a(Qs);Od=i(Ip,"Finally, this model supports inherent JAX features such as:"),Ip.forEach(t),Dd=c(Te),dt=s(Te,"UL",{});var ko=a(dt);Ys=s(ko,"LI",{});var Sp=a(Ys);Tn=s(Sp,"A",{href:!0,rel:!0});var Wp=a(Tn);Nd=i(Wp,"Just-In-Time (JIT) compilation"),Wp.forEach(t),Sp.forEach(t),Id=c(ko),ea=s(ko,"LI",{});var Bp=a(ea);wn=s(Bp,"A",{href:!0,rel:!0});var Up=a(wn);Sd=i(Up,"Automatic Differentiation"),Up.forEach(t),Bp.forEach(t),Wd=c(ko),ta=s(ko,"LI",{});var Rp=a(ta);Mn=s(Rp,"A",{href:!0,rel:!0});var Hp=a(Mn);Bd=i(Hp,"Vectorization"),Hp.forEach(t),Rp.forEach(t),Ud=c(ko),oa=s(ko,"LI",{});var Vp=a(oa);Ln=s(Vp,"A",{href:!0,rel:!0});var Kp=a(Ln);Rd=i(Kp,"Parallelization"),Kp.forEach(t),Vp.forEach(t),ko.forEach(t),Hd=c(Te),Ie=s(Te,"DIV",{class:!0});var yo=a(Ie);T($n.$$.fragment,yo),Vd=c(yo),Pt=s(yo,"P",{});var ds=a(Pt);Kd=i(ds,"The "),na=s(ds,"CODE",{});var Jp=a(na);Jd=i(Jp,"FlaxXGLMPreTrainedModel"),Jp.forEach(t),Zd=i(ds," forward method, overrides the "),sa=s(ds,"CODE",{});var Zp=a(sa);Qd=i(Zp,"__call__"),Zp.forEach(t),Yd=i(ds," special method."),ds.forEach(t),ec=c(yo),T(io.$$.fragment,yo),tc=c(yo),T(lo.$$.fragment,yo),yo.forEach(t),Te.forEach(t),this.h()},h(){h(p,"name","hf:doc:metadata"),h(p,"content",JSON.stringify(yh)),h(m,"id","xglm"),h(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(m,"href","#xglm"),h(f,"class","relative group"),h(te,"id","overview"),h(te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(te,"href","#overview"),h(j,"class","relative group"),h(se,"href","https://arxiv.org/abs/2112.10668"),h(se,"rel","nofollow"),h(re,"href","https://huggingface.co/valhalla"),h(re,"rel","nofollow"),h(le,"href","https://github.com/pytorch/fairseq/tree/main/examples/xglm"),h(le,"rel","nofollow"),h(oe,"id","transformers.XGLMConfig"),h(oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(oe,"href","#transformers.XGLMConfig"),h(C,"class","relative group"),h(A,"href","/docs/transformers/main/en/model_doc/xglm#transformers.XGLMModel"),h(ue,"href","https://huggingface.co/facebook/xglm-564M"),h(ue,"rel","nofollow"),h(Ce,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),h(Pe,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),h(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ve,"id","transformers.XGLMTokenizer"),h(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ve,"href","#transformers.XGLMTokenizer"),h(D,"class","relative group"),h(qn,"href","/docs/transformers/main/en/model_doc/roberta#transformers.RobertaTokenizer"),h(Cn,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetTokenizer"),h(bo,"href","https://github.com/google/sentencepiece"),h(bo,"rel","nofollow"),h(Pn,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),h(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(On,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Dt,"id","transformers.XGLMTokenizerFast"),h(Dt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Dt,"href","#transformers.XGLMTokenizerFast"),h(wt,"class","relative group"),h(Dn,"href","/docs/transformers/main/en/model_doc/roberta#transformers.RobertaTokenizer"),h(Nn,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetTokenizer"),h(Eo,"href","https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=BPE#models"),h(Eo,"rel","nofollow"),h(In,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),h(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(It,"id","transformers.XGLMModel"),h(It,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(It,"href","#transformers.XGLMModel"),h(Mt,"class","relative group"),h(Bn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(No,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(No,"rel","nofollow"),h(Un,"href","/docs/transformers/main/en/model_doc/xglm#transformers.XGLMModel"),h(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ut,"id","transformers.XGLMForCausalLM"),h(Ut,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ut,"href","#transformers.XGLMForCausalLM"),h($t,"class","relative group"),h(Rn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(Ro,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Ro,"rel","nofollow"),h(Hn,"href","/docs/transformers/main/en/model_doc/xglm#transformers.XGLMForCausalLM"),h(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Vt,"id","transformers.TFXGLMModel"),h(Vt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Vt,"href","#transformers.TFXGLMModel"),h(zt,"class","relative group"),h(Vn,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),h(Qo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Qo,"rel","nofollow"),h(Kn,"href","/docs/transformers/main/en/model_doc/xglm#transformers.TFXGLMModel"),h(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Yt,"id","transformers.TFXGLMForCausalLM"),h(Yt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Yt,"href","#transformers.TFXGLMForCausalLM"),h(Xt,"class","relative group"),h(Jn,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),h(sn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(sn,"rel","nofollow"),h(Zn,"href","/docs/transformers/main/en/model_doc/xglm#transformers.TFXGLMForCausalLM"),h(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(no,"id","transformers.FlaxXGLMModel"),h(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"),h(no,"href","#transformers.FlaxXGLMModel"),h(Gt,"class","relative group"),h(Qn,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(pn,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),h(pn,"rel","nofollow"),h(hn,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(hn,"rel","nofollow"),h(un,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(un,"rel","nofollow"),h(mn,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(mn,"rel","nofollow"),h(fn,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(fn,"rel","nofollow"),h(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ro,"id","transformers.FlaxXGLMForCausalLM"),h(ro,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ro,"href","#transformers.FlaxXGLMForCausalLM"),h(Ct,"class","relative group"),h(Yn,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(bn,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),h(bn,"rel","nofollow"),h(Tn,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Tn,"rel","nofollow"),h(wn,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(wn,"rel","nofollow"),h(Mn,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Mn,"rel","nofollow"),h(Ln,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Ln,"rel","nofollow"),h(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,_){e(document.head,p),g(o,y,_),g(o,f,_),e(f,m),e(m,k),w(l,k,null),e(f,u),e(f,z),e(z,Ue),g(o,ze,_),g(o,j,_),e(j,te),e(te,ne),w(x,ne,null),e(j,Re),e(j,V),e(V,He),g(o,Fe,_),g(o,I,_),e(I,Ve),e(I,se),e(se,ae),e(I,Ke),g(o,Xe,_),g(o,U,_),e(U,Je),g(o,Ee,_),g(o,R,_),e(R,we),e(we,Ze),g(o,ke,_),g(o,E,_),e(E,O),e(E,re),e(re,ie),e(E,Qe),e(E,le),e(le,de),e(E,Ye),g(o,Ge,_),g(o,C,_),e(C,oe),e(oe,K),w(ce,K,null),e(C,et),e(C,J),e(J,tt),g(o,qe,_),g(o,P,_),w(pe,P,null),e(P,he),e(P,Z),e(Z,Me),e(Z,A),e(A,ot),e(Z,S),e(Z,ue),e(ue,nt),e(Z,v),e(P,F),e(P,me),e(me,Le),e(me,Ce),e(Ce,kt),e(me,G),e(me,Pe),e(Pe,yt),e(me,vt),e(P,bt),w(ye,P,null),g(o,H,_),g(o,D,_),e(D,ve),e(ve,st),w(W,st,null),e(D,Tt),e(D,at),e(at,rt),g(o,pt,_),g(o,q,_),w($e,q,null),e(q,lr),e(q,it),e(it,dr),e(it,qn),e(qn,cr),e(it,pr),e(it,Cn),e(Cn,hr),e(it,ur),e(it,bo),e(bo,mr),e(it,fr),e(q,gr),e(q,To),e(To,_r),e(To,Pn),e(Pn,kr),e(To,yr),e(q,vr),e(q,ht),w(wo,ht,null),e(ht,br),e(ht,cs),e(cs,Tr),e(ht,wr),e(ht,Mo),e(Mo,An),e(An,Mr),e(An,ps),e(ps,Lr),e(Mo,$r),e(Mo,jn),e(jn,xr),e(jn,hs),e(hs,zr),e(q,Fr),e(q,jt),w(Lo,jt,null),e(jt,Xr),e(jt,$o),e($o,Er),e($o,us),e(us,Gr),e($o,qr),e(q,Cr),e(q,Ot),w(xo,Ot,null),e(Ot,Pr),e(Ot,ms),e(ms,Ar),e(q,jr),e(q,On),w(zo,On,null),g(o,ka,_),g(o,wt,_),e(wt,Dt),e(Dt,fs),w(Fo,fs,null),e(wt,Or),e(wt,gs),e(gs,Dr),g(o,ya,_),g(o,fe,_),w(Xo,fe,null),e(fe,Nr),e(fe,xe),e(xe,Ir),e(xe,_s),e(_s,Sr),e(xe,Wr),e(xe,Dn),e(Dn,Br),e(xe,Ur),e(xe,Nn),e(Nn,Rr),e(xe,Hr),e(xe,Eo),e(Eo,Vr),e(xe,Kr),e(fe,Jr),e(fe,Go),e(Go,Zr),e(Go,In),e(In,Qr),e(Go,Yr),e(fe,ei),e(fe,ut),w(qo,ut,null),e(ut,ti),e(ut,ks),e(ks,oi),e(ut,ni),e(ut,Co),e(Co,Sn),e(Sn,si),e(Sn,ys),e(ys,ai),e(Co,ri),e(Co,Wn),e(Wn,ii),e(Wn,vs),e(vs,li),e(fe,di),e(fe,Nt),w(Po,Nt,null),e(Nt,ci),e(Nt,bs),e(bs,pi),g(o,va,_),g(o,Mt,_),e(Mt,It),e(It,Ts),w(Ao,Ts,null),e(Mt,hi),e(Mt,ws),e(ws,ui),g(o,ba,_),g(o,ge,_),w(jo,ge,null),e(ge,mi),e(ge,Oo),e(Oo,fi),e(Oo,Bn),e(Bn,gi),e(Oo,_i),e(ge,ki),e(ge,Do),e(Do,yi),e(Do,No),e(No,vi),e(Do,bi),e(ge,Ti),e(ge,St),e(St,wi),e(St,Ms),e(Ms,Mi),e(St,Li),e(St,Ls),e(Ls,$i),e(ge,xi),e(ge,Ae),w(Io,Ae,null),e(Ae,zi),e(Ae,Lt),e(Lt,Fi),e(Lt,Un),e(Un,Xi),e(Lt,Ei),e(Lt,$s),e($s,Gi),e(Lt,qi),e(Ae,Ci),w(Wt,Ae,null),e(Ae,Pi),w(Bt,Ae,null),g(o,Ta,_),g(o,$t,_),e($t,Ut),e(Ut,xs),w(So,xs,null),e($t,Ai),e($t,zs),e(zs,ji),g(o,wa,_),g(o,_e,_),w(Wo,_e,null),e(_e,Oi),e(_e,Fs),e(Fs,Di),e(_e,Ni),e(_e,Bo),e(Bo,Ii),e(Bo,Rn),e(Rn,Si),e(Bo,Wi),e(_e,Bi),e(_e,Uo),e(Uo,Ui),e(Uo,Ro),e(Ro,Ri),e(Uo,Hi),e(_e,Vi),e(_e,je),w(Ho,je,null),e(je,Ki),e(je,xt),e(xt,Ji),e(xt,Hn),e(Hn,Zi),e(xt,Qi),e(xt,Xs),e(Xs,Yi),e(xt,el),e(je,tl),w(Rt,je,null),e(je,ol),w(Ht,je,null),g(o,Ma,_),g(o,zt,_),e(zt,Vt),e(Vt,Es),w(Vo,Es,null),e(zt,nl),e(zt,Gs),e(Gs,sl),g(o,La,_),g(o,Q,_),w(Ko,Q,null),e(Q,al),e(Q,Jo),e(Jo,rl),e(Jo,Vn),e(Vn,il),e(Jo,ll),e(Q,dl),e(Q,Zo),e(Zo,cl),e(Zo,Qo),e(Qo,pl),e(Zo,hl),e(Q,ul),w(Kt,Q,null),e(Q,ml),e(Q,Jt),e(Jt,fl),e(Jt,qs),e(qs,gl),e(Jt,_l),e(Jt,Cs),e(Cs,kl),e(Q,yl),e(Q,Oe),w(Yo,Oe,null),e(Oe,vl),e(Oe,Ft),e(Ft,bl),e(Ft,Kn),e(Kn,Tl),e(Ft,wl),e(Ft,Ps),e(Ps,Ml),e(Ft,Ll),e(Oe,$l),w(Zt,Oe,null),e(Oe,xl),w(Qt,Oe,null),g(o,$a,_),g(o,Xt,_),e(Xt,Yt),e(Yt,As),w(en,As,null),e(Xt,zl),e(Xt,js),e(js,Fl),g(o,xa,_),g(o,Y,_),w(tn,Y,null),e(Y,Xl),e(Y,Os),e(Os,El),e(Y,Gl),e(Y,on),e(on,ql),e(on,Jn),e(Jn,Cl),e(on,Pl),e(Y,Al),e(Y,nn),e(nn,jl),e(nn,sn),e(sn,Ol),e(nn,Dl),e(Y,Nl),w(eo,Y,null),e(Y,Il),e(Y,De),w(an,De,null),e(De,Sl),e(De,Et),e(Et,Wl),e(Et,Zn),e(Zn,Bl),e(Et,Ul),e(Et,Ds),e(Ds,Rl),e(Et,Hl),e(De,Vl),w(to,De,null),e(De,Kl),w(oo,De,null),g(o,za,_),g(o,Gt,_),e(Gt,no),e(no,Ns),w(rn,Ns,null),e(Gt,Jl),e(Gt,Is),e(Is,Zl),g(o,Fa,_),g(o,ee,_),w(ln,ee,null),e(ee,Ql),e(ee,dn),e(dn,Yl),e(dn,Qn),e(Qn,ed),e(dn,td),e(ee,od),e(ee,cn),e(cn,nd),e(cn,pn),e(pn,sd),e(cn,ad),e(ee,rd),e(ee,Ss),e(Ss,id),e(ee,ld),e(ee,lt),e(lt,Ws),e(Ws,hn),e(hn,dd),e(lt,cd),e(lt,Bs),e(Bs,un),e(un,pd),e(lt,hd),e(lt,Us),e(Us,mn),e(mn,ud),e(lt,md),e(lt,Rs),e(Rs,fn),e(fn,fd),e(ee,gd),e(ee,Ne),w(gn,Ne,null),e(Ne,_d),e(Ne,qt),e(qt,kd),e(qt,Hs),e(Hs,yd),e(qt,vd),e(qt,Vs),e(Vs,bd),e(qt,Td),e(Ne,wd),w(so,Ne,null),e(Ne,Md),w(ao,Ne,null),g(o,Xa,_),g(o,Ct,_),e(Ct,ro),e(ro,Ks),w(_n,Ks,null),e(Ct,Ld),e(Ct,Js),e(Js,$d),g(o,Ea,_),g(o,B,_),w(kn,B,null),e(B,xd),e(B,Zs),e(Zs,zd),e(B,Fd),e(B,yn),e(yn,Xd),e(yn,Yn),e(Yn,Ed),e(yn,Gd),e(B,qd),e(B,vn),e(vn,Cd),e(vn,bn),e(bn,Pd),e(vn,Ad),e(B,jd),e(B,Qs),e(Qs,Od),e(B,Dd),e(B,dt),e(dt,Ys),e(Ys,Tn),e(Tn,Nd),e(dt,Id),e(dt,ea),e(ea,wn),e(wn,Sd),e(dt,Wd),e(dt,ta),e(ta,Mn),e(Mn,Bd),e(dt,Ud),e(dt,oa),e(oa,Ln),e(Ln,Rd),e(B,Hd),e(B,Ie),w($n,Ie,null),e(Ie,Vd),e(Ie,Pt),e(Pt,Kd),e(Pt,na),e(na,Jd),e(Pt,Zd),e(Pt,sa),e(sa,Qd),e(Pt,Yd),e(Ie,ec),w(io,Ie,null),e(Ie,tc),w(lo,Ie,null),Ga=!0},p(o,[_]){const xn={};_&2&&(xn.$$scope={dirty:_,ctx:o}),ye.$set(xn);const aa={};_&2&&(aa.$$scope={dirty:_,ctx:o}),Wt.$set(aa);const ra={};_&2&&(ra.$$scope={dirty:_,ctx:o}),Bt.$set(ra);const ia={};_&2&&(ia.$$scope={dirty:_,ctx:o}),Rt.$set(ia);const zn={};_&2&&(zn.$$scope={dirty:_,ctx:o}),Ht.$set(zn);const la={};_&2&&(la.$$scope={dirty:_,ctx:o}),Kt.$set(la);const da={};_&2&&(da.$$scope={dirty:_,ctx:o}),Zt.$set(da);const ca={};_&2&&(ca.$$scope={dirty:_,ctx:o}),Qt.$set(ca);const Fn={};_&2&&(Fn.$$scope={dirty:_,ctx:o}),eo.$set(Fn);const pa={};_&2&&(pa.$$scope={dirty:_,ctx:o}),to.$set(pa);const ha={};_&2&&(ha.$$scope={dirty:_,ctx:o}),oo.$set(ha);const ua={};_&2&&(ua.$$scope={dirty:_,ctx:o}),so.$set(ua);const ma={};_&2&&(ma.$$scope={dirty:_,ctx:o}),ao.$set(ma);const At={};_&2&&(At.$$scope={dirty:_,ctx:o}),io.$set(At);const fa={};_&2&&(fa.$$scope={dirty:_,ctx:o}),lo.$set(fa)},i(o){Ga||(M(l.$$.fragment,o),M(x.$$.fragment,o),M(ce.$$.fragment,o),M(pe.$$.fragment,o),M(ye.$$.fragment,o),M(W.$$.fragment,o),M($e.$$.fragment,o),M(wo.$$.fragment,o),M(Lo.$$.fragment,o),M(xo.$$.fragment,o),M(zo.$$.fragment,o),M(Fo.$$.fragment,o),M(Xo.$$.fragment,o),M(qo.$$.fragment,o),M(Po.$$.fragment,o),M(Ao.$$.fragment,o),M(jo.$$.fragment,o),M(Io.$$.fragment,o),M(Wt.$$.fragment,o),M(Bt.$$.fragment,o),M(So.$$.fragment,o),M(Wo.$$.fragment,o),M(Ho.$$.fragment,o),M(Rt.$$.fragment,o),M(Ht.$$.fragment,o),M(Vo.$$.fragment,o),M(Ko.$$.fragment,o),M(Kt.$$.fragment,o),M(Yo.$$.fragment,o),M(Zt.$$.fragment,o),M(Qt.$$.fragment,o),M(en.$$.fragment,o),M(tn.$$.fragment,o),M(eo.$$.fragment,o),M(an.$$.fragment,o),M(to.$$.fragment,o),M(oo.$$.fragment,o),M(rn.$$.fragment,o),M(ln.$$.fragment,o),M(gn.$$.fragment,o),M(so.$$.fragment,o),M(ao.$$.fragment,o),M(_n.$$.fragment,o),M(kn.$$.fragment,o),M($n.$$.fragment,o),M(io.$$.fragment,o),M(lo.$$.fragment,o),Ga=!0)},o(o){L(l.$$.fragment,o),L(x.$$.fragment,o),L(ce.$$.fragment,o),L(pe.$$.fragment,o),L(ye.$$.fragment,o),L(W.$$.fragment,o),L($e.$$.fragment,o),L(wo.$$.fragment,o),L(Lo.$$.fragment,o),L(xo.$$.fragment,o),L(zo.$$.fragment,o),L(Fo.$$.fragment,o),L(Xo.$$.fragment,o),L(qo.$$.fragment,o),L(Po.$$.fragment,o),L(Ao.$$.fragment,o),L(jo.$$.fragment,o),L(Io.$$.fragment,o),L(Wt.$$.fragment,o),L(Bt.$$.fragment,o),L(So.$$.fragment,o),L(Wo.$$.fragment,o),L(Ho.$$.fragment,o),L(Rt.$$.fragment,o),L(Ht.$$.fragment,o),L(Vo.$$.fragment,o),L(Ko.$$.fragment,o),L(Kt.$$.fragment,o),L(Yo.$$.fragment,o),L(Zt.$$.fragment,o),L(Qt.$$.fragment,o),L(en.$$.fragment,o),L(tn.$$.fragment,o),L(eo.$$.fragment,o),L(an.$$.fragment,o),L(to.$$.fragment,o),L(oo.$$.fragment,o),L(rn.$$.fragment,o),L(ln.$$.fragment,o),L(gn.$$.fragment,o),L(so.$$.fragment,o),L(ao.$$.fragment,o),L(_n.$$.fragment,o),L(kn.$$.fragment,o),L($n.$$.fragment,o),L(io.$$.fragment,o),L(lo.$$.fragment,o),Ga=!1},d(o){t(p),o&&t(y),o&&t(f),$(l),o&&t(ze),o&&t(j),$(x),o&&t(Fe),o&&t(I),o&&t(Xe),o&&t(U),o&&t(Ee),o&&t(R),o&&t(ke),o&&t(E),o&&t(Ge),o&&t(C),$(ce),o&&t(qe),o&&t(P),$(pe),$(ye),o&&t(H),o&&t(D),$(W),o&&t(pt),o&&t(q),$($e),$(wo),$(Lo),$(xo),$(zo),o&&t(ka),o&&t(wt),$(Fo),o&&t(ya),o&&t(fe),$(Xo),$(qo),$(Po),o&&t(va),o&&t(Mt),$(Ao),o&&t(ba),o&&t(ge),$(jo),$(Io),$(Wt),$(Bt),o&&t(Ta),o&&t($t),$(So),o&&t(wa),o&&t(_e),$(Wo),$(Ho),$(Rt),$(Ht),o&&t(Ma),o&&t(zt),$(Vo),o&&t(La),o&&t(Q),$(Ko),$(Kt),$(Yo),$(Zt),$(Qt),o&&t($a),o&&t(Xt),$(en),o&&t(xa),o&&t(Y),$(tn),$(eo),$(an),$(to),$(oo),o&&t(za),o&&t(Gt),$(rn),o&&t(Fa),o&&t(ee),$(ln),$(gn),$(so),$(ao),o&&t(Xa),o&&t(Ct),$(_n),o&&t(Ea),o&&t(B),$(kn),$($n),$(io),$(lo)}}}const yh={local:"xglm",sections:[{local:"overview",title:"Overview"},{local:"transformers.XGLMConfig",title:"XGLMConfig"},{local:"transformers.XGLMTokenizer",title:"XGLMTokenizer"},{local:"transformers.XGLMTokenizerFast",title:"XGLMTokenizerFast"},{local:"transformers.XGLMModel",title:"XGLMModel"},{local:"transformers.XGLMForCausalLM",title:"XGLMForCausalLM"},{local:"transformers.TFXGLMModel",title:"TFXGLMModel"},{local:"transformers.TFXGLMForCausalLM",title:"TFXGLMForCausalLM"},{local:"transformers.FlaxXGLMModel",title:"FlaxXGLMModel"},{local:"transformers.FlaxXGLMForCausalLM",title:"FlaxXGLMForCausalLM"}],title:"XGLM"};function vh(X){return oh(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xh extends Qp{constructor(p){super();Yp(this,p,vh,kh,eh,{})}}export{xh as default,yh as metadata};
