import{s as Ct,o as Ft,n as he}from"../chunks/scheduler.9bc65507.js";import{S as zt,i as jt,g as c,s as r,r as v,A as Jt,h as m,f as s,c as l,j as ee,u as y,x as _,k as Q,y as d,a as i,v as M,d as w,t as $,w as x}from"../chunks/index.707bf1b6.js";import{T as it}from"../chunks/Tip.c2ecdbf4.js";import{D as de}from"../chunks/Docstring.17db21ae.js";import{C as ft}from"../chunks/CodeBlock.54a9f38d.js";import{F as Ht,M as Xt}from"../chunks/Markdown.fef84341.js";import{E as ut}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{H as Pe}from"../chunks/Heading.342b1fa6.js";function Ut(k){let e,u="This model is in maintenance mode only, so we won’t accept any new PRs changing its code. This model was deprecated due to security issues linked to <code>pickle.load</code>.",t,a,T="We recommend switching to more recent models for improved security.",o,g,S='In case you would still like to use <code>TransfoXL</code> in your experiments, we recommend using the <a href="https://huggingface.co/transfo-xl/transfo-xl-wt103" rel="nofollow">Hub checkpoint</a> with a specific revision to ensure you are downloading safe files from the Hub.',z,H,Y=`You will need to set the environment variable <code>TRUST_REMOTE_CODE</code> to <code>True</code> in order to allow the
usage of <code>pickle.load()</code>:`,J,j,Z,f,X=`If you run into any issues running this model, please reinstall the last version that supported this model: v4.35.0.
You can do so by running the following command: <code>pip install -U transformers==4.35.0</code>.`,N;return j=new ft({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwVHJhbnNmb1hMVG9rZW5pemVyJTJDJTIwVHJhbnNmb1hMTE1IZWFkTW9kZWwlMEElMEFvcy5lbnZpcm9uJTVCJTIyVFJVU1RfUkVNT1RFX0NPREUlMjIlNUQlMjAlM0QlMjAlMjJUcnVlJTIyJTBBJTBBY2hlY2twb2ludCUyMCUzRCUyMCd0cmFuc2ZvLXhsJTJGdHJhbnNmby14bC13dDEwMyclMEFyZXZpc2lvbiUyMCUzRCUyMCc0MGExODZkYTc5NDU4YzlmOWRlODQ2ZWRmYWVhNzljNDEyMTM3Zjk3JyUwQSUwQXRva2VuaXplciUyMCUzRCUyMFRyYW5zZm9YTFRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCUyQyUyMHJldmlzaW9uJTNEcmV2aXNpb24pJTBBbW9kZWwlMjAlM0QlMjBUcmFuc2ZvWExMTUhlYWRNb2RlbC5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCUyQyUyMHJldmlzaW9uJTNEcmV2aXNpb24p",highlighted:`<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TransfoXLTokenizer, TransfoXLLMHeadModel

os.environ[<span class="hljs-string">&quot;TRUST_REMOTE_CODE&quot;</span>] = <span class="hljs-string">&quot;True&quot;</span>

checkpoint = <span class="hljs-string">&#x27;transfo-xl/transfo-xl-wt103&#x27;</span>
revision = <span class="hljs-string">&#x27;40a186da79458c9f9de846edfaea79c412137f97&#x27;</span>

tokenizer = TransfoXLTokenizer.from_pretrained(checkpoint, revision=revision)
model = TransfoXLLMHeadModel.from_pretrained(checkpoint, revision=revision)`,wrap:!1}}),{c(){e=c("p"),e.innerHTML=u,t=r(),a=c("p"),a.textContent=T,o=r(),g=c("p"),g.innerHTML=S,z=r(),H=c("p"),H.innerHTML=Y,J=r(),v(j.$$.fragment),Z=r(),f=c("p"),f.innerHTML=X},l(C){e=m(C,"P",{"data-svelte-h":!0}),_(e)!=="svelte-1blbnop"&&(e.innerHTML=u),t=l(C),a=m(C,"P",{"data-svelte-h":!0}),_(a)!=="svelte-1lx88qw"&&(a.textContent=T),o=l(C),g=m(C,"P",{"data-svelte-h":!0}),_(g)!=="svelte-w1zh7q"&&(g.innerHTML=S),z=l(C),H=m(C,"P",{"data-svelte-h":!0}),_(H)!=="svelte-e2fsys"&&(H.innerHTML=Y),J=l(C),y(j.$$.fragment,C),Z=l(C),f=m(C,"P",{"data-svelte-h":!0}),_(f)!=="svelte-2p1oiw"&&(f.innerHTML=X)},m(C,D){i(C,e,D),i(C,t,D),i(C,a,D),i(C,o,D),i(C,g,D),i(C,z,D),i(C,H,D),i(C,J,D),M(j,C,D),i(C,Z,D),i(C,f,D),N=!0},p:he,i(C){N||(w(j.$$.fragment,C),N=!0)},o(C){$(j.$$.fragment,C),N=!1},d(C){C&&(s(e),s(t),s(a),s(o),s(g),s(z),s(H),s(J),s(Z),s(f)),x(j,C)}}}function qt(k){let e,u='TransformerXL does <strong>not</strong> work with <em>torch.nn.DataParallel</em> due to a bug in PyTorch, see <a href="https://github.com/pytorch/pytorch/issues/36035" rel="nofollow">issue #36035</a>';return{c(){e=c("p"),e.innerHTML=u},l(t){e=m(t,"P",{"data-svelte-h":!0}),_(e)!=="svelte-17chyfm"&&(e.innerHTML=u)},m(t,a){i(t,e,a)},p:he,d(t){t&&s(e)}}}function Wt(k){let e,u="Examples:",t,a,T;return a=new ft({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`,wrap:!1}}),{c(){e=c("p"),e.textContent=u,t=r(),v(a.$$.fragment)},l(o){e=m(o,"P",{"data-svelte-h":!0}),_(e)!=="svelte-kvfsh7"&&(e.textContent=u),t=l(o),y(a.$$.fragment,o)},m(o,g){i(o,e,g),i(o,t,g),M(a,o,g),T=!0},p:he,i(o){T||(w(a.$$.fragment,o),T=!0)},o(o){$(a.$$.fragment,o),T=!1},d(o){o&&(s(e),s(t)),x(a,o)}}}function Zt(k){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=c("p"),e.innerHTML=u},l(t){e=m(t,"P",{"data-svelte-h":!0}),_(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(t,a){i(t,e,a)},p:he,d(t){t&&s(e)}}}function Nt(k){let e,u="Example:",t,a,T;return a=new ft({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBUcmFuc2ZvWExNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydHJhbnNmby14bCUyRnRyYW5zZm8teGwtd3QxMDMlMjIpJTBBbW9kZWwlMjAlM0QlMjBUcmFuc2ZvWExNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIydHJhbnNmby14bCUyRnRyYW5zZm8teGwtd3QxMDMlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",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/transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLModel.from_pretrained(<span class="hljs-string">&quot;transfo-xl/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`,wrap:!1}}),{c(){e=c("p"),e.textContent=u,t=r(),v(a.$$.fragment)},l(o){e=m(o,"P",{"data-svelte-h":!0}),_(e)!=="svelte-11lpom8"&&(e.textContent=u),t=l(o),y(a.$$.fragment,o)},m(o,g){i(o,e,g),i(o,t,g),M(a,o,g),T=!0},p:he,i(o){T||(w(a.$$.fragment,o),T=!0)},o(o){$(a.$$.fragment,o),T=!1},d(o){o&&(s(e),s(t)),x(a,o)}}}function It(k){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=c("p"),e.innerHTML=u},l(t){e=m(t,"P",{"data-svelte-h":!0}),_(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(t,a){i(t,e,a)},p:he,d(t){t&&s(e)}}}function Rt(k){let e,u="Example:",t,a,T;return a=new ft({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMFRyYW5zZm9YTExNSGVhZE1vZGVsJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydHJhbnNmby14bCUyRnRyYW5zZm8teGwtd3QxMDMlMjIpJTBBbW9kZWwlMjAlM0QlMjBUcmFuc2ZvWExMTUhlYWRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIydHJhbnNmby14bCUyRnRyYW5zZm8teGwtd3QxMDMlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCklMEFsb3NzJTIwJTNEJTIwb3V0cHV0cy5sb3NzJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHM=",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/transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLLMHeadModel.from_pretrained(<span class="hljs-string">&quot;transfo-xl/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`,wrap:!1}}),{c(){e=c("p"),e.textContent=u,t=r(),v(a.$$.fragment)},l(o){e=m(o,"P",{"data-svelte-h":!0}),_(e)!=="svelte-11lpom8"&&(e.textContent=u),t=l(o),y(a.$$.fragment,o)},m(o,g){i(o,e,g),i(o,t,g),M(a,o,g),T=!0},p:he,i(o){T||(w(a.$$.fragment,o),T=!0)},o(o){$(a.$$.fragment,o),T=!1},d(o){o&&(s(e),s(t)),x(a,o)}}}function Bt(k){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=c("p"),e.innerHTML=u},l(t){e=m(t,"P",{"data-svelte-h":!0}),_(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(t,a){i(t,e,a)},p:he,d(t){t&&s(e)}}}function Et(k){let e,u="Example of single-label classification:",t,a,T;return a=new ft({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMFRyYW5zZm9YTEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0cmFuc2ZvLXhsJTJGdHJhbnNmby14bC13dDEwMyUyMiklMEFtb2RlbCUyMCUzRCUyMFRyYW5zZm9YTEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMnRyYW5zZm8teGwlMkZ0cmFuc2ZvLXhsLXd0MTAzJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF9jbGFzc19pZCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoKS5pdGVtKCklMEElMEElMjMlMjBUbyUyMHRyYWluJTIwYSUyMG1vZGVsJTIwb24lMjAlNjBudW1fbGFiZWxzJTYwJTIwY2xhc3NlcyUyQyUyMHlvdSUyMGNhbiUyMHBhc3MlMjAlNjBudW1fbGFiZWxzJTNEbnVtX2xhYmVscyU2MCUyMHRvJTIwJTYwLmZyb21fcHJldHJhaW5lZCguLi4pJTYwJTBBbnVtX2xhYmVscyUyMCUzRCUyMGxlbihtb2RlbC5jb25maWcuaWQybGFiZWwpJTBBbW9kZWwlMjAlM0QlMjBUcmFuc2ZvWExGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ0cmFuc2ZvLXhsJTJGdHJhbnNmby14bC13dDEwMyUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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/transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;transfo-xl/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/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`,wrap:!1}}),{c(){e=c("p"),e.textContent=u,t=r(),v(a.$$.fragment)},l(o){e=m(o,"P",{"data-svelte-h":!0}),_(e)!=="svelte-ykxpe4"&&(e.textContent=u),t=l(o),y(a.$$.fragment,o)},m(o,g){i(o,e,g),i(o,t,g),M(a,o,g),T=!0},p:he,i(o){T||(w(a.$$.fragment,o),T=!0)},o(o){$(a.$$.fragment,o),T=!1},d(o){o&&(s(e),s(t)),x(a,o)}}}function Gt(k){let e,u="Example of multi-label classification:",t,a,T;return a=new ft({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMFRyYW5zZm9YTEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0cmFuc2ZvLXhsJTJGdHJhbnNmby14bC13dDEwMyUyMiklMEFtb2RlbCUyMCUzRCUyMFRyYW5zZm9YTEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMnRyYW5zZm8teGwlMkZ0cmFuc2ZvLXhsLXd0MTAzJTIyJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkcyUyMCUzRCUyMHRvcmNoLmFyYW5nZSgwJTJDJTIwbG9naXRzLnNoYXBlJTVCLTElNUQpJTVCdG9yY2guc2lnbW9pZChsb2dpdHMpLnNxdWVlemUoZGltJTNEMCklMjAlM0UlMjAwLjUlNUQlMEElMEElMjMlMjBUbyUyMHRyYWluJTIwYSUyMG1vZGVsJTIwb24lMjAlNjBudW1fbGFiZWxzJTYwJTIwY2xhc3NlcyUyQyUyMHlvdSUyMGNhbiUyMHBhc3MlMjAlNjBudW1fbGFiZWxzJTNEbnVtX2xhYmVscyU2MCUyMHRvJTIwJTYwLmZyb21fcHJldHJhaW5lZCguLi4pJTYwJTBBbnVtX2xhYmVscyUyMCUzRCUyMGxlbihtb2RlbC5jb25maWcuaWQybGFiZWwpJTBBbW9kZWwlMjAlM0QlMjBUcmFuc2ZvWExGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJ0cmFuc2ZvLXhsJTJGdHJhbnNmby14bC13dDEwMyUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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/transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TransfoXLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;transfo-xl/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/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`,wrap:!1}}),{c(){e=c("p"),e.textContent=u,t=r(),v(a.$$.fragment)},l(o){e=m(o,"P",{"data-svelte-h":!0}),_(e)!=="svelte-1l8e32d"&&(e.textContent=u),t=l(o),y(a.$$.fragment,o)},m(o,g){i(o,e,g),i(o,t,g),M(a,o,g),T=!0},p:he,i(o){T||(w(a.$$.fragment,o),T=!0)},o(o){$(a.$$.fragment,o),T=!1},d(o){o&&(s(e),s(t)),x(a,o)}}}function Vt(k){let e,u,t,a,T,o,g="The bare Bert Model transformer outputting raw hidden-states without any specific head on top.",S,z,H=`This model inherits from <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</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.)`,Y,J,j=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Z,f,X,N,C,D='The <a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLModel">TransfoXLModel</a> forward method, overrides the <code>__call__</code> special method.',be,Ne,et,E,ot,se,xe,I,ce,O,ge,je=`The Transformer-XL Model with a language modeling head on top (adaptive softmax with weights tied to the adaptive
input embeddings)`,Je,Le,st=`This model inherits from <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</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.)`,ve,tt,at=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,ye,me,G,fe,Ie,te='The <a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLLMHeadModel">TransfoXLLMHeadModel</a> forward method, overrides the <code>__call__</code> special method.',Re,Fe,ke,Be,nt,V,Se,U,Xe,P,_e,R="The Transformer-XL Model transformer with a sequence classification head on top (linear layer).",Me,Ye,Oe=`<a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLForSequenceClassification">TransfoXLForSequenceClassification</a> uses the last token in order to do the classification, as other causal
models (e.g. GPT-1) do.`,Ae,Qe,De=`Since it does classification on the last token, it requires to know the position of the last token. If a
<code>pad_token_id</code> is defined in the configuration, it finds the last token that is not a padding token in each row. If
no <code>pad_token_id</code> is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when <code>inputs_embeds</code> are passed instead of <code>input_ids</code>, it does the same (take the last value in
each row of the batch).`,Ke,we,Ee=`This model inherits from <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</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.)`,Ge,He,Te=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Ve,ne,ae,pt,Ue,re='The <a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLForSequenceClassification">TransfoXLForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',qe,B,$e,We,Ze,le,ze;return e=new Pe({props:{title:"TransfoXLModel",local:"transformers.TransfoXLModel",headingTag:"h2"}}),a=new de({props:{name:"class transformers.TransfoXLModel",anchor:"transformers.TransfoXLModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.TransfoXLModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py#L760"}}),X=new de({props:{name:"forward",anchor:"transformers.TransfoXLModel.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"mems",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.TransfoXLModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TransfoXLModel.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TransfoXLModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TransfoXLModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TransfoXLModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TransfoXLModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TransfoXLModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.39.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py#L867",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput"
>transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput"
>transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ne=new it({props:{$$slots:{default:[Zt]},$$scope:{ctx:k}}}),E=new ut({props:{anchor:"transformers.TransfoXLModel.forward.example",$$slots:{default:[Nt]},$$scope:{ctx:k}}}),se=new Pe({props:{title:"TransfoXLLMHeadModel",local:"transformers.TransfoXLLMHeadModel",headingTag:"h2"}}),ce=new de({props:{name:"class transformers.TransfoXLLMHeadModel",anchor:"transformers.TransfoXLLMHeadModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.TransfoXLLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py#L999"}}),G=new de({props:{name:"forward",anchor:"transformers.TransfoXLLMHeadModel.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"mems",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.TransfoXLLMHeadModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TransfoXLLMHeadModel.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TransfoXLLMHeadModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TransfoXLLMHeadModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TransfoXLLMHeadModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TransfoXLLMHeadModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TransfoXLLMHeadModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.39.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TransfoXLLMHeadModel.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for language modeling. Note that the labels <strong>are shifted</strong> inside the model, i.e. you can set
<code>labels = input_ids</code> Indices are selected in <code>[-100, 0, ..., config.vocab_size]</code> All labels set to <code>-100</code>
are ignored (masked), the loss is only computed for labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py#L1062",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput"
>transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>losses</strong> (<code>torch.FloatTensor</code> of shape <em>(batch_size, sequence_length-1)</em>, <em>optional</em>, returned when <code>labels</code> is provided) — 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>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput"
>transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fe=new it({props:{$$slots:{default:[It]},$$scope:{ctx:k}}}),Be=new ut({props:{anchor:"transformers.TransfoXLLMHeadModel.forward.example",$$slots:{default:[Rt]},$$scope:{ctx:k}}}),V=new Pe({props:{title:"TransfoXLForSequenceClassification",local:"transformers.TransfoXLForSequenceClassification",headingTag:"h2"}}),Xe=new de({props:{name:"class transformers.TransfoXLForSequenceClassification",anchor:"transformers.TransfoXLForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.TransfoXLForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py#L1179"}}),ae=new de({props:{name:"forward",anchor:"transformers.TransfoXLForSequenceClassification.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"mems",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.TransfoXLForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.39.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TransfoXLForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py#L1203",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLSequenceClassifierOutputWithPast</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — 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>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLSequenceClassifierOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),B=new it({props:{$$slots:{default:[Bt]},$$scope:{ctx:k}}}),We=new ut({props:{anchor:"transformers.TransfoXLForSequenceClassification.forward.example",$$slots:{default:[Et]},$$scope:{ctx:k}}}),le=new ut({props:{anchor:"transformers.TransfoXLForSequenceClassification.forward.example-2",$$slots:{default:[Gt]},$$scope:{ctx:k}}}),{c(){v(e.$$.fragment),u=r(),t=c("div"),v(a.$$.fragment),T=r(),o=c("p"),o.textContent=g,S=r(),z=c("p"),z.innerHTML=H,Y=r(),J=c("p"),J.innerHTML=j,Z=r(),f=c("div"),v(X.$$.fragment),N=r(),C=c("p"),C.innerHTML=D,be=r(),v(Ne.$$.fragment),et=r(),v(E.$$.fragment),ot=r(),v(se.$$.fragment),xe=r(),I=c("div"),v(ce.$$.fragment),O=r(),ge=c("p"),ge.textContent=je,Je=r(),Le=c("p"),Le.innerHTML=st,ve=r(),tt=c("p"),tt.innerHTML=at,ye=r(),me=c("div"),v(G.$$.fragment),fe=r(),Ie=c("p"),Ie.innerHTML=te,Re=r(),v(Fe.$$.fragment),ke=r(),v(Be.$$.fragment),nt=r(),v(V.$$.fragment),Se=r(),U=c("div"),v(Xe.$$.fragment),P=r(),_e=c("p"),_e.textContent=R,Me=r(),Ye=c("p"),Ye.innerHTML=Oe,Ae=r(),Qe=c("p"),Qe.innerHTML=De,Ke=r(),we=c("p"),we.innerHTML=Ee,Ge=r(),He=c("p"),He.innerHTML=Te,Ve=r(),ne=c("div"),v(ae.$$.fragment),pt=r(),Ue=c("p"),Ue.innerHTML=re,qe=r(),v(B.$$.fragment),$e=r(),v(We.$$.fragment),Ze=r(),v(le.$$.fragment),this.h()},l(h){y(e.$$.fragment,h),u=l(h),t=m(h,"DIV",{class:!0});var F=ee(t);y(a.$$.fragment,F),T=l(F),o=m(F,"P",{"data-svelte-h":!0}),_(o)!=="svelte-1n9fdqw"&&(o.textContent=g),S=l(F),z=m(F,"P",{"data-svelte-h":!0}),_(z)!=="svelte-1t3ln5c"&&(z.innerHTML=H),Y=l(F),J=m(F,"P",{"data-svelte-h":!0}),_(J)!=="svelte-hswkmf"&&(J.innerHTML=j),Z=l(F),f=m(F,"DIV",{class:!0});var K=ee(f);y(X.$$.fragment,K),N=l(K),C=m(K,"P",{"data-svelte-h":!0}),_(C)!=="svelte-1ka7ach"&&(C.innerHTML=D),be=l(K),y(Ne.$$.fragment,K),et=l(K),y(E.$$.fragment,K),K.forEach(s),F.forEach(s),ot=l(h),y(se.$$.fragment,h),xe=l(h),I=m(h,"DIV",{class:!0});var oe=ee(I);y(ce.$$.fragment,oe),O=l(oe),ge=m(oe,"P",{"data-svelte-h":!0}),_(ge)!=="svelte-117cpg6"&&(ge.textContent=je),Je=l(oe),Le=m(oe,"P",{"data-svelte-h":!0}),_(Le)!=="svelte-1t3ln5c"&&(Le.innerHTML=st),ve=l(oe),tt=m(oe,"P",{"data-svelte-h":!0}),_(tt)!=="svelte-hswkmf"&&(tt.innerHTML=at),ye=l(oe),me=m(oe,"DIV",{class:!0});var q=ee(me);y(G.$$.fragment,q),fe=l(q),Ie=m(q,"P",{"data-svelte-h":!0}),_(Ie)!=="svelte-1mjod6j"&&(Ie.innerHTML=te),Re=l(q),y(Fe.$$.fragment,q),ke=l(q),y(Be.$$.fragment,q),q.forEach(s),oe.forEach(s),nt=l(h),y(V.$$.fragment,h),Se=l(h),U=m(h,"DIV",{class:!0});var W=ee(U);y(Xe.$$.fragment,W),P=l(W),_e=m(W,"P",{"data-svelte-h":!0}),_(_e)!=="svelte-1yst0e0"&&(_e.textContent=R),Me=l(W),Ye=m(W,"P",{"data-svelte-h":!0}),_(Ye)!=="svelte-1ql2umh"&&(Ye.innerHTML=Oe),Ae=l(W),Qe=m(W,"P",{"data-svelte-h":!0}),_(Qe)!=="svelte-10ugs3m"&&(Qe.innerHTML=De),Ke=l(W),we=m(W,"P",{"data-svelte-h":!0}),_(we)!=="svelte-1t3ln5c"&&(we.innerHTML=Ee),Ge=l(W),He=m(W,"P",{"data-svelte-h":!0}),_(He)!=="svelte-hswkmf"&&(He.innerHTML=Te),Ve=l(W),ne=m(W,"DIV",{class:!0});var p=ee(ne);y(ae.$$.fragment,p),pt=l(p),Ue=m(p,"P",{"data-svelte-h":!0}),_(Ue)!=="svelte-vcdcqf"&&(Ue.innerHTML=re),qe=l(p),y(B.$$.fragment,p),$e=l(p),y(We.$$.fragment,p),Ze=l(p),y(le.$$.fragment,p),p.forEach(s),W.forEach(s),this.h()},h(){Q(f,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(h,F){M(e,h,F),i(h,u,F),i(h,t,F),M(a,t,null),d(t,T),d(t,o),d(t,S),d(t,z),d(t,Y),d(t,J),d(t,Z),d(t,f),M(X,f,null),d(f,N),d(f,C),d(f,be),M(Ne,f,null),d(f,et),M(E,f,null),i(h,ot,F),M(se,h,F),i(h,xe,F),i(h,I,F),M(ce,I,null),d(I,O),d(I,ge),d(I,Je),d(I,Le),d(I,ve),d(I,tt),d(I,ye),d(I,me),M(G,me,null),d(me,fe),d(me,Ie),d(me,Re),M(Fe,me,null),d(me,ke),M(Be,me,null),i(h,nt,F),M(V,h,F),i(h,Se,F),i(h,U,F),M(Xe,U,null),d(U,P),d(U,_e),d(U,Me),d(U,Ye),d(U,Ae),d(U,Qe),d(U,Ke),d(U,we),d(U,Ge),d(U,He),d(U,Ve),d(U,ne),M(ae,ne,null),d(ne,pt),d(ne,Ue),d(ne,qe),M(B,ne,null),d(ne,$e),M(We,ne,null),d(ne,Ze),M(le,ne,null),ze=!0},p(h,F){const K={};F&2&&(K.$$scope={dirty:F,ctx:h}),Ne.$set(K);const oe={};F&2&&(oe.$$scope={dirty:F,ctx:h}),E.$set(oe);const q={};F&2&&(q.$$scope={dirty:F,ctx:h}),Fe.$set(q);const W={};F&2&&(W.$$scope={dirty:F,ctx:h}),Be.$set(W);const p={};F&2&&(p.$$scope={dirty:F,ctx:h}),B.$set(p);const L={};F&2&&(L.$$scope={dirty:F,ctx:h}),We.$set(L);const Ce={};F&2&&(Ce.$$scope={dirty:F,ctx:h}),le.$set(Ce)},i(h){ze||(w(e.$$.fragment,h),w(a.$$.fragment,h),w(X.$$.fragment,h),w(Ne.$$.fragment,h),w(E.$$.fragment,h),w(se.$$.fragment,h),w(ce.$$.fragment,h),w(G.$$.fragment,h),w(Fe.$$.fragment,h),w(Be.$$.fragment,h),w(V.$$.fragment,h),w(Xe.$$.fragment,h),w(ae.$$.fragment,h),w(B.$$.fragment,h),w(We.$$.fragment,h),w(le.$$.fragment,h),ze=!0)},o(h){$(e.$$.fragment,h),$(a.$$.fragment,h),$(X.$$.fragment,h),$(Ne.$$.fragment,h),$(E.$$.fragment,h),$(se.$$.fragment,h),$(ce.$$.fragment,h),$(G.$$.fragment,h),$(Fe.$$.fragment,h),$(Be.$$.fragment,h),$(V.$$.fragment,h),$(Xe.$$.fragment,h),$(ae.$$.fragment,h),$(B.$$.fragment,h),$(We.$$.fragment,h),$(le.$$.fragment,h),ze=!1},d(h){h&&(s(u),s(t),s(ot),s(xe),s(I),s(nt),s(Se),s(U)),x(e,h),x(a),x(X),x(Ne),x(E),x(se,h),x(ce),x(G),x(Fe),x(Be),x(V,h),x(Xe),x(ae),x(B),x(We),x(le)}}}function Pt(k){let e,u;return e=new Xt({props:{$$slots:{default:[Vt]},$$scope:{ctx:k}}}),{c(){v(e.$$.fragment)},l(t){y(e.$$.fragment,t)},m(t,a){M(e,t,a),u=!0},p(t,a){const T={};a&2&&(T.$$scope={dirty:a,ctx:t}),e.$set(T)},i(t){u||(w(e.$$.fragment,t),u=!0)},o(t){$(e.$$.fragment,t),u=!1},d(t){x(e,t)}}}function St(k){let e,u="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",t,a,T="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional argument.</li>",o,g,S=`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 <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,z,H,Y=`<li>a single Tensor with <code>input_ids</code> only and nothing else: <code>model(input_ids)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([input_ids, attention_mask])</code> or <code>model([input_ids, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;input_ids&quot;: input_ids, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,J,j,Z=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){e=c("p"),e.innerHTML=u,t=r(),a=c("ul"),a.innerHTML=T,o=r(),g=c("p"),g.innerHTML=S,z=r(),H=c("ul"),H.innerHTML=Y,J=r(),j=c("p"),j.innerHTML=Z},l(f){e=m(f,"P",{"data-svelte-h":!0}),_(e)!=="svelte-1ajbfxg"&&(e.innerHTML=u),t=l(f),a=m(f,"UL",{"data-svelte-h":!0}),_(a)!=="svelte-qm1t26"&&(a.innerHTML=T),o=l(f),g=m(f,"P",{"data-svelte-h":!0}),_(g)!=="svelte-1v9qsc5"&&(g.innerHTML=S),z=l(f),H=m(f,"UL",{"data-svelte-h":!0}),_(H)!=="svelte-15scerc"&&(H.innerHTML=Y),J=l(f),j=m(f,"P",{"data-svelte-h":!0}),_(j)!=="svelte-1an3odd"&&(j.innerHTML=Z)},m(f,X){i(f,e,X),i(f,t,X),i(f,a,X),i(f,o,X),i(f,g,X),i(f,z,X),i(f,H,X),i(f,J,X),i(f,j,X)},p:he,d(f){f&&(s(e),s(t),s(a),s(o),s(g),s(z),s(H),s(J),s(j))}}}function Yt(k){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=c("p"),e.innerHTML=u},l(t){e=m(t,"P",{"data-svelte-h":!0}),_(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(t,a){i(t,e,a)},p:he,d(t){t&&s(e)}}}function Ot(k){let e,u="Example:",t,a,T;return a=new ft({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURlRyYW5zZm9YTE1vZGVsJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0cmFuc2ZvLXhsJTJGdHJhbnNmby14bC13dDEwMyUyMiklMEFtb2RlbCUyMCUzRCUyMFRGVHJhbnNmb1hMTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnRyYW5zZm8teGwlMkZ0cmFuc2ZvLXhsLXd0MTAzJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",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/transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFTransfoXLModel.from_pretrained(<span class="hljs-string">&quot;transfo-xl/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`,wrap:!1}}),{c(){e=c("p"),e.textContent=u,t=r(),v(a.$$.fragment)},l(o){e=m(o,"P",{"data-svelte-h":!0}),_(e)!=="svelte-11lpom8"&&(e.textContent=u),t=l(o),y(a.$$.fragment,o)},m(o,g){i(o,e,g),i(o,t,g),M(a,o,g),T=!0},p:he,i(o){T||(w(a.$$.fragment,o),T=!0)},o(o){$(a.$$.fragment,o),T=!1},d(o){o&&(s(e),s(t)),x(a,o)}}}function At(k){let e,u="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",t,a,T="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional argument.</li>",o,g,S=`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 <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,z,H,Y=`<li>a single Tensor with <code>input_ids</code> only and nothing else: <code>model(input_ids)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([input_ids, attention_mask])</code> or <code>model([input_ids, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;input_ids&quot;: input_ids, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,J,j,Z=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){e=c("p"),e.innerHTML=u,t=r(),a=c("ul"),a.innerHTML=T,o=r(),g=c("p"),g.innerHTML=S,z=r(),H=c("ul"),H.innerHTML=Y,J=r(),j=c("p"),j.innerHTML=Z},l(f){e=m(f,"P",{"data-svelte-h":!0}),_(e)!=="svelte-1ajbfxg"&&(e.innerHTML=u),t=l(f),a=m(f,"UL",{"data-svelte-h":!0}),_(a)!=="svelte-qm1t26"&&(a.innerHTML=T),o=l(f),g=m(f,"P",{"data-svelte-h":!0}),_(g)!=="svelte-1v9qsc5"&&(g.innerHTML=S),z=l(f),H=m(f,"UL",{"data-svelte-h":!0}),_(H)!=="svelte-15scerc"&&(H.innerHTML=Y),J=l(f),j=m(f,"P",{"data-svelte-h":!0}),_(j)!=="svelte-1an3odd"&&(j.innerHTML=Z)},m(f,X){i(f,e,X),i(f,t,X),i(f,a,X),i(f,o,X),i(f,g,X),i(f,z,X),i(f,H,X),i(f,J,X),i(f,j,X)},p:he,d(f){f&&(s(e),s(t),s(a),s(o),s(g),s(z),s(H),s(J),s(j))}}}function Qt(k){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=c("p"),e.innerHTML=u},l(t){e=m(t,"P",{"data-svelte-h":!0}),_(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(t,a){i(t,e,a)},p:he,d(t){t&&s(e)}}}function Dt(k){let e,u="Example:",t,a,T;return a=new ft({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURlRyYW5zZm9YTExNSGVhZE1vZGVsJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0cmFuc2ZvLXhsJTJGdHJhbnNmby14bC13dDEwMyUyMiklMEFtb2RlbCUyMCUzRCUyMFRGVHJhbnNmb1hMTE1IZWFkTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnRyYW5zZm8teGwlMkZ0cmFuc2ZvLXhsLXd0MTAzJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRzKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",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/transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFTransfoXLLMHeadModel.from_pretrained(<span class="hljs-string">&quot;transfo-xl/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`,wrap:!1}}),{c(){e=c("p"),e.textContent=u,t=r(),v(a.$$.fragment)},l(o){e=m(o,"P",{"data-svelte-h":!0}),_(e)!=="svelte-11lpom8"&&(e.textContent=u),t=l(o),y(a.$$.fragment,o)},m(o,g){i(o,e,g),i(o,t,g),M(a,o,g),T=!0},p:he,i(o){T||(w(a.$$.fragment,o),T=!0)},o(o){$(a.$$.fragment,o),T=!1},d(o){o&&(s(e),s(t)),x(a,o)}}}function Kt(k){let e,u="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",t,a,T="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional argument.</li>",o,g,S=`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 <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,z,H,Y=`<li>a single Tensor with <code>input_ids</code> only and nothing else: <code>model(input_ids)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([input_ids, attention_mask])</code> or <code>model([input_ids, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;input_ids&quot;: input_ids, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,J,j,Z=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){e=c("p"),e.innerHTML=u,t=r(),a=c("ul"),a.innerHTML=T,o=r(),g=c("p"),g.innerHTML=S,z=r(),H=c("ul"),H.innerHTML=Y,J=r(),j=c("p"),j.innerHTML=Z},l(f){e=m(f,"P",{"data-svelte-h":!0}),_(e)!=="svelte-1ajbfxg"&&(e.innerHTML=u),t=l(f),a=m(f,"UL",{"data-svelte-h":!0}),_(a)!=="svelte-qm1t26"&&(a.innerHTML=T),o=l(f),g=m(f,"P",{"data-svelte-h":!0}),_(g)!=="svelte-1v9qsc5"&&(g.innerHTML=S),z=l(f),H=m(f,"UL",{"data-svelte-h":!0}),_(H)!=="svelte-15scerc"&&(H.innerHTML=Y),J=l(f),j=m(f,"P",{"data-svelte-h":!0}),_(j)!=="svelte-1an3odd"&&(j.innerHTML=Z)},m(f,X){i(f,e,X),i(f,t,X),i(f,a,X),i(f,o,X),i(f,g,X),i(f,z,X),i(f,H,X),i(f,J,X),i(f,j,X)},p:he,d(f){f&&(s(e),s(t),s(a),s(o),s(g),s(z),s(H),s(J),s(j))}}}function en(k){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=c("p"),e.innerHTML=u},l(t){e=m(t,"P",{"data-svelte-h":!0}),_(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(t,a){i(t,e,a)},p:he,d(t){t&&s(e)}}}function tn(k){let e,u="Example:",t,a,T;return a=new ft({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURlRyYW5zZm9YTEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnRyYW5zZm8teGwlMkZ0cmFuc2ZvLXhsLXd0MTAzJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZUcmFuc2ZvWExGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ0cmFuc2ZvLXhsJTJGdHJhbnNmby14bC13dDEwMyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBJTBBbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF9jbGFzc19pZCUyMCUzRCUyMGludCh0Zi5tYXRoLmFyZ21heChsb2dpdHMlMkMlMjBheGlzJTNELTEpJTVCMCU1RCk=",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/transfo-xl-wt103&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFTransfoXLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;transfo-xl/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>])`,wrap:!1}}),{c(){e=c("p"),e.textContent=u,t=r(),v(a.$$.fragment)},l(o){e=m(o,"P",{"data-svelte-h":!0}),_(e)!=="svelte-11lpom8"&&(e.textContent=u),t=l(o),y(a.$$.fragment,o)},m(o,g){i(o,e,g),i(o,t,g),M(a,o,g),T=!0},p:he,i(o){T||(w(a.$$.fragment,o),T=!0)},o(o){$(a.$$.fragment,o),T=!1},d(o){o&&(s(e),s(t)),x(a,o)}}}function nn(k){let e,u;return e=new ft({props:{code:"JTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwVEZUcmFuc2ZvWExGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ0cmFuc2ZvLXhsJTJGdHJhbnNmby14bC13dDEwMyUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRmLmNvbnN0YW50KDEpJTBBbG9zcyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKS5sb3Nz",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/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',wrap:!1}}),{c(){v(e.$$.fragment)},l(t){y(e.$$.fragment,t)},m(t,a){M(e,t,a),u=!0},p:he,i(t){u||(w(e.$$.fragment,t),u=!0)},o(t){$(e.$$.fragment,t),u=!1},d(t){x(e,t)}}}function on(k){let e,u,t,a,T,o,g="The bare Bert Model transformer outputting raw hidden-states without any specific head on top.",S,z,H=`This model inherits from <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</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.)`,Y,J,j=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</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.`,Z,f,X,N,C,D,be,Ne='The <a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TFTransfoXLModel">TFTransfoXLModel</a> forward method, overrides the <code>__call__</code> special method.',et,E,ot,se,xe,I,ce,O,ge,je,Je,Le=`The Transformer-XL Model with a language modeling head on top (adaptive softmax with weights tied to the adaptive
input embeddings)`,st,ve,tt=`This model inherits from <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</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.)`,at,ye,me=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</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.`,G,fe,Ie,te,Re,Fe,ke,Be='The <a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TFTransfoXLLMHeadModel">TFTransfoXLLMHeadModel</a> forward method, overrides the <code>__call__</code> special method.',nt,V,Se,U,Xe,P,_e,R,Me,Ye,Oe,Ae="The Transfo XL Model transformer with a sequence classification head on top (linear layer).",Qe,De,Ke=`<a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TFTransfoXLForSequenceClassification">TFTransfoXLForSequenceClassification</a> uses the last token in order to do the classification, as other causal
models (e.g. GPT-1,GPT-2) do.`,we,Ee,Ge=`Since it does classification on the last token, it requires to know the position of the last token. If a
<code>pad_token_id</code> is defined in the configuration, it finds the last token that is not a padding token in each row. If
no <code>pad_token_id</code> is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when <code>inputs_embeds</code> are passed instead of <code>input_ids</code>, it does the same (take the last value in
each row of the batch).`,He,Te,Ve=`This model inherits from <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</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.)`,ne,ae,pt=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</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.`,Ue,re,qe,B,$e,We,Ze,le='The <a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TFTransfoXLForSequenceClassification">TFTransfoXLForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',ze,h,F,K,oe,q,W;return e=new Pe({props:{title:"TFTransfoXLModel",local:"transformers.TFTransfoXLModel",headingTag:"h2"}}),a=new de({props:{name:"class transformers.TFTransfoXLModel",anchor:"transformers.TFTransfoXLModel",parameters:[{name:"config",val:""},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFTransfoXLModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py#L852"}}),f=new it({props:{$$slots:{default:[St]},$$scope:{ctx:k}}}),C=new de({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/v4.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFTransfoXLModel.call.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TFTransfoXLModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFTransfoXLModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFTransfoXLModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFTransfoXLModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFTransfoXLModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.39.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFTransfoXLModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py#L861",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.models.deprecated.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput"
>transformers.models.deprecated.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.models.deprecated.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput"
>transformers.models.deprecated.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),E=new it({props:{$$slots:{default:[Yt]},$$scope:{ctx:k}}}),se=new ut({props:{anchor:"transformers.TFTransfoXLModel.call.example",$$slots:{default:[Ot]},$$scope:{ctx:k}}}),I=new Pe({props:{title:"TFTransfoXLLMHeadModel",local:"transformers.TFTransfoXLLMHeadModel",headingTag:"h2"}}),ge=new de({props:{name:"class transformers.TFTransfoXLLMHeadModel",anchor:"transformers.TFTransfoXLLMHeadModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.TFTransfoXLLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py#L893"}}),fe=new it({props:{$$slots:{default:[At]},$$scope:{ctx:k}}}),Re=new de({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/v4.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.39.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFTransfoXLLMHeadModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py#L929",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.models.deprecated.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput"
>transformers.models.deprecated.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>losses</strong> (<code>tf.Tensor</code> of shape <em>(batch_size, sequence_length-1)</em>, <em>optional</em>, returned when <code>labels</code> is provided) — 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>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.models.deprecated.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput"
>transformers.models.deprecated.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),V=new it({props:{$$slots:{default:[Qt]},$$scope:{ctx:k}}}),U=new ut({props:{anchor:"transformers.TFTransfoXLLMHeadModel.call.example",$$slots:{default:[Dt]},$$scope:{ctx:k}}}),P=new Pe({props:{title:"TFTransfoXLForSequenceClassification",local:"transformers.TFTransfoXLForSequenceClassification",headingTag:"h2"}}),Me=new de({props:{name:"class transformers.TFTransfoXLForSequenceClassification",anchor:"transformers.TFTransfoXLForSequenceClassification",parameters:[{name:"config",val:""},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFTransfoXLForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig">TransfoXLConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py#L1007"}}),re=new it({props:{$$slots:{default:[Kt]},$$scope:{ctx:k}}}),$e=new de({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/v4.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>mems</code> output below). Can be used to speed up sequential decoding. The token ids which have their mems
given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"mems"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.39.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFTransfoXLForSequenceClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the cross entropy classification loss. Indices should be in <code>[0, ..., config.vocab_size - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py#L1042",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.deprecated.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLSequenceClassifierOutputWithPast</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig"
>TransfoXLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — 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>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.deprecated.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLSequenceClassifierOutputWithPast</code> or <code>tuple(tf.Tensor)</code></p>
`}}),h=new it({props:{$$slots:{default:[en]},$$scope:{ctx:k}}}),K=new ut({props:{anchor:"transformers.TFTransfoXLForSequenceClassification.call.example",$$slots:{default:[tn]},$$scope:{ctx:k}}}),q=new ut({props:{anchor:"transformers.TFTransfoXLForSequenceClassification.call.example-2",$$slots:{default:[nn]},$$scope:{ctx:k}}}),{c(){v(e.$$.fragment),u=r(),t=c("div"),v(a.$$.fragment),T=r(),o=c("p"),o.textContent=g,S=r(),z=c("p"),z.innerHTML=H,Y=r(),J=c("p"),J.innerHTML=j,Z=r(),v(f.$$.fragment),X=r(),N=c("div"),v(C.$$.fragment),D=r(),be=c("p"),be.innerHTML=Ne,et=r(),v(E.$$.fragment),ot=r(),v(se.$$.fragment),xe=r(),v(I.$$.fragment),ce=r(),O=c("div"),v(ge.$$.fragment),je=r(),Je=c("p"),Je.textContent=Le,st=r(),ve=c("p"),ve.innerHTML=tt,at=r(),ye=c("p"),ye.innerHTML=me,G=r(),v(fe.$$.fragment),Ie=r(),te=c("div"),v(Re.$$.fragment),Fe=r(),ke=c("p"),ke.innerHTML=Be,nt=r(),v(V.$$.fragment),Se=r(),v(U.$$.fragment),Xe=r(),v(P.$$.fragment),_e=r(),R=c("div"),v(Me.$$.fragment),Ye=r(),Oe=c("p"),Oe.textContent=Ae,Qe=r(),De=c("p"),De.innerHTML=Ke,we=r(),Ee=c("p"),Ee.innerHTML=Ge,He=r(),Te=c("p"),Te.innerHTML=Ve,ne=r(),ae=c("p"),ae.innerHTML=pt,Ue=r(),v(re.$$.fragment),qe=r(),B=c("div"),v($e.$$.fragment),We=r(),Ze=c("p"),Ze.innerHTML=le,ze=r(),v(h.$$.fragment),F=r(),v(K.$$.fragment),oe=r(),v(q.$$.fragment),this.h()},l(p){y(e.$$.fragment,p),u=l(p),t=m(p,"DIV",{class:!0});var L=ee(t);y(a.$$.fragment,L),T=l(L),o=m(L,"P",{"data-svelte-h":!0}),_(o)!=="svelte-1n9fdqw"&&(o.textContent=g),S=l(L),z=m(L,"P",{"data-svelte-h":!0}),_(z)!=="svelte-1pwa1lc"&&(z.innerHTML=H),Y=l(L),J=m(L,"P",{"data-svelte-h":!0}),_(J)!=="svelte-1be7e3c"&&(J.innerHTML=j),Z=l(L),y(f.$$.fragment,L),X=l(L),N=m(L,"DIV",{class:!0});var Ce=ee(N);y(C.$$.fragment,Ce),D=l(Ce),be=m(Ce,"P",{"data-svelte-h":!0}),_(be)!=="svelte-1tmf9r9"&&(be.innerHTML=Ne),et=l(Ce),y(E.$$.fragment,Ce),ot=l(Ce),y(se.$$.fragment,Ce),Ce.forEach(s),L.forEach(s),xe=l(p),y(I.$$.fragment,p),ce=l(p),O=m(p,"DIV",{class:!0});var pe=ee(O);y(ge.$$.fragment,pe),je=l(pe),Je=m(pe,"P",{"data-svelte-h":!0}),_(Je)!=="svelte-117cpg6"&&(Je.textContent=Le),st=l(pe),ve=m(pe,"P",{"data-svelte-h":!0}),_(ve)!=="svelte-1pwa1lc"&&(ve.innerHTML=tt),at=l(pe),ye=m(pe,"P",{"data-svelte-h":!0}),_(ye)!=="svelte-1be7e3c"&&(ye.innerHTML=me),G=l(pe),y(fe.$$.fragment,pe),Ie=l(pe),te=m(pe,"DIV",{class:!0});var ue=ee(te);y(Re.$$.fragment,ue),Fe=l(ue),ke=m(ue,"P",{"data-svelte-h":!0}),_(ke)!=="svelte-mvq00r"&&(ke.innerHTML=Be),nt=l(ue),y(V.$$.fragment,ue),Se=l(ue),y(U.$$.fragment,ue),ue.forEach(s),pe.forEach(s),Xe=l(p),y(P.$$.fragment,p),_e=l(p),R=m(p,"DIV",{class:!0});var A=ee(R);y(Me.$$.fragment,A),Ye=l(A),Oe=m(A,"P",{"data-svelte-h":!0}),_(Oe)!=="svelte-wlxpaz"&&(Oe.textContent=Ae),Qe=l(A),De=m(A,"P",{"data-svelte-h":!0}),_(De)!=="svelte-12et1xz"&&(De.innerHTML=Ke),we=l(A),Ee=m(A,"P",{"data-svelte-h":!0}),_(Ee)!=="svelte-10ugs3m"&&(Ee.innerHTML=Ge),He=l(A),Te=m(A,"P",{"data-svelte-h":!0}),_(Te)!=="svelte-1pwa1lc"&&(Te.innerHTML=Ve),ne=l(A),ae=m(A,"P",{"data-svelte-h":!0}),_(ae)!=="svelte-1be7e3c"&&(ae.innerHTML=pt),Ue=l(A),y(re.$$.fragment,A),qe=l(A),B=m(A,"DIV",{class:!0});var ie=ee(B);y($e.$$.fragment,ie),We=l(ie),Ze=m(ie,"P",{"data-svelte-h":!0}),_(Ze)!=="svelte-fw2wjr"&&(Ze.innerHTML=le),ze=l(ie),y(h.$$.fragment,ie),F=l(ie),y(K.$$.fragment,ie),oe=l(ie),y(q.$$.fragment,ie),ie.forEach(s),A.forEach(s),this.h()},h(){Q(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(p,L){M(e,p,L),i(p,u,L),i(p,t,L),M(a,t,null),d(t,T),d(t,o),d(t,S),d(t,z),d(t,Y),d(t,J),d(t,Z),M(f,t,null),d(t,X),d(t,N),M(C,N,null),d(N,D),d(N,be),d(N,et),M(E,N,null),d(N,ot),M(se,N,null),i(p,xe,L),M(I,p,L),i(p,ce,L),i(p,O,L),M(ge,O,null),d(O,je),d(O,Je),d(O,st),d(O,ve),d(O,at),d(O,ye),d(O,G),M(fe,O,null),d(O,Ie),d(O,te),M(Re,te,null),d(te,Fe),d(te,ke),d(te,nt),M(V,te,null),d(te,Se),M(U,te,null),i(p,Xe,L),M(P,p,L),i(p,_e,L),i(p,R,L),M(Me,R,null),d(R,Ye),d(R,Oe),d(R,Qe),d(R,De),d(R,we),d(R,Ee),d(R,He),d(R,Te),d(R,ne),d(R,ae),d(R,Ue),M(re,R,null),d(R,qe),d(R,B),M($e,B,null),d(B,We),d(B,Ze),d(B,ze),M(h,B,null),d(B,F),M(K,B,null),d(B,oe),M(q,B,null),W=!0},p(p,L){const Ce={};L&2&&(Ce.$$scope={dirty:L,ctx:p}),f.$set(Ce);const pe={};L&2&&(pe.$$scope={dirty:L,ctx:p}),E.$set(pe);const ue={};L&2&&(ue.$$scope={dirty:L,ctx:p}),se.$set(ue);const A={};L&2&&(A.$$scope={dirty:L,ctx:p}),fe.$set(A);const ie={};L&2&&(ie.$$scope={dirty:L,ctx:p}),V.$set(ie);const ht={};L&2&&(ht.$$scope={dirty:L,ctx:p}),U.$set(ht);const dt={};L&2&&(dt.$$scope={dirty:L,ctx:p}),re.$set(dt);const ct={};L&2&&(ct.$$scope={dirty:L,ctx:p}),h.$set(ct);const gt={};L&2&&(gt.$$scope={dirty:L,ctx:p}),K.$set(gt);const mt={};L&2&&(mt.$$scope={dirty:L,ctx:p}),q.$set(mt)},i(p){W||(w(e.$$.fragment,p),w(a.$$.fragment,p),w(f.$$.fragment,p),w(C.$$.fragment,p),w(E.$$.fragment,p),w(se.$$.fragment,p),w(I.$$.fragment,p),w(ge.$$.fragment,p),w(fe.$$.fragment,p),w(Re.$$.fragment,p),w(V.$$.fragment,p),w(U.$$.fragment,p),w(P.$$.fragment,p),w(Me.$$.fragment,p),w(re.$$.fragment,p),w($e.$$.fragment,p),w(h.$$.fragment,p),w(K.$$.fragment,p),w(q.$$.fragment,p),W=!0)},o(p){$(e.$$.fragment,p),$(a.$$.fragment,p),$(f.$$.fragment,p),$(C.$$.fragment,p),$(E.$$.fragment,p),$(se.$$.fragment,p),$(I.$$.fragment,p),$(ge.$$.fragment,p),$(fe.$$.fragment,p),$(Re.$$.fragment,p),$(V.$$.fragment,p),$(U.$$.fragment,p),$(P.$$.fragment,p),$(Me.$$.fragment,p),$(re.$$.fragment,p),$($e.$$.fragment,p),$(h.$$.fragment,p),$(K.$$.fragment,p),$(q.$$.fragment,p),W=!1},d(p){p&&(s(u),s(t),s(xe),s(ce),s(O),s(Xe),s(_e),s(R)),x(e,p),x(a),x(f),x(C),x(E),x(se),x(I,p),x(ge),x(fe),x(Re),x(V),x(U),x(P,p),x(Me),x(re),x($e),x(h),x(K),x(q)}}}function sn(k){let e,u;return e=new Xt({props:{$$slots:{default:[on]},$$scope:{ctx:k}}}),{c(){v(e.$$.fragment)},l(t){y(e.$$.fragment,t)},m(t,a){M(e,t,a),u=!0},p(t,a){const T={};a&2&&(T.$$scope={dirty:a,ctx:t}),e.$set(T)},i(t){u||(w(e.$$.fragment,t),u=!0)},o(t){$(e.$$.fragment,t),u=!1},d(t){x(e,t)}}}function an(k){let e,u,t,a,T,o,g,S,z,H='<a href="https://huggingface.co/models?filter=transfo-xl"><img alt="Models" src="https://img.shields.io/badge/All_model_pages-transfo--xl-blueviolet"/></a> <a href="https://huggingface.co/spaces/docs-demos/transfo-xl-wt103"><img alt="Spaces" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue"/></a>',Y,J,j,Z,f=`The Transformer-XL model was proposed in <a href="https://arxiv.org/abs/1901.02860" rel="nofollow">Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context</a> by Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V. Le, Ruslan
Salakhutdinov. It’s a causal (uni-directional) transformer with relative positioning (sinusoïdal) embeddings which can
reuse previously computed hidden-states to attend to longer context (memory). This model also uses adaptive softmax
inputs and outputs (tied).`,X,N,C="The abstract from the paper is the following:",D,be,Ne=`<em>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.</em>`,et,E,ot='This model was contributed by <a href="https://huggingface.co/thomwolf" rel="nofollow">thomwolf</a>. The original code can be found <a href="https://github.com/kimiyoung/transformer-xl" rel="nofollow">here</a>.',se,xe,I,ce,O=`<li>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.</li> <li>Transformer-XL is one of the few models that has no sequence length limit.</li> <li>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.</li> <li>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.</li> <li>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.</li>`,ge,je,Je,Le,st,ve,tt='<li><a href="../tasks/sequence_classification">Text classification task guide</a></li> <li><a href="../tasks/language_modeling">Causal language modeling task guide</a></li>',at,ye,me,G,fe,Ie,te,Re=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLModel">TransfoXLModel</a> or a <a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TFTransfoXLModel">TFTransfoXLModel</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
<a href="https://huggingface.co/transfo-xl/transfo-xl-wt103" rel="nofollow">transfo-xl/transfo-xl-wt103</a> architecture.`,Fe,ke,Be=`Configuration objects inherit from <a href="/docs/transformers/v4.39.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.39.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,nt,V,Se,U,Xe,P,_e,R,Me,Ye=`Construct a Transformer-XL tokenizer adapted from Vocab class in <a href="https://github.com/kimiyoung/transformer-xl" rel="nofollow">the original
code</a>. The Transformer-XL tokenizer is a word-level tokenizer (no
sub-word tokenization).`,Oe,Ae,Qe=`This tokenizer inherits from <a href="/docs/transformers/v4.39.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`,De,Ke,we,Ee,Ge,He,Te,Ve,ne,ae,pt="Base class for model’s outputs that may also contain a past key/values (to speed up sequential decoding).",Ue,re,qe,B,$e,We="Base class for model’s outputs that may also contain a past key/values (to speed up sequential decoding).",Ze,le,ze,h,F,K="Base class for model’s outputs that may also contain a past key/values (to speed up sequential decoding).",oe,q,W,p,L,Ce="Base class for model’s outputs that may also contain a past key/values (to speed up sequential decoding).",pe,ue,A,ie,ht,dt,ct,gt,mt,_t,yt,bt,Mt;return T=new Pe({props:{title:"Transformer XL",local:"transformer-xl",headingTag:"h1"}}),g=new it({props:{warning:!0,$$slots:{default:[Ut]},$$scope:{ctx:k}}}),J=new Pe({props:{title:"Overview",local:"overview",headingTag:"h2"}}),xe=new Pe({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),je=new it({props:{warning:!0,$$slots:{default:[qt]},$$scope:{ctx:k}}}),Le=new Pe({props:{title:"Resources",local:"resources",headingTag:"h2"}}),ye=new Pe({props:{title:"TransfoXLConfig",local:"transformers.TransfoXLConfig",headingTag:"h2"}}),fe=new de({props:{name:"class transformers.TransfoXLConfig",anchor:"transformers.TransfoXLConfig",parameters:[{name:"vocab_size",val:" = 267735"},{name:"cutoffs",val:" = [20000, 40000, 200000]"},{name:"d_model",val:" = 1024"},{name:"d_embed",val:" = 1024"},{name:"n_head",val:" = 16"},{name:"d_head",val:" = 64"},{name:"d_inner",val:" = 4096"},{name:"div_val",val:" = 4"},{name:"pre_lnorm",val:" = False"},{name:"n_layer",val:" = 18"},{name:"mem_len",val:" = 1600"},{name:"clamp_len",val:" = 1000"},{name:"same_length",val:" = True"},{name:"proj_share_all_but_first",val:" = True"},{name:"attn_type",val:" = 0"},{name:"sample_softmax",val:" = -1"},{name:"adaptive",val:" = True"},{name:"dropout",val:" = 0.1"},{name:"dropatt",val:" = 0.0"},{name:"untie_r",val:" = True"},{name:"init",val:" = 'normal'"},{name:"init_range",val:" = 0.01"},{name:"proj_init_std",val:" = 0.01"},{name:"init_std",val:" = 0.02"},{name:"layer_norm_epsilon",val:" = 1e-05"},{name:"eos_token_id",val:" = 0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TransfoXLConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 267735) &#x2014;
Vocabulary size of the BERT model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TransfoXLModel">TransfoXLModel</a> or <a href="/docs/transformers/v4.39.1/en/model_doc/transfo-xl#transformers.TFTransfoXLModel">TFTransfoXLModel</a>.`,name:"vocab_size"},{anchor:"transformers.TransfoXLConfig.cutoffs",description:`<strong>cutoffs</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[20000, 40000, 200000]</code>) &#x2014;
Cutoffs for the adaptive softmax.`,name:"cutoffs"},{anchor:"transformers.TransfoXLConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the model&#x2019;s hidden states.`,name:"d_model"},{anchor:"transformers.TransfoXLConfig.d_embed",description:`<strong>d_embed</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the embeddings`,name:"d_embed"},{anchor:"transformers.TransfoXLConfig.n_head",description:`<strong>n_head</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"n_head"},{anchor:"transformers.TransfoXLConfig.d_head",description:`<strong>d_head</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Dimensionality of the model&#x2019;s heads.`,name:"d_head"},{anchor:"transformers.TransfoXLConfig.d_inner",description:`<strong>d_inner</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Inner dimension in FF`,name:"d_inner"},{anchor:"transformers.TransfoXLConfig.div_val",description:`<strong>div_val</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Divident value for adapative input and softmax`,name:"div_val"},{anchor:"transformers.TransfoXLConfig.pre_lnorm",description:`<strong>pre_lnorm</strong> (<code>boolean</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to apply LayerNorm to the input instead of the output in the blocks.`,name:"pre_lnorm"},{anchor:"transformers.TransfoXLConfig.n_layer",description:`<strong>n_layer</strong> (<code>int</code>, <em>optional</em>, defaults to 18) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"n_layer"},{anchor:"transformers.TransfoXLConfig.mem_len",description:`<strong>mem_len</strong> (<code>int</code>, <em>optional</em>, defaults to 1600) &#x2014;
Length of the retained previous heads.`,name:"mem_len"},{anchor:"transformers.TransfoXLConfig.clamp_len",description:`<strong>clamp_len</strong> (<code>int</code>, <em>optional</em>, defaults to 1000) &#x2014;
Use the same pos embeddings after clamp_len.`,name:"clamp_len"},{anchor:"transformers.TransfoXLConfig.same_length",description:`<strong>same_length</strong> (<code>boolean</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use the same attn length for all tokens`,name:"same_length"},{anchor:"transformers.TransfoXLConfig.proj_share_all_but_first",description:`<strong>proj_share_all_but_first</strong> (<code>boolean</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
True to share all but first projs, False not to share.`,name:"proj_share_all_but_first"},{anchor:"transformers.TransfoXLConfig.attn_type",description:`<strong>attn_type</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Attention type. 0 for Transformer-XL, 1 for Shaw et al, 2 for Vaswani et al, 3 for Al Rfou et al.`,name:"attn_type"},{anchor:"transformers.TransfoXLConfig.sample_softmax",description:`<strong>sample_softmax</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Number of samples in the sampled softmax.`,name:"sample_softmax"},{anchor:"transformers.TransfoXLConfig.adaptive",description:`<strong>adaptive</strong> (<code>boolean</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use adaptive softmax.`,name:"adaptive"},{anchor:"transformers.TransfoXLConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.TransfoXLConfig.dropatt",description:`<strong>dropatt</strong> (<code>float</code>, <em>optional</em>, defaults to 0.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-05) &#x2014;
The epsilon to use in the layer normalization layers`,name:"layer_norm_epsilon"},{anchor:"transformers.TransfoXLConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
End of stream token id.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/configuration_transfo_xl.py#L29"}}),V=new ut({props:{anchor:"transformers.TransfoXLConfig.example",$$slots:{default:[Wt]},$$scope:{ctx:k}}}),U=new Pe({props:{title:"TransfoXLTokenizer",local:"transformers.TransfoXLTokenizer",headingTag:"h2"}}),_e=new de({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>[&apos;&lt;formula&gt;&apos;]</code>) &#x2014;
A list of additional special tokens (for the HuggingFace functionality).`,name:"additional_special_tokens"},{anchor:"transformers.TransfoXLTokenizer.language",description:`<strong>language</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;en&quot;</code>) &#x2014;
The language of this tokenizer (used for mose preprocessing).`,name:"language"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/tokenization_transfo_xl.py#L124"}}),we=new de({props:{name:"save_vocabulary",anchor:"transformers.TransfoXLTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": Optional = None"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/tokenization_transfo_xl.py#L328"}}),Ge=new Pe({props:{title:"TransfoXL specific outputs",local:"transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput",headingTag:"h2"}}),Ve=new de({props:{name:"class transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput",anchor:"transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput",parameters:[{name:"last_hidden_state",val:": FloatTensor"},{name:"mems",val:": List = None"},{name:"hidden_states",val:": Optional = None"},{name:"attentions",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.models.deprecated.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.deprecated.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.deprecated.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.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py#L599"}}),qe=new de({props:{name:"class transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput",anchor:"transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput",parameters:[{name:"losses",val:": Optional = None"},{name:"prediction_scores",val:": FloatTensor = None"},{name:"mems",val:": List = None"},{name:"hidden_states",val:": Optional = None"},{name:"attentions",val:": Optional = None"},{name:"loss",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.models.deprecated.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.deprecated.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.deprecated.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.deprecated.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.deprecated.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.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLLMHeadModelOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>()</code>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Reduced language modeling loss.`,name:"loss"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py#L664"}}),ze=new de({props:{name:"class transformers.models.deprecated.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput",anchor:"transformers.models.deprecated.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.deprecated.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.deprecated.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.deprecated.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.deprecated.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py#L673"}}),W=new de({props:{name:"class transformers.models.deprecated.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput",anchor:"transformers.models.deprecated.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.deprecated.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.deprecated.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.deprecated.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.deprecated.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.deprecated.transfo_xl.modeling_tf_transfo_xl.TFTransfoXLLMHeadModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py#L704"}}),ue=new Ht({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[sn],pytorch:[Pt]},$$scope:{ctx:k}}}),ie=new Pe({props:{title:"Internal Layers",local:"transformers.AdaptiveEmbedding",headingTag:"h2"}}),ct=new de({props:{name:"class transformers.AdaptiveEmbedding",anchor:"transformers.AdaptiveEmbedding",parameters:[{name:"n_token",val:""},{name:"d_embed",val:""},{name:"d_proj",val:""},{name:"cutoffs",val:""},{name:"div_val",val:" = 1"},{name:"sample_softmax",val:" = False"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py#L399"}}),_t=new de({props:{name:"class transformers.TFAdaptiveEmbedding",anchor:"transformers.TFAdaptiveEmbedding",parameters:[{name:"n_token",val:""},{name:"d_embed",val:""},{name:"d_proj",val:""},{name:"cutoffs",val:""},{name:"div_val",val:" = 1"},{name:"init_std",val:" = 0.02"},{name:"sample_softmax",val:" = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py#L345"}}),{c(){e=c("meta"),u=r(),t=c("p"),a=r(),v(T.$$.fragment),o=r(),v(g.$$.fragment),S=r(),z=c("div"),z.innerHTML=H,Y=r(),v(J.$$.fragment),j=r(),Z=c("p"),Z.innerHTML=f,X=r(),N=c("p"),N.textContent=C,D=r(),be=c("p"),be.innerHTML=Ne,et=r(),E=c("p"),E.innerHTML=ot,se=r(),v(xe.$$.fragment),I=r(),ce=c("ul"),ce.innerHTML=O,ge=r(),v(je.$$.fragment),Je=r(),v(Le.$$.fragment),st=r(),ve=c("ul"),ve.innerHTML=tt,at=r(),v(ye.$$.fragment),me=r(),G=c("div"),v(fe.$$.fragment),Ie=r(),te=c("p"),te.innerHTML=Re,Fe=r(),ke=c("p"),ke.innerHTML=Be,nt=r(),v(V.$$.fragment),Se=r(),v(U.$$.fragment),Xe=r(),P=c("div"),v(_e.$$.fragment),R=r(),Me=c("p"),Me.innerHTML=Ye,Oe=r(),Ae=c("p"),Ae.innerHTML=Qe,De=r(),Ke=c("div"),v(we.$$.fragment),Ee=r(),v(Ge.$$.fragment),He=r(),Te=c("div"),v(Ve.$$.fragment),ne=r(),ae=c("p"),ae.textContent=pt,Ue=r(),re=c("div"),v(qe.$$.fragment),B=r(),$e=c("p"),$e.textContent=We,Ze=r(),le=c("div"),v(ze.$$.fragment),h=r(),F=c("p"),F.textContent=K,oe=r(),q=c("div"),v(W.$$.fragment),p=r(),L=c("p"),L.textContent=Ce,pe=r(),v(ue.$$.fragment),A=r(),v(ie.$$.fragment),ht=r(),dt=c("div"),v(ct.$$.fragment),gt=r(),mt=c("div"),v(_t.$$.fragment),yt=r(),bt=c("p"),this.h()},l(n){const b=Jt("svelte-u9bgzb",document.head);e=m(b,"META",{name:!0,content:!0}),b.forEach(s),u=l(n),t=m(n,"P",{}),ee(t).forEach(s),a=l(n),y(T.$$.fragment,n),o=l(n),y(g.$$.fragment,n),S=l(n),z=m(n,"DIV",{class:!0,"data-svelte-h":!0}),_(z)!=="svelte-1e1blju"&&(z.innerHTML=H),Y=l(n),y(J.$$.fragment,n),j=l(n),Z=m(n,"P",{"data-svelte-h":!0}),_(Z)!=="svelte-10474ig"&&(Z.innerHTML=f),X=l(n),N=m(n,"P",{"data-svelte-h":!0}),_(N)!=="svelte-vfdo9a"&&(N.textContent=C),D=l(n),be=m(n,"P",{"data-svelte-h":!0}),_(be)!=="svelte-14c6mzu"&&(be.innerHTML=Ne),et=l(n),E=m(n,"P",{"data-svelte-h":!0}),_(E)!=="svelte-fzra47"&&(E.innerHTML=ot),se=l(n),y(xe.$$.fragment,n),I=l(n),ce=m(n,"UL",{"data-svelte-h":!0}),_(ce)!=="svelte-1dzkjyk"&&(ce.innerHTML=O),ge=l(n),y(je.$$.fragment,n),Je=l(n),y(Le.$$.fragment,n),st=l(n),ve=m(n,"UL",{"data-svelte-h":!0}),_(ve)!=="svelte-17u5l9r"&&(ve.innerHTML=tt),at=l(n),y(ye.$$.fragment,n),me=l(n),G=m(n,"DIV",{class:!0});var rt=ee(G);y(fe.$$.fragment,rt),Ie=l(rt),te=m(rt,"P",{"data-svelte-h":!0}),_(te)!=="svelte-11htgrh"&&(te.innerHTML=Re),Fe=l(rt),ke=m(rt,"P",{"data-svelte-h":!0}),_(ke)!=="svelte-1nrxf0l"&&(ke.innerHTML=Be),nt=l(rt),y(V.$$.fragment,rt),rt.forEach(s),Se=l(n),y(U.$$.fragment,n),Xe=l(n),P=m(n,"DIV",{class:!0});var lt=ee(P);y(_e.$$.fragment,lt),R=l(lt),Me=m(lt,"P",{"data-svelte-h":!0}),_(Me)!=="svelte-64mlya"&&(Me.innerHTML=Ye),Oe=l(lt),Ae=m(lt,"P",{"data-svelte-h":!0}),_(Ae)!=="svelte-1lbxouy"&&(Ae.innerHTML=Qe),De=l(lt),Ke=m(lt,"DIV",{class:!0});var vt=ee(Ke);y(we.$$.fragment,vt),vt.forEach(s),lt.forEach(s),Ee=l(n),y(Ge.$$.fragment,n),He=l(n),Te=m(n,"DIV",{class:!0});var Tt=ee(Te);y(Ve.$$.fragment,Tt),ne=l(Tt),ae=m(Tt,"P",{"data-svelte-h":!0}),_(ae)!=="svelte-1kt4x95"&&(ae.textContent=pt),Tt.forEach(s),Ue=l(n),re=m(n,"DIV",{class:!0});var wt=ee(re);y(qe.$$.fragment,wt),B=l(wt),$e=m(wt,"P",{"data-svelte-h":!0}),_($e)!=="svelte-1kt4x95"&&($e.textContent=We),wt.forEach(s),Ze=l(n),le=m(n,"DIV",{class:!0});var $t=ee(le);y(ze.$$.fragment,$t),h=l($t),F=m($t,"P",{"data-svelte-h":!0}),_(F)!=="svelte-1kt4x95"&&(F.textContent=K),$t.forEach(s),oe=l(n),q=m(n,"DIV",{class:!0});var xt=ee(q);y(W.$$.fragment,xt),p=l(xt),L=m(xt,"P",{"data-svelte-h":!0}),_(L)!=="svelte-1kt4x95"&&(L.textContent=Ce),xt.forEach(s),pe=l(n),y(ue.$$.fragment,n),A=l(n),y(ie.$$.fragment,n),ht=l(n),dt=m(n,"DIV",{class:!0});var Lt=ee(dt);y(ct.$$.fragment,Lt),Lt.forEach(s),gt=l(n),mt=m(n,"DIV",{class:!0});var kt=ee(mt);y(_t.$$.fragment,kt),kt.forEach(s),yt=l(n),bt=m(n,"P",{}),ee(bt).forEach(s),this.h()},h(){Q(e,"name","hf:doc:metadata"),Q(e,"content",rn),Q(z,"class","flex flex-wrap space-x-1"),Q(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(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(n,b){d(document.head,e),i(n,u,b),i(n,t,b),i(n,a,b),M(T,n,b),i(n,o,b),M(g,n,b),i(n,S,b),i(n,z,b),i(n,Y,b),M(J,n,b),i(n,j,b),i(n,Z,b),i(n,X,b),i(n,N,b),i(n,D,b),i(n,be,b),i(n,et,b),i(n,E,b),i(n,se,b),M(xe,n,b),i(n,I,b),i(n,ce,b),i(n,ge,b),M(je,n,b),i(n,Je,b),M(Le,n,b),i(n,st,b),i(n,ve,b),i(n,at,b),M(ye,n,b),i(n,me,b),i(n,G,b),M(fe,G,null),d(G,Ie),d(G,te),d(G,Fe),d(G,ke),d(G,nt),M(V,G,null),i(n,Se,b),M(U,n,b),i(n,Xe,b),i(n,P,b),M(_e,P,null),d(P,R),d(P,Me),d(P,Oe),d(P,Ae),d(P,De),d(P,Ke),M(we,Ke,null),i(n,Ee,b),M(Ge,n,b),i(n,He,b),i(n,Te,b),M(Ve,Te,null),d(Te,ne),d(Te,ae),i(n,Ue,b),i(n,re,b),M(qe,re,null),d(re,B),d(re,$e),i(n,Ze,b),i(n,le,b),M(ze,le,null),d(le,h),d(le,F),i(n,oe,b),i(n,q,b),M(W,q,null),d(q,p),d(q,L),i(n,pe,b),M(ue,n,b),i(n,A,b),M(ie,n,b),i(n,ht,b),i(n,dt,b),M(ct,dt,null),i(n,gt,b),i(n,mt,b),M(_t,mt,null),i(n,yt,b),i(n,bt,b),Mt=!0},p(n,[b]){const rt={};b&2&&(rt.$$scope={dirty:b,ctx:n}),g.$set(rt);const lt={};b&2&&(lt.$$scope={dirty:b,ctx:n}),je.$set(lt);const vt={};b&2&&(vt.$$scope={dirty:b,ctx:n}),V.$set(vt);const Tt={};b&2&&(Tt.$$scope={dirty:b,ctx:n}),ue.$set(Tt)},i(n){Mt||(w(T.$$.fragment,n),w(g.$$.fragment,n),w(J.$$.fragment,n),w(xe.$$.fragment,n),w(je.$$.fragment,n),w(Le.$$.fragment,n),w(ye.$$.fragment,n),w(fe.$$.fragment,n),w(V.$$.fragment,n),w(U.$$.fragment,n),w(_e.$$.fragment,n),w(we.$$.fragment,n),w(Ge.$$.fragment,n),w(Ve.$$.fragment,n),w(qe.$$.fragment,n),w(ze.$$.fragment,n),w(W.$$.fragment,n),w(ue.$$.fragment,n),w(ie.$$.fragment,n),w(ct.$$.fragment,n),w(_t.$$.fragment,n),Mt=!0)},o(n){$(T.$$.fragment,n),$(g.$$.fragment,n),$(J.$$.fragment,n),$(xe.$$.fragment,n),$(je.$$.fragment,n),$(Le.$$.fragment,n),$(ye.$$.fragment,n),$(fe.$$.fragment,n),$(V.$$.fragment,n),$(U.$$.fragment,n),$(_e.$$.fragment,n),$(we.$$.fragment,n),$(Ge.$$.fragment,n),$(Ve.$$.fragment,n),$(qe.$$.fragment,n),$(ze.$$.fragment,n),$(W.$$.fragment,n),$(ue.$$.fragment,n),$(ie.$$.fragment,n),$(ct.$$.fragment,n),$(_t.$$.fragment,n),Mt=!1},d(n){n&&(s(u),s(t),s(a),s(o),s(S),s(z),s(Y),s(j),s(Z),s(X),s(N),s(D),s(be),s(et),s(E),s(se),s(I),s(ce),s(ge),s(Je),s(st),s(ve),s(at),s(me),s(G),s(Se),s(Xe),s(P),s(Ee),s(He),s(Te),s(Ue),s(re),s(Ze),s(le),s(oe),s(q),s(pe),s(A),s(ht),s(dt),s(gt),s(mt),s(yt),s(bt)),s(e),x(T,n),x(g,n),x(J,n),x(xe,n),x(je,n),x(Le,n),x(ye,n),x(fe),x(V),x(U,n),x(_e),x(we),x(Ge,n),x(Ve),x(qe),x(ze),x(W),x(ue,n),x(ie,n),x(ct),x(_t)}}}const rn='{"title":"Transformer XL","local":"transformer-xl","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"TransfoXLConfig","local":"transformers.TransfoXLConfig","sections":[],"depth":2},{"title":"TransfoXLTokenizer","local":"transformers.TransfoXLTokenizer","sections":[],"depth":2},{"title":"TransfoXL specific outputs","local":"transformers.models.deprecated.transfo_xl.modeling_transfo_xl.TransfoXLModelOutput","sections":[],"depth":2},{"title":"TransfoXLModel","local":"transformers.TransfoXLModel","sections":[],"depth":2},{"title":"TransfoXLLMHeadModel","local":"transformers.TransfoXLLMHeadModel","sections":[],"depth":2},{"title":"TransfoXLForSequenceClassification","local":"transformers.TransfoXLForSequenceClassification","sections":[],"depth":2},{"title":"TFTransfoXLModel","local":"transformers.TFTransfoXLModel","sections":[],"depth":2},{"title":"TFTransfoXLLMHeadModel","local":"transformers.TFTransfoXLLMHeadModel","sections":[],"depth":2},{"title":"TFTransfoXLForSequenceClassification","local":"transformers.TFTransfoXLForSequenceClassification","sections":[],"depth":2},{"title":"Internal Layers","local":"transformers.AdaptiveEmbedding","sections":[],"depth":2}],"depth":1}';function ln(k){return Ft(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _n extends zt{constructor(e){super(),jt(this,e,ln,an,Ct,{})}}export{_n as component};
