import{S as Zc,i as Jc,s as ef,e as a,k as c,w,t as n,M as tf,c as r,d as t,m as f,a as i,x as $,h as s,b as p,G as e,g as u,y as k,q as L,o as x,B as X,v as of,L as It}from"../../chunks/vendor-hf-doc-builder.js";import{T as bt}from"../../chunks/Tip-hf-doc-builder.js";import{D as re}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Wt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as pt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ht}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function nf(q){let d,b,h,g,v,l,m,E,R,ie;return{c(){d=a("p"),b=n("TransformerXL does "),h=a("strong"),g=n("not"),v=n(" work with "),l=a("em"),m=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 A=i(d);b=s(A,"TransformerXL does "),h=r(A,"STRONG",{});var G=i(h);g=s(G,"not"),G.forEach(t),v=s(A," work with "),l=r(A,"EM",{});var y=i(l);m=s(y,"torch.nn.DataParallel"),y.forEach(t),E=s(A," due to a bug in PyTorch, see "),R=r(A,"A",{href:!0,rel:!0});var he=i(R);ie=s(he,"issue #36035"),he.forEach(t),A.forEach(t),this.h()},h(){p(R,"href","https://github.com/pytorch/pytorch/issues/36035"),p(R,"rel","nofollow")},m(P,A){u(P,d,A),e(d,b),e(d,h),e(h,g),e(d,v),e(d,l),e(l,m),e(d,E),e(d,R),e(R,ie)},d(P){P&&t(d)}}}function sf(q){let d,b,h,g,v;return g=new Wt({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"),b=n("Examples:"),h=c(),w(g.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);b=s(m,"Examples:"),m.forEach(t),h=f(l),$(g.$$.fragment,l)},m(l,m){u(l,d,m),e(d,b),u(l,h,m),k(g,l,m),v=!0},p:It,i(l){v||(L(g.$$.fragment,l),v=!0)},o(l){x(g.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(h),X(g,l)}}}function af(q){let d,b,h,g,v;return{c(){d=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),g=n("Module"),v=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 m=i(d);b=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(m,"CODE",{});var E=i(h);g=s(E,"Module"),E.forEach(t),v=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){u(l,d,m),e(d,b),e(d,h),e(h,g),e(d,v)},d(l){l&&t(d)}}}function rf(q){let d,b,h,g,v;return g=new Wt({props:{code:`from transformers import AutoTokenizer, TransfoXLModel
import torch

tokenizer = AutoTokenizer.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> AutoTokenizer, 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 = AutoTokenizer.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"),b=n("Example:"),h=c(),w(g.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);b=s(m,"Example:"),m.forEach(t),h=f(l),$(g.$$.fragment,l)},m(l,m){u(l,d,m),e(d,b),u(l,h,m),k(g,l,m),v=!0},p:It,i(l){v||(L(g.$$.fragment,l),v=!0)},o(l){x(g.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(h),X(g,l)}}}function lf(q){let d,b,h,g,v;return{c(){d=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),g=n("Module"),v=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 m=i(d);b=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(m,"CODE",{});var E=i(h);g=s(E,"Module"),E.forEach(t),v=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){u(l,d,m),e(d,b),e(d,h),e(h,g),e(d,v)},d(l){l&&t(d)}}}function df(q){let d,b,h,g,v;return g=new Wt({props:{code:`import torch
from transformers import AutoTokenizer, TransfoXLLMHeadModel

tokenizer = AutoTokenizer.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> AutoTokenizer, TransfoXLLMHeadModel

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

tokenizer = AutoTokenizer.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()

# 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`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TransfoXLForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.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><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`}}),{c(){d=a("p"),b=n("Example of single-label classification:"),h=c(),w(g.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);b=s(m,"Example of single-label classification:"),m.forEach(t),h=f(l),$(g.$$.fragment,l)},m(l,m){u(l,d,m),e(d,b),u(l,h,m),k(g,l,m),v=!0},p:It,i(l){v||(L(g.$$.fragment,l),v=!0)},o(l){x(g.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(h),X(g,l)}}}function mf(q){let d,b,h,g,v;return g=new Wt({props:{code:`import torch
from transformers import AutoTokenizer, TransfoXLForSequenceClassification

tokenizer = AutoTokenizer.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_ids = torch.arange(0, logits.shape[-1])[torch.sigmoid(logits).squeeze(dim=0) > 0.5]

# 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.sum(
    torch.nn.functional.one_hot(predicted_class_ids[None, :].clone(), num_classes=num_labels), dim=1
).to(torch.float)
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TransfoXLForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.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_ids = torch.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

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

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

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

tokenizer = AutoTokenizer.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])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, 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 = AutoTokenizer.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>])`}}),{c(){d=a("p"),b=n("Example:"),h=c(),w(g.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);b=s(m,"Example:"),m.forEach(t),h=f(l),$(g.$$.fragment,l)},m(l,m){u(l,d,m),e(d,b),u(l,h,m),k(g,l,m),v=!0},p:It,i(l){v||(L(g.$$.fragment,l),v=!0)},o(l){x(g.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(h),X(g,l)}}}function wf(q){let d,b;return d=new Wt({props:{code:'# To train a model on `num_labels` classes, you can pass `num_labels=num_labels` to `.from_pretrained(...)`\nnum_labels = len(model.config.id2label)\nmodel = TFTransfoXLForSequenceClassification.from_pretrained("transfo-xl-wt103", num_labels=num_labels)\n\nlabels = tf.constant(1)\nloss = model(**inputs, labels=labels).loss',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>\n<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)\n<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)\n\n<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tf.constant(<span class="hljs-number">1</span>)\n<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss'}}),{c(){w(d.$$.fragment)},l(h){$(d.$$.fragment,h)},m(h,g){k(d,h,g),b=!0},p:It,i(h){b||(L(d.$$.fragment,h),b=!0)},o(h){x(d.$$.fragment,h),b=!1},d(h){X(d,h)}}}function $f(q){let d,b,h,g,v,l,m,E,R,ie,P,A,G,y,he,Y,Ce,Le,N,ze,de,ee,Pe,xe,W,je,Xe,B,Te,Oe,ce,C,S,Me,D,ve,Ae,te,be,Se,j,Q,oe,fe,Ne,ne,me,De,U,Ee,H,Fe,K,z,ye,O,He,we,T,M,Z,J,Je,le,F,Ie,et,tt,We,ot,V,I,nt,st,se,ue,at,ge,rt,_e,Be,Za,Ja,er,Bt,ta,yt,Ut,Jn,Lo,tr,es,or,oa,Ye,xo,nr,Xo,sr,Mo,ar,rr,ir,Eo,lr,Mn,dr,cr,fr,En,Fo,na,wt,Kt,ts,qo,mr,os,pr,sa,$t,Co,hr,ns,ur,aa,kt,zo,gr,ss,_r,ra,Lt,Po,Tr,as,vr,ia,xt,jo,br,rs,yr,la,Xt,Vt,is,Oo,wr,ls,$r,da,Ue,Ao,kr,ds,Lr,xr,So,Xr,Fn,Mr,Er,Fr,No,qr,Do,Cr,zr,Pr,it,Ho,jr,Mt,Or,qn,Ar,Sr,cs,Nr,Dr,Hr,Rt,Ir,Gt,ca,Et,Yt,fs,Io,Wr,ms,Br,fa,Ke,Wo,Ur,ps,Kr,Vr,Bo,Rr,Cn,Gr,Yr,Qr,Uo,Zr,Ko,Jr,ei,ti,lt,Vo,oi,Ft,ni,zn,si,ai,hs,ri,ii,li,Qt,di,Zt,ma,qt,Jt,us,Ro,ci,gs,fi,pa,pe,Go,mi,_s,pi,hi,Pn,jn,ui,gi,_i,Qe,Ti,Ts,vi,bi,vs,yi,wi,bs,$i,ki,ys,Li,xi,Xi,Yo,Mi,On,Ei,Fi,qi,Qo,Ci,Zo,zi,Pi,ji,Ve,Jo,Oi,Ct,Ai,An,Si,Ni,ws,Di,Hi,Ii,eo,Wi,to,Bi,oo,ha,zt,no,$s,en,Ui,ks,Ki,ua,$e,tn,Vi,Ls,Ri,Gi,on,Yi,Sn,Qi,Zi,Ji,nn,el,sn,tl,ol,nl,so,sl,dt,an,al,Pt,rl,Nn,il,ll,xs,dl,cl,fl,ao,ml,ro,ga,jt,io,Xs,rn,pl,Ms,hl,_a,ke,ln,ul,Es,gl,_l,dn,Tl,Dn,vl,bl,yl,cn,wl,fn,$l,kl,Ll,lo,xl,ct,mn,Xl,Ot,Ml,Hn,El,Fl,Fs,ql,Cl,zl,co,Pl,fo,Ta,At,mo,qs,pn,jl,Cs,Ol,va,ae,hn,Al,zs,Sl,Nl,In,Wn,Dl,Hl,Il,Ze,Wl,Ps,Bl,Ul,js,Kl,Vl,Os,Rl,Gl,As,Yl,Ql,Zl,un,Jl,Bn,ed,td,od,gn,nd,_n,sd,ad,rd,po,id,Re,Tn,ld,St,dd,Un,cd,fd,Ss,md,pd,hd,ho,ud,uo,gd,go,ba,Nt,_o,Ns,vn,_d,Ds,Td,ya,bn,yn,wa,wn,$n,$a;return l=new pt({}),y=new pt({}),H=new bt({props:{warning:!0,$$slots:{default:[nf]},$$scope:{ctx:q}}}),O=new pt({}),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/main/en/model_doc/transfo-xl#transformers.TransfoXLModel">TransfoXLModel</a> or <a href="/docs/transformers/main/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/main/src/transformers/models/transfo_xl/configuration_transfo_xl.py#L29"}}),Bt=new Ht({props:{anchor:"transformers.TransfoXLConfig.example",$$slots:{default:[sf]},$$scope:{ctx:q}}}),Lo=new pt({}),xo=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/main/src/transformers/models/transfo_xl/tokenization_transfo_xl.py#L123"}}),Fo=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/main/src/transformers/models/transfo_xl/tokenization_transfo_xl.py#L310"}}),qo=new pt({}),Co=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/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L601"}}),zo=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/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L666"}}),Po=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/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L700"}}),jo=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/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L731"}}),Oo=new pt({}),Ao=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L765"}}),Ho=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L869",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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 bt({props:{$$slots:{default:[af]},$$scope:{ctx:q}}}),Gt=new Ht({props:{anchor:"transformers.TransfoXLModel.forward.example",$$slots:{default:[rf]},$$scope:{ctx:q}}}),Io=new pt({}),Wo=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L1006"}}),Vo=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L1062",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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 bt({props:{$$slots:{default:[lf]},$$scope:{ctx:q}}}),Zt=new Ht({props:{anchor:"transformers.TransfoXLLMHeadModel.forward.example",$$slots:{default:[df]},$$scope:{ctx:q}}}),Ro=new pt({}),Go=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L1194"}}),Jo=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L1205",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/main/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 bt({props:{$$slots:{default:[cf]},$$scope:{ctx:q}}}),to=new Ht({props:{anchor:"transformers.TransfoXLForSequenceClassification.forward.example",$$slots:{default:[ff]},$$scope:{ctx:q}}}),oo=new Ht({props:{anchor:"transformers.TransfoXLForSequenceClassification.forward.example-2",$$slots:{default:[mf]},$$scope:{ctx:q}}}),en=new pt({}),tn=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L882"}}),so=new bt({props:{$$slots:{default:[pf]},$$scope:{ctx:q}}}),an=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[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"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/main/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.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/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L887",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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>
`}}),ao=new bt({props:{$$slots:{default:[hf]},$$scope:{ctx:q}}}),ro=new Ht({props:{anchor:"transformers.TFTransfoXLModel.call.example",$$slots:{default:[uf]},$$scope:{ctx:q}}}),rn=new pt({}),ln=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L937"}}),lo=new bt({props:{$$slots:{default:[gf]},$$scope:{ctx:q}}}),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[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"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/main/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.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/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L966",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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>
`}}),co=new bt({props:{$$slots:{default:[_f]},$$scope:{ctx:q}}}),fo=new Ht({props:{anchor:"transformers.TFTransfoXLLMHeadModel.call.example",$$slots:{default:[Tf]},$$scope:{ctx:q}}}),pn=new pt({}),hn=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L1055"}}),po=new bt({props:{$$slots:{default:[vf]},$$scope:{ctx:q}}}),Tn=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[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"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/main/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.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/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L1070",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/main/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>
`}}),ho=new bt({props:{$$slots:{default:[bf]},$$scope:{ctx:q}}}),uo=new Ht({props:{anchor:"transformers.TFTransfoXLForSequenceClassification.call.example",$$slots:{default:[yf]},$$scope:{ctx:q}}}),go=new Ht({props:{anchor:"transformers.TFTransfoXLForSequenceClassification.call.example-2",$$slots:{default:[wf]},$$scope:{ctx:q}}}),vn=new pt({}),yn=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/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L400"}}),$n=new re({props:{name:"class transformers.TFAdaptiveEmbedding",anchor:"transformers.TFAdaptiveEmbedding",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L342"}}),{c(){d=a("meta"),b=c(),h=a("h1"),g=a("a"),v=a("span"),w(l.$$.fragment),m=c(),E=a("span"),R=n("Transformer XL"),ie=c(),P=a("h2"),A=a("a"),G=a("span"),w(y.$$.fragment),he=c(),Y=a("span"),Ce=n("Overview"),Le=c(),N=a("p"),ze=n("The Transformer-XL model was proposed in "),de=a("a"),ee=n("Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context"),Pe=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=c(),W=a("p"),je=n("The abstract from the paper is the following:"),Xe=c(),B=a("p"),Te=a("em"),Oe=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=c(),C=a("p"),S=n("Tips:"),Me=c(),D=a("ul"),ve=a("li"),Ae=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=c(),be=a("li"),Se=n("Transformer-XL is one of the few models that has no sequence length limit."),j=c(),Q=a("p"),oe=n("This model was contributed by "),fe=a("a"),Ne=n("thomwolf"),ne=n(". The original code can be found "),me=a("a"),De=n("here"),U=n("."),Ee=c(),w(H.$$.fragment),Fe=c(),K=a("h2"),z=a("a"),ye=a("span"),w(O.$$.fragment),He=c(),we=a("span"),T=n("TransfoXLConfig"),M=c(),Z=a("div"),w(J.$$.fragment),Je=c(),le=a("p"),F=n("This is the configuration class to store the configuration of a "),Ie=a("a"),et=n("TransfoXLModel"),tt=n(" or a "),We=a("a"),ot=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"),nt=n("transfo-xl-wt103"),st=n(" architecture."),se=c(),ue=a("p"),at=n("Configuration objects inherit from "),ge=a("a"),rt=n("PretrainedConfig"),_e=n(` and can be used to control the model outputs. Read the
documentation from `),Be=a("a"),Za=n("PretrainedConfig"),Ja=n(" for more information."),er=c(),w(Bt.$$.fragment),ta=c(),yt=a("h2"),Ut=a("a"),Jn=a("span"),w(Lo.$$.fragment),tr=c(),es=a("span"),or=n("TransfoXLTokenizer"),oa=c(),Ye=a("div"),w(xo.$$.fragment),nr=c(),Xo=a("p"),sr=n("Construct a Transformer-XL tokenizer adapted from Vocab class in "),Mo=a("a"),ar=n(`the original
code`),rr=n(`. The Transformer-XL tokenizer is a word-level tokenizer (no
sub-word tokenization).`),ir=c(),Eo=a("p"),lr=n("This tokenizer inherits from "),Mn=a("a"),dr=n("PreTrainedTokenizer"),cr=n(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),fr=c(),En=a("div"),w(Fo.$$.fragment),na=c(),wt=a("h2"),Kt=a("a"),ts=a("span"),w(qo.$$.fragment),mr=c(),os=a("span"),pr=n("TransfoXL specific outputs"),sa=c(),$t=a("div"),w(Co.$$.fragment),hr=c(),ns=a("p"),ur=n("Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),aa=c(),kt=a("div"),w(zo.$$.fragment),gr=c(),ss=a("p"),_r=n("Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),ra=c(),Lt=a("div"),w(Po.$$.fragment),Tr=c(),as=a("p"),vr=n("Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),ia=c(),xt=a("div"),w(jo.$$.fragment),br=c(),rs=a("p"),yr=n("Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),la=c(),Xt=a("h2"),Vt=a("a"),is=a("span"),w(Oo.$$.fragment),wr=c(),ls=a("span"),$r=n("TransfoXLModel"),da=c(),Ue=a("div"),w(Ao.$$.fragment),kr=c(),ds=a("p"),Lr=n("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),xr=c(),So=a("p"),Xr=n("This model inherits from "),Fn=a("a"),Mr=n("PreTrainedModel"),Er=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.)`),Fr=c(),No=a("p"),qr=n("This model is also a PyTorch "),Do=a("a"),Cr=n("torch.nn.Module"),zr=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Pr=c(),it=a("div"),w(Ho.$$.fragment),jr=c(),Mt=a("p"),Or=n("The "),qn=a("a"),Ar=n("TransfoXLModel"),Sr=n(" forward method, overrides the "),cs=a("code"),Nr=n("__call__"),Dr=n(" special method."),Hr=c(),w(Rt.$$.fragment),Ir=c(),w(Gt.$$.fragment),ca=c(),Et=a("h2"),Yt=a("a"),fs=a("span"),w(Io.$$.fragment),Wr=c(),ms=a("span"),Br=n("TransfoXLLMHeadModel"),fa=c(),Ke=a("div"),w(Wo.$$.fragment),Ur=c(),ps=a("p"),Kr=n(`The Transformer-XL Model with a language modeling head on top (adaptive softmax with weights tied to the adaptive
input embeddings)`),Vr=c(),Bo=a("p"),Rr=n("This model inherits from "),Cn=a("a"),Gr=n("PreTrainedModel"),Yr=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.)`),Qr=c(),Uo=a("p"),Zr=n("This model is also a PyTorch "),Ko=a("a"),Jr=n("torch.nn.Module"),ei=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ti=c(),lt=a("div"),w(Vo.$$.fragment),oi=c(),Ft=a("p"),ni=n("The "),zn=a("a"),si=n("TransfoXLLMHeadModel"),ai=n(" forward method, overrides the "),hs=a("code"),ri=n("__call__"),ii=n(" special method."),li=c(),w(Qt.$$.fragment),di=c(),w(Zt.$$.fragment),ma=c(),qt=a("h2"),Jt=a("a"),us=a("span"),w(Ro.$$.fragment),ci=c(),gs=a("span"),fi=n("TransfoXLForSequenceClassification"),pa=c(),pe=a("div"),w(Go.$$.fragment),mi=c(),_s=a("p"),pi=n("The Transformer-XL Model transformer with a sequence classification head on top (linear layer)."),hi=c(),Pn=a("p"),jn=a("a"),ui=n("TransfoXLForSequenceClassification"),gi=n(` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1) do.`),_i=c(),Qe=a("p"),Ti=n(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Ts=a("code"),vi=n("pad_token_id"),bi=n(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),vs=a("code"),yi=n("pad_token_id"),wi=n(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),bs=a("code"),$i=n("inputs_embeds"),ki=n(" are passed instead of "),ys=a("code"),Li=n("input_ids"),xi=n(`, it does the same (take the last value in
each row of the batch).`),Xi=c(),Yo=a("p"),Mi=n("This model inherits from "),On=a("a"),Ei=n("PreTrainedModel"),Fi=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.)`),qi=c(),Qo=a("p"),Ci=n("This model is also a PyTorch "),Zo=a("a"),zi=n("torch.nn.Module"),Pi=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ji=c(),Ve=a("div"),w(Jo.$$.fragment),Oi=c(),Ct=a("p"),Ai=n("The "),An=a("a"),Si=n("TransfoXLForSequenceClassification"),Ni=n(" forward method, overrides the "),ws=a("code"),Di=n("__call__"),Hi=n(" special method."),Ii=c(),w(eo.$$.fragment),Wi=c(),w(to.$$.fragment),Bi=c(),w(oo.$$.fragment),ha=c(),zt=a("h2"),no=a("a"),$s=a("span"),w(en.$$.fragment),Ui=c(),ks=a("span"),Ki=n("TFTransfoXLModel"),ua=c(),$e=a("div"),w(tn.$$.fragment),Vi=c(),Ls=a("p"),Ri=n("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),Gi=c(),on=a("p"),Yi=n("This model inherits from "),Sn=a("a"),Qi=n("TFPreTrainedModel"),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.)`),Ji=c(),nn=a("p"),el=n("This model is also a "),sn=a("a"),tl=n("tf.keras.Model"),ol=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.`),nl=c(),w(so.$$.fragment),sl=c(),dt=a("div"),w(an.$$.fragment),al=c(),Pt=a("p"),rl=n("The "),Nn=a("a"),il=n("TFTransfoXLModel"),ll=n(" forward method, overrides the "),xs=a("code"),dl=n("__call__"),cl=n(" special method."),fl=c(),w(ao.$$.fragment),ml=c(),w(ro.$$.fragment),ga=c(),jt=a("h2"),io=a("a"),Xs=a("span"),w(rn.$$.fragment),pl=c(),Ms=a("span"),hl=n("TFTransfoXLLMHeadModel"),_a=c(),ke=a("div"),w(ln.$$.fragment),ul=c(),Es=a("p"),gl=n(`The Transformer-XL Model with a language modeling head on top (adaptive softmax with weights tied to the adaptive
input embeddings)`),_l=c(),dn=a("p"),Tl=n("This model inherits from "),Dn=a("a"),vl=n("TFPreTrainedModel"),bl=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.)`),yl=c(),cn=a("p"),wl=n("This model is also a "),fn=a("a"),$l=n("tf.keras.Model"),kl=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=c(),w(lo.$$.fragment),xl=c(),ct=a("div"),w(mn.$$.fragment),Xl=c(),Ot=a("p"),Ml=n("The "),Hn=a("a"),El=n("TFTransfoXLLMHeadModel"),Fl=n(" forward method, overrides the "),Fs=a("code"),ql=n("__call__"),Cl=n(" special method."),zl=c(),w(co.$$.fragment),Pl=c(),w(fo.$$.fragment),Ta=c(),At=a("h2"),mo=a("a"),qs=a("span"),w(pn.$$.fragment),jl=c(),Cs=a("span"),Ol=n("TFTransfoXLForSequenceClassification"),va=c(),ae=a("div"),w(hn.$$.fragment),Al=c(),zs=a("p"),Sl=n("The Transfo XL Model transformer with a sequence classification head on top (linear layer)."),Nl=c(),In=a("p"),Wn=a("a"),Dl=n("TFTransfoXLForSequenceClassification"),Hl=n(` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1,GPT-2) do.`),Il=c(),Ze=a("p"),Wl=n(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Ps=a("code"),Bl=n("pad_token_id"),Ul=n(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),js=a("code"),Kl=n("pad_token_id"),Vl=n(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),Os=a("code"),Rl=n("inputs_embeds"),Gl=n(" are passed instead of "),As=a("code"),Yl=n("input_ids"),Ql=n(`, it does the same (take the last value in
each row of the batch).`),Zl=c(),un=a("p"),Jl=n("This model inherits from "),Bn=a("a"),ed=n("TFPreTrainedModel"),td=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.)`),od=c(),gn=a("p"),nd=n("This model is also a "),_n=a("a"),sd=n("tf.keras.Model"),ad=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.`),rd=c(),w(po.$$.fragment),id=c(),Re=a("div"),w(Tn.$$.fragment),ld=c(),St=a("p"),dd=n("The "),Un=a("a"),cd=n("TFTransfoXLForSequenceClassification"),fd=n(" forward method, overrides the "),Ss=a("code"),md=n("__call__"),pd=n(" special method."),hd=c(),w(ho.$$.fragment),ud=c(),w(uo.$$.fragment),gd=c(),w(go.$$.fragment),ba=c(),Nt=a("h2"),_o=a("a"),Ns=a("span"),w(vn.$$.fragment),_d=c(),Ds=a("span"),Td=n("Internal Layers"),ya=c(),bn=a("div"),w(yn.$$.fragment),wa=c(),wn=a("div"),w($n.$$.fragment),this.h()},l(o){const _=tf('[data-svelte="svelte-1phssyn"]',document.head);d=r(_,"META",{name:!0,content:!0}),_.forEach(t),b=f(o),h=r(o,"H1",{class:!0});var kn=i(h);g=r(kn,"A",{id:!0,class:!0,href:!0});var Hs=i(g);v=r(Hs,"SPAN",{});var Is=i(v);$(l.$$.fragment,Is),Is.forEach(t),Hs.forEach(t),m=f(kn),E=r(kn,"SPAN",{});var Ws=i(E);R=s(Ws,"Transformer XL"),Ws.forEach(t),kn.forEach(t),ie=f(o),P=r(o,"H2",{class:!0});var Ln=i(P);A=r(Ln,"A",{id:!0,class:!0,href:!0});var Bs=i(A);G=r(Bs,"SPAN",{});var Us=i(G);$(y.$$.fragment,Us),Us.forEach(t),Bs.forEach(t),he=f(Ln),Y=r(Ln,"SPAN",{});var Ks=i(Y);Ce=s(Ks,"Overview"),Ks.forEach(t),Ln.forEach(t),Le=f(o),N=r(o,"P",{});var xn=i(N);ze=s(xn,"The Transformer-XL model was proposed in "),de=r(xn,"A",{href:!0,rel:!0});var Vs=i(de);ee=s(Vs,"Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context"),Vs.forEach(t),Pe=s(xn,` 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).`),xn.forEach(t),xe=f(o),W=r(o,"P",{});var Rs=i(W);je=s(Rs,"The abstract from the paper is the following:"),Rs.forEach(t),Xe=f(o),B=r(o,"P",{});var Gs=i(B);Te=r(Gs,"EM",{});var Ys=i(Te);Oe=s(Ys,`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.`),Ys.forEach(t),Gs.forEach(t),ce=f(o),C=r(o,"P",{});var Qs=i(C);S=s(Qs,"Tips:"),Qs.forEach(t),Me=f(o),D=r(o,"UL",{});var Xn=i(D);ve=r(Xn,"LI",{});var Zs=i(ve);Ae=s(Zs,`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.`),Zs.forEach(t),te=f(Xn),be=r(Xn,"LI",{});var Js=i(be);Se=s(Js,"Transformer-XL is one of the few models that has no sequence length limit."),Js.forEach(t),Xn.forEach(t),j=f(o),Q=r(o,"P",{});var Dt=i(Q);oe=s(Dt,"This model was contributed by "),fe=r(Dt,"A",{href:!0,rel:!0});var ea=i(fe);Ne=s(ea,"thomwolf"),ea.forEach(t),ne=s(Dt,". The original code can be found "),me=r(Dt,"A",{href:!0,rel:!0});var yd=i(me);De=s(yd,"here"),yd.forEach(t),U=s(Dt,"."),Dt.forEach(t),Ee=f(o),$(H.$$.fragment,o),Fe=f(o),K=r(o,"H2",{class:!0});var ka=i(K);z=r(ka,"A",{id:!0,class:!0,href:!0});var wd=i(z);ye=r(wd,"SPAN",{});var $d=i(ye);$(O.$$.fragment,$d),$d.forEach(t),wd.forEach(t),He=f(ka),we=r(ka,"SPAN",{});var kd=i(we);T=s(kd,"TransfoXLConfig"),kd.forEach(t),ka.forEach(t),M=f(o),Z=r(o,"DIV",{class:!0});var To=i(Z);$(J.$$.fragment,To),Je=f(To),le=r(To,"P",{});var vo=i(le);F=s(vo,"This is the configuration class to store the configuration of a "),Ie=r(vo,"A",{href:!0});var Ld=i(Ie);et=s(Ld,"TransfoXLModel"),Ld.forEach(t),tt=s(vo," or a "),We=r(vo,"A",{href:!0});var xd=i(We);ot=s(xd,"TFTransfoXLModel"),xd.forEach(t),V=s(vo,`. 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(vo,"A",{href:!0,rel:!0});var Xd=i(I);nt=s(Xd,"transfo-xl-wt103"),Xd.forEach(t),st=s(vo," architecture."),vo.forEach(t),se=f(To),ue=r(To,"P",{});var Kn=i(ue);at=s(Kn,"Configuration objects inherit from "),ge=r(Kn,"A",{href:!0});var Md=i(ge);rt=s(Md,"PretrainedConfig"),Md.forEach(t),_e=s(Kn,` and can be used to control the model outputs. Read the
documentation from `),Be=r(Kn,"A",{href:!0});var Ed=i(Be);Za=s(Ed,"PretrainedConfig"),Ed.forEach(t),Ja=s(Kn," for more information."),Kn.forEach(t),er=f(To),$(Bt.$$.fragment,To),To.forEach(t),ta=f(o),yt=r(o,"H2",{class:!0});var La=i(yt);Ut=r(La,"A",{id:!0,class:!0,href:!0});var Fd=i(Ut);Jn=r(Fd,"SPAN",{});var qd=i(Jn);$(Lo.$$.fragment,qd),qd.forEach(t),Fd.forEach(t),tr=f(La),es=r(La,"SPAN",{});var Cd=i(es);or=s(Cd,"TransfoXLTokenizer"),Cd.forEach(t),La.forEach(t),oa=f(o),Ye=r(o,"DIV",{class:!0});var bo=i(Ye);$(xo.$$.fragment,bo),nr=f(bo),Xo=r(bo,"P",{});var xa=i(Xo);sr=s(xa,"Construct a Transformer-XL tokenizer adapted from Vocab class in "),Mo=r(xa,"A",{href:!0,rel:!0});var zd=i(Mo);ar=s(zd,`the original
code`),zd.forEach(t),rr=s(xa,`. The Transformer-XL tokenizer is a word-level tokenizer (no
sub-word tokenization).`),xa.forEach(t),ir=f(bo),Eo=r(bo,"P",{});var Xa=i(Eo);lr=s(Xa,"This tokenizer inherits from "),Mn=r(Xa,"A",{href:!0});var Pd=i(Mn);dr=s(Pd,"PreTrainedTokenizer"),Pd.forEach(t),cr=s(Xa,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Xa.forEach(t),fr=f(bo),En=r(bo,"DIV",{class:!0});var jd=i(En);$(Fo.$$.fragment,jd),jd.forEach(t),bo.forEach(t),na=f(o),wt=r(o,"H2",{class:!0});var Ma=i(wt);Kt=r(Ma,"A",{id:!0,class:!0,href:!0});var Od=i(Kt);ts=r(Od,"SPAN",{});var Ad=i(ts);$(qo.$$.fragment,Ad),Ad.forEach(t),Od.forEach(t),mr=f(Ma),os=r(Ma,"SPAN",{});var Sd=i(os);pr=s(Sd,"TransfoXL specific outputs"),Sd.forEach(t),Ma.forEach(t),sa=f(o),$t=r(o,"DIV",{class:!0});var Ea=i($t);$(Co.$$.fragment,Ea),hr=f(Ea),ns=r(Ea,"P",{});var Nd=i(ns);ur=s(Nd,"Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),Nd.forEach(t),Ea.forEach(t),aa=f(o),kt=r(o,"DIV",{class:!0});var Fa=i(kt);$(zo.$$.fragment,Fa),gr=f(Fa),ss=r(Fa,"P",{});var Dd=i(ss);_r=s(Dd,"Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),Dd.forEach(t),Fa.forEach(t),ra=f(o),Lt=r(o,"DIV",{class:!0});var qa=i(Lt);$(Po.$$.fragment,qa),Tr=f(qa),as=r(qa,"P",{});var Hd=i(as);vr=s(Hd,"Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),Hd.forEach(t),qa.forEach(t),ia=f(o),xt=r(o,"DIV",{class:!0});var Ca=i(xt);$(jo.$$.fragment,Ca),br=f(Ca),rs=r(Ca,"P",{});var Id=i(rs);yr=s(Id,"Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),Id.forEach(t),Ca.forEach(t),la=f(o),Xt=r(o,"H2",{class:!0});var za=i(Xt);Vt=r(za,"A",{id:!0,class:!0,href:!0});var Wd=i(Vt);is=r(Wd,"SPAN",{});var Bd=i(is);$(Oo.$$.fragment,Bd),Bd.forEach(t),Wd.forEach(t),wr=f(za),ls=r(za,"SPAN",{});var Ud=i(ls);$r=s(Ud,"TransfoXLModel"),Ud.forEach(t),za.forEach(t),da=f(o),Ue=r(o,"DIV",{class:!0});var ht=i(Ue);$(Ao.$$.fragment,ht),kr=f(ht),ds=r(ht,"P",{});var Kd=i(ds);Lr=s(Kd,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),Kd.forEach(t),xr=f(ht),So=r(ht,"P",{});var Pa=i(So);Xr=s(Pa,"This model inherits from "),Fn=r(Pa,"A",{href:!0});var Vd=i(Fn);Mr=s(Vd,"PreTrainedModel"),Vd.forEach(t),Er=s(Pa,`. 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.)`),Pa.forEach(t),Fr=f(ht),No=r(ht,"P",{});var ja=i(No);qr=s(ja,"This model is also a PyTorch "),Do=r(ja,"A",{href:!0,rel:!0});var Rd=i(Do);Cr=s(Rd,"torch.nn.Module"),Rd.forEach(t),zr=s(ja,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ja.forEach(t),Pr=f(ht),it=r(ht,"DIV",{class:!0});var yo=i(it);$(Ho.$$.fragment,yo),jr=f(yo),Mt=r(yo,"P",{});var Vn=i(Mt);Or=s(Vn,"The "),qn=r(Vn,"A",{href:!0});var Gd=i(qn);Ar=s(Gd,"TransfoXLModel"),Gd.forEach(t),Sr=s(Vn," forward method, overrides the "),cs=r(Vn,"CODE",{});var Yd=i(cs);Nr=s(Yd,"__call__"),Yd.forEach(t),Dr=s(Vn," special method."),Vn.forEach(t),Hr=f(yo),$(Rt.$$.fragment,yo),Ir=f(yo),$(Gt.$$.fragment,yo),yo.forEach(t),ht.forEach(t),ca=f(o),Et=r(o,"H2",{class:!0});var Oa=i(Et);Yt=r(Oa,"A",{id:!0,class:!0,href:!0});var Qd=i(Yt);fs=r(Qd,"SPAN",{});var Zd=i(fs);$(Io.$$.fragment,Zd),Zd.forEach(t),Qd.forEach(t),Wr=f(Oa),ms=r(Oa,"SPAN",{});var Jd=i(ms);Br=s(Jd,"TransfoXLLMHeadModel"),Jd.forEach(t),Oa.forEach(t),fa=f(o),Ke=r(o,"DIV",{class:!0});var ut=i(Ke);$(Wo.$$.fragment,ut),Ur=f(ut),ps=r(ut,"P",{});var ec=i(ps);Kr=s(ec,`The Transformer-XL Model with a language modeling head on top (adaptive softmax with weights tied to the adaptive
input embeddings)`),ec.forEach(t),Vr=f(ut),Bo=r(ut,"P",{});var Aa=i(Bo);Rr=s(Aa,"This model inherits from "),Cn=r(Aa,"A",{href:!0});var tc=i(Cn);Gr=s(tc,"PreTrainedModel"),tc.forEach(t),Yr=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),Qr=f(ut),Uo=r(ut,"P",{});var Sa=i(Uo);Zr=s(Sa,"This model is also a PyTorch "),Ko=r(Sa,"A",{href:!0,rel:!0});var oc=i(Ko);Jr=s(oc,"torch.nn.Module"),oc.forEach(t),ei=s(Sa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sa.forEach(t),ti=f(ut),lt=r(ut,"DIV",{class:!0});var wo=i(lt);$(Vo.$$.fragment,wo),oi=f(wo),Ft=r(wo,"P",{});var Rn=i(Ft);ni=s(Rn,"The "),zn=r(Rn,"A",{href:!0});var nc=i(zn);si=s(nc,"TransfoXLLMHeadModel"),nc.forEach(t),ai=s(Rn," forward method, overrides the "),hs=r(Rn,"CODE",{});var sc=i(hs);ri=s(sc,"__call__"),sc.forEach(t),ii=s(Rn," special method."),Rn.forEach(t),li=f(wo),$(Qt.$$.fragment,wo),di=f(wo),$(Zt.$$.fragment,wo),wo.forEach(t),ut.forEach(t),ma=f(o),qt=r(o,"H2",{class:!0});var Na=i(qt);Jt=r(Na,"A",{id:!0,class:!0,href:!0});var ac=i(Jt);us=r(ac,"SPAN",{});var rc=i(us);$(Ro.$$.fragment,rc),rc.forEach(t),ac.forEach(t),ci=f(Na),gs=r(Na,"SPAN",{});var ic=i(gs);fi=s(ic,"TransfoXLForSequenceClassification"),ic.forEach(t),Na.forEach(t),pa=f(o),pe=r(o,"DIV",{class:!0});var Ge=i(pe);$(Go.$$.fragment,Ge),mi=f(Ge),_s=r(Ge,"P",{});var lc=i(_s);pi=s(lc,"The Transformer-XL Model transformer with a sequence classification head on top (linear layer)."),lc.forEach(t),hi=f(Ge),Pn=r(Ge,"P",{});var vd=i(Pn);jn=r(vd,"A",{href:!0});var dc=i(jn);ui=s(dc,"TransfoXLForSequenceClassification"),dc.forEach(t),gi=s(vd,` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1) do.`),vd.forEach(t),_i=f(Ge),Qe=r(Ge,"P",{});var gt=i(Qe);Ti=s(gt,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Ts=r(gt,"CODE",{});var cc=i(Ts);vi=s(cc,"pad_token_id"),cc.forEach(t),bi=s(gt,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),vs=r(gt,"CODE",{});var fc=i(vs);yi=s(fc,"pad_token_id"),fc.forEach(t),wi=s(gt,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),bs=r(gt,"CODE",{});var mc=i(bs);$i=s(mc,"inputs_embeds"),mc.forEach(t),ki=s(gt," are passed instead of "),ys=r(gt,"CODE",{});var pc=i(ys);Li=s(pc,"input_ids"),pc.forEach(t),xi=s(gt,`, it does the same (take the last value in
each row of the batch).`),gt.forEach(t),Xi=f(Ge),Yo=r(Ge,"P",{});var Da=i(Yo);Mi=s(Da,"This model inherits from "),On=r(Da,"A",{href:!0});var hc=i(On);Ei=s(hc,"PreTrainedModel"),hc.forEach(t),Fi=s(Da,`. 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.)`),Da.forEach(t),qi=f(Ge),Qo=r(Ge,"P",{});var Ha=i(Qo);Ci=s(Ha,"This model is also a PyTorch "),Zo=r(Ha,"A",{href:!0,rel:!0});var uc=i(Zo);zi=s(uc,"torch.nn.Module"),uc.forEach(t),Pi=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),ji=f(Ge),Ve=r(Ge,"DIV",{class:!0});var _t=i(Ve);$(Jo.$$.fragment,_t),Oi=f(_t),Ct=r(_t,"P",{});var Gn=i(Ct);Ai=s(Gn,"The "),An=r(Gn,"A",{href:!0});var gc=i(An);Si=s(gc,"TransfoXLForSequenceClassification"),gc.forEach(t),Ni=s(Gn," forward method, overrides the "),ws=r(Gn,"CODE",{});var _c=i(ws);Di=s(_c,"__call__"),_c.forEach(t),Hi=s(Gn," special method."),Gn.forEach(t),Ii=f(_t),$(eo.$$.fragment,_t),Wi=f(_t),$(to.$$.fragment,_t),Bi=f(_t),$(oo.$$.fragment,_t),_t.forEach(t),Ge.forEach(t),ha=f(o),zt=r(o,"H2",{class:!0});var Ia=i(zt);no=r(Ia,"A",{id:!0,class:!0,href:!0});var Tc=i(no);$s=r(Tc,"SPAN",{});var vc=i($s);$(en.$$.fragment,vc),vc.forEach(t),Tc.forEach(t),Ui=f(Ia),ks=r(Ia,"SPAN",{});var bc=i(ks);Ki=s(bc,"TFTransfoXLModel"),bc.forEach(t),Ia.forEach(t),ua=f(o),$e=r(o,"DIV",{class:!0});var ft=i($e);$(tn.$$.fragment,ft),Vi=f(ft),Ls=r(ft,"P",{});var yc=i(Ls);Ri=s(yc,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),yc.forEach(t),Gi=f(ft),on=r(ft,"P",{});var Wa=i(on);Yi=s(Wa,"This model inherits from "),Sn=r(Wa,"A",{href:!0});var wc=i(Sn);Qi=s(wc,"TFPreTrainedModel"),wc.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),Ji=f(ft),nn=r(ft,"P",{});var Ba=i(nn);el=s(Ba,"This model is also a "),sn=r(Ba,"A",{href:!0,rel:!0});var $c=i(sn);tl=s($c,"tf.keras.Model"),$c.forEach(t),ol=s(Ba,` 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.`),Ba.forEach(t),nl=f(ft),$(so.$$.fragment,ft),sl=f(ft),dt=r(ft,"DIV",{class:!0});var $o=i(dt);$(an.$$.fragment,$o),al=f($o),Pt=r($o,"P",{});var Yn=i(Pt);rl=s(Yn,"The "),Nn=r(Yn,"A",{href:!0});var kc=i(Nn);il=s(kc,"TFTransfoXLModel"),kc.forEach(t),ll=s(Yn," forward method, overrides the "),xs=r(Yn,"CODE",{});var Lc=i(xs);dl=s(Lc,"__call__"),Lc.forEach(t),cl=s(Yn," special method."),Yn.forEach(t),fl=f($o),$(ao.$$.fragment,$o),ml=f($o),$(ro.$$.fragment,$o),$o.forEach(t),ft.forEach(t),ga=f(o),jt=r(o,"H2",{class:!0});var Ua=i(jt);io=r(Ua,"A",{id:!0,class:!0,href:!0});var xc=i(io);Xs=r(xc,"SPAN",{});var Xc=i(Xs);$(rn.$$.fragment,Xc),Xc.forEach(t),xc.forEach(t),pl=f(Ua),Ms=r(Ua,"SPAN",{});var Mc=i(Ms);hl=s(Mc,"TFTransfoXLLMHeadModel"),Mc.forEach(t),Ua.forEach(t),_a=f(o),ke=r(o,"DIV",{class:!0});var mt=i(ke);$(ln.$$.fragment,mt),ul=f(mt),Es=r(mt,"P",{});var Ec=i(Es);gl=s(Ec,`The Transformer-XL Model with a language modeling head on top (adaptive softmax with weights tied to the adaptive
input embeddings)`),Ec.forEach(t),_l=f(mt),dn=r(mt,"P",{});var Ka=i(dn);Tl=s(Ka,"This model inherits from "),Dn=r(Ka,"A",{href:!0});var Fc=i(Dn);vl=s(Fc,"TFPreTrainedModel"),Fc.forEach(t),bl=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),yl=f(mt),cn=r(mt,"P",{});var Va=i(cn);wl=s(Va,"This model is also a "),fn=r(Va,"A",{href:!0,rel:!0});var qc=i(fn);$l=s(qc,"tf.keras.Model"),qc.forEach(t),kl=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=f(mt),$(lo.$$.fragment,mt),xl=f(mt),ct=r(mt,"DIV",{class:!0});var ko=i(ct);$(mn.$$.fragment,ko),Xl=f(ko),Ot=r(ko,"P",{});var Qn=i(Ot);Ml=s(Qn,"The "),Hn=r(Qn,"A",{href:!0});var Cc=i(Hn);El=s(Cc,"TFTransfoXLLMHeadModel"),Cc.forEach(t),Fl=s(Qn," forward method, overrides the "),Fs=r(Qn,"CODE",{});var zc=i(Fs);ql=s(zc,"__call__"),zc.forEach(t),Cl=s(Qn," special method."),Qn.forEach(t),zl=f(ko),$(co.$$.fragment,ko),Pl=f(ko),$(fo.$$.fragment,ko),ko.forEach(t),mt.forEach(t),Ta=f(o),At=r(o,"H2",{class:!0});var Ra=i(At);mo=r(Ra,"A",{id:!0,class:!0,href:!0});var Pc=i(mo);qs=r(Pc,"SPAN",{});var jc=i(qs);$(pn.$$.fragment,jc),jc.forEach(t),Pc.forEach(t),jl=f(Ra),Cs=r(Ra,"SPAN",{});var Oc=i(Cs);Ol=s(Oc,"TFTransfoXLForSequenceClassification"),Oc.forEach(t),Ra.forEach(t),va=f(o),ae=r(o,"DIV",{class:!0});var qe=i(ae);$(hn.$$.fragment,qe),Al=f(qe),zs=r(qe,"P",{});var Ac=i(zs);Sl=s(Ac,"The Transfo XL Model transformer with a sequence classification head on top (linear layer)."),Ac.forEach(t),Nl=f(qe),In=r(qe,"P",{});var bd=i(In);Wn=r(bd,"A",{href:!0});var Sc=i(Wn);Dl=s(Sc,"TFTransfoXLForSequenceClassification"),Sc.forEach(t),Hl=s(bd,` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1,GPT-2) do.`),bd.forEach(t),Il=f(qe),Ze=r(qe,"P",{});var Tt=i(Ze);Wl=s(Tt,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Ps=r(Tt,"CODE",{});var Nc=i(Ps);Bl=s(Nc,"pad_token_id"),Nc.forEach(t),Ul=s(Tt,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),js=r(Tt,"CODE",{});var Dc=i(js);Kl=s(Dc,"pad_token_id"),Dc.forEach(t),Vl=s(Tt,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),Os=r(Tt,"CODE",{});var Hc=i(Os);Rl=s(Hc,"inputs_embeds"),Hc.forEach(t),Gl=s(Tt," are passed instead of "),As=r(Tt,"CODE",{});var Ic=i(As);Yl=s(Ic,"input_ids"),Ic.forEach(t),Ql=s(Tt,`, it does the same (take the last value in
each row of the batch).`),Tt.forEach(t),Zl=f(qe),un=r(qe,"P",{});var Ga=i(un);Jl=s(Ga,"This model inherits from "),Bn=r(Ga,"A",{href:!0});var Wc=i(Bn);ed=s(Wc,"TFPreTrainedModel"),Wc.forEach(t),td=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),od=f(qe),gn=r(qe,"P",{});var Ya=i(gn);nd=s(Ya,"This model is also a "),_n=r(Ya,"A",{href:!0,rel:!0});var Bc=i(_n);sd=s(Bc,"tf.keras.Model"),Bc.forEach(t),ad=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),rd=f(qe),$(po.$$.fragment,qe),id=f(qe),Re=r(qe,"DIV",{class:!0});var vt=i(Re);$(Tn.$$.fragment,vt),ld=f(vt),St=r(vt,"P",{});var Zn=i(St);dd=s(Zn,"The "),Un=r(Zn,"A",{href:!0});var Uc=i(Un);cd=s(Uc,"TFTransfoXLForSequenceClassification"),Uc.forEach(t),fd=s(Zn," forward method, overrides the "),Ss=r(Zn,"CODE",{});var Kc=i(Ss);md=s(Kc,"__call__"),Kc.forEach(t),pd=s(Zn," special method."),Zn.forEach(t),hd=f(vt),$(ho.$$.fragment,vt),ud=f(vt),$(uo.$$.fragment,vt),gd=f(vt),$(go.$$.fragment,vt),vt.forEach(t),qe.forEach(t),ba=f(o),Nt=r(o,"H2",{class:!0});var Qa=i(Nt);_o=r(Qa,"A",{id:!0,class:!0,href:!0});var Vc=i(_o);Ns=r(Vc,"SPAN",{});var Rc=i(Ns);$(vn.$$.fragment,Rc),Rc.forEach(t),Vc.forEach(t),_d=f(Qa),Ds=r(Qa,"SPAN",{});var Gc=i(Ds);Td=s(Gc,"Internal Layers"),Gc.forEach(t),Qa.forEach(t),ya=f(o),bn=r(o,"DIV",{class:!0});var Yc=i(bn);$(yn.$$.fragment,Yc),Yc.forEach(t),wa=f(o),wn=r(o,"DIV",{class:!0});var Qc=i(wn);$($n.$$.fragment,Qc),Qc.forEach(t),this.h()},h(){p(d,"name","hf:doc:metadata"),p(d,"content",JSON.stringify(kf)),p(g,"id","transformer-xl"),p(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(g,"href","#transformer-xl"),p(h,"class","relative group"),p(A,"id","overview"),p(A,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(A,"href","#overview"),p(P,"class","relative group"),p(de,"href","https://arxiv.org/abs/1901.02860"),p(de,"rel","nofollow"),p(fe,"href","https://huggingface.co/thomwolf"),p(fe,"rel","nofollow"),p(me,"href","https://github.com/kimiyoung/transformer-xl"),p(me,"rel","nofollow"),p(z,"id","transformers.TransfoXLConfig"),p(z,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(z,"href","#transformers.TransfoXLConfig"),p(K,"class","relative group"),p(Ie,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLModel"),p(We,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TFTransfoXLModel"),p(I,"href","https://huggingface.co/transfo-xl-wt103"),p(I,"rel","nofollow"),p(ge,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),p(Be,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),p(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ut,"id","transformers.TransfoXLTokenizer"),p(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"),p(Ut,"href","#transformers.TransfoXLTokenizer"),p(yt,"class","relative group"),p(Mo,"href","https://github.com/kimiyoung/transformer-xl"),p(Mo,"rel","nofollow"),p(Mn,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),p(En,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Kt,"id","transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput"),p(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"),p(Kt,"href","#transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput"),p(wt,"class","relative group"),p($t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Vt,"id","transformers.TransfoXLModel"),p(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"),p(Vt,"href","#transformers.TransfoXLModel"),p(Xt,"class","relative group"),p(Fn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Do,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Do,"rel","nofollow"),p(qn,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLModel"),p(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Yt,"id","transformers.TransfoXLLMHeadModel"),p(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"),p(Yt,"href","#transformers.TransfoXLLMHeadModel"),p(Et,"class","relative group"),p(Cn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Ko,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Ko,"rel","nofollow"),p(zn,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLLMHeadModel"),p(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Jt,"id","transformers.TransfoXLForSequenceClassification"),p(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"),p(Jt,"href","#transformers.TransfoXLForSequenceClassification"),p(qt,"class","relative group"),p(jn,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLForSequenceClassification"),p(On,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Zo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Zo,"rel","nofollow"),p(An,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLForSequenceClassification"),p(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(no,"id","transformers.TFTransfoXLModel"),p(no,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(no,"href","#transformers.TFTransfoXLModel"),p(zt,"class","relative group"),p(Sn,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),p(sn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(sn,"rel","nofollow"),p(Nn,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TFTransfoXLModel"),p(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(io,"id","transformers.TFTransfoXLLMHeadModel"),p(io,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(io,"href","#transformers.TFTransfoXLLMHeadModel"),p(jt,"class","relative group"),p(Dn,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),p(fn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(fn,"rel","nofollow"),p(Hn,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TFTransfoXLLMHeadModel"),p(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(mo,"id","transformers.TFTransfoXLForSequenceClassification"),p(mo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(mo,"href","#transformers.TFTransfoXLForSequenceClassification"),p(At,"class","relative group"),p(Wn,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TFTransfoXLForSequenceClassification"),p(Bn,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),p(_n,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(_n,"rel","nofollow"),p(Un,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TFTransfoXLForSequenceClassification"),p(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(_o,"id","transformers.AdaptiveEmbedding"),p(_o,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(_o,"href","#transformers.AdaptiveEmbedding"),p(Nt,"class","relative group"),p(bn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(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(o,_){e(document.head,d),u(o,b,_),u(o,h,_),e(h,g),e(g,v),k(l,v,null),e(h,m),e(h,E),e(E,R),u(o,ie,_),u(o,P,_),e(P,A),e(A,G),k(y,G,null),e(P,he),e(P,Y),e(Y,Ce),u(o,Le,_),u(o,N,_),e(N,ze),e(N,de),e(de,ee),e(N,Pe),u(o,xe,_),u(o,W,_),e(W,je),u(o,Xe,_),u(o,B,_),e(B,Te),e(Te,Oe),u(o,ce,_),u(o,C,_),e(C,S),u(o,Me,_),u(o,D,_),e(D,ve),e(ve,Ae),e(D,te),e(D,be),e(be,Se),u(o,j,_),u(o,Q,_),e(Q,oe),e(Q,fe),e(fe,Ne),e(Q,ne),e(Q,me),e(me,De),e(Q,U),u(o,Ee,_),k(H,o,_),u(o,Fe,_),u(o,K,_),e(K,z),e(z,ye),k(O,ye,null),e(K,He),e(K,we),e(we,T),u(o,M,_),u(o,Z,_),k(J,Z,null),e(Z,Je),e(Z,le),e(le,F),e(le,Ie),e(Ie,et),e(le,tt),e(le,We),e(We,ot),e(le,V),e(le,I),e(I,nt),e(le,st),e(Z,se),e(Z,ue),e(ue,at),e(ue,ge),e(ge,rt),e(ue,_e),e(ue,Be),e(Be,Za),e(ue,Ja),e(Z,er),k(Bt,Z,null),u(o,ta,_),u(o,yt,_),e(yt,Ut),e(Ut,Jn),k(Lo,Jn,null),e(yt,tr),e(yt,es),e(es,or),u(o,oa,_),u(o,Ye,_),k(xo,Ye,null),e(Ye,nr),e(Ye,Xo),e(Xo,sr),e(Xo,Mo),e(Mo,ar),e(Xo,rr),e(Ye,ir),e(Ye,Eo),e(Eo,lr),e(Eo,Mn),e(Mn,dr),e(Eo,cr),e(Ye,fr),e(Ye,En),k(Fo,En,null),u(o,na,_),u(o,wt,_),e(wt,Kt),e(Kt,ts),k(qo,ts,null),e(wt,mr),e(wt,os),e(os,pr),u(o,sa,_),u(o,$t,_),k(Co,$t,null),e($t,hr),e($t,ns),e(ns,ur),u(o,aa,_),u(o,kt,_),k(zo,kt,null),e(kt,gr),e(kt,ss),e(ss,_r),u(o,ra,_),u(o,Lt,_),k(Po,Lt,null),e(Lt,Tr),e(Lt,as),e(as,vr),u(o,ia,_),u(o,xt,_),k(jo,xt,null),e(xt,br),e(xt,rs),e(rs,yr),u(o,la,_),u(o,Xt,_),e(Xt,Vt),e(Vt,is),k(Oo,is,null),e(Xt,wr),e(Xt,ls),e(ls,$r),u(o,da,_),u(o,Ue,_),k(Ao,Ue,null),e(Ue,kr),e(Ue,ds),e(ds,Lr),e(Ue,xr),e(Ue,So),e(So,Xr),e(So,Fn),e(Fn,Mr),e(So,Er),e(Ue,Fr),e(Ue,No),e(No,qr),e(No,Do),e(Do,Cr),e(No,zr),e(Ue,Pr),e(Ue,it),k(Ho,it,null),e(it,jr),e(it,Mt),e(Mt,Or),e(Mt,qn),e(qn,Ar),e(Mt,Sr),e(Mt,cs),e(cs,Nr),e(Mt,Dr),e(it,Hr),k(Rt,it,null),e(it,Ir),k(Gt,it,null),u(o,ca,_),u(o,Et,_),e(Et,Yt),e(Yt,fs),k(Io,fs,null),e(Et,Wr),e(Et,ms),e(ms,Br),u(o,fa,_),u(o,Ke,_),k(Wo,Ke,null),e(Ke,Ur),e(Ke,ps),e(ps,Kr),e(Ke,Vr),e(Ke,Bo),e(Bo,Rr),e(Bo,Cn),e(Cn,Gr),e(Bo,Yr),e(Ke,Qr),e(Ke,Uo),e(Uo,Zr),e(Uo,Ko),e(Ko,Jr),e(Uo,ei),e(Ke,ti),e(Ke,lt),k(Vo,lt,null),e(lt,oi),e(lt,Ft),e(Ft,ni),e(Ft,zn),e(zn,si),e(Ft,ai),e(Ft,hs),e(hs,ri),e(Ft,ii),e(lt,li),k(Qt,lt,null),e(lt,di),k(Zt,lt,null),u(o,ma,_),u(o,qt,_),e(qt,Jt),e(Jt,us),k(Ro,us,null),e(qt,ci),e(qt,gs),e(gs,fi),u(o,pa,_),u(o,pe,_),k(Go,pe,null),e(pe,mi),e(pe,_s),e(_s,pi),e(pe,hi),e(pe,Pn),e(Pn,jn),e(jn,ui),e(Pn,gi),e(pe,_i),e(pe,Qe),e(Qe,Ti),e(Qe,Ts),e(Ts,vi),e(Qe,bi),e(Qe,vs),e(vs,yi),e(Qe,wi),e(Qe,bs),e(bs,$i),e(Qe,ki),e(Qe,ys),e(ys,Li),e(Qe,xi),e(pe,Xi),e(pe,Yo),e(Yo,Mi),e(Yo,On),e(On,Ei),e(Yo,Fi),e(pe,qi),e(pe,Qo),e(Qo,Ci),e(Qo,Zo),e(Zo,zi),e(Qo,Pi),e(pe,ji),e(pe,Ve),k(Jo,Ve,null),e(Ve,Oi),e(Ve,Ct),e(Ct,Ai),e(Ct,An),e(An,Si),e(Ct,Ni),e(Ct,ws),e(ws,Di),e(Ct,Hi),e(Ve,Ii),k(eo,Ve,null),e(Ve,Wi),k(to,Ve,null),e(Ve,Bi),k(oo,Ve,null),u(o,ha,_),u(o,zt,_),e(zt,no),e(no,$s),k(en,$s,null),e(zt,Ui),e(zt,ks),e(ks,Ki),u(o,ua,_),u(o,$e,_),k(tn,$e,null),e($e,Vi),e($e,Ls),e(Ls,Ri),e($e,Gi),e($e,on),e(on,Yi),e(on,Sn),e(Sn,Qi),e(on,Zi),e($e,Ji),e($e,nn),e(nn,el),e(nn,sn),e(sn,tl),e(nn,ol),e($e,nl),k(so,$e,null),e($e,sl),e($e,dt),k(an,dt,null),e(dt,al),e(dt,Pt),e(Pt,rl),e(Pt,Nn),e(Nn,il),e(Pt,ll),e(Pt,xs),e(xs,dl),e(Pt,cl),e(dt,fl),k(ao,dt,null),e(dt,ml),k(ro,dt,null),u(o,ga,_),u(o,jt,_),e(jt,io),e(io,Xs),k(rn,Xs,null),e(jt,pl),e(jt,Ms),e(Ms,hl),u(o,_a,_),u(o,ke,_),k(ln,ke,null),e(ke,ul),e(ke,Es),e(Es,gl),e(ke,_l),e(ke,dn),e(dn,Tl),e(dn,Dn),e(Dn,vl),e(dn,bl),e(ke,yl),e(ke,cn),e(cn,wl),e(cn,fn),e(fn,$l),e(cn,kl),e(ke,Ll),k(lo,ke,null),e(ke,xl),e(ke,ct),k(mn,ct,null),e(ct,Xl),e(ct,Ot),e(Ot,Ml),e(Ot,Hn),e(Hn,El),e(Ot,Fl),e(Ot,Fs),e(Fs,ql),e(Ot,Cl),e(ct,zl),k(co,ct,null),e(ct,Pl),k(fo,ct,null),u(o,Ta,_),u(o,At,_),e(At,mo),e(mo,qs),k(pn,qs,null),e(At,jl),e(At,Cs),e(Cs,Ol),u(o,va,_),u(o,ae,_),k(hn,ae,null),e(ae,Al),e(ae,zs),e(zs,Sl),e(ae,Nl),e(ae,In),e(In,Wn),e(Wn,Dl),e(In,Hl),e(ae,Il),e(ae,Ze),e(Ze,Wl),e(Ze,Ps),e(Ps,Bl),e(Ze,Ul),e(Ze,js),e(js,Kl),e(Ze,Vl),e(Ze,Os),e(Os,Rl),e(Ze,Gl),e(Ze,As),e(As,Yl),e(Ze,Ql),e(ae,Zl),e(ae,un),e(un,Jl),e(un,Bn),e(Bn,ed),e(un,td),e(ae,od),e(ae,gn),e(gn,nd),e(gn,_n),e(_n,sd),e(gn,ad),e(ae,rd),k(po,ae,null),e(ae,id),e(ae,Re),k(Tn,Re,null),e(Re,ld),e(Re,St),e(St,dd),e(St,Un),e(Un,cd),e(St,fd),e(St,Ss),e(Ss,md),e(St,pd),e(Re,hd),k(ho,Re,null),e(Re,ud),k(uo,Re,null),e(Re,gd),k(go,Re,null),u(o,ba,_),u(o,Nt,_),e(Nt,_o),e(_o,Ns),k(vn,Ns,null),e(Nt,_d),e(Nt,Ds),e(Ds,Td),u(o,ya,_),u(o,bn,_),k(yn,bn,null),u(o,wa,_),u(o,wn,_),k($n,wn,null),$a=!0},p(o,[_]){const kn={};_&2&&(kn.$$scope={dirty:_,ctx:o}),H.$set(kn);const Hs={};_&2&&(Hs.$$scope={dirty:_,ctx:o}),Bt.$set(Hs);const Is={};_&2&&(Is.$$scope={dirty:_,ctx:o}),Rt.$set(Is);const Ws={};_&2&&(Ws.$$scope={dirty:_,ctx:o}),Gt.$set(Ws);const Ln={};_&2&&(Ln.$$scope={dirty:_,ctx:o}),Qt.$set(Ln);const Bs={};_&2&&(Bs.$$scope={dirty:_,ctx:o}),Zt.$set(Bs);const Us={};_&2&&(Us.$$scope={dirty:_,ctx:o}),eo.$set(Us);const Ks={};_&2&&(Ks.$$scope={dirty:_,ctx:o}),to.$set(Ks);const xn={};_&2&&(xn.$$scope={dirty:_,ctx:o}),oo.$set(xn);const Vs={};_&2&&(Vs.$$scope={dirty:_,ctx:o}),so.$set(Vs);const Rs={};_&2&&(Rs.$$scope={dirty:_,ctx:o}),ao.$set(Rs);const Gs={};_&2&&(Gs.$$scope={dirty:_,ctx:o}),ro.$set(Gs);const Ys={};_&2&&(Ys.$$scope={dirty:_,ctx:o}),lo.$set(Ys);const Qs={};_&2&&(Qs.$$scope={dirty:_,ctx:o}),co.$set(Qs);const Xn={};_&2&&(Xn.$$scope={dirty:_,ctx:o}),fo.$set(Xn);const Zs={};_&2&&(Zs.$$scope={dirty:_,ctx:o}),po.$set(Zs);const Js={};_&2&&(Js.$$scope={dirty:_,ctx:o}),ho.$set(Js);const Dt={};_&2&&(Dt.$$scope={dirty:_,ctx:o}),uo.$set(Dt);const ea={};_&2&&(ea.$$scope={dirty:_,ctx:o}),go.$set(ea)},i(o){$a||(L(l.$$.fragment,o),L(y.$$.fragment,o),L(H.$$.fragment,o),L(O.$$.fragment,o),L(J.$$.fragment,o),L(Bt.$$.fragment,o),L(Lo.$$.fragment,o),L(xo.$$.fragment,o),L(Fo.$$.fragment,o),L(qo.$$.fragment,o),L(Co.$$.fragment,o),L(zo.$$.fragment,o),L(Po.$$.fragment,o),L(jo.$$.fragment,o),L(Oo.$$.fragment,o),L(Ao.$$.fragment,o),L(Ho.$$.fragment,o),L(Rt.$$.fragment,o),L(Gt.$$.fragment,o),L(Io.$$.fragment,o),L(Wo.$$.fragment,o),L(Vo.$$.fragment,o),L(Qt.$$.fragment,o),L(Zt.$$.fragment,o),L(Ro.$$.fragment,o),L(Go.$$.fragment,o),L(Jo.$$.fragment,o),L(eo.$$.fragment,o),L(to.$$.fragment,o),L(oo.$$.fragment,o),L(en.$$.fragment,o),L(tn.$$.fragment,o),L(so.$$.fragment,o),L(an.$$.fragment,o),L(ao.$$.fragment,o),L(ro.$$.fragment,o),L(rn.$$.fragment,o),L(ln.$$.fragment,o),L(lo.$$.fragment,o),L(mn.$$.fragment,o),L(co.$$.fragment,o),L(fo.$$.fragment,o),L(pn.$$.fragment,o),L(hn.$$.fragment,o),L(po.$$.fragment,o),L(Tn.$$.fragment,o),L(ho.$$.fragment,o),L(uo.$$.fragment,o),L(go.$$.fragment,o),L(vn.$$.fragment,o),L(yn.$$.fragment,o),L($n.$$.fragment,o),$a=!0)},o(o){x(l.$$.fragment,o),x(y.$$.fragment,o),x(H.$$.fragment,o),x(O.$$.fragment,o),x(J.$$.fragment,o),x(Bt.$$.fragment,o),x(Lo.$$.fragment,o),x(xo.$$.fragment,o),x(Fo.$$.fragment,o),x(qo.$$.fragment,o),x(Co.$$.fragment,o),x(zo.$$.fragment,o),x(Po.$$.fragment,o),x(jo.$$.fragment,o),x(Oo.$$.fragment,o),x(Ao.$$.fragment,o),x(Ho.$$.fragment,o),x(Rt.$$.fragment,o),x(Gt.$$.fragment,o),x(Io.$$.fragment,o),x(Wo.$$.fragment,o),x(Vo.$$.fragment,o),x(Qt.$$.fragment,o),x(Zt.$$.fragment,o),x(Ro.$$.fragment,o),x(Go.$$.fragment,o),x(Jo.$$.fragment,o),x(eo.$$.fragment,o),x(to.$$.fragment,o),x(oo.$$.fragment,o),x(en.$$.fragment,o),x(tn.$$.fragment,o),x(so.$$.fragment,o),x(an.$$.fragment,o),x(ao.$$.fragment,o),x(ro.$$.fragment,o),x(rn.$$.fragment,o),x(ln.$$.fragment,o),x(lo.$$.fragment,o),x(mn.$$.fragment,o),x(co.$$.fragment,o),x(fo.$$.fragment,o),x(pn.$$.fragment,o),x(hn.$$.fragment,o),x(po.$$.fragment,o),x(Tn.$$.fragment,o),x(ho.$$.fragment,o),x(uo.$$.fragment,o),x(go.$$.fragment,o),x(vn.$$.fragment,o),x(yn.$$.fragment,o),x($n.$$.fragment,o),$a=!1},d(o){t(d),o&&t(b),o&&t(h),X(l),o&&t(ie),o&&t(P),X(y),o&&t(Le),o&&t(N),o&&t(xe),o&&t(W),o&&t(Xe),o&&t(B),o&&t(ce),o&&t(C),o&&t(Me),o&&t(D),o&&t(j),o&&t(Q),o&&t(Ee),X(H,o),o&&t(Fe),o&&t(K),X(O),o&&t(M),o&&t(Z),X(J),X(Bt),o&&t(ta),o&&t(yt),X(Lo),o&&t(oa),o&&t(Ye),X(xo),X(Fo),o&&t(na),o&&t(wt),X(qo),o&&t(sa),o&&t($t),X(Co),o&&t(aa),o&&t(kt),X(zo),o&&t(ra),o&&t(Lt),X(Po),o&&t(ia),o&&t(xt),X(jo),o&&t(la),o&&t(Xt),X(Oo),o&&t(da),o&&t(Ue),X(Ao),X(Ho),X(Rt),X(Gt),o&&t(ca),o&&t(Et),X(Io),o&&t(fa),o&&t(Ke),X(Wo),X(Vo),X(Qt),X(Zt),o&&t(ma),o&&t(qt),X(Ro),o&&t(pa),o&&t(pe),X(Go),X(Jo),X(eo),X(to),X(oo),o&&t(ha),o&&t(zt),X(en),o&&t(ua),o&&t($e),X(tn),X(so),X(an),X(ao),X(ro),o&&t(ga),o&&t(jt),X(rn),o&&t(_a),o&&t(ke),X(ln),X(lo),X(mn),X(co),X(fo),o&&t(Ta),o&&t(At),X(pn),o&&t(va),o&&t(ae),X(hn),X(po),X(Tn),X(ho),X(uo),X(go),o&&t(ba),o&&t(Nt),X(vn),o&&t(ya),o&&t(bn),X(yn),o&&t(wa),o&&t(wn),X($n)}}}const kf={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 Lf(q){return of(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Cf extends Zc{constructor(d){super();Jc(this,d,Lf,$f,ef,{})}}export{Cf as default,kf as metadata};
