import{S as op,i as np,s as sp,e as a,k as p,w as b,t as n,M as ap,c as r,d as t,m as h,a as i,x as k,h as s,b as m,N as tp,G as e,g,y as w,q as $,o as C,B as L,v as rp,L as vt}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ut}from"../../chunks/Tip-hf-doc-builder.js";import{D as Be}from"../../chunks/Docstring-hf-doc-builder.js";import{C as yt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as _t}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Tt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function ip(F){let d,v,c,f,y;return f=new yt({props:{code:`from transformers import CTRLConfig, CTRLModel

# Initializing a CTRL configuration
configuration = CTRLConfig()

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

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

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

<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 = CTRLModel(configuration)

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

tokenizer = AutoTokenizer.from_pretrained("ctrl")
model = CTRLModel.from_pretrained("ctrl")

# CTRL was trained with control codes as the first token
inputs = tokenizer("Opinion My dog is cute", return_tensors="pt")
assert inputs["input_ids"][0, 0].item() in tokenizer.control_codes.values()

outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, CTRLModel
<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;ctrl&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CTRLModel.from_pretrained(<span class="hljs-string">&quot;ctrl&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># CTRL was trained with control codes as the first token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Opinion 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">assert</span> inputs[<span class="hljs-string">&quot;input_ids&quot;</span>][<span class="hljs-number">0</span>, <span class="hljs-number">0</span>].item() <span class="hljs-keyword">in</span> tokenizer.control_codes.values()

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

tokenizer = AutoTokenizer.from_pretrained("ctrl")
model = CTRLLMHeadModel.from_pretrained("ctrl")

# CTRL was trained with control codes as the first token
inputs = tokenizer("Wikipedia The llama is", return_tensors="pt")
assert inputs["input_ids"][0, 0].item() in tokenizer.control_codes.values()

sequence_ids = model.generate(inputs["input_ids"])
sequences = tokenizer.batch_decode(sequence_ids)
sequences

outputs = model(**inputs, labels=inputs["input_ids"])
round(outputs.loss.item(), 2)

list(outputs.logits.shape)`,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, CTRLLMHeadModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;ctrl&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CTRLLMHeadModel.from_pretrained(<span class="hljs-string">&quot;ctrl&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># CTRL was trained with control codes as the first token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Wikipedia The llama is&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> inputs[<span class="hljs-string">&quot;input_ids&quot;</span>][<span class="hljs-number">0</span>, <span class="hljs-number">0</span>].item() <span class="hljs-keyword">in</span> tokenizer.control_codes.values()

<span class="hljs-meta">&gt;&gt;&gt; </span>sequence_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>sequences = tokenizer.batch_decode(sequence_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>sequences
[<span class="hljs-string">&#x27;Wikipedia The llama is a member of the family Bovidae. It is native to the Andes of Peru,&#x27;</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><span class="hljs-built_in">round</span>(outputs.loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">9.21</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(outputs.logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">5</span>, <span class="hljs-number">246534</span>]`}}),{c(){d=a("p"),v=n("Example:"),c=p(),b(f.$$.fragment)},l(l){d=r(l,"P",{});var u=i(d);v=s(u,"Example:"),u.forEach(t),c=h(l),k(f.$$.fragment,l)},m(l,u){g(l,d,u),e(d,v),g(l,c,u),w(f,l,u),y=!0},p:vt,i(l){y||($(f.$$.fragment,l),y=!0)},o(l){C(f.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(c),L(f,l)}}}function hp(F){let d,v,c,f,y;return{c(){d=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a("code"),f=n("Module"),y=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var u=i(d);v=s(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r(u,"CODE",{});var q=i(c);f=s(q,"Module"),q.forEach(t),y=s(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){g(l,d,u),e(d,v),e(d,c),e(c,f),e(d,y)},d(l){l&&t(d)}}}function up(F){let d,v,c,f,y;return f=new yt({props:{code:`import torch
from transformers import AutoTokenizer, CTRLForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("ctrl")
model = CTRLForSequenceClassification.from_pretrained("ctrl")

# CTRL was trained with control codes as the first token
inputs = tokenizer("Opinion My dog is cute", return_tensors="pt")
assert inputs["input_ids"][0, 0].item() in tokenizer.control_codes.values()

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;ctrl&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CTRLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;ctrl&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># CTRL was trained with control codes as the first token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Opinion 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">assert</span> inputs[<span class="hljs-string">&quot;input_ids&quot;</span>][<span class="hljs-number">0</span>, <span class="hljs-number">0</span>].item() <span class="hljs-keyword">in</span> tokenizer.control_codes.values()

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
<span class="hljs-string">&#x27;LABEL_0&#x27;</span>`}}),{c(){d=a("p"),v=n("Example of single-label classification:"),c=p(),b(f.$$.fragment)},l(l){d=r(l,"P",{});var u=i(d);v=s(u,"Example of single-label classification:"),u.forEach(t),c=h(l),k(f.$$.fragment,l)},m(l,u){g(l,d,u),e(d,v),g(l,c,u),w(f,l,u),y=!0},p:vt,i(l){y||($(f.$$.fragment,l),y=!0)},o(l){C(f.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(c),L(f,l)}}}function mp(F){let d,v;return d=new yt({props:{code:`import torch

torch.manual_seed(42)
# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = CTRLForSequenceClassification.from_pretrained("ctrl", num_labels=num_labels)

labels = torch.tensor(1)
loss = model(**inputs, labels=labels).loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">42</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 = CTRLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;ctrl&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.35</span>`}}),{c(){b(d.$$.fragment)},l(c){k(d.$$.fragment,c)},m(c,f){w(d,c,f),v=!0},p:vt,i(c){v||($(d.$$.fragment,c),v=!0)},o(c){C(d.$$.fragment,c),v=!1},d(c){L(d,c)}}}function fp(F){let d,v,c,f,y;return f=new yt({props:{code:`import torch
from transformers import AutoTokenizer, CTRLForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("ctrl")
model = CTRLForSequenceClassification.from_pretrained("ctrl", problem_type="multi_label_classification")

# CTRL was trained with control codes as the first token
inputs = tokenizer("Opinion My dog is cute", return_tensors="pt")
assert inputs["input_ids"][0, 0].item() in tokenizer.control_codes.values()

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># CTRL was trained with control codes as the first token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Opinion 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">assert</span> inputs[<span class="hljs-string">&quot;input_ids&quot;</span>][<span class="hljs-number">0</span>, <span class="hljs-number">0</span>].item() <span class="hljs-keyword">in</span> tokenizer.control_codes.values()

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

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

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

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

tokenizer = AutoTokenizer.from_pretrained("ctrl")
model = TFCTRLModel.from_pretrained("ctrl")

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

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFCTRLModel
<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;ctrl&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCTRLModel.from_pretrained(<span class="hljs-string">&quot;ctrl&quot;</span>)

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

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

tokenizer = AutoTokenizer.from_pretrained("ctrl")
model = TFCTRLLMHeadModel.from_pretrained("ctrl")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
outputs = model(inputs)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFCTRLLMHeadModel
<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;ctrl&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCTRLLMHeadModel.from_pretrained(<span class="hljs-string">&quot;ctrl&quot;</span>)

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

tokenizer = AutoTokenizer.from_pretrained("ctrl")
model = TFCTRLForSequenceClassification.from_pretrained("ctrl")

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

logits = model(**inputs).logits

predicted_class_id = int(tf.math.argmax(logits, axis=-1)[0])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFCTRLForSequenceClassification
<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;ctrl&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCTRLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;ctrl&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])`}}),{c(){d=a("p"),v=n("Example:"),c=p(),b(f.$$.fragment)},l(l){d=r(l,"P",{});var u=i(d);v=s(u,"Example:"),u.forEach(t),c=h(l),k(f.$$.fragment,l)},m(l,u){g(l,d,u),e(d,v),g(l,c,u),w(f,l,u),y=!0},p:vt,i(l){y||($(f.$$.fragment,l),y=!0)},o(l){C(f.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(c),L(f,l)}}}function Lp(F){let d,v;return d=new yt({props:{code:'# To train a model on `num_labels` classes, you can pass `num_labels=num_labels` to `.from_pretrained(...)`\nnum_labels = len(model.config.id2label)\nmodel = TFCTRLForSequenceClassification.from_pretrained("ctrl", num_labels=num_labels)\n\nlabels = tf.constant(1)\nloss = model(**inputs, labels=labels).loss',highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on `num_labels` classes, you can pass `num_labels=num_labels` to `.from_pretrained(...)`</span>\n<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)\n<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCTRLForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;ctrl&quot;</span>, num_labels=num_labels)\n\n<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tf.constant(<span class="hljs-number">1</span>)\n<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss'}}),{c(){b(d.$$.fragment)},l(c){k(d.$$.fragment,c)},m(c,f){w(d,c,f),v=!0},p:vt,i(c){v||($(d.$$.fragment,c),v=!0)},o(c){C(d.$$.fragment,c),v=!1},d(c){L(d,c)}}}function Mp(F){let d,v,c,f,y,l,u,q,Ee,ke,O,ce,J,M,Fe,I,pe,Ke,K,Q,ne,W,se,qe,U,ze,we,S,je,ae,he,z,j,xe,Y,$e,ue,Z,Ce,me,x,Pe,V,fe,Se,G,D,re,H,ie,ee,Oe,ge,P,Ae,A,le,Ne,T,R,Ze,_e,X,et,E,tt,ot,Ve,nt,st,N,te,at,Ie,B,rt,it,Le,de,Te,Me,Ba,Ka,Eo,Va,Ga,oa,Mt,Bt,os,Fo,Xa,ns,Ja,na,Kt,ss,Cn,Qa,Ya,as,Ln,Za,sa,Rt,Vt,rs,qo,er,is,tr,aa,Je,zo,or,ft,nr,Mn,sr,ar,Rn,rr,ir,jo,lr,dr,cr,Et,pr,En,hr,ur,Fn,mr,fr,gr,Gt,ra,Ft,Xt,ls,xo,_r,ds,Tr,ia,Qe,Po,vr,cs,yr,br,So,kr,qn,wr,$r,Cr,zn,Oo,la,qt,Jt,ps,Ao,Lr,hs,Mr,da,De,No,Rr,us,Er,Fr,Io,qr,jn,zr,jr,xr,Do,Pr,Ho,Sr,Or,Ar,lt,Wo,Nr,zt,Ir,xn,Dr,Hr,ms,Wr,Ur,Br,Qt,Kr,Yt,ca,jt,Zt,fs,Uo,Vr,gs,Gr,pa,He,Bo,Xr,_s,Jr,Qr,Ko,Yr,Pn,Zr,ei,ti,Vo,oi,Go,ni,si,ai,dt,Xo,ri,xt,ii,Sn,li,di,Ts,ci,pi,hi,eo,ui,to,ha,Pt,oo,vs,Jo,mi,ys,fi,ua,We,Qo,gi,Ue,_i,On,Ti,vi,bs,yi,bi,ks,ki,wi,ws,$i,Ci,$s,Li,Mi,Ri,Yo,Ei,An,Fi,qi,zi,Zo,ji,en,xi,Pi,Si,ve,tn,Oi,St,Ai,Nn,Ni,Ii,Cs,Di,Hi,Wi,no,Ui,so,Bi,ao,Ki,ro,Vi,io,ma,Ot,lo,Ls,on,Gi,Ms,Xi,fa,ye,nn,Ji,Rs,Qi,Yi,sn,Zi,In,el,tl,ol,an,nl,rn,sl,al,rl,co,il,ct,ln,ll,At,dl,Dn,cl,pl,Es,hl,ul,ml,po,fl,ho,ga,Nt,uo,Fs,dn,gl,qs,_l,_a,be,cn,Tl,zs,vl,yl,pn,bl,Hn,kl,wl,$l,hn,Cl,un,Ll,Ml,Rl,mo,El,pt,mn,Fl,It,ql,Wn,zl,jl,js,xl,Pl,Sl,fo,Ol,go,Ta,Dt,_o,xs,fn,Al,Ps,Nl,va,oe,gn,Il,Ss,Dl,Hl,Un,Bn,Wl,Ul,Bl,Ye,Kl,Os,Vl,Gl,As,Xl,Jl,Ns,Ql,Yl,Is,Zl,ed,td,_n,od,Kn,nd,sd,ad,Tn,rd,vn,id,ld,dd,To,cd,Ge,yn,pd,Ht,hd,Vn,ud,md,Ds,fd,gd,_d,vo,Td,yo,vd,bo,ya;return l=new _t({}),se=new _t({}),Fo=new _t({}),qo=new _t({}),zo=new Be({props:{name:"class transformers.CTRLConfig",anchor:"transformers.CTRLConfig",parameters:[{name:"vocab_size",val:" = 246534"},{name:"n_positions",val:" = 256"},{name:"n_embd",val:" = 1280"},{name:"dff",val:" = 8192"},{name:"n_layer",val:" = 48"},{name:"n_head",val:" = 16"},{name:"resid_pdrop",val:" = 0.1"},{name:"embd_pdrop",val:" = 0.1"},{name:"layer_norm_epsilon",val:" = 1e-06"},{name:"initializer_range",val:" = 0.02"},{name:"use_cache",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CTRLConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 246534) &#x2014;
Vocabulary size of the CTRL 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.29.0/en/model_doc/ctrl#transformers.CTRLModel">CTRLModel</a> or <a href="/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.TFCTRLModel">TFCTRLModel</a>.`,name:"vocab_size"},{anchor:"transformers.CTRLConfig.n_positions",description:`<strong>n_positions</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"n_positions"},{anchor:"transformers.CTRLConfig.n_embd",description:`<strong>n_embd</strong> (<code>int</code>, <em>optional</em>, defaults to 1280) &#x2014;
Dimensionality of the embeddings and hidden states.`,name:"n_embd"},{anchor:"transformers.CTRLConfig.dff",description:`<strong>dff</strong> (<code>int</code>, <em>optional</em>, defaults to 8192) &#x2014;
Dimensionality of the inner dimension of the feed forward networks (FFN).`,name:"dff"},{anchor:"transformers.CTRLConfig.n_layer",description:`<strong>n_layer</strong> (<code>int</code>, <em>optional</em>, defaults to 48) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"n_layer"},{anchor:"transformers.CTRLConfig.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.CTRLConfig.resid_pdrop",description:`<strong>resid_pdrop</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:"resid_pdrop"},{anchor:"transformers.CTRLConfig.embd_pdrop",description:`<strong>embd_pdrop</strong> (<code>int</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the embeddings.`,name:"embd_pdrop"},{anchor:"transformers.CTRLConfig.layer_norm_epsilon",description:`<strong>layer_norm_epsilon</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-6) &#x2014;
The epsilon to use in the layer normalization layers`,name:"layer_norm_epsilon"},{anchor:"transformers.CTRLConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.CTRLConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/ctrl/configuration_ctrl.py#L26"}}),Gt=new Tt({props:{anchor:"transformers.CTRLConfig.example",$$slots:{default:[ip]},$$scope:{ctx:F}}}),xo=new _t({}),Po=new Be({props:{name:"class transformers.CTRLTokenizer",anchor:"transformers.CTRLTokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"unk_token",val:" = '<unk>'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CTRLTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.CTRLTokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.CTRLTokenizer.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"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/ctrl/tokenization_ctrl.py#L119"}}),Oo=new Be({props:{name:"save_vocabulary",anchor:"transformers.CTRLTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/ctrl/tokenization_ctrl.py#L227"}}),Ao=new _t({}),No=new Be({props:{name:"class transformers.CTRLModel",anchor:"transformers.CTRLModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.CTRLModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.CTRLConfig">CTRLConfig</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.29.0/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.29.0/src/transformers/models/ctrl/modeling_ctrl.py#L319"}}),Wo=new Be({props:{name:"forward",anchor:"transformers.CTRLModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CTRLModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else <code>past_key_values[0].shape[-2]</code>
(<code>sequence_length</code> of input past key value states). Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only input IDs that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.CTRLModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[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>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as input ids as they have already been computed.`,name:"past_key_values"},{anchor:"transformers.CTRLModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.CTRLModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.CTRLModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CTRLModel.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.CTRLModel.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.CTRLModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.CTRLModel.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.CTRLModel.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.CTRLModel.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.29.0/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.29.0/src/transformers/models/ctrl/modeling_ctrl.py#L352",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</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.29.0/en/model_doc/ctrl#transformers.CTRLConfig"
>CTRLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
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 optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qt=new Ut({props:{$$slots:{default:[lp]},$$scope:{ctx:F}}}),Yt=new Tt({props:{anchor:"transformers.CTRLModel.forward.example",$$slots:{default:[dp]},$$scope:{ctx:F}}}),Uo=new _t({}),Bo=new Be({props:{name:"class transformers.CTRLLMHeadModel",anchor:"transformers.CTRLLMHeadModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.CTRLLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.CTRLConfig">CTRLConfig</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.29.0/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.29.0/src/transformers/models/ctrl/modeling_ctrl.py#L511"}}),Xo=new Be({props:{name:"forward",anchor:"transformers.CTRLLMHeadModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CTRLLMHeadModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else <code>past_key_values[0].shape[-2]</code>
(<code>sequence_length</code> of input past key value states). Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only input IDs that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.CTRLLMHeadModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[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>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as input ids as they have already been computed.`,name:"past_key_values"},{anchor:"transformers.CTRLLMHeadModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.CTRLLMHeadModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.CTRLLMHeadModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CTRLLMHeadModel.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.CTRLLMHeadModel.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.CTRLLMHeadModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.CTRLLMHeadModel.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.CTRLLMHeadModel.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.CTRLLMHeadModel.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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.CTRLLMHeadModel.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.29.0/src/transformers/models/ctrl/modeling_ctrl.py#L535",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</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.29.0/en/model_doc/ctrl#transformers.CTRLConfig"
>CTRLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
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 optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),eo=new Ut({props:{$$slots:{default:[cp]},$$scope:{ctx:F}}}),to=new Tt({props:{anchor:"transformers.CTRLLMHeadModel.forward.example",$$slots:{default:[pp]},$$scope:{ctx:F}}}),Jo=new _t({}),Qo=new Be({props:{name:"class transformers.CTRLForSequenceClassification",anchor:"transformers.CTRLForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.CTRLForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.CTRLConfig">CTRLConfig</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.29.0/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.29.0/src/transformers/models/ctrl/modeling_ctrl.py#L653"}}),tn=new Be({props:{name:"forward",anchor:"transformers.CTRLForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CTRLForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else <code>past_key_values[0].shape[-2]</code>
(<code>sequence_length</code> of input past key value states). Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only input IDs that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.CTRLForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[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>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as input ids as they have already been computed.`,name:"past_key_values"},{anchor:"transformers.CTRLForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.CTRLForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.CTRLForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CTRLForSequenceClassification.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.CTRLForSequenceClassification.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.CTRLForSequenceClassification.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.CTRLForSequenceClassification.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.CTRLForSequenceClassification.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.CTRLForSequenceClassification.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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.CTRLForSequenceClassification.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.29.0/src/transformers/models/ctrl/modeling_ctrl.py#L663",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</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.29.0/en/model_doc/ctrl#transformers.CTRLConfig"
>CTRLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
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 optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),no=new Ut({props:{$$slots:{default:[hp]},$$scope:{ctx:F}}}),so=new Tt({props:{anchor:"transformers.CTRLForSequenceClassification.forward.example",$$slots:{default:[up]},$$scope:{ctx:F}}}),ao=new Tt({props:{anchor:"transformers.CTRLForSequenceClassification.forward.example-2",$$slots:{default:[mp]},$$scope:{ctx:F}}}),ro=new Tt({props:{anchor:"transformers.CTRLForSequenceClassification.forward.example-3",$$slots:{default:[fp]},$$scope:{ctx:F}}}),io=new Tt({props:{anchor:"transformers.CTRLForSequenceClassification.forward.example-4",$$slots:{default:[gp]},$$scope:{ctx:F}}}),on=new _t({}),nn=new Be({props:{name:"class transformers.TFCTRLModel",anchor:"transformers.TFCTRLModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFCTRLModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.CTRLConfig">CTRLConfig</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.29.0/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.29.0/src/transformers/models/ctrl/modeling_tf_ctrl.py#L530"}}),co=new Ut({props:{$$slots:{default:[_p]},$$scope:{ctx:F}}}),ln=new Be({props:{name:"call",anchor:"transformers.TFCTRLModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFCTRLModel.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past</code> is <code>None</code> else <code>past[0].shape[-2]</code> (<code>sequence_length</code> of
input past key value states).</p>
<p>Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past</code> is used, only input IDs that do not have their past calculated should be passed as <code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFCTRLModel.call.past",description:`<strong>past</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>past</code> output below). Can be used 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:"past"},{anchor:"transformers.TFCTRLModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFCTRLModel.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFCTRLModel.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFCTRLModel.call.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.TFCTRLModel.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.TFCTRLModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past</code> key value states are returned and can be used to speed up decoding (see <code>past</code>).`,name:"use_cache"},{anchor:"transformers.TFCTRLModel.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.TFCTRLModel.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.TFCTRLModel.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.29.0/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.TFCTRLModel.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.29.0/src/transformers/models/ctrl/modeling_tf_ctrl.py#L535",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPast"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPast</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.29.0/en/model_doc/ctrl#transformers.CTRLConfig"
>CTRLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPast"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPast</a> or <code>tuple(tf.Tensor)</code></p>
`}}),po=new Ut({props:{$$slots:{default:[Tp]},$$scope:{ctx:F}}}),ho=new Tt({props:{anchor:"transformers.TFCTRLModel.call.example",$$slots:{default:[vp]},$$scope:{ctx:F}}}),dn=new _t({}),cn=new Be({props:{name:"class transformers.TFCTRLLMHeadModel",anchor:"transformers.TFCTRLLMHeadModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFCTRLLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.CTRLConfig">CTRLConfig</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.29.0/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.29.0/src/transformers/models/ctrl/modeling_tf_ctrl.py#L625"}}),mo=new Ut({props:{$$slots:{default:[yp]},$$scope:{ctx:F}}}),mn=new Be({props:{name:"call",anchor:"transformers.TFCTRLLMHeadModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFCTRLLMHeadModel.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past</code> is <code>None</code> else <code>past[0].shape[-2]</code> (<code>sequence_length</code> of
input past key value states).</p>
<p>Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past</code> is used, only input IDs that do not have their past calculated should be passed as <code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFCTRLLMHeadModel.call.past",description:`<strong>past</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>past</code> output below). Can be used 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:"past"},{anchor:"transformers.TFCTRLLMHeadModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFCTRLLMHeadModel.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFCTRLLMHeadModel.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFCTRLLMHeadModel.call.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.TFCTRLLMHeadModel.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.TFCTRLLMHeadModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past</code> key value states are returned and can be used to speed up decoding (see <code>past</code>).`,name:"use_cache"},{anchor:"transformers.TFCTRLLMHeadModel.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.TFCTRLLMHeadModel.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.TFCTRLLMHeadModel.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.29.0/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.TFCTRLLMHeadModel.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.TFCTRLLMHeadModel.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.29.0/src/transformers/models/ctrl/modeling_tf_ctrl.py#L648",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithPast"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithPast</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.29.0/en/model_doc/ctrl#transformers.CTRLConfig"
>CTRLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithPast"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithPast</a> or <code>tuple(tf.Tensor)</code></p>
`}}),fo=new Ut({props:{$$slots:{default:[bp]},$$scope:{ctx:F}}}),go=new Tt({props:{anchor:"transformers.TFCTRLLMHeadModel.call.example",$$slots:{default:[kp]},$$scope:{ctx:F}}}),fn=new _t({}),gn=new Be({props:{name:"class transformers.TFCTRLForSequenceClassification",anchor:"transformers.TFCTRLForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFCTRLForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.CTRLConfig">CTRLConfig</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.29.0/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.29.0/src/transformers/models/ctrl/modeling_tf_ctrl.py#L737"}}),To=new Ut({props:{$$slots:{default:[wp]},$$scope:{ctx:F}}}),yn=new Be({props:{name:"call",anchor:"transformers.TFCTRLForSequenceClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFCTRLForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past</code> is <code>None</code> else <code>past[0].shape[-2]</code> (<code>sequence_length</code> of
input past key value states).</p>
<p>Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past</code> is used, only input IDs that do not have their past calculated should be passed as <code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFCTRLForSequenceClassification.call.past",description:`<strong>past</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>past</code> output below). Can be used 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:"past"},{anchor:"transformers.TFCTRLForSequenceClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFCTRLForSequenceClassification.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFCTRLForSequenceClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFCTRLForSequenceClassification.call.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.TFCTRLForSequenceClassification.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.TFCTRLForSequenceClassification.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past</code> key value states are returned and can be used to speed up decoding (see <code>past</code>).`,name:"use_cache"},{anchor:"transformers.TFCTRLForSequenceClassification.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.TFCTRLForSequenceClassification.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.TFCTRLForSequenceClassification.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.29.0/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.TFCTRLForSequenceClassification.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.TFCTRLForSequenceClassification.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.29.0/src/transformers/models/ctrl/modeling_tf_ctrl.py#L752",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</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.29.0/en/model_doc/ctrl#transformers.CTRLConfig"
>CTRLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),vo=new Ut({props:{$$slots:{default:[$p]},$$scope:{ctx:F}}}),yo=new Tt({props:{anchor:"transformers.TFCTRLForSequenceClassification.call.example",$$slots:{default:[Cp]},$$scope:{ctx:F}}}),bo=new Tt({props:{anchor:"transformers.TFCTRLForSequenceClassification.call.example-2",$$slots:{default:[Lp]},$$scope:{ctx:F}}}),{c(){d=a("meta"),v=p(),c=a("h1"),f=a("a"),y=a("span"),b(l.$$.fragment),u=p(),q=a("span"),Ee=n("CTRL"),ke=p(),O=a("div"),ce=a("a"),J=a("img"),Fe=p(),I=a("a"),pe=a("img"),K=p(),Q=a("h2"),ne=a("a"),W=a("span"),b(se.$$.fragment),qe=p(),U=a("span"),ze=n("Overview"),we=p(),S=a("p"),je=n("CTRL model was proposed in "),ae=a("a"),he=n("CTRL: A Conditional Transformer Language Model for Controllable Generation"),z=n(" by Nitish Shirish Keskar"),j=a("em"),xe=n(", Bryan McCann"),Y=n(`, Lav R. Varshney, Caiming Xiong and
Richard Socher. It\u2019s a causal (unidirectional) transformer pre-trained using language modeling on a very large corpus
of ~140 GB of text data with the first token reserved as a control code (such as Links, Books, Wikipedia etc.).`),$e=p(),ue=a("p"),Z=n("The abstract from the paper is the following:"),Ce=p(),me=a("p"),x=a("em"),Pe=n(`Large-scale language models show promising text generation capabilities, but users cannot easily control particular
aspects of the generated text. We release CTRL, a 1.63 billion-parameter conditional transformer language model,
trained to condition on control codes that govern style, content, and task-specific behavior. Control codes were
derived from structure that naturally co-occurs with raw text, preserving the advantages of unsupervised learning while
providing more explicit control over text generation. These codes also allow CTRL to predict which parts of the
training data are most likely given a sequence. This provides a potential method for analyzing large amounts of data
via model-based source attribution.`),V=p(),fe=a("p"),Se=n("Tips:"),G=p(),D=a("ul"),re=a("li"),H=n(`CTRL makes use of control codes to generate text: it requires generations to be started by certain words, sentences
or links to generate coherent text. Refer to the `),ie=a("a"),ee=n("original implementation"),Oe=n(` for
more information.`),ge=p(),P=a("li"),Ae=n(`CTRL is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),A=p(),le=a("li"),Ne=n(`CTRL was trained with a causal language modeling (CLM) objective and is therefore powerful at predicting the next
token in a sequence. Leveraging this feature allows CTRL to generate syntactically coherent text as it can be
observed in the `),T=a("em"),R=n("run_generation.py"),Ze=n(" example script."),_e=p(),X=a("li"),et=n("The PyTorch models can take the "),E=a("code"),tt=n("past_key_values"),ot=n(` as input, which is the previously computed key/value attention pairs.
TensorFlow models accepts `),Ve=a("code"),nt=n("past"),st=n(" as input. Using the "),N=a("code"),te=n("past_key_values"),at=n(` value prevents the model from re-computing
pre-computed values in the context of text generation. See the `),Ie=a("a"),B=a("code"),rt=n("forward"),it=n(`
method for more information on the usage of this argument.`),Le=p(),de=a("p"),Te=n("This model was contributed by "),Me=a("a"),Ba=n("keskarnitishr"),Ka=n(`. The original code can be found
`),Eo=a("a"),Va=n("here"),Ga=n("."),oa=p(),Mt=a("h2"),Bt=a("a"),os=a("span"),b(Fo.$$.fragment),Xa=p(),ns=a("span"),Ja=n("Documentation resources"),na=p(),Kt=a("ul"),ss=a("li"),Cn=a("a"),Qa=n("Text classification task guide"),Ya=p(),as=a("li"),Ln=a("a"),Za=n("Causal language modeling task guide"),sa=p(),Rt=a("h2"),Vt=a("a"),rs=a("span"),b(qo.$$.fragment),er=p(),is=a("span"),tr=n("CTRLConfig"),aa=p(),Je=a("div"),b(zo.$$.fragment),or=p(),ft=a("p"),nr=n("This is the configuration class to store the configuration of a "),Mn=a("a"),sr=n("CTRLModel"),ar=n(" or a "),Rn=a("a"),rr=n("TFCTRLModel"),ir=n(`. It is used to
instantiate a CTRL 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
`),jo=a("a"),lr=n("ctrl"),dr=n(" architecture from SalesForce."),cr=p(),Et=a("p"),pr=n("Configuration objects inherit from "),En=a("a"),hr=n("PretrainedConfig"),ur=n(` and can be used to control the model outputs. Read the
documentation from `),Fn=a("a"),mr=n("PretrainedConfig"),fr=n(" for more information."),gr=p(),b(Gt.$$.fragment),ra=p(),Ft=a("h2"),Xt=a("a"),ls=a("span"),b(xo.$$.fragment),_r=p(),ds=a("span"),Tr=n("CTRLTokenizer"),ia=p(),Qe=a("div"),b(Po.$$.fragment),vr=p(),cs=a("p"),yr=n("Construct a CTRL tokenizer. Based on Byte-Pair-Encoding."),br=p(),So=a("p"),kr=n("This tokenizer inherits from "),qn=a("a"),wr=n("PreTrainedTokenizer"),$r=n(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Cr=p(),zn=a("div"),b(Oo.$$.fragment),la=p(),qt=a("h2"),Jt=a("a"),ps=a("span"),b(Ao.$$.fragment),Lr=p(),hs=a("span"),Mr=n("CTRLModel"),da=p(),De=a("div"),b(No.$$.fragment),Rr=p(),us=a("p"),Er=n("The bare CTRL Model transformer outputting raw hidden-states without any specific head on top."),Fr=p(),Io=a("p"),qr=n("This model inherits from "),jn=a("a"),zr=n("PreTrainedModel"),jr=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),xr=p(),Do=a("p"),Pr=n("This model is also a PyTorch "),Ho=a("a"),Sr=n("torch.nn.Module"),Or=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ar=p(),lt=a("div"),b(Wo.$$.fragment),Nr=p(),zt=a("p"),Ir=n("The "),xn=a("a"),Dr=n("CTRLModel"),Hr=n(" forward method, overrides the "),ms=a("code"),Wr=n("__call__"),Ur=n(" special method."),Br=p(),b(Qt.$$.fragment),Kr=p(),b(Yt.$$.fragment),ca=p(),jt=a("h2"),Zt=a("a"),fs=a("span"),b(Uo.$$.fragment),Vr=p(),gs=a("span"),Gr=n("CTRLLMHeadModel"),pa=p(),He=a("div"),b(Bo.$$.fragment),Xr=p(),_s=a("p"),Jr=n(`The CTRL Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Qr=p(),Ko=a("p"),Yr=n("This model inherits from "),Pn=a("a"),Zr=n("PreTrainedModel"),ei=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ti=p(),Vo=a("p"),oi=n("This model is also a PyTorch "),Go=a("a"),ni=n("torch.nn.Module"),si=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ai=p(),dt=a("div"),b(Xo.$$.fragment),ri=p(),xt=a("p"),ii=n("The "),Sn=a("a"),li=n("CTRLLMHeadModel"),di=n(" forward method, overrides the "),Ts=a("code"),ci=n("__call__"),pi=n(" special method."),hi=p(),b(eo.$$.fragment),ui=p(),b(to.$$.fragment),ha=p(),Pt=a("h2"),oo=a("a"),vs=a("span"),b(Jo.$$.fragment),mi=p(),ys=a("span"),fi=n("CTRLForSequenceClassification"),ua=p(),We=a("div"),b(Qo.$$.fragment),gi=p(),Ue=a("p"),_i=n(`The CTRL Model transformer with a sequence classification head on top (linear layer).
`),On=a("a"),Ti=n("CTRLForSequenceClassification"),vi=n(` uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do. Since it does classification on the last token, it requires to know the position of the last
token. If a `),bs=a("code"),yi=n("pad_token_id"),bi=n(` is defined in the configuration, it finds the last token that is not a padding token in
each row. If no `),ks=a("code"),ki=n("pad_token_id"),wi=n(` is defined, it simply takes the last value in each row of the batch. Since it cannot
guess the padding tokens when `),ws=a("code"),$i=n("inputs_embeds"),Ci=n(" are passed instead of "),$s=a("code"),Li=n("input_ids"),Mi=n(`, it does the same (take the last
value in each row of the batch).`),Ri=p(),Yo=a("p"),Ei=n("This model inherits from "),An=a("a"),Fi=n("PreTrainedModel"),qi=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),zi=p(),Zo=a("p"),ji=n("This model is also a PyTorch "),en=a("a"),xi=n("torch.nn.Module"),Pi=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Si=p(),ve=a("div"),b(tn.$$.fragment),Oi=p(),St=a("p"),Ai=n("The "),Nn=a("a"),Ni=n("CTRLForSequenceClassification"),Ii=n(" forward method, overrides the "),Cs=a("code"),Di=n("__call__"),Hi=n(" special method."),Wi=p(),b(no.$$.fragment),Ui=p(),b(so.$$.fragment),Bi=p(),b(ao.$$.fragment),Ki=p(),b(ro.$$.fragment),Vi=p(),b(io.$$.fragment),ma=p(),Ot=a("h2"),lo=a("a"),Ls=a("span"),b(on.$$.fragment),Gi=p(),Ms=a("span"),Xi=n("TFCTRLModel"),fa=p(),ye=a("div"),b(nn.$$.fragment),Ji=p(),Rs=a("p"),Qi=n("The bare CTRL Model transformer outputting raw hidden-states without any specific head on top."),Yi=p(),sn=a("p"),Zi=n("This model inherits from "),In=a("a"),el=n("TFPreTrainedModel"),tl=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ol=p(),an=a("p"),nl=n("This model is also a "),rn=a("a"),sl=n("tf.keras.Model"),al=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),rl=p(),b(co.$$.fragment),il=p(),ct=a("div"),b(ln.$$.fragment),ll=p(),At=a("p"),dl=n("The "),Dn=a("a"),cl=n("TFCTRLModel"),pl=n(" forward method, overrides the "),Es=a("code"),hl=n("__call__"),ul=n(" special method."),ml=p(),b(po.$$.fragment),fl=p(),b(ho.$$.fragment),ga=p(),Nt=a("h2"),uo=a("a"),Fs=a("span"),b(dn.$$.fragment),gl=p(),qs=a("span"),_l=n("TFCTRLLMHeadModel"),_a=p(),be=a("div"),b(cn.$$.fragment),Tl=p(),zs=a("p"),vl=n(`The CTRL Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),yl=p(),pn=a("p"),bl=n("This model inherits from "),Hn=a("a"),kl=n("TFPreTrainedModel"),wl=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),$l=p(),hn=a("p"),Cl=n("This model is also a "),un=a("a"),Ll=n("tf.keras.Model"),Ml=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Rl=p(),b(mo.$$.fragment),El=p(),pt=a("div"),b(mn.$$.fragment),Fl=p(),It=a("p"),ql=n("The "),Wn=a("a"),zl=n("TFCTRLLMHeadModel"),jl=n(" forward method, overrides the "),js=a("code"),xl=n("__call__"),Pl=n(" special method."),Sl=p(),b(fo.$$.fragment),Ol=p(),b(go.$$.fragment),Ta=p(),Dt=a("h2"),_o=a("a"),xs=a("span"),b(fn.$$.fragment),Al=p(),Ps=a("span"),Nl=n("TFCTRLForSequenceClassification"),va=p(),oe=a("div"),b(gn.$$.fragment),Il=p(),Ss=a("p"),Dl=n("The CTRL Model transformer with a sequence classification head on top (linear layer)."),Hl=p(),Un=a("p"),Bn=a("a"),Wl=n("TFCTRLForSequenceClassification"),Ul=n(` uses the last token in order to do the classification, as other causal models
(e.g. GPT-1, GPT-2) do.`),Bl=p(),Ye=a("p"),Kl=n(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Os=a("code"),Vl=n("pad_token_id"),Gl=n(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),As=a("code"),Xl=n("pad_token_id"),Jl=n(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),Ns=a("code"),Ql=n("inputs_embeds"),Yl=n(" are passed instead of "),Is=a("code"),Zl=n("input_ids"),ed=n(`, it does the same (take the last value in
each row of the batch).`),td=p(),_n=a("p"),od=n("This model inherits from "),Kn=a("a"),nd=n("TFPreTrainedModel"),sd=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ad=p(),Tn=a("p"),rd=n("This model is also a "),vn=a("a"),id=n("tf.keras.Model"),ld=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),dd=p(),b(To.$$.fragment),cd=p(),Ge=a("div"),b(yn.$$.fragment),pd=p(),Ht=a("p"),hd=n("The "),Vn=a("a"),ud=n("TFCTRLForSequenceClassification"),md=n(" forward method, overrides the "),Ds=a("code"),fd=n("__call__"),gd=n(" special method."),_d=p(),b(vo.$$.fragment),Td=p(),b(yo.$$.fragment),vd=p(),b(bo.$$.fragment),this.h()},l(o){const _=ap('[data-svelte="svelte-1phssyn"]',document.head);d=r(_,"META",{name:!0,content:!0}),_.forEach(t),v=h(o),c=r(o,"H1",{class:!0});var bn=i(c);f=r(bn,"A",{id:!0,class:!0,href:!0});var Hs=i(f);y=r(Hs,"SPAN",{});var Ws=i(y);k(l.$$.fragment,Ws),Ws.forEach(t),Hs.forEach(t),u=h(bn),q=r(bn,"SPAN",{});var Us=i(q);Ee=s(Us,"CTRL"),Us.forEach(t),bn.forEach(t),ke=h(o),O=r(o,"DIV",{class:!0});var kn=i(O);ce=r(kn,"A",{href:!0});var Bs=i(ce);J=r(Bs,"IMG",{alt:!0,src:!0}),Bs.forEach(t),Fe=h(kn),I=r(kn,"A",{href:!0});var Ks=i(I);pe=r(Ks,"IMG",{alt:!0,src:!0}),Ks.forEach(t),kn.forEach(t),K=h(o),Q=r(o,"H2",{class:!0});var wn=i(Q);ne=r(wn,"A",{id:!0,class:!0,href:!0});var Vs=i(ne);W=r(Vs,"SPAN",{});var Gs=i(W);k(se.$$.fragment,Gs),Gs.forEach(t),Vs.forEach(t),qe=h(wn),U=r(wn,"SPAN",{});var Xs=i(U);ze=s(Xs,"Overview"),Xs.forEach(t),wn.forEach(t),we=h(o),S=r(o,"P",{});var Wt=i(S);je=s(Wt,"CTRL model was proposed in "),ae=r(Wt,"A",{href:!0,rel:!0});var Js=i(ae);he=s(Js,"CTRL: A Conditional Transformer Language Model for Controllable Generation"),Js.forEach(t),z=s(Wt," by Nitish Shirish Keskar"),j=r(Wt,"EM",{});var Qs=i(j);xe=s(Qs,", Bryan McCann"),Qs.forEach(t),Y=s(Wt,`, Lav R. Varshney, Caiming Xiong and
Richard Socher. It\u2019s a causal (unidirectional) transformer pre-trained using language modeling on a very large corpus
of ~140 GB of text data with the first token reserved as a control code (such as Links, Books, Wikipedia etc.).`),Wt.forEach(t),$e=h(o),ue=r(o,"P",{});var Ys=i(ue);Z=s(Ys,"The abstract from the paper is the following:"),Ys.forEach(t),Ce=h(o),me=r(o,"P",{});var Zs=i(me);x=r(Zs,"EM",{});var ea=i(x);Pe=s(ea,`Large-scale language models show promising text generation capabilities, but users cannot easily control particular
aspects of the generated text. We release CTRL, a 1.63 billion-parameter conditional transformer language model,
trained to condition on control codes that govern style, content, and task-specific behavior. Control codes were
derived from structure that naturally co-occurs with raw text, preserving the advantages of unsupervised learning while
providing more explicit control over text generation. These codes also allow CTRL to predict which parts of the
training data are most likely given a sequence. This provides a potential method for analyzing large amounts of data
via model-based source attribution.`),ea.forEach(t),Zs.forEach(t),V=h(o),fe=r(o,"P",{});var ta=i(fe);Se=s(ta,"Tips:"),ta.forEach(t),G=h(o),D=r(o,"UL",{});var gt=i(D);re=r(gt,"LI",{});var $n=i(re);H=s($n,`CTRL makes use of control codes to generate text: it requires generations to be started by certain words, sentences
or links to generate coherent text. Refer to the `),ie=r($n,"A",{href:!0,rel:!0});var bd=i(ie);ee=s(bd,"original implementation"),bd.forEach(t),Oe=s($n,` for
more information.`),$n.forEach(t),ge=h(gt),P=r(gt,"LI",{});var kd=i(P);Ae=s(kd,`CTRL is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),kd.forEach(t),A=h(gt),le=r(gt,"LI",{});var ba=i(le);Ne=s(ba,`CTRL was trained with a causal language modeling (CLM) objective and is therefore powerful at predicting the next
token in a sequence. Leveraging this feature allows CTRL to generate syntactically coherent text as it can be
observed in the `),T=r(ba,"EM",{});var wd=i(T);R=s(wd,"run_generation.py"),wd.forEach(t),Ze=s(ba," example script."),ba.forEach(t),_e=h(gt),X=r(gt,"LI",{});var bt=i(X);et=s(bt,"The PyTorch models can take the "),E=r(bt,"CODE",{});var $d=i(E);tt=s($d,"past_key_values"),$d.forEach(t),ot=s(bt,` as input, which is the previously computed key/value attention pairs.
TensorFlow models accepts `),Ve=r(bt,"CODE",{});var Cd=i(Ve);nt=s(Cd,"past"),Cd.forEach(t),st=s(bt," as input. Using the "),N=r(bt,"CODE",{});var Ld=i(N);te=s(Ld,"past_key_values"),Ld.forEach(t),at=s(bt,` value prevents the model from re-computing
pre-computed values in the context of text generation. See the `),Ie=r(bt,"A",{href:!0});var Md=i(Ie);B=r(Md,"CODE",{});var Rd=i(B);rt=s(Rd,"forward"),Rd.forEach(t),Md.forEach(t),it=s(bt,`
method for more information on the usage of this argument.`),bt.forEach(t),gt.forEach(t),Le=h(o),de=r(o,"P",{});var Gn=i(de);Te=s(Gn,"This model was contributed by "),Me=r(Gn,"A",{href:!0,rel:!0});var Ed=i(Me);Ba=s(Ed,"keskarnitishr"),Ed.forEach(t),Ka=s(Gn,`. The original code can be found
`),Eo=r(Gn,"A",{href:!0,rel:!0});var Fd=i(Eo);Va=s(Fd,"here"),Fd.forEach(t),Ga=s(Gn,"."),Gn.forEach(t),oa=h(o),Mt=r(o,"H2",{class:!0});var ka=i(Mt);Bt=r(ka,"A",{id:!0,class:!0,href:!0});var qd=i(Bt);os=r(qd,"SPAN",{});var zd=i(os);k(Fo.$$.fragment,zd),zd.forEach(t),qd.forEach(t),Xa=h(ka),ns=r(ka,"SPAN",{});var jd=i(ns);Ja=s(jd,"Documentation resources"),jd.forEach(t),ka.forEach(t),na=h(o),Kt=r(o,"UL",{});var wa=i(Kt);ss=r(wa,"LI",{});var xd=i(ss);Cn=r(xd,"A",{href:!0});var Pd=i(Cn);Qa=s(Pd,"Text classification task guide"),Pd.forEach(t),xd.forEach(t),Ya=h(wa),as=r(wa,"LI",{});var Sd=i(as);Ln=r(Sd,"A",{href:!0});var Od=i(Ln);Za=s(Od,"Causal language modeling task guide"),Od.forEach(t),Sd.forEach(t),wa.forEach(t),sa=h(o),Rt=r(o,"H2",{class:!0});var $a=i(Rt);Vt=r($a,"A",{id:!0,class:!0,href:!0});var Ad=i(Vt);rs=r(Ad,"SPAN",{});var Nd=i(rs);k(qo.$$.fragment,Nd),Nd.forEach(t),Ad.forEach(t),er=h($a),is=r($a,"SPAN",{});var Id=i(is);tr=s(Id,"CTRLConfig"),Id.forEach(t),$a.forEach(t),aa=h(o),Je=r(o,"DIV",{class:!0});var ko=i(Je);k(zo.$$.fragment,ko),or=h(ko),ft=r(ko,"P",{});var wo=i(ft);nr=s(wo,"This is the configuration class to store the configuration of a "),Mn=r(wo,"A",{href:!0});var Dd=i(Mn);sr=s(Dd,"CTRLModel"),Dd.forEach(t),ar=s(wo," or a "),Rn=r(wo,"A",{href:!0});var Hd=i(Rn);rr=s(Hd,"TFCTRLModel"),Hd.forEach(t),ir=s(wo,`. It is used to
instantiate a CTRL 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
`),jo=r(wo,"A",{href:!0,rel:!0});var Wd=i(jo);lr=s(Wd,"ctrl"),Wd.forEach(t),dr=s(wo," architecture from SalesForce."),wo.forEach(t),cr=h(ko),Et=r(ko,"P",{});var Xn=i(Et);pr=s(Xn,"Configuration objects inherit from "),En=r(Xn,"A",{href:!0});var Ud=i(En);hr=s(Ud,"PretrainedConfig"),Ud.forEach(t),ur=s(Xn,` and can be used to control the model outputs. Read the
documentation from `),Fn=r(Xn,"A",{href:!0});var Bd=i(Fn);mr=s(Bd,"PretrainedConfig"),Bd.forEach(t),fr=s(Xn," for more information."),Xn.forEach(t),gr=h(ko),k(Gt.$$.fragment,ko),ko.forEach(t),ra=h(o),Ft=r(o,"H2",{class:!0});var Ca=i(Ft);Xt=r(Ca,"A",{id:!0,class:!0,href:!0});var Kd=i(Xt);ls=r(Kd,"SPAN",{});var Vd=i(ls);k(xo.$$.fragment,Vd),Vd.forEach(t),Kd.forEach(t),_r=h(Ca),ds=r(Ca,"SPAN",{});var Gd=i(ds);Tr=s(Gd,"CTRLTokenizer"),Gd.forEach(t),Ca.forEach(t),ia=h(o),Qe=r(o,"DIV",{class:!0});var $o=i(Qe);k(Po.$$.fragment,$o),vr=h($o),cs=r($o,"P",{});var Xd=i(cs);yr=s(Xd,"Construct a CTRL tokenizer. Based on Byte-Pair-Encoding."),Xd.forEach(t),br=h($o),So=r($o,"P",{});var La=i(So);kr=s(La,"This tokenizer inherits from "),qn=r(La,"A",{href:!0});var Jd=i(qn);wr=s(Jd,"PreTrainedTokenizer"),Jd.forEach(t),$r=s(La,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),La.forEach(t),Cr=h($o),zn=r($o,"DIV",{class:!0});var Qd=i(zn);k(Oo.$$.fragment,Qd),Qd.forEach(t),$o.forEach(t),la=h(o),qt=r(o,"H2",{class:!0});var Ma=i(qt);Jt=r(Ma,"A",{id:!0,class:!0,href:!0});var Yd=i(Jt);ps=r(Yd,"SPAN",{});var Zd=i(ps);k(Ao.$$.fragment,Zd),Zd.forEach(t),Yd.forEach(t),Lr=h(Ma),hs=r(Ma,"SPAN",{});var ec=i(hs);Mr=s(ec,"CTRLModel"),ec.forEach(t),Ma.forEach(t),da=h(o),De=r(o,"DIV",{class:!0});var kt=i(De);k(No.$$.fragment,kt),Rr=h(kt),us=r(kt,"P",{});var tc=i(us);Er=s(tc,"The bare CTRL Model transformer outputting raw hidden-states without any specific head on top."),tc.forEach(t),Fr=h(kt),Io=r(kt,"P",{});var Ra=i(Io);qr=s(Ra,"This model inherits from "),jn=r(Ra,"A",{href:!0});var oc=i(jn);zr=s(oc,"PreTrainedModel"),oc.forEach(t),jr=s(Ra,`. 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.)`),Ra.forEach(t),xr=h(kt),Do=r(kt,"P",{});var Ea=i(Do);Pr=s(Ea,"This model is also a PyTorch "),Ho=r(Ea,"A",{href:!0,rel:!0});var nc=i(Ho);Sr=s(nc,"torch.nn.Module"),nc.forEach(t),Or=s(Ea,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ea.forEach(t),Ar=h(kt),lt=r(kt,"DIV",{class:!0});var Co=i(lt);k(Wo.$$.fragment,Co),Nr=h(Co),zt=r(Co,"P",{});var Jn=i(zt);Ir=s(Jn,"The "),xn=r(Jn,"A",{href:!0});var sc=i(xn);Dr=s(sc,"CTRLModel"),sc.forEach(t),Hr=s(Jn," forward method, overrides the "),ms=r(Jn,"CODE",{});var ac=i(ms);Wr=s(ac,"__call__"),ac.forEach(t),Ur=s(Jn," special method."),Jn.forEach(t),Br=h(Co),k(Qt.$$.fragment,Co),Kr=h(Co),k(Yt.$$.fragment,Co),Co.forEach(t),kt.forEach(t),ca=h(o),jt=r(o,"H2",{class:!0});var Fa=i(jt);Zt=r(Fa,"A",{id:!0,class:!0,href:!0});var rc=i(Zt);fs=r(rc,"SPAN",{});var ic=i(fs);k(Uo.$$.fragment,ic),ic.forEach(t),rc.forEach(t),Vr=h(Fa),gs=r(Fa,"SPAN",{});var lc=i(gs);Gr=s(lc,"CTRLLMHeadModel"),lc.forEach(t),Fa.forEach(t),pa=h(o),He=r(o,"DIV",{class:!0});var wt=i(He);k(Bo.$$.fragment,wt),Xr=h(wt),_s=r(wt,"P",{});var dc=i(_s);Jr=s(dc,`The CTRL Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),dc.forEach(t),Qr=h(wt),Ko=r(wt,"P",{});var qa=i(Ko);Yr=s(qa,"This model inherits from "),Pn=r(qa,"A",{href:!0});var cc=i(Pn);Zr=s(cc,"PreTrainedModel"),cc.forEach(t),ei=s(qa,`. 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.)`),qa.forEach(t),ti=h(wt),Vo=r(wt,"P",{});var za=i(Vo);oi=s(za,"This model is also a PyTorch "),Go=r(za,"A",{href:!0,rel:!0});var pc=i(Go);ni=s(pc,"torch.nn.Module"),pc.forEach(t),si=s(za,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),za.forEach(t),ai=h(wt),dt=r(wt,"DIV",{class:!0});var Lo=i(dt);k(Xo.$$.fragment,Lo),ri=h(Lo),xt=r(Lo,"P",{});var Qn=i(xt);ii=s(Qn,"The "),Sn=r(Qn,"A",{href:!0});var hc=i(Sn);li=s(hc,"CTRLLMHeadModel"),hc.forEach(t),di=s(Qn," forward method, overrides the "),Ts=r(Qn,"CODE",{});var uc=i(Ts);ci=s(uc,"__call__"),uc.forEach(t),pi=s(Qn," special method."),Qn.forEach(t),hi=h(Lo),k(eo.$$.fragment,Lo),ui=h(Lo),k(to.$$.fragment,Lo),Lo.forEach(t),wt.forEach(t),ha=h(o),Pt=r(o,"H2",{class:!0});var ja=i(Pt);oo=r(ja,"A",{id:!0,class:!0,href:!0});var mc=i(oo);vs=r(mc,"SPAN",{});var fc=i(vs);k(Jo.$$.fragment,fc),fc.forEach(t),mc.forEach(t),mi=h(ja),ys=r(ja,"SPAN",{});var gc=i(ys);fi=s(gc,"CTRLForSequenceClassification"),gc.forEach(t),ja.forEach(t),ua=h(o),We=r(o,"DIV",{class:!0});var $t=i(We);k(Qo.$$.fragment,$t),gi=h($t),Ue=r($t,"P",{});var ht=i(Ue);_i=s(ht,`The CTRL Model transformer with a sequence classification head on top (linear layer).
`),On=r(ht,"A",{href:!0});var _c=i(On);Ti=s(_c,"CTRLForSequenceClassification"),_c.forEach(t),vi=s(ht,` uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do. Since it does classification on the last token, it requires to know the position of the last
token. If a `),bs=r(ht,"CODE",{});var Tc=i(bs);yi=s(Tc,"pad_token_id"),Tc.forEach(t),bi=s(ht,` is defined in the configuration, it finds the last token that is not a padding token in
each row. If no `),ks=r(ht,"CODE",{});var vc=i(ks);ki=s(vc,"pad_token_id"),vc.forEach(t),wi=s(ht,` is defined, it simply takes the last value in each row of the batch. Since it cannot
guess the padding tokens when `),ws=r(ht,"CODE",{});var yc=i(ws);$i=s(yc,"inputs_embeds"),yc.forEach(t),Ci=s(ht," are passed instead of "),$s=r(ht,"CODE",{});var bc=i($s);Li=s(bc,"input_ids"),bc.forEach(t),Mi=s(ht,`, it does the same (take the last
value in each row of the batch).`),ht.forEach(t),Ri=h($t),Yo=r($t,"P",{});var xa=i(Yo);Ei=s(xa,"This model inherits from "),An=r(xa,"A",{href:!0});var kc=i(An);Fi=s(kc,"PreTrainedModel"),kc.forEach(t),qi=s(xa,`. 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.)`),xa.forEach(t),zi=h($t),Zo=r($t,"P",{});var Pa=i(Zo);ji=s(Pa,"This model is also a PyTorch "),en=r(Pa,"A",{href:!0,rel:!0});var wc=i(en);xi=s(wc,"torch.nn.Module"),wc.forEach(t),Pi=s(Pa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Pa.forEach(t),Si=h($t),ve=r($t,"DIV",{class:!0});var Xe=i(ve);k(tn.$$.fragment,Xe),Oi=h(Xe),St=r(Xe,"P",{});var Yn=i(St);Ai=s(Yn,"The "),Nn=r(Yn,"A",{href:!0});var $c=i(Nn);Ni=s($c,"CTRLForSequenceClassification"),$c.forEach(t),Ii=s(Yn," forward method, overrides the "),Cs=r(Yn,"CODE",{});var Cc=i(Cs);Di=s(Cc,"__call__"),Cc.forEach(t),Hi=s(Yn," special method."),Yn.forEach(t),Wi=h(Xe),k(no.$$.fragment,Xe),Ui=h(Xe),k(so.$$.fragment,Xe),Bi=h(Xe),k(ao.$$.fragment,Xe),Ki=h(Xe),k(ro.$$.fragment,Xe),Vi=h(Xe),k(io.$$.fragment,Xe),Xe.forEach(t),$t.forEach(t),ma=h(o),Ot=r(o,"H2",{class:!0});var Sa=i(Ot);lo=r(Sa,"A",{id:!0,class:!0,href:!0});var Lc=i(lo);Ls=r(Lc,"SPAN",{});var Mc=i(Ls);k(on.$$.fragment,Mc),Mc.forEach(t),Lc.forEach(t),Gi=h(Sa),Ms=r(Sa,"SPAN",{});var Rc=i(Ms);Xi=s(Rc,"TFCTRLModel"),Rc.forEach(t),Sa.forEach(t),fa=h(o),ye=r(o,"DIV",{class:!0});var ut=i(ye);k(nn.$$.fragment,ut),Ji=h(ut),Rs=r(ut,"P",{});var Ec=i(Rs);Qi=s(Ec,"The bare CTRL Model transformer outputting raw hidden-states without any specific head on top."),Ec.forEach(t),Yi=h(ut),sn=r(ut,"P",{});var Oa=i(sn);Zi=s(Oa,"This model inherits from "),In=r(Oa,"A",{href:!0});var Fc=i(In);el=s(Fc,"TFPreTrainedModel"),Fc.forEach(t),tl=s(Oa,`. 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.)`),Oa.forEach(t),ol=h(ut),an=r(ut,"P",{});var Aa=i(an);nl=s(Aa,"This model is also a "),rn=r(Aa,"A",{href:!0,rel:!0});var qc=i(rn);sl=s(qc,"tf.keras.Model"),qc.forEach(t),al=s(Aa,` 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.`),Aa.forEach(t),rl=h(ut),k(co.$$.fragment,ut),il=h(ut),ct=r(ut,"DIV",{class:!0});var Mo=i(ct);k(ln.$$.fragment,Mo),ll=h(Mo),At=r(Mo,"P",{});var Zn=i(At);dl=s(Zn,"The "),Dn=r(Zn,"A",{href:!0});var zc=i(Dn);cl=s(zc,"TFCTRLModel"),zc.forEach(t),pl=s(Zn," forward method, overrides the "),Es=r(Zn,"CODE",{});var jc=i(Es);hl=s(jc,"__call__"),jc.forEach(t),ul=s(Zn," special method."),Zn.forEach(t),ml=h(Mo),k(po.$$.fragment,Mo),fl=h(Mo),k(ho.$$.fragment,Mo),Mo.forEach(t),ut.forEach(t),ga=h(o),Nt=r(o,"H2",{class:!0});var Na=i(Nt);uo=r(Na,"A",{id:!0,class:!0,href:!0});var xc=i(uo);Fs=r(xc,"SPAN",{});var Pc=i(Fs);k(dn.$$.fragment,Pc),Pc.forEach(t),xc.forEach(t),gl=h(Na),qs=r(Na,"SPAN",{});var Sc=i(qs);_l=s(Sc,"TFCTRLLMHeadModel"),Sc.forEach(t),Na.forEach(t),_a=h(o),be=r(o,"DIV",{class:!0});var mt=i(be);k(cn.$$.fragment,mt),Tl=h(mt),zs=r(mt,"P",{});var Oc=i(zs);vl=s(Oc,`The CTRL Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Oc.forEach(t),yl=h(mt),pn=r(mt,"P",{});var Ia=i(pn);bl=s(Ia,"This model inherits from "),Hn=r(Ia,"A",{href:!0});var Ac=i(Hn);kl=s(Ac,"TFPreTrainedModel"),Ac.forEach(t),wl=s(Ia,`. 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.)`),Ia.forEach(t),$l=h(mt),hn=r(mt,"P",{});var Da=i(hn);Cl=s(Da,"This model is also a "),un=r(Da,"A",{href:!0,rel:!0});var Nc=i(un);Ll=s(Nc,"tf.keras.Model"),Nc.forEach(t),Ml=s(Da,` 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.`),Da.forEach(t),Rl=h(mt),k(mo.$$.fragment,mt),El=h(mt),pt=r(mt,"DIV",{class:!0});var Ro=i(pt);k(mn.$$.fragment,Ro),Fl=h(Ro),It=r(Ro,"P",{});var es=i(It);ql=s(es,"The "),Wn=r(es,"A",{href:!0});var Ic=i(Wn);zl=s(Ic,"TFCTRLLMHeadModel"),Ic.forEach(t),jl=s(es," forward method, overrides the "),js=r(es,"CODE",{});var Dc=i(js);xl=s(Dc,"__call__"),Dc.forEach(t),Pl=s(es," special method."),es.forEach(t),Sl=h(Ro),k(fo.$$.fragment,Ro),Ol=h(Ro),k(go.$$.fragment,Ro),Ro.forEach(t),mt.forEach(t),Ta=h(o),Dt=r(o,"H2",{class:!0});var Ha=i(Dt);_o=r(Ha,"A",{id:!0,class:!0,href:!0});var Hc=i(_o);xs=r(Hc,"SPAN",{});var Wc=i(xs);k(fn.$$.fragment,Wc),Wc.forEach(t),Hc.forEach(t),Al=h(Ha),Ps=r(Ha,"SPAN",{});var Uc=i(Ps);Nl=s(Uc,"TFCTRLForSequenceClassification"),Uc.forEach(t),Ha.forEach(t),va=h(o),oe=r(o,"DIV",{class:!0});var Re=i(oe);k(gn.$$.fragment,Re),Il=h(Re),Ss=r(Re,"P",{});var Bc=i(Ss);Dl=s(Bc,"The CTRL Model transformer with a sequence classification head on top (linear layer)."),Bc.forEach(t),Hl=h(Re),Un=r(Re,"P",{});var yd=i(Un);Bn=r(yd,"A",{href:!0});var Kc=i(Bn);Wl=s(Kc,"TFCTRLForSequenceClassification"),Kc.forEach(t),Ul=s(yd,` uses the last token in order to do the classification, as other causal models
(e.g. GPT-1, GPT-2) do.`),yd.forEach(t),Bl=h(Re),Ye=r(Re,"P",{});var Ct=i(Ye);Kl=s(Ct,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Os=r(Ct,"CODE",{});var Vc=i(Os);Vl=s(Vc,"pad_token_id"),Vc.forEach(t),Gl=s(Ct,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),As=r(Ct,"CODE",{});var Gc=i(As);Xl=s(Gc,"pad_token_id"),Gc.forEach(t),Jl=s(Ct,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),Ns=r(Ct,"CODE",{});var Xc=i(Ns);Ql=s(Xc,"inputs_embeds"),Xc.forEach(t),Yl=s(Ct," are passed instead of "),Is=r(Ct,"CODE",{});var Jc=i(Is);Zl=s(Jc,"input_ids"),Jc.forEach(t),ed=s(Ct,`, it does the same (take the last value in
each row of the batch).`),Ct.forEach(t),td=h(Re),_n=r(Re,"P",{});var Wa=i(_n);od=s(Wa,"This model inherits from "),Kn=r(Wa,"A",{href:!0});var Qc=i(Kn);nd=s(Qc,"TFPreTrainedModel"),Qc.forEach(t),sd=s(Wa,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Wa.forEach(t),ad=h(Re),Tn=r(Re,"P",{});var Ua=i(Tn);rd=s(Ua,"This model is also a "),vn=r(Ua,"A",{href:!0,rel:!0});var Yc=i(vn);id=s(Yc,"tf.keras.Model"),Yc.forEach(t),ld=s(Ua,` 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.`),Ua.forEach(t),dd=h(Re),k(To.$$.fragment,Re),cd=h(Re),Ge=r(Re,"DIV",{class:!0});var Lt=i(Ge);k(yn.$$.fragment,Lt),pd=h(Lt),Ht=r(Lt,"P",{});var ts=i(Ht);hd=s(ts,"The "),Vn=r(ts,"A",{href:!0});var Zc=i(Vn);ud=s(Zc,"TFCTRLForSequenceClassification"),Zc.forEach(t),md=s(ts," forward method, overrides the "),Ds=r(ts,"CODE",{});var ep=i(Ds);fd=s(ep,"__call__"),ep.forEach(t),gd=s(ts," special method."),ts.forEach(t),_d=h(Lt),k(vo.$$.fragment,Lt),Td=h(Lt),k(yo.$$.fragment,Lt),vd=h(Lt),k(bo.$$.fragment,Lt),Lt.forEach(t),Re.forEach(t),this.h()},h(){m(d,"name","hf:doc:metadata"),m(d,"content",JSON.stringify(Rp)),m(f,"id","ctrl"),m(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(f,"href","#ctrl"),m(c,"class","relative group"),m(J,"alt","Models"),tp(J.src,M="https://img.shields.io/badge/All_model_pages-ctrl-blueviolet")||m(J,"src",M),m(ce,"href","https://huggingface.co/models?filter=ctrl"),m(pe,"alt","Spaces"),tp(pe.src,Ke="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||m(pe,"src",Ke),m(I,"href","https://huggingface.co/spaces/docs-demos/tiny-ctrl"),m(O,"class","flex flex-wrap space-x-1"),m(ne,"id","overview"),m(ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(ne,"href","#overview"),m(Q,"class","relative group"),m(ae,"href","https://arxiv.org/abs/1909.05858"),m(ae,"rel","nofollow"),m(ie,"href","https://github.com/salesforce/ctrl"),m(ie,"rel","nofollow"),m(Ie,"href","model_doc/ctrl#transformers.CTRLModel.forward"),m(Me,"href","https://huggingface.co/keskarnitishr"),m(Me,"rel","nofollow"),m(Eo,"href","https://github.com/salesforce/ctrl"),m(Eo,"rel","nofollow"),m(Bt,"id","documentation-resources"),m(Bt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Bt,"href","#documentation-resources"),m(Mt,"class","relative group"),m(Cn,"href","../tasks/sequence_classification"),m(Ln,"href","../tasks/language_modeling"),m(Vt,"id","transformers.CTRLConfig"),m(Vt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Vt,"href","#transformers.CTRLConfig"),m(Rt,"class","relative group"),m(Mn,"href","/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.CTRLModel"),m(Rn,"href","/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.TFCTRLModel"),m(jo,"href","https://huggingface.co/ctrl"),m(jo,"rel","nofollow"),m(En,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),m(Fn,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),m(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Xt,"id","transformers.CTRLTokenizer"),m(Xt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Xt,"href","#transformers.CTRLTokenizer"),m(Ft,"class","relative group"),m(qn,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(zn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Jt,"id","transformers.CTRLModel"),m(Jt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Jt,"href","#transformers.CTRLModel"),m(qt,"class","relative group"),m(jn,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),m(Ho,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Ho,"rel","nofollow"),m(xn,"href","/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.CTRLModel"),m(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Zt,"id","transformers.CTRLLMHeadModel"),m(Zt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Zt,"href","#transformers.CTRLLMHeadModel"),m(jt,"class","relative group"),m(Pn,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),m(Go,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Go,"rel","nofollow"),m(Sn,"href","/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.CTRLLMHeadModel"),m(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(oo,"id","transformers.CTRLForSequenceClassification"),m(oo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(oo,"href","#transformers.CTRLForSequenceClassification"),m(Pt,"class","relative group"),m(On,"href","/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.CTRLForSequenceClassification"),m(An,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),m(en,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(en,"rel","nofollow"),m(Nn,"href","/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.CTRLForSequenceClassification"),m(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(lo,"id","transformers.TFCTRLModel"),m(lo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(lo,"href","#transformers.TFCTRLModel"),m(Ot,"class","relative group"),m(In,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(rn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(rn,"rel","nofollow"),m(Dn,"href","/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.TFCTRLModel"),m(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(uo,"id","transformers.TFCTRLLMHeadModel"),m(uo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(uo,"href","#transformers.TFCTRLLMHeadModel"),m(Nt,"class","relative group"),m(Hn,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(un,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(un,"rel","nofollow"),m(Wn,"href","/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.TFCTRLLMHeadModel"),m(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(_o,"id","transformers.TFCTRLForSequenceClassification"),m(_o,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(_o,"href","#transformers.TFCTRLForSequenceClassification"),m(Dt,"class","relative group"),m(Bn,"href","/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.TFCTRLForSequenceClassification"),m(Kn,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(vn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(vn,"rel","nofollow"),m(Vn,"href","/docs/transformers/v4.29.0/en/model_doc/ctrl#transformers.TFCTRLForSequenceClassification"),m(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,_){e(document.head,d),g(o,v,_),g(o,c,_),e(c,f),e(f,y),w(l,y,null),e(c,u),e(c,q),e(q,Ee),g(o,ke,_),g(o,O,_),e(O,ce),e(ce,J),e(O,Fe),e(O,I),e(I,pe),g(o,K,_),g(o,Q,_),e(Q,ne),e(ne,W),w(se,W,null),e(Q,qe),e(Q,U),e(U,ze),g(o,we,_),g(o,S,_),e(S,je),e(S,ae),e(ae,he),e(S,z),e(S,j),e(j,xe),e(S,Y),g(o,$e,_),g(o,ue,_),e(ue,Z),g(o,Ce,_),g(o,me,_),e(me,x),e(x,Pe),g(o,V,_),g(o,fe,_),e(fe,Se),g(o,G,_),g(o,D,_),e(D,re),e(re,H),e(re,ie),e(ie,ee),e(re,Oe),e(D,ge),e(D,P),e(P,Ae),e(D,A),e(D,le),e(le,Ne),e(le,T),e(T,R),e(le,Ze),e(D,_e),e(D,X),e(X,et),e(X,E),e(E,tt),e(X,ot),e(X,Ve),e(Ve,nt),e(X,st),e(X,N),e(N,te),e(X,at),e(X,Ie),e(Ie,B),e(B,rt),e(X,it),g(o,Le,_),g(o,de,_),e(de,Te),e(de,Me),e(Me,Ba),e(de,Ka),e(de,Eo),e(Eo,Va),e(de,Ga),g(o,oa,_),g(o,Mt,_),e(Mt,Bt),e(Bt,os),w(Fo,os,null),e(Mt,Xa),e(Mt,ns),e(ns,Ja),g(o,na,_),g(o,Kt,_),e(Kt,ss),e(ss,Cn),e(Cn,Qa),e(Kt,Ya),e(Kt,as),e(as,Ln),e(Ln,Za),g(o,sa,_),g(o,Rt,_),e(Rt,Vt),e(Vt,rs),w(qo,rs,null),e(Rt,er),e(Rt,is),e(is,tr),g(o,aa,_),g(o,Je,_),w(zo,Je,null),e(Je,or),e(Je,ft),e(ft,nr),e(ft,Mn),e(Mn,sr),e(ft,ar),e(ft,Rn),e(Rn,rr),e(ft,ir),e(ft,jo),e(jo,lr),e(ft,dr),e(Je,cr),e(Je,Et),e(Et,pr),e(Et,En),e(En,hr),e(Et,ur),e(Et,Fn),e(Fn,mr),e(Et,fr),e(Je,gr),w(Gt,Je,null),g(o,ra,_),g(o,Ft,_),e(Ft,Xt),e(Xt,ls),w(xo,ls,null),e(Ft,_r),e(Ft,ds),e(ds,Tr),g(o,ia,_),g(o,Qe,_),w(Po,Qe,null),e(Qe,vr),e(Qe,cs),e(cs,yr),e(Qe,br),e(Qe,So),e(So,kr),e(So,qn),e(qn,wr),e(So,$r),e(Qe,Cr),e(Qe,zn),w(Oo,zn,null),g(o,la,_),g(o,qt,_),e(qt,Jt),e(Jt,ps),w(Ao,ps,null),e(qt,Lr),e(qt,hs),e(hs,Mr),g(o,da,_),g(o,De,_),w(No,De,null),e(De,Rr),e(De,us),e(us,Er),e(De,Fr),e(De,Io),e(Io,qr),e(Io,jn),e(jn,zr),e(Io,jr),e(De,xr),e(De,Do),e(Do,Pr),e(Do,Ho),e(Ho,Sr),e(Do,Or),e(De,Ar),e(De,lt),w(Wo,lt,null),e(lt,Nr),e(lt,zt),e(zt,Ir),e(zt,xn),e(xn,Dr),e(zt,Hr),e(zt,ms),e(ms,Wr),e(zt,Ur),e(lt,Br),w(Qt,lt,null),e(lt,Kr),w(Yt,lt,null),g(o,ca,_),g(o,jt,_),e(jt,Zt),e(Zt,fs),w(Uo,fs,null),e(jt,Vr),e(jt,gs),e(gs,Gr),g(o,pa,_),g(o,He,_),w(Bo,He,null),e(He,Xr),e(He,_s),e(_s,Jr),e(He,Qr),e(He,Ko),e(Ko,Yr),e(Ko,Pn),e(Pn,Zr),e(Ko,ei),e(He,ti),e(He,Vo),e(Vo,oi),e(Vo,Go),e(Go,ni),e(Vo,si),e(He,ai),e(He,dt),w(Xo,dt,null),e(dt,ri),e(dt,xt),e(xt,ii),e(xt,Sn),e(Sn,li),e(xt,di),e(xt,Ts),e(Ts,ci),e(xt,pi),e(dt,hi),w(eo,dt,null),e(dt,ui),w(to,dt,null),g(o,ha,_),g(o,Pt,_),e(Pt,oo),e(oo,vs),w(Jo,vs,null),e(Pt,mi),e(Pt,ys),e(ys,fi),g(o,ua,_),g(o,We,_),w(Qo,We,null),e(We,gi),e(We,Ue),e(Ue,_i),e(Ue,On),e(On,Ti),e(Ue,vi),e(Ue,bs),e(bs,yi),e(Ue,bi),e(Ue,ks),e(ks,ki),e(Ue,wi),e(Ue,ws),e(ws,$i),e(Ue,Ci),e(Ue,$s),e($s,Li),e(Ue,Mi),e(We,Ri),e(We,Yo),e(Yo,Ei),e(Yo,An),e(An,Fi),e(Yo,qi),e(We,zi),e(We,Zo),e(Zo,ji),e(Zo,en),e(en,xi),e(Zo,Pi),e(We,Si),e(We,ve),w(tn,ve,null),e(ve,Oi),e(ve,St),e(St,Ai),e(St,Nn),e(Nn,Ni),e(St,Ii),e(St,Cs),e(Cs,Di),e(St,Hi),e(ve,Wi),w(no,ve,null),e(ve,Ui),w(so,ve,null),e(ve,Bi),w(ao,ve,null),e(ve,Ki),w(ro,ve,null),e(ve,Vi),w(io,ve,null),g(o,ma,_),g(o,Ot,_),e(Ot,lo),e(lo,Ls),w(on,Ls,null),e(Ot,Gi),e(Ot,Ms),e(Ms,Xi),g(o,fa,_),g(o,ye,_),w(nn,ye,null),e(ye,Ji),e(ye,Rs),e(Rs,Qi),e(ye,Yi),e(ye,sn),e(sn,Zi),e(sn,In),e(In,el),e(sn,tl),e(ye,ol),e(ye,an),e(an,nl),e(an,rn),e(rn,sl),e(an,al),e(ye,rl),w(co,ye,null),e(ye,il),e(ye,ct),w(ln,ct,null),e(ct,ll),e(ct,At),e(At,dl),e(At,Dn),e(Dn,cl),e(At,pl),e(At,Es),e(Es,hl),e(At,ul),e(ct,ml),w(po,ct,null),e(ct,fl),w(ho,ct,null),g(o,ga,_),g(o,Nt,_),e(Nt,uo),e(uo,Fs),w(dn,Fs,null),e(Nt,gl),e(Nt,qs),e(qs,_l),g(o,_a,_),g(o,be,_),w(cn,be,null),e(be,Tl),e(be,zs),e(zs,vl),e(be,yl),e(be,pn),e(pn,bl),e(pn,Hn),e(Hn,kl),e(pn,wl),e(be,$l),e(be,hn),e(hn,Cl),e(hn,un),e(un,Ll),e(hn,Ml),e(be,Rl),w(mo,be,null),e(be,El),e(be,pt),w(mn,pt,null),e(pt,Fl),e(pt,It),e(It,ql),e(It,Wn),e(Wn,zl),e(It,jl),e(It,js),e(js,xl),e(It,Pl),e(pt,Sl),w(fo,pt,null),e(pt,Ol),w(go,pt,null),g(o,Ta,_),g(o,Dt,_),e(Dt,_o),e(_o,xs),w(fn,xs,null),e(Dt,Al),e(Dt,Ps),e(Ps,Nl),g(o,va,_),g(o,oe,_),w(gn,oe,null),e(oe,Il),e(oe,Ss),e(Ss,Dl),e(oe,Hl),e(oe,Un),e(Un,Bn),e(Bn,Wl),e(Un,Ul),e(oe,Bl),e(oe,Ye),e(Ye,Kl),e(Ye,Os),e(Os,Vl),e(Ye,Gl),e(Ye,As),e(As,Xl),e(Ye,Jl),e(Ye,Ns),e(Ns,Ql),e(Ye,Yl),e(Ye,Is),e(Is,Zl),e(Ye,ed),e(oe,td),e(oe,_n),e(_n,od),e(_n,Kn),e(Kn,nd),e(_n,sd),e(oe,ad),e(oe,Tn),e(Tn,rd),e(Tn,vn),e(vn,id),e(Tn,ld),e(oe,dd),w(To,oe,null),e(oe,cd),e(oe,Ge),w(yn,Ge,null),e(Ge,pd),e(Ge,Ht),e(Ht,hd),e(Ht,Vn),e(Vn,ud),e(Ht,md),e(Ht,Ds),e(Ds,fd),e(Ht,gd),e(Ge,_d),w(vo,Ge,null),e(Ge,Td),w(yo,Ge,null),e(Ge,vd),w(bo,Ge,null),ya=!0},p(o,[_]){const bn={};_&2&&(bn.$$scope={dirty:_,ctx:o}),Gt.$set(bn);const Hs={};_&2&&(Hs.$$scope={dirty:_,ctx:o}),Qt.$set(Hs);const Ws={};_&2&&(Ws.$$scope={dirty:_,ctx:o}),Yt.$set(Ws);const Us={};_&2&&(Us.$$scope={dirty:_,ctx:o}),eo.$set(Us);const kn={};_&2&&(kn.$$scope={dirty:_,ctx:o}),to.$set(kn);const Bs={};_&2&&(Bs.$$scope={dirty:_,ctx:o}),no.$set(Bs);const Ks={};_&2&&(Ks.$$scope={dirty:_,ctx:o}),so.$set(Ks);const wn={};_&2&&(wn.$$scope={dirty:_,ctx:o}),ao.$set(wn);const Vs={};_&2&&(Vs.$$scope={dirty:_,ctx:o}),ro.$set(Vs);const Gs={};_&2&&(Gs.$$scope={dirty:_,ctx:o}),io.$set(Gs);const Xs={};_&2&&(Xs.$$scope={dirty:_,ctx:o}),co.$set(Xs);const Wt={};_&2&&(Wt.$$scope={dirty:_,ctx:o}),po.$set(Wt);const Js={};_&2&&(Js.$$scope={dirty:_,ctx:o}),ho.$set(Js);const Qs={};_&2&&(Qs.$$scope={dirty:_,ctx:o}),mo.$set(Qs);const Ys={};_&2&&(Ys.$$scope={dirty:_,ctx:o}),fo.$set(Ys);const Zs={};_&2&&(Zs.$$scope={dirty:_,ctx:o}),go.$set(Zs);const ea={};_&2&&(ea.$$scope={dirty:_,ctx:o}),To.$set(ea);const ta={};_&2&&(ta.$$scope={dirty:_,ctx:o}),vo.$set(ta);const gt={};_&2&&(gt.$$scope={dirty:_,ctx:o}),yo.$set(gt);const $n={};_&2&&($n.$$scope={dirty:_,ctx:o}),bo.$set($n)},i(o){ya||($(l.$$.fragment,o),$(se.$$.fragment,o),$(Fo.$$.fragment,o),$(qo.$$.fragment,o),$(zo.$$.fragment,o),$(Gt.$$.fragment,o),$(xo.$$.fragment,o),$(Po.$$.fragment,o),$(Oo.$$.fragment,o),$(Ao.$$.fragment,o),$(No.$$.fragment,o),$(Wo.$$.fragment,o),$(Qt.$$.fragment,o),$(Yt.$$.fragment,o),$(Uo.$$.fragment,o),$(Bo.$$.fragment,o),$(Xo.$$.fragment,o),$(eo.$$.fragment,o),$(to.$$.fragment,o),$(Jo.$$.fragment,o),$(Qo.$$.fragment,o),$(tn.$$.fragment,o),$(no.$$.fragment,o),$(so.$$.fragment,o),$(ao.$$.fragment,o),$(ro.$$.fragment,o),$(io.$$.fragment,o),$(on.$$.fragment,o),$(nn.$$.fragment,o),$(co.$$.fragment,o),$(ln.$$.fragment,o),$(po.$$.fragment,o),$(ho.$$.fragment,o),$(dn.$$.fragment,o),$(cn.$$.fragment,o),$(mo.$$.fragment,o),$(mn.$$.fragment,o),$(fo.$$.fragment,o),$(go.$$.fragment,o),$(fn.$$.fragment,o),$(gn.$$.fragment,o),$(To.$$.fragment,o),$(yn.$$.fragment,o),$(vo.$$.fragment,o),$(yo.$$.fragment,o),$(bo.$$.fragment,o),ya=!0)},o(o){C(l.$$.fragment,o),C(se.$$.fragment,o),C(Fo.$$.fragment,o),C(qo.$$.fragment,o),C(zo.$$.fragment,o),C(Gt.$$.fragment,o),C(xo.$$.fragment,o),C(Po.$$.fragment,o),C(Oo.$$.fragment,o),C(Ao.$$.fragment,o),C(No.$$.fragment,o),C(Wo.$$.fragment,o),C(Qt.$$.fragment,o),C(Yt.$$.fragment,o),C(Uo.$$.fragment,o),C(Bo.$$.fragment,o),C(Xo.$$.fragment,o),C(eo.$$.fragment,o),C(to.$$.fragment,o),C(Jo.$$.fragment,o),C(Qo.$$.fragment,o),C(tn.$$.fragment,o),C(no.$$.fragment,o),C(so.$$.fragment,o),C(ao.$$.fragment,o),C(ro.$$.fragment,o),C(io.$$.fragment,o),C(on.$$.fragment,o),C(nn.$$.fragment,o),C(co.$$.fragment,o),C(ln.$$.fragment,o),C(po.$$.fragment,o),C(ho.$$.fragment,o),C(dn.$$.fragment,o),C(cn.$$.fragment,o),C(mo.$$.fragment,o),C(mn.$$.fragment,o),C(fo.$$.fragment,o),C(go.$$.fragment,o),C(fn.$$.fragment,o),C(gn.$$.fragment,o),C(To.$$.fragment,o),C(yn.$$.fragment,o),C(vo.$$.fragment,o),C(yo.$$.fragment,o),C(bo.$$.fragment,o),ya=!1},d(o){t(d),o&&t(v),o&&t(c),L(l),o&&t(ke),o&&t(O),o&&t(K),o&&t(Q),L(se),o&&t(we),o&&t(S),o&&t($e),o&&t(ue),o&&t(Ce),o&&t(me),o&&t(V),o&&t(fe),o&&t(G),o&&t(D),o&&t(Le),o&&t(de),o&&t(oa),o&&t(Mt),L(Fo),o&&t(na),o&&t(Kt),o&&t(sa),o&&t(Rt),L(qo),o&&t(aa),o&&t(Je),L(zo),L(Gt),o&&t(ra),o&&t(Ft),L(xo),o&&t(ia),o&&t(Qe),L(Po),L(Oo),o&&t(la),o&&t(qt),L(Ao),o&&t(da),o&&t(De),L(No),L(Wo),L(Qt),L(Yt),o&&t(ca),o&&t(jt),L(Uo),o&&t(pa),o&&t(He),L(Bo),L(Xo),L(eo),L(to),o&&t(ha),o&&t(Pt),L(Jo),o&&t(ua),o&&t(We),L(Qo),L(tn),L(no),L(so),L(ao),L(ro),L(io),o&&t(ma),o&&t(Ot),L(on),o&&t(fa),o&&t(ye),L(nn),L(co),L(ln),L(po),L(ho),o&&t(ga),o&&t(Nt),L(dn),o&&t(_a),o&&t(be),L(cn),L(mo),L(mn),L(fo),L(go),o&&t(Ta),o&&t(Dt),L(fn),o&&t(va),o&&t(oe),L(gn),L(To),L(yn),L(vo),L(yo),L(bo)}}}const Rp={local:"ctrl",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.CTRLConfig",title:"CTRLConfig"},{local:"transformers.CTRLTokenizer",title:"CTRLTokenizer"},{local:"transformers.CTRLModel",title:"CTRLModel"},{local:"transformers.CTRLLMHeadModel",title:"CTRLLMHeadModel"},{local:"transformers.CTRLForSequenceClassification",title:"CTRLForSequenceClassification"},{local:"transformers.TFCTRLModel",title:"TFCTRLModel"},{local:"transformers.TFCTRLLMHeadModel",title:"TFCTRLLMHeadModel"},{local:"transformers.TFCTRLForSequenceClassification",title:"TFCTRLForSequenceClassification"}],title:"CTRL"};function Ep(F){return rp(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Sp extends op{constructor(d){super();np(this,d,Ep,Mp,sp,{})}}export{Sp as default,Rp as metadata};
