import{S as kh,i as vh,s as yh,e as n,k as c,w as b,t as r,M as bh,c as s,d as t,m as p,a,x as T,h as i,b as d,G as e,g,y as w,q as M,o as L,B as $,v as Th,L as jn}from"../../chunks/vendor-hf-doc-builder.js";import{T as Mo}from"../../chunks/Tip-hf-doc-builder.js";import{D}from"../../chunks/Docstring-hf-doc-builder.js";import{C as On}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Re}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as An}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function wh(X){let h,y,f,m,k;return m=new On({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(){h=n("p"),y=r("Example:"),f=c(),b(m.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);y=i(u,"Example:"),u.forEach(t),f=p(l),T(m.$$.fragment,l)},m(l,u){g(l,h,u),e(h,y),g(l,f,u),w(m,l,u),k=!0},p:jn,i(l){k||(M(m.$$.fragment,l),k=!0)},o(l){L(m.$$.fragment,l),k=!1},d(l){l&&t(h),l&&t(f),$(m,l)}}}function Mh(X){let h,y,f,m,k;return{c(){h=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){h=s(l,"P",{});var u=a(h);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 F=a(f);m=i(F,"Module"),F.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,h,u),e(h,y),e(h,f),e(f,m),e(h,k)},d(l){l&&t(h)}}}function Lh(X){let h,y,f,m,k;return m=new On({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(){h=n("p"),y=r("Example:"),f=c(),b(m.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);y=i(u,"Example:"),u.forEach(t),f=p(l),T(m.$$.fragment,l)},m(l,u){g(l,h,u),e(h,y),g(l,f,u),w(m,l,u),k=!0},p:jn,i(l){k||(M(m.$$.fragment,l),k=!0)},o(l){L(m.$$.fragment,l),k=!1},d(l){l&&t(h),l&&t(f),$(m,l)}}}function $h(X){let h,y,f,m,k;return{c(){h=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){h=s(l,"P",{});var u=a(h);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 F=a(f);m=i(F,"Module"),F.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,h,u),e(h,y),e(h,f),e(f,m),e(h,k)},d(l){l&&t(h)}}}function xh(X){let h,y,f,m,k;return m=new On({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(){h=n("p"),y=r("Example:"),f=c(),b(m.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);y=i(u,"Example:"),u.forEach(t),f=p(l),T(m.$$.fragment,l)},m(l,u){g(l,h,u),e(h,y),g(l,f,u),w(m,l,u),k=!0},p:jn,i(l){k||(M(m.$$.fragment,l),k=!0)},o(l){L(m.$$.fragment,l),k=!1},d(l){l&&t(h),l&&t(f),$(m,l)}}}function Fh(X){let h,y,f,m,k,l,u,F,He,Fe,A,ee,ne,x,Ve,H,Ke,ze,N,Je,se,ae,Ze,Ee,U,Qe,Xe,B,Te,Ye,ke,G,j,re,ie,et,le,de,tt,Ge,q,te,V,ce,ot,K,nt,qe,I,we,R,st,ve,C,oe,O,pe,at;return{c(){h=n("p"),y=r("TensorFlow models and layers in "),f=n("code"),m=r("transformers"),k=r(" accept two formats as input:"),l=c(),u=n("ul"),F=n("li"),He=r("having all inputs as keyword arguments (like PyTorch models), or"),Fe=c(),A=n("li"),ee=r("having all inputs as a list, tuple or dict in the first positional argument."),ne=c(),x=n("p"),Ve=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 `),H=n("code"),Ke=r("model.fit()"),ze=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),N=n("code"),Je=r("model.fit()"),se=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),ae=n("code"),Ze=r("fit()"),Ee=r(" and "),U=n("code"),Qe=r("predict()"),Xe=r(`, such as when creating your own layers or models with
the Keras `),B=n("code"),Te=r("Functional"),Ye=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ke=c(),G=n("ul"),j=n("li"),re=r("a single Tensor with "),ie=n("code"),et=r("input_ids"),le=r(" only and nothing else: "),de=n("code"),tt=r("model(input_ids)"),Ge=c(),q=n("li"),te=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=n("code"),ce=r("model([input_ids, attention_mask])"),ot=r(" or "),K=n("code"),nt=r("model([input_ids, attention_mask, token_type_ids])"),qe=c(),I=n("li"),we=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=n("code"),st=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ve=c(),C=n("p"),oe=r(`Note that when creating models and layers with
`),O=n("a"),pe=r("subclassing"),at=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){h=s(v,"P",{});var E=a(h);y=i(E,"TensorFlow models and layers in "),f=s(E,"CODE",{});var ct=a(f);m=i(ct,"transformers"),ct.forEach(t),k=i(E," accept two formats as input:"),E.forEach(t),l=p(v),u=s(v,"UL",{});var P=a(u);F=s(P,"LI",{});var Me=a(F);He=i(Me,"having all inputs as keyword arguments (like PyTorch models), or"),Me.forEach(t),Fe=p(P),A=s(P,"LI",{});var _t=a(A);ee=i(_t,"having all inputs as a list, tuple or dict in the first positional argument."),_t.forEach(t),P.forEach(t),ne=p(v),x=s(v,"P",{});var z=a(x);Ve=i(z,`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 `),H=s(z,"CODE",{});var kt=a(H);Ke=i(kt,"model.fit()"),kt.forEach(t),ze=i(z,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),N=s(z,"CODE",{});var Ce=a(N);Je=i(Ce,"model.fit()"),Ce.forEach(t),se=i(z,` supports! If, however, you want to use the second
format outside of Keras methods like `),ae=s(z,"CODE",{});var vt=a(ae);Ze=i(vt,"fit()"),vt.forEach(t),Ee=i(z," and "),U=s(z,"CODE",{});var yt=a(U);Qe=i(yt,"predict()"),yt.forEach(t),Xe=i(z,`, such as when creating your own layers or models with
the Keras `),B=s(z,"CODE",{});var Le=a(B);Te=i(Le,"Functional"),Le.forEach(t),Ye=i(z,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),z.forEach(t),ke=p(v),G=s(v,"UL",{});var J=a(G);j=s(J,"LI",{});var he=a(j);re=i(he,"a single Tensor with "),ie=s(he,"CODE",{});var bt=a(ie);et=i(bt,"input_ids"),bt.forEach(t),le=i(he," only and nothing else: "),de=s(he,"CODE",{});var ue=a(de);tt=i(ue,"model(input_ids)"),ue.forEach(t),he.forEach(t),Ge=p(J),q=s(J,"LI",{});var me=a(q);te=i(me,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=s(me,"CODE",{});var Pe=a(V);ce=i(Pe,"model([input_ids, attention_mask])"),Pe.forEach(t),ot=i(me," or "),K=s(me,"CODE",{});var Tt=a(K);nt=i(Tt,"model([input_ids, attention_mask, token_type_ids])"),Tt.forEach(t),me.forEach(t),qe=p(J),I=s(J,"LI",{});var rt=a(I);we=i(rt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=s(rt,"CODE",{});var Ae=a(R);st=i(Ae,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ae.forEach(t),rt.forEach(t),J.forEach(t),ve=p(v),C=s(v,"P",{});var $e=a(C);oe=i($e,`Note that when creating models and layers with
`),O=s($e,"A",{href:!0,rel:!0});var wt=a(O);pe=i(wt,"subclassing"),wt.forEach(t),at=i($e,` 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!`),$e.forEach(t),this.h()},h(){d(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),d(O,"rel","nofollow")},m(v,E){g(v,h,E),e(h,y),e(h,f),e(f,m),e(h,k),g(v,l,E),g(v,u,E),e(u,F),e(F,He),e(u,Fe),e(u,A),e(A,ee),g(v,ne,E),g(v,x,E),e(x,Ve),e(x,H),e(H,Ke),e(x,ze),e(x,N),e(N,Je),e(x,se),e(x,ae),e(ae,Ze),e(x,Ee),e(x,U),e(U,Qe),e(x,Xe),e(x,B),e(B,Te),e(x,Ye),g(v,ke,E),g(v,G,E),e(G,j),e(j,re),e(j,ie),e(ie,et),e(j,le),e(j,de),e(de,tt),e(G,Ge),e(G,q),e(q,te),e(q,V),e(V,ce),e(q,ot),e(q,K),e(K,nt),e(G,qe),e(G,I),e(I,we),e(I,R),e(R,st),g(v,ve,E),g(v,C,E),e(C,oe),e(C,O),e(O,pe),e(C,at)},d(v){v&&t(h),v&&t(l),v&&t(u),v&&t(ne),v&&t(x),v&&t(ke),v&&t(G),v&&t(ve),v&&t(C)}}}function zh(X){let h,y,f,m,k;return{c(){h=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){h=s(l,"P",{});var u=a(h);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 F=a(f);m=i(F,"Module"),F.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,h,u),e(h,y),e(h,f),e(f,m),e(h,k)},d(l){l&&t(h)}}}function Eh(X){let h,y,f,m,k;return m=new On({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(){h=n("p"),y=r("Example:"),f=c(),b(m.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);y=i(u,"Example:"),u.forEach(t),f=p(l),T(m.$$.fragment,l)},m(l,u){g(l,h,u),e(h,y),g(l,f,u),w(m,l,u),k=!0},p:jn,i(l){k||(M(m.$$.fragment,l),k=!0)},o(l){L(m.$$.fragment,l),k=!1},d(l){l&&t(h),l&&t(f),$(m,l)}}}function Xh(X){let h,y,f,m,k,l,u,F,He,Fe,A,ee,ne,x,Ve,H,Ke,ze,N,Je,se,ae,Ze,Ee,U,Qe,Xe,B,Te,Ye,ke,G,j,re,ie,et,le,de,tt,Ge,q,te,V,ce,ot,K,nt,qe,I,we,R,st,ve,C,oe,O,pe,at;return{c(){h=n("p"),y=r("TensorFlow models and layers in "),f=n("code"),m=r("transformers"),k=r(" accept two formats as input:"),l=c(),u=n("ul"),F=n("li"),He=r("having all inputs as keyword arguments (like PyTorch models), or"),Fe=c(),A=n("li"),ee=r("having all inputs as a list, tuple or dict in the first positional argument."),ne=c(),x=n("p"),Ve=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 `),H=n("code"),Ke=r("model.fit()"),ze=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),N=n("code"),Je=r("model.fit()"),se=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),ae=n("code"),Ze=r("fit()"),Ee=r(" and "),U=n("code"),Qe=r("predict()"),Xe=r(`, such as when creating your own layers or models with
the Keras `),B=n("code"),Te=r("Functional"),Ye=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ke=c(),G=n("ul"),j=n("li"),re=r("a single Tensor with "),ie=n("code"),et=r("input_ids"),le=r(" only and nothing else: "),de=n("code"),tt=r("model(input_ids)"),Ge=c(),q=n("li"),te=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=n("code"),ce=r("model([input_ids, attention_mask])"),ot=r(" or "),K=n("code"),nt=r("model([input_ids, attention_mask, token_type_ids])"),qe=c(),I=n("li"),we=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=n("code"),st=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ve=c(),C=n("p"),oe=r(`Note that when creating models and layers with
`),O=n("a"),pe=r("subclassing"),at=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){h=s(v,"P",{});var E=a(h);y=i(E,"TensorFlow models and layers in "),f=s(E,"CODE",{});var ct=a(f);m=i(ct,"transformers"),ct.forEach(t),k=i(E," accept two formats as input:"),E.forEach(t),l=p(v),u=s(v,"UL",{});var P=a(u);F=s(P,"LI",{});var Me=a(F);He=i(Me,"having all inputs as keyword arguments (like PyTorch models), or"),Me.forEach(t),Fe=p(P),A=s(P,"LI",{});var _t=a(A);ee=i(_t,"having all inputs as a list, tuple or dict in the first positional argument."),_t.forEach(t),P.forEach(t),ne=p(v),x=s(v,"P",{});var z=a(x);Ve=i(z,`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 `),H=s(z,"CODE",{});var kt=a(H);Ke=i(kt,"model.fit()"),kt.forEach(t),ze=i(z,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),N=s(z,"CODE",{});var Ce=a(N);Je=i(Ce,"model.fit()"),Ce.forEach(t),se=i(z,` supports! If, however, you want to use the second
format outside of Keras methods like `),ae=s(z,"CODE",{});var vt=a(ae);Ze=i(vt,"fit()"),vt.forEach(t),Ee=i(z," and "),U=s(z,"CODE",{});var yt=a(U);Qe=i(yt,"predict()"),yt.forEach(t),Xe=i(z,`, such as when creating your own layers or models with
the Keras `),B=s(z,"CODE",{});var Le=a(B);Te=i(Le,"Functional"),Le.forEach(t),Ye=i(z,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),z.forEach(t),ke=p(v),G=s(v,"UL",{});var J=a(G);j=s(J,"LI",{});var he=a(j);re=i(he,"a single Tensor with "),ie=s(he,"CODE",{});var bt=a(ie);et=i(bt,"input_ids"),bt.forEach(t),le=i(he," only and nothing else: "),de=s(he,"CODE",{});var ue=a(de);tt=i(ue,"model(input_ids)"),ue.forEach(t),he.forEach(t),Ge=p(J),q=s(J,"LI",{});var me=a(q);te=i(me,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),V=s(me,"CODE",{});var Pe=a(V);ce=i(Pe,"model([input_ids, attention_mask])"),Pe.forEach(t),ot=i(me," or "),K=s(me,"CODE",{});var Tt=a(K);nt=i(Tt,"model([input_ids, attention_mask, token_type_ids])"),Tt.forEach(t),me.forEach(t),qe=p(J),I=s(J,"LI",{});var rt=a(I);we=i(rt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=s(rt,"CODE",{});var Ae=a(R);st=i(Ae,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ae.forEach(t),rt.forEach(t),J.forEach(t),ve=p(v),C=s(v,"P",{});var $e=a(C);oe=i($e,`Note that when creating models and layers with
`),O=s($e,"A",{href:!0,rel:!0});var wt=a(O);pe=i(wt,"subclassing"),wt.forEach(t),at=i($e,` 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!`),$e.forEach(t),this.h()},h(){d(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),d(O,"rel","nofollow")},m(v,E){g(v,h,E),e(h,y),e(h,f),e(f,m),e(h,k),g(v,l,E),g(v,u,E),e(u,F),e(F,He),e(u,Fe),e(u,A),e(A,ee),g(v,ne,E),g(v,x,E),e(x,Ve),e(x,H),e(H,Ke),e(x,ze),e(x,N),e(N,Je),e(x,se),e(x,ae),e(ae,Ze),e(x,Ee),e(x,U),e(U,Qe),e(x,Xe),e(x,B),e(B,Te),e(x,Ye),g(v,ke,E),g(v,G,E),e(G,j),e(j,re),e(j,ie),e(ie,et),e(j,le),e(j,de),e(de,tt),e(G,Ge),e(G,q),e(q,te),e(q,V),e(V,ce),e(q,ot),e(q,K),e(K,nt),e(G,qe),e(G,I),e(I,we),e(I,R),e(R,st),g(v,ve,E),g(v,C,E),e(C,oe),e(C,O),e(O,pe),e(C,at)},d(v){v&&t(h),v&&t(l),v&&t(u),v&&t(ne),v&&t(x),v&&t(ke),v&&t(G),v&&t(ve),v&&t(C)}}}function Gh(X){let h,y,f,m,k;return{c(){h=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){h=s(l,"P",{});var u=a(h);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 F=a(f);m=i(F,"Module"),F.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,h,u),e(h,y),e(h,f),e(f,m),e(h,k)},d(l){l&&t(h)}}}function qh(X){let h,y,f,m,k;return m=new On({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(){h=n("p"),y=r("Example:"),f=c(),b(m.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);y=i(u,"Example:"),u.forEach(t),f=p(l),T(m.$$.fragment,l)},m(l,u){g(l,h,u),e(h,y),g(l,f,u),w(m,l,u),k=!0},p:jn,i(l){k||(M(m.$$.fragment,l),k=!0)},o(l){L(m.$$.fragment,l),k=!1},d(l){l&&t(h),l&&t(f),$(m,l)}}}function Ch(X){let h,y,f,m,k;return{c(){h=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){h=s(l,"P",{});var u=a(h);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 F=a(f);m=i(F,"Module"),F.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,h,u),e(h,y),e(h,f),e(f,m),e(h,k)},d(l){l&&t(h)}}}function Ph(X){let h,y,f,m,k;return m=new On({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(){h=n("p"),y=r("Example:"),f=c(),b(m.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);y=i(u,"Example:"),u.forEach(t),f=p(l),T(m.$$.fragment,l)},m(l,u){g(l,h,u),e(h,y),g(l,f,u),w(m,l,u),k=!0},p:jn,i(l){k||(M(m.$$.fragment,l),k=!0)},o(l){L(m.$$.fragment,l),k=!1},d(l){l&&t(h),l&&t(f),$(m,l)}}}function Ah(X){let h,y,f,m,k;return{c(){h=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){h=s(l,"P",{});var u=a(h);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 F=a(f);m=i(F,"Module"),F.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,h,u),e(h,y),e(h,f),e(f,m),e(h,k)},d(l){l&&t(h)}}}function jh(X){let h,y,f,m,k;return m=new On({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(){h=n("p"),y=r("Example:"),f=c(),b(m.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);y=i(u,"Example:"),u.forEach(t),f=p(l),T(m.$$.fragment,l)},m(l,u){g(l,h,u),e(h,y),g(l,f,u),w(m,l,u),k=!0},p:jn,i(l){k||(M(m.$$.fragment,l),k=!0)},o(l){L(m.$$.fragment,l),k=!1},d(l){l&&t(h),l&&t(f),$(m,l)}}}function Oh(X){let h,y,f,m,k,l,u,F,He,Fe,A,ee,ne,x,Ve,H,Ke,ze,N,Je,se,ae,Ze,Ee,U,Qe,Xe,B,Te,Ye,ke,G,j,re,ie,et,le,de,tt,Ge,q,te,V,ce,ot,K,nt,qe,I,we,R,st,ve,C,oe,O,pe,at,v,E,ct,P,Me,_t,z,kt,Ce,vt,yt,Le,J,he,bt,ue,me,Pe,Tt,rt,Ae,$e,wt,vr,Dt,$a,Mt,Nt,gs,Lo,yr,_s,br,xa,S,$o,Tr,it,wr,Dn,Mr,Lr,Nn,$r,xr,xo,Fr,zr,Er,Fo,Xr,In,Gr,qr,Cr,pt,zo,Pr,ks,Ar,jr,Eo,Sn,Or,vs,Dr,Nr,Wn,Ir,ys,Sr,Wr,It,Xo,Ur,Go,Br,bs,Rr,Hr,Vr,St,qo,Kr,Ts,Jr,Zr,Un,Co,Fa,Lt,Wt,ws,Po,Qr,Ms,Yr,za,fe,Ao,ei,xe,ti,Ls,oi,ni,Bn,si,ai,Rn,ri,ii,jo,li,di,ci,Oo,pi,Hn,hi,ui,mi,ht,Do,fi,$s,gi,_i,No,Vn,ki,xs,vi,yi,Kn,bi,Fs,Ti,wi,Ut,Io,Mi,zs,Li,Ea,$t,Bt,Es,So,$i,Xs,xi,Xa,ge,Wo,Fi,Uo,zi,Jn,Ei,Xi,Gi,Bo,qi,Ro,Ci,Pi,Ai,Rt,ji,Gs,Oi,Di,qs,Ni,Ii,je,Ho,Si,xt,Wi,Zn,Ui,Bi,Cs,Ri,Hi,Vi,Ht,Ki,Vt,Ga,Ft,Kt,Ps,Vo,Ji,As,Zi,qa,_e,Ko,Qi,js,Yi,el,Jo,tl,Qn,ol,nl,sl,Zo,al,Qo,rl,il,ll,Oe,Yo,dl,zt,cl,Yn,pl,hl,Os,ul,ml,fl,Jt,gl,Zt,Ca,Et,Qt,Ds,en,_l,Ns,kl,Pa,Z,tn,vl,on,yl,es,bl,Tl,wl,nn,Ml,sn,Ll,$l,xl,Yt,Fl,eo,zl,Is,El,Xl,Ss,Gl,ql,De,an,Cl,Xt,Pl,ts,Al,jl,Ws,Ol,Dl,Nl,to,Il,oo,Aa,Gt,no,Us,rn,Sl,Bs,Wl,ja,Q,ln,Ul,Rs,Bl,Rl,dn,Hl,os,Vl,Kl,Jl,cn,Zl,pn,Ql,Yl,ed,so,td,Ne,hn,od,qt,nd,ns,sd,ad,Hs,rd,id,ld,ao,dd,ro,Oa,Ct,io,Vs,un,cd,Ks,pd,Da,Y,mn,hd,fn,ud,ss,md,fd,gd,gn,_d,_n,kd,vd,yd,Js,bd,Td,lt,Zs,kn,wd,Md,Qs,vn,Ld,$d,Ys,yn,xd,Fd,ea,bn,zd,Ed,Ie,Tn,Xd,Pt,Gd,ta,qd,Cd,oa,Pd,Ad,jd,lo,Od,co,Na,At,po,na,wn,Dd,sa,Nd,Ia,W,Mn,Id,aa,Sd,Wd,Ln,Ud,as,Bd,Rd,Hd,$n,Vd,xn,Kd,Jd,Zd,ra,Qd,Yd,dt,ia,Fn,ec,tc,la,zn,oc,nc,da,En,sc,ac,ca,Xn,rc,ic,Se,Gn,lc,jt,dc,pa,cc,pc,ha,hc,uc,mc,ho,fc,uo,Sa;return l=new Re({}),x=new Re({}),ce=new Re({}),pe=new Re({}),Me=new D({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/v4.29.0/en/model_doc/xglm#transformers.XGLMModel">XGLMModel</a> or <a href="/docs/transformers/v4.29.0/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/v4.29.0/src/transformers/models/xglm/configuration_xglm.py#L29"}}),Dt=new An({props:{anchor:"transformers.XGLMConfig.example",$$slots:{default:[wh]},$$scope:{ctx:X}}}),Lo=new Re({}),$o=new D({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/v4.29.0/src/transformers/models/xglm/tokenization_xglm.py#L43"}}),zo=new D({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/v4.29.0/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>
`}}),Xo=new D({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/v4.29.0/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>
`}}),qo=new D({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/v4.29.0/src/transformers/models/xglm/tokenization_xglm.py#L242",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Co=new D({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/v4.29.0/src/transformers/models/xglm/tokenization_xglm.py#L298"}}),Po=new Re({}),Ao=new D({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/v4.29.0/src/transformers/models/xglm/tokenization_xglm_fast.py#L49"}}),Do=new D({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/v4.29.0/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>
`}}),Io=new D({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/v4.29.0/src/transformers/models/xglm/tokenization_xglm_fast.py#L164",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),So=new Re({}),Wo=new D({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/v4.29.0/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/v4.29.0/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/v4.29.0/src/transformers/models/xglm/modeling_xglm.py#L514"}}),Ho=new D({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:"position_ids",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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XGLMModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.FloatTensor</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.XGLMModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.LongTensor</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.XGLMModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(num_layers, attention_heads)</code>, <em>optional</em>) &#x2014;
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>`,name:"head_mask"},{anchor:"transformers.XGLMModel.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.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.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>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.`,name:"past_key_values"},{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/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xglm/modeling_xglm.py#L575",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ht=new Mo({props:{$$slots:{default:[Mh]},$$scope:{ctx:X}}}),Vt=new An({props:{anchor:"transformers.XGLMModel.forward.example",$$slots:{default:[Lh]},$$scope:{ctx:X}}}),Vo=new Re({}),Ko=new D({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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xglm/modeling_xglm.py#L748"}}),Yo=new D({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:"position_ids",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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XGLMForCausalLM.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.FloatTensor</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.XGLMForCausalLM.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.LongTensor</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.XGLMForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(num_layers, attention_heads)</code>, <em>optional</em>) &#x2014;
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>`,name:"head_mask"},{anchor:"transformers.XGLMForCausalLM.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.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.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>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.`,name:"past_key_values"},{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/v4.29.0/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/v4.29.0/src/transformers/models/xglm/modeling_xglm.py#L779",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Jt=new Mo({props:{$$slots:{default:[$h]},$$scope:{ctx:X}}}),Zt=new An({props:{anchor:"transformers.XGLMForCausalLM.forward.example",$$slots:{default:[xh]},$$scope:{ctx:X}}}),en=new Re({}),tn=new D({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/v4.29.0/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/v4.29.0/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/v4.29.0/src/transformers/models/xglm/modeling_tf_xglm.py#L772"}}),Yt=new Mo({props:{$$slots:{default:[Fh]},$$scope:{ctx:X}}}),an=new D({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:"position_ids",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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.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/v4.29.0/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/v4.29.0/src/transformers/models/xglm/modeling_tf_xglm.py#L788",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),to=new Mo({props:{$$slots:{default:[zh]},$$scope:{ctx:X}}}),oo=new An({props:{anchor:"transformers.TFXGLMModel.call.example",$$slots:{default:[Eh]},$$scope:{ctx:X}}}),rn=new Re({}),ln=new D({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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xglm/modeling_tf_xglm.py#L857"}}),so=new Mo({props:{$$slots:{default:[Xh]},$$scope:{ctx:X}}}),hn=new D({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:"position_ids",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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.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/v4.29.0/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/v4.29.0/src/transformers/models/xglm/modeling_tf_xglm.py#L907",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.29.0/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/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ao=new Mo({props:{$$slots:{default:[Gh]},$$scope:{ctx:X}}}),ro=new An({props:{anchor:"transformers.TFXGLMForCausalLM.call.example",$$slots:{default:[qh]},$$scope:{ctx:X}}}),un=new Re({}),mn=new D({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/v4.29.0/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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xglm/modeling_flax_xglm.py#L689"}}),Tn=new D({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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xglm/modeling_flax_xglm.py#L611",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),lo=new Mo({props:{$$slots:{default:[Ch]},$$scope:{ctx:X}}}),co=new An({props:{anchor:"transformers.FlaxXGLMModel.__call__.example",$$slots:{default:[Ph]},$$scope:{ctx:X}}}),wn=new Re({}),Mn=new D({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/v4.29.0/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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xglm/modeling_flax_xglm.py#L766"}}),Gn=new D({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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xglm/modeling_flax_xglm.py#L611",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ho=new Mo({props:{$$slots:{default:[Ah]},$$scope:{ctx:X}}}),uo=new An({props:{anchor:"transformers.FlaxXGLMForCausalLM.__call__.example",$$slots:{default:[jh]},$$scope:{ctx:X}}}),{c(){h=n("meta"),y=c(),f=n("h1"),m=n("a"),k=n("span"),b(l.$$.fragment),u=c(),F=n("span"),He=r("XGLM"),Fe=c(),A=n("h2"),ee=n("a"),ne=n("span"),b(x.$$.fragment),Ve=c(),H=n("span"),Ke=r("Overview"),ze=c(),N=n("p"),Je=r("The XGLM model was proposed in "),se=n("a"),ae=r("Few-shot Learning with Multilingual Language Models"),Ze=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.`),Ee=c(),U=n("p"),Qe=r("The abstract from the paper is the following:"),Xe=c(),B=n("p"),Te=n("em"),Ye=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=c(),G=n("p"),j=r("This model was contributed by "),re=n("a"),ie=r("Suraj"),et=r(". The original code can be found "),le=n("a"),de=r("here"),tt=r("."),Ge=c(),q=n("h2"),te=n("a"),V=n("span"),b(ce.$$.fragment),ot=c(),K=n("span"),nt=r("Documentation resources"),qe=c(),I=n("ul"),we=n("li"),R=n("a"),st=r("Causal language modeling task guide"),ve=c(),C=n("h2"),oe=n("a"),O=n("span"),b(pe.$$.fragment),at=c(),v=n("span"),E=r("XGLMConfig"),ct=c(),P=n("div"),b(Me.$$.fragment),_t=c(),z=n("p"),kt=r("This is the configuration class to store the configuration of a "),Ce=n("a"),vt=r("XGLMModel"),yt=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
`),Le=n("a"),J=r("facebook/xglm-564M"),he=r(" architecture."),bt=c(),ue=n("p"),me=r("Configuration objects inherit from "),Pe=n("a"),Tt=r("PretrainedConfig"),rt=r(` and can be used to control the model outputs. Read the
documentation from `),Ae=n("a"),$e=r("PretrainedConfig"),wt=r(" for more information."),vr=c(),b(Dt.$$.fragment),$a=c(),Mt=n("h2"),Nt=n("a"),gs=n("span"),b(Lo.$$.fragment),yr=c(),_s=n("span"),br=r("XGLMTokenizer"),xa=c(),S=n("div"),b($o.$$.fragment),Tr=c(),it=n("p"),wr=r("Adapted from "),Dn=n("a"),Mr=r("RobertaTokenizer"),Lr=r(" and "),Nn=n("a"),$r=r("XLNetTokenizer"),xr=r(`. Based on
`),xo=n("a"),Fr=r("SentencePiece"),zr=r("."),Er=c(),Fo=n("p"),Xr=r("This tokenizer inherits from "),In=n("a"),Gr=r("PreTrainedTokenizer"),qr=r(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Cr=c(),pt=n("div"),b(zo.$$.fragment),Pr=c(),ks=n("p"),Ar=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:`),jr=c(),Eo=n("ul"),Sn=n("li"),Or=r("single sequence: "),vs=n("code"),Dr=r("<s> X </s>"),Nr=c(),Wn=n("li"),Ir=r("pair of sequences: "),ys=n("code"),Sr=r("<s> A </s></s> B </s>"),Wr=c(),It=n("div"),b(Xo.$$.fragment),Ur=c(),Go=n("p"),Br=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 `),bs=n("code"),Rr=r("prepare_for_model"),Hr=r(" method."),Vr=c(),St=n("div"),b(qo.$$.fragment),Kr=c(),Ts=n("p"),Jr=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.`),Zr=c(),Un=n("div"),b(Co.$$.fragment),Fa=c(),Lt=n("h2"),Wt=n("a"),ws=n("span"),b(Po.$$.fragment),Qr=c(),Ms=n("span"),Yr=r("XGLMTokenizerFast"),za=c(),fe=n("div"),b(Ao.$$.fragment),ei=c(),xe=n("p"),ti=r("Construct a \u201Cfast\u201D XGLM tokenizer (backed by HuggingFace\u2019s "),Ls=n("em"),oi=r("tokenizers"),ni=r(" library). Adapted from "),Bn=n("a"),si=r("RobertaTokenizer"),ai=r(`
and `),Rn=n("a"),ri=r("XLNetTokenizer"),ii=r(`. Based on
`),jo=n("a"),li=r("BPE"),di=r("."),ci=c(),Oo=n("p"),pi=r("This tokenizer inherits from "),Hn=n("a"),hi=r("PreTrainedTokenizerFast"),ui=r(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),mi=c(),ht=n("div"),b(Do.$$.fragment),fi=c(),$s=n("p"),gi=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:`),_i=c(),No=n("ul"),Vn=n("li"),ki=r("single sequence: "),xs=n("code"),vi=r("<s> X </s>"),yi=c(),Kn=n("li"),bi=r("pair of sequences: "),Fs=n("code"),Ti=r("<s> A </s></s> B </s>"),wi=c(),Ut=n("div"),b(Io.$$.fragment),Mi=c(),zs=n("p"),Li=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.`),Ea=c(),$t=n("h2"),Bt=n("a"),Es=n("span"),b(So.$$.fragment),$i=c(),Xs=n("span"),xi=r("XGLMModel"),Xa=c(),ge=n("div"),b(Wo.$$.fragment),Fi=c(),Uo=n("p"),zi=r(`The bare XGLM Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Jn=n("a"),Ei=r("PreTrainedModel"),Xi=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.)`),Gi=c(),Bo=n("p"),qi=r("This model is also a PyTorch "),Ro=n("a"),Ci=r("torch.nn.Module"),Pi=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ai=c(),Rt=n("p"),ji=r("Transformer decoder consisting of "),Gs=n("em"),Oi=r("config.num_layers"),Di=r(" layers. Each layer is a "),qs=n("code"),Ni=r("XGLMDecoderLayer"),Ii=c(),je=n("div"),b(Ho.$$.fragment),Si=c(),xt=n("p"),Wi=r("The "),Zn=n("a"),Ui=r("XGLMModel"),Bi=r(" forward method, overrides the "),Cs=n("code"),Ri=r("__call__"),Hi=r(" special method."),Vi=c(),b(Ht.$$.fragment),Ki=c(),b(Vt.$$.fragment),Ga=c(),Ft=n("h2"),Kt=n("a"),Ps=n("span"),b(Vo.$$.fragment),Ji=c(),As=n("span"),Zi=r("XGLMForCausalLM"),qa=c(),_e=n("div"),b(Ko.$$.fragment),Qi=c(),js=n("p"),Yi=r(`The XGLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),el=c(),Jo=n("p"),tl=r("This model inherits from "),Qn=n("a"),ol=r("PreTrainedModel"),nl=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.)`),sl=c(),Zo=n("p"),al=r("This model is also a PyTorch "),Qo=n("a"),rl=r("torch.nn.Module"),il=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ll=c(),Oe=n("div"),b(Yo.$$.fragment),dl=c(),zt=n("p"),cl=r("The "),Yn=n("a"),pl=r("XGLMForCausalLM"),hl=r(" forward method, overrides the "),Os=n("code"),ul=r("__call__"),ml=r(" special method."),fl=c(),b(Jt.$$.fragment),gl=c(),b(Zt.$$.fragment),Ca=c(),Et=n("h2"),Qt=n("a"),Ds=n("span"),b(en.$$.fragment),_l=c(),Ns=n("span"),kl=r("TFXGLMModel"),Pa=c(),Z=n("div"),b(tn.$$.fragment),vl=c(),on=n("p"),yl=r(`The bare XGLM Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),es=n("a"),bl=r("TFPreTrainedModel"),Tl=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.)`),wl=c(),nn=n("p"),Ml=r("This model is also a "),sn=n("a"),Ll=r("tf.keras.Model"),$l=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.`),xl=c(),b(Yt.$$.fragment),Fl=c(),eo=n("p"),zl=r("Transformer decoder consisting of "),Is=n("em"),El=r("config.num_layers"),Xl=r(" layers. Each layer is a "),Ss=n("code"),Gl=r("TFXGLMDecoderLayer"),ql=c(),De=n("div"),b(an.$$.fragment),Cl=c(),Xt=n("p"),Pl=r("The "),ts=n("a"),Al=r("TFXGLMModel"),jl=r(" forward method, overrides the "),Ws=n("code"),Ol=r("__call__"),Dl=r(" special method."),Nl=c(),b(to.$$.fragment),Il=c(),b(oo.$$.fragment),Aa=c(),Gt=n("h2"),no=n("a"),Us=n("span"),b(rn.$$.fragment),Sl=c(),Bs=n("span"),Wl=r("TFXGLMForCausalLM"),ja=c(),Q=n("div"),b(ln.$$.fragment),Ul=c(),Rs=n("p"),Bl=r(`The XGLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Rl=c(),dn=n("p"),Hl=r("This model inherits from "),os=n("a"),Vl=r("TFPreTrainedModel"),Kl=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.)`),Jl=c(),cn=n("p"),Zl=r("This model is also a "),pn=n("a"),Ql=r("tf.keras.Model"),Yl=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.`),ed=c(),b(so.$$.fragment),td=c(),Ne=n("div"),b(hn.$$.fragment),od=c(),qt=n("p"),nd=r("The "),ns=n("a"),sd=r("TFXGLMForCausalLM"),ad=r(" forward method, overrides the "),Hs=n("code"),rd=r("__call__"),id=r(" special method."),ld=c(),b(ao.$$.fragment),dd=c(),b(ro.$$.fragment),Oa=c(),Ct=n("h2"),io=n("a"),Vs=n("span"),b(un.$$.fragment),cd=c(),Ks=n("span"),pd=r("FlaxXGLMModel"),Da=c(),Y=n("div"),b(mn.$$.fragment),hd=c(),fn=n("p"),ud=r(`The bare XGLM Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),ss=n("a"),md=r("FlaxPreTrainedModel"),fd=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.)`),gd=c(),gn=n("p"),_d=r(`This model is also a Flax Linen
`),_n=n("a"),kd=r("flax.nn.Module"),vd=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),yd=c(),Js=n("p"),bd=r("Finally, this model supports inherent JAX features such as:"),Td=c(),lt=n("ul"),Zs=n("li"),kn=n("a"),wd=r("Just-In-Time (JIT) compilation"),Md=c(),Qs=n("li"),vn=n("a"),Ld=r("Automatic Differentiation"),$d=c(),Ys=n("li"),yn=n("a"),xd=r("Vectorization"),Fd=c(),ea=n("li"),bn=n("a"),zd=r("Parallelization"),Ed=c(),Ie=n("div"),b(Tn.$$.fragment),Xd=c(),Pt=n("p"),Gd=r("The "),ta=n("code"),qd=r("FlaxXGLMPreTrainedModel"),Cd=r(" forward method, overrides the "),oa=n("code"),Pd=r("__call__"),Ad=r(" special method."),jd=c(),b(lo.$$.fragment),Od=c(),b(co.$$.fragment),Na=c(),At=n("h2"),po=n("a"),na=n("span"),b(wn.$$.fragment),Dd=c(),sa=n("span"),Nd=r("FlaxXGLMForCausalLM"),Ia=c(),W=n("div"),b(Mn.$$.fragment),Id=c(),aa=n("p"),Sd=r(`The XGLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Wd=c(),Ln=n("p"),Ud=r("This model inherits from "),as=n("a"),Bd=r("FlaxPreTrainedModel"),Rd=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.)`),Hd=c(),$n=n("p"),Vd=r(`This model is also a Flax Linen
`),xn=n("a"),Kd=r("flax.nn.Module"),Jd=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Zd=c(),ra=n("p"),Qd=r("Finally, this model supports inherent JAX features such as:"),Yd=c(),dt=n("ul"),ia=n("li"),Fn=n("a"),ec=r("Just-In-Time (JIT) compilation"),tc=c(),la=n("li"),zn=n("a"),oc=r("Automatic Differentiation"),nc=c(),da=n("li"),En=n("a"),sc=r("Vectorization"),ac=c(),ca=n("li"),Xn=n("a"),rc=r("Parallelization"),ic=c(),Se=n("div"),b(Gn.$$.fragment),lc=c(),jt=n("p"),dc=r("The "),pa=n("code"),cc=r("FlaxXGLMPreTrainedModel"),pc=r(" forward method, overrides the "),ha=n("code"),hc=r("__call__"),uc=r(" special method."),mc=c(),b(ho.$$.fragment),fc=c(),b(uo.$$.fragment),this.h()},l(o){const _=bh('[data-svelte="svelte-1phssyn"]',document.head);h=s(_,"META",{name:!0,content:!0}),_.forEach(t),y=p(o),f=s(o,"H1",{class:!0});var qn=a(f);m=s(qn,"A",{id:!0,class:!0,href:!0});var ua=a(m);k=s(ua,"SPAN",{});var ma=a(k);T(l.$$.fragment,ma),ma.forEach(t),ua.forEach(t),u=p(qn),F=s(qn,"SPAN",{});var fa=a(F);He=i(fa,"XGLM"),fa.forEach(t),qn.forEach(t),Fe=p(o),A=s(o,"H2",{class:!0});var Cn=a(A);ee=s(Cn,"A",{id:!0,class:!0,href:!0});var ga=a(ee);ne=s(ga,"SPAN",{});var _a=a(ne);T(x.$$.fragment,_a),_a.forEach(t),ga.forEach(t),Ve=p(Cn),H=s(Cn,"SPAN",{});var ka=a(H);Ke=i(ka,"Overview"),ka.forEach(t),Cn.forEach(t),ze=p(o),N=s(o,"P",{});var Pn=a(N);Je=i(Pn,"The XGLM model was proposed in "),se=s(Pn,"A",{href:!0,rel:!0});var va=a(se);ae=i(va,"Few-shot Learning with Multilingual Language Models"),va.forEach(t),Ze=i(Pn,`
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.`),Pn.forEach(t),Ee=p(o),U=s(o,"P",{});var ya=a(U);Qe=i(ya,"The abstract from the paper is the following:"),ya.forEach(t),Xe=p(o),B=s(o,"P",{});var ba=a(B);Te=s(ba,"EM",{});var Ta=a(Te);Ye=i(Ta,`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.`),Ta.forEach(t),ba.forEach(t),ke=p(o),G=s(o,"P",{});var Ot=a(G);j=i(Ot,"This model was contributed by "),re=s(Ot,"A",{href:!0,rel:!0});var wa=a(re);ie=i(wa,"Suraj"),wa.forEach(t),et=i(Ot,". The original code can be found "),le=s(Ot,"A",{href:!0,rel:!0});var yc=a(le);de=i(yc,"here"),yc.forEach(t),tt=i(Ot,"."),Ot.forEach(t),Ge=p(o),q=s(o,"H2",{class:!0});var Wa=a(q);te=s(Wa,"A",{id:!0,class:!0,href:!0});var bc=a(te);V=s(bc,"SPAN",{});var Tc=a(V);T(ce.$$.fragment,Tc),Tc.forEach(t),bc.forEach(t),ot=p(Wa),K=s(Wa,"SPAN",{});var wc=a(K);nt=i(wc,"Documentation resources"),wc.forEach(t),Wa.forEach(t),qe=p(o),I=s(o,"UL",{});var Mc=a(I);we=s(Mc,"LI",{});var Lc=a(we);R=s(Lc,"A",{href:!0});var $c=a(R);st=i($c,"Causal language modeling task guide"),$c.forEach(t),Lc.forEach(t),Mc.forEach(t),ve=p(o),C=s(o,"H2",{class:!0});var Ua=a(C);oe=s(Ua,"A",{id:!0,class:!0,href:!0});var xc=a(oe);O=s(xc,"SPAN",{});var Fc=a(O);T(pe.$$.fragment,Fc),Fc.forEach(t),xc.forEach(t),at=p(Ua),v=s(Ua,"SPAN",{});var zc=a(v);E=i(zc,"XGLMConfig"),zc.forEach(t),Ua.forEach(t),ct=p(o),P=s(o,"DIV",{class:!0});var mo=a(P);T(Me.$$.fragment,mo),_t=p(mo),z=s(mo,"P",{});var rs=a(z);kt=i(rs,"This is the configuration class to store the configuration of a "),Ce=s(rs,"A",{href:!0});var Ec=a(Ce);vt=i(Ec,"XGLMModel"),Ec.forEach(t),yt=i(rs,`. 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
`),Le=s(rs,"A",{href:!0,rel:!0});var Xc=a(Le);J=i(Xc,"facebook/xglm-564M"),Xc.forEach(t),he=i(rs," architecture."),rs.forEach(t),bt=p(mo),ue=s(mo,"P",{});var is=a(ue);me=i(is,"Configuration objects inherit from "),Pe=s(is,"A",{href:!0});var Gc=a(Pe);Tt=i(Gc,"PretrainedConfig"),Gc.forEach(t),rt=i(is,` and can be used to control the model outputs. Read the
documentation from `),Ae=s(is,"A",{href:!0});var qc=a(Ae);$e=i(qc,"PretrainedConfig"),qc.forEach(t),wt=i(is," for more information."),is.forEach(t),vr=p(mo),T(Dt.$$.fragment,mo),mo.forEach(t),$a=p(o),Mt=s(o,"H2",{class:!0});var Ba=a(Mt);Nt=s(Ba,"A",{id:!0,class:!0,href:!0});var Cc=a(Nt);gs=s(Cc,"SPAN",{});var Pc=a(gs);T(Lo.$$.fragment,Pc),Pc.forEach(t),Cc.forEach(t),yr=p(Ba),_s=s(Ba,"SPAN",{});var Ac=a(_s);br=i(Ac,"XGLMTokenizer"),Ac.forEach(t),Ba.forEach(t),xa=p(o),S=s(o,"DIV",{class:!0});var ye=a(S);T($o.$$.fragment,ye),Tr=p(ye),it=s(ye,"P",{});var fo=a(it);wr=i(fo,"Adapted from "),Dn=s(fo,"A",{href:!0});var jc=a(Dn);Mr=i(jc,"RobertaTokenizer"),jc.forEach(t),Lr=i(fo," and "),Nn=s(fo,"A",{href:!0});var Oc=a(Nn);$r=i(Oc,"XLNetTokenizer"),Oc.forEach(t),xr=i(fo,`. Based on
`),xo=s(fo,"A",{href:!0,rel:!0});var Dc=a(xo);Fr=i(Dc,"SentencePiece"),Dc.forEach(t),zr=i(fo,"."),fo.forEach(t),Er=p(ye),Fo=s(ye,"P",{});var Ra=a(Fo);Xr=i(Ra,"This tokenizer inherits from "),In=s(Ra,"A",{href:!0});var Nc=a(In);Gr=i(Nc,"PreTrainedTokenizer"),Nc.forEach(t),qr=i(Ra,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Ra.forEach(t),Cr=p(ye),pt=s(ye,"DIV",{class:!0});var ls=a(pt);T(zo.$$.fragment,ls),Pr=p(ls),ks=s(ls,"P",{});var Ic=a(ks);Ar=i(Ic,`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:`),Ic.forEach(t),jr=p(ls),Eo=s(ls,"UL",{});var Ha=a(Eo);Sn=s(Ha,"LI",{});var gc=a(Sn);Or=i(gc,"single sequence: "),vs=s(gc,"CODE",{});var Sc=a(vs);Dr=i(Sc,"<s> X </s>"),Sc.forEach(t),gc.forEach(t),Nr=p(Ha),Wn=s(Ha,"LI",{});var _c=a(Wn);Ir=i(_c,"pair of sequences: "),ys=s(_c,"CODE",{});var Wc=a(ys);Sr=i(Wc,"<s> A </s></s> B </s>"),Wc.forEach(t),_c.forEach(t),Ha.forEach(t),ls.forEach(t),Wr=p(ye),It=s(ye,"DIV",{class:!0});var Va=a(It);T(Xo.$$.fragment,Va),Ur=p(Va),Go=s(Va,"P",{});var Ka=a(Go);Br=i(Ka,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),bs=s(Ka,"CODE",{});var Uc=a(bs);Rr=i(Uc,"prepare_for_model"),Uc.forEach(t),Hr=i(Ka," method."),Ka.forEach(t),Va.forEach(t),Vr=p(ye),St=s(ye,"DIV",{class:!0});var Ja=a(St);T(qo.$$.fragment,Ja),Kr=p(Ja),Ts=s(Ja,"P",{});var Bc=a(Ts);Jr=i(Bc,`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.`),Bc.forEach(t),Ja.forEach(t),Zr=p(ye),Un=s(ye,"DIV",{class:!0});var Rc=a(Un);T(Co.$$.fragment,Rc),Rc.forEach(t),ye.forEach(t),Fa=p(o),Lt=s(o,"H2",{class:!0});var Za=a(Lt);Wt=s(Za,"A",{id:!0,class:!0,href:!0});var Hc=a(Wt);ws=s(Hc,"SPAN",{});var Vc=a(ws);T(Po.$$.fragment,Vc),Vc.forEach(t),Hc.forEach(t),Qr=p(Za),Ms=s(Za,"SPAN",{});var Kc=a(Ms);Yr=i(Kc,"XGLMTokenizerFast"),Kc.forEach(t),Za.forEach(t),za=p(o),fe=s(o,"DIV",{class:!0});var ut=a(fe);T(Ao.$$.fragment,ut),ei=p(ut),xe=s(ut,"P",{});var mt=a(xe);ti=i(mt,"Construct a \u201Cfast\u201D XGLM tokenizer (backed by HuggingFace\u2019s "),Ls=s(mt,"EM",{});var Jc=a(Ls);oi=i(Jc,"tokenizers"),Jc.forEach(t),ni=i(mt," library). Adapted from "),Bn=s(mt,"A",{href:!0});var Zc=a(Bn);si=i(Zc,"RobertaTokenizer"),Zc.forEach(t),ai=i(mt,`
and `),Rn=s(mt,"A",{href:!0});var Qc=a(Rn);ri=i(Qc,"XLNetTokenizer"),Qc.forEach(t),ii=i(mt,`. Based on
`),jo=s(mt,"A",{href:!0,rel:!0});var Yc=a(jo);li=i(Yc,"BPE"),Yc.forEach(t),di=i(mt,"."),mt.forEach(t),ci=p(ut),Oo=s(ut,"P",{});var Qa=a(Oo);pi=i(Qa,"This tokenizer inherits from "),Hn=s(Qa,"A",{href:!0});var ep=a(Hn);hi=i(ep,"PreTrainedTokenizerFast"),ep.forEach(t),ui=i(Qa,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Qa.forEach(t),mi=p(ut),ht=s(ut,"DIV",{class:!0});var ds=a(ht);T(Do.$$.fragment,ds),fi=p(ds),$s=s(ds,"P",{});var tp=a($s);gi=i(tp,`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:`),tp.forEach(t),_i=p(ds),No=s(ds,"UL",{});var Ya=a(No);Vn=s(Ya,"LI",{});var kc=a(Vn);ki=i(kc,"single sequence: "),xs=s(kc,"CODE",{});var op=a(xs);vi=i(op,"<s> X </s>"),op.forEach(t),kc.forEach(t),yi=p(Ya),Kn=s(Ya,"LI",{});var vc=a(Kn);bi=i(vc,"pair of sequences: "),Fs=s(vc,"CODE",{});var np=a(Fs);Ti=i(np,"<s> A </s></s> B </s>"),np.forEach(t),vc.forEach(t),Ya.forEach(t),ds.forEach(t),wi=p(ut),Ut=s(ut,"DIV",{class:!0});var er=a(Ut);T(Io.$$.fragment,er),Mi=p(er),zs=s(er,"P",{});var sp=a(zs);Li=i(sp,`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.`),sp.forEach(t),er.forEach(t),ut.forEach(t),Ea=p(o),$t=s(o,"H2",{class:!0});var tr=a($t);Bt=s(tr,"A",{id:!0,class:!0,href:!0});var ap=a(Bt);Es=s(ap,"SPAN",{});var rp=a(Es);T(So.$$.fragment,rp),rp.forEach(t),ap.forEach(t),$i=p(tr),Xs=s(tr,"SPAN",{});var ip=a(Xs);xi=i(ip,"XGLMModel"),ip.forEach(t),tr.forEach(t),Xa=p(o),ge=s(o,"DIV",{class:!0});var ft=a(ge);T(Wo.$$.fragment,ft),Fi=p(ft),Uo=s(ft,"P",{});var or=a(Uo);zi=i(or,`The bare XGLM Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Jn=s(or,"A",{href:!0});var lp=a(Jn);Ei=i(lp,"PreTrainedModel"),lp.forEach(t),Xi=i(or,`. 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.)`),or.forEach(t),Gi=p(ft),Bo=s(ft,"P",{});var nr=a(Bo);qi=i(nr,"This model is also a PyTorch "),Ro=s(nr,"A",{href:!0,rel:!0});var dp=a(Ro);Ci=i(dp,"torch.nn.Module"),dp.forEach(t),Pi=i(nr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),nr.forEach(t),Ai=p(ft),Rt=s(ft,"P",{});var Ma=a(Rt);ji=i(Ma,"Transformer decoder consisting of "),Gs=s(Ma,"EM",{});var cp=a(Gs);Oi=i(cp,"config.num_layers"),cp.forEach(t),Di=i(Ma," layers. Each layer is a "),qs=s(Ma,"CODE",{});var pp=a(qs);Ni=i(pp,"XGLMDecoderLayer"),pp.forEach(t),Ma.forEach(t),Ii=p(ft),je=s(ft,"DIV",{class:!0});var go=a(je);T(Ho.$$.fragment,go),Si=p(go),xt=s(go,"P",{});var cs=a(xt);Wi=i(cs,"The "),Zn=s(cs,"A",{href:!0});var hp=a(Zn);Ui=i(hp,"XGLMModel"),hp.forEach(t),Bi=i(cs," forward method, overrides the "),Cs=s(cs,"CODE",{});var up=a(Cs);Ri=i(up,"__call__"),up.forEach(t),Hi=i(cs," special method."),cs.forEach(t),Vi=p(go),T(Ht.$$.fragment,go),Ki=p(go),T(Vt.$$.fragment,go),go.forEach(t),ft.forEach(t),Ga=p(o),Ft=s(o,"H2",{class:!0});var sr=a(Ft);Kt=s(sr,"A",{id:!0,class:!0,href:!0});var mp=a(Kt);Ps=s(mp,"SPAN",{});var fp=a(Ps);T(Vo.$$.fragment,fp),fp.forEach(t),mp.forEach(t),Ji=p(sr),As=s(sr,"SPAN",{});var gp=a(As);Zi=i(gp,"XGLMForCausalLM"),gp.forEach(t),sr.forEach(t),qa=p(o),_e=s(o,"DIV",{class:!0});var gt=a(_e);T(Ko.$$.fragment,gt),Qi=p(gt),js=s(gt,"P",{});var _p=a(js);Yi=i(_p,`The XGLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),_p.forEach(t),el=p(gt),Jo=s(gt,"P",{});var ar=a(Jo);tl=i(ar,"This model inherits from "),Qn=s(ar,"A",{href:!0});var kp=a(Qn);ol=i(kp,"PreTrainedModel"),kp.forEach(t),nl=i(ar,`. 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.)`),ar.forEach(t),sl=p(gt),Zo=s(gt,"P",{});var rr=a(Zo);al=i(rr,"This model is also a PyTorch "),Qo=s(rr,"A",{href:!0,rel:!0});var vp=a(Qo);rl=i(vp,"torch.nn.Module"),vp.forEach(t),il=i(rr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),rr.forEach(t),ll=p(gt),Oe=s(gt,"DIV",{class:!0});var _o=a(Oe);T(Yo.$$.fragment,_o),dl=p(_o),zt=s(_o,"P",{});var ps=a(zt);cl=i(ps,"The "),Yn=s(ps,"A",{href:!0});var yp=a(Yn);pl=i(yp,"XGLMForCausalLM"),yp.forEach(t),hl=i(ps," forward method, overrides the "),Os=s(ps,"CODE",{});var bp=a(Os);ul=i(bp,"__call__"),bp.forEach(t),ml=i(ps," special method."),ps.forEach(t),fl=p(_o),T(Jt.$$.fragment,_o),gl=p(_o),T(Zt.$$.fragment,_o),_o.forEach(t),gt.forEach(t),Ca=p(o),Et=s(o,"H2",{class:!0});var ir=a(Et);Qt=s(ir,"A",{id:!0,class:!0,href:!0});var Tp=a(Qt);Ds=s(Tp,"SPAN",{});var wp=a(Ds);T(en.$$.fragment,wp),wp.forEach(t),Tp.forEach(t),_l=p(ir),Ns=s(ir,"SPAN",{});var Mp=a(Ns);kl=i(Mp,"TFXGLMModel"),Mp.forEach(t),ir.forEach(t),Pa=p(o),Z=s(o,"DIV",{class:!0});var We=a(Z);T(tn.$$.fragment,We),vl=p(We),on=s(We,"P",{});var lr=a(on);yl=i(lr,`The bare XGLM Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),es=s(lr,"A",{href:!0});var Lp=a(es);bl=i(Lp,"TFPreTrainedModel"),Lp.forEach(t),Tl=i(lr,`. 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.)`),lr.forEach(t),wl=p(We),nn=s(We,"P",{});var dr=a(nn);Ml=i(dr,"This model is also a "),sn=s(dr,"A",{href:!0,rel:!0});var $p=a(sn);Ll=i($p,"tf.keras.Model"),$p.forEach(t),$l=i(dr,` 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.`),dr.forEach(t),xl=p(We),T(Yt.$$.fragment,We),Fl=p(We),eo=s(We,"P",{});var La=a(eo);zl=i(La,"Transformer decoder consisting of "),Is=s(La,"EM",{});var xp=a(Is);El=i(xp,"config.num_layers"),xp.forEach(t),Xl=i(La," layers. Each layer is a "),Ss=s(La,"CODE",{});var Fp=a(Ss);Gl=i(Fp,"TFXGLMDecoderLayer"),Fp.forEach(t),La.forEach(t),ql=p(We),De=s(We,"DIV",{class:!0});var ko=a(De);T(an.$$.fragment,ko),Cl=p(ko),Xt=s(ko,"P",{});var hs=a(Xt);Pl=i(hs,"The "),ts=s(hs,"A",{href:!0});var zp=a(ts);Al=i(zp,"TFXGLMModel"),zp.forEach(t),jl=i(hs," forward method, overrides the "),Ws=s(hs,"CODE",{});var Ep=a(Ws);Ol=i(Ep,"__call__"),Ep.forEach(t),Dl=i(hs," special method."),hs.forEach(t),Nl=p(ko),T(to.$$.fragment,ko),Il=p(ko),T(oo.$$.fragment,ko),ko.forEach(t),We.forEach(t),Aa=p(o),Gt=s(o,"H2",{class:!0});var cr=a(Gt);no=s(cr,"A",{id:!0,class:!0,href:!0});var Xp=a(no);Us=s(Xp,"SPAN",{});var Gp=a(Us);T(rn.$$.fragment,Gp),Gp.forEach(t),Xp.forEach(t),Sl=p(cr),Bs=s(cr,"SPAN",{});var qp=a(Bs);Wl=i(qp,"TFXGLMForCausalLM"),qp.forEach(t),cr.forEach(t),ja=p(o),Q=s(o,"DIV",{class:!0});var Ue=a(Q);T(ln.$$.fragment,Ue),Ul=p(Ue),Rs=s(Ue,"P",{});var Cp=a(Rs);Bl=i(Cp,`The XGLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Cp.forEach(t),Rl=p(Ue),dn=s(Ue,"P",{});var pr=a(dn);Hl=i(pr,"This model inherits from "),os=s(pr,"A",{href:!0});var Pp=a(os);Vl=i(Pp,"TFPreTrainedModel"),Pp.forEach(t),Kl=i(pr,`. 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.)`),pr.forEach(t),Jl=p(Ue),cn=s(Ue,"P",{});var hr=a(cn);Zl=i(hr,"This model is also a "),pn=s(hr,"A",{href:!0,rel:!0});var Ap=a(pn);Ql=i(Ap,"tf.keras.Model"),Ap.forEach(t),Yl=i(hr,` 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.`),hr.forEach(t),ed=p(Ue),T(so.$$.fragment,Ue),td=p(Ue),Ne=s(Ue,"DIV",{class:!0});var vo=a(Ne);T(hn.$$.fragment,vo),od=p(vo),qt=s(vo,"P",{});var us=a(qt);nd=i(us,"The "),ns=s(us,"A",{href:!0});var jp=a(ns);sd=i(jp,"TFXGLMForCausalLM"),jp.forEach(t),ad=i(us," forward method, overrides the "),Hs=s(us,"CODE",{});var Op=a(Hs);rd=i(Op,"__call__"),Op.forEach(t),id=i(us," special method."),us.forEach(t),ld=p(vo),T(ao.$$.fragment,vo),dd=p(vo),T(ro.$$.fragment,vo),vo.forEach(t),Ue.forEach(t),Oa=p(o),Ct=s(o,"H2",{class:!0});var ur=a(Ct);io=s(ur,"A",{id:!0,class:!0,href:!0});var Dp=a(io);Vs=s(Dp,"SPAN",{});var Np=a(Vs);T(un.$$.fragment,Np),Np.forEach(t),Dp.forEach(t),cd=p(ur),Ks=s(ur,"SPAN",{});var Ip=a(Ks);pd=i(Ip,"FlaxXGLMModel"),Ip.forEach(t),ur.forEach(t),Da=p(o),Y=s(o,"DIV",{class:!0});var Be=a(Y);T(mn.$$.fragment,Be),hd=p(Be),fn=s(Be,"P",{});var mr=a(fn);ud=i(mr,`The bare XGLM Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),ss=s(mr,"A",{href:!0});var Sp=a(ss);md=i(Sp,"FlaxPreTrainedModel"),Sp.forEach(t),fd=i(mr,`. 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.)`),mr.forEach(t),gd=p(Be),gn=s(Be,"P",{});var fr=a(gn);_d=i(fr,`This model is also a Flax Linen
`),_n=s(fr,"A",{href:!0,rel:!0});var Wp=a(_n);kd=i(Wp,"flax.nn.Module"),Wp.forEach(t),vd=i(fr,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),fr.forEach(t),yd=p(Be),Js=s(Be,"P",{});var Up=a(Js);bd=i(Up,"Finally, this model supports inherent JAX features such as:"),Up.forEach(t),Td=p(Be),lt=s(Be,"UL",{});var yo=a(lt);Zs=s(yo,"LI",{});var Bp=a(Zs);kn=s(Bp,"A",{href:!0,rel:!0});var Rp=a(kn);wd=i(Rp,"Just-In-Time (JIT) compilation"),Rp.forEach(t),Bp.forEach(t),Md=p(yo),Qs=s(yo,"LI",{});var Hp=a(Qs);vn=s(Hp,"A",{href:!0,rel:!0});var Vp=a(vn);Ld=i(Vp,"Automatic Differentiation"),Vp.forEach(t),Hp.forEach(t),$d=p(yo),Ys=s(yo,"LI",{});var Kp=a(Ys);yn=s(Kp,"A",{href:!0,rel:!0});var Jp=a(yn);xd=i(Jp,"Vectorization"),Jp.forEach(t),Kp.forEach(t),Fd=p(yo),ea=s(yo,"LI",{});var Zp=a(ea);bn=s(Zp,"A",{href:!0,rel:!0});var Qp=a(bn);zd=i(Qp,"Parallelization"),Qp.forEach(t),Zp.forEach(t),yo.forEach(t),Ed=p(Be),Ie=s(Be,"DIV",{class:!0});var bo=a(Ie);T(Tn.$$.fragment,bo),Xd=p(bo),Pt=s(bo,"P",{});var ms=a(Pt);Gd=i(ms,"The "),ta=s(ms,"CODE",{});var Yp=a(ta);qd=i(Yp,"FlaxXGLMPreTrainedModel"),Yp.forEach(t),Cd=i(ms," forward method, overrides the "),oa=s(ms,"CODE",{});var eh=a(oa);Pd=i(eh,"__call__"),eh.forEach(t),Ad=i(ms," special method."),ms.forEach(t),jd=p(bo),T(lo.$$.fragment,bo),Od=p(bo),T(co.$$.fragment,bo),bo.forEach(t),Be.forEach(t),Na=p(o),At=s(o,"H2",{class:!0});var gr=a(At);po=s(gr,"A",{id:!0,class:!0,href:!0});var th=a(po);na=s(th,"SPAN",{});var oh=a(na);T(wn.$$.fragment,oh),oh.forEach(t),th.forEach(t),Dd=p(gr),sa=s(gr,"SPAN",{});var nh=a(sa);Nd=i(nh,"FlaxXGLMForCausalLM"),nh.forEach(t),gr.forEach(t),Ia=p(o),W=s(o,"DIV",{class:!0});var be=a(W);T(Mn.$$.fragment,be),Id=p(be),aa=s(be,"P",{});var sh=a(aa);Sd=i(sh,`The XGLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),sh.forEach(t),Wd=p(be),Ln=s(be,"P",{});var _r=a(Ln);Ud=i(_r,"This model inherits from "),as=s(_r,"A",{href:!0});var ah=a(as);Bd=i(ah,"FlaxPreTrainedModel"),ah.forEach(t),Rd=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.)`),_r.forEach(t),Hd=p(be),$n=s(be,"P",{});var kr=a($n);Vd=i(kr,`This model is also a Flax Linen
`),xn=s(kr,"A",{href:!0,rel:!0});var rh=a(xn);Kd=i(rh,"flax.nn.Module"),rh.forEach(t),Jd=i(kr,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),kr.forEach(t),Zd=p(be),ra=s(be,"P",{});var ih=a(ra);Qd=i(ih,"Finally, this model supports inherent JAX features such as:"),ih.forEach(t),Yd=p(be),dt=s(be,"UL",{});var To=a(dt);ia=s(To,"LI",{});var lh=a(ia);Fn=s(lh,"A",{href:!0,rel:!0});var dh=a(Fn);ec=i(dh,"Just-In-Time (JIT) compilation"),dh.forEach(t),lh.forEach(t),tc=p(To),la=s(To,"LI",{});var ch=a(la);zn=s(ch,"A",{href:!0,rel:!0});var ph=a(zn);oc=i(ph,"Automatic Differentiation"),ph.forEach(t),ch.forEach(t),nc=p(To),da=s(To,"LI",{});var hh=a(da);En=s(hh,"A",{href:!0,rel:!0});var uh=a(En);sc=i(uh,"Vectorization"),uh.forEach(t),hh.forEach(t),ac=p(To),ca=s(To,"LI",{});var mh=a(ca);Xn=s(mh,"A",{href:!0,rel:!0});var fh=a(Xn);rc=i(fh,"Parallelization"),fh.forEach(t),mh.forEach(t),To.forEach(t),ic=p(be),Se=s(be,"DIV",{class:!0});var wo=a(Se);T(Gn.$$.fragment,wo),lc=p(wo),jt=s(wo,"P",{});var fs=a(jt);dc=i(fs,"The "),pa=s(fs,"CODE",{});var gh=a(pa);cc=i(gh,"FlaxXGLMPreTrainedModel"),gh.forEach(t),pc=i(fs," forward method, overrides the "),ha=s(fs,"CODE",{});var _h=a(ha);hc=i(_h,"__call__"),_h.forEach(t),uc=i(fs," special method."),fs.forEach(t),mc=p(wo),T(ho.$$.fragment,wo),fc=p(wo),T(uo.$$.fragment,wo),wo.forEach(t),be.forEach(t),this.h()},h(){d(h,"name","hf:doc:metadata"),d(h,"content",JSON.stringify(Dh)),d(m,"id","xglm"),d(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"),d(m,"href","#xglm"),d(f,"class","relative group"),d(ee,"id","overview"),d(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ee,"href","#overview"),d(A,"class","relative group"),d(se,"href","https://arxiv.org/abs/2112.10668"),d(se,"rel","nofollow"),d(re,"href","https://huggingface.co/valhalla"),d(re,"rel","nofollow"),d(le,"href","https://github.com/pytorch/fairseq/tree/main/examples/xglm"),d(le,"rel","nofollow"),d(te,"id","documentation-resources"),d(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"),d(te,"href","#documentation-resources"),d(q,"class","relative group"),d(R,"href","../tasks/language_modeling"),d(oe,"id","transformers.XGLMConfig"),d(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"),d(oe,"href","#transformers.XGLMConfig"),d(C,"class","relative group"),d(Ce,"href","/docs/transformers/v4.29.0/en/model_doc/xglm#transformers.XGLMModel"),d(Le,"href","https://huggingface.co/facebook/xglm-564M"),d(Le,"rel","nofollow"),d(Pe,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(Ae,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Nt,"id","transformers.XGLMTokenizer"),d(Nt,"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"),d(Nt,"href","#transformers.XGLMTokenizer"),d(Mt,"class","relative group"),d(Dn,"href","/docs/transformers/v4.29.0/en/model_doc/roberta#transformers.RobertaTokenizer"),d(Nn,"href","/docs/transformers/v4.29.0/en/model_doc/xlnet#transformers.XLNetTokenizer"),d(xo,"href","https://github.com/google/sentencepiece"),d(xo,"rel","nofollow"),d(In,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),d(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Un,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Wt,"id","transformers.XGLMTokenizerFast"),d(Wt,"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"),d(Wt,"href","#transformers.XGLMTokenizerFast"),d(Lt,"class","relative group"),d(Bn,"href","/docs/transformers/v4.29.0/en/model_doc/roberta#transformers.RobertaTokenizer"),d(Rn,"href","/docs/transformers/v4.29.0/en/model_doc/xlnet#transformers.XLNetTokenizer"),d(jo,"href","https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=BPE#models"),d(jo,"rel","nofollow"),d(Hn,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),d(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Bt,"id","transformers.XGLMModel"),d(Bt,"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"),d(Bt,"href","#transformers.XGLMModel"),d($t,"class","relative group"),d(Jn,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),d(Ro,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ro,"rel","nofollow"),d(Zn,"href","/docs/transformers/v4.29.0/en/model_doc/xglm#transformers.XGLMModel"),d(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Kt,"id","transformers.XGLMForCausalLM"),d(Kt,"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"),d(Kt,"href","#transformers.XGLMForCausalLM"),d(Ft,"class","relative group"),d(Qn,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),d(Qo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Qo,"rel","nofollow"),d(Yn,"href","/docs/transformers/v4.29.0/en/model_doc/xglm#transformers.XGLMForCausalLM"),d(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Qt,"id","transformers.TFXGLMModel"),d(Qt,"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"),d(Qt,"href","#transformers.TFXGLMModel"),d(Et,"class","relative group"),d(es,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),d(sn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(sn,"rel","nofollow"),d(ts,"href","/docs/transformers/v4.29.0/en/model_doc/xglm#transformers.TFXGLMModel"),d(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(no,"id","transformers.TFXGLMForCausalLM"),d(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"),d(no,"href","#transformers.TFXGLMForCausalLM"),d(Gt,"class","relative group"),d(os,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),d(pn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(pn,"rel","nofollow"),d(ns,"href","/docs/transformers/v4.29.0/en/model_doc/xglm#transformers.TFXGLMForCausalLM"),d(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(io,"id","transformers.FlaxXGLMModel"),d(io,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(io,"href","#transformers.FlaxXGLMModel"),d(Ct,"class","relative group"),d(ss,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(_n,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),d(_n,"rel","nofollow"),d(kn,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(kn,"rel","nofollow"),d(vn,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(vn,"rel","nofollow"),d(yn,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(yn,"rel","nofollow"),d(bn,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(bn,"rel","nofollow"),d(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(po,"id","transformers.FlaxXGLMForCausalLM"),d(po,"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"),d(po,"href","#transformers.FlaxXGLMForCausalLM"),d(At,"class","relative group"),d(as,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(xn,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),d(xn,"rel","nofollow"),d(Fn,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(Fn,"rel","nofollow"),d(zn,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(zn,"rel","nofollow"),d(En,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(En,"rel","nofollow"),d(Xn,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(Xn,"rel","nofollow"),d(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(W,"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,h),g(o,y,_),g(o,f,_),e(f,m),e(m,k),w(l,k,null),e(f,u),e(f,F),e(F,He),g(o,Fe,_),g(o,A,_),e(A,ee),e(ee,ne),w(x,ne,null),e(A,Ve),e(A,H),e(H,Ke),g(o,ze,_),g(o,N,_),e(N,Je),e(N,se),e(se,ae),e(N,Ze),g(o,Ee,_),g(o,U,_),e(U,Qe),g(o,Xe,_),g(o,B,_),e(B,Te),e(Te,Ye),g(o,ke,_),g(o,G,_),e(G,j),e(G,re),e(re,ie),e(G,et),e(G,le),e(le,de),e(G,tt),g(o,Ge,_),g(o,q,_),e(q,te),e(te,V),w(ce,V,null),e(q,ot),e(q,K),e(K,nt),g(o,qe,_),g(o,I,_),e(I,we),e(we,R),e(R,st),g(o,ve,_),g(o,C,_),e(C,oe),e(oe,O),w(pe,O,null),e(C,at),e(C,v),e(v,E),g(o,ct,_),g(o,P,_),w(Me,P,null),e(P,_t),e(P,z),e(z,kt),e(z,Ce),e(Ce,vt),e(z,yt),e(z,Le),e(Le,J),e(z,he),e(P,bt),e(P,ue),e(ue,me),e(ue,Pe),e(Pe,Tt),e(ue,rt),e(ue,Ae),e(Ae,$e),e(ue,wt),e(P,vr),w(Dt,P,null),g(o,$a,_),g(o,Mt,_),e(Mt,Nt),e(Nt,gs),w(Lo,gs,null),e(Mt,yr),e(Mt,_s),e(_s,br),g(o,xa,_),g(o,S,_),w($o,S,null),e(S,Tr),e(S,it),e(it,wr),e(it,Dn),e(Dn,Mr),e(it,Lr),e(it,Nn),e(Nn,$r),e(it,xr),e(it,xo),e(xo,Fr),e(it,zr),e(S,Er),e(S,Fo),e(Fo,Xr),e(Fo,In),e(In,Gr),e(Fo,qr),e(S,Cr),e(S,pt),w(zo,pt,null),e(pt,Pr),e(pt,ks),e(ks,Ar),e(pt,jr),e(pt,Eo),e(Eo,Sn),e(Sn,Or),e(Sn,vs),e(vs,Dr),e(Eo,Nr),e(Eo,Wn),e(Wn,Ir),e(Wn,ys),e(ys,Sr),e(S,Wr),e(S,It),w(Xo,It,null),e(It,Ur),e(It,Go),e(Go,Br),e(Go,bs),e(bs,Rr),e(Go,Hr),e(S,Vr),e(S,St),w(qo,St,null),e(St,Kr),e(St,Ts),e(Ts,Jr),e(S,Zr),e(S,Un),w(Co,Un,null),g(o,Fa,_),g(o,Lt,_),e(Lt,Wt),e(Wt,ws),w(Po,ws,null),e(Lt,Qr),e(Lt,Ms),e(Ms,Yr),g(o,za,_),g(o,fe,_),w(Ao,fe,null),e(fe,ei),e(fe,xe),e(xe,ti),e(xe,Ls),e(Ls,oi),e(xe,ni),e(xe,Bn),e(Bn,si),e(xe,ai),e(xe,Rn),e(Rn,ri),e(xe,ii),e(xe,jo),e(jo,li),e(xe,di),e(fe,ci),e(fe,Oo),e(Oo,pi),e(Oo,Hn),e(Hn,hi),e(Oo,ui),e(fe,mi),e(fe,ht),w(Do,ht,null),e(ht,fi),e(ht,$s),e($s,gi),e(ht,_i),e(ht,No),e(No,Vn),e(Vn,ki),e(Vn,xs),e(xs,vi),e(No,yi),e(No,Kn),e(Kn,bi),e(Kn,Fs),e(Fs,Ti),e(fe,wi),e(fe,Ut),w(Io,Ut,null),e(Ut,Mi),e(Ut,zs),e(zs,Li),g(o,Ea,_),g(o,$t,_),e($t,Bt),e(Bt,Es),w(So,Es,null),e($t,$i),e($t,Xs),e(Xs,xi),g(o,Xa,_),g(o,ge,_),w(Wo,ge,null),e(ge,Fi),e(ge,Uo),e(Uo,zi),e(Uo,Jn),e(Jn,Ei),e(Uo,Xi),e(ge,Gi),e(ge,Bo),e(Bo,qi),e(Bo,Ro),e(Ro,Ci),e(Bo,Pi),e(ge,Ai),e(ge,Rt),e(Rt,ji),e(Rt,Gs),e(Gs,Oi),e(Rt,Di),e(Rt,qs),e(qs,Ni),e(ge,Ii),e(ge,je),w(Ho,je,null),e(je,Si),e(je,xt),e(xt,Wi),e(xt,Zn),e(Zn,Ui),e(xt,Bi),e(xt,Cs),e(Cs,Ri),e(xt,Hi),e(je,Vi),w(Ht,je,null),e(je,Ki),w(Vt,je,null),g(o,Ga,_),g(o,Ft,_),e(Ft,Kt),e(Kt,Ps),w(Vo,Ps,null),e(Ft,Ji),e(Ft,As),e(As,Zi),g(o,qa,_),g(o,_e,_),w(Ko,_e,null),e(_e,Qi),e(_e,js),e(js,Yi),e(_e,el),e(_e,Jo),e(Jo,tl),e(Jo,Qn),e(Qn,ol),e(Jo,nl),e(_e,sl),e(_e,Zo),e(Zo,al),e(Zo,Qo),e(Qo,rl),e(Zo,il),e(_e,ll),e(_e,Oe),w(Yo,Oe,null),e(Oe,dl),e(Oe,zt),e(zt,cl),e(zt,Yn),e(Yn,pl),e(zt,hl),e(zt,Os),e(Os,ul),e(zt,ml),e(Oe,fl),w(Jt,Oe,null),e(Oe,gl),w(Zt,Oe,null),g(o,Ca,_),g(o,Et,_),e(Et,Qt),e(Qt,Ds),w(en,Ds,null),e(Et,_l),e(Et,Ns),e(Ns,kl),g(o,Pa,_),g(o,Z,_),w(tn,Z,null),e(Z,vl),e(Z,on),e(on,yl),e(on,es),e(es,bl),e(on,Tl),e(Z,wl),e(Z,nn),e(nn,Ml),e(nn,sn),e(sn,Ll),e(nn,$l),e(Z,xl),w(Yt,Z,null),e(Z,Fl),e(Z,eo),e(eo,zl),e(eo,Is),e(Is,El),e(eo,Xl),e(eo,Ss),e(Ss,Gl),e(Z,ql),e(Z,De),w(an,De,null),e(De,Cl),e(De,Xt),e(Xt,Pl),e(Xt,ts),e(ts,Al),e(Xt,jl),e(Xt,Ws),e(Ws,Ol),e(Xt,Dl),e(De,Nl),w(to,De,null),e(De,Il),w(oo,De,null),g(o,Aa,_),g(o,Gt,_),e(Gt,no),e(no,Us),w(rn,Us,null),e(Gt,Sl),e(Gt,Bs),e(Bs,Wl),g(o,ja,_),g(o,Q,_),w(ln,Q,null),e(Q,Ul),e(Q,Rs),e(Rs,Bl),e(Q,Rl),e(Q,dn),e(dn,Hl),e(dn,os),e(os,Vl),e(dn,Kl),e(Q,Jl),e(Q,cn),e(cn,Zl),e(cn,pn),e(pn,Ql),e(cn,Yl),e(Q,ed),w(so,Q,null),e(Q,td),e(Q,Ne),w(hn,Ne,null),e(Ne,od),e(Ne,qt),e(qt,nd),e(qt,ns),e(ns,sd),e(qt,ad),e(qt,Hs),e(Hs,rd),e(qt,id),e(Ne,ld),w(ao,Ne,null),e(Ne,dd),w(ro,Ne,null),g(o,Oa,_),g(o,Ct,_),e(Ct,io),e(io,Vs),w(un,Vs,null),e(Ct,cd),e(Ct,Ks),e(Ks,pd),g(o,Da,_),g(o,Y,_),w(mn,Y,null),e(Y,hd),e(Y,fn),e(fn,ud),e(fn,ss),e(ss,md),e(fn,fd),e(Y,gd),e(Y,gn),e(gn,_d),e(gn,_n),e(_n,kd),e(gn,vd),e(Y,yd),e(Y,Js),e(Js,bd),e(Y,Td),e(Y,lt),e(lt,Zs),e(Zs,kn),e(kn,wd),e(lt,Md),e(lt,Qs),e(Qs,vn),e(vn,Ld),e(lt,$d),e(lt,Ys),e(Ys,yn),e(yn,xd),e(lt,Fd),e(lt,ea),e(ea,bn),e(bn,zd),e(Y,Ed),e(Y,Ie),w(Tn,Ie,null),e(Ie,Xd),e(Ie,Pt),e(Pt,Gd),e(Pt,ta),e(ta,qd),e(Pt,Cd),e(Pt,oa),e(oa,Pd),e(Pt,Ad),e(Ie,jd),w(lo,Ie,null),e(Ie,Od),w(co,Ie,null),g(o,Na,_),g(o,At,_),e(At,po),e(po,na),w(wn,na,null),e(At,Dd),e(At,sa),e(sa,Nd),g(o,Ia,_),g(o,W,_),w(Mn,W,null),e(W,Id),e(W,aa),e(aa,Sd),e(W,Wd),e(W,Ln),e(Ln,Ud),e(Ln,as),e(as,Bd),e(Ln,Rd),e(W,Hd),e(W,$n),e($n,Vd),e($n,xn),e(xn,Kd),e($n,Jd),e(W,Zd),e(W,ra),e(ra,Qd),e(W,Yd),e(W,dt),e(dt,ia),e(ia,Fn),e(Fn,ec),e(dt,tc),e(dt,la),e(la,zn),e(zn,oc),e(dt,nc),e(dt,da),e(da,En),e(En,sc),e(dt,ac),e(dt,ca),e(ca,Xn),e(Xn,rc),e(W,ic),e(W,Se),w(Gn,Se,null),e(Se,lc),e(Se,jt),e(jt,dc),e(jt,pa),e(pa,cc),e(jt,pc),e(jt,ha),e(ha,hc),e(jt,uc),e(Se,mc),w(ho,Se,null),e(Se,fc),w(uo,Se,null),Sa=!0},p(o,[_]){const qn={};_&2&&(qn.$$scope={dirty:_,ctx:o}),Dt.$set(qn);const ua={};_&2&&(ua.$$scope={dirty:_,ctx:o}),Ht.$set(ua);const ma={};_&2&&(ma.$$scope={dirty:_,ctx:o}),Vt.$set(ma);const fa={};_&2&&(fa.$$scope={dirty:_,ctx:o}),Jt.$set(fa);const Cn={};_&2&&(Cn.$$scope={dirty:_,ctx:o}),Zt.$set(Cn);const ga={};_&2&&(ga.$$scope={dirty:_,ctx:o}),Yt.$set(ga);const _a={};_&2&&(_a.$$scope={dirty:_,ctx:o}),to.$set(_a);const ka={};_&2&&(ka.$$scope={dirty:_,ctx:o}),oo.$set(ka);const Pn={};_&2&&(Pn.$$scope={dirty:_,ctx:o}),so.$set(Pn);const va={};_&2&&(va.$$scope={dirty:_,ctx:o}),ao.$set(va);const ya={};_&2&&(ya.$$scope={dirty:_,ctx:o}),ro.$set(ya);const ba={};_&2&&(ba.$$scope={dirty:_,ctx:o}),lo.$set(ba);const Ta={};_&2&&(Ta.$$scope={dirty:_,ctx:o}),co.$set(Ta);const Ot={};_&2&&(Ot.$$scope={dirty:_,ctx:o}),ho.$set(Ot);const wa={};_&2&&(wa.$$scope={dirty:_,ctx:o}),uo.$set(wa)},i(o){Sa||(M(l.$$.fragment,o),M(x.$$.fragment,o),M(ce.$$.fragment,o),M(pe.$$.fragment,o),M(Me.$$.fragment,o),M(Dt.$$.fragment,o),M(Lo.$$.fragment,o),M($o.$$.fragment,o),M(zo.$$.fragment,o),M(Xo.$$.fragment,o),M(qo.$$.fragment,o),M(Co.$$.fragment,o),M(Po.$$.fragment,o),M(Ao.$$.fragment,o),M(Do.$$.fragment,o),M(Io.$$.fragment,o),M(So.$$.fragment,o),M(Wo.$$.fragment,o),M(Ho.$$.fragment,o),M(Ht.$$.fragment,o),M(Vt.$$.fragment,o),M(Vo.$$.fragment,o),M(Ko.$$.fragment,o),M(Yo.$$.fragment,o),M(Jt.$$.fragment,o),M(Zt.$$.fragment,o),M(en.$$.fragment,o),M(tn.$$.fragment,o),M(Yt.$$.fragment,o),M(an.$$.fragment,o),M(to.$$.fragment,o),M(oo.$$.fragment,o),M(rn.$$.fragment,o),M(ln.$$.fragment,o),M(so.$$.fragment,o),M(hn.$$.fragment,o),M(ao.$$.fragment,o),M(ro.$$.fragment,o),M(un.$$.fragment,o),M(mn.$$.fragment,o),M(Tn.$$.fragment,o),M(lo.$$.fragment,o),M(co.$$.fragment,o),M(wn.$$.fragment,o),M(Mn.$$.fragment,o),M(Gn.$$.fragment,o),M(ho.$$.fragment,o),M(uo.$$.fragment,o),Sa=!0)},o(o){L(l.$$.fragment,o),L(x.$$.fragment,o),L(ce.$$.fragment,o),L(pe.$$.fragment,o),L(Me.$$.fragment,o),L(Dt.$$.fragment,o),L(Lo.$$.fragment,o),L($o.$$.fragment,o),L(zo.$$.fragment,o),L(Xo.$$.fragment,o),L(qo.$$.fragment,o),L(Co.$$.fragment,o),L(Po.$$.fragment,o),L(Ao.$$.fragment,o),L(Do.$$.fragment,o),L(Io.$$.fragment,o),L(So.$$.fragment,o),L(Wo.$$.fragment,o),L(Ho.$$.fragment,o),L(Ht.$$.fragment,o),L(Vt.$$.fragment,o),L(Vo.$$.fragment,o),L(Ko.$$.fragment,o),L(Yo.$$.fragment,o),L(Jt.$$.fragment,o),L(Zt.$$.fragment,o),L(en.$$.fragment,o),L(tn.$$.fragment,o),L(Yt.$$.fragment,o),L(an.$$.fragment,o),L(to.$$.fragment,o),L(oo.$$.fragment,o),L(rn.$$.fragment,o),L(ln.$$.fragment,o),L(so.$$.fragment,o),L(hn.$$.fragment,o),L(ao.$$.fragment,o),L(ro.$$.fragment,o),L(un.$$.fragment,o),L(mn.$$.fragment,o),L(Tn.$$.fragment,o),L(lo.$$.fragment,o),L(co.$$.fragment,o),L(wn.$$.fragment,o),L(Mn.$$.fragment,o),L(Gn.$$.fragment,o),L(ho.$$.fragment,o),L(uo.$$.fragment,o),Sa=!1},d(o){t(h),o&&t(y),o&&t(f),$(l),o&&t(Fe),o&&t(A),$(x),o&&t(ze),o&&t(N),o&&t(Ee),o&&t(U),o&&t(Xe),o&&t(B),o&&t(ke),o&&t(G),o&&t(Ge),o&&t(q),$(ce),o&&t(qe),o&&t(I),o&&t(ve),o&&t(C),$(pe),o&&t(ct),o&&t(P),$(Me),$(Dt),o&&t($a),o&&t(Mt),$(Lo),o&&t(xa),o&&t(S),$($o),$(zo),$(Xo),$(qo),$(Co),o&&t(Fa),o&&t(Lt),$(Po),o&&t(za),o&&t(fe),$(Ao),$(Do),$(Io),o&&t(Ea),o&&t($t),$(So),o&&t(Xa),o&&t(ge),$(Wo),$(Ho),$(Ht),$(Vt),o&&t(Ga),o&&t(Ft),$(Vo),o&&t(qa),o&&t(_e),$(Ko),$(Yo),$(Jt),$(Zt),o&&t(Ca),o&&t(Et),$(en),o&&t(Pa),o&&t(Z),$(tn),$(Yt),$(an),$(to),$(oo),o&&t(Aa),o&&t(Gt),$(rn),o&&t(ja),o&&t(Q),$(ln),$(so),$(hn),$(ao),$(ro),o&&t(Oa),o&&t(Ct),$(un),o&&t(Da),o&&t(Y),$(mn),$(Tn),$(lo),$(co),o&&t(Na),o&&t(At),$(wn),o&&t(Ia),o&&t(W),$(Mn),$(Gn),$(ho),$(uo)}}}const Dh={local:"xglm",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{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 Nh(X){return Th(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Hh extends kh{constructor(h){super();vh(this,h,Nh,Oh,yh,{})}}export{Hh as default,Dh as metadata};
