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

# Initializing a Transformer XL configuration
configuration = TransfoXLConfig()

# Initializing a model (with random weights) from the configuration
model = TransfoXLModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TransfoXLConfig, TransfoXLModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLModel(configuration)

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = TransfoXLTokenizer.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLModel.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = TransfoXLTokenizer.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLLMHeadModel.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)

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

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

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

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

predicted_class_id = logits.argmax().item()
model.config.id2label[predicted_class_id]
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TransfoXLTokenizer, TransfoXLForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = TransfoXLTokenizer.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

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

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

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

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

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

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

predicted_class_id = logits.argmax().item()
model.config.id2label[predicted_class_id]
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TransfoXLTokenizer, TransfoXLForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = TransfoXLTokenizer.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = TransfoXLTokenizer.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFTransfoXLModel.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = TransfoXLTokenizer.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFTransfoXLLMHeadModel.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)

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

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

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

logits = model(**inputs).logits

predicted_class_id = int(tf.math.argmax(logits, axis=-1)[0])
model.config.id2label[predicted_class_id]
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TransfoXLTokenizer, TFTransfoXLForSequenceClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = TransfoXLTokenizer.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFTransfoXLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits

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

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

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