import{S as of,i as nf,s as sf,e as a,k as f,w as y,t as n,M as af,c as r,d as t,m as p,a as i,x as w,h as s,b as m,G as e,g,y as $,q as k,o as L,B as x,v as rf,L as gt}from"../../chunks/vendor-hf-doc-builder.js";import{T as $t}from"../../chunks/Tip-hf-doc-builder.js";import{D as re}from"../../chunks/Docstring-hf-doc-builder.js";import{C as _t}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as mt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ut}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function lf(F){let d,v,c,u,b,l,h,E,R,ie;return{c(){d=a("p"),v=n("TransformerXL does "),c=a("strong"),u=n("not"),b=n(" work with "),l=a("em"),h=n("torch.nn.DataParallel"),E=n(" due to a bug in PyTorch, see "),R=a("a"),ie=n("issue #36035"),this.h()},l(P){d=r(P,"P",{});var S=i(d);v=s(S,"TransformerXL does "),c=r(S,"STRONG",{});var G=i(c);u=s(G,"not"),G.forEach(t),b=s(S," work with "),l=r(S,"EM",{});var X=i(l);h=s(X,"torch.nn.DataParallel"),X.forEach(t),E=s(S," due to a bug in PyTorch, see "),R=r(S,"A",{href:!0,rel:!0});var me=i(R);ie=s(me,"issue #36035"),me.forEach(t),S.forEach(t),this.h()},h(){m(R,"href","https://github.com/pytorch/pytorch/issues/36035"),m(R,"rel","nofollow")},m(P,S){g(P,d,S),e(d,v),e(d,c),e(c,u),e(d,b),e(d,l),e(l,h),e(d,E),e(d,R),e(R,ie)},d(P){P&&t(d)}}}function df(F){let d,v,c,u,b;return u=new _t({props:{code:`from transformers import TransfoXLConfig, TransfoXLModel

# Initializing a Transformer XL configuration
configuration = TransfoXLConfig()

# Initializing a model (with random weights) from the configuration
model = TransfoXLModel(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> TransfoXLConfig, TransfoXLModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLModel(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(){d=a("p"),v=n("Examples:"),c=f(),y(u.$$.fragment)},l(l){d=r(l,"P",{});var h=i(d);v=s(h,"Examples:"),h.forEach(t),c=p(l),w(u.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,c,h),$(u,l,h),b=!0},p:gt,i(l){b||(k(u.$$.fragment,l),b=!0)},o(l){L(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(c),x(u,l)}}}function cf(F){let d,v,c,u,b;return{c(){d=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var h=i(d);v=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r(h,"CODE",{});var E=i(c);u=s(E,"Module"),E.forEach(t),b=s(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,c),e(c,u),e(d,b)},d(l){l&&t(d)}}}function ff(F){let d,v,c,u,b;return u=new _t({props:{code:`from transformers import TransfoXLTokenizer, TransfoXLModel
import torch

tokenizer = TransfoXLTokenizer.from_pretrained("transfo-xl-wt103")
model = TransfoXLModel.from_pretrained("transfo-xl-wt103")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = TransfoXLTokenizer.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLModel.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&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(){d=a("p"),v=n("Example:"),c=f(),y(u.$$.fragment)},l(l){d=r(l,"P",{});var h=i(d);v=s(h,"Example:"),h.forEach(t),c=p(l),w(u.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,c,h),$(u,l,h),b=!0},p:gt,i(l){b||(k(u.$$.fragment,l),b=!0)},o(l){L(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(c),x(u,l)}}}function pf(F){let d,v,c,u,b;return{c(){d=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var h=i(d);v=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r(h,"CODE",{});var E=i(c);u=s(E,"Module"),E.forEach(t),b=s(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,c),e(c,u),e(d,b)},d(l){l&&t(d)}}}function hf(F){let d,v,c,u,b;return u=new _t({props:{code:`import torch
from transformers import TransfoXLTokenizer, TransfoXLLMHeadModel

tokenizer = TransfoXLTokenizer.from_pretrained("transfo-xl-wt103")
model = TransfoXLLMHeadModel.from_pretrained("transfo-xl-wt103")

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> TransfoXLTokenizer, TransfoXLLMHeadModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = TransfoXLTokenizer.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLLMHeadModel.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&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(){d=a("p"),v=n("Example:"),c=f(),y(u.$$.fragment)},l(l){d=r(l,"P",{});var h=i(d);v=s(h,"Example:"),h.forEach(t),c=p(l),w(u.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,c,h),$(u,l,h),b=!0},p:gt,i(l){b||(k(u.$$.fragment,l),b=!0)},o(l){L(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(c),x(u,l)}}}function mf(F){let d,v,c,u,b;return{c(){d=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var h=i(d);v=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r(h,"CODE",{});var E=i(c);u=s(E,"Module"),E.forEach(t),b=s(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,c),e(c,u),e(d,b)},d(l){l&&t(d)}}}function uf(F){let d,v,c,u,b;return u=new _t({props:{code:`import torch
from transformers import TransfoXLTokenizer, TransfoXLForSequenceClassification

tokenizer = TransfoXLTokenizer.from_pretrained("transfo-xl-wt103")
model = TransfoXLForSequenceClassification.from_pretrained("transfo-xl-wt103")

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

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()
model.config.id2label[predicted_class_id]
`,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> TransfoXLTokenizer, TransfoXLForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = TransfoXLTokenizer.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&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><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
`}}),{c(){d=a("p"),v=n("Example of single-label classification:"),c=f(),y(u.$$.fragment)},l(l){d=r(l,"P",{});var h=i(d);v=s(h,"Example of single-label classification:"),h.forEach(t),c=p(l),w(u.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,c,h),$(u,l,h),b=!0},p:gt,i(l){b||(k(u.$$.fragment,l),b=!0)},o(l){L(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(c),x(u,l)}}}function gf(F){let d,v;return d=new _t({props:{code:`# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = TransfoXLForSequenceClassification.from_pretrained("transfo-xl-wt103", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss
round(loss.item(), 2)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
`}}),{c(){y(d.$$.fragment)},l(c){w(d.$$.fragment,c)},m(c,u){$(d,c,u),v=!0},p:gt,i(c){v||(k(d.$$.fragment,c),v=!0)},o(c){L(d.$$.fragment,c),v=!1},d(c){x(d,c)}}}function _f(F){let d,v,c,u,b;return u=new _t({props:{code:`import torch
from transformers import TransfoXLTokenizer, TransfoXLForSequenceClassification

tokenizer = TransfoXLTokenizer.from_pretrained("transfo-xl-wt103")
model = TransfoXLForSequenceClassification.from_pretrained("transfo-xl-wt103", problem_type="multi_label_classification")

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

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()
model.config.id2label[predicted_class_id]
`,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> TransfoXLTokenizer, TransfoXLForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = TransfoXLTokenizer.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&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><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
`}}),{c(){d=a("p"),v=n("Example of multi-label classification:"),c=f(),y(u.$$.fragment)},l(l){d=r(l,"P",{});var h=i(d);v=s(h,"Example of multi-label classification:"),h.forEach(t),c=p(l),w(u.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,c,h),$(u,l,h),b=!0},p:gt,i(l){b||(k(u.$$.fragment,l),b=!0)},o(l){L(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(c),x(u,l)}}}function Tf(F){let d,v;return d=new _t({props:{code:`# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = TransfoXLForSequenceClassification.from_pretrained(
    "transfo-xl-wt103", num_labels=num_labels, problem_type="multi_label_classification"
)

labels = torch.nn.functional.one_hot(torch.tensor([predicted_class_id]), num_classes=num_labels).to(
    torch.float
)
loss = model(**inputs, labels=labels).loss
loss.backward()`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.nn.functional.one_hot(torch.tensor([predicted_class_id]), num_classes=num_labels).to(
<span class="hljs-meta">... </span>    torch.<span class="hljs-built_in">float</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span>loss.backward()`}}),{c(){y(d.$$.fragment)},l(c){w(d.$$.fragment,c)},m(c,u){$(d,c,u),v=!0},p:gt,i(c){v||(k(d.$$.fragment,c),v=!0)},o(c){L(d.$$.fragment,c),v=!1},d(c){x(d,c)}}}function vf(F){let d,v,c,u,b,l,h,E,R,ie,P,S,G,X,me,Y,ze,xe,D,Pe,de,ee,je,Xe,W,Oe,Me,B,ve,Se,ce,C,N,Ee,A,be,Ne,te,ye,De,j,Q,oe,fe,Ae,ne,pe,He,U,Fe,H,qe,K,z,we,O,Ie,$e;return{c(){d=a("p"),v=n("TensorFlow models and layers in "),c=a("code"),u=n("transformers"),b=n(" accept two formats as input:"),l=f(),h=a("ul"),E=a("li"),R=n("having all inputs as keyword arguments (like PyTorch models), or"),ie=f(),P=a("li"),S=n("having all inputs as a list, tuple or dict in the first positional argument."),G=f(),X=a("p"),me=n(`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 `),Y=a("code"),ze=n("model.fit()"),xe=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=a("code"),Pe=n("model.fit()"),de=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),ee=a("code"),je=n("fit()"),Xe=n(" and "),W=a("code"),Oe=n("predict()"),Me=n(`, such as when creating your own layers or models with
the Keras `),B=a("code"),ve=n("Functional"),Se=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ce=f(),C=a("ul"),N=a("li"),Ee=n("a single Tensor with "),A=a("code"),be=n("input_ids"),Ne=n(" only and nothing else: "),te=a("code"),ye=n("model(input_ids)"),De=f(),j=a("li"),Q=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),oe=a("code"),fe=n("model([input_ids, attention_mask])"),Ae=n(" or "),ne=a("code"),pe=n("model([input_ids, attention_mask, token_type_ids])"),He=f(),U=a("li"),Fe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),H=a("code"),qe=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),K=f(),z=a("p"),we=n(`Note that when creating models and layers with
`),O=a("a"),Ie=n("subclassing"),$e=n(` 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(T){d=r(T,"P",{});var M=i(d);v=s(M,"TensorFlow models and layers in "),c=r(M,"CODE",{});var Z=i(c);u=s(Z,"transformers"),Z.forEach(t),b=s(M," accept two formats as input:"),M.forEach(t),l=p(T),h=r(T,"UL",{});var J=i(h);E=r(J,"LI",{});var et=i(E);R=s(et,"having all inputs as keyword arguments (like PyTorch models), or"),et.forEach(t),ie=p(J),P=r(J,"LI",{});var le=i(P);S=s(le,"having all inputs as a list, tuple or dict in the first positional argument."),le.forEach(t),J.forEach(t),G=p(T),X=r(T,"P",{});var q=i(X);me=s(q,`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 `),Y=r(q,"CODE",{});var We=i(Y);ze=s(We,"model.fit()"),We.forEach(t),xe=s(q,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=r(q,"CODE",{});var tt=i(D);Pe=s(tt,"model.fit()"),tt.forEach(t),de=s(q,` supports! If, however, you want to use the second
format outside of Keras methods like `),ee=r(q,"CODE",{});var ot=i(ee);je=s(ot,"fit()"),ot.forEach(t),Xe=s(q," and "),W=r(q,"CODE",{});var Be=i(W);Oe=s(Be,"predict()"),Be.forEach(t),Me=s(q,`, such as when creating your own layers or models with
the Keras `),B=r(q,"CODE",{});var nt=i(B);ve=s(nt,"Functional"),nt.forEach(t),Se=s(q,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),q.forEach(t),ce=p(T),C=r(T,"UL",{});var V=i(C);N=r(V,"LI",{});var I=i(N);Ee=s(I,"a single Tensor with "),A=r(I,"CODE",{});var st=i(A);be=s(st,"input_ids"),st.forEach(t),Ne=s(I," only and nothing else: "),te=r(I,"CODE",{});var at=i(te);ye=s(at,"model(input_ids)"),at.forEach(t),I.forEach(t),De=p(V),j=r(V,"LI",{});var se=i(j);Q=s(se,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),oe=r(se,"CODE",{});var ue=i(oe);fe=s(ue,"model([input_ids, attention_mask])"),ue.forEach(t),Ae=s(se," or "),ne=r(se,"CODE",{});var rt=i(ne);pe=s(rt,"model([input_ids, attention_mask, token_type_ids])"),rt.forEach(t),se.forEach(t),He=p(V),U=r(V,"LI",{});var ge=i(U);Fe=s(ge,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),H=r(ge,"CODE",{});var it=i(H);qe=s(it,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),it.forEach(t),ge.forEach(t),V.forEach(t),K=p(T),z=r(T,"P",{});var _e=i(z);we=s(_e,`Note that when creating models and layers with
`),O=r(_e,"A",{href:!0,rel:!0});var Ue=i(O);Ie=s(Ue,"subclassing"),Ue.forEach(t),$e=s(_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(){m(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(O,"rel","nofollow")},m(T,M){g(T,d,M),e(d,v),e(d,c),e(c,u),e(d,b),g(T,l,M),g(T,h,M),e(h,E),e(E,R),e(h,ie),e(h,P),e(P,S),g(T,G,M),g(T,X,M),e(X,me),e(X,Y),e(Y,ze),e(X,xe),e(X,D),e(D,Pe),e(X,de),e(X,ee),e(ee,je),e(X,Xe),e(X,W),e(W,Oe),e(X,Me),e(X,B),e(B,ve),e(X,Se),g(T,ce,M),g(T,C,M),e(C,N),e(N,Ee),e(N,A),e(A,be),e(N,Ne),e(N,te),e(te,ye),e(C,De),e(C,j),e(j,Q),e(j,oe),e(oe,fe),e(j,Ae),e(j,ne),e(ne,pe),e(C,He),e(C,U),e(U,Fe),e(U,H),e(H,qe),g(T,K,M),g(T,z,M),e(z,we),e(z,O),e(O,Ie),e(z,$e)},d(T){T&&t(d),T&&t(l),T&&t(h),T&&t(G),T&&t(X),T&&t(ce),T&&t(C),T&&t(K),T&&t(z)}}}function bf(F){let d,v,c,u,b;return{c(){d=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var h=i(d);v=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r(h,"CODE",{});var E=i(c);u=s(E,"Module"),E.forEach(t),b=s(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,c),e(c,u),e(d,b)},d(l){l&&t(d)}}}function yf(F){let d,v,c,u,b;return u=new _t({props:{code:`from transformers import TransfoXLTokenizer, TFTransfoXLModel
import tensorflow as tf

tokenizer = TransfoXLTokenizer.from_pretrained("transfo-xl-wt103")
model = TFTransfoXLModel.from_pretrained("transfo-xl-wt103")

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> TransfoXLTokenizer, TFTransfoXLModel
<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 = TransfoXLTokenizer.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFTransfoXLModel.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&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(){d=a("p"),v=n("Example:"),c=f(),y(u.$$.fragment)},l(l){d=r(l,"P",{});var h=i(d);v=s(h,"Example:"),h.forEach(t),c=p(l),w(u.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,c,h),$(u,l,h),b=!0},p:gt,i(l){b||(k(u.$$.fragment,l),b=!0)},o(l){L(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(c),x(u,l)}}}function wf(F){let d,v,c,u,b,l,h,E,R,ie,P,S,G,X,me,Y,ze,xe,D,Pe,de,ee,je,Xe,W,Oe,Me,B,ve,Se,ce,C,N,Ee,A,be,Ne,te,ye,De,j,Q,oe,fe,Ae,ne,pe,He,U,Fe,H,qe,K,z,we,O,Ie,$e;return{c(){d=a("p"),v=n("TensorFlow models and layers in "),c=a("code"),u=n("transformers"),b=n(" accept two formats as input:"),l=f(),h=a("ul"),E=a("li"),R=n("having all inputs as keyword arguments (like PyTorch models), or"),ie=f(),P=a("li"),S=n("having all inputs as a list, tuple or dict in the first positional argument."),G=f(),X=a("p"),me=n(`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 `),Y=a("code"),ze=n("model.fit()"),xe=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=a("code"),Pe=n("model.fit()"),de=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),ee=a("code"),je=n("fit()"),Xe=n(" and "),W=a("code"),Oe=n("predict()"),Me=n(`, such as when creating your own layers or models with
the Keras `),B=a("code"),ve=n("Functional"),Se=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ce=f(),C=a("ul"),N=a("li"),Ee=n("a single Tensor with "),A=a("code"),be=n("input_ids"),Ne=n(" only and nothing else: "),te=a("code"),ye=n("model(input_ids)"),De=f(),j=a("li"),Q=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),oe=a("code"),fe=n("model([input_ids, attention_mask])"),Ae=n(" or "),ne=a("code"),pe=n("model([input_ids, attention_mask, token_type_ids])"),He=f(),U=a("li"),Fe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),H=a("code"),qe=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),K=f(),z=a("p"),we=n(`Note that when creating models and layers with
`),O=a("a"),Ie=n("subclassing"),$e=n(` 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(T){d=r(T,"P",{});var M=i(d);v=s(M,"TensorFlow models and layers in "),c=r(M,"CODE",{});var Z=i(c);u=s(Z,"transformers"),Z.forEach(t),b=s(M," accept two formats as input:"),M.forEach(t),l=p(T),h=r(T,"UL",{});var J=i(h);E=r(J,"LI",{});var et=i(E);R=s(et,"having all inputs as keyword arguments (like PyTorch models), or"),et.forEach(t),ie=p(J),P=r(J,"LI",{});var le=i(P);S=s(le,"having all inputs as a list, tuple or dict in the first positional argument."),le.forEach(t),J.forEach(t),G=p(T),X=r(T,"P",{});var q=i(X);me=s(q,`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 `),Y=r(q,"CODE",{});var We=i(Y);ze=s(We,"model.fit()"),We.forEach(t),xe=s(q,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=r(q,"CODE",{});var tt=i(D);Pe=s(tt,"model.fit()"),tt.forEach(t),de=s(q,` supports! If, however, you want to use the second
format outside of Keras methods like `),ee=r(q,"CODE",{});var ot=i(ee);je=s(ot,"fit()"),ot.forEach(t),Xe=s(q," and "),W=r(q,"CODE",{});var Be=i(W);Oe=s(Be,"predict()"),Be.forEach(t),Me=s(q,`, such as when creating your own layers or models with
the Keras `),B=r(q,"CODE",{});var nt=i(B);ve=s(nt,"Functional"),nt.forEach(t),Se=s(q,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),q.forEach(t),ce=p(T),C=r(T,"UL",{});var V=i(C);N=r(V,"LI",{});var I=i(N);Ee=s(I,"a single Tensor with "),A=r(I,"CODE",{});var st=i(A);be=s(st,"input_ids"),st.forEach(t),Ne=s(I," only and nothing else: "),te=r(I,"CODE",{});var at=i(te);ye=s(at,"model(input_ids)"),at.forEach(t),I.forEach(t),De=p(V),j=r(V,"LI",{});var se=i(j);Q=s(se,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),oe=r(se,"CODE",{});var ue=i(oe);fe=s(ue,"model([input_ids, attention_mask])"),ue.forEach(t),Ae=s(se," or "),ne=r(se,"CODE",{});var rt=i(ne);pe=s(rt,"model([input_ids, attention_mask, token_type_ids])"),rt.forEach(t),se.forEach(t),He=p(V),U=r(V,"LI",{});var ge=i(U);Fe=s(ge,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),H=r(ge,"CODE",{});var it=i(H);qe=s(it,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),it.forEach(t),ge.forEach(t),V.forEach(t),K=p(T),z=r(T,"P",{});var _e=i(z);we=s(_e,`Note that when creating models and layers with
`),O=r(_e,"A",{href:!0,rel:!0});var Ue=i(O);Ie=s(Ue,"subclassing"),Ue.forEach(t),$e=s(_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(){m(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(O,"rel","nofollow")},m(T,M){g(T,d,M),e(d,v),e(d,c),e(c,u),e(d,b),g(T,l,M),g(T,h,M),e(h,E),e(E,R),e(h,ie),e(h,P),e(P,S),g(T,G,M),g(T,X,M),e(X,me),e(X,Y),e(Y,ze),e(X,xe),e(X,D),e(D,Pe),e(X,de),e(X,ee),e(ee,je),e(X,Xe),e(X,W),e(W,Oe),e(X,Me),e(X,B),e(B,ve),e(X,Se),g(T,ce,M),g(T,C,M),e(C,N),e(N,Ee),e(N,A),e(A,be),e(N,Ne),e(N,te),e(te,ye),e(C,De),e(C,j),e(j,Q),e(j,oe),e(oe,fe),e(j,Ae),e(j,ne),e(ne,pe),e(C,He),e(C,U),e(U,Fe),e(U,H),e(H,qe),g(T,K,M),g(T,z,M),e(z,we),e(z,O),e(O,Ie),e(z,$e)},d(T){T&&t(d),T&&t(l),T&&t(h),T&&t(G),T&&t(X),T&&t(ce),T&&t(C),T&&t(K),T&&t(z)}}}function $f(F){let d,v,c,u,b;return{c(){d=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var h=i(d);v=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r(h,"CODE",{});var E=i(c);u=s(E,"Module"),E.forEach(t),b=s(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,c),e(c,u),e(d,b)},d(l){l&&t(d)}}}function kf(F){let d,v,c,u,b;return u=new _t({props:{code:`from transformers import TransfoXLTokenizer, TFTransfoXLLMHeadModel
import tensorflow as tf

tokenizer = TransfoXLTokenizer.from_pretrained("transfo-xl-wt103")
model = TFTransfoXLLMHeadModel.from_pretrained("transfo-xl-wt103")

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> TransfoXLTokenizer, TFTransfoXLLMHeadModel
<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 = TransfoXLTokenizer.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFTransfoXLLMHeadModel.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&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(){d=a("p"),v=n("Example:"),c=f(),y(u.$$.fragment)},l(l){d=r(l,"P",{});var h=i(d);v=s(h,"Example:"),h.forEach(t),c=p(l),w(u.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,c,h),$(u,l,h),b=!0},p:gt,i(l){b||(k(u.$$.fragment,l),b=!0)},o(l){L(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(c),x(u,l)}}}function Lf(F){let d,v,c,u,b,l,h,E,R,ie,P,S,G,X,me,Y,ze,xe,D,Pe,de,ee,je,Xe,W,Oe,Me,B,ve,Se,ce,C,N,Ee,A,be,Ne,te,ye,De,j,Q,oe,fe,Ae,ne,pe,He,U,Fe,H,qe,K,z,we,O,Ie,$e;return{c(){d=a("p"),v=n("TensorFlow models and layers in "),c=a("code"),u=n("transformers"),b=n(" accept two formats as input:"),l=f(),h=a("ul"),E=a("li"),R=n("having all inputs as keyword arguments (like PyTorch models), or"),ie=f(),P=a("li"),S=n("having all inputs as a list, tuple or dict in the first positional argument."),G=f(),X=a("p"),me=n(`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 `),Y=a("code"),ze=n("model.fit()"),xe=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=a("code"),Pe=n("model.fit()"),de=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),ee=a("code"),je=n("fit()"),Xe=n(" and "),W=a("code"),Oe=n("predict()"),Me=n(`, such as when creating your own layers or models with
the Keras `),B=a("code"),ve=n("Functional"),Se=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ce=f(),C=a("ul"),N=a("li"),Ee=n("a single Tensor with "),A=a("code"),be=n("input_ids"),Ne=n(" only and nothing else: "),te=a("code"),ye=n("model(input_ids)"),De=f(),j=a("li"),Q=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),oe=a("code"),fe=n("model([input_ids, attention_mask])"),Ae=n(" or "),ne=a("code"),pe=n("model([input_ids, attention_mask, token_type_ids])"),He=f(),U=a("li"),Fe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),H=a("code"),qe=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),K=f(),z=a("p"),we=n(`Note that when creating models and layers with
`),O=a("a"),Ie=n("subclassing"),$e=n(` 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(T){d=r(T,"P",{});var M=i(d);v=s(M,"TensorFlow models and layers in "),c=r(M,"CODE",{});var Z=i(c);u=s(Z,"transformers"),Z.forEach(t),b=s(M," accept two formats as input:"),M.forEach(t),l=p(T),h=r(T,"UL",{});var J=i(h);E=r(J,"LI",{});var et=i(E);R=s(et,"having all inputs as keyword arguments (like PyTorch models), or"),et.forEach(t),ie=p(J),P=r(J,"LI",{});var le=i(P);S=s(le,"having all inputs as a list, tuple or dict in the first positional argument."),le.forEach(t),J.forEach(t),G=p(T),X=r(T,"P",{});var q=i(X);me=s(q,`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 `),Y=r(q,"CODE",{});var We=i(Y);ze=s(We,"model.fit()"),We.forEach(t),xe=s(q,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=r(q,"CODE",{});var tt=i(D);Pe=s(tt,"model.fit()"),tt.forEach(t),de=s(q,` supports! If, however, you want to use the second
format outside of Keras methods like `),ee=r(q,"CODE",{});var ot=i(ee);je=s(ot,"fit()"),ot.forEach(t),Xe=s(q," and "),W=r(q,"CODE",{});var Be=i(W);Oe=s(Be,"predict()"),Be.forEach(t),Me=s(q,`, such as when creating your own layers or models with
the Keras `),B=r(q,"CODE",{});var nt=i(B);ve=s(nt,"Functional"),nt.forEach(t),Se=s(q,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),q.forEach(t),ce=p(T),C=r(T,"UL",{});var V=i(C);N=r(V,"LI",{});var I=i(N);Ee=s(I,"a single Tensor with "),A=r(I,"CODE",{});var st=i(A);be=s(st,"input_ids"),st.forEach(t),Ne=s(I," only and nothing else: "),te=r(I,"CODE",{});var at=i(te);ye=s(at,"model(input_ids)"),at.forEach(t),I.forEach(t),De=p(V),j=r(V,"LI",{});var se=i(j);Q=s(se,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),oe=r(se,"CODE",{});var ue=i(oe);fe=s(ue,"model([input_ids, attention_mask])"),ue.forEach(t),Ae=s(se," or "),ne=r(se,"CODE",{});var rt=i(ne);pe=s(rt,"model([input_ids, attention_mask, token_type_ids])"),rt.forEach(t),se.forEach(t),He=p(V),U=r(V,"LI",{});var ge=i(U);Fe=s(ge,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),H=r(ge,"CODE",{});var it=i(H);qe=s(it,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),it.forEach(t),ge.forEach(t),V.forEach(t),K=p(T),z=r(T,"P",{});var _e=i(z);we=s(_e,`Note that when creating models and layers with
`),O=r(_e,"A",{href:!0,rel:!0});var Ue=i(O);Ie=s(Ue,"subclassing"),Ue.forEach(t),$e=s(_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(){m(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(O,"rel","nofollow")},m(T,M){g(T,d,M),e(d,v),e(d,c),e(c,u),e(d,b),g(T,l,M),g(T,h,M),e(h,E),e(E,R),e(h,ie),e(h,P),e(P,S),g(T,G,M),g(T,X,M),e(X,me),e(X,Y),e(Y,ze),e(X,xe),e(X,D),e(D,Pe),e(X,de),e(X,ee),e(ee,je),e(X,Xe),e(X,W),e(W,Oe),e(X,Me),e(X,B),e(B,ve),e(X,Se),g(T,ce,M),g(T,C,M),e(C,N),e(N,Ee),e(N,A),e(A,be),e(N,Ne),e(N,te),e(te,ye),e(C,De),e(C,j),e(j,Q),e(j,oe),e(oe,fe),e(j,Ae),e(j,ne),e(ne,pe),e(C,He),e(C,U),e(U,Fe),e(U,H),e(H,qe),g(T,K,M),g(T,z,M),e(z,we),e(z,O),e(O,Ie),e(z,$e)},d(T){T&&t(d),T&&t(l),T&&t(h),T&&t(G),T&&t(X),T&&t(ce),T&&t(C),T&&t(K),T&&t(z)}}}function xf(F){let d,v,c,u,b;return{c(){d=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var h=i(d);v=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r(h,"CODE",{});var E=i(c);u=s(E,"Module"),E.forEach(t),b=s(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,c),e(c,u),e(d,b)},d(l){l&&t(d)}}}function Xf(F){let d,v,c,u,b;return u=new _t({props:{code:`from transformers import TransfoXLTokenizer, TFTransfoXLForSequenceClassification
import tensorflow as tf

tokenizer = TransfoXLTokenizer.from_pretrained("transfo-xl-wt103")
model = TFTransfoXLForSequenceClassification.from_pretrained("transfo-xl-wt103")

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

logits = model(**inputs).logits

predicted_class_id = int(tf.math.argmax(logits, axis=-1)[0])
model.config.id2label[predicted_class_id]
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TransfoXLTokenizer, TFTransfoXLForSequenceClassification
<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 = TransfoXLTokenizer.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFTransfoXLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&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>logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
`}}),{c(){d=a("p"),v=n("Example:"),c=f(),y(u.$$.fragment)},l(l){d=r(l,"P",{});var h=i(d);v=s(h,"Example:"),h.forEach(t),c=p(l),w(u.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,c,h),$(u,l,h),b=!0},p:gt,i(l){b||(k(u.$$.fragment,l),b=!0)},o(l){L(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(c),x(u,l)}}}function Mf(F){let d,v;return d=new _t({props:{code:`# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = TFTransfoXLForSequenceClassification.from_pretrained("transfo-xl-wt103", num_labels=num_labels)

labels = tf.constant(1)
loss = model(**inputs, labels=labels).loss
round(float(loss), 2)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFTransfoXLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tf.constant(<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(<span class="hljs-built_in">float</span>(loss), <span class="hljs-number">2</span>)
`}}),{c(){y(d.$$.fragment)},l(c){w(d.$$.fragment,c)},m(c,u){$(d,c,u),v=!0},p:gt,i(c){v||(k(d.$$.fragment,c),v=!0)},o(c){L(d.$$.fragment,c),v=!1},d(c){x(d,c)}}}function Ef(F){let d,v,c,u,b,l,h,E,R,ie,P,S,G,X,me,Y,ze,xe,D,Pe,de,ee,je,Xe,W,Oe,Me,B,ve,Se,ce,C,N,Ee,A,be,Ne,te,ye,De,j,Q,oe,fe,Ae,ne,pe,He,U,Fe,H,qe,K,z,we,O,Ie,$e,T,M,Z,J,et,le,q,We,tt,ot,Be,nt,V,I,st,at,se,ue,rt,ge,it,_e,Ue,tr,or,nr,Bt,aa,kt,Ut,os,Xo,sr,ns,ar,ra,Qe,Mo,rr,Eo,ir,Fo,lr,dr,cr,qo,fr,qn,pr,hr,mr,Cn,Co,ia,Lt,Kt,ss,zo,ur,as,gr,la,xt,Po,_r,rs,Tr,da,Xt,jo,vr,is,br,ca,Mt,Oo,yr,ls,wr,fa,Et,So,$r,ds,kr,pa,Ft,Vt,cs,No,Lr,fs,xr,ha,Ke,Do,Xr,ps,Mr,Er,Ao,Fr,zn,qr,Cr,zr,Ho,Pr,Io,jr,Or,Sr,lt,Wo,Nr,qt,Dr,Pn,Ar,Hr,hs,Ir,Wr,Br,Rt,Ur,Gt,ma,Ct,Yt,ms,Bo,Kr,us,Vr,ua,Ve,Uo,Rr,gs,Gr,Yr,Ko,Qr,jn,Zr,Jr,ei,Vo,ti,Ro,oi,ni,si,dt,Go,ai,zt,ri,On,ii,li,_s,di,ci,fi,Qt,pi,Zt,ga,Pt,Jt,Ts,Yo,hi,vs,mi,_a,he,Qo,ui,bs,gi,_i,Sn,Nn,Ti,vi,bi,Ze,yi,ys,wi,$i,ws,ki,Li,$s,xi,Xi,ks,Mi,Ei,Fi,Zo,qi,Dn,Ci,zi,Pi,Jo,ji,en,Oi,Si,Ni,Te,tn,Di,jt,Ai,An,Hi,Ii,Ls,Wi,Bi,Ui,eo,Ki,to,Vi,oo,Ri,no,Gi,so,Ta,Ot,ao,xs,on,Yi,Xs,Qi,va,ke,nn,Zi,Ms,Ji,el,sn,tl,Hn,ol,nl,sl,an,al,rn,rl,il,ll,ro,dl,ct,ln,cl,St,fl,In,pl,hl,Es,ml,ul,gl,io,_l,lo,ba,Nt,co,Fs,dn,Tl,qs,vl,ya,Le,cn,bl,Cs,yl,wl,fn,$l,Wn,kl,Ll,xl,pn,Xl,hn,Ml,El,Fl,fo,ql,ft,mn,Cl,Dt,zl,Bn,Pl,jl,zs,Ol,Sl,Nl,po,Dl,ho,wa,At,mo,Ps,un,Al,js,Hl,$a,ae,gn,Il,Os,Wl,Bl,Un,Kn,Ul,Kl,Vl,Je,Rl,Ss,Gl,Yl,Ns,Ql,Zl,Ds,Jl,ed,As,td,od,nd,_n,sd,Vn,ad,rd,id,Tn,ld,vn,dd,cd,fd,uo,pd,Re,bn,hd,Ht,md,Rn,ud,gd,Hs,_d,Td,vd,go,bd,_o,yd,To,ka,It,vo,Is,yn,wd,Ws,$d,La,wn,$n,xa,kn,Ln,Xa;return l=new mt({}),X=new mt({}),H=new $t({props:{warning:!0,$$slots:{default:[lf]},$$scope:{ctx:F}}}),O=new mt({}),J=new re({props:{name:"class transformers.TransfoXLConfig",anchor:"transformers.TransfoXLConfig",parameters:[{name:"vocab_size",val:" = 267735"},{name:"cutoffs",val:" = [20000, 40000, 200000]"},{name:"d_model",val:" = 1024"},{name:"d_embed",val:" = 1024"},{name:"n_head",val:" = 16"},{name:"d_head",val:" = 64"},{name:"d_inner",val:" = 4096"},{name:"div_val",val:" = 4"},{name:"pre_lnorm",val:" = False"},{name:"n_layer",val:" = 18"},{name:"mem_len",val:" = 1600"},{name:"clamp_len",val:" = 1000"},{name:"same_length",val:" = True"},{name:"proj_share_all_but_first",val:" = True"},{name:"attn_type",val:" = 0"},{name:"sample_softmax",val:" = -1"},{name:"adaptive",val:" = True"},{name:"dropout",val:" = 0.1"},{name:"dropatt",val:" = 0.0"},{name:"untie_r",val:" = True"},{name:"init",val:" = 'normal'"},{name:"init_range",val:" = 0.01"},{name:"proj_init_std",val:" = 0.01"},{name:"init_std",val:" = 0.02"},{name:"layer_norm_epsilon",val:" = 1e-05"},{name:"eos_token_id",val:" = 0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TransfoXLConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 267735) &#x2014;
Vocabulary size of the BERT model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLModel">TransfoXLModel</a> or <a href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TFTransfoXLModel">TFTransfoXLModel</a>.`,name:"vocab_size"},{anchor:"transformers.TransfoXLConfig.cutoffs",description:`<strong>cutoffs</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[20000, 40000, 200000]</code>) &#x2014;
Cutoffs for the adaptive softmax.`,name:"cutoffs"},{anchor:"transformers.TransfoXLConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the model&#x2019;s hidden states.`,name:"d_model"},{anchor:"transformers.TransfoXLConfig.d_embed",description:`<strong>d_embed</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the embeddings`,name:"d_embed"},{anchor:"transformers.TransfoXLConfig.n_head",description:`<strong>n_head</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"n_head"},{anchor:"transformers.TransfoXLConfig.d_head",description:`<strong>d_head</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Dimensionality of the model&#x2019;s heads.`,name:"d_head"},{anchor:"transformers.TransfoXLConfig.d_inner",description:`<strong>d_inner</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Inner dimension in FF`,name:"d_inner"},{anchor:"transformers.TransfoXLConfig.div_val",description:`<strong>div_val</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Divident value for adapative input and softmax`,name:"div_val"},{anchor:"transformers.TransfoXLConfig.pre_lnorm",description:`<strong>pre_lnorm</strong> (<code>boolean</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to apply LayerNorm to the input instead of the output in the blocks.`,name:"pre_lnorm"},{anchor:"transformers.TransfoXLConfig.n_layer",description:`<strong>n_layer</strong> (<code>int</code>, <em>optional</em>, defaults to 18) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"n_layer"},{anchor:"transformers.TransfoXLConfig.mem_len",description:`<strong>mem_len</strong> (<code>int</code>, <em>optional</em>, defaults to 1600) &#x2014;
Length of the retained previous heads.`,name:"mem_len"},{anchor:"transformers.TransfoXLConfig.clamp_len",description:`<strong>clamp_len</strong> (<code>int</code>, <em>optional</em>, defaults to 1000) &#x2014;
Use the same pos embeddings after clamp_len.`,name:"clamp_len"},{anchor:"transformers.TransfoXLConfig.same_length",description:`<strong>same_length</strong> (<code>boolean</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use the same attn length for all tokens`,name:"same_length"},{anchor:"transformers.TransfoXLConfig.proj_share_all_but_first",description:`<strong>proj_share_all_but_first</strong> (<code>boolean</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
True to share all but first projs, False not to share.`,name:"proj_share_all_but_first"},{anchor:"transformers.TransfoXLConfig.attn_type",description:`<strong>attn_type</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Attention type. 0 for Transformer-XL, 1 for Shaw et al, 2 for Vaswani et al, 3 for Al Rfou et al.`,name:"attn_type"},{anchor:"transformers.TransfoXLConfig.sample_softmax",description:`<strong>sample_softmax</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Number of samples in the sampled softmax.`,name:"sample_softmax"},{anchor:"transformers.TransfoXLConfig.adaptive",description:`<strong>adaptive</strong> (<code>boolean</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use adaptive softmax.`,name:"adaptive"},{anchor:"transformers.TransfoXLConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.TransfoXLConfig.dropatt",description:`<strong>dropatt</strong> (<code>float</code>, <em>optional</em>, defaults to 0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"dropatt"},{anchor:"transformers.TransfoXLConfig.untie_r",description:`<strong>untie_r</strong> (<code>boolean</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether ot not to untie relative position biases.`,name:"untie_r"},{anchor:"transformers.TransfoXLConfig.init",description:`<strong>init</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;normal&quot;</code>) &#x2014;
Parameter initializer to use.`,name:"init"},{anchor:"transformers.TransfoXLConfig.init_range",description:`<strong>init_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.01) &#x2014;
Parameters initialized by U(-init_range, init_range).`,name:"init_range"},{anchor:"transformers.TransfoXLConfig.proj_init_std",description:`<strong>proj_init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.01) &#x2014;
Parameters initialized by N(0, init_std)`,name:"proj_init_std"},{anchor:"transformers.TransfoXLConfig.init_std",description:`<strong>init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
Parameters initialized by N(0, init_std)`,name:"init_std"},{anchor:"transformers.TransfoXLConfig.layer_norm_epsilon",description:`<strong>layer_norm_epsilon</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon to use in the layer normalization layers`,name:"layer_norm_epsilon"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/transfo_xl/configuration_transfo_xl.py#L29"}}),Bt=new ut({props:{anchor:"transformers.TransfoXLConfig.example",$$slots:{default:[df]},$$scope:{ctx:F}}}),Xo=new mt({}),Mo=new re({props:{name:"class transformers.TransfoXLTokenizer",anchor:"transformers.TransfoXLTokenizer",parameters:[{name:"special",val:" = None"},{name:"min_freq",val:" = 0"},{name:"max_size",val:" = None"},{name:"lower_case",val:" = False"},{name:"delimiter",val:" = None"},{name:"vocab_file",val:" = None"},{name:"pretrained_vocab_file",val:": str = None"},{name:"never_split",val:" = None"},{name:"unk_token",val:" = '<unk>'"},{name:"eos_token",val:" = '<eos>'"},{name:"additional_special_tokens",val:" = ['<formula>']"},{name:"language",val:" = 'en'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TransfoXLTokenizer.special",description:`<strong>special</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
A list of special tokens (to be treated by the original implementation of this tokenizer).`,name:"special"},{anchor:"transformers.TransfoXLTokenizer.min_freq",description:`<strong>min_freq</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The minimum number of times a token has to be present in order to be kept in the vocabulary (otherwise it
will be mapped to <code>unk_token</code>).`,name:"min_freq"},{anchor:"transformers.TransfoXLTokenizer.max_size",description:`<strong>max_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum size of the vocabulary. If left unset, it will default to the size of the vocabulary found
after excluding the tokens according to the <code>min_freq</code> rule.`,name:"max_size"},{anchor:"transformers.TransfoXLTokenizer.lower_case",description:`<strong>lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"lower_case"},{anchor:"transformers.TransfoXLTokenizer.delimiter",description:`<strong>delimiter</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The delimiter used between tokens.`,name:"delimiter"},{anchor:"transformers.TransfoXLTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
File containing the vocabulary (from the original implementation).`,name:"vocab_file"},{anchor:"transformers.TransfoXLTokenizer.pretrained_vocab_file",description:`<strong>pretrained_vocab_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
File containing the vocabulary as saved with the <code>save_pretrained()</code> method.`,name:"pretrained_vocab_file"},{anchor:"transformers.TransfoXLTokenizer.never_split",description:`<strong>never_split</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
List of tokens that should never be split. If no list is specified, will simply use the existing special
tokens.`,name:"never_split"},{anchor:"transformers.TransfoXLTokenizer.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.TransfoXLTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;eos&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.TransfoXLTokenizer.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>, defaults to <code>[&quot;&lt;formula&gt;&quot;]</code>) &#x2014;
A list of additional special tokens (for the HuggingFace functionality).`,name:"additional_special_tokens"},{anchor:"transformers.TransfoXLTokenizer.language",description:`<strong>language</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;en&quot;</code>) &#x2014;
The language of this tokenizer (used for mose preprocessing).`,name:"language"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/transfo_xl/tokenization_transfo_xl.py#L123"}}),Co=new re({props:{name:"save_vocabulary",anchor:"transformers.TransfoXLTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/transfo_xl/tokenization_transfo_xl.py#L310"}}),zo=new mt({}),Po=new re({props:{name:"class transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput",anchor:"transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput",parameters:[{name:"last_hidden_state",val:": FloatTensor"},{name:"mems",val:": typing.List[torch.FloatTensor] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the model.`,name:"last_hidden_state"},{anchor:"transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.`,name:"mems"},{anchor:"transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L602"}}),jo=new re({props:{name:"class transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput",anchor:"transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput",parameters:[{name:"losses",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prediction_scores",val:": FloatTensor = None"},{name:"mems",val:": typing.List[torch.FloatTensor] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"}],parametersDescription:[{anchor:"transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput.losses",description:`<strong>losses</strong> (<code>torch.FloatTensor</code> of shape <em>(batch_size, sequence_length-1)</em>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Language modeling losses (not reduced).`,name:"losses"},{anchor:"transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput.prediction_scores",description:`<strong>prediction_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token after SoftMax).`,name:"prediction_scores"},{anchor:"transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.`,name:"mems"},{anchor:"transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"},{anchor:"transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>()</code>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Reduced language modeling loss.`,name:"loss"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L667"}}),Oo=new re({props:{name:"class transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput",anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput",parameters:[{name:"last_hidden_state",val:": Tensor = None"},{name:"mems",val:": typing.List[tensorflow.python.framework.ops.Tensor] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],parametersDescription:[{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the model.`,name:"last_hidden_state"},{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.`,name:"mems"},{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L701"}}),So=new re({props:{name:"class transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput",anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput",parameters:[{name:"prediction_scores",val:": Tensor = None"},{name:"mems",val:": typing.List[tensorflow.python.framework.ops.Tensor] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],parametersDescription:[{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput.losses",description:`<strong>losses</strong> (<code>tf.Tensor</code> of shape <em>(batch_size, sequence_length-1)</em>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Language modeling losses (not reduced).`,name:"losses"},{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput.prediction_scores",description:`<strong>prediction_scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token after SoftMax).`,name:"prediction_scores"},{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.`,name:"mems"},{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L732"}}),No=new mt({}),Do=new re({props:{name:"class transformers.TransfoXLModel",anchor:"transformers.TransfoXLModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.TransfoXLModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</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.25.1/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.25.1/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L766"}}),Wo=new re({props:{name:"forward",anchor:"transformers.TransfoXLModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"mems",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = 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.TransfoXLModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLTokenizer">TransfoXLTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TransfoXLModel.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TransfoXLModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TransfoXLModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TransfoXLModel.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.TransfoXLModel.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.TransfoXLModel.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.25.1/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.25.1/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L870",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput"
>transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput</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.25.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput"
>transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Rt=new $t({props:{$$slots:{default:[cf]},$$scope:{ctx:F}}}),Gt=new ut({props:{anchor:"transformers.TransfoXLModel.forward.example",$$slots:{default:[ff]},$$scope:{ctx:F}}}),Bo=new mt({}),Uo=new re({props:{name:"class transformers.TransfoXLLMHeadModel",anchor:"transformers.TransfoXLLMHeadModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.TransfoXLLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</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.25.1/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.25.1/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L1008"}}),Go=new re({props:{name:"forward",anchor:"transformers.TransfoXLLMHeadModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"mems",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.TransfoXLLMHeadModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLTokenizer">TransfoXLTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TransfoXLLMHeadModel.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TransfoXLLMHeadModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TransfoXLLMHeadModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TransfoXLLMHeadModel.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.TransfoXLLMHeadModel.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.TransfoXLLMHeadModel.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.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TransfoXLLMHeadModel.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for language modeling. Note that the labels <strong>are shifted</strong> inside the model, i.e. you can set
<code>labels = input_ids</code> Indices are selected in <code>[-100, 0, ..., config.vocab_size]</code> All labels set to <code>-100</code>
are ignored (masked), the loss is only computed for labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L1064",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput"
>transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput</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.25.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>losses</strong> (<code>torch.FloatTensor</code> of shape <em>(batch_size, sequence_length-1)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling losses (not reduced).</p>
</li>
<li>
<p><strong>prediction_scores</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 after SoftMax).</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>()</code>, <em>optional</em>, returned when <code>labels</code> is provided)
Reduced language modeling loss.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput"
>transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qt=new $t({props:{$$slots:{default:[pf]},$$scope:{ctx:F}}}),Zt=new ut({props:{anchor:"transformers.TransfoXLLMHeadModel.forward.example",$$slots:{default:[hf]},$$scope:{ctx:F}}}),Yo=new mt({}),Qo=new re({props:{name:"class transformers.TransfoXLForSequenceClassification",anchor:"transformers.TransfoXLForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.TransfoXLForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</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.25.1/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.25.1/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L1197"}}),tn=new re({props:{name:"forward",anchor:"transformers.TransfoXLForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"mems",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.TransfoXLForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLTokenizer">TransfoXLTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TransfoXLForSequenceClassification.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.TransfoXLForSequenceClassification.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.TransfoXLForSequenceClassification.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.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L1208",returnDescription:`
<p>A <code>transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLSequenceClassifierOutputWithPast</code> 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.25.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLSequenceClassifierOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),eo=new $t({props:{$$slots:{default:[mf]},$$scope:{ctx:F}}}),to=new ut({props:{anchor:"transformers.TransfoXLForSequenceClassification.forward.example",$$slots:{default:[uf]},$$scope:{ctx:F}}}),oo=new ut({props:{anchor:"transformers.TransfoXLForSequenceClassification.forward.example-2",$$slots:{default:[gf]},$$scope:{ctx:F}}}),no=new ut({props:{anchor:"transformers.TransfoXLForSequenceClassification.forward.example-3",$$slots:{default:[_f]},$$scope:{ctx:F}}}),so=new ut({props:{anchor:"transformers.TransfoXLForSequenceClassification.forward.example-4",$$slots:{default:[Tf]},$$scope:{ctx:F}}}),on=new mt({}),nn=new re({props:{name:"class transformers.TFTransfoXLModel",anchor:"transformers.TFTransfoXLModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFTransfoXLModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</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.25.1/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.25.1/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L883"}}),ro=new $t({props:{$$slots:{default:[vf]},$$scope:{ctx:F}}}),ln=new re({props:{name:"call",anchor:"transformers.TFTransfoXLModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"mems",val:": typing.Optional[typing.List[tensorflow.python.framework.ops.Tensor]] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFTransfoXLModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFTransfoXLModel.call.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TFTransfoXLModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFTransfoXLModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> or <code>Numpy array</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.TFTransfoXLModel.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.TFTransfoXLModel.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.TFTransfoXLModel.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.25.1/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.TFTransfoXLModel.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.25.1/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L888",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput"
>transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput</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.25.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput"
>transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),io=new $t({props:{$$slots:{default:[bf]},$$scope:{ctx:F}}}),lo=new ut({props:{anchor:"transformers.TFTransfoXLModel.call.example",$$slots:{default:[yf]},$$scope:{ctx:F}}}),dn=new mt({}),cn=new re({props:{name:"class transformers.TFTransfoXLLMHeadModel",anchor:"transformers.TFTransfoXLLMHeadModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFTransfoXLLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</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.25.1/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.25.1/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L939"}}),fo=new $t({props:{$$slots:{default:[wf]},$$scope:{ctx:F}}}),mn=new re({props:{name:"call",anchor:"transformers.TFTransfoXLLMHeadModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"mems",val:": typing.Optional[typing.List[tensorflow.python.framework.ops.Tensor]] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFTransfoXLLMHeadModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> or <code>Numpy array</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.TFTransfoXLLMHeadModel.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.TFTransfoXLLMHeadModel.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.TFTransfoXLLMHeadModel.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.25.1/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.TFTransfoXLLMHeadModel.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.25.1/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L968",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput"
>transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput</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.25.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>losses</strong> (<code>tf.Tensor</code> of shape <em>(batch_size, sequence_length-1)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling losses (not reduced).</p>
</li>
<li>
<p><strong>prediction_scores</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 after SoftMax).</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput"
>transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),po=new $t({props:{$$slots:{default:[$f]},$$scope:{ctx:F}}}),ho=new ut({props:{anchor:"transformers.TFTransfoXLLMHeadModel.call.example",$$slots:{default:[kf]},$$scope:{ctx:F}}}),un=new mt({}),gn=new re({props:{name:"class transformers.TFTransfoXLForSequenceClassification",anchor:"transformers.TFTransfoXLForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFTransfoXLForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</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.25.1/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.25.1/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L1062"}}),uo=new $t({props:{$$slots:{default:[Lf]},$$scope:{ctx:F}}}),bn=new re({props:{name:"call",anchor:"transformers.TFTransfoXLForSequenceClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"mems",val:": typing.Optional[typing.List[tensorflow.python.framework.ops.Tensor]] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFTransfoXLForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> or <code>Numpy array</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.TFTransfoXLForSequenceClassification.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.TFTransfoXLForSequenceClassification.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.TFTransfoXLForSequenceClassification.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.25.1/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.TFTransfoXLForSequenceClassification.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.TFTransfoXLForSequenceClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the cross entropy classification loss. Indices should be in <code>[0, ..., config.vocab_size - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L1077",returnDescription:`
<p>A <code>transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLSequenceClassifierOutputWithPast</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLSequenceClassifierOutputWithPast</code> or <code>tuple(tf.Tensor)</code></p>
`}}),go=new $t({props:{$$slots:{default:[xf]},$$scope:{ctx:F}}}),_o=new ut({props:{anchor:"transformers.TFTransfoXLForSequenceClassification.call.example",$$slots:{default:[Xf]},$$scope:{ctx:F}}}),To=new ut({props:{anchor:"transformers.TFTransfoXLForSequenceClassification.call.example-2",$$slots:{default:[Mf]},$$scope:{ctx:F}}}),yn=new mt({}),$n=new re({props:{name:"class transformers.AdaptiveEmbedding",anchor:"transformers.AdaptiveEmbedding",parameters:[{name:"n_token",val:""},{name:"d_embed",val:""},{name:"d_proj",val:""},{name:"cutoffs",val:""},{name:"div_val",val:" = 1"},{name:"sample_softmax",val:" = False"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L401"}}),Ln=new re({props:{name:"class transformers.TFAdaptiveEmbedding",anchor:"transformers.TFAdaptiveEmbedding",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L343"}}),{c(){d=a("meta"),v=f(),c=a("h1"),u=a("a"),b=a("span"),y(l.$$.fragment),h=f(),E=a("span"),R=n("Transformer XL"),ie=f(),P=a("h2"),S=a("a"),G=a("span"),y(X.$$.fragment),me=f(),Y=a("span"),ze=n("Overview"),xe=f(),D=a("p"),Pe=n("The Transformer-XL model was proposed in "),de=a("a"),ee=n("Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context"),je=n(` by Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V. Le, Ruslan
Salakhutdinov. It\u2019s a causal (uni-directional) transformer with relative positioning (sinuso\xEFdal) embeddings which can
reuse previously computed hidden-states to attend to longer context (memory). This model also uses adaptive softmax
inputs and outputs (tied).`),Xe=f(),W=a("p"),Oe=n("The abstract from the paper is the following:"),Me=f(),B=a("p"),ve=a("em"),Se=n(`Transformers have a potential of learning longer-term dependency, but are limited by a fixed-length context in the
setting of language modeling. We propose a novel neural architecture Transformer-XL that enables learning dependency
beyond a fixed length without disrupting temporal coherence. It consists of a segment-level recurrence mechanism and a
novel positional encoding scheme. Our method not only enables capturing longer-term dependency, but also resolves the
context fragmentation problem. As a result, Transformer-XL learns dependency that is 80% longer than RNNs and 450%
longer than vanilla Transformers, achieves better performance on both short and long sequences, and is up to 1,800+
times faster than vanilla Transformers during evaluation. Notably, we improve the state-of-the-art results of
bpc/perplexity to 0.99 on enwiki8, 1.08 on text8, 18.3 on WikiText-103, 21.8 on One Billion Word, and 54.5 on Penn
Treebank (without finetuning). When trained only on WikiText-103, Transformer-XL manages to generate reasonably
coherent, novel text articles with thousands of tokens.`),ce=f(),C=a("p"),N=n("Tips:"),Ee=f(),A=a("ul"),be=a("li"),Ne=n(`Transformer-XL uses relative sinusoidal positional embeddings. Padding can be done on the left or on the right. The
original implementation trains on SQuAD with padding on the left, therefore the padding defaults are set to left.`),te=f(),ye=a("li"),De=n("Transformer-XL is one of the few models that has no sequence length limit."),j=f(),Q=a("p"),oe=n("This model was contributed by "),fe=a("a"),Ae=n("thomwolf"),ne=n(". The original code can be found "),pe=a("a"),He=n("here"),U=n("."),Fe=f(),y(H.$$.fragment),qe=f(),K=a("h2"),z=a("a"),we=a("span"),y(O.$$.fragment),Ie=f(),$e=a("span"),T=n("TransfoXLConfig"),M=f(),Z=a("div"),y(J.$$.fragment),et=f(),le=a("p"),q=n("This is the configuration class to store the configuration of a "),We=a("a"),tt=n("TransfoXLModel"),ot=n(" or a "),Be=a("a"),nt=n("TFTransfoXLModel"),V=n(`. It is
used to instantiate a Transformer-XL 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 TransfoXL
`),I=a("a"),st=n("transfo-xl-wt103"),at=n(" architecture."),se=f(),ue=a("p"),rt=n("Configuration objects inherit from "),ge=a("a"),it=n("PretrainedConfig"),_e=n(` and can be used to control the model outputs. Read the
documentation from `),Ue=a("a"),tr=n("PretrainedConfig"),or=n(" for more information."),nr=f(),y(Bt.$$.fragment),aa=f(),kt=a("h2"),Ut=a("a"),os=a("span"),y(Xo.$$.fragment),sr=f(),ns=a("span"),ar=n("TransfoXLTokenizer"),ra=f(),Qe=a("div"),y(Mo.$$.fragment),rr=f(),Eo=a("p"),ir=n("Construct a Transformer-XL tokenizer adapted from Vocab class in "),Fo=a("a"),lr=n(`the original
code`),dr=n(`. The Transformer-XL tokenizer is a word-level tokenizer (no
sub-word tokenization).`),cr=f(),qo=a("p"),fr=n("This tokenizer inherits from "),qn=a("a"),pr=n("PreTrainedTokenizer"),hr=n(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),mr=f(),Cn=a("div"),y(Co.$$.fragment),ia=f(),Lt=a("h2"),Kt=a("a"),ss=a("span"),y(zo.$$.fragment),ur=f(),as=a("span"),gr=n("TransfoXL specific outputs"),la=f(),xt=a("div"),y(Po.$$.fragment),_r=f(),rs=a("p"),Tr=n("Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),da=f(),Xt=a("div"),y(jo.$$.fragment),vr=f(),is=a("p"),br=n("Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),ca=f(),Mt=a("div"),y(Oo.$$.fragment),yr=f(),ls=a("p"),wr=n("Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),fa=f(),Et=a("div"),y(So.$$.fragment),$r=f(),ds=a("p"),kr=n("Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),pa=f(),Ft=a("h2"),Vt=a("a"),cs=a("span"),y(No.$$.fragment),Lr=f(),fs=a("span"),xr=n("TransfoXLModel"),ha=f(),Ke=a("div"),y(Do.$$.fragment),Xr=f(),ps=a("p"),Mr=n("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),Er=f(),Ao=a("p"),Fr=n("This model inherits from "),zn=a("a"),qr=n("PreTrainedModel"),Cr=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),zr=f(),Ho=a("p"),Pr=n("This model is also a PyTorch "),Io=a("a"),jr=n("torch.nn.Module"),Or=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sr=f(),lt=a("div"),y(Wo.$$.fragment),Nr=f(),qt=a("p"),Dr=n("The "),Pn=a("a"),Ar=n("TransfoXLModel"),Hr=n(" forward method, overrides the "),hs=a("code"),Ir=n("__call__"),Wr=n(" special method."),Br=f(),y(Rt.$$.fragment),Ur=f(),y(Gt.$$.fragment),ma=f(),Ct=a("h2"),Yt=a("a"),ms=a("span"),y(Bo.$$.fragment),Kr=f(),us=a("span"),Vr=n("TransfoXLLMHeadModel"),ua=f(),Ve=a("div"),y(Uo.$$.fragment),Rr=f(),gs=a("p"),Gr=n(`The Transformer-XL Model with a language modeling head on top (adaptive softmax with weights tied to the adaptive
input embeddings)`),Yr=f(),Ko=a("p"),Qr=n("This model inherits from "),jn=a("a"),Zr=n("PreTrainedModel"),Jr=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ei=f(),Vo=a("p"),ti=n("This model is also a PyTorch "),Ro=a("a"),oi=n("torch.nn.Module"),ni=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),si=f(),dt=a("div"),y(Go.$$.fragment),ai=f(),zt=a("p"),ri=n("The "),On=a("a"),ii=n("TransfoXLLMHeadModel"),li=n(" forward method, overrides the "),_s=a("code"),di=n("__call__"),ci=n(" special method."),fi=f(),y(Qt.$$.fragment),pi=f(),y(Zt.$$.fragment),ga=f(),Pt=a("h2"),Jt=a("a"),Ts=a("span"),y(Yo.$$.fragment),hi=f(),vs=a("span"),mi=n("TransfoXLForSequenceClassification"),_a=f(),he=a("div"),y(Qo.$$.fragment),ui=f(),bs=a("p"),gi=n("The Transformer-XL Model transformer with a sequence classification head on top (linear layer)."),_i=f(),Sn=a("p"),Nn=a("a"),Ti=n("TransfoXLForSequenceClassification"),vi=n(` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1) do.`),bi=f(),Ze=a("p"),yi=n(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),ys=a("code"),wi=n("pad_token_id"),$i=n(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),ws=a("code"),ki=n("pad_token_id"),Li=n(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),$s=a("code"),xi=n("inputs_embeds"),Xi=n(" are passed instead of "),ks=a("code"),Mi=n("input_ids"),Ei=n(`, it does the same (take the last value in
each row of the batch).`),Fi=f(),Zo=a("p"),qi=n("This model inherits from "),Dn=a("a"),Ci=n("PreTrainedModel"),zi=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Pi=f(),Jo=a("p"),ji=n("This model is also a PyTorch "),en=a("a"),Oi=n("torch.nn.Module"),Si=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ni=f(),Te=a("div"),y(tn.$$.fragment),Di=f(),jt=a("p"),Ai=n("The "),An=a("a"),Hi=n("TransfoXLForSequenceClassification"),Ii=n(" forward method, overrides the "),Ls=a("code"),Wi=n("__call__"),Bi=n(" special method."),Ui=f(),y(eo.$$.fragment),Ki=f(),y(to.$$.fragment),Vi=f(),y(oo.$$.fragment),Ri=f(),y(no.$$.fragment),Gi=f(),y(so.$$.fragment),Ta=f(),Ot=a("h2"),ao=a("a"),xs=a("span"),y(on.$$.fragment),Yi=f(),Xs=a("span"),Qi=n("TFTransfoXLModel"),va=f(),ke=a("div"),y(nn.$$.fragment),Zi=f(),Ms=a("p"),Ji=n("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),el=f(),sn=a("p"),tl=n("This model inherits from "),Hn=a("a"),ol=n("TFPreTrainedModel"),nl=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),sl=f(),an=a("p"),al=n("This model is also a "),rn=a("a"),rl=n("tf.keras.Model"),il=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),ll=f(),y(ro.$$.fragment),dl=f(),ct=a("div"),y(ln.$$.fragment),cl=f(),St=a("p"),fl=n("The "),In=a("a"),pl=n("TFTransfoXLModel"),hl=n(" forward method, overrides the "),Es=a("code"),ml=n("__call__"),ul=n(" special method."),gl=f(),y(io.$$.fragment),_l=f(),y(lo.$$.fragment),ba=f(),Nt=a("h2"),co=a("a"),Fs=a("span"),y(dn.$$.fragment),Tl=f(),qs=a("span"),vl=n("TFTransfoXLLMHeadModel"),ya=f(),Le=a("div"),y(cn.$$.fragment),bl=f(),Cs=a("p"),yl=n(`The Transformer-XL Model with a language modeling head on top (adaptive softmax with weights tied to the adaptive
input embeddings)`),wl=f(),fn=a("p"),$l=n("This model inherits from "),Wn=a("a"),kl=n("TFPreTrainedModel"),Ll=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),xl=f(),pn=a("p"),Xl=n("This model is also a "),hn=a("a"),Ml=n("tf.keras.Model"),El=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Fl=f(),y(fo.$$.fragment),ql=f(),ft=a("div"),y(mn.$$.fragment),Cl=f(),Dt=a("p"),zl=n("The "),Bn=a("a"),Pl=n("TFTransfoXLLMHeadModel"),jl=n(" forward method, overrides the "),zs=a("code"),Ol=n("__call__"),Sl=n(" special method."),Nl=f(),y(po.$$.fragment),Dl=f(),y(ho.$$.fragment),wa=f(),At=a("h2"),mo=a("a"),Ps=a("span"),y(un.$$.fragment),Al=f(),js=a("span"),Hl=n("TFTransfoXLForSequenceClassification"),$a=f(),ae=a("div"),y(gn.$$.fragment),Il=f(),Os=a("p"),Wl=n("The Transfo XL Model transformer with a sequence classification head on top (linear layer)."),Bl=f(),Un=a("p"),Kn=a("a"),Ul=n("TFTransfoXLForSequenceClassification"),Kl=n(` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1,GPT-2) do.`),Vl=f(),Je=a("p"),Rl=n(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Ss=a("code"),Gl=n("pad_token_id"),Yl=n(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Ns=a("code"),Ql=n("pad_token_id"),Zl=n(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),Ds=a("code"),Jl=n("inputs_embeds"),ed=n(" are passed instead of "),As=a("code"),td=n("input_ids"),od=n(`, it does the same (take the last value in
each row of the batch).`),nd=f(),_n=a("p"),sd=n("This model inherits from "),Vn=a("a"),ad=n("TFPreTrainedModel"),rd=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),id=f(),Tn=a("p"),ld=n("This model is also a "),vn=a("a"),dd=n("tf.keras.Model"),cd=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),fd=f(),y(uo.$$.fragment),pd=f(),Re=a("div"),y(bn.$$.fragment),hd=f(),Ht=a("p"),md=n("The "),Rn=a("a"),ud=n("TFTransfoXLForSequenceClassification"),gd=n(" forward method, overrides the "),Hs=a("code"),_d=n("__call__"),Td=n(" special method."),vd=f(),y(go.$$.fragment),bd=f(),y(_o.$$.fragment),yd=f(),y(To.$$.fragment),ka=f(),It=a("h2"),vo=a("a"),Is=a("span"),y(yn.$$.fragment),wd=f(),Ws=a("span"),$d=n("Internal Layers"),La=f(),wn=a("div"),y($n.$$.fragment),xa=f(),kn=a("div"),y(Ln.$$.fragment),this.h()},l(o){const _=af('[data-svelte="svelte-1phssyn"]',document.head);d=r(_,"META",{name:!0,content:!0}),_.forEach(t),v=p(o),c=r(o,"H1",{class:!0});var xn=i(c);u=r(xn,"A",{id:!0,class:!0,href:!0});var Bs=i(u);b=r(Bs,"SPAN",{});var Us=i(b);w(l.$$.fragment,Us),Us.forEach(t),Bs.forEach(t),h=p(xn),E=r(xn,"SPAN",{});var Ks=i(E);R=s(Ks,"Transformer XL"),Ks.forEach(t),xn.forEach(t),ie=p(o),P=r(o,"H2",{class:!0});var Xn=i(P);S=r(Xn,"A",{id:!0,class:!0,href:!0});var Vs=i(S);G=r(Vs,"SPAN",{});var Rs=i(G);w(X.$$.fragment,Rs),Rs.forEach(t),Vs.forEach(t),me=p(Xn),Y=r(Xn,"SPAN",{});var Gs=i(Y);ze=s(Gs,"Overview"),Gs.forEach(t),Xn.forEach(t),xe=p(o),D=r(o,"P",{});var Mn=i(D);Pe=s(Mn,"The Transformer-XL model was proposed in "),de=r(Mn,"A",{href:!0,rel:!0});var Ys=i(de);ee=s(Ys,"Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context"),Ys.forEach(t),je=s(Mn,` by Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V. Le, Ruslan
Salakhutdinov. It\u2019s a causal (uni-directional) transformer with relative positioning (sinuso\xEFdal) embeddings which can
reuse previously computed hidden-states to attend to longer context (memory). This model also uses adaptive softmax
inputs and outputs (tied).`),Mn.forEach(t),Xe=p(o),W=r(o,"P",{});var Qs=i(W);Oe=s(Qs,"The abstract from the paper is the following:"),Qs.forEach(t),Me=p(o),B=r(o,"P",{});var Zs=i(B);ve=r(Zs,"EM",{});var Js=i(ve);Se=s(Js,`Transformers have a potential of learning longer-term dependency, but are limited by a fixed-length context in the
setting of language modeling. We propose a novel neural architecture Transformer-XL that enables learning dependency
beyond a fixed length without disrupting temporal coherence. It consists of a segment-level recurrence mechanism and a
novel positional encoding scheme. Our method not only enables capturing longer-term dependency, but also resolves the
context fragmentation problem. As a result, Transformer-XL learns dependency that is 80% longer than RNNs and 450%
longer than vanilla Transformers, achieves better performance on both short and long sequences, and is up to 1,800+
times faster than vanilla Transformers during evaluation. Notably, we improve the state-of-the-art results of
bpc/perplexity to 0.99 on enwiki8, 1.08 on text8, 18.3 on WikiText-103, 21.8 on One Billion Word, and 54.5 on Penn
Treebank (without finetuning). When trained only on WikiText-103, Transformer-XL manages to generate reasonably
coherent, novel text articles with thousands of tokens.`),Js.forEach(t),Zs.forEach(t),ce=p(o),C=r(o,"P",{});var ea=i(C);N=s(ea,"Tips:"),ea.forEach(t),Ee=p(o),A=r(o,"UL",{});var En=i(A);be=r(En,"LI",{});var ta=i(be);Ne=s(ta,`Transformer-XL uses relative sinusoidal positional embeddings. Padding can be done on the left or on the right. The
original implementation trains on SQuAD with padding on the left, therefore the padding defaults are set to left.`),ta.forEach(t),te=p(En),ye=r(En,"LI",{});var oa=i(ye);De=s(oa,"Transformer-XL is one of the few models that has no sequence length limit."),oa.forEach(t),En.forEach(t),j=p(o),Q=r(o,"P",{});var Wt=i(Q);oe=s(Wt,"This model was contributed by "),fe=r(Wt,"A",{href:!0,rel:!0});var na=i(fe);Ae=s(na,"thomwolf"),na.forEach(t),ne=s(Wt,". The original code can be found "),pe=r(Wt,"A",{href:!0,rel:!0});var sa=i(pe);He=s(sa,"here"),sa.forEach(t),U=s(Wt,"."),Wt.forEach(t),Fe=p(o),w(H.$$.fragment,o),qe=p(o),K=r(o,"H2",{class:!0});var Fn=i(K);z=r(Fn,"A",{id:!0,class:!0,href:!0});var xd=i(z);we=r(xd,"SPAN",{});var Xd=i(we);w(O.$$.fragment,Xd),Xd.forEach(t),xd.forEach(t),Ie=p(Fn),$e=r(Fn,"SPAN",{});var Md=i($e);T=s(Md,"TransfoXLConfig"),Md.forEach(t),Fn.forEach(t),M=p(o),Z=r(o,"DIV",{class:!0});var bo=i(Z);w(J.$$.fragment,bo),et=p(bo),le=r(bo,"P",{});var yo=i(le);q=s(yo,"This is the configuration class to store the configuration of a "),We=r(yo,"A",{href:!0});var Ed=i(We);tt=s(Ed,"TransfoXLModel"),Ed.forEach(t),ot=s(yo," or a "),Be=r(yo,"A",{href:!0});var Fd=i(Be);nt=s(Fd,"TFTransfoXLModel"),Fd.forEach(t),V=s(yo,`. It is
used to instantiate a Transformer-XL 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 TransfoXL
`),I=r(yo,"A",{href:!0,rel:!0});var qd=i(I);st=s(qd,"transfo-xl-wt103"),qd.forEach(t),at=s(yo," architecture."),yo.forEach(t),se=p(bo),ue=r(bo,"P",{});var Gn=i(ue);rt=s(Gn,"Configuration objects inherit from "),ge=r(Gn,"A",{href:!0});var Cd=i(ge);it=s(Cd,"PretrainedConfig"),Cd.forEach(t),_e=s(Gn,` and can be used to control the model outputs. Read the
documentation from `),Ue=r(Gn,"A",{href:!0});var zd=i(Ue);tr=s(zd,"PretrainedConfig"),zd.forEach(t),or=s(Gn," for more information."),Gn.forEach(t),nr=p(bo),w(Bt.$$.fragment,bo),bo.forEach(t),aa=p(o),kt=r(o,"H2",{class:!0});var Ma=i(kt);Ut=r(Ma,"A",{id:!0,class:!0,href:!0});var Pd=i(Ut);os=r(Pd,"SPAN",{});var jd=i(os);w(Xo.$$.fragment,jd),jd.forEach(t),Pd.forEach(t),sr=p(Ma),ns=r(Ma,"SPAN",{});var Od=i(ns);ar=s(Od,"TransfoXLTokenizer"),Od.forEach(t),Ma.forEach(t),ra=p(o),Qe=r(o,"DIV",{class:!0});var wo=i(Qe);w(Mo.$$.fragment,wo),rr=p(wo),Eo=r(wo,"P",{});var Ea=i(Eo);ir=s(Ea,"Construct a Transformer-XL tokenizer adapted from Vocab class in "),Fo=r(Ea,"A",{href:!0,rel:!0});var Sd=i(Fo);lr=s(Sd,`the original
code`),Sd.forEach(t),dr=s(Ea,`. The Transformer-XL tokenizer is a word-level tokenizer (no
sub-word tokenization).`),Ea.forEach(t),cr=p(wo),qo=r(wo,"P",{});var Fa=i(qo);fr=s(Fa,"This tokenizer inherits from "),qn=r(Fa,"A",{href:!0});var Nd=i(qn);pr=s(Nd,"PreTrainedTokenizer"),Nd.forEach(t),hr=s(Fa,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Fa.forEach(t),mr=p(wo),Cn=r(wo,"DIV",{class:!0});var Dd=i(Cn);w(Co.$$.fragment,Dd),Dd.forEach(t),wo.forEach(t),ia=p(o),Lt=r(o,"H2",{class:!0});var qa=i(Lt);Kt=r(qa,"A",{id:!0,class:!0,href:!0});var Ad=i(Kt);ss=r(Ad,"SPAN",{});var Hd=i(ss);w(zo.$$.fragment,Hd),Hd.forEach(t),Ad.forEach(t),ur=p(qa),as=r(qa,"SPAN",{});var Id=i(as);gr=s(Id,"TransfoXL specific outputs"),Id.forEach(t),qa.forEach(t),la=p(o),xt=r(o,"DIV",{class:!0});var Ca=i(xt);w(Po.$$.fragment,Ca),_r=p(Ca),rs=r(Ca,"P",{});var Wd=i(rs);Tr=s(Wd,"Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),Wd.forEach(t),Ca.forEach(t),da=p(o),Xt=r(o,"DIV",{class:!0});var za=i(Xt);w(jo.$$.fragment,za),vr=p(za),is=r(za,"P",{});var Bd=i(is);br=s(Bd,"Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),Bd.forEach(t),za.forEach(t),ca=p(o),Mt=r(o,"DIV",{class:!0});var Pa=i(Mt);w(Oo.$$.fragment,Pa),yr=p(Pa),ls=r(Pa,"P",{});var Ud=i(ls);wr=s(Ud,"Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),Ud.forEach(t),Pa.forEach(t),fa=p(o),Et=r(o,"DIV",{class:!0});var ja=i(Et);w(So.$$.fragment,ja),$r=p(ja),ds=r(ja,"P",{});var Kd=i(ds);kr=s(Kd,"Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),Kd.forEach(t),ja.forEach(t),pa=p(o),Ft=r(o,"H2",{class:!0});var Oa=i(Ft);Vt=r(Oa,"A",{id:!0,class:!0,href:!0});var Vd=i(Vt);cs=r(Vd,"SPAN",{});var Rd=i(cs);w(No.$$.fragment,Rd),Rd.forEach(t),Vd.forEach(t),Lr=p(Oa),fs=r(Oa,"SPAN",{});var Gd=i(fs);xr=s(Gd,"TransfoXLModel"),Gd.forEach(t),Oa.forEach(t),ha=p(o),Ke=r(o,"DIV",{class:!0});var Tt=i(Ke);w(Do.$$.fragment,Tt),Xr=p(Tt),ps=r(Tt,"P",{});var Yd=i(ps);Mr=s(Yd,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),Yd.forEach(t),Er=p(Tt),Ao=r(Tt,"P",{});var Sa=i(Ao);Fr=s(Sa,"This model inherits from "),zn=r(Sa,"A",{href:!0});var Qd=i(zn);qr=s(Qd,"PreTrainedModel"),Qd.forEach(t),Cr=s(Sa,`. 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.)`),Sa.forEach(t),zr=p(Tt),Ho=r(Tt,"P",{});var Na=i(Ho);Pr=s(Na,"This model is also a PyTorch "),Io=r(Na,"A",{href:!0,rel:!0});var Zd=i(Io);jr=s(Zd,"torch.nn.Module"),Zd.forEach(t),Or=s(Na,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Na.forEach(t),Sr=p(Tt),lt=r(Tt,"DIV",{class:!0});var $o=i(lt);w(Wo.$$.fragment,$o),Nr=p($o),qt=r($o,"P",{});var Yn=i(qt);Dr=s(Yn,"The "),Pn=r(Yn,"A",{href:!0});var Jd=i(Pn);Ar=s(Jd,"TransfoXLModel"),Jd.forEach(t),Hr=s(Yn," forward method, overrides the "),hs=r(Yn,"CODE",{});var ec=i(hs);Ir=s(ec,"__call__"),ec.forEach(t),Wr=s(Yn," special method."),Yn.forEach(t),Br=p($o),w(Rt.$$.fragment,$o),Ur=p($o),w(Gt.$$.fragment,$o),$o.forEach(t),Tt.forEach(t),ma=p(o),Ct=r(o,"H2",{class:!0});var Da=i(Ct);Yt=r(Da,"A",{id:!0,class:!0,href:!0});var tc=i(Yt);ms=r(tc,"SPAN",{});var oc=i(ms);w(Bo.$$.fragment,oc),oc.forEach(t),tc.forEach(t),Kr=p(Da),us=r(Da,"SPAN",{});var nc=i(us);Vr=s(nc,"TransfoXLLMHeadModel"),nc.forEach(t),Da.forEach(t),ua=p(o),Ve=r(o,"DIV",{class:!0});var vt=i(Ve);w(Uo.$$.fragment,vt),Rr=p(vt),gs=r(vt,"P",{});var sc=i(gs);Gr=s(sc,`The Transformer-XL Model with a language modeling head on top (adaptive softmax with weights tied to the adaptive
input embeddings)`),sc.forEach(t),Yr=p(vt),Ko=r(vt,"P",{});var Aa=i(Ko);Qr=s(Aa,"This model inherits from "),jn=r(Aa,"A",{href:!0});var ac=i(jn);Zr=s(ac,"PreTrainedModel"),ac.forEach(t),Jr=s(Aa,`. 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.)`),Aa.forEach(t),ei=p(vt),Vo=r(vt,"P",{});var Ha=i(Vo);ti=s(Ha,"This model is also a PyTorch "),Ro=r(Ha,"A",{href:!0,rel:!0});var rc=i(Ro);oi=s(rc,"torch.nn.Module"),rc.forEach(t),ni=s(Ha,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ha.forEach(t),si=p(vt),dt=r(vt,"DIV",{class:!0});var ko=i(dt);w(Go.$$.fragment,ko),ai=p(ko),zt=r(ko,"P",{});var Qn=i(zt);ri=s(Qn,"The "),On=r(Qn,"A",{href:!0});var ic=i(On);ii=s(ic,"TransfoXLLMHeadModel"),ic.forEach(t),li=s(Qn," forward method, overrides the "),_s=r(Qn,"CODE",{});var lc=i(_s);di=s(lc,"__call__"),lc.forEach(t),ci=s(Qn," special method."),Qn.forEach(t),fi=p(ko),w(Qt.$$.fragment,ko),pi=p(ko),w(Zt.$$.fragment,ko),ko.forEach(t),vt.forEach(t),ga=p(o),Pt=r(o,"H2",{class:!0});var Ia=i(Pt);Jt=r(Ia,"A",{id:!0,class:!0,href:!0});var dc=i(Jt);Ts=r(dc,"SPAN",{});var cc=i(Ts);w(Yo.$$.fragment,cc),cc.forEach(t),dc.forEach(t),hi=p(Ia),vs=r(Ia,"SPAN",{});var fc=i(vs);mi=s(fc,"TransfoXLForSequenceClassification"),fc.forEach(t),Ia.forEach(t),_a=p(o),he=r(o,"DIV",{class:!0});var Ge=i(he);w(Qo.$$.fragment,Ge),ui=p(Ge),bs=r(Ge,"P",{});var pc=i(bs);gi=s(pc,"The Transformer-XL Model transformer with a sequence classification head on top (linear layer)."),pc.forEach(t),_i=p(Ge),Sn=r(Ge,"P",{});var kd=i(Sn);Nn=r(kd,"A",{href:!0});var hc=i(Nn);Ti=s(hc,"TransfoXLForSequenceClassification"),hc.forEach(t),vi=s(kd,` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1) do.`),kd.forEach(t),bi=p(Ge),Ze=r(Ge,"P",{});var bt=i(Ze);yi=s(bt,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),ys=r(bt,"CODE",{});var mc=i(ys);wi=s(mc,"pad_token_id"),mc.forEach(t),$i=s(bt,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),ws=r(bt,"CODE",{});var uc=i(ws);ki=s(uc,"pad_token_id"),uc.forEach(t),Li=s(bt,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),$s=r(bt,"CODE",{});var gc=i($s);xi=s(gc,"inputs_embeds"),gc.forEach(t),Xi=s(bt," are passed instead of "),ks=r(bt,"CODE",{});var _c=i(ks);Mi=s(_c,"input_ids"),_c.forEach(t),Ei=s(bt,`, it does the same (take the last value in
each row of the batch).`),bt.forEach(t),Fi=p(Ge),Zo=r(Ge,"P",{});var Wa=i(Zo);qi=s(Wa,"This model inherits from "),Dn=r(Wa,"A",{href:!0});var Tc=i(Dn);Ci=s(Tc,"PreTrainedModel"),Tc.forEach(t),zi=s(Wa,`. 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.)`),Wa.forEach(t),Pi=p(Ge),Jo=r(Ge,"P",{});var Ba=i(Jo);ji=s(Ba,"This model is also a PyTorch "),en=r(Ba,"A",{href:!0,rel:!0});var vc=i(en);Oi=s(vc,"torch.nn.Module"),vc.forEach(t),Si=s(Ba,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ba.forEach(t),Ni=p(Ge),Te=r(Ge,"DIV",{class:!0});var Ye=i(Te);w(tn.$$.fragment,Ye),Di=p(Ye),jt=r(Ye,"P",{});var Zn=i(jt);Ai=s(Zn,"The "),An=r(Zn,"A",{href:!0});var bc=i(An);Hi=s(bc,"TransfoXLForSequenceClassification"),bc.forEach(t),Ii=s(Zn," forward method, overrides the "),Ls=r(Zn,"CODE",{});var yc=i(Ls);Wi=s(yc,"__call__"),yc.forEach(t),Bi=s(Zn," special method."),Zn.forEach(t),Ui=p(Ye),w(eo.$$.fragment,Ye),Ki=p(Ye),w(to.$$.fragment,Ye),Vi=p(Ye),w(oo.$$.fragment,Ye),Ri=p(Ye),w(no.$$.fragment,Ye),Gi=p(Ye),w(so.$$.fragment,Ye),Ye.forEach(t),Ge.forEach(t),Ta=p(o),Ot=r(o,"H2",{class:!0});var Ua=i(Ot);ao=r(Ua,"A",{id:!0,class:!0,href:!0});var wc=i(ao);xs=r(wc,"SPAN",{});var $c=i(xs);w(on.$$.fragment,$c),$c.forEach(t),wc.forEach(t),Yi=p(Ua),Xs=r(Ua,"SPAN",{});var kc=i(Xs);Qi=s(kc,"TFTransfoXLModel"),kc.forEach(t),Ua.forEach(t),va=p(o),ke=r(o,"DIV",{class:!0});var pt=i(ke);w(nn.$$.fragment,pt),Zi=p(pt),Ms=r(pt,"P",{});var Lc=i(Ms);Ji=s(Lc,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),Lc.forEach(t),el=p(pt),sn=r(pt,"P",{});var Ka=i(sn);tl=s(Ka,"This model inherits from "),Hn=r(Ka,"A",{href:!0});var xc=i(Hn);ol=s(xc,"TFPreTrainedModel"),xc.forEach(t),nl=s(Ka,`. 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.)`),Ka.forEach(t),sl=p(pt),an=r(pt,"P",{});var Va=i(an);al=s(Va,"This model is also a "),rn=r(Va,"A",{href:!0,rel:!0});var Xc=i(rn);rl=s(Xc,"tf.keras.Model"),Xc.forEach(t),il=s(Va,` 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.`),Va.forEach(t),ll=p(pt),w(ro.$$.fragment,pt),dl=p(pt),ct=r(pt,"DIV",{class:!0});var Lo=i(ct);w(ln.$$.fragment,Lo),cl=p(Lo),St=r(Lo,"P",{});var Jn=i(St);fl=s(Jn,"The "),In=r(Jn,"A",{href:!0});var Mc=i(In);pl=s(Mc,"TFTransfoXLModel"),Mc.forEach(t),hl=s(Jn," forward method, overrides the "),Es=r(Jn,"CODE",{});var Ec=i(Es);ml=s(Ec,"__call__"),Ec.forEach(t),ul=s(Jn," special method."),Jn.forEach(t),gl=p(Lo),w(io.$$.fragment,Lo),_l=p(Lo),w(lo.$$.fragment,Lo),Lo.forEach(t),pt.forEach(t),ba=p(o),Nt=r(o,"H2",{class:!0});var Ra=i(Nt);co=r(Ra,"A",{id:!0,class:!0,href:!0});var Fc=i(co);Fs=r(Fc,"SPAN",{});var qc=i(Fs);w(dn.$$.fragment,qc),qc.forEach(t),Fc.forEach(t),Tl=p(Ra),qs=r(Ra,"SPAN",{});var Cc=i(qs);vl=s(Cc,"TFTransfoXLLMHeadModel"),Cc.forEach(t),Ra.forEach(t),ya=p(o),Le=r(o,"DIV",{class:!0});var ht=i(Le);w(cn.$$.fragment,ht),bl=p(ht),Cs=r(ht,"P",{});var zc=i(Cs);yl=s(zc,`The Transformer-XL Model with a language modeling head on top (adaptive softmax with weights tied to the adaptive
input embeddings)`),zc.forEach(t),wl=p(ht),fn=r(ht,"P",{});var Ga=i(fn);$l=s(Ga,"This model inherits from "),Wn=r(Ga,"A",{href:!0});var Pc=i(Wn);kl=s(Pc,"TFPreTrainedModel"),Pc.forEach(t),Ll=s(Ga,`. 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.)`),Ga.forEach(t),xl=p(ht),pn=r(ht,"P",{});var Ya=i(pn);Xl=s(Ya,"This model is also a "),hn=r(Ya,"A",{href:!0,rel:!0});var jc=i(hn);Ml=s(jc,"tf.keras.Model"),jc.forEach(t),El=s(Ya,` 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.`),Ya.forEach(t),Fl=p(ht),w(fo.$$.fragment,ht),ql=p(ht),ft=r(ht,"DIV",{class:!0});var xo=i(ft);w(mn.$$.fragment,xo),Cl=p(xo),Dt=r(xo,"P",{});var es=i(Dt);zl=s(es,"The "),Bn=r(es,"A",{href:!0});var Oc=i(Bn);Pl=s(Oc,"TFTransfoXLLMHeadModel"),Oc.forEach(t),jl=s(es," forward method, overrides the "),zs=r(es,"CODE",{});var Sc=i(zs);Ol=s(Sc,"__call__"),Sc.forEach(t),Sl=s(es," special method."),es.forEach(t),Nl=p(xo),w(po.$$.fragment,xo),Dl=p(xo),w(ho.$$.fragment,xo),xo.forEach(t),ht.forEach(t),wa=p(o),At=r(o,"H2",{class:!0});var Qa=i(At);mo=r(Qa,"A",{id:!0,class:!0,href:!0});var Nc=i(mo);Ps=r(Nc,"SPAN",{});var Dc=i(Ps);w(un.$$.fragment,Dc),Dc.forEach(t),Nc.forEach(t),Al=p(Qa),js=r(Qa,"SPAN",{});var Ac=i(js);Hl=s(Ac,"TFTransfoXLForSequenceClassification"),Ac.forEach(t),Qa.forEach(t),$a=p(o),ae=r(o,"DIV",{class:!0});var Ce=i(ae);w(gn.$$.fragment,Ce),Il=p(Ce),Os=r(Ce,"P",{});var Hc=i(Os);Wl=s(Hc,"The Transfo XL Model transformer with a sequence classification head on top (linear layer)."),Hc.forEach(t),Bl=p(Ce),Un=r(Ce,"P",{});var Ld=i(Un);Kn=r(Ld,"A",{href:!0});var Ic=i(Kn);Ul=s(Ic,"TFTransfoXLForSequenceClassification"),Ic.forEach(t),Kl=s(Ld,` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1,GPT-2) do.`),Ld.forEach(t),Vl=p(Ce),Je=r(Ce,"P",{});var yt=i(Je);Rl=s(yt,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Ss=r(yt,"CODE",{});var Wc=i(Ss);Gl=s(Wc,"pad_token_id"),Wc.forEach(t),Yl=s(yt,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Ns=r(yt,"CODE",{});var Bc=i(Ns);Ql=s(Bc,"pad_token_id"),Bc.forEach(t),Zl=s(yt,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),Ds=r(yt,"CODE",{});var Uc=i(Ds);Jl=s(Uc,"inputs_embeds"),Uc.forEach(t),ed=s(yt," are passed instead of "),As=r(yt,"CODE",{});var Kc=i(As);td=s(Kc,"input_ids"),Kc.forEach(t),od=s(yt,`, it does the same (take the last value in
each row of the batch).`),yt.forEach(t),nd=p(Ce),_n=r(Ce,"P",{});var Za=i(_n);sd=s(Za,"This model inherits from "),Vn=r(Za,"A",{href:!0});var Vc=i(Vn);ad=s(Vc,"TFPreTrainedModel"),Vc.forEach(t),rd=s(Za,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Za.forEach(t),id=p(Ce),Tn=r(Ce,"P",{});var Ja=i(Tn);ld=s(Ja,"This model is also a "),vn=r(Ja,"A",{href:!0,rel:!0});var Rc=i(vn);dd=s(Rc,"tf.keras.Model"),Rc.forEach(t),cd=s(Ja,` 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.`),Ja.forEach(t),fd=p(Ce),w(uo.$$.fragment,Ce),pd=p(Ce),Re=r(Ce,"DIV",{class:!0});var wt=i(Re);w(bn.$$.fragment,wt),hd=p(wt),Ht=r(wt,"P",{});var ts=i(Ht);md=s(ts,"The "),Rn=r(ts,"A",{href:!0});var Gc=i(Rn);ud=s(Gc,"TFTransfoXLForSequenceClassification"),Gc.forEach(t),gd=s(ts," forward method, overrides the "),Hs=r(ts,"CODE",{});var Yc=i(Hs);_d=s(Yc,"__call__"),Yc.forEach(t),Td=s(ts," special method."),ts.forEach(t),vd=p(wt),w(go.$$.fragment,wt),bd=p(wt),w(_o.$$.fragment,wt),yd=p(wt),w(To.$$.fragment,wt),wt.forEach(t),Ce.forEach(t),ka=p(o),It=r(o,"H2",{class:!0});var er=i(It);vo=r(er,"A",{id:!0,class:!0,href:!0});var Qc=i(vo);Is=r(Qc,"SPAN",{});var Zc=i(Is);w(yn.$$.fragment,Zc),Zc.forEach(t),Qc.forEach(t),wd=p(er),Ws=r(er,"SPAN",{});var Jc=i(Ws);$d=s(Jc,"Internal Layers"),Jc.forEach(t),er.forEach(t),La=p(o),wn=r(o,"DIV",{class:!0});var ef=i(wn);w($n.$$.fragment,ef),ef.forEach(t),xa=p(o),kn=r(o,"DIV",{class:!0});var tf=i(kn);w(Ln.$$.fragment,tf),tf.forEach(t),this.h()},h(){m(d,"name","hf:doc:metadata"),m(d,"content",JSON.stringify(Ff)),m(u,"id","transformer-xl"),m(u,"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"),m(u,"href","#transformer-xl"),m(c,"class","relative group"),m(S,"id","overview"),m(S,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(S,"href","#overview"),m(P,"class","relative group"),m(de,"href","https://arxiv.org/abs/1901.02860"),m(de,"rel","nofollow"),m(fe,"href","https://huggingface.co/thomwolf"),m(fe,"rel","nofollow"),m(pe,"href","https://github.com/kimiyoung/transformer-xl"),m(pe,"rel","nofollow"),m(z,"id","transformers.TransfoXLConfig"),m(z,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(z,"href","#transformers.TransfoXLConfig"),m(K,"class","relative group"),m(We,"href","/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLModel"),m(Be,"href","/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TFTransfoXLModel"),m(I,"href","https://huggingface.co/transfo-xl-wt103"),m(I,"rel","nofollow"),m(ge,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),m(Ue,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),m(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ut,"id","transformers.TransfoXLTokenizer"),m(Ut,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Ut,"href","#transformers.TransfoXLTokenizer"),m(kt,"class","relative group"),m(Fo,"href","https://github.com/kimiyoung/transformer-xl"),m(Fo,"rel","nofollow"),m(qn,"href","/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(Cn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Kt,"id","transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput"),m(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"),m(Kt,"href","#transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput"),m(Lt,"class","relative group"),m(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Vt,"id","transformers.TransfoXLModel"),m(Vt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Vt,"href","#transformers.TransfoXLModel"),m(Ft,"class","relative group"),m(zn,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),m(Io,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Io,"rel","nofollow"),m(Pn,"href","/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLModel"),m(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Yt,"id","transformers.TransfoXLLMHeadModel"),m(Yt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Yt,"href","#transformers.TransfoXLLMHeadModel"),m(Ct,"class","relative group"),m(jn,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),m(Ro,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Ro,"rel","nofollow"),m(On,"href","/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLLMHeadModel"),m(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Jt,"id","transformers.TransfoXLForSequenceClassification"),m(Jt,"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"),m(Jt,"href","#transformers.TransfoXLForSequenceClassification"),m(Pt,"class","relative group"),m(Nn,"href","/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLForSequenceClassification"),m(Dn,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),m(en,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(en,"rel","nofollow"),m(An,"href","/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TransfoXLForSequenceClassification"),m(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ao,"id","transformers.TFTransfoXLModel"),m(ao,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(ao,"href","#transformers.TFTransfoXLModel"),m(Ot,"class","relative group"),m(Hn,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),m(rn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(rn,"rel","nofollow"),m(In,"href","/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TFTransfoXLModel"),m(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(co,"id","transformers.TFTransfoXLLMHeadModel"),m(co,"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"),m(co,"href","#transformers.TFTransfoXLLMHeadModel"),m(Nt,"class","relative group"),m(Wn,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),m(hn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(hn,"rel","nofollow"),m(Bn,"href","/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TFTransfoXLLMHeadModel"),m(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(mo,"id","transformers.TFTransfoXLForSequenceClassification"),m(mo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(mo,"href","#transformers.TFTransfoXLForSequenceClassification"),m(At,"class","relative group"),m(Kn,"href","/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TFTransfoXLForSequenceClassification"),m(Vn,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),m(vn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(vn,"rel","nofollow"),m(Rn,"href","/docs/transformers/v4.25.1/en/model_doc/transfo-xl#transformers.TFTransfoXLForSequenceClassification"),m(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(vo,"id","transformers.AdaptiveEmbedding"),m(vo,"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"),m(vo,"href","#transformers.AdaptiveEmbedding"),m(It,"class","relative group"),m(wn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(kn,"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,d),g(o,v,_),g(o,c,_),e(c,u),e(u,b),$(l,b,null),e(c,h),e(c,E),e(E,R),g(o,ie,_),g(o,P,_),e(P,S),e(S,G),$(X,G,null),e(P,me),e(P,Y),e(Y,ze),g(o,xe,_),g(o,D,_),e(D,Pe),e(D,de),e(de,ee),e(D,je),g(o,Xe,_),g(o,W,_),e(W,Oe),g(o,Me,_),g(o,B,_),e(B,ve),e(ve,Se),g(o,ce,_),g(o,C,_),e(C,N),g(o,Ee,_),g(o,A,_),e(A,be),e(be,Ne),e(A,te),e(A,ye),e(ye,De),g(o,j,_),g(o,Q,_),e(Q,oe),e(Q,fe),e(fe,Ae),e(Q,ne),e(Q,pe),e(pe,He),e(Q,U),g(o,Fe,_),$(H,o,_),g(o,qe,_),g(o,K,_),e(K,z),e(z,we),$(O,we,null),e(K,Ie),e(K,$e),e($e,T),g(o,M,_),g(o,Z,_),$(J,Z,null),e(Z,et),e(Z,le),e(le,q),e(le,We),e(We,tt),e(le,ot),e(le,Be),e(Be,nt),e(le,V),e(le,I),e(I,st),e(le,at),e(Z,se),e(Z,ue),e(ue,rt),e(ue,ge),e(ge,it),e(ue,_e),e(ue,Ue),e(Ue,tr),e(ue,or),e(Z,nr),$(Bt,Z,null),g(o,aa,_),g(o,kt,_),e(kt,Ut),e(Ut,os),$(Xo,os,null),e(kt,sr),e(kt,ns),e(ns,ar),g(o,ra,_),g(o,Qe,_),$(Mo,Qe,null),e(Qe,rr),e(Qe,Eo),e(Eo,ir),e(Eo,Fo),e(Fo,lr),e(Eo,dr),e(Qe,cr),e(Qe,qo),e(qo,fr),e(qo,qn),e(qn,pr),e(qo,hr),e(Qe,mr),e(Qe,Cn),$(Co,Cn,null),g(o,ia,_),g(o,Lt,_),e(Lt,Kt),e(Kt,ss),$(zo,ss,null),e(Lt,ur),e(Lt,as),e(as,gr),g(o,la,_),g(o,xt,_),$(Po,xt,null),e(xt,_r),e(xt,rs),e(rs,Tr),g(o,da,_),g(o,Xt,_),$(jo,Xt,null),e(Xt,vr),e(Xt,is),e(is,br),g(o,ca,_),g(o,Mt,_),$(Oo,Mt,null),e(Mt,yr),e(Mt,ls),e(ls,wr),g(o,fa,_),g(o,Et,_),$(So,Et,null),e(Et,$r),e(Et,ds),e(ds,kr),g(o,pa,_),g(o,Ft,_),e(Ft,Vt),e(Vt,cs),$(No,cs,null),e(Ft,Lr),e(Ft,fs),e(fs,xr),g(o,ha,_),g(o,Ke,_),$(Do,Ke,null),e(Ke,Xr),e(Ke,ps),e(ps,Mr),e(Ke,Er),e(Ke,Ao),e(Ao,Fr),e(Ao,zn),e(zn,qr),e(Ao,Cr),e(Ke,zr),e(Ke,Ho),e(Ho,Pr),e(Ho,Io),e(Io,jr),e(Ho,Or),e(Ke,Sr),e(Ke,lt),$(Wo,lt,null),e(lt,Nr),e(lt,qt),e(qt,Dr),e(qt,Pn),e(Pn,Ar),e(qt,Hr),e(qt,hs),e(hs,Ir),e(qt,Wr),e(lt,Br),$(Rt,lt,null),e(lt,Ur),$(Gt,lt,null),g(o,ma,_),g(o,Ct,_),e(Ct,Yt),e(Yt,ms),$(Bo,ms,null),e(Ct,Kr),e(Ct,us),e(us,Vr),g(o,ua,_),g(o,Ve,_),$(Uo,Ve,null),e(Ve,Rr),e(Ve,gs),e(gs,Gr),e(Ve,Yr),e(Ve,Ko),e(Ko,Qr),e(Ko,jn),e(jn,Zr),e(Ko,Jr),e(Ve,ei),e(Ve,Vo),e(Vo,ti),e(Vo,Ro),e(Ro,oi),e(Vo,ni),e(Ve,si),e(Ve,dt),$(Go,dt,null),e(dt,ai),e(dt,zt),e(zt,ri),e(zt,On),e(On,ii),e(zt,li),e(zt,_s),e(_s,di),e(zt,ci),e(dt,fi),$(Qt,dt,null),e(dt,pi),$(Zt,dt,null),g(o,ga,_),g(o,Pt,_),e(Pt,Jt),e(Jt,Ts),$(Yo,Ts,null),e(Pt,hi),e(Pt,vs),e(vs,mi),g(o,_a,_),g(o,he,_),$(Qo,he,null),e(he,ui),e(he,bs),e(bs,gi),e(he,_i),e(he,Sn),e(Sn,Nn),e(Nn,Ti),e(Sn,vi),e(he,bi),e(he,Ze),e(Ze,yi),e(Ze,ys),e(ys,wi),e(Ze,$i),e(Ze,ws),e(ws,ki),e(Ze,Li),e(Ze,$s),e($s,xi),e(Ze,Xi),e(Ze,ks),e(ks,Mi),e(Ze,Ei),e(he,Fi),e(he,Zo),e(Zo,qi),e(Zo,Dn),e(Dn,Ci),e(Zo,zi),e(he,Pi),e(he,Jo),e(Jo,ji),e(Jo,en),e(en,Oi),e(Jo,Si),e(he,Ni),e(he,Te),$(tn,Te,null),e(Te,Di),e(Te,jt),e(jt,Ai),e(jt,An),e(An,Hi),e(jt,Ii),e(jt,Ls),e(Ls,Wi),e(jt,Bi),e(Te,Ui),$(eo,Te,null),e(Te,Ki),$(to,Te,null),e(Te,Vi),$(oo,Te,null),e(Te,Ri),$(no,Te,null),e(Te,Gi),$(so,Te,null),g(o,Ta,_),g(o,Ot,_),e(Ot,ao),e(ao,xs),$(on,xs,null),e(Ot,Yi),e(Ot,Xs),e(Xs,Qi),g(o,va,_),g(o,ke,_),$(nn,ke,null),e(ke,Zi),e(ke,Ms),e(Ms,Ji),e(ke,el),e(ke,sn),e(sn,tl),e(sn,Hn),e(Hn,ol),e(sn,nl),e(ke,sl),e(ke,an),e(an,al),e(an,rn),e(rn,rl),e(an,il),e(ke,ll),$(ro,ke,null),e(ke,dl),e(ke,ct),$(ln,ct,null),e(ct,cl),e(ct,St),e(St,fl),e(St,In),e(In,pl),e(St,hl),e(St,Es),e(Es,ml),e(St,ul),e(ct,gl),$(io,ct,null),e(ct,_l),$(lo,ct,null),g(o,ba,_),g(o,Nt,_),e(Nt,co),e(co,Fs),$(dn,Fs,null),e(Nt,Tl),e(Nt,qs),e(qs,vl),g(o,ya,_),g(o,Le,_),$(cn,Le,null),e(Le,bl),e(Le,Cs),e(Cs,yl),e(Le,wl),e(Le,fn),e(fn,$l),e(fn,Wn),e(Wn,kl),e(fn,Ll),e(Le,xl),e(Le,pn),e(pn,Xl),e(pn,hn),e(hn,Ml),e(pn,El),e(Le,Fl),$(fo,Le,null),e(Le,ql),e(Le,ft),$(mn,ft,null),e(ft,Cl),e(ft,Dt),e(Dt,zl),e(Dt,Bn),e(Bn,Pl),e(Dt,jl),e(Dt,zs),e(zs,Ol),e(Dt,Sl),e(ft,Nl),$(po,ft,null),e(ft,Dl),$(ho,ft,null),g(o,wa,_),g(o,At,_),e(At,mo),e(mo,Ps),$(un,Ps,null),e(At,Al),e(At,js),e(js,Hl),g(o,$a,_),g(o,ae,_),$(gn,ae,null),e(ae,Il),e(ae,Os),e(Os,Wl),e(ae,Bl),e(ae,Un),e(Un,Kn),e(Kn,Ul),e(Un,Kl),e(ae,Vl),e(ae,Je),e(Je,Rl),e(Je,Ss),e(Ss,Gl),e(Je,Yl),e(Je,Ns),e(Ns,Ql),e(Je,Zl),e(Je,Ds),e(Ds,Jl),e(Je,ed),e(Je,As),e(As,td),e(Je,od),e(ae,nd),e(ae,_n),e(_n,sd),e(_n,Vn),e(Vn,ad),e(_n,rd),e(ae,id),e(ae,Tn),e(Tn,ld),e(Tn,vn),e(vn,dd),e(Tn,cd),e(ae,fd),$(uo,ae,null),e(ae,pd),e(ae,Re),$(bn,Re,null),e(Re,hd),e(Re,Ht),e(Ht,md),e(Ht,Rn),e(Rn,ud),e(Ht,gd),e(Ht,Hs),e(Hs,_d),e(Ht,Td),e(Re,vd),$(go,Re,null),e(Re,bd),$(_o,Re,null),e(Re,yd),$(To,Re,null),g(o,ka,_),g(o,It,_),e(It,vo),e(vo,Is),$(yn,Is,null),e(It,wd),e(It,Ws),e(Ws,$d),g(o,La,_),g(o,wn,_),$($n,wn,null),g(o,xa,_),g(o,kn,_),$(Ln,kn,null),Xa=!0},p(o,[_]){const xn={};_&2&&(xn.$$scope={dirty:_,ctx:o}),H.$set(xn);const Bs={};_&2&&(Bs.$$scope={dirty:_,ctx:o}),Bt.$set(Bs);const Us={};_&2&&(Us.$$scope={dirty:_,ctx:o}),Rt.$set(Us);const Ks={};_&2&&(Ks.$$scope={dirty:_,ctx:o}),Gt.$set(Ks);const Xn={};_&2&&(Xn.$$scope={dirty:_,ctx:o}),Qt.$set(Xn);const Vs={};_&2&&(Vs.$$scope={dirty:_,ctx:o}),Zt.$set(Vs);const Rs={};_&2&&(Rs.$$scope={dirty:_,ctx:o}),eo.$set(Rs);const Gs={};_&2&&(Gs.$$scope={dirty:_,ctx:o}),to.$set(Gs);const Mn={};_&2&&(Mn.$$scope={dirty:_,ctx:o}),oo.$set(Mn);const Ys={};_&2&&(Ys.$$scope={dirty:_,ctx:o}),no.$set(Ys);const Qs={};_&2&&(Qs.$$scope={dirty:_,ctx:o}),so.$set(Qs);const Zs={};_&2&&(Zs.$$scope={dirty:_,ctx:o}),ro.$set(Zs);const Js={};_&2&&(Js.$$scope={dirty:_,ctx:o}),io.$set(Js);const ea={};_&2&&(ea.$$scope={dirty:_,ctx:o}),lo.$set(ea);const En={};_&2&&(En.$$scope={dirty:_,ctx:o}),fo.$set(En);const ta={};_&2&&(ta.$$scope={dirty:_,ctx:o}),po.$set(ta);const oa={};_&2&&(oa.$$scope={dirty:_,ctx:o}),ho.$set(oa);const Wt={};_&2&&(Wt.$$scope={dirty:_,ctx:o}),uo.$set(Wt);const na={};_&2&&(na.$$scope={dirty:_,ctx:o}),go.$set(na);const sa={};_&2&&(sa.$$scope={dirty:_,ctx:o}),_o.$set(sa);const Fn={};_&2&&(Fn.$$scope={dirty:_,ctx:o}),To.$set(Fn)},i(o){Xa||(k(l.$$.fragment,o),k(X.$$.fragment,o),k(H.$$.fragment,o),k(O.$$.fragment,o),k(J.$$.fragment,o),k(Bt.$$.fragment,o),k(Xo.$$.fragment,o),k(Mo.$$.fragment,o),k(Co.$$.fragment,o),k(zo.$$.fragment,o),k(Po.$$.fragment,o),k(jo.$$.fragment,o),k(Oo.$$.fragment,o),k(So.$$.fragment,o),k(No.$$.fragment,o),k(Do.$$.fragment,o),k(Wo.$$.fragment,o),k(Rt.$$.fragment,o),k(Gt.$$.fragment,o),k(Bo.$$.fragment,o),k(Uo.$$.fragment,o),k(Go.$$.fragment,o),k(Qt.$$.fragment,o),k(Zt.$$.fragment,o),k(Yo.$$.fragment,o),k(Qo.$$.fragment,o),k(tn.$$.fragment,o),k(eo.$$.fragment,o),k(to.$$.fragment,o),k(oo.$$.fragment,o),k(no.$$.fragment,o),k(so.$$.fragment,o),k(on.$$.fragment,o),k(nn.$$.fragment,o),k(ro.$$.fragment,o),k(ln.$$.fragment,o),k(io.$$.fragment,o),k(lo.$$.fragment,o),k(dn.$$.fragment,o),k(cn.$$.fragment,o),k(fo.$$.fragment,o),k(mn.$$.fragment,o),k(po.$$.fragment,o),k(ho.$$.fragment,o),k(un.$$.fragment,o),k(gn.$$.fragment,o),k(uo.$$.fragment,o),k(bn.$$.fragment,o),k(go.$$.fragment,o),k(_o.$$.fragment,o),k(To.$$.fragment,o),k(yn.$$.fragment,o),k($n.$$.fragment,o),k(Ln.$$.fragment,o),Xa=!0)},o(o){L(l.$$.fragment,o),L(X.$$.fragment,o),L(H.$$.fragment,o),L(O.$$.fragment,o),L(J.$$.fragment,o),L(Bt.$$.fragment,o),L(Xo.$$.fragment,o),L(Mo.$$.fragment,o),L(Co.$$.fragment,o),L(zo.$$.fragment,o),L(Po.$$.fragment,o),L(jo.$$.fragment,o),L(Oo.$$.fragment,o),L(So.$$.fragment,o),L(No.$$.fragment,o),L(Do.$$.fragment,o),L(Wo.$$.fragment,o),L(Rt.$$.fragment,o),L(Gt.$$.fragment,o),L(Bo.$$.fragment,o),L(Uo.$$.fragment,o),L(Go.$$.fragment,o),L(Qt.$$.fragment,o),L(Zt.$$.fragment,o),L(Yo.$$.fragment,o),L(Qo.$$.fragment,o),L(tn.$$.fragment,o),L(eo.$$.fragment,o),L(to.$$.fragment,o),L(oo.$$.fragment,o),L(no.$$.fragment,o),L(so.$$.fragment,o),L(on.$$.fragment,o),L(nn.$$.fragment,o),L(ro.$$.fragment,o),L(ln.$$.fragment,o),L(io.$$.fragment,o),L(lo.$$.fragment,o),L(dn.$$.fragment,o),L(cn.$$.fragment,o),L(fo.$$.fragment,o),L(mn.$$.fragment,o),L(po.$$.fragment,o),L(ho.$$.fragment,o),L(un.$$.fragment,o),L(gn.$$.fragment,o),L(uo.$$.fragment,o),L(bn.$$.fragment,o),L(go.$$.fragment,o),L(_o.$$.fragment,o),L(To.$$.fragment,o),L(yn.$$.fragment,o),L($n.$$.fragment,o),L(Ln.$$.fragment,o),Xa=!1},d(o){t(d),o&&t(v),o&&t(c),x(l),o&&t(ie),o&&t(P),x(X),o&&t(xe),o&&t(D),o&&t(Xe),o&&t(W),o&&t(Me),o&&t(B),o&&t(ce),o&&t(C),o&&t(Ee),o&&t(A),o&&t(j),o&&t(Q),o&&t(Fe),x(H,o),o&&t(qe),o&&t(K),x(O),o&&t(M),o&&t(Z),x(J),x(Bt),o&&t(aa),o&&t(kt),x(Xo),o&&t(ra),o&&t(Qe),x(Mo),x(Co),o&&t(ia),o&&t(Lt),x(zo),o&&t(la),o&&t(xt),x(Po),o&&t(da),o&&t(Xt),x(jo),o&&t(ca),o&&t(Mt),x(Oo),o&&t(fa),o&&t(Et),x(So),o&&t(pa),o&&t(Ft),x(No),o&&t(ha),o&&t(Ke),x(Do),x(Wo),x(Rt),x(Gt),o&&t(ma),o&&t(Ct),x(Bo),o&&t(ua),o&&t(Ve),x(Uo),x(Go),x(Qt),x(Zt),o&&t(ga),o&&t(Pt),x(Yo),o&&t(_a),o&&t(he),x(Qo),x(tn),x(eo),x(to),x(oo),x(no),x(so),o&&t(Ta),o&&t(Ot),x(on),o&&t(va),o&&t(ke),x(nn),x(ro),x(ln),x(io),x(lo),o&&t(ba),o&&t(Nt),x(dn),o&&t(ya),o&&t(Le),x(cn),x(fo),x(mn),x(po),x(ho),o&&t(wa),o&&t(At),x(un),o&&t($a),o&&t(ae),x(gn),x(uo),x(bn),x(go),x(_o),x(To),o&&t(ka),o&&t(It),x(yn),o&&t(La),o&&t(wn),x($n),o&&t(xa),o&&t(kn),x(Ln)}}}const Ff={local:"transformer-xl",sections:[{local:"overview",title:"Overview"},{local:"transformers.TransfoXLConfig",title:"TransfoXLConfig"},{local:"transformers.TransfoXLTokenizer",title:"TransfoXLTokenizer"},{local:"transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput",title:"TransfoXL specific outputs"},{local:"transformers.TransfoXLModel",title:"TransfoXLModel"},{local:"transformers.TransfoXLLMHeadModel",title:"TransfoXLLMHeadModel"},{local:"transformers.TransfoXLForSequenceClassification",title:"TransfoXLForSequenceClassification"},{local:"transformers.TFTransfoXLModel",title:"TFTransfoXLModel"},{local:"transformers.TFTransfoXLLMHeadModel",title:"TFTransfoXLLMHeadModel"},{local:"transformers.TFTransfoXLForSequenceClassification",title:"TFTransfoXLForSequenceClassification"},{local:"transformers.AdaptiveEmbedding",title:"Internal Layers"}],title:"Transformer XL"};function qf(F){return rf(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Nf extends of{constructor(d){super();nf(this,d,qf,Ef,sf,{})}}export{Nf as default,Ff as metadata};
