import{S as Df,i as Yf,s as Qf,e as n,k as c,w as y,t as a,M as Kf,c as s,d as t,m as f,a as l,x as w,h as r,b as m,N as Of,G as e,g as p,y as M,q as $,o as k,B as L,v as em,L as Bt}from"../../chunks/vendor-hf-doc-builder.js";import{T as Mt}from"../../chunks/Tip-hf-doc-builder.js";import{D as ae}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Rt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as nt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Vt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function tm(C){let d,v,u,g,b,i,h,F,B,re;return{c(){d=n("p"),v=a("TransformerXL does "),u=n("strong"),g=a("not"),b=a(" work with "),i=n("em"),h=a("torch.nn.DataParallel"),F=a(" due to a bug in PyTorch, see "),B=n("a"),re=a("issue #36035"),this.h()},l(j){d=s(j,"P",{});var U=l(d);v=r(U,"TransformerXL does "),u=s(U,"STRONG",{});var H=l(u);g=r(H,"not"),H.forEach(t),b=r(U," work with "),i=s(U,"EM",{});var x=l(i);h=r(x,"torch.nn.DataParallel"),x.forEach(t),F=r(U," due to a bug in PyTorch, see "),B=s(U,"A",{href:!0,rel:!0});var me=l(B);re=r(me,"issue #36035"),me.forEach(t),U.forEach(t),this.h()},h(){m(B,"href","https://github.com/pytorch/pytorch/issues/36035"),m(B,"rel","nofollow")},m(j,U){p(j,d,U),e(d,v),e(d,u),e(u,g),e(d,b),e(d,i),e(i,h),e(d,F),e(d,B),e(B,re)},d(j){j&&t(d)}}}function om(C){let d,v,u,g,b;return g=new Rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYW5zZm9YTENvbmZpZyUyQyUyMFRyYW5zZm9YTE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFRyYW5zZm9ybWVyJTIwWEwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMFRyYW5zZm9YTENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBUcmFuc2ZvWExNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",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=n("p"),v=a("Examples:"),u=c(),y(g.$$.fragment)},l(i){d=s(i,"P",{});var h=l(d);v=r(h,"Examples:"),h.forEach(t),u=f(i),w(g.$$.fragment,i)},m(i,h){p(i,d,h),e(d,v),p(i,u,h),M(g,i,h),b=!0},p:Bt,i(i){b||($(g.$$.fragment,i),b=!0)},o(i){k(g.$$.fragment,i),b=!1},d(i){i&&t(d),i&&t(u),L(g,i)}}}function nm(C){let d,v,u,g,b;return{c(){d=n("p"),v=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),g=a("Module"),b=a(`
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(i){d=s(i,"P",{});var h=l(d);v=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var F=l(u);g=r(F,"Module"),F.forEach(t),b=r(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(i,h){p(i,d,h),e(d,v),e(d,u),e(u,g),e(d,b)},d(i){i&&t(d)}}}function sm(C){let d,v,u,g,b;return g=new Rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBUcmFuc2ZvWExNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydHJhbnNmby14bC13dDEwMyUyMiklMEFtb2RlbCUyMCUzRCUyMFRyYW5zZm9YTE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJ0cmFuc2ZvLXhsLXd0MTAzJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TransfoXLModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=n("p"),v=a("Example:"),u=c(),y(g.$$.fragment)},l(i){d=s(i,"P",{});var h=l(d);v=r(h,"Example:"),h.forEach(t),u=f(i),w(g.$$.fragment,i)},m(i,h){p(i,d,h),e(d,v),p(i,u,h),M(g,i,h),b=!0},p:Bt,i(i){b||($(g.$$.fragment,i),b=!0)},o(i){k(g.$$.fragment,i),b=!1},d(i){i&&t(d),i&&t(u),L(g,i)}}}function am(C){let d,v,u,g,b;return{c(){d=n("p"),v=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),g=a("Module"),b=a(`
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(i){d=s(i,"P",{});var h=l(d);v=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var F=l(u);g=r(F,"Module"),F.forEach(t),b=r(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(i,h){p(i,d,h),e(d,v),e(d,u),e(u,g),e(d,b)},d(i){i&&t(d)}}}function rm(C){let d,v,u,g,b;return g=new Rt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMFRyYW5zZm9YTExNSGVhZE1vZGVsJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydHJhbnNmby14bC13dDEwMyUyMiklMEFtb2RlbCUyMCUzRCUyMFRyYW5zZm9YTExNSGVhZE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJ0cmFuc2ZvLXhsLXd0MTAzJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RpbnB1dHMlNUIlMjJpbnB1dF9pZHMlMjIlNUQpJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcyUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TransfoXLLMHeadModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=n("p"),v=a("Example:"),u=c(),y(g.$$.fragment)},l(i){d=s(i,"P",{});var h=l(d);v=r(h,"Example:"),h.forEach(t),u=f(i),w(g.$$.fragment,i)},m(i,h){p(i,d,h),e(d,v),p(i,u,h),M(g,i,h),b=!0},p:Bt,i(i){b||($(g.$$.fragment,i),b=!0)},o(i){k(g.$$.fragment,i),b=!1},d(i){i&&t(d),i&&t(u),L(g,i)}}}function lm(C){let d,v,u,g,b;return{c(){d=n("p"),v=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),g=a("Module"),b=a(`
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(i){d=s(i,"P",{});var h=l(d);v=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var F=l(u);g=r(F,"Module"),F.forEach(t),b=r(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(i,h){p(i,d,h),e(d,v),e(d,u),e(u,g),e(d,b)},d(i){i&&t(d)}}}function im(C){let d,v,u,g,b;return g=new Rt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMFRyYW5zZm9YTEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0cmFuc2ZvLXhsLXd0MTAzJTIyKSUwQW1vZGVsJTIwJTNEJTIwVHJhbnNmb1hMRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydHJhbnNmby14bC13dDEwMyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWQlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KCkuaXRlbSgpJTBBJTBBJTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwVHJhbnNmb1hMRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydHJhbnNmby14bC13dDEwMyUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TransfoXLForSequenceClassification

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=n("p"),v=a("Example of single-label classification:"),u=c(),y(g.$$.fragment)},l(i){d=s(i,"P",{});var h=l(d);v=r(h,"Example of single-label classification:"),h.forEach(t),u=f(i),w(g.$$.fragment,i)},m(i,h){p(i,d,h),e(d,v),p(i,u,h),M(g,i,h),b=!0},p:Bt,i(i){b||($(g.$$.fragment,i),b=!0)},o(i){k(g.$$.fragment,i),b=!1},d(i){i&&t(d),i&&t(u),L(g,i)}}}function dm(C){let d,v,u,g,b;return g=new Rt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMFRyYW5zZm9YTEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0cmFuc2ZvLXhsLXd0MTAzJTIyKSUwQW1vZGVsJTIwJTNEJTIwVHJhbnNmb1hMRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydHJhbnNmby14bC13dDEwMyUyMiUyQyUyMHByb2JsZW1fdHlwZSUzRCUyMm11bHRpX2xhYmVsX2NsYXNzaWZpY2F0aW9uJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF9jbGFzc19pZHMlMjAlM0QlMjB0b3JjaC5hcmFuZ2UoMCUyQyUyMGxvZ2l0cy5zaGFwZSU1Qi0xJTVEKSU1QnRvcmNoLnNpZ21vaWQobG9naXRzKS5zcXVlZXplKGRpbSUzRDApJTIwJTNFJTIwMC41JTVEJTBBJTBBJTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwVHJhbnNmb1hMRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIydHJhbnNmby14bC13dDEwMyUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TransfoXLForSequenceClassification

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=n("p"),v=a("Example:"),u=c(),y(g.$$.fragment)},l(i){d=s(i,"P",{});var h=l(d);v=r(h,"Example:"),h.forEach(t),u=f(i),w(g.$$.fragment,i)},m(i,h){p(i,d,h),e(d,v),p(i,u,h),M(g,i,h),b=!0},p:Bt,i(i){b||($(g.$$.fragment,i),b=!0)},o(i){k(g.$$.fragment,i),b=!1},d(i){i&&t(d),i&&t(u),L(g,i)}}}function hm(C){let d,v,u,g,b,i,h,F,B,re,j,U,H,x,me,A,he,Ae,Y,ee,le,R,de,Ce,G,ze,ke,Z,je,ce,pe,z,N,ue,te,Le,ge,O,Je,xe,J,Ie,Q,P,Te,oe,Ne,be,V,qe,D,Ue,_e,I,We,W,ve,Ze;return{c(){d=n("p"),v=a("TensorFlow models and layers in "),u=n("code"),g=a("transformers"),b=a(" accept two formats as input:"),i=c(),h=n("ul"),F=n("li"),B=a("having all inputs as keyword arguments (like PyTorch models), or"),re=c(),j=n("li"),U=a("having all inputs as a list, tuple or dict in the first positional argument."),H=c(),x=n("p"),me=a(`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 `),A=n("code"),he=a("model.fit()"),Ae=a(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Y=n("code"),ee=a("model.fit()"),le=a(` supports! If, however, you want to use the second
format outside of Keras methods like `),R=n("code"),de=a("fit()"),Ce=a(" and "),G=n("code"),ze=a("predict()"),ke=a(`, such as when creating your own layers or models with
the Keras `),Z=n("code"),je=a("Functional"),ce=a(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),pe=c(),z=n("ul"),N=n("li"),ue=a("a single Tensor with "),te=n("code"),Le=a("input_ids"),ge=a(" only and nothing else: "),O=n("code"),Je=a("model(input_ids)"),xe=c(),J=n("li"),Ie=a(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=n("code"),P=a("model([input_ids, attention_mask])"),Te=a(" or "),oe=n("code"),Ne=a("model([input_ids, attention_mask, token_type_ids])"),be=c(),V=n("li"),qe=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=n("code"),Ue=a('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),_e=c(),I=n("p"),We=a(`Note that when creating models and layers with
`),W=n("a"),ve=a("subclassing"),Ze=a(` 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=s(T,"P",{});var X=l(d);v=r(X,"TensorFlow models and layers in "),u=s(X,"CODE",{});var st=l(u);g=r(st,"transformers"),st.forEach(t),b=r(X," accept two formats as input:"),X.forEach(t),i=f(T),h=s(T,"UL",{});var K=l(h);F=s(K,"LI",{});var at=l(F);B=r(at,"having all inputs as keyword arguments (like PyTorch models), or"),at.forEach(t),re=f(K),j=s(K,"LI",{});var rt=l(j);U=r(rt,"having all inputs as a list, tuple or dict in the first positional argument."),rt.forEach(t),K.forEach(t),H=f(T),x=s(T,"P",{});var E=l(x);me=r(E,`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 `),A=s(E,"CODE",{});var lt=l(A);he=r(lt,"model.fit()"),lt.forEach(t),Ae=r(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Y=s(E,"CODE",{});var it=l(Y);ee=r(it,"model.fit()"),it.forEach(t),le=r(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),R=s(E,"CODE",{});var De=l(R);de=r(De,"fit()"),De.forEach(t),Ce=r(E," and "),G=s(E,"CODE",{});var ye=l(G);ze=r(ye,"predict()"),ye.forEach(t),ke=r(E,`, such as when creating your own layers or models with
the Keras `),Z=s(E,"CODE",{});var Ye=l(Z);je=r(Ye,"Functional"),Ye.forEach(t),ce=r(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),pe=f(T),z=s(T,"UL",{});var q=l(z);N=s(q,"LI",{});var S=l(N);ue=r(S,"a single Tensor with "),te=s(S,"CODE",{});var Ve=l(te);Le=r(Ve,"input_ids"),Ve.forEach(t),ge=r(S," only and nothing else: "),O=s(S,"CODE",{});var Xe=l(O);Je=r(Xe,"model(input_ids)"),Xe.forEach(t),S.forEach(t),xe=f(q),J=s(q,"LI",{});var ne=l(J);Ie=r(ne,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=s(ne,"CODE",{});var Be=l(Q);P=r(Be,"model([input_ids, attention_mask])"),Be.forEach(t),Te=r(ne," or "),oe=s(ne,"CODE",{});var dt=l(oe);Ne=r(dt,"model([input_ids, attention_mask, token_type_ids])"),dt.forEach(t),ne.forEach(t),be=f(q),V=s(q,"LI",{});var Ee=l(V);qe=r(Ee,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=s(Ee,"CODE",{});var we=l(D);Ue=r(we,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),we.forEach(t),Ee.forEach(t),q.forEach(t),_e=f(T),I=s(T,"P",{});var ie=l(I);We=r(ie,`Note that when creating models and layers with
`),W=s(ie,"A",{href:!0,rel:!0});var Pe=l(W);ve=r(Pe,"subclassing"),Pe.forEach(t),Ze=r(ie,` 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!`),ie.forEach(t),this.h()},h(){m(W,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(W,"rel","nofollow")},m(T,X){p(T,d,X),e(d,v),e(d,u),e(u,g),e(d,b),p(T,i,X),p(T,h,X),e(h,F),e(F,B),e(h,re),e(h,j),e(j,U),p(T,H,X),p(T,x,X),e(x,me),e(x,A),e(A,he),e(x,Ae),e(x,Y),e(Y,ee),e(x,le),e(x,R),e(R,de),e(x,Ce),e(x,G),e(G,ze),e(x,ke),e(x,Z),e(Z,je),e(x,ce),p(T,pe,X),p(T,z,X),e(z,N),e(N,ue),e(N,te),e(te,Le),e(N,ge),e(N,O),e(O,Je),e(z,xe),e(z,J),e(J,Ie),e(J,Q),e(Q,P),e(J,Te),e(J,oe),e(oe,Ne),e(z,be),e(z,V),e(V,qe),e(V,D),e(D,Ue),p(T,_e,X),p(T,I,X),e(I,We),e(I,W),e(W,ve),e(I,Ze)},d(T){T&&t(d),T&&t(i),T&&t(h),T&&t(H),T&&t(x),T&&t(pe),T&&t(z),T&&t(_e),T&&t(I)}}}function pm(C){let d,v,u,g,b;return{c(){d=n("p"),v=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),g=a("Module"),b=a(`
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(i){d=s(i,"P",{});var h=l(d);v=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var F=l(u);g=r(F,"Module"),F.forEach(t),b=r(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(i,h){p(i,d,h),e(d,v),e(d,u),e(u,g),e(d,b)},d(i){i&&t(d)}}}function um(C){let d,v,u,g,b;return g=new Rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURlRyYW5zZm9YTExNSGVhZE1vZGVsJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0cmFuc2ZvLXhsLXd0MTAzJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZUcmFuc2ZvWExMTUhlYWRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIydHJhbnNmby14bC13dDEwMyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFTransfoXLLMHeadModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=n("p"),v=a("Example:"),u=c(),y(g.$$.fragment)},l(i){d=s(i,"P",{});var h=l(d);v=r(h,"Example:"),h.forEach(t),u=f(i),w(g.$$.fragment,i)},m(i,h){p(i,d,h),e(d,v),p(i,u,h),M(g,i,h),b=!0},p:Bt,i(i){b||($(g.$$.fragment,i),b=!0)},o(i){k(g.$$.fragment,i),b=!1},d(i){i&&t(d),i&&t(u),L(g,i)}}}function gm(C){let d,v,u,g,b,i,h,F,B,re,j,U,H,x,me,A,he,Ae,Y,ee,le,R,de,Ce,G,ze,ke,Z,je,ce,pe,z,N,ue,te,Le,ge,O,Je,xe,J,Ie,Q,P,Te,oe,Ne,be,V,qe,D,Ue,_e,I,We,W,ve,Ze;return{c(){d=n("p"),v=a("TensorFlow models and layers in "),u=n("code"),g=a("transformers"),b=a(" accept two formats as input:"),i=c(),h=n("ul"),F=n("li"),B=a("having all inputs as keyword arguments (like PyTorch models), or"),re=c(),j=n("li"),U=a("having all inputs as a list, tuple or dict in the first positional argument."),H=c(),x=n("p"),me=a(`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 `),A=n("code"),he=a("model.fit()"),Ae=a(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Y=n("code"),ee=a("model.fit()"),le=a(` supports! If, however, you want to use the second
format outside of Keras methods like `),R=n("code"),de=a("fit()"),Ce=a(" and "),G=n("code"),ze=a("predict()"),ke=a(`, such as when creating your own layers or models with
the Keras `),Z=n("code"),je=a("Functional"),ce=a(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),pe=c(),z=n("ul"),N=n("li"),ue=a("a single Tensor with "),te=n("code"),Le=a("input_ids"),ge=a(" only and nothing else: "),O=n("code"),Je=a("model(input_ids)"),xe=c(),J=n("li"),Ie=a(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=n("code"),P=a("model([input_ids, attention_mask])"),Te=a(" or "),oe=n("code"),Ne=a("model([input_ids, attention_mask, token_type_ids])"),be=c(),V=n("li"),qe=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=n("code"),Ue=a('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),_e=c(),I=n("p"),We=a(`Note that when creating models and layers with
`),W=n("a"),ve=a("subclassing"),Ze=a(` 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=s(T,"P",{});var X=l(d);v=r(X,"TensorFlow models and layers in "),u=s(X,"CODE",{});var st=l(u);g=r(st,"transformers"),st.forEach(t),b=r(X," accept two formats as input:"),X.forEach(t),i=f(T),h=s(T,"UL",{});var K=l(h);F=s(K,"LI",{});var at=l(F);B=r(at,"having all inputs as keyword arguments (like PyTorch models), or"),at.forEach(t),re=f(K),j=s(K,"LI",{});var rt=l(j);U=r(rt,"having all inputs as a list, tuple or dict in the first positional argument."),rt.forEach(t),K.forEach(t),H=f(T),x=s(T,"P",{});var E=l(x);me=r(E,`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 `),A=s(E,"CODE",{});var lt=l(A);he=r(lt,"model.fit()"),lt.forEach(t),Ae=r(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Y=s(E,"CODE",{});var it=l(Y);ee=r(it,"model.fit()"),it.forEach(t),le=r(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),R=s(E,"CODE",{});var De=l(R);de=r(De,"fit()"),De.forEach(t),Ce=r(E," and "),G=s(E,"CODE",{});var ye=l(G);ze=r(ye,"predict()"),ye.forEach(t),ke=r(E,`, such as when creating your own layers or models with
the Keras `),Z=s(E,"CODE",{});var Ye=l(Z);je=r(Ye,"Functional"),Ye.forEach(t),ce=r(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),pe=f(T),z=s(T,"UL",{});var q=l(z);N=s(q,"LI",{});var S=l(N);ue=r(S,"a single Tensor with "),te=s(S,"CODE",{});var Ve=l(te);Le=r(Ve,"input_ids"),Ve.forEach(t),ge=r(S," only and nothing else: "),O=s(S,"CODE",{});var Xe=l(O);Je=r(Xe,"model(input_ids)"),Xe.forEach(t),S.forEach(t),xe=f(q),J=s(q,"LI",{});var ne=l(J);Ie=r(ne,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=s(ne,"CODE",{});var Be=l(Q);P=r(Be,"model([input_ids, attention_mask])"),Be.forEach(t),Te=r(ne," or "),oe=s(ne,"CODE",{});var dt=l(oe);Ne=r(dt,"model([input_ids, attention_mask, token_type_ids])"),dt.forEach(t),ne.forEach(t),be=f(q),V=s(q,"LI",{});var Ee=l(V);qe=r(Ee,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=s(Ee,"CODE",{});var we=l(D);Ue=r(we,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),we.forEach(t),Ee.forEach(t),q.forEach(t),_e=f(T),I=s(T,"P",{});var ie=l(I);We=r(ie,`Note that when creating models and layers with
`),W=s(ie,"A",{href:!0,rel:!0});var Pe=l(W);ve=r(Pe,"subclassing"),Pe.forEach(t),Ze=r(ie,` 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!`),ie.forEach(t),this.h()},h(){m(W,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(W,"rel","nofollow")},m(T,X){p(T,d,X),e(d,v),e(d,u),e(u,g),e(d,b),p(T,i,X),p(T,h,X),e(h,F),e(F,B),e(h,re),e(h,j),e(j,U),p(T,H,X),p(T,x,X),e(x,me),e(x,A),e(A,he),e(x,Ae),e(x,Y),e(Y,ee),e(x,le),e(x,R),e(R,de),e(x,Ce),e(x,G),e(G,ze),e(x,ke),e(x,Z),e(Z,je),e(x,ce),p(T,pe,X),p(T,z,X),e(z,N),e(N,ue),e(N,te),e(te,Le),e(N,ge),e(N,O),e(O,Je),e(z,xe),e(z,J),e(J,Ie),e(J,Q),e(Q,P),e(J,Te),e(J,oe),e(oe,Ne),e(z,be),e(z,V),e(V,qe),e(V,D),e(D,Ue),p(T,_e,X),p(T,I,X),e(I,We),e(I,W),e(W,ve),e(I,Ze)},d(T){T&&t(d),T&&t(i),T&&t(h),T&&t(H),T&&t(x),T&&t(pe),T&&t(z),T&&t(_e),T&&t(I)}}}function _m(C){let d,v,u,g,b;return{c(){d=n("p"),v=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),g=a("Module"),b=a(`
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(i){d=s(i,"P",{});var h=l(d);v=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var F=l(u);g=r(F,"Module"),F.forEach(t),b=r(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(i,h){p(i,d,h),e(d,v),e(d,u),e(u,g),e(d,b)},d(i){i&&t(d)}}}function Tm(C){let d,v,u,g,b;return g=new Rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURlRyYW5zZm9YTEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnRyYW5zZm8teGwtd3QxMDMlMjIpJTBBbW9kZWwlMjAlM0QlMjBURlRyYW5zZm9YTEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMnRyYW5zZm8teGwtd3QxMDMlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQSUwQWxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWQlMjAlM0QlMjBpbnQodGYubWF0aC5hcmdtYXgobG9naXRzJTJDJTIwYXhpcyUzRC0xKSU1QjAlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFTransfoXLForSequenceClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])`}}),{c(){d=n("p"),v=a("Example:"),u=c(),y(g.$$.fragment)},l(i){d=s(i,"P",{});var h=l(d);v=r(h,"Example:"),h.forEach(t),u=f(i),w(g.$$.fragment,i)},m(i,h){p(i,d,h),e(d,v),p(i,u,h),M(g,i,h),b=!0},p:Bt,i(i){b||($(g.$$.fragment,i),b=!0)},o(i){k(g.$$.fragment,i),b=!1},d(i){i&&t(d),i&&t(u),L(g,i)}}}function bm(C){let d,v;return d=new Rt({props:{code:"JTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwVEZUcmFuc2ZvWExGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ0cmFuc2ZvLXhsLXd0MTAzJTIyJTJDJTIwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdGYuY29uc3RhbnQoMSklMEFsb3NzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMpLmxvc3M=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on `num_labels` classes, you can pass `num_labels=num_labels` to `.from_pretrained(...)`</span>\n<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)\n<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFTransfoXLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;transfo-xl-wt103&quot;</span>, num_labels=num_labels)\n\n<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tf.constant(<span class="hljs-number">1</span>)\n<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss'}}),{c(){y(d.$$.fragment)},l(u){w(d.$$.fragment,u)},m(u,g){M(d,u,g),v=!0},p:Bt,i(u){v||($(d.$$.fragment,u),v=!0)},o(u){k(d.$$.fragment,u),v=!1},d(u){L(d,u)}}}function vm(C){let d,v,u,g,b,i,h,F,B,re,j,U,H,x,me,A,he,Ae,Y,ee,le,R,de,Ce,G,ze,ke,Z,je,ce,pe,z,N,ue,te,Le,ge,O,Je,xe,J,Ie,Q,P,Te,oe,Ne,be,V,qe,D,Ue,_e,I,We,W,ve,Ze,T,X,st,K,at,rt,E,lt,it,De,ye,Ye,q,S,Ve,Xe,ne,Be,dt,Ee,we,ie,Pe,br,vr,hs,Nn,yr,Ta,$t,Gt,ps,Fo,wr,us,Mr,ba,Qe,Co,$r,gt,kr,qn,Lr,xr,Un,Xr,Er,zo,Fr,Cr,zr,kt,jr,Wn,Jr,Ir,Zn,Nr,qr,Ur,Ot,va,Lt,Dt,gs,jo,Wr,_s,Zr,ya,Ke,Jo,Pr,Io,Sr,No,Hr,Ar,Vr,qo,Br,Pn,Rr,Gr,Or,Sn,Uo,wa,xt,Yt,Ts,Wo,Dr,bs,Yr,Ma,Xt,Zo,Qr,vs,Kr,$a,Et,Po,el,ys,tl,ka,Ft,So,ol,ws,nl,La,Ct,Ho,sl,Ms,al,xa,zt,Qt,$s,Ao,rl,ks,ll,Xa,Se,Vo,il,Ls,dl,cl,Bo,fl,Hn,ml,hl,pl,Ro,ul,Go,gl,_l,Tl,ct,Oo,bl,jt,vl,An,yl,wl,xs,Ml,$l,kl,Kt,Ll,eo,Ea,Jt,to,Xs,Do,xl,Es,Xl,Fa,He,Yo,El,Fs,Fl,Cl,Qo,zl,Vn,jl,Jl,Il,Ko,Nl,en,ql,Ul,Wl,ft,tn,Zl,It,Pl,Bn,Sl,Hl,Cs,Al,Vl,Bl,oo,Rl,no,Ca,Nt,so,zs,on,Gl,js,Ol,za,fe,nn,Dl,Js,Yl,Ql,Rn,Gn,Kl,ei,ti,et,oi,Is,ni,si,Ns,ai,ri,qs,li,ii,Us,di,ci,fi,sn,mi,On,hi,pi,ui,an,gi,rn,_i,Ti,bi,Re,ln,vi,qt,yi,Dn,wi,Mi,Ws,$i,ki,Li,ao,xi,ro,Xi,lo,ja,Ut,io,Zs,dn,Ei,Ps,Fi,Ja,Me,cn,Ci,Ss,zi,ji,fn,Ji,Yn,Ii,Ni,qi,mn,Ui,hn,Wi,Zi,Pi,co,Si,mt,pn,Hi,Wt,Ai,Qn,Vi,Bi,Hs,Ri,Gi,Oi,fo,Di,mo,Ia,Zt,ho,As,un,Yi,Vs,Qi,Na,$e,gn,Ki,Bs,ed,td,_n,od,Kn,nd,sd,ad,Tn,rd,bn,ld,id,dd,po,cd,ht,vn,fd,Pt,md,es,hd,pd,Rs,ud,gd,_d,uo,Td,go,qa,St,_o,Gs,yn,bd,Os,vd,Ua,se,wn,yd,Ds,wd,Md,ts,os,$d,kd,Ld,tt,xd,Ys,Xd,Ed,Qs,Fd,Cd,Ks,zd,jd,ea,Jd,Id,Nd,Mn,qd,ns,Ud,Wd,Zd,$n,Pd,kn,Sd,Hd,Ad,To,Vd,Ge,Ln,Bd,Ht,Rd,ss,Gd,Od,ta,Dd,Yd,Qd,bo,Kd,vo,ec,yo,Wa,At,wo,oa,xn,tc,na,oc,Za,Xn,En,Pa,Fn,Cn,Sa;return i=new nt({}),de=new nt({}),ye=new Mt({props:{warning:!0,$$slots:{default:[tm]},$$scope:{ctx:C}}}),Xe=new nt({}),Fo=new nt({}),Co=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/main/en/model_doc/transfo-xl#transformers.TransfoXLModel">TransfoXLModel</a> or <a href="/docs/transformers/main/en/model_doc/transfo-xl#transformers.TFTransfoXLModel">TFTransfoXLModel</a>.`,name:"vocab_size"},{anchor:"transformers.TransfoXLConfig.cutoffs",description:`<strong>cutoffs</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[20000, 40000, 200000]</code>) &#x2014;
Cutoffs for the adaptive softmax.`,name:"cutoffs"},{anchor:"transformers.TransfoXLConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the model&#x2019;s hidden states.`,name:"d_model"},{anchor:"transformers.TransfoXLConfig.d_embed",description:`<strong>d_embed</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the embeddings`,name:"d_embed"},{anchor:"transformers.TransfoXLConfig.n_head",description:`<strong>n_head</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"n_head"},{anchor:"transformers.TransfoXLConfig.d_head",description:`<strong>d_head</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Dimensionality of the model&#x2019;s heads.`,name:"d_head"},{anchor:"transformers.TransfoXLConfig.d_inner",description:`<strong>d_inner</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Inner dimension in FF`,name:"d_inner"},{anchor:"transformers.TransfoXLConfig.div_val",description:`<strong>div_val</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Divident value for adapative input and softmax`,name:"div_val"},{anchor:"transformers.TransfoXLConfig.pre_lnorm",description:`<strong>pre_lnorm</strong> (<code>boolean</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to apply LayerNorm to the input instead of the output in the blocks.`,name:"pre_lnorm"},{anchor:"transformers.TransfoXLConfig.n_layer",description:`<strong>n_layer</strong> (<code>int</code>, <em>optional</em>, defaults to 18) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"n_layer"},{anchor:"transformers.TransfoXLConfig.mem_len",description:`<strong>mem_len</strong> (<code>int</code>, <em>optional</em>, defaults to 1600) &#x2014;
Length of the retained previous heads.`,name:"mem_len"},{anchor:"transformers.TransfoXLConfig.clamp_len",description:`<strong>clamp_len</strong> (<code>int</code>, <em>optional</em>, defaults to 1000) &#x2014;
Use the same pos embeddings after clamp_len.`,name:"clamp_len"},{anchor:"transformers.TransfoXLConfig.same_length",description:`<strong>same_length</strong> (<code>boolean</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use the same attn length for all tokens`,name:"same_length"},{anchor:"transformers.TransfoXLConfig.proj_share_all_but_first",description:`<strong>proj_share_all_but_first</strong> (<code>boolean</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
True to share all but first projs, False not to share.`,name:"proj_share_all_but_first"},{anchor:"transformers.TransfoXLConfig.attn_type",description:`<strong>attn_type</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Attention type. 0 for Transformer-XL, 1 for Shaw et al, 2 for Vaswani et al, 3 for Al Rfou et al.`,name:"attn_type"},{anchor:"transformers.TransfoXLConfig.sample_softmax",description:`<strong>sample_softmax</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Number of samples in the sampled softmax.`,name:"sample_softmax"},{anchor:"transformers.TransfoXLConfig.adaptive",description:`<strong>adaptive</strong> (<code>boolean</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use adaptive softmax.`,name:"adaptive"},{anchor:"transformers.TransfoXLConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.TransfoXLConfig.dropatt",description:`<strong>dropatt</strong> (<code>float</code>, <em>optional</em>, defaults to 0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"dropatt"},{anchor:"transformers.TransfoXLConfig.untie_r",description:`<strong>untie_r</strong> (<code>boolean</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether ot not to untie relative position biases.`,name:"untie_r"},{anchor:"transformers.TransfoXLConfig.init",description:`<strong>init</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;normal&quot;</code>) &#x2014;
Parameter initializer to use.`,name:"init"},{anchor:"transformers.TransfoXLConfig.init_range",description:`<strong>init_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.01) &#x2014;
Parameters initialized by U(-init_range, init_range).`,name:"init_range"},{anchor:"transformers.TransfoXLConfig.proj_init_std",description:`<strong>proj_init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.01) &#x2014;
Parameters initialized by N(0, init_std)`,name:"proj_init_std"},{anchor:"transformers.TransfoXLConfig.init_std",description:`<strong>init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
Parameters initialized by N(0, init_std)`,name:"init_std"},{anchor:"transformers.TransfoXLConfig.layer_norm_epsilon",description:`<strong>layer_norm_epsilon</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon to use in the layer normalization layers`,name:"layer_norm_epsilon"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/configuration_transfo_xl.py#L29"}}),Ot=new Vt({props:{anchor:"transformers.TransfoXLConfig.example",$$slots:{default:[om]},$$scope:{ctx:C}}}),jo=new nt({}),Jo=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/main/src/transformers/models/transfo_xl/tokenization_transfo_xl.py#L123"}}),Uo=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/main/src/transformers/models/transfo_xl/tokenization_transfo_xl.py#L310"}}),Wo=new nt({}),Zo=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/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L600"}}),Po=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/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L665"}}),So=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:": tf.Tensor = None"},{name:"mems",val:": List[tf.Tensor] = None"},{name:"hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"attentions",val:": Tuple[tf.Tensor] | None = None"}],parametersDescription:[{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the model.`,name:"last_hidden_state"},{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.`,name:"mems"},{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L673"}}),Ho=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:": tf.Tensor = None"},{name:"mems",val:": List[tf.Tensor] = None"},{name:"hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"attentions",val:": Tuple[tf.Tensor] | None = None"}],parametersDescription:[{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput.losses",description:`<strong>losses</strong> (<code>tf.Tensor</code> of shape <em>(batch_size, sequence_length-1)</em>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Language modeling losses (not reduced).`,name:"losses"},{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput.prediction_scores",description:`<strong>prediction_scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token after SoftMax).`,name:"prediction_scores"},{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.`,name:"mems"},{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L704"}}),Ao=new nt({}),Vo=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/main/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L764"}}),Oo=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TransfoXLModel.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TransfoXLModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TransfoXLModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TransfoXLModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TransfoXLModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TransfoXLModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L867",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput"
>transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput"
>transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Kt=new Mt({props:{$$slots:{default:[nm]},$$scope:{ctx:C}}}),eo=new Vt({props:{anchor:"transformers.TransfoXLModel.forward.example",$$slots:{default:[sm]},$$scope:{ctx:C}}}),Do=new nt({}),Yo=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/main/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L1004"}}),tn=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TransfoXLLMHeadModel.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TransfoXLLMHeadModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TransfoXLLMHeadModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TransfoXLLMHeadModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TransfoXLLMHeadModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TransfoXLLMHeadModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TransfoXLLMHeadModel.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for language modeling. Note that the labels <strong>are shifted</strong> inside the model, i.e. you can set
<code>labels = input_ids</code> Indices are selected in <code>[-100, 0, ..., config.vocab_size]</code> All labels set to <code>-100</code>
are ignored (masked), the loss is only computed for labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L1060",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput"
>transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>losses</strong> (<code>torch.FloatTensor</code> of shape <em>(batch_size, sequence_length-1)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling losses (not reduced).</p>
</li>
<li>
<p><strong>prediction_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token after SoftMax).</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>()</code>, <em>optional</em>, returned when <code>labels</code> is provided)
Reduced language modeling loss.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput"
>transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),oo=new Mt({props:{$$slots:{default:[am]},$$scope:{ctx:C}}}),no=new Vt({props:{anchor:"transformers.TransfoXLLMHeadModel.forward.example",$$slots:{default:[rm]},$$scope:{ctx:C}}}),on=new nt({}),nn=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/main/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L1192"}}),ln=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L1201",returnDescription:`
<p>A <code>transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLSequenceClassifierOutputWithPast</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.transfo_xl.modeling_transfo_xl.TransfoXLSequenceClassifierOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ao=new Mt({props:{$$slots:{default:[lm]},$$scope:{ctx:C}}}),ro=new Vt({props:{anchor:"transformers.TransfoXLForSequenceClassification.forward.example",$$slots:{default:[im]},$$scope:{ctx:C}}}),lo=new Vt({props:{anchor:"transformers.TransfoXLForSequenceClassification.forward.example-2",$$slots:{default:[dm]},$$scope:{ctx:C}}}),dn=new nt({}),cn=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/main/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L855"}}),co=new Mt({props:{$$slots:{default:[cm]},$$scope:{ctx:C}}}),pn=new ae({props:{name:"call",anchor:"transformers.TFTransfoXLModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"mems",val:": List[tf.Tensor] | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": bool | None = None"},{name:"output_hidden_states",val:": bool | None = None"},{name:"return_dict",val:": bool | None = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFTransfoXLModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFTransfoXLModel.call.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TFTransfoXLModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFTransfoXLModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFTransfoXLModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFTransfoXLModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFTransfoXLModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFTransfoXLModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L860",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput"
>transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput"
>transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),fo=new Mt({props:{$$slots:{default:[fm]},$$scope:{ctx:C}}}),mo=new Vt({props:{anchor:"transformers.TFTransfoXLModel.call.example",$$slots:{default:[mm]},$$scope:{ctx:C}}}),un=new nt({}),gn=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/main/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L899"}}),po=new Mt({props:{$$slots:{default:[hm]},$$scope:{ctx:C}}}),vn=new ae({props:{name:"call",anchor:"transformers.TFTransfoXLLMHeadModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"mems",val:": List[tf.Tensor] | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": bool | None = None"},{name:"output_hidden_states",val:": bool | None = None"},{name:"return_dict",val:": bool | None = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFTransfoXLLMHeadModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L928",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput"
>transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>losses</strong> (<code>tf.Tensor</code> of shape <em>(batch_size, sequence_length-1)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling losses (not reduced).</p>
</li>
<li>
<p><strong>prediction_scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token after SoftMax).</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/transfo-xl#transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput"
>transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),uo=new Mt({props:{$$slots:{default:[pm]},$$scope:{ctx:C}}}),go=new Vt({props:{anchor:"transformers.TFTransfoXLLMHeadModel.call.example",$$slots:{default:[um]},$$scope:{ctx:C}}}),yn=new nt({}),wn=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/main/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L1006"}}),To=new Mt({props:{$$slots:{default:[gm]},$$scope:{ctx:C}}}),Ln=new ae({props:{name:"call",anchor:"transformers.TFTransfoXLForSequenceClassification.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"mems",val:": List[tf.Tensor] | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFTransfoXLForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the cross entropy classification loss. Indices should be in <code>[0, ..., config.vocab_size - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L1026",returnDescription:`
<p>A <code>transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLSequenceClassifierOutputWithPast</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states (key and values in the attention blocks). Can be used (see <code>mems</code>
input) to speed up sequential decoding. The token ids which have their past given to this model should not
be passed as input ids as they have already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLSequenceClassifierOutputWithPast</code> or <code>tuple(tf.Tensor)</code></p>
`}}),bo=new Mt({props:{$$slots:{default:[_m]},$$scope:{ctx:C}}}),vo=new Vt({props:{anchor:"transformers.TFTransfoXLForSequenceClassification.call.example",$$slots:{default:[Tm]},$$scope:{ctx:C}}}),yo=new Vt({props:{anchor:"transformers.TFTransfoXLForSequenceClassification.call.example-2",$$slots:{default:[bm]},$$scope:{ctx:C}}}),xn=new nt({}),En=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/main/src/transformers/models/transfo_xl/modeling_transfo_xl.py#L399"}}),Cn=new ae({props:{name:"class transformers.TFAdaptiveEmbedding",anchor:"transformers.TFAdaptiveEmbedding",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py#L344"}}),{c(){d=n("meta"),v=c(),u=n("h1"),g=n("a"),b=n("span"),y(i.$$.fragment),h=c(),F=n("span"),B=a("Transformer XL"),re=c(),j=n("div"),U=n("a"),H=n("img"),me=c(),A=n("a"),he=n("img"),Y=c(),ee=n("h2"),le=n("a"),R=n("span"),y(de.$$.fragment),Ce=c(),G=n("span"),ze=a("Overview"),ke=c(),Z=n("p"),je=a("The Transformer-XL model was proposed in "),ce=n("a"),pe=a("Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context"),z=a(` 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).`),N=c(),ue=n("p"),te=a("The abstract from the paper is the following:"),Le=c(),ge=n("p"),O=n("em"),Je=a(`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.`),xe=c(),J=n("p"),Ie=a("Tips:"),Q=c(),P=n("ul"),Te=n("li"),oe=a(`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.`),Ne=c(),be=n("li"),V=a("Transformer-XL is one of the few models that has no sequence length limit."),qe=c(),D=n("li"),Ue=a("Same as a regular GPT model, but introduces a recurrence mechanism for two consecutive segments (similar to a regular RNNs with two consecutive inputs). In this context, a segment is a number of consecutive tokens (for instance 512) that may span across multiple documents, and segments are fed in order to the model."),_e=c(),I=n("li"),We=a("Basically, the hidden states of the previous segment are concatenated to the current input to compute the attention scores. This allows the model to pay attention to information that was in the previous segment as well as the current one. By stacking multiple attention layers, the receptive field can be increased to multiple previous segments."),W=c(),ve=n("li"),Ze=a("This changes the positional embeddings to positional relative embeddings (as the regular positional embeddings would give the same results in the current input and the current hidden state at a given position) and needs to make some adjustments in the way attention scores are computed."),T=c(),X=n("p"),st=a("This model was contributed by "),K=n("a"),at=a("thomwolf"),rt=a(". The original code can be found "),E=n("a"),lt=a("here"),it=a("."),De=c(),y(ye.$$.fragment),Ye=c(),q=n("h2"),S=n("a"),Ve=n("span"),y(Xe.$$.fragment),ne=c(),Be=n("span"),dt=a("Documentation resources"),Ee=c(),we=n("ul"),ie=n("li"),Pe=n("a"),br=a("Text classification task guide"),vr=c(),hs=n("li"),Nn=n("a"),yr=a("Causal language modeling task guide"),Ta=c(),$t=n("h2"),Gt=n("a"),ps=n("span"),y(Fo.$$.fragment),wr=c(),us=n("span"),Mr=a("TransfoXLConfig"),ba=c(),Qe=n("div"),y(Co.$$.fragment),$r=c(),gt=n("p"),kr=a("This is the configuration class to store the configuration of a "),qn=n("a"),Lr=a("TransfoXLModel"),xr=a(" or a "),Un=n("a"),Xr=a("TFTransfoXLModel"),Er=a(`. 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
`),zo=n("a"),Fr=a("transfo-xl-wt103"),Cr=a(" architecture."),zr=c(),kt=n("p"),jr=a("Configuration objects inherit from "),Wn=n("a"),Jr=a("PretrainedConfig"),Ir=a(` and can be used to control the model outputs. Read the
documentation from `),Zn=n("a"),Nr=a("PretrainedConfig"),qr=a(" for more information."),Ur=c(),y(Ot.$$.fragment),va=c(),Lt=n("h2"),Dt=n("a"),gs=n("span"),y(jo.$$.fragment),Wr=c(),_s=n("span"),Zr=a("TransfoXLTokenizer"),ya=c(),Ke=n("div"),y(Jo.$$.fragment),Pr=c(),Io=n("p"),Sr=a("Construct a Transformer-XL tokenizer adapted from Vocab class in "),No=n("a"),Hr=a(`the original
code`),Ar=a(`. The Transformer-XL tokenizer is a word-level tokenizer (no
sub-word tokenization).`),Vr=c(),qo=n("p"),Br=a("This tokenizer inherits from "),Pn=n("a"),Rr=a("PreTrainedTokenizer"),Gr=a(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Or=c(),Sn=n("div"),y(Uo.$$.fragment),wa=c(),xt=n("h2"),Yt=n("a"),Ts=n("span"),y(Wo.$$.fragment),Dr=c(),bs=n("span"),Yr=a("TransfoXL specific outputs"),Ma=c(),Xt=n("div"),y(Zo.$$.fragment),Qr=c(),vs=n("p"),Kr=a("Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),$a=c(),Et=n("div"),y(Po.$$.fragment),el=c(),ys=n("p"),tl=a("Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),ka=c(),Ft=n("div"),y(So.$$.fragment),ol=c(),ws=n("p"),nl=a("Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),La=c(),Ct=n("div"),y(Ho.$$.fragment),sl=c(),Ms=n("p"),al=a("Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),xa=c(),zt=n("h2"),Qt=n("a"),$s=n("span"),y(Ao.$$.fragment),rl=c(),ks=n("span"),ll=a("TransfoXLModel"),Xa=c(),Se=n("div"),y(Vo.$$.fragment),il=c(),Ls=n("p"),dl=a("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),cl=c(),Bo=n("p"),fl=a("This model inherits from "),Hn=n("a"),ml=a("PreTrainedModel"),hl=a(`. 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.)`),pl=c(),Ro=n("p"),ul=a("This model is also a PyTorch "),Go=n("a"),gl=a("torch.nn.Module"),_l=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Tl=c(),ct=n("div"),y(Oo.$$.fragment),bl=c(),jt=n("p"),vl=a("The "),An=n("a"),yl=a("TransfoXLModel"),wl=a(" forward method, overrides the "),xs=n("code"),Ml=a("__call__"),$l=a(" special method."),kl=c(),y(Kt.$$.fragment),Ll=c(),y(eo.$$.fragment),Ea=c(),Jt=n("h2"),to=n("a"),Xs=n("span"),y(Do.$$.fragment),xl=c(),Es=n("span"),Xl=a("TransfoXLLMHeadModel"),Fa=c(),He=n("div"),y(Yo.$$.fragment),El=c(),Fs=n("p"),Fl=a(`The Transformer-XL Model with a language modeling head on top (adaptive softmax with weights tied to the adaptive
input embeddings)`),Cl=c(),Qo=n("p"),zl=a("This model inherits from "),Vn=n("a"),jl=a("PreTrainedModel"),Jl=a(`. 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.)`),Il=c(),Ko=n("p"),Nl=a("This model is also a PyTorch "),en=n("a"),ql=a("torch.nn.Module"),Ul=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Wl=c(),ft=n("div"),y(tn.$$.fragment),Zl=c(),It=n("p"),Pl=a("The "),Bn=n("a"),Sl=a("TransfoXLLMHeadModel"),Hl=a(" forward method, overrides the "),Cs=n("code"),Al=a("__call__"),Vl=a(" special method."),Bl=c(),y(oo.$$.fragment),Rl=c(),y(no.$$.fragment),Ca=c(),Nt=n("h2"),so=n("a"),zs=n("span"),y(on.$$.fragment),Gl=c(),js=n("span"),Ol=a("TransfoXLForSequenceClassification"),za=c(),fe=n("div"),y(nn.$$.fragment),Dl=c(),Js=n("p"),Yl=a("The Transformer-XL Model transformer with a sequence classification head on top (linear layer)."),Ql=c(),Rn=n("p"),Gn=n("a"),Kl=a("TransfoXLForSequenceClassification"),ei=a(` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1) do.`),ti=c(),et=n("p"),oi=a(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Is=n("code"),ni=a("pad_token_id"),si=a(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Ns=n("code"),ai=a("pad_token_id"),ri=a(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),qs=n("code"),li=a("inputs_embeds"),ii=a(" are passed instead of "),Us=n("code"),di=a("input_ids"),ci=a(`, it does the same (take the last value in
each row of the batch).`),fi=c(),sn=n("p"),mi=a("This model inherits from "),On=n("a"),hi=a("PreTrainedModel"),pi=a(`. 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.)`),ui=c(),an=n("p"),gi=a("This model is also a PyTorch "),rn=n("a"),_i=a("torch.nn.Module"),Ti=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),bi=c(),Re=n("div"),y(ln.$$.fragment),vi=c(),qt=n("p"),yi=a("The "),Dn=n("a"),wi=a("TransfoXLForSequenceClassification"),Mi=a(" forward method, overrides the "),Ws=n("code"),$i=a("__call__"),ki=a(" special method."),Li=c(),y(ao.$$.fragment),xi=c(),y(ro.$$.fragment),Xi=c(),y(lo.$$.fragment),ja=c(),Ut=n("h2"),io=n("a"),Zs=n("span"),y(dn.$$.fragment),Ei=c(),Ps=n("span"),Fi=a("TFTransfoXLModel"),Ja=c(),Me=n("div"),y(cn.$$.fragment),Ci=c(),Ss=n("p"),zi=a("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),ji=c(),fn=n("p"),Ji=a("This model inherits from "),Yn=n("a"),Ii=a("TFPreTrainedModel"),Ni=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),qi=c(),mn=n("p"),Ui=a("This model is also a "),hn=n("a"),Wi=a("tf.keras.Model"),Zi=a(` 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.`),Pi=c(),y(co.$$.fragment),Si=c(),mt=n("div"),y(pn.$$.fragment),Hi=c(),Wt=n("p"),Ai=a("The "),Qn=n("a"),Vi=a("TFTransfoXLModel"),Bi=a(" forward method, overrides the "),Hs=n("code"),Ri=a("__call__"),Gi=a(" special method."),Oi=c(),y(fo.$$.fragment),Di=c(),y(mo.$$.fragment),Ia=c(),Zt=n("h2"),ho=n("a"),As=n("span"),y(un.$$.fragment),Yi=c(),Vs=n("span"),Qi=a("TFTransfoXLLMHeadModel"),Na=c(),$e=n("div"),y(gn.$$.fragment),Ki=c(),Bs=n("p"),ed=a(`The Transformer-XL Model with a language modeling head on top (adaptive softmax with weights tied to the adaptive
input embeddings)`),td=c(),_n=n("p"),od=a("This model inherits from "),Kn=n("a"),nd=a("TFPreTrainedModel"),sd=a(`. 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.)`),ad=c(),Tn=n("p"),rd=a("This model is also a "),bn=n("a"),ld=a("tf.keras.Model"),id=a(` 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.`),dd=c(),y(po.$$.fragment),cd=c(),ht=n("div"),y(vn.$$.fragment),fd=c(),Pt=n("p"),md=a("The "),es=n("a"),hd=a("TFTransfoXLLMHeadModel"),pd=a(" forward method, overrides the "),Rs=n("code"),ud=a("__call__"),gd=a(" special method."),_d=c(),y(uo.$$.fragment),Td=c(),y(go.$$.fragment),qa=c(),St=n("h2"),_o=n("a"),Gs=n("span"),y(yn.$$.fragment),bd=c(),Os=n("span"),vd=a("TFTransfoXLForSequenceClassification"),Ua=c(),se=n("div"),y(wn.$$.fragment),yd=c(),Ds=n("p"),wd=a("The Transfo XL Model transformer with a sequence classification head on top (linear layer)."),Md=c(),ts=n("p"),os=n("a"),$d=a("TFTransfoXLForSequenceClassification"),kd=a(` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1,GPT-2) do.`),Ld=c(),tt=n("p"),xd=a(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Ys=n("code"),Xd=a("pad_token_id"),Ed=a(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Qs=n("code"),Fd=a("pad_token_id"),Cd=a(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),Ks=n("code"),zd=a("inputs_embeds"),jd=a(" are passed instead of "),ea=n("code"),Jd=a("input_ids"),Id=a(`, it does the same (take the last value in
each row of the batch).`),Nd=c(),Mn=n("p"),qd=a("This model inherits from "),ns=n("a"),Ud=a("TFPreTrainedModel"),Wd=a(`. 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.)`),Zd=c(),$n=n("p"),Pd=a("This model is also a "),kn=n("a"),Sd=a("tf.keras.Model"),Hd=a(` 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.`),Ad=c(),y(To.$$.fragment),Vd=c(),Ge=n("div"),y(Ln.$$.fragment),Bd=c(),Ht=n("p"),Rd=a("The "),ss=n("a"),Gd=a("TFTransfoXLForSequenceClassification"),Od=a(" forward method, overrides the "),ta=n("code"),Dd=a("__call__"),Yd=a(" special method."),Qd=c(),y(bo.$$.fragment),Kd=c(),y(vo.$$.fragment),ec=c(),y(yo.$$.fragment),Wa=c(),At=n("h2"),wo=n("a"),oa=n("span"),y(xn.$$.fragment),tc=c(),na=n("span"),oc=a("Internal Layers"),Za=c(),Xn=n("div"),y(En.$$.fragment),Pa=c(),Fn=n("div"),y(Cn.$$.fragment),this.h()},l(o){const _=Kf('[data-svelte="svelte-1phssyn"]',document.head);d=s(_,"META",{name:!0,content:!0}),_.forEach(t),v=f(o),u=s(o,"H1",{class:!0});var zn=l(u);g=s(zn,"A",{id:!0,class:!0,href:!0});var sa=l(g);b=s(sa,"SPAN",{});var aa=l(b);w(i.$$.fragment,aa),aa.forEach(t),sa.forEach(t),h=f(zn),F=s(zn,"SPAN",{});var ra=l(F);B=r(ra,"Transformer XL"),ra.forEach(t),zn.forEach(t),re=f(o),j=s(o,"DIV",{class:!0});var jn=l(j);U=s(jn,"A",{href:!0});var la=l(U);H=s(la,"IMG",{alt:!0,src:!0}),la.forEach(t),me=f(jn),A=s(jn,"A",{href:!0});var ia=l(A);he=s(ia,"IMG",{alt:!0,src:!0}),ia.forEach(t),jn.forEach(t),Y=f(o),ee=s(o,"H2",{class:!0});var Jn=l(ee);le=s(Jn,"A",{id:!0,class:!0,href:!0});var da=l(le);R=s(da,"SPAN",{});var ca=l(R);w(de.$$.fragment,ca),ca.forEach(t),da.forEach(t),Ce=f(Jn),G=s(Jn,"SPAN",{});var fa=l(G);ze=r(fa,"Overview"),fa.forEach(t),Jn.forEach(t),ke=f(o),Z=s(o,"P",{});var In=l(Z);je=r(In,"The Transformer-XL model was proposed in "),ce=s(In,"A",{href:!0,rel:!0});var ma=l(ce);pe=r(ma,"Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context"),ma.forEach(t),z=r(In,` 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).`),In.forEach(t),N=f(o),ue=s(o,"P",{});var ha=l(ue);te=r(ha,"The abstract from the paper is the following:"),ha.forEach(t),Le=f(o),ge=s(o,"P",{});var pa=l(ge);O=s(pa,"EM",{});var ua=l(O);Je=r(ua,`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.`),ua.forEach(t),pa.forEach(t),xe=f(o),J=s(o,"P",{});var ga=l(J);Ie=r(ga,"Tips:"),ga.forEach(t),Q=f(o),P=s(o,"UL",{});var ot=l(P);Te=s(ot,"LI",{});var _a=l(Te);oe=r(_a,`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.`),_a.forEach(t),Ne=f(ot),be=s(ot,"LI",{});var ac=l(be);V=r(ac,"Transformer-XL is one of the few models that has no sequence length limit."),ac.forEach(t),qe=f(ot),D=s(ot,"LI",{});var rc=l(D);Ue=r(rc,"Same as a regular GPT model, but introduces a recurrence mechanism for two consecutive segments (similar to a regular RNNs with two consecutive inputs). In this context, a segment is a number of consecutive tokens (for instance 512) that may span across multiple documents, and segments are fed in order to the model."),rc.forEach(t),_e=f(ot),I=s(ot,"LI",{});var lc=l(I);We=r(lc,"Basically, the hidden states of the previous segment are concatenated to the current input to compute the attention scores. This allows the model to pay attention to information that was in the previous segment as well as the current one. By stacking multiple attention layers, the receptive field can be increased to multiple previous segments."),lc.forEach(t),W=f(ot),ve=s(ot,"LI",{});var ic=l(ve);Ze=r(ic,"This changes the positional embeddings to positional relative embeddings (as the regular positional embeddings would give the same results in the current input and the current hidden state at a given position) and needs to make some adjustments in the way attention scores are computed."),ic.forEach(t),ot.forEach(t),T=f(o),X=s(o,"P",{});var as=l(X);st=r(as,"This model was contributed by "),K=s(as,"A",{href:!0,rel:!0});var dc=l(K);at=r(dc,"thomwolf"),dc.forEach(t),rt=r(as,". The original code can be found "),E=s(as,"A",{href:!0,rel:!0});var cc=l(E);lt=r(cc,"here"),cc.forEach(t),it=r(as,"."),as.forEach(t),De=f(o),w(ye.$$.fragment,o),Ye=f(o),q=s(o,"H2",{class:!0});var Ha=l(q);S=s(Ha,"A",{id:!0,class:!0,href:!0});var fc=l(S);Ve=s(fc,"SPAN",{});var mc=l(Ve);w(Xe.$$.fragment,mc),mc.forEach(t),fc.forEach(t),ne=f(Ha),Be=s(Ha,"SPAN",{});var hc=l(Be);dt=r(hc,"Documentation resources"),hc.forEach(t),Ha.forEach(t),Ee=f(o),we=s(o,"UL",{});var Aa=l(we);ie=s(Aa,"LI",{});var pc=l(ie);Pe=s(pc,"A",{href:!0});var uc=l(Pe);br=r(uc,"Text classification task guide"),uc.forEach(t),pc.forEach(t),vr=f(Aa),hs=s(Aa,"LI",{});var gc=l(hs);Nn=s(gc,"A",{href:!0});var _c=l(Nn);yr=r(_c,"Causal language modeling task guide"),_c.forEach(t),gc.forEach(t),Aa.forEach(t),Ta=f(o),$t=s(o,"H2",{class:!0});var Va=l($t);Gt=s(Va,"A",{id:!0,class:!0,href:!0});var Tc=l(Gt);ps=s(Tc,"SPAN",{});var bc=l(ps);w(Fo.$$.fragment,bc),bc.forEach(t),Tc.forEach(t),wr=f(Va),us=s(Va,"SPAN",{});var vc=l(us);Mr=r(vc,"TransfoXLConfig"),vc.forEach(t),Va.forEach(t),ba=f(o),Qe=s(o,"DIV",{class:!0});var Mo=l(Qe);w(Co.$$.fragment,Mo),$r=f(Mo),gt=s(Mo,"P",{});var $o=l(gt);kr=r($o,"This is the configuration class to store the configuration of a "),qn=s($o,"A",{href:!0});var yc=l(qn);Lr=r(yc,"TransfoXLModel"),yc.forEach(t),xr=r($o," or a "),Un=s($o,"A",{href:!0});var wc=l(Un);Xr=r(wc,"TFTransfoXLModel"),wc.forEach(t),Er=r($o,`. 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
`),zo=s($o,"A",{href:!0,rel:!0});var Mc=l(zo);Fr=r(Mc,"transfo-xl-wt103"),Mc.forEach(t),Cr=r($o," architecture."),$o.forEach(t),zr=f(Mo),kt=s(Mo,"P",{});var rs=l(kt);jr=r(rs,"Configuration objects inherit from "),Wn=s(rs,"A",{href:!0});var $c=l(Wn);Jr=r($c,"PretrainedConfig"),$c.forEach(t),Ir=r(rs,` and can be used to control the model outputs. Read the
documentation from `),Zn=s(rs,"A",{href:!0});var kc=l(Zn);Nr=r(kc,"PretrainedConfig"),kc.forEach(t),qr=r(rs," for more information."),rs.forEach(t),Ur=f(Mo),w(Ot.$$.fragment,Mo),Mo.forEach(t),va=f(o),Lt=s(o,"H2",{class:!0});var Ba=l(Lt);Dt=s(Ba,"A",{id:!0,class:!0,href:!0});var Lc=l(Dt);gs=s(Lc,"SPAN",{});var xc=l(gs);w(jo.$$.fragment,xc),xc.forEach(t),Lc.forEach(t),Wr=f(Ba),_s=s(Ba,"SPAN",{});var Xc=l(_s);Zr=r(Xc,"TransfoXLTokenizer"),Xc.forEach(t),Ba.forEach(t),ya=f(o),Ke=s(o,"DIV",{class:!0});var ko=l(Ke);w(Jo.$$.fragment,ko),Pr=f(ko),Io=s(ko,"P",{});var Ra=l(Io);Sr=r(Ra,"Construct a Transformer-XL tokenizer adapted from Vocab class in "),No=s(Ra,"A",{href:!0,rel:!0});var Ec=l(No);Hr=r(Ec,`the original
code`),Ec.forEach(t),Ar=r(Ra,`. The Transformer-XL tokenizer is a word-level tokenizer (no
sub-word tokenization).`),Ra.forEach(t),Vr=f(ko),qo=s(ko,"P",{});var Ga=l(qo);Br=r(Ga,"This tokenizer inherits from "),Pn=s(Ga,"A",{href:!0});var Fc=l(Pn);Rr=r(Fc,"PreTrainedTokenizer"),Fc.forEach(t),Gr=r(Ga,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Ga.forEach(t),Or=f(ko),Sn=s(ko,"DIV",{class:!0});var Cc=l(Sn);w(Uo.$$.fragment,Cc),Cc.forEach(t),ko.forEach(t),wa=f(o),xt=s(o,"H2",{class:!0});var Oa=l(xt);Yt=s(Oa,"A",{id:!0,class:!0,href:!0});var zc=l(Yt);Ts=s(zc,"SPAN",{});var jc=l(Ts);w(Wo.$$.fragment,jc),jc.forEach(t),zc.forEach(t),Dr=f(Oa),bs=s(Oa,"SPAN",{});var Jc=l(bs);Yr=r(Jc,"TransfoXL specific outputs"),Jc.forEach(t),Oa.forEach(t),Ma=f(o),Xt=s(o,"DIV",{class:!0});var Da=l(Xt);w(Zo.$$.fragment,Da),Qr=f(Da),vs=s(Da,"P",{});var Ic=l(vs);Kr=r(Ic,"Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),Ic.forEach(t),Da.forEach(t),$a=f(o),Et=s(o,"DIV",{class:!0});var Ya=l(Et);w(Po.$$.fragment,Ya),el=f(Ya),ys=s(Ya,"P",{});var Nc=l(ys);tl=r(Nc,"Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),Nc.forEach(t),Ya.forEach(t),ka=f(o),Ft=s(o,"DIV",{class:!0});var Qa=l(Ft);w(So.$$.fragment,Qa),ol=f(Qa),ws=s(Qa,"P",{});var qc=l(ws);nl=r(qc,"Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),qc.forEach(t),Qa.forEach(t),La=f(o),Ct=s(o,"DIV",{class:!0});var Ka=l(Ct);w(Ho.$$.fragment,Ka),sl=f(Ka),Ms=s(Ka,"P",{});var Uc=l(Ms);al=r(Uc,"Base class for model\u2019s outputs that may also contain a past key/values (to speed up sequential decoding)."),Uc.forEach(t),Ka.forEach(t),xa=f(o),zt=s(o,"H2",{class:!0});var er=l(zt);Qt=s(er,"A",{id:!0,class:!0,href:!0});var Wc=l(Qt);$s=s(Wc,"SPAN",{});var Zc=l($s);w(Ao.$$.fragment,Zc),Zc.forEach(t),Wc.forEach(t),rl=f(er),ks=s(er,"SPAN",{});var Pc=l(ks);ll=r(Pc,"TransfoXLModel"),Pc.forEach(t),er.forEach(t),Xa=f(o),Se=s(o,"DIV",{class:!0});var _t=l(Se);w(Vo.$$.fragment,_t),il=f(_t),Ls=s(_t,"P",{});var Sc=l(Ls);dl=r(Sc,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),Sc.forEach(t),cl=f(_t),Bo=s(_t,"P",{});var tr=l(Bo);fl=r(tr,"This model inherits from "),Hn=s(tr,"A",{href:!0});var Hc=l(Hn);ml=r(Hc,"PreTrainedModel"),Hc.forEach(t),hl=r(tr,`. 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.)`),tr.forEach(t),pl=f(_t),Ro=s(_t,"P",{});var or=l(Ro);ul=r(or,"This model is also a PyTorch "),Go=s(or,"A",{href:!0,rel:!0});var Ac=l(Go);gl=r(Ac,"torch.nn.Module"),Ac.forEach(t),_l=r(or,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),or.forEach(t),Tl=f(_t),ct=s(_t,"DIV",{class:!0});var Lo=l(ct);w(Oo.$$.fragment,Lo),bl=f(Lo),jt=s(Lo,"P",{});var ls=l(jt);vl=r(ls,"The "),An=s(ls,"A",{href:!0});var Vc=l(An);yl=r(Vc,"TransfoXLModel"),Vc.forEach(t),wl=r(ls," forward method, overrides the "),xs=s(ls,"CODE",{});var Bc=l(xs);Ml=r(Bc,"__call__"),Bc.forEach(t),$l=r(ls," special method."),ls.forEach(t),kl=f(Lo),w(Kt.$$.fragment,Lo),Ll=f(Lo),w(eo.$$.fragment,Lo),Lo.forEach(t),_t.forEach(t),Ea=f(o),Jt=s(o,"H2",{class:!0});var nr=l(Jt);to=s(nr,"A",{id:!0,class:!0,href:!0});var Rc=l(to);Xs=s(Rc,"SPAN",{});var Gc=l(Xs);w(Do.$$.fragment,Gc),Gc.forEach(t),Rc.forEach(t),xl=f(nr),Es=s(nr,"SPAN",{});var Oc=l(Es);Xl=r(Oc,"TransfoXLLMHeadModel"),Oc.forEach(t),nr.forEach(t),Fa=f(o),He=s(o,"DIV",{class:!0});var Tt=l(He);w(Yo.$$.fragment,Tt),El=f(Tt),Fs=s(Tt,"P",{});var Dc=l(Fs);Fl=r(Dc,`The Transformer-XL Model with a language modeling head on top (adaptive softmax with weights tied to the adaptive
input embeddings)`),Dc.forEach(t),Cl=f(Tt),Qo=s(Tt,"P",{});var sr=l(Qo);zl=r(sr,"This model inherits from "),Vn=s(sr,"A",{href:!0});var Yc=l(Vn);jl=r(Yc,"PreTrainedModel"),Yc.forEach(t),Jl=r(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),Il=f(Tt),Ko=s(Tt,"P",{});var ar=l(Ko);Nl=r(ar,"This model is also a PyTorch "),en=s(ar,"A",{href:!0,rel:!0});var Qc=l(en);ql=r(Qc,"torch.nn.Module"),Qc.forEach(t),Ul=r(ar,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ar.forEach(t),Wl=f(Tt),ft=s(Tt,"DIV",{class:!0});var xo=l(ft);w(tn.$$.fragment,xo),Zl=f(xo),It=s(xo,"P",{});var is=l(It);Pl=r(is,"The "),Bn=s(is,"A",{href:!0});var Kc=l(Bn);Sl=r(Kc,"TransfoXLLMHeadModel"),Kc.forEach(t),Hl=r(is," forward method, overrides the "),Cs=s(is,"CODE",{});var ef=l(Cs);Al=r(ef,"__call__"),ef.forEach(t),Vl=r(is," special method."),is.forEach(t),Bl=f(xo),w(oo.$$.fragment,xo),Rl=f(xo),w(no.$$.fragment,xo),xo.forEach(t),Tt.forEach(t),Ca=f(o),Nt=s(o,"H2",{class:!0});var rr=l(Nt);so=s(rr,"A",{id:!0,class:!0,href:!0});var tf=l(so);zs=s(tf,"SPAN",{});var of=l(zs);w(on.$$.fragment,of),of.forEach(t),tf.forEach(t),Gl=f(rr),js=s(rr,"SPAN",{});var nf=l(js);Ol=r(nf,"TransfoXLForSequenceClassification"),nf.forEach(t),rr.forEach(t),za=f(o),fe=s(o,"DIV",{class:!0});var Oe=l(fe);w(nn.$$.fragment,Oe),Dl=f(Oe),Js=s(Oe,"P",{});var sf=l(Js);Yl=r(sf,"The Transformer-XL Model transformer with a sequence classification head on top (linear layer)."),sf.forEach(t),Ql=f(Oe),Rn=s(Oe,"P",{});var nc=l(Rn);Gn=s(nc,"A",{href:!0});var af=l(Gn);Kl=r(af,"TransfoXLForSequenceClassification"),af.forEach(t),ei=r(nc,` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1) do.`),nc.forEach(t),ti=f(Oe),et=s(Oe,"P",{});var bt=l(et);oi=r(bt,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Is=s(bt,"CODE",{});var rf=l(Is);ni=r(rf,"pad_token_id"),rf.forEach(t),si=r(bt,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Ns=s(bt,"CODE",{});var lf=l(Ns);ai=r(lf,"pad_token_id"),lf.forEach(t),ri=r(bt,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),qs=s(bt,"CODE",{});var df=l(qs);li=r(df,"inputs_embeds"),df.forEach(t),ii=r(bt," are passed instead of "),Us=s(bt,"CODE",{});var cf=l(Us);di=r(cf,"input_ids"),cf.forEach(t),ci=r(bt,`, it does the same (take the last value in
each row of the batch).`),bt.forEach(t),fi=f(Oe),sn=s(Oe,"P",{});var lr=l(sn);mi=r(lr,"This model inherits from "),On=s(lr,"A",{href:!0});var ff=l(On);hi=r(ff,"PreTrainedModel"),ff.forEach(t),pi=r(lr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),lr.forEach(t),ui=f(Oe),an=s(Oe,"P",{});var ir=l(an);gi=r(ir,"This model is also a PyTorch "),rn=s(ir,"A",{href:!0,rel:!0});var mf=l(rn);_i=r(mf,"torch.nn.Module"),mf.forEach(t),Ti=r(ir,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ir.forEach(t),bi=f(Oe),Re=s(Oe,"DIV",{class:!0});var vt=l(Re);w(ln.$$.fragment,vt),vi=f(vt),qt=s(vt,"P",{});var ds=l(qt);yi=r(ds,"The "),Dn=s(ds,"A",{href:!0});var hf=l(Dn);wi=r(hf,"TransfoXLForSequenceClassification"),hf.forEach(t),Mi=r(ds," forward method, overrides the "),Ws=s(ds,"CODE",{});var pf=l(Ws);$i=r(pf,"__call__"),pf.forEach(t),ki=r(ds," special method."),ds.forEach(t),Li=f(vt),w(ao.$$.fragment,vt),xi=f(vt),w(ro.$$.fragment,vt),Xi=f(vt),w(lo.$$.fragment,vt),vt.forEach(t),Oe.forEach(t),ja=f(o),Ut=s(o,"H2",{class:!0});var dr=l(Ut);io=s(dr,"A",{id:!0,class:!0,href:!0});var uf=l(io);Zs=s(uf,"SPAN",{});var gf=l(Zs);w(dn.$$.fragment,gf),gf.forEach(t),uf.forEach(t),Ei=f(dr),Ps=s(dr,"SPAN",{});var _f=l(Ps);Fi=r(_f,"TFTransfoXLModel"),_f.forEach(t),dr.forEach(t),Ja=f(o),Me=s(o,"DIV",{class:!0});var pt=l(Me);w(cn.$$.fragment,pt),Ci=f(pt),Ss=s(pt,"P",{});var Tf=l(Ss);zi=r(Tf,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),Tf.forEach(t),ji=f(pt),fn=s(pt,"P",{});var cr=l(fn);Ji=r(cr,"This model inherits from "),Yn=s(cr,"A",{href:!0});var bf=l(Yn);Ii=r(bf,"TFPreTrainedModel"),bf.forEach(t),Ni=r(cr,`. 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.)`),cr.forEach(t),qi=f(pt),mn=s(pt,"P",{});var fr=l(mn);Ui=r(fr,"This model is also a "),hn=s(fr,"A",{href:!0,rel:!0});var vf=l(hn);Wi=r(vf,"tf.keras.Model"),vf.forEach(t),Zi=r(fr,` 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.`),fr.forEach(t),Pi=f(pt),w(co.$$.fragment,pt),Si=f(pt),mt=s(pt,"DIV",{class:!0});var Xo=l(mt);w(pn.$$.fragment,Xo),Hi=f(Xo),Wt=s(Xo,"P",{});var cs=l(Wt);Ai=r(cs,"The "),Qn=s(cs,"A",{href:!0});var yf=l(Qn);Vi=r(yf,"TFTransfoXLModel"),yf.forEach(t),Bi=r(cs," forward method, overrides the "),Hs=s(cs,"CODE",{});var wf=l(Hs);Ri=r(wf,"__call__"),wf.forEach(t),Gi=r(cs," special method."),cs.forEach(t),Oi=f(Xo),w(fo.$$.fragment,Xo),Di=f(Xo),w(mo.$$.fragment,Xo),Xo.forEach(t),pt.forEach(t),Ia=f(o),Zt=s(o,"H2",{class:!0});var mr=l(Zt);ho=s(mr,"A",{id:!0,class:!0,href:!0});var Mf=l(ho);As=s(Mf,"SPAN",{});var $f=l(As);w(un.$$.fragment,$f),$f.forEach(t),Mf.forEach(t),Yi=f(mr),Vs=s(mr,"SPAN",{});var kf=l(Vs);Qi=r(kf,"TFTransfoXLLMHeadModel"),kf.forEach(t),mr.forEach(t),Na=f(o),$e=s(o,"DIV",{class:!0});var ut=l($e);w(gn.$$.fragment,ut),Ki=f(ut),Bs=s(ut,"P",{});var Lf=l(Bs);ed=r(Lf,`The Transformer-XL Model with a language modeling head on top (adaptive softmax with weights tied to the adaptive
input embeddings)`),Lf.forEach(t),td=f(ut),_n=s(ut,"P",{});var hr=l(_n);od=r(hr,"This model inherits from "),Kn=s(hr,"A",{href:!0});var xf=l(Kn);nd=r(xf,"TFPreTrainedModel"),xf.forEach(t),sd=r(hr,`. 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.)`),hr.forEach(t),ad=f(ut),Tn=s(ut,"P",{});var pr=l(Tn);rd=r(pr,"This model is also a "),bn=s(pr,"A",{href:!0,rel:!0});var Xf=l(bn);ld=r(Xf,"tf.keras.Model"),Xf.forEach(t),id=r(pr,` 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.`),pr.forEach(t),dd=f(ut),w(po.$$.fragment,ut),cd=f(ut),ht=s(ut,"DIV",{class:!0});var Eo=l(ht);w(vn.$$.fragment,Eo),fd=f(Eo),Pt=s(Eo,"P",{});var fs=l(Pt);md=r(fs,"The "),es=s(fs,"A",{href:!0});var Ef=l(es);hd=r(Ef,"TFTransfoXLLMHeadModel"),Ef.forEach(t),pd=r(fs," forward method, overrides the "),Rs=s(fs,"CODE",{});var Ff=l(Rs);ud=r(Ff,"__call__"),Ff.forEach(t),gd=r(fs," special method."),fs.forEach(t),_d=f(Eo),w(uo.$$.fragment,Eo),Td=f(Eo),w(go.$$.fragment,Eo),Eo.forEach(t),ut.forEach(t),qa=f(o),St=s(o,"H2",{class:!0});var ur=l(St);_o=s(ur,"A",{id:!0,class:!0,href:!0});var Cf=l(_o);Gs=s(Cf,"SPAN",{});var zf=l(Gs);w(yn.$$.fragment,zf),zf.forEach(t),Cf.forEach(t),bd=f(ur),Os=s(ur,"SPAN",{});var jf=l(Os);vd=r(jf,"TFTransfoXLForSequenceClassification"),jf.forEach(t),ur.forEach(t),Ua=f(o),se=s(o,"DIV",{class:!0});var Fe=l(se);w(wn.$$.fragment,Fe),yd=f(Fe),Ds=s(Fe,"P",{});var Jf=l(Ds);wd=r(Jf,"The Transfo XL Model transformer with a sequence classification head on top (linear layer)."),Jf.forEach(t),Md=f(Fe),ts=s(Fe,"P",{});var sc=l(ts);os=s(sc,"A",{href:!0});var If=l(os);$d=r(If,"TFTransfoXLForSequenceClassification"),If.forEach(t),kd=r(sc,` uses the last token in order to do the classification, as other causal
models (e.g. GPT-1,GPT-2) do.`),sc.forEach(t),Ld=f(Fe),tt=s(Fe,"P",{});var yt=l(tt);xd=r(yt,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Ys=s(yt,"CODE",{});var Nf=l(Ys);Xd=r(Nf,"pad_token_id"),Nf.forEach(t),Ed=r(yt,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Qs=s(yt,"CODE",{});var qf=l(Qs);Fd=r(qf,"pad_token_id"),qf.forEach(t),Cd=r(yt,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),Ks=s(yt,"CODE",{});var Uf=l(Ks);zd=r(Uf,"inputs_embeds"),Uf.forEach(t),jd=r(yt," are passed instead of "),ea=s(yt,"CODE",{});var Wf=l(ea);Jd=r(Wf,"input_ids"),Wf.forEach(t),Id=r(yt,`, it does the same (take the last value in
each row of the batch).`),yt.forEach(t),Nd=f(Fe),Mn=s(Fe,"P",{});var gr=l(Mn);qd=r(gr,"This model inherits from "),ns=s(gr,"A",{href:!0});var Zf=l(ns);Ud=r(Zf,"TFPreTrainedModel"),Zf.forEach(t),Wd=r(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),Zd=f(Fe),$n=s(Fe,"P",{});var _r=l($n);Pd=r(_r,"This model is also a "),kn=s(_r,"A",{href:!0,rel:!0});var Pf=l(kn);Sd=r(Pf,"tf.keras.Model"),Pf.forEach(t),Hd=r(_r,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),_r.forEach(t),Ad=f(Fe),w(To.$$.fragment,Fe),Vd=f(Fe),Ge=s(Fe,"DIV",{class:!0});var wt=l(Ge);w(Ln.$$.fragment,wt),Bd=f(wt),Ht=s(wt,"P",{});var ms=l(Ht);Rd=r(ms,"The "),ss=s(ms,"A",{href:!0});var Sf=l(ss);Gd=r(Sf,"TFTransfoXLForSequenceClassification"),Sf.forEach(t),Od=r(ms," forward method, overrides the "),ta=s(ms,"CODE",{});var Hf=l(ta);Dd=r(Hf,"__call__"),Hf.forEach(t),Yd=r(ms," special method."),ms.forEach(t),Qd=f(wt),w(bo.$$.fragment,wt),Kd=f(wt),w(vo.$$.fragment,wt),ec=f(wt),w(yo.$$.fragment,wt),wt.forEach(t),Fe.forEach(t),Wa=f(o),At=s(o,"H2",{class:!0});var Tr=l(At);wo=s(Tr,"A",{id:!0,class:!0,href:!0});var Af=l(wo);oa=s(Af,"SPAN",{});var Vf=l(oa);w(xn.$$.fragment,Vf),Vf.forEach(t),Af.forEach(t),tc=f(Tr),na=s(Tr,"SPAN",{});var Bf=l(na);oc=r(Bf,"Internal Layers"),Bf.forEach(t),Tr.forEach(t),Za=f(o),Xn=s(o,"DIV",{class:!0});var Rf=l(Xn);w(En.$$.fragment,Rf),Rf.forEach(t),Pa=f(o),Fn=s(o,"DIV",{class:!0});var Gf=l(Fn);w(Cn.$$.fragment,Gf),Gf.forEach(t),this.h()},h(){m(d,"name","hf:doc:metadata"),m(d,"content",JSON.stringify(ym)),m(g,"id","transformer-xl"),m(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(g,"href","#transformer-xl"),m(u,"class","relative group"),m(H,"alt","Models"),Of(H.src,x="https://img.shields.io/badge/All_model_pages-transfo--xl-blueviolet")||m(H,"src",x),m(U,"href","https://huggingface.co/models?filter=transfo-xl"),m(he,"alt","Spaces"),Of(he.src,Ae="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||m(he,"src",Ae),m(A,"href","https://huggingface.co/spaces/docs-demos/transfo-xl-wt103"),m(j,"class","flex flex-wrap space-x-1"),m(le,"id","overview"),m(le,"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(le,"href","#overview"),m(ee,"class","relative group"),m(ce,"href","https://arxiv.org/abs/1901.02860"),m(ce,"rel","nofollow"),m(K,"href","https://huggingface.co/thomwolf"),m(K,"rel","nofollow"),m(E,"href","https://github.com/kimiyoung/transformer-xl"),m(E,"rel","nofollow"),m(S,"id","documentation-resources"),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","#documentation-resources"),m(q,"class","relative group"),m(Pe,"href","../tasks/sequence_classification"),m(Nn,"href","../tasks/language_modeling"),m(Gt,"id","transformers.TransfoXLConfig"),m(Gt,"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(Gt,"href","#transformers.TransfoXLConfig"),m($t,"class","relative group"),m(qn,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLModel"),m(Un,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TFTransfoXLModel"),m(zo,"href","https://huggingface.co/transfo-xl-wt103"),m(zo,"rel","nofollow"),m(Wn,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),m(Zn,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),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(Dt,"id","transformers.TransfoXLTokenizer"),m(Dt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Dt,"href","#transformers.TransfoXLTokenizer"),m(Lt,"class","relative group"),m(No,"href","https://github.com/kimiyoung/transformer-xl"),m(No,"rel","nofollow"),m(Pn,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(Sn,"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.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput"),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.models.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput"),m(xt,"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(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(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(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(Qt,"id","transformers.TransfoXLModel"),m(Qt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Qt,"href","#transformers.TransfoXLModel"),m(zt,"class","relative group"),m(Hn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(Go,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Go,"rel","nofollow"),m(An,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLModel"),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(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(to,"id","transformers.TransfoXLLMHeadModel"),m(to,"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(to,"href","#transformers.TransfoXLLMHeadModel"),m(Jt,"class","relative group"),m(Vn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(en,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(en,"rel","nofollow"),m(Bn,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLLMHeadModel"),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(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(so,"id","transformers.TransfoXLForSequenceClassification"),m(so,"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(so,"href","#transformers.TransfoXLForSequenceClassification"),m(Nt,"class","relative group"),m(Gn,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLForSequenceClassification"),m(On,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(rn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(rn,"rel","nofollow"),m(Dn,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TransfoXLForSequenceClassification"),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(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(io,"id","transformers.TFTransfoXLModel"),m(io,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(io,"href","#transformers.TFTransfoXLModel"),m(Ut,"class","relative group"),m(Yn,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(hn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(hn,"rel","nofollow"),m(Qn,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TFTransfoXLModel"),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(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ho,"id","transformers.TFTransfoXLLMHeadModel"),m(ho,"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(ho,"href","#transformers.TFTransfoXLLMHeadModel"),m(Zt,"class","relative group"),m(Kn,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(bn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(bn,"rel","nofollow"),m(es,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TFTransfoXLLMHeadModel"),m(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m($e,"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,"id","transformers.TFTransfoXLForSequenceClassification"),m(_o,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(_o,"href","#transformers.TFTransfoXLForSequenceClassification"),m(St,"class","relative group"),m(os,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TFTransfoXLForSequenceClassification"),m(ns,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(kn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(kn,"rel","nofollow"),m(ss,"href","/docs/transformers/main/en/model_doc/transfo-xl#transformers.TFTransfoXLForSequenceClassification"),m(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(wo,"id","transformers.AdaptiveEmbedding"),m(wo,"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(wo,"href","#transformers.AdaptiveEmbedding"),m(At,"class","relative group"),m(Xn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Fn,"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),p(o,v,_),p(o,u,_),e(u,g),e(g,b),M(i,b,null),e(u,h),e(u,F),e(F,B),p(o,re,_),p(o,j,_),e(j,U),e(U,H),e(j,me),e(j,A),e(A,he),p(o,Y,_),p(o,ee,_),e(ee,le),e(le,R),M(de,R,null),e(ee,Ce),e(ee,G),e(G,ze),p(o,ke,_),p(o,Z,_),e(Z,je),e(Z,ce),e(ce,pe),e(Z,z),p(o,N,_),p(o,ue,_),e(ue,te),p(o,Le,_),p(o,ge,_),e(ge,O),e(O,Je),p(o,xe,_),p(o,J,_),e(J,Ie),p(o,Q,_),p(o,P,_),e(P,Te),e(Te,oe),e(P,Ne),e(P,be),e(be,V),e(P,qe),e(P,D),e(D,Ue),e(P,_e),e(P,I),e(I,We),e(P,W),e(P,ve),e(ve,Ze),p(o,T,_),p(o,X,_),e(X,st),e(X,K),e(K,at),e(X,rt),e(X,E),e(E,lt),e(X,it),p(o,De,_),M(ye,o,_),p(o,Ye,_),p(o,q,_),e(q,S),e(S,Ve),M(Xe,Ve,null),e(q,ne),e(q,Be),e(Be,dt),p(o,Ee,_),p(o,we,_),e(we,ie),e(ie,Pe),e(Pe,br),e(we,vr),e(we,hs),e(hs,Nn),e(Nn,yr),p(o,Ta,_),p(o,$t,_),e($t,Gt),e(Gt,ps),M(Fo,ps,null),e($t,wr),e($t,us),e(us,Mr),p(o,ba,_),p(o,Qe,_),M(Co,Qe,null),e(Qe,$r),e(Qe,gt),e(gt,kr),e(gt,qn),e(qn,Lr),e(gt,xr),e(gt,Un),e(Un,Xr),e(gt,Er),e(gt,zo),e(zo,Fr),e(gt,Cr),e(Qe,zr),e(Qe,kt),e(kt,jr),e(kt,Wn),e(Wn,Jr),e(kt,Ir),e(kt,Zn),e(Zn,Nr),e(kt,qr),e(Qe,Ur),M(Ot,Qe,null),p(o,va,_),p(o,Lt,_),e(Lt,Dt),e(Dt,gs),M(jo,gs,null),e(Lt,Wr),e(Lt,_s),e(_s,Zr),p(o,ya,_),p(o,Ke,_),M(Jo,Ke,null),e(Ke,Pr),e(Ke,Io),e(Io,Sr),e(Io,No),e(No,Hr),e(Io,Ar),e(Ke,Vr),e(Ke,qo),e(qo,Br),e(qo,Pn),e(Pn,Rr),e(qo,Gr),e(Ke,Or),e(Ke,Sn),M(Uo,Sn,null),p(o,wa,_),p(o,xt,_),e(xt,Yt),e(Yt,Ts),M(Wo,Ts,null),e(xt,Dr),e(xt,bs),e(bs,Yr),p(o,Ma,_),p(o,Xt,_),M(Zo,Xt,null),e(Xt,Qr),e(Xt,vs),e(vs,Kr),p(o,$a,_),p(o,Et,_),M(Po,Et,null),e(Et,el),e(Et,ys),e(ys,tl),p(o,ka,_),p(o,Ft,_),M(So,Ft,null),e(Ft,ol),e(Ft,ws),e(ws,nl),p(o,La,_),p(o,Ct,_),M(Ho,Ct,null),e(Ct,sl),e(Ct,Ms),e(Ms,al),p(o,xa,_),p(o,zt,_),e(zt,Qt),e(Qt,$s),M(Ao,$s,null),e(zt,rl),e(zt,ks),e(ks,ll),p(o,Xa,_),p(o,Se,_),M(Vo,Se,null),e(Se,il),e(Se,Ls),e(Ls,dl),e(Se,cl),e(Se,Bo),e(Bo,fl),e(Bo,Hn),e(Hn,ml),e(Bo,hl),e(Se,pl),e(Se,Ro),e(Ro,ul),e(Ro,Go),e(Go,gl),e(Ro,_l),e(Se,Tl),e(Se,ct),M(Oo,ct,null),e(ct,bl),e(ct,jt),e(jt,vl),e(jt,An),e(An,yl),e(jt,wl),e(jt,xs),e(xs,Ml),e(jt,$l),e(ct,kl),M(Kt,ct,null),e(ct,Ll),M(eo,ct,null),p(o,Ea,_),p(o,Jt,_),e(Jt,to),e(to,Xs),M(Do,Xs,null),e(Jt,xl),e(Jt,Es),e(Es,Xl),p(o,Fa,_),p(o,He,_),M(Yo,He,null),e(He,El),e(He,Fs),e(Fs,Fl),e(He,Cl),e(He,Qo),e(Qo,zl),e(Qo,Vn),e(Vn,jl),e(Qo,Jl),e(He,Il),e(He,Ko),e(Ko,Nl),e(Ko,en),e(en,ql),e(Ko,Ul),e(He,Wl),e(He,ft),M(tn,ft,null),e(ft,Zl),e(ft,It),e(It,Pl),e(It,Bn),e(Bn,Sl),e(It,Hl),e(It,Cs),e(Cs,Al),e(It,Vl),e(ft,Bl),M(oo,ft,null),e(ft,Rl),M(no,ft,null),p(o,Ca,_),p(o,Nt,_),e(Nt,so),e(so,zs),M(on,zs,null),e(Nt,Gl),e(Nt,js),e(js,Ol),p(o,za,_),p(o,fe,_),M(nn,fe,null),e(fe,Dl),e(fe,Js),e(Js,Yl),e(fe,Ql),e(fe,Rn),e(Rn,Gn),e(Gn,Kl),e(Rn,ei),e(fe,ti),e(fe,et),e(et,oi),e(et,Is),e(Is,ni),e(et,si),e(et,Ns),e(Ns,ai),e(et,ri),e(et,qs),e(qs,li),e(et,ii),e(et,Us),e(Us,di),e(et,ci),e(fe,fi),e(fe,sn),e(sn,mi),e(sn,On),e(On,hi),e(sn,pi),e(fe,ui),e(fe,an),e(an,gi),e(an,rn),e(rn,_i),e(an,Ti),e(fe,bi),e(fe,Re),M(ln,Re,null),e(Re,vi),e(Re,qt),e(qt,yi),e(qt,Dn),e(Dn,wi),e(qt,Mi),e(qt,Ws),e(Ws,$i),e(qt,ki),e(Re,Li),M(ao,Re,null),e(Re,xi),M(ro,Re,null),e(Re,Xi),M(lo,Re,null),p(o,ja,_),p(o,Ut,_),e(Ut,io),e(io,Zs),M(dn,Zs,null),e(Ut,Ei),e(Ut,Ps),e(Ps,Fi),p(o,Ja,_),p(o,Me,_),M(cn,Me,null),e(Me,Ci),e(Me,Ss),e(Ss,zi),e(Me,ji),e(Me,fn),e(fn,Ji),e(fn,Yn),e(Yn,Ii),e(fn,Ni),e(Me,qi),e(Me,mn),e(mn,Ui),e(mn,hn),e(hn,Wi),e(mn,Zi),e(Me,Pi),M(co,Me,null),e(Me,Si),e(Me,mt),M(pn,mt,null),e(mt,Hi),e(mt,Wt),e(Wt,Ai),e(Wt,Qn),e(Qn,Vi),e(Wt,Bi),e(Wt,Hs),e(Hs,Ri),e(Wt,Gi),e(mt,Oi),M(fo,mt,null),e(mt,Di),M(mo,mt,null),p(o,Ia,_),p(o,Zt,_),e(Zt,ho),e(ho,As),M(un,As,null),e(Zt,Yi),e(Zt,Vs),e(Vs,Qi),p(o,Na,_),p(o,$e,_),M(gn,$e,null),e($e,Ki),e($e,Bs),e(Bs,ed),e($e,td),e($e,_n),e(_n,od),e(_n,Kn),e(Kn,nd),e(_n,sd),e($e,ad),e($e,Tn),e(Tn,rd),e(Tn,bn),e(bn,ld),e(Tn,id),e($e,dd),M(po,$e,null),e($e,cd),e($e,ht),M(vn,ht,null),e(ht,fd),e(ht,Pt),e(Pt,md),e(Pt,es),e(es,hd),e(Pt,pd),e(Pt,Rs),e(Rs,ud),e(Pt,gd),e(ht,_d),M(uo,ht,null),e(ht,Td),M(go,ht,null),p(o,qa,_),p(o,St,_),e(St,_o),e(_o,Gs),M(yn,Gs,null),e(St,bd),e(St,Os),e(Os,vd),p(o,Ua,_),p(o,se,_),M(wn,se,null),e(se,yd),e(se,Ds),e(Ds,wd),e(se,Md),e(se,ts),e(ts,os),e(os,$d),e(ts,kd),e(se,Ld),e(se,tt),e(tt,xd),e(tt,Ys),e(Ys,Xd),e(tt,Ed),e(tt,Qs),e(Qs,Fd),e(tt,Cd),e(tt,Ks),e(Ks,zd),e(tt,jd),e(tt,ea),e(ea,Jd),e(tt,Id),e(se,Nd),e(se,Mn),e(Mn,qd),e(Mn,ns),e(ns,Ud),e(Mn,Wd),e(se,Zd),e(se,$n),e($n,Pd),e($n,kn),e(kn,Sd),e($n,Hd),e(se,Ad),M(To,se,null),e(se,Vd),e(se,Ge),M(Ln,Ge,null),e(Ge,Bd),e(Ge,Ht),e(Ht,Rd),e(Ht,ss),e(ss,Gd),e(Ht,Od),e(Ht,ta),e(ta,Dd),e(Ht,Yd),e(Ge,Qd),M(bo,Ge,null),e(Ge,Kd),M(vo,Ge,null),e(Ge,ec),M(yo,Ge,null),p(o,Wa,_),p(o,At,_),e(At,wo),e(wo,oa),M(xn,oa,null),e(At,tc),e(At,na),e(na,oc),p(o,Za,_),p(o,Xn,_),M(En,Xn,null),p(o,Pa,_),p(o,Fn,_),M(Cn,Fn,null),Sa=!0},p(o,[_]){const zn={};_&2&&(zn.$$scope={dirty:_,ctx:o}),ye.$set(zn);const sa={};_&2&&(sa.$$scope={dirty:_,ctx:o}),Ot.$set(sa);const aa={};_&2&&(aa.$$scope={dirty:_,ctx:o}),Kt.$set(aa);const ra={};_&2&&(ra.$$scope={dirty:_,ctx:o}),eo.$set(ra);const jn={};_&2&&(jn.$$scope={dirty:_,ctx:o}),oo.$set(jn);const la={};_&2&&(la.$$scope={dirty:_,ctx:o}),no.$set(la);const ia={};_&2&&(ia.$$scope={dirty:_,ctx:o}),ao.$set(ia);const Jn={};_&2&&(Jn.$$scope={dirty:_,ctx:o}),ro.$set(Jn);const da={};_&2&&(da.$$scope={dirty:_,ctx:o}),lo.$set(da);const ca={};_&2&&(ca.$$scope={dirty:_,ctx:o}),co.$set(ca);const fa={};_&2&&(fa.$$scope={dirty:_,ctx:o}),fo.$set(fa);const In={};_&2&&(In.$$scope={dirty:_,ctx:o}),mo.$set(In);const ma={};_&2&&(ma.$$scope={dirty:_,ctx:o}),po.$set(ma);const ha={};_&2&&(ha.$$scope={dirty:_,ctx:o}),uo.$set(ha);const pa={};_&2&&(pa.$$scope={dirty:_,ctx:o}),go.$set(pa);const ua={};_&2&&(ua.$$scope={dirty:_,ctx:o}),To.$set(ua);const ga={};_&2&&(ga.$$scope={dirty:_,ctx:o}),bo.$set(ga);const ot={};_&2&&(ot.$$scope={dirty:_,ctx:o}),vo.$set(ot);const _a={};_&2&&(_a.$$scope={dirty:_,ctx:o}),yo.$set(_a)},i(o){Sa||($(i.$$.fragment,o),$(de.$$.fragment,o),$(ye.$$.fragment,o),$(Xe.$$.fragment,o),$(Fo.$$.fragment,o),$(Co.$$.fragment,o),$(Ot.$$.fragment,o),$(jo.$$.fragment,o),$(Jo.$$.fragment,o),$(Uo.$$.fragment,o),$(Wo.$$.fragment,o),$(Zo.$$.fragment,o),$(Po.$$.fragment,o),$(So.$$.fragment,o),$(Ho.$$.fragment,o),$(Ao.$$.fragment,o),$(Vo.$$.fragment,o),$(Oo.$$.fragment,o),$(Kt.$$.fragment,o),$(eo.$$.fragment,o),$(Do.$$.fragment,o),$(Yo.$$.fragment,o),$(tn.$$.fragment,o),$(oo.$$.fragment,o),$(no.$$.fragment,o),$(on.$$.fragment,o),$(nn.$$.fragment,o),$(ln.$$.fragment,o),$(ao.$$.fragment,o),$(ro.$$.fragment,o),$(lo.$$.fragment,o),$(dn.$$.fragment,o),$(cn.$$.fragment,o),$(co.$$.fragment,o),$(pn.$$.fragment,o),$(fo.$$.fragment,o),$(mo.$$.fragment,o),$(un.$$.fragment,o),$(gn.$$.fragment,o),$(po.$$.fragment,o),$(vn.$$.fragment,o),$(uo.$$.fragment,o),$(go.$$.fragment,o),$(yn.$$.fragment,o),$(wn.$$.fragment,o),$(To.$$.fragment,o),$(Ln.$$.fragment,o),$(bo.$$.fragment,o),$(vo.$$.fragment,o),$(yo.$$.fragment,o),$(xn.$$.fragment,o),$(En.$$.fragment,o),$(Cn.$$.fragment,o),Sa=!0)},o(o){k(i.$$.fragment,o),k(de.$$.fragment,o),k(ye.$$.fragment,o),k(Xe.$$.fragment,o),k(Fo.$$.fragment,o),k(Co.$$.fragment,o),k(Ot.$$.fragment,o),k(jo.$$.fragment,o),k(Jo.$$.fragment,o),k(Uo.$$.fragment,o),k(Wo.$$.fragment,o),k(Zo.$$.fragment,o),k(Po.$$.fragment,o),k(So.$$.fragment,o),k(Ho.$$.fragment,o),k(Ao.$$.fragment,o),k(Vo.$$.fragment,o),k(Oo.$$.fragment,o),k(Kt.$$.fragment,o),k(eo.$$.fragment,o),k(Do.$$.fragment,o),k(Yo.$$.fragment,o),k(tn.$$.fragment,o),k(oo.$$.fragment,o),k(no.$$.fragment,o),k(on.$$.fragment,o),k(nn.$$.fragment,o),k(ln.$$.fragment,o),k(ao.$$.fragment,o),k(ro.$$.fragment,o),k(lo.$$.fragment,o),k(dn.$$.fragment,o),k(cn.$$.fragment,o),k(co.$$.fragment,o),k(pn.$$.fragment,o),k(fo.$$.fragment,o),k(mo.$$.fragment,o),k(un.$$.fragment,o),k(gn.$$.fragment,o),k(po.$$.fragment,o),k(vn.$$.fragment,o),k(uo.$$.fragment,o),k(go.$$.fragment,o),k(yn.$$.fragment,o),k(wn.$$.fragment,o),k(To.$$.fragment,o),k(Ln.$$.fragment,o),k(bo.$$.fragment,o),k(vo.$$.fragment,o),k(yo.$$.fragment,o),k(xn.$$.fragment,o),k(En.$$.fragment,o),k(Cn.$$.fragment,o),Sa=!1},d(o){t(d),o&&t(v),o&&t(u),L(i),o&&t(re),o&&t(j),o&&t(Y),o&&t(ee),L(de),o&&t(ke),o&&t(Z),o&&t(N),o&&t(ue),o&&t(Le),o&&t(ge),o&&t(xe),o&&t(J),o&&t(Q),o&&t(P),o&&t(T),o&&t(X),o&&t(De),L(ye,o),o&&t(Ye),o&&t(q),L(Xe),o&&t(Ee),o&&t(we),o&&t(Ta),o&&t($t),L(Fo),o&&t(ba),o&&t(Qe),L(Co),L(Ot),o&&t(va),o&&t(Lt),L(jo),o&&t(ya),o&&t(Ke),L(Jo),L(Uo),o&&t(wa),o&&t(xt),L(Wo),o&&t(Ma),o&&t(Xt),L(Zo),o&&t($a),o&&t(Et),L(Po),o&&t(ka),o&&t(Ft),L(So),o&&t(La),o&&t(Ct),L(Ho),o&&t(xa),o&&t(zt),L(Ao),o&&t(Xa),o&&t(Se),L(Vo),L(Oo),L(Kt),L(eo),o&&t(Ea),o&&t(Jt),L(Do),o&&t(Fa),o&&t(He),L(Yo),L(tn),L(oo),L(no),o&&t(Ca),o&&t(Nt),L(on),o&&t(za),o&&t(fe),L(nn),L(ln),L(ao),L(ro),L(lo),o&&t(ja),o&&t(Ut),L(dn),o&&t(Ja),o&&t(Me),L(cn),L(co),L(pn),L(fo),L(mo),o&&t(Ia),o&&t(Zt),L(un),o&&t(Na),o&&t($e),L(gn),L(po),L(vn),L(uo),L(go),o&&t(qa),o&&t(St),L(yn),o&&t(Ua),o&&t(se),L(wn),L(To),L(Ln),L(bo),L(vo),L(yo),o&&t(Wa),o&&t(At),L(xn),o&&t(Za),o&&t(Xn),L(En),o&&t(Pa),o&&t(Fn),L(Cn)}}}const ym={local:"transformer-xl",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{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 wm(C){return em(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Em extends Df{constructor(d){super();Yf(this,d,wm,vm,Qf,{})}}export{Em as default,ym as metadata};
