import{s as Ol,o as Hl,n as O}from"../chunks/scheduler.9bc65507.js";import{S as jl,i as zl,g as s,s as i,u as T,A as Fl,h as a,f as t,c as l,j as $,v as b,y as u,k as f,o,a as d,w as y,d as v,t as M,x as w}from"../chunks/index.78c82d43.js";import{T as le}from"../chunks/Tip.87d55b76.js";import{D as H}from"../chunks/Docstring.f3d04bd2.js";import{C as de}from"../chunks/CodeBlock.48618ec2.js";import{I as B}from"../chunks/IconCopyLink.bedaa44d.js";import{E as me}from"../chunks/ExampleCodeBlock.872b014d.js";import{P as Dr}from"../chunks/PipelineTag.75b0f707.js";function Ul(G){let n,_="Examples:",m,p,k;return p=new de({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME9wZW5BSUdQVENvbmZpZyUyQyUyME9wZW5BSUdQVE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEdQVCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwT3BlbkFJR1BUQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyME9wZW5BSUdQVE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> OpenAIGPTConfig, OpenAIGPTModel

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

<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 = OpenAIGPTModel(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(){n=s("p"),n.textContent=_,m=i(),T(p.$$.fragment)},l(r){n=a(r,"P",{"data-svelte-h":!0}),u(n)!=="svelte-kvfsh7"&&(n.textContent=_),m=l(r),b(p.$$.fragment,r)},m(r,g){d(r,n,g),d(r,m,g),y(p,r,g),k=!0},p:O,i(r){k||(v(p.$$.fragment,r),k=!0)},o(r){M(p.$$.fragment,r),k=!1},d(r){r&&(t(n),t(m)),w(p,r)}}}function Jl(G){let n,_=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=s("p"),n.innerHTML=_},l(m){n=a(m,"P",{"data-svelte-h":!0}),u(n)!=="svelte-fincs2"&&(n.innerHTML=_)},m(m,p){d(m,n,p)},p:O,d(m){m&&t(n)}}}function Nl(G){let n,_="Example:",m,p,k;return p=new de({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBPcGVuQUlHUFRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpLWdwdCUyMiklMEFtb2RlbCUyMCUzRCUyME9wZW5BSUdQVE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWktZ3B0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, OpenAIGPTModel
<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;openai-gpt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OpenAIGPTModel.from_pretrained(<span class="hljs-string">&quot;openai-gpt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){n=s("p"),n.textContent=_,m=i(),T(p.$$.fragment)},l(r){n=a(r,"P",{"data-svelte-h":!0}),u(n)!=="svelte-11lpom8"&&(n.textContent=_),m=l(r),b(p.$$.fragment,r)},m(r,g){d(r,n,g),d(r,m,g),y(p,r,g),k=!0},p:O,i(r){k||(v(p.$$.fragment,r),k=!0)},o(r){M(p.$$.fragment,r),k=!1},d(r){r&&(t(n),t(m)),w(p,r)}}}function ql(G){let n,_=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=s("p"),n.innerHTML=_},l(m){n=a(m,"P",{"data-svelte-h":!0}),u(n)!=="svelte-fincs2"&&(n.innerHTML=_)},m(m,p){d(m,n,p)},p:O,d(m){m&&t(n)}}}function Wl(G){let n,_="Example:",m,p,k;return p=new de({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME9wZW5BSUdQVExNSGVhZE1vZGVsJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpLWdwdCUyMiklMEFtb2RlbCUyMCUzRCUyME9wZW5BSUdQVExNSGVhZE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWktZ3B0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RpbnB1dHMlNUIlMjJpbnB1dF9pZHMlMjIlNUQpJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcyUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",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, OpenAIGPTLMHeadModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){n=s("p"),n.textContent=_,m=i(),T(p.$$.fragment)},l(r){n=a(r,"P",{"data-svelte-h":!0}),u(n)!=="svelte-11lpom8"&&(n.textContent=_),m=l(r),b(p.$$.fragment,r)},m(r,g){d(r,n,g),d(r,m,g),y(p,r,g),k=!0},p:O,i(r){k||(v(p.$$.fragment,r),k=!0)},o(r){M(p.$$.fragment,r),k=!1},d(r){r&&(t(n),t(m)),w(p,r)}}}function Ll(G){let n,_=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=s("p"),n.innerHTML=_},l(m){n=a(m,"P",{"data-svelte-h":!0}),u(n)!=="svelte-fincs2"&&(n.innerHTML=_)},m(m,p){d(m,n,p)},p:O,d(m){m&&t(n)}}}function Sl(G){let n,_="Examples:",m,p,k;return p=new de({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBPcGVuQUlHUFREb3VibGVIZWFkc01vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWktZ3B0JTIyKSUwQW1vZGVsJTIwJTNEJTIwT3BlbkFJR1BURG91YmxlSGVhZHNNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpLWdwdCUyMiklMEF0b2tlbml6ZXIuYWRkX3NwZWNpYWxfdG9rZW5zKCUwQSUyMCUyMCUyMCUyMCU3QiUyMmNsc190b2tlbiUyMiUzQSUyMCUyMiU1QkNMUyU1RCUyMiU3RCUwQSklMjAlMjAlMjMlMjBBZGQlMjBhJTIwJTVCQ0xTJTVEJTIwdG8lMjB0aGUlMjB2b2NhYnVsYXJ5JTIwKHdlJTIwc2hvdWxkJTIwdHJhaW4lMjBpdCUyMGFsc28hKSUwQW1vZGVsLnJlc2l6ZV90b2tlbl9lbWJlZGRpbmdzKGxlbih0b2tlbml6ZXIpKSUwQSUwQWNob2ljZXMlMjAlM0QlMjAlNUIlMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIwJTVCQ0xTJTVEJTIyJTJDJTIwJTIySGVsbG8lMkMlMjBteSUyMGNhdCUyMGlzJTIwY3V0ZSUyMCU1QkNMUyU1RCUyMiU1RCUwQWlucHV0X2lkcyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUJ0b2tlbml6ZXIuZW5jb2RlKHMpJTIwZm9yJTIwcyUyMGluJTIwY2hvaWNlcyU1RCkudW5zcXVlZXplKDApJTIwJTIwJTIzJTIwQmF0Y2glMjBzaXplJTIwMSUyQyUyMDIlMjBjaG9pY2VzJTBBbWNfdG9rZW5faWRzJTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QmlucHV0X2lkcy5zaXplKC0xKSUyMC0lMjAxJTJDJTIwaW5wdXRfaWRzLnNpemUoLTEpJTIwLSUyMDElNUQpLnVuc3F1ZWV6ZSgwKSUyMCUyMCUyMyUyMEJhdGNoJTIwc2l6ZSUyMDElMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRfaWRzJTJDJTIwbWNfdG9rZW5faWRzJTNEbWNfdG9rZW5faWRzKSUwQWxtX2xvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBbWNfbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5tY19sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, OpenAIGPTDoubleHeadsModel
<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;openai-gpt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OpenAIGPTDoubleHeadsModel.from_pretrained(<span class="hljs-string">&quot;openai-gpt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.add_special_tokens(
<span class="hljs-meta">... </span>    {<span class="hljs-string">&quot;cls_token&quot;</span>: <span class="hljs-string">&quot;[CLS]&quot;</span>}
<span class="hljs-meta">... </span>)  <span class="hljs-comment"># Add a [CLS] to the vocabulary (we should train it also!)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.resize_token_embeddings(<span class="hljs-built_in">len</span>(tokenizer))

<span class="hljs-meta">&gt;&gt;&gt; </span>choices = [<span class="hljs-string">&quot;Hello, my dog is cute [CLS]&quot;</span>, <span class="hljs-string">&quot;Hello, my cat is cute [CLS]&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = torch.tensor([tokenizer.encode(s) <span class="hljs-keyword">for</span> s <span class="hljs-keyword">in</span> choices]).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># Batch size 1, 2 choices</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mc_token_ids = torch.tensor([input_ids.size(-<span class="hljs-number">1</span>) - <span class="hljs-number">1</span>, input_ids.size(-<span class="hljs-number">1</span>) - <span class="hljs-number">1</span>]).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids, mc_token_ids=mc_token_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>lm_logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span>mc_logits = outputs.mc_logits`}}),{c(){n=s("p"),n.textContent=_,m=i(),T(p.$$.fragment)},l(r){n=a(r,"P",{"data-svelte-h":!0}),u(n)!=="svelte-kvfsh7"&&(n.textContent=_),m=l(r),b(p.$$.fragment,r)},m(r,g){d(r,n,g),d(r,m,g),y(p,r,g),k=!0},p:O,i(r){k||(v(p.$$.fragment,r),k=!0)},o(r){M(p.$$.fragment,r),k=!1},d(r){r&&(t(n),t(m)),w(p,r)}}}function Zl(G){let n,_=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=s("p"),n.innerHTML=_},l(m){n=a(m,"P",{"data-svelte-h":!0}),u(n)!=="svelte-fincs2"&&(n.innerHTML=_)},m(m,p){d(m,n,p)},p:O,d(m){m&&t(n)}}}function Bl(G){let n,_="Example of single-label classification:",m,p,k;return p=new de({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME9wZW5BSUdQVEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWktZ3B0JTIyKSUwQW1vZGVsJTIwJTNEJTIwT3BlbkFJR1BURm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpLWdwdCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWQlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KCkuaXRlbSgpJTBBJTBBJTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwT3BlbkFJR1BURm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpLWdwdCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, OpenAIGPTForSequenceClassification

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){n=s("p"),n.textContent=_,m=i(),T(p.$$.fragment)},l(r){n=a(r,"P",{"data-svelte-h":!0}),u(n)!=="svelte-ykxpe4"&&(n.textContent=_),m=l(r),b(p.$$.fragment,r)},m(r,g){d(r,n,g),d(r,m,g),y(p,r,g),k=!0},p:O,i(r){k||(v(p.$$.fragment,r),k=!0)},o(r){M(p.$$.fragment,r),k=!1},d(r){r&&(t(n),t(m)),w(p,r)}}}function Vl(G){let n,_="Example of multi-label classification:",m,p,k;return p=new de({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME9wZW5BSUdQVEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWktZ3B0JTIyKSUwQW1vZGVsJTIwJTNEJTIwT3BlbkFJR1BURm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpLWdwdCUyMiUyQyUyMHByb2JsZW1fdHlwZSUzRCUyMm11bHRpX2xhYmVsX2NsYXNzaWZpY2F0aW9uJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF9jbGFzc19pZHMlMjAlM0QlMjB0b3JjaC5hcmFuZ2UoMCUyQyUyMGxvZ2l0cy5zaGFwZSU1Qi0xJTVEKSU1QnRvcmNoLnNpZ21vaWQobG9naXRzKS5zcXVlZXplKGRpbSUzRDApJTIwJTNFJTIwMC41JTVEJTBBJTBBJTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwT3BlbkFJR1BURm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyb3BlbmFpLWdwdCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, OpenAIGPTForSequenceClassification

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){n=s("p"),n.textContent=_,m=i(),T(p.$$.fragment)},l(r){n=a(r,"P",{"data-svelte-h":!0}),u(n)!=="svelte-1l8e32d"&&(n.textContent=_),m=l(r),b(p.$$.fragment,r)},m(r,g){d(r,n,g),d(r,m,g),y(p,r,g),k=!0},p:O,i(r){k||(v(p.$$.fragment,r),k=!0)},o(r){M(p.$$.fragment,r),k=!1},d(r){r&&(t(n),t(m)),w(p,r)}}}function El(G){let n,_="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",m,p,k="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional argument.</li>",r,g,z=`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,A,x,V=`<li>a single Tensor with <code>input_ids</code> only and nothing else: <code>model(input_ids)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([input_ids, attention_mask])</code> or <code>model([input_ids, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;input_ids&quot;: input_ids, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,C,P,E=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){n=s("p"),n.innerHTML=_,m=i(),p=s("ul"),p.innerHTML=k,r=i(),g=s("p"),g.innerHTML=z,A=i(),x=s("ul"),x.innerHTML=V,C=i(),P=s("p"),P.innerHTML=E},l(h){n=a(h,"P",{"data-svelte-h":!0}),u(n)!=="svelte-1ajbfxg"&&(n.innerHTML=_),m=l(h),p=a(h,"UL",{"data-svelte-h":!0}),u(p)!=="svelte-qm1t26"&&(p.innerHTML=k),r=l(h),g=a(h,"P",{"data-svelte-h":!0}),u(g)!=="svelte-1v9qsc5"&&(g.innerHTML=z),A=l(h),x=a(h,"UL",{"data-svelte-h":!0}),u(x)!=="svelte-15scerc"&&(x.innerHTML=V),C=l(h),P=a(h,"P",{"data-svelte-h":!0}),u(P)!=="svelte-1an3odd"&&(P.innerHTML=E)},m(h,I){d(h,n,I),d(h,m,I),d(h,p,I),d(h,r,I),d(h,g,I),d(h,A,I),d(h,x,I),d(h,C,I),d(h,P,I)},p:O,d(h){h&&(t(n),t(m),t(p),t(r),t(g),t(A),t(x),t(C),t(P))}}}function Rl(G){let n,_=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=s("p"),n.innerHTML=_},l(m){n=a(m,"P",{"data-svelte-h":!0}),u(n)!=="svelte-fincs2"&&(n.innerHTML=_)},m(m,p){d(m,n,p)},p:O,d(m){m&&t(n)}}}function Dl(G){let n,_="Example:",m,p,k;return p=new de({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURk9wZW5BSUdQVE1vZGVsJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWktZ3B0JTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZPcGVuQUlHUFRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpLWdwdCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFOpenAIGPTModel
<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;openai-gpt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFOpenAIGPTModel.from_pretrained(<span class="hljs-string">&quot;openai-gpt&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(){n=s("p"),n.textContent=_,m=i(),T(p.$$.fragment)},l(r){n=a(r,"P",{"data-svelte-h":!0}),u(n)!=="svelte-11lpom8"&&(n.textContent=_),m=l(r),b(p.$$.fragment,r)},m(r,g){d(r,n,g),d(r,m,g),y(p,r,g),k=!0},p:O,i(r){k||(v(p.$$.fragment,r),k=!0)},o(r){M(p.$$.fragment,r),k=!1},d(r){r&&(t(n),t(m)),w(p,r)}}}function Xl(G){let n,_="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",m,p,k="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional argument.</li>",r,g,z=`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,A,x,V=`<li>a single Tensor with <code>input_ids</code> only and nothing else: <code>model(input_ids)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([input_ids, attention_mask])</code> or <code>model([input_ids, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;input_ids&quot;: input_ids, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,C,P,E=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){n=s("p"),n.innerHTML=_,m=i(),p=s("ul"),p.innerHTML=k,r=i(),g=s("p"),g.innerHTML=z,A=i(),x=s("ul"),x.innerHTML=V,C=i(),P=s("p"),P.innerHTML=E},l(h){n=a(h,"P",{"data-svelte-h":!0}),u(n)!=="svelte-1ajbfxg"&&(n.innerHTML=_),m=l(h),p=a(h,"UL",{"data-svelte-h":!0}),u(p)!=="svelte-qm1t26"&&(p.innerHTML=k),r=l(h),g=a(h,"P",{"data-svelte-h":!0}),u(g)!=="svelte-1v9qsc5"&&(g.innerHTML=z),A=l(h),x=a(h,"UL",{"data-svelte-h":!0}),u(x)!=="svelte-15scerc"&&(x.innerHTML=V),C=l(h),P=a(h,"P",{"data-svelte-h":!0}),u(P)!=="svelte-1an3odd"&&(P.innerHTML=E)},m(h,I){d(h,n,I),d(h,m,I),d(h,p,I),d(h,r,I),d(h,g,I),d(h,A,I),d(h,x,I),d(h,C,I),d(h,P,I)},p:O,d(h){h&&(t(n),t(m),t(p),t(r),t(g),t(A),t(x),t(C),t(P))}}}function Ql(G){let n,_=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=s("p"),n.innerHTML=_},l(m){n=a(m,"P",{"data-svelte-h":!0}),u(n)!=="svelte-fincs2"&&(n.innerHTML=_)},m(m,p){d(m,n,p)},p:O,d(m){m&&t(n)}}}function Yl(G){let n,_="Example:",m,p,k;return p=new de({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURk9wZW5BSUdQVExNSGVhZE1vZGVsJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWktZ3B0JTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZPcGVuQUlHUFRMTUhlYWRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpLWdwdCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFOpenAIGPTLMHeadModel
<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;openai-gpt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFOpenAIGPTLMHeadModel.from_pretrained(<span class="hljs-string">&quot;openai-gpt&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(){n=s("p"),n.textContent=_,m=i(),T(p.$$.fragment)},l(r){n=a(r,"P",{"data-svelte-h":!0}),u(n)!=="svelte-11lpom8"&&(n.textContent=_),m=l(r),b(p.$$.fragment,r)},m(r,g){d(r,n,g),d(r,m,g),y(p,r,g),k=!0},p:O,i(r){k||(v(p.$$.fragment,r),k=!0)},o(r){M(p.$$.fragment,r),k=!1},d(r){r&&(t(n),t(m)),w(p,r)}}}function Kl(G){let n,_="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",m,p,k="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional argument.</li>",r,g,z=`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,A,x,V=`<li>a single Tensor with <code>input_ids</code> only and nothing else: <code>model(input_ids)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([input_ids, attention_mask])</code> or <code>model([input_ids, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;input_ids&quot;: input_ids, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,C,P,E=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){n=s("p"),n.innerHTML=_,m=i(),p=s("ul"),p.innerHTML=k,r=i(),g=s("p"),g.innerHTML=z,A=i(),x=s("ul"),x.innerHTML=V,C=i(),P=s("p"),P.innerHTML=E},l(h){n=a(h,"P",{"data-svelte-h":!0}),u(n)!=="svelte-1ajbfxg"&&(n.innerHTML=_),m=l(h),p=a(h,"UL",{"data-svelte-h":!0}),u(p)!=="svelte-qm1t26"&&(p.innerHTML=k),r=l(h),g=a(h,"P",{"data-svelte-h":!0}),u(g)!=="svelte-1v9qsc5"&&(g.innerHTML=z),A=l(h),x=a(h,"UL",{"data-svelte-h":!0}),u(x)!=="svelte-15scerc"&&(x.innerHTML=V),C=l(h),P=a(h,"P",{"data-svelte-h":!0}),u(P)!=="svelte-1an3odd"&&(P.innerHTML=E)},m(h,I){d(h,n,I),d(h,m,I),d(h,p,I),d(h,r,I),d(h,g,I),d(h,A,I),d(h,x,I),d(h,C,I),d(h,P,I)},p:O,d(h){h&&(t(n),t(m),t(p),t(r),t(g),t(A),t(x),t(C),t(P))}}}function ed(G){let n,_=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=s("p"),n.innerHTML=_},l(m){n=a(m,"P",{"data-svelte-h":!0}),u(n)!=="svelte-fincs2"&&(n.innerHTML=_)},m(m,p){d(m,n,p)},p:O,d(m){m&&t(n)}}}function td(G){let n,_="Examples:",m,p,k;return p=new de({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMFRGT3BlbkFJR1BURG91YmxlSGVhZHNNb2RlbCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haS1ncHQlMjIpJTBBbW9kZWwlMjAlM0QlMjBURk9wZW5BSUdQVERvdWJsZUhlYWRzTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haS1ncHQlMjIpJTBBJTBBJTIzJTIwQWRkJTIwYSUyMCU1QkNMUyU1RCUyMHRvJTIwdGhlJTIwdm9jYWJ1bGFyeSUyMCh3ZSUyMHNob3VsZCUyMHRyYWluJTIwaXQlMjBhbHNvISklMEF0b2tlbml6ZXIuYWRkX3NwZWNpYWxfdG9rZW5zKCU3QiUyMmNsc190b2tlbiUyMiUzQSUyMCUyMiU1QkNMUyU1RCUyMiU3RCklMEFtb2RlbC5yZXNpemVfdG9rZW5fZW1iZWRkaW5ncyhsZW4odG9rZW5pemVyKSklMjAlMjAlMjMlMjBVcGRhdGUlMjB0aGUlMjBtb2RlbCUyMGVtYmVkZGluZ3MlMjB3aXRoJTIwdGhlJTIwbmV3JTIwdm9jYWJ1bGFyeSUyMHNpemUlMEFwcmludCh0b2tlbml6ZXIuY2xzX3Rva2VuX2lkJTJDJTIwbGVuKHRva2VuaXplcikpJTIwJTIwJTIzJTIwVGhlJTIwbmV3bHklMjB0b2tlbiUyMHRoZSUyMGxhc3QlMjB0b2tlbiUyMG9mJTIwdGhlJTIwdm9jYWJ1bGFyeSUwQSUwQWNob2ljZXMlMjAlM0QlMjAlNUIlMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIwJTVCQ0xTJTVEJTIyJTJDJTIwJTIySGVsbG8lMkMlMjBteSUyMGNhdCUyMGlzJTIwY3V0ZSUyMCU1QkNMUyU1RCUyMiU1RCUwQWVuY29kaW5nJTIwJTNEJTIwdG9rZW5pemVyKGNob2ljZXMlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQWlucHV0cyUyMCUzRCUyMCU3QmslM0ElMjB0Zi5leHBhbmRfZGltcyh2JTJDJTIwMCklMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwZW5jb2RpbmcuaXRlbXMoKSU3RCUwQWlucHV0cyU1QiUyMm1jX3Rva2VuX2lkcyUyMiU1RCUyMCUzRCUyMHRmLmNvbnN0YW50KCUwQSUyMCUyMCUyMCUyMCU1QmlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RC5zaGFwZSU1Qi0xJTVEJTIwLSUyMDElMkMlMjBpbnB1dHMlNUIlMjJpbnB1dF9pZHMlMjIlNUQuc2hhcGUlNUItMSU1RCUyMC0lMjAxJTVEJTBBKSU1QiUwQSUyMCUyMCUyMCUyME5vbmUlMkMlMjAlM0ElMEElNUQlMjAlMjAlMjMlMjBCYXRjaCUyMHNpemUlMjAxJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEFsbV9wcmVkaWN0aW9uX3Njb3JlcyUyQyUyMG1jX3ByZWRpY3Rpb25fc2NvcmVzJTIwJTNEJTIwb3V0cHV0cyU1QiUzQTIlNUQ=",highlighted:`<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><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFOpenAIGPTDoubleHeadsModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Add a [CLS] to the vocabulary (we should train it also!)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.add_special_tokens({<span class="hljs-string">&quot;cls_token&quot;</span>: <span class="hljs-string">&quot;[CLS]&quot;</span>})
<span class="hljs-meta">&gt;&gt;&gt; </span>model.resize_token_embeddings(<span class="hljs-built_in">len</span>(tokenizer))  <span class="hljs-comment"># Update the model embeddings with the new vocabulary size</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.cls_token_id, <span class="hljs-built_in">len</span>(tokenizer))  <span class="hljs-comment"># The newly token the last token of the vocabulary</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>choices = [<span class="hljs-string">&quot;Hello, my dog is cute [CLS]&quot;</span>, <span class="hljs-string">&quot;Hello, my cat is cute [CLS]&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(choices, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = {k: tf.expand_dims(v, <span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs[<span class="hljs-string">&quot;mc_token_ids&quot;</span>] = tf.constant(
<span class="hljs-meta">... </span>    [inputs[<span class="hljs-string">&quot;input_ids&quot;</span>].shape[-<span class="hljs-number">1</span>] - <span class="hljs-number">1</span>, inputs[<span class="hljs-string">&quot;input_ids&quot;</span>].shape[-<span class="hljs-number">1</span>] - <span class="hljs-number">1</span>]
<span class="hljs-meta">... </span>)[
<span class="hljs-meta">... </span>    <span class="hljs-literal">None</span>, :
<span class="hljs-meta">... </span>]  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>lm_prediction_scores, mc_prediction_scores = outputs[:<span class="hljs-number">2</span>]`}}),{c(){n=s("p"),n.textContent=_,m=i(),T(p.$$.fragment)},l(r){n=a(r,"P",{"data-svelte-h":!0}),u(n)!=="svelte-kvfsh7"&&(n.textContent=_),m=l(r),b(p.$$.fragment,r)},m(r,g){d(r,n,g),d(r,m,g),y(p,r,g),k=!0},p:O,i(r){k||(v(p.$$.fragment,r),k=!0)},o(r){M(p.$$.fragment,r),k=!1},d(r){r&&(t(n),t(m)),w(p,r)}}}function nd(G){let n,_="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",m,p,k="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional argument.</li>",r,g,z=`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,A,x,V=`<li>a single Tensor with <code>input_ids</code> only and nothing else: <code>model(input_ids)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([input_ids, attention_mask])</code> or <code>model([input_ids, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;input_ids&quot;: input_ids, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,C,P,E=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){n=s("p"),n.innerHTML=_,m=i(),p=s("ul"),p.innerHTML=k,r=i(),g=s("p"),g.innerHTML=z,A=i(),x=s("ul"),x.innerHTML=V,C=i(),P=s("p"),P.innerHTML=E},l(h){n=a(h,"P",{"data-svelte-h":!0}),u(n)!=="svelte-1ajbfxg"&&(n.innerHTML=_),m=l(h),p=a(h,"UL",{"data-svelte-h":!0}),u(p)!=="svelte-qm1t26"&&(p.innerHTML=k),r=l(h),g=a(h,"P",{"data-svelte-h":!0}),u(g)!=="svelte-1v9qsc5"&&(g.innerHTML=z),A=l(h),x=a(h,"UL",{"data-svelte-h":!0}),u(x)!=="svelte-15scerc"&&(x.innerHTML=V),C=l(h),P=a(h,"P",{"data-svelte-h":!0}),u(P)!=="svelte-1an3odd"&&(P.innerHTML=E)},m(h,I){d(h,n,I),d(h,m,I),d(h,p,I),d(h,r,I),d(h,g,I),d(h,A,I),d(h,x,I),d(h,C,I),d(h,P,I)},p:O,d(h){h&&(t(n),t(m),t(p),t(r),t(g),t(A),t(x),t(C),t(P))}}}function od(G){let n,_=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=s("p"),n.innerHTML=_},l(m){n=a(m,"P",{"data-svelte-h":!0}),u(n)!=="svelte-fincs2"&&(n.innerHTML=_)},m(m,p){d(m,n,p)},p:O,d(m){m&&t(n)}}}function sd(G){let n,_="Example:",m,p,k;return p=new de({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURk9wZW5BSUdQVEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haS1ncHQlMjIpJTBBbW9kZWwlMjAlM0QlMjBURk9wZW5BSUdQVEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haS1ncHQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQSUwQWxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWQlMjAlM0QlMjBpbnQodGYubWF0aC5hcmdtYXgobG9naXRzJTJDJTIwYXhpcyUzRC0xKSU1QjAlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFOpenAIGPTForSequenceClassification
<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;openai-gpt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFOpenAIGPTForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;openai-gpt&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(){n=s("p"),n.textContent=_,m=i(),T(p.$$.fragment)},l(r){n=a(r,"P",{"data-svelte-h":!0}),u(n)!=="svelte-11lpom8"&&(n.textContent=_),m=l(r),b(p.$$.fragment,r)},m(r,g){d(r,n,g),d(r,m,g),y(p,r,g),k=!0},p:O,i(r){k||(v(p.$$.fragment,r),k=!0)},o(r){M(p.$$.fragment,r),k=!1},d(r){r&&(t(n),t(m)),w(p,r)}}}function ad(G){let n,_;return n=new de({props:{code:"JTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwVEZPcGVuQUlHUFRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWktZ3B0JTIyJTJDJTIwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdGYuY29uc3RhbnQoMSklMEFsb3NzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMpLmxvc3M=",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 = TFOpenAIGPTForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;openai-gpt&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(){T(n.$$.fragment)},l(m){b(n.$$.fragment,m)},m(m,p){y(n,m,p),_=!0},p:O,i(m){_||(v(n.$$.fragment,m),_=!0)},o(m){M(n.$$.fragment,m),_=!1},d(m){w(n,m)}}}function rd(G){let n,_,m,p,k,r,g,z,A,x,V="OpenAI GPT",C,P,E='<a href="https://huggingface.co/models?filter=openai-gpt"><img alt="Models" src="https://img.shields.io/badge/All_model_pages-openai--gpt-blueviolet"/></a> <a href="https://huggingface.co/spaces/docs-demos/openai-gpt"><img alt="Spaces" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue"/></a>',h,I,je,Uo,wt,ua,An,Xr="Overview",ps,kt,Qr=`OpenAI GPT model was proposed in <a href="https://s3-us-west-2.amazonaws.com/openai-assets/research-covers/language-unsupervised/language_understanding_paper.pdf" rel="nofollow">Improving Language Understanding by Generative Pre-Training</a>
by Alec Radford, Karthik Narasimhan, Tim Salimans and Ilya Sutskever. It’s a causal (unidirectional) transformer
pre-trained using language modeling on a large corpus will long range dependencies, the Toronto Book Corpus.`,ms,$t,Yr="The abstract from the paper is the following:",us,It,Kr=`<em>Natural language understanding comprises a wide range of diverse tasks such as textual entailment, question answering,
semantic similarity assessment, and document classification. Although large unlabeled text corpora are abundant,
labeled data for learning these specific tasks is scarce, making it challenging for discriminatively trained models to
perform adequately. We demonstrate that large gains on these tasks can be realized by generative pretraining of a
language model on a diverse corpus of unlabeled text, followed by discriminative fine-tuning on each specific task. In
contrast to previous approaches, we make use of task-aware input transformations during fine-tuning to achieve
effective transfer while requiring minimal changes to the model architecture. We demonstrate the effectiveness of our
approach on a wide range of benchmarks for natural language understanding. Our general task-agnostic model outperforms
discriminatively trained models that use architectures specifically crafted for each task, significantly improving upon
the state of the art in 9 out of the 12 tasks studied.</em>`,hs,Gt,ei="Tips:",fs,Pt,ti=`<li>GPT is a model with absolute position embeddings so it’s usually advised to pad the inputs on the right rather than
the left.</li> <li>GPT 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 GPT-2 to generate syntactically coherent text as it can be
observed in the <em>run_generation.py</em> example script.</li>`,gs,xt,ni=`<a href="https://transformer.huggingface.co/doc/gpt" rel="nofollow">Write With Transformer</a> is a webapp created and hosted by Hugging Face
showcasing the generative capabilities of several models. GPT is one of them.`,_s,Ct,oi='This model was contributed by <a href="https://huggingface.co/thomwolf" rel="nofollow">thomwolf</a>. The original code can be found <a href="https://github.com/openai/finetune-transformer-lm" rel="nofollow">here</a>.',Ts,At,si="Note:",bs,Ot,ai=`If you want to reproduce the original tokenization process of the <em>OpenAI GPT</em> paper, you will need to install <code>ftfy</code>
and <code>SpaCy</code>:`,ys,Ht,vs,jt,ri=`If you don’t install <code>ftfy</code> and <code>SpaCy</code>, the <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTTokenizer">OpenAIGPTTokenizer</a> will default to tokenize
using BERT’s <code>BasicTokenizer</code> followed by Byte-Pair Encoding (which should be fine for most usage, don’t worry).`,Ms,be,ze,Jo,zt,ha,On,ii="Resources",ws,Ft,li="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with OpenAI GPT. If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.",ks,Ut,$s,Jt,di='<li>A blog post on <a href="https://www.philschmid.de/getting-started-setfit" rel="nofollow">outperforming OpenAI GPT-3 with SetFit for text-classification</a>.</li> <li>See also: <a href="../tasks/sequence_classification">Text classification task guide</a></li>',Is,Nt,Gs,qt,ci='<li>A blog on how to <a href="https://www.philschmid.de/fine-tune-a-non-english-gpt-2-model-with-huggingface" rel="nofollow">Finetune a non-English GPT-2 Model with Hugging Face</a>.</li> <li>A blog on <a href="https://huggingface.co/blog/how-to-generate" rel="nofollow">How to generate text: using different decoding methods for language generation with Transformers</a> with GPT-2.</li> <li>A blog on <a href="https://huggingface.co/blog/codeparrot" rel="nofollow">Training CodeParrot 🦜 from Scratch</a>, a large GPT-2 model.</li> <li>A blog on <a href="https://huggingface.co/blog/tf-xla-generate" rel="nofollow">Faster Text Generation with TensorFlow and XLA</a> with GPT-2.</li> <li>A blog on <a href="https://huggingface.co/blog/megatron-training" rel="nofollow">How to train a Language Model with Megatron-LM</a> with a GPT-2 model.</li> <li>A notebook on how to <a href="https://colab.research.google.com/github/AlekseyKorshuk/huggingartists/blob/master/huggingartists-demo.ipynb" rel="nofollow">finetune GPT2 to generate lyrics in the style of your favorite artist</a>. 🌎</li> <li>A notebook on how to <a href="https://colab.research.google.com/github/borisdayma/huggingtweets/blob/master/huggingtweets-demo.ipynb" rel="nofollow">finetune GPT2 to generate tweets in the style of your favorite Twitter user</a>. 🌎</li> <li><a href="https://huggingface.co/course/en/chapter7/6?fw=pt#training-a-causal-language-model-from-scratch" rel="nofollow">Causal language modeling</a> chapter of the 🤗 Hugging Face Course.</li> <li><a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTLMHeadModel">OpenAIGPTLMHeadModel</a> is supported by this <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/language-modeling#gpt-2gpt-and-causal-language-modeling" rel="nofollow">causal language modeling example script</a>, <a href="https://github.com/huggingface/transformers/blob/main/examples/pytorch/text-generation/run_generation.py" rel="nofollow">text generation example script</a> and <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb" rel="nofollow">notebook</a>.</li> <li><a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.TFOpenAIGPTLMHeadModel">TFOpenAIGPTLMHeadModel</a> is supported by this <a href="https://github.com/huggingface/transformers/tree/main/examples/tensorflow/language-modeling#run_clmpy" rel="nofollow">causal language modeling example script</a> and <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb" rel="nofollow">notebook</a>.</li> <li>See also: <a href="../tasks/language_modeling">Causal language modeling task guide</a></li>',Ps,Wt,xs,Lt,pi='<li>A course material on <a href="https://huggingface.co/course/en/chapter6/5" rel="nofollow">Byte-Pair Encoding tokenization</a>.</li>',Cs,ye,Fe,No,St,fa,Hn,mi="OpenAIGPTConfig",As,X,Zt,ga,jn,ui=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTModel">OpenAIGPTModel</a> or a <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.TFOpenAIGPTModel">TFOpenAIGPTModel</a>. It is
used to instantiate a GPT 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 GPT
<a href="https://huggingface.co/openai-gpt" rel="nofollow">openai-gpt</a> architecture from OpenAI.`,_a,zn,hi=`Configuration objects inherit from <a href="/docs/transformers/v4.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Ta,Ue,Os,ve,Je,qo,Bt,ba,Fn,fi="OpenAIGPTTokenizer",Hs,q,Vt,ya,Un,gi="Construct a GPT Tokenizer. Based on Byte-Pair-Encoding with the following peculiarities:",va,Jn,_i=`<li>lowercases all inputs,</li> <li>uses <code>SpaCy</code> tokenizer and <code>ftfy</code> for pre-BPE tokenization if they are installed, fallback to BERT’s
<code>BasicTokenizer</code> if not.</li>`,Ma,Nn,Ti=`This tokenizer inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`,wa,qn,Et,js,Me,Ne,Wo,Rt,ka,Wn,bi="OpenAIGPTTokenizerFast",zs,Q,Dt,$a,Ln,yi=`Construct a “fast” GPT Tokenizer (backed by HuggingFace’s <em>tokenizers</em> library). Based on Byte-Pair-Encoding with
the following peculiarities:`,Ia,Sn,vi="<li>lower case all inputs</li> <li>uses BERT’s BasicTokenizer for pre-BPE tokenization</li>",Ga,Zn,Mi=`This tokenizer inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a> which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`,Fs,we,qe,Lo,Xt,Pa,Bn,wi="OpenAI specific outputs",Us,ke,Qt,xa,Vn,ki="Base class for outputs of models predicting if two sentences are consecutive or not.",Js,$e,Yt,Ca,En,$i="Base class for outputs of models predicting if two sentences are consecutive or not.",Ns,Ie,We,So,Kt,Aa,Rn,Ii="OpenAIGPTModel",qs,W,en,Oa,Dn,Gi="The bare OpenAI GPT transformer model outputting raw hidden-states without any specific head on top.",Ha,Xn,Pi=`This model inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,ja,Qn,xi=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,za,K,tn,Fa,Yn,Ci='The <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTModel">OpenAIGPTModel</a> forward method, overrides the <code>__call__</code> special method.',Ua,Le,Ja,Se,Ws,Ge,Ze,Zo,nn,Na,Kn,Ai="OpenAIGPTLMHeadModel",Ls,L,on,qa,eo,Oi=`OpenAI GPT Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`,Wa,to,Hi=`This model inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,La,no,ji=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Sa,ee,sn,Za,oo,zi='The <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTLMHeadModel">OpenAIGPTLMHeadModel</a> forward method, overrides the <code>__call__</code> special method.',Ba,Be,Va,Ve,Ss,Pe,Ee,Bo,an,Ea,so,Fi="OpenAIGPTDoubleHeadsModel",Zs,S,rn,Ra,ao,Ui=`OpenAI GPT Model transformer with a language modeling and a multiple-choice classification head on top e.g. for
RocStories/SWAG tasks. The two heads are two linear layers. The language modeling head has its weights tied to the
input embeddings, the classification head takes as input the input of a specified classification token index in the
input sequence).`,Da,ro,Ji=`This model inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Xa,io,Ni=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Qa,te,ln,Ya,lo,qi='The <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTDoubleHeadsModel">OpenAIGPTDoubleHeadsModel</a> forward method, overrides the <code>__call__</code> special method.',Ka,Re,er,De,Bs,xe,Xe,Vo,dn,tr,co,Wi="OpenAIGPTForSequenceClassification",Vs,Z,cn,nr,po,Li=`The Original OpenAI GPT Model transformer with a sequence classification head on top (linear layer).
<a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTForSequenceClassification">OpenAIGPTForSequenceClassification</a> 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 <code>pad_token_id</code> is defined in the configuration, it finds the last token that is not a padding
token in each row. If no <code>pad_token_id</code> is defined, it simply takes the last value in each row of the batch. Since
it cannot guess the padding tokens when <code>inputs_embeds</code> are passed instead of <code>input_ids</code>, it does the same (take
the last value in each row of the batch).`,or,mo,Si=`This model inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,sr,uo,Zi=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,ar,R,pn,rr,ho,Bi='The <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTForSequenceClassification">OpenAIGPTForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',ir,Qe,lr,Ye,dr,Ke,Es,Ce,et,Eo,mn,cr,fo,Vi="TFOpenAIGPTModel",Rs,F,un,pr,go,Ei="The bare OpenAI GPT transformer model outputting raw hidden-states without any specific head on top.",mr,_o,Ri=`This model inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,ur,To,Di=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">tf.keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,hr,tt,fr,ne,hn,gr,bo,Xi='The <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.TFOpenAIGPTModel">TFOpenAIGPTModel</a> forward method, overrides the <code>__call__</code> special method.',_r,nt,Tr,ot,Ds,Ae,st,Ro,fn,br,yo,Qi="TFOpenAIGPTLMHeadModel",Xs,U,gn,yr,vo,Yi=`OpenAI GPT Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`,vr,Mo,Ki=`This model inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Mr,wo,el=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">tf.keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,wr,at,kr,oe,_n,$r,ko,tl='The <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.TFOpenAIGPTLMHeadModel">TFOpenAIGPTLMHeadModel</a> forward method, overrides the <code>__call__</code> special method.',Ir,rt,Gr,it,Qs,Oe,lt,Do,Tn,Pr,$o,nl="TFOpenAIGPTDoubleHeadsModel",Ys,J,bn,xr,Io,ol=`OpenAI GPT Model transformer with a language modeling and a multiple-choice classification head on top e.g. for
RocStories/SWAG tasks. The two heads are two linear layers. The language modeling head has its weights tied to the
input embeddings, the classification head takes as input the input of a specified classification token index in the
input sequence).`,Cr,Go,sl=`This model inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Ar,Po,al=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">tf.keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,Or,dt,Hr,se,yn,jr,xo,rl='The <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.TFOpenAIGPTDoubleHeadsModel">TFOpenAIGPTDoubleHeadsModel</a> forward method, overrides the <code>__call__</code> special method.',zr,ct,Fr,pt,Ks,He,mt,Xo,vn,Ur,Co,il="TFOpenAIGPTForSequenceClassification",ea,j,Mn,Jr,Ao,ll="The OpenAI GPT Model transformer with a sequence classification head on top (linear layer).",Nr,Oo,dl=`<a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.TFOpenAIGPTForSequenceClassification">TFOpenAIGPTForSequenceClassification</a> uses the last token in order to do the classification, as other causal
models (e.g. GPT-2) do.`,qr,Ho,cl=`Since it does classification on the last token, it requires to know the position of the last token. If a
<code>pad_token_id</code> is defined in the configuration, it finds the last token that is not a padding token in each row. If
no <code>pad_token_id</code> is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when <code>inputs_embeds</code> are passed instead of <code>input_ids</code>, it does the same (take the last value in
each row of the batch).`,Wr,jo,pl=`This model inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Lr,zo,ml=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">tf.keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,Sr,ut,Zr,D,wn,Br,Fo,ul='The <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.TFOpenAIGPTForSequenceClassification">TFOpenAIGPTForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',Vr,ht,Er,ft,Rr,gt,ta,Qo,na;return z=new B({}),wt=new B({}),Ht=new de({props:{code:"cGlwJTIwaW5zdGFsbCUyMHNwYWN5JTIwZnRmeSUzRCUzRDQuNC4zJTBBcHl0aG9uJTIwLW0lMjBzcGFjeSUyMGRvd25sb2FkJTIwZW4=",highlighted:`pip install spacy ftfy==4.4.3
python -m spacy download en`}}),zt=new B({}),Ut=new Dr({props:{pipeline:"text-classification"}}),Nt=new Dr({props:{pipeline:"text-generation"}}),Wt=new Dr({props:{pipeline:"token-classification"}}),St=new B({}),Zt=new H({props:{name:"class transformers.OpenAIGPTConfig",anchor:"transformers.OpenAIGPTConfig",parameters:[{name:"vocab_size",val:" = 40478"},{name:"n_positions",val:" = 512"},{name:"n_embd",val:" = 768"},{name:"n_layer",val:" = 12"},{name:"n_head",val:" = 12"},{name:"afn",val:" = 'gelu'"},{name:"resid_pdrop",val:" = 0.1"},{name:"embd_pdrop",val:" = 0.1"},{name:"attn_pdrop",val:" = 0.1"},{name:"layer_norm_epsilon",val:" = 1e-05"},{name:"initializer_range",val:" = 0.02"},{name:"summary_type",val:" = 'cls_index'"},{name:"summary_use_proj",val:" = True"},{name:"summary_activation",val:" = None"},{name:"summary_proj_to_labels",val:" = True"},{name:"summary_first_dropout",val:" = 0.1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OpenAIGPTConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 40478) &#x2014;
Vocabulary size of the GPT-2 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.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTModel">OpenAIGPTModel</a> or <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.TFOpenAIGPTModel">TFOpenAIGPTModel</a>.`,name:"vocab_size"},{anchor:"transformers.OpenAIGPTConfig.n_positions",description:`<strong>n_positions</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#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.OpenAIGPTConfig.n_embd",description:`<strong>n_embd</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the embeddings and hidden states.`,name:"n_embd"},{anchor:"transformers.OpenAIGPTConfig.n_layer",description:`<strong>n_layer</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"n_layer"},{anchor:"transformers.OpenAIGPTConfig.n_head",description:`<strong>n_head</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"n_head"},{anchor:"transformers.OpenAIGPTConfig.afn",description:`<strong>afn</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"afn"},{anchor:"transformers.OpenAIGPTConfig.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.OpenAIGPTConfig.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.OpenAIGPTConfig.attn_pdrop",description:`<strong>attn_pdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention.`,name:"attn_pdrop"},{anchor:"transformers.OpenAIGPTConfig.layer_norm_epsilon",description:`<strong>layer_norm_epsilon</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon to use in the layer normalization layers`,name:"layer_norm_epsilon"},{anchor:"transformers.OpenAIGPTConfig.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.OpenAIGPTConfig.summary_type",description:`<strong>summary_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;cls_index&quot;</code>) &#x2014;
Argument used when doing sequence summary, used in the models <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTDoubleHeadsModel">OpenAIGPTDoubleHeadsModel</a> and
<a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTDoubleHeadsModel">OpenAIGPTDoubleHeadsModel</a>.</p>
<p>Has to be one of the following options:</p>
<ul>
<li><code>&quot;last&quot;</code>: Take the last token hidden state (like XLNet).</li>
<li><code>&quot;first&quot;</code>: Take the first token hidden state (like BERT).</li>
<li><code>&quot;mean&quot;</code>: Take the mean of all tokens hidden states.</li>
<li><code>&quot;cls_index&quot;</code>: Supply a Tensor of classification token position (like GPT/GPT-2).</li>
<li><code>&quot;attn&quot;</code>: Not implemented now, use multi-head attention.</li>
</ul>`,name:"summary_type"},{anchor:"transformers.OpenAIGPTConfig.summary_use_proj",description:`<strong>summary_use_proj</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Argument used when doing sequence summary, used in the models <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTDoubleHeadsModel">OpenAIGPTDoubleHeadsModel</a> and
<a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTDoubleHeadsModel">OpenAIGPTDoubleHeadsModel</a>.</p>
<p>Whether or not to add a projection after the vector extraction.`,name:"summary_use_proj"},{anchor:"transformers.OpenAIGPTConfig.summary_activation",description:`<strong>summary_activation</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Argument used when doing sequence summary, used in the models <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTDoubleHeadsModel">OpenAIGPTDoubleHeadsModel</a> and
<a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTDoubleHeadsModel">OpenAIGPTDoubleHeadsModel</a>.</p>
<p>Pass <code>&quot;tanh&quot;</code> for a tanh activation to the output, any other value will result in no activation.`,name:"summary_activation"},{anchor:"transformers.OpenAIGPTConfig.summary_proj_to_labels",description:`<strong>summary_proj_to_labels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Argument used when doing sequence summary, used in the models <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTDoubleHeadsModel">OpenAIGPTDoubleHeadsModel</a> and
<a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTDoubleHeadsModel">OpenAIGPTDoubleHeadsModel</a>.</p>
<p>Whether the projection outputs should have <code>config.num_labels</code> or <code>config.hidden_size</code> classes.`,name:"summary_proj_to_labels"},{anchor:"transformers.OpenAIGPTConfig.summary_first_dropout",description:`<strong>summary_first_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Argument used when doing sequence summary, used in the models <a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTDoubleHeadsModel">OpenAIGPTDoubleHeadsModel</a> and
<a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTDoubleHeadsModel">OpenAIGPTDoubleHeadsModel</a>.</p>
<p>The dropout ratio to be used after the projection and activation.`,name:"summary_first_dropout"},{anchor:"transformers.OpenAIGPTConfig.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.33.3/src/transformers/models/openai/configuration_openai.py#L27"}}),Ue=new me({props:{anchor:"transformers.OpenAIGPTConfig.example",$$slots:{default:[Ul]},$$scope:{ctx:G}}}),Bt=new B({}),Vt=new H({props:{name:"class transformers.OpenAIGPTTokenizer",anchor:"transformers.OpenAIGPTTokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"unk_token",val:" = '<unk>'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OpenAIGPTTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.OpenAIGPTTokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.OpenAIGPTTokenizer.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.33.3/src/transformers/models/openai/tokenization_openai.py#L245"}}),Et=new H({props:{name:"save_vocabulary",anchor:"transformers.OpenAIGPTTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/openai/tokenization_openai.py#L378"}}),Rt=new B({}),Dt=new H({props:{name:"class transformers.OpenAIGPTTokenizerFast",anchor:"transformers.OpenAIGPTTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"merges_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"unk_token",val:" = '<unk>'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OpenAIGPTTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.OpenAIGPTTokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.OpenAIGPTTokenizerFast.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.33.3/src/transformers/models/openai/tokenization_openai_fast.py#L40"}}),Xt=new B({}),Qt=new H({props:{name:"class transformers.models.openai.modeling_openai.OpenAIGPTDoubleHeadsModelOutput",anchor:"transformers.models.openai.modeling_openai.OpenAIGPTDoubleHeadsModelOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"mc_loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"logits",val:": FloatTensor = None"},{name:"mc_logits",val:": FloatTensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.openai.modeling_openai.OpenAIGPTDoubleHeadsModelOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Language modeling loss.`,name:"loss"},{anchor:"transformers.models.openai.modeling_openai.OpenAIGPTDoubleHeadsModelOutput.mc_loss",description:`<strong>mc_loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>mc_labels</code> is provided) &#x2014;
Multiple choice classification loss.`,name:"mc_loss"},{anchor:"transformers.models.openai.modeling_openai.OpenAIGPTDoubleHeadsModelOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"logits"},{anchor:"transformers.models.openai.modeling_openai.OpenAIGPTDoubleHeadsModelOutput.mc_logits",description:`<strong>mc_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) &#x2014;
Prediction scores of the multiple choice classification head (scores for each choice before SoftMax).`,name:"mc_logits"},{anchor:"transformers.models.openai.modeling_openai.OpenAIGPTDoubleHeadsModelOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.openai.modeling_openai.OpenAIGPTDoubleHeadsModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/openai/modeling_openai.py#L298"}}),Yt=new H({props:{name:"class transformers.models.openai.modeling_tf_openai.TFOpenAIGPTDoubleHeadsModelOutput",anchor:"transformers.models.openai.modeling_tf_openai.TFOpenAIGPTDoubleHeadsModelOutput",parameters:[{name:"logits",val:": tf.Tensor = None"},{name:"mc_logits",val:": tf.Tensor = None"},{name:"hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"attentions",val:": Tuple[tf.Tensor] | None = None"}],parametersDescription:[{anchor:"transformers.models.openai.modeling_tf_openai.TFOpenAIGPTDoubleHeadsModelOutput.logits",description:`<strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"logits"},{anchor:"transformers.models.openai.modeling_tf_openai.TFOpenAIGPTDoubleHeadsModelOutput.mc_logits",description:`<strong>mc_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_choices)</code>) &#x2014;
Prediction scores of the multiple choice classification head (scores for each choice before SoftMax).`,name:"mc_logits"},{anchor:"transformers.models.openai.modeling_tf_openai.TFOpenAIGPTDoubleHeadsModelOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.openai.modeling_tf_openai.TFOpenAIGPTDoubleHeadsModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/openai/modeling_tf_openai.py#L362"}}),Kt=new B({}),en=new H({props:{name:"class transformers.OpenAIGPTModel",anchor:"transformers.OpenAIGPTModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.OpenAIGPTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig">OpenAIGPTConfig</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.33.3/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.33.3/src/transformers/models/openai/modeling_openai.py#L402"}}),tn=new H({props:{name:"forward",anchor:"transformers.OpenAIGPTModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = 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:"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.OpenAIGPTModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.OpenAIGPTModel.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.OpenAIGPTModel.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.OpenAIGPTModel.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.OpenAIGPTModel.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.OpenAIGPTModel.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.OpenAIGPTModel.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.OpenAIGPTModel.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.OpenAIGPTModel.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.33.3/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.33.3/src/transformers/models/openai/modeling_openai.py#L428",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</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.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig"
>OpenAIGPTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, 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>) — 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.33.3/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Le=new le({props:{$$slots:{default:[Jl]},$$scope:{ctx:G}}}),Se=new me({props:{anchor:"transformers.OpenAIGPTModel.forward.example",$$slots:{default:[Nl]},$$scope:{ctx:G}}}),nn=new B({}),on=new H({props:{name:"class transformers.OpenAIGPTLMHeadModel",anchor:"transformers.OpenAIGPTLMHeadModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.OpenAIGPTLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig">OpenAIGPTConfig</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.33.3/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.33.3/src/transformers/models/openai/modeling_openai.py#L533"}}),sn=new H({props:{name:"forward",anchor:"transformers.OpenAIGPTLMHeadModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = 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:"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.OpenAIGPTLMHeadModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.OpenAIGPTLMHeadModel.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.OpenAIGPTLMHeadModel.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.OpenAIGPTLMHeadModel.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.OpenAIGPTLMHeadModel.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.OpenAIGPTLMHeadModel.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.OpenAIGPTLMHeadModel.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.OpenAIGPTLMHeadModel.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.OpenAIGPTLMHeadModel.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.33.3/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.OpenAIGPTLMHeadModel.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.33.3/src/transformers/models/openai/modeling_openai.py#L550",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</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.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig"
>OpenAIGPTConfig</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) — 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>) — Prediction scores of the language modeling head (scores for each vocabulary token 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>) — 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>) — 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.33.3/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Be=new le({props:{$$slots:{default:[ql]},$$scope:{ctx:G}}}),Ve=new me({props:{anchor:"transformers.OpenAIGPTLMHeadModel.forward.example",$$slots:{default:[Wl]},$$scope:{ctx:G}}}),an=new B({}),rn=new H({props:{name:"class transformers.OpenAIGPTDoubleHeadsModel",anchor:"transformers.OpenAIGPTDoubleHeadsModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.OpenAIGPTDoubleHeadsModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig">OpenAIGPTConfig</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.33.3/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.33.3/src/transformers/models/openai/modeling_openai.py#L624"}}),ln=new H({props:{name:"forward",anchor:"transformers.OpenAIGPTDoubleHeadsModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = 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:"mc_token_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"mc_labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.OpenAIGPTDoubleHeadsModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.OpenAIGPTDoubleHeadsModel.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.OpenAIGPTDoubleHeadsModel.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.OpenAIGPTDoubleHeadsModel.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.OpenAIGPTDoubleHeadsModel.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.OpenAIGPTDoubleHeadsModel.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.OpenAIGPTDoubleHeadsModel.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.OpenAIGPTDoubleHeadsModel.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.OpenAIGPTDoubleHeadsModel.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.33.3/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.OpenAIGPTDoubleHeadsModel.forward.mc_token_ids",description:`<strong>mc_token_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices)</code>, <em>optional</em>, default to index of the last token of the input) &#x2014;
Index of the classification token in each input sequence. Selected in the range <code>[0, input_ids.size(-1) - 1]</code>.`,name:"mc_token_ids"},{anchor:"transformers.OpenAIGPTDoubleHeadsModel.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>[-1, 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"},{anchor:"transformers.OpenAIGPTDoubleHeadsModel.forward.mc_labels",description:`<strong>mc_labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices]</code>
where <em>num_choices</em> is the size of the second dimension of the input tensors. (see <em>input_ids</em> above)`,name:"mc_labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/openai/modeling_openai.py#L644",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.models.openai.modeling_openai.OpenAIGPTDoubleHeadsModelOutput"
>transformers.models.openai.modeling_openai.OpenAIGPTDoubleHeadsModelOutput</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.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig"
>OpenAIGPTConfig</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) — Language modeling loss.</p>
</li>
<li>
<p><strong>mc_loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>mc_labels</code> is provided) — Multiple choice classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>mc_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) — Prediction scores of the multiple choice classification head (scores for each choice 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>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.models.openai.modeling_openai.OpenAIGPTDoubleHeadsModelOutput"
>transformers.models.openai.modeling_openai.OpenAIGPTDoubleHeadsModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Re=new le({props:{$$slots:{default:[Ll]},$$scope:{ctx:G}}}),De=new me({props:{anchor:"transformers.OpenAIGPTDoubleHeadsModel.forward.example",$$slots:{default:[Sl]},$$scope:{ctx:G}}}),dn=new B({}),cn=new H({props:{name:"class transformers.OpenAIGPTForSequenceClassification",anchor:"transformers.OpenAIGPTForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.OpenAIGPTForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig">OpenAIGPTConfig</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.33.3/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.33.3/src/transformers/models/openai/modeling_openai.py#L752"}}),pn=new H({props:{name:"forward",anchor:"transformers.OpenAIGPTForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = 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:"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.OpenAIGPTForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.OpenAIGPTForSequenceClassification.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.OpenAIGPTForSequenceClassification.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.OpenAIGPTForSequenceClassification.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.OpenAIGPTForSequenceClassification.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.OpenAIGPTForSequenceClassification.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.OpenAIGPTForSequenceClassification.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.OpenAIGPTForSequenceClassification.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.OpenAIGPTForSequenceClassification.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.33.3/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.OpenAIGPTForSequenceClassification.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.33.3/src/transformers/models/openai/modeling_openai.py#L762",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.3/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.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig"
>OpenAIGPTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, 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>) — 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.33.3/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qe=new le({props:{$$slots:{default:[Zl]},$$scope:{ctx:G}}}),Ye=new me({props:{anchor:"transformers.OpenAIGPTForSequenceClassification.forward.example",$$slots:{default:[Bl]},$$scope:{ctx:G}}}),Ke=new me({props:{anchor:"transformers.OpenAIGPTForSequenceClassification.forward.example-2",$$slots:{default:[Vl]},$$scope:{ctx:G}}}),mn=new B({}),un=new H({props:{name:"class transformers.TFOpenAIGPTModel",anchor:"transformers.TFOpenAIGPTModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFOpenAIGPTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig">OpenAIGPTConfig</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.33.3/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.33.3/src/transformers/models/openai/modeling_tf_openai.py#L492"}}),tt=new le({props:{$$slots:{default:[El]},$$scope:{ctx:G}}}),hn=new H({props:{name:"call",anchor:"transformers.TFOpenAIGPTModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFOpenAIGPTModel.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.33.3/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.TFOpenAIGPTModel.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.TFOpenAIGPTModel.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.TFOpenAIGPTModel.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.TFOpenAIGPTModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFOpenAIGPTModel.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.TFOpenAIGPTModel.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.TFOpenAIGPTModel.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.TFOpenAIGPTModel.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.33.3/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.TFOpenAIGPTModel.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.33.3/src/transformers/models/openai/modeling_tf_openai.py#L497",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</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.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig"
>OpenAIGPTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),nt=new le({props:{$$slots:{default:[Rl]},$$scope:{ctx:G}}}),ot=new me({props:{anchor:"transformers.TFOpenAIGPTModel.call.example",$$slots:{default:[Dl]},$$scope:{ctx:G}}}),fn=new B({}),gn=new H({props:{name:"class transformers.TFOpenAIGPTLMHeadModel",anchor:"transformers.TFOpenAIGPTLMHeadModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFOpenAIGPTLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig">OpenAIGPTConfig</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.33.3/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.33.3/src/transformers/models/openai/modeling_tf_openai.py#L539"}}),at=new le({props:{$$slots:{default:[Xl]},$$scope:{ctx:G}}}),_n=new H({props:{name:"call",anchor:"transformers.TFOpenAIGPTLMHeadModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFOpenAIGPTLMHeadModel.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.33.3/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.TFOpenAIGPTLMHeadModel.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.TFOpenAIGPTLMHeadModel.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.TFOpenAIGPTLMHeadModel.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.TFOpenAIGPTLMHeadModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFOpenAIGPTLMHeadModel.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.TFOpenAIGPTLMHeadModel.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.TFOpenAIGPTLMHeadModel.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.TFOpenAIGPTLMHeadModel.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.33.3/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.TFOpenAIGPTLMHeadModel.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.TFOpenAIGPTLMHeadModel.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.33.3/src/transformers/models/openai/modeling_tf_openai.py#L552",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutput"
>transformers.modeling_tf_outputs.TFCausalLMOutput</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.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig"
>OpenAIGPTConfig</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) — 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>) — Prediction scores of the language modeling head (scores for each vocabulary token 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>) — Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutput"
>transformers.modeling_tf_outputs.TFCausalLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),rt=new le({props:{$$slots:{default:[Ql]},$$scope:{ctx:G}}}),it=new me({props:{anchor:"transformers.TFOpenAIGPTLMHeadModel.call.example",$$slots:{default:[Yl]},$$scope:{ctx:G}}}),Tn=new B({}),bn=new H({props:{name:"class transformers.TFOpenAIGPTDoubleHeadsModel",anchor:"transformers.TFOpenAIGPTDoubleHeadsModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFOpenAIGPTDoubleHeadsModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig">OpenAIGPTConfig</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.33.3/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.33.3/src/transformers/models/openai/modeling_tf_openai.py#L626"}}),dt=new le({props:{$$slots:{default:[Kl]},$$scope:{ctx:G}}}),yn=new H({props:{name:"call",anchor:"transformers.TFOpenAIGPTDoubleHeadsModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"mc_token_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFOpenAIGPTDoubleHeadsModel.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.33.3/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.TFOpenAIGPTDoubleHeadsModel.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.TFOpenAIGPTDoubleHeadsModel.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.TFOpenAIGPTDoubleHeadsModel.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.TFOpenAIGPTDoubleHeadsModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFOpenAIGPTDoubleHeadsModel.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.TFOpenAIGPTDoubleHeadsModel.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.TFOpenAIGPTDoubleHeadsModel.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.TFOpenAIGPTDoubleHeadsModel.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.33.3/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.TFOpenAIGPTDoubleHeadsModel.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.TFOpenAIGPTDoubleHeadsModel.call.mc_token_ids",description:`<strong>mc_token_ids</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, num_choices)</code>, <em>optional</em>, default to index of the last token of the input) &#x2014;
Index of the classification token in each input sequence. Selected in the range <code>[0, input_ids.size(-1) - 1]</code>.`,name:"mc_token_ids"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/openai/modeling_tf_openai.py#L635",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.models.openai.modeling_tf_openai.TFOpenAIGPTDoubleHeadsModelOutput"
>transformers.models.openai.modeling_tf_openai.TFOpenAIGPTDoubleHeadsModelOutput</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.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig"
>OpenAIGPTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>mc_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_choices)</code>) — Prediction scores of the multiple choice classification head (scores for each choice 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>) — Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.models.openai.modeling_tf_openai.TFOpenAIGPTDoubleHeadsModelOutput"
>transformers.models.openai.modeling_tf_openai.TFOpenAIGPTDoubleHeadsModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ct=new le({props:{$$slots:{default:[ed]},$$scope:{ctx:G}}}),pt=new me({props:{anchor:"transformers.TFOpenAIGPTDoubleHeadsModel.call.example",$$slots:{default:[td]},$$scope:{ctx:G}}}),vn=new B({}),Mn=new H({props:{name:"class transformers.TFOpenAIGPTForSequenceClassification",anchor:"transformers.TFOpenAIGPTForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFOpenAIGPTForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig">OpenAIGPTConfig</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.33.3/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.33.3/src/transformers/models/openai/modeling_tf_openai.py#L753"}}),ut=new le({props:{$$slots:{default:[nd]},$$scope:{ctx:G}}}),wn=new H({props:{name:"call",anchor:"transformers.TFOpenAIGPTForSequenceClassification.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFOpenAIGPTForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.33.3/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.TFOpenAIGPTForSequenceClassification.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.TFOpenAIGPTForSequenceClassification.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.TFOpenAIGPTForSequenceClassification.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.TFOpenAIGPTForSequenceClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFOpenAIGPTForSequenceClassification.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.TFOpenAIGPTForSequenceClassification.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.TFOpenAIGPTForSequenceClassification.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.TFOpenAIGPTForSequenceClassification.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.33.3/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.TFOpenAIGPTForSequenceClassification.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.TFOpenAIGPTForSequenceClassification.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.33.3/src/transformers/models/openai/modeling_tf_openai.py#L765",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.3/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.33.3/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig"
>OpenAIGPTConfig</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) — Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ht=new le({props:{$$slots:{default:[od]},$$scope:{ctx:G}}}),ft=new me({props:{anchor:"transformers.TFOpenAIGPTForSequenceClassification.call.example",$$slots:{default:[sd]},$$scope:{ctx:G}}}),gt=new me({props:{anchor:"transformers.TFOpenAIGPTForSequenceClassification.call.example-2",$$slots:{default:[ad]},$$scope:{ctx:G}}}),{c(){n=s("meta"),_=i(),m=s("p"),p=i(),k=s("h1"),r=s("a"),g=s("span"),T(z.$$.fragment),A=i(),x=s("span"),x.textContent=V,C=i(),P=s("div"),P.innerHTML=E,h=i(),I=s("h2"),je=s("a"),Uo=s("span"),T(wt.$$.fragment),ua=i(),An=s("span"),An.textContent=Xr,ps=i(),kt=s("p"),kt.innerHTML=Qr,ms=i(),$t=s("p"),$t.textContent=Yr,us=i(),It=s("p"),It.innerHTML=Kr,hs=i(),Gt=s("p"),Gt.textContent=ei,fs=i(),Pt=s("ul"),Pt.innerHTML=ti,gs=i(),xt=s("p"),xt.innerHTML=ni,_s=i(),Ct=s("p"),Ct.innerHTML=oi,Ts=i(),At=s("p"),At.textContent=si,bs=i(),Ot=s("p"),Ot.innerHTML=ai,ys=i(),T(Ht.$$.fragment),vs=i(),jt=s("p"),jt.innerHTML=ri,Ms=i(),be=s("h2"),ze=s("a"),Jo=s("span"),T(zt.$$.fragment),ha=i(),On=s("span"),On.textContent=ii,ws=i(),Ft=s("p"),Ft.textContent=li,ks=i(),T(Ut.$$.fragment),$s=i(),Jt=s("ul"),Jt.innerHTML=di,Is=i(),T(Nt.$$.fragment),Gs=i(),qt=s("ul"),qt.innerHTML=ci,Ps=i(),T(Wt.$$.fragment),xs=i(),Lt=s("ul"),Lt.innerHTML=pi,Cs=i(),ye=s("h2"),Fe=s("a"),No=s("span"),T(St.$$.fragment),fa=i(),Hn=s("span"),Hn.textContent=mi,As=i(),X=s("div"),T(Zt.$$.fragment),ga=i(),jn=s("p"),jn.innerHTML=ui,_a=i(),zn=s("p"),zn.innerHTML=hi,Ta=i(),T(Ue.$$.fragment),Os=i(),ve=s("h2"),Je=s("a"),qo=s("span"),T(Bt.$$.fragment),ba=i(),Fn=s("span"),Fn.textContent=fi,Hs=i(),q=s("div"),T(Vt.$$.fragment),ya=i(),Un=s("p"),Un.textContent=gi,va=i(),Jn=s("ul"),Jn.innerHTML=_i,Ma=i(),Nn=s("p"),Nn.innerHTML=Ti,wa=i(),qn=s("div"),T(Et.$$.fragment),js=i(),Me=s("h2"),Ne=s("a"),Wo=s("span"),T(Rt.$$.fragment),ka=i(),Wn=s("span"),Wn.textContent=bi,zs=i(),Q=s("div"),T(Dt.$$.fragment),$a=i(),Ln=s("p"),Ln.innerHTML=yi,Ia=i(),Sn=s("ul"),Sn.innerHTML=vi,Ga=i(),Zn=s("p"),Zn.innerHTML=Mi,Fs=i(),we=s("h2"),qe=s("a"),Lo=s("span"),T(Xt.$$.fragment),Pa=i(),Bn=s("span"),Bn.textContent=wi,Us=i(),ke=s("div"),T(Qt.$$.fragment),xa=i(),Vn=s("p"),Vn.textContent=ki,Js=i(),$e=s("div"),T(Yt.$$.fragment),Ca=i(),En=s("p"),En.textContent=$i,Ns=i(),Ie=s("h2"),We=s("a"),So=s("span"),T(Kt.$$.fragment),Aa=i(),Rn=s("span"),Rn.textContent=Ii,qs=i(),W=s("div"),T(en.$$.fragment),Oa=i(),Dn=s("p"),Dn.textContent=Gi,Ha=i(),Xn=s("p"),Xn.innerHTML=Pi,ja=i(),Qn=s("p"),Qn.innerHTML=xi,za=i(),K=s("div"),T(tn.$$.fragment),Fa=i(),Yn=s("p"),Yn.innerHTML=Ci,Ua=i(),T(Le.$$.fragment),Ja=i(),T(Se.$$.fragment),Ws=i(),Ge=s("h2"),Ze=s("a"),Zo=s("span"),T(nn.$$.fragment),Na=i(),Kn=s("span"),Kn.textContent=Ai,Ls=i(),L=s("div"),T(on.$$.fragment),qa=i(),eo=s("p"),eo.textContent=Oi,Wa=i(),to=s("p"),to.innerHTML=Hi,La=i(),no=s("p"),no.innerHTML=ji,Sa=i(),ee=s("div"),T(sn.$$.fragment),Za=i(),oo=s("p"),oo.innerHTML=zi,Ba=i(),T(Be.$$.fragment),Va=i(),T(Ve.$$.fragment),Ss=i(),Pe=s("h2"),Ee=s("a"),Bo=s("span"),T(an.$$.fragment),Ea=i(),so=s("span"),so.textContent=Fi,Zs=i(),S=s("div"),T(rn.$$.fragment),Ra=i(),ao=s("p"),ao.textContent=Ui,Da=i(),ro=s("p"),ro.innerHTML=Ji,Xa=i(),io=s("p"),io.innerHTML=Ni,Qa=i(),te=s("div"),T(ln.$$.fragment),Ya=i(),lo=s("p"),lo.innerHTML=qi,Ka=i(),T(Re.$$.fragment),er=i(),T(De.$$.fragment),Bs=i(),xe=s("h2"),Xe=s("a"),Vo=s("span"),T(dn.$$.fragment),tr=i(),co=s("span"),co.textContent=Wi,Vs=i(),Z=s("div"),T(cn.$$.fragment),nr=i(),po=s("p"),po.innerHTML=Li,or=i(),mo=s("p"),mo.innerHTML=Si,sr=i(),uo=s("p"),uo.innerHTML=Zi,ar=i(),R=s("div"),T(pn.$$.fragment),rr=i(),ho=s("p"),ho.innerHTML=Bi,ir=i(),T(Qe.$$.fragment),lr=i(),T(Ye.$$.fragment),dr=i(),T(Ke.$$.fragment),Es=i(),Ce=s("h2"),et=s("a"),Eo=s("span"),T(mn.$$.fragment),cr=i(),fo=s("span"),fo.textContent=Vi,Rs=i(),F=s("div"),T(un.$$.fragment),pr=i(),go=s("p"),go.textContent=Ei,mr=i(),_o=s("p"),_o.innerHTML=Ri,ur=i(),To=s("p"),To.innerHTML=Di,hr=i(),T(tt.$$.fragment),fr=i(),ne=s("div"),T(hn.$$.fragment),gr=i(),bo=s("p"),bo.innerHTML=Xi,_r=i(),T(nt.$$.fragment),Tr=i(),T(ot.$$.fragment),Ds=i(),Ae=s("h2"),st=s("a"),Ro=s("span"),T(fn.$$.fragment),br=i(),yo=s("span"),yo.textContent=Qi,Xs=i(),U=s("div"),T(gn.$$.fragment),yr=i(),vo=s("p"),vo.textContent=Yi,vr=i(),Mo=s("p"),Mo.innerHTML=Ki,Mr=i(),wo=s("p"),wo.innerHTML=el,wr=i(),T(at.$$.fragment),kr=i(),oe=s("div"),T(_n.$$.fragment),$r=i(),ko=s("p"),ko.innerHTML=tl,Ir=i(),T(rt.$$.fragment),Gr=i(),T(it.$$.fragment),Qs=i(),Oe=s("h2"),lt=s("a"),Do=s("span"),T(Tn.$$.fragment),Pr=i(),$o=s("span"),$o.textContent=nl,Ys=i(),J=s("div"),T(bn.$$.fragment),xr=i(),Io=s("p"),Io.textContent=ol,Cr=i(),Go=s("p"),Go.innerHTML=sl,Ar=i(),Po=s("p"),Po.innerHTML=al,Or=i(),T(dt.$$.fragment),Hr=i(),se=s("div"),T(yn.$$.fragment),jr=i(),xo=s("p"),xo.innerHTML=rl,zr=i(),T(ct.$$.fragment),Fr=i(),T(pt.$$.fragment),Ks=i(),He=s("h2"),mt=s("a"),Xo=s("span"),T(vn.$$.fragment),Ur=i(),Co=s("span"),Co.textContent=il,ea=i(),j=s("div"),T(Mn.$$.fragment),Jr=i(),Ao=s("p"),Ao.textContent=ll,Nr=i(),Oo=s("p"),Oo.innerHTML=dl,qr=i(),Ho=s("p"),Ho.innerHTML=cl,Wr=i(),jo=s("p"),jo.innerHTML=pl,Lr=i(),zo=s("p"),zo.innerHTML=ml,Sr=i(),T(ut.$$.fragment),Zr=i(),D=s("div"),T(wn.$$.fragment),Br=i(),Fo=s("p"),Fo.innerHTML=ul,Vr=i(),T(ht.$$.fragment),Er=i(),T(ft.$$.fragment),Rr=i(),T(gt.$$.fragment),ta=i(),Qo=s("p"),this.h()},l(e){const c=Fl("svelte-1phssyn",document.head);n=a(c,"META",{name:!0,content:!0}),c.forEach(t),_=l(e),m=a(e,"P",{}),$(m).forEach(t),p=l(e),k=a(e,"H1",{class:!0});var kn=$(k);r=a(kn,"A",{id:!0,class:!0,href:!0});var Yo=$(r);g=a(Yo,"SPAN",{});var Ko=$(g);b(z.$$.fragment,Ko),Ko.forEach(t),Yo.forEach(t),A=l(kn),x=a(kn,"SPAN",{"data-svelte-h":!0}),u(x)!=="svelte-ihxqc"&&(x.textContent=V),kn.forEach(t),C=l(e),P=a(e,"DIV",{class:!0,"data-svelte-h":!0}),u(P)!=="svelte-ol7n4e"&&(P.innerHTML=E),h=l(e),I=a(e,"H2",{class:!0});var $n=$(I);je=a($n,"A",{id:!0,class:!0,href:!0});var es=$(je);Uo=a(es,"SPAN",{});var ts=$(Uo);b(wt.$$.fragment,ts),ts.forEach(t),es.forEach(t),ua=l($n),An=a($n,"SPAN",{"data-svelte-h":!0}),u(An)!=="svelte-1jsw1pg"&&(An.textContent=Xr),$n.forEach(t),ps=l(e),kt=a(e,"P",{"data-svelte-h":!0}),u(kt)!=="svelte-lzxyn"&&(kt.innerHTML=Qr),ms=l(e),$t=a(e,"P",{"data-svelte-h":!0}),u($t)!=="svelte-vfdo9a"&&($t.textContent=Yr),us=l(e),It=a(e,"P",{"data-svelte-h":!0}),u(It)!=="svelte-1r8x2z3"&&(It.innerHTML=Kr),hs=l(e),Gt=a(e,"P",{"data-svelte-h":!0}),u(Gt)!=="svelte-axv494"&&(Gt.textContent=ei),fs=l(e),Pt=a(e,"UL",{"data-svelte-h":!0}),u(Pt)!=="svelte-e2gzft"&&(Pt.innerHTML=ti),gs=l(e),xt=a(e,"P",{"data-svelte-h":!0}),u(xt)!=="svelte-zq7bpd"&&(xt.innerHTML=ni),_s=l(e),Ct=a(e,"P",{"data-svelte-h":!0}),u(Ct)!=="svelte-wafrd3"&&(Ct.innerHTML=oi),Ts=l(e),At=a(e,"P",{"data-svelte-h":!0}),u(At)!=="svelte-fovr4a"&&(At.textContent=si),bs=l(e),Ot=a(e,"P",{"data-svelte-h":!0}),u(Ot)!=="svelte-9fkltf"&&(Ot.innerHTML=ai),ys=l(e),b(Ht.$$.fragment,e),vs=l(e),jt=a(e,"P",{"data-svelte-h":!0}),u(jt)!=="svelte-vqzwb4"&&(jt.innerHTML=ri),Ms=l(e),be=a(e,"H2",{class:!0});var In=$(be);ze=a(In,"A",{id:!0,class:!0,href:!0});var ns=$(ze);Jo=a(ns,"SPAN",{});var os=$(Jo);b(zt.$$.fragment,os),os.forEach(t),ns.forEach(t),ha=l(In),On=a(In,"SPAN",{"data-svelte-h":!0}),u(On)!=="svelte-w4zzv6"&&(On.textContent=ii),In.forEach(t),ws=l(e),Ft=a(e,"P",{"data-svelte-h":!0}),u(Ft)!=="svelte-z786dm"&&(Ft.textContent=li),ks=l(e),b(Ut.$$.fragment,e),$s=l(e),Jt=a(e,"UL",{"data-svelte-h":!0}),u(Jt)!=="svelte-re9l8x"&&(Jt.innerHTML=di),Is=l(e),b(Nt.$$.fragment,e),Gs=l(e),qt=a(e,"UL",{"data-svelte-h":!0}),u(qt)!=="svelte-13a6gal"&&(qt.innerHTML=ci),Ps=l(e),b(Wt.$$.fragment,e),xs=l(e),Lt=a(e,"UL",{"data-svelte-h":!0}),u(Lt)!=="svelte-1goz972"&&(Lt.innerHTML=pi),Cs=l(e),ye=a(e,"H2",{class:!0});var Gn=$(ye);Fe=a(Gn,"A",{id:!0,class:!0,href:!0});var ss=$(Fe);No=a(ss,"SPAN",{});var as=$(No);b(St.$$.fragment,as),as.forEach(t),ss.forEach(t),fa=l(Gn),Hn=a(Gn,"SPAN",{"data-svelte-h":!0}),u(Hn)!=="svelte-1oem62y"&&(Hn.textContent=mi),Gn.forEach(t),As=l(e),X=a(e,"DIV",{class:!0});var ce=$(X);b(Zt.$$.fragment,ce),ga=l(ce),jn=a(ce,"P",{"data-svelte-h":!0}),u(jn)!=="svelte-txzqis"&&(jn.innerHTML=ui),_a=l(ce),zn=a(ce,"P",{"data-svelte-h":!0}),u(zn)!=="svelte-cfh5wl"&&(zn.innerHTML=hi),Ta=l(ce),b(Ue.$$.fragment,ce),ce.forEach(t),Os=l(e),ve=a(e,"H2",{class:!0});var Pn=$(ve);Je=a(Pn,"A",{id:!0,class:!0,href:!0});var rs=$(Je);qo=a(rs,"SPAN",{});var is=$(qo);b(Bt.$$.fragment,is),is.forEach(t),rs.forEach(t),ba=l(Pn),Fn=a(Pn,"SPAN",{"data-svelte-h":!0}),u(Fn)!=="svelte-13u4sk9"&&(Fn.textContent=fi),Pn.forEach(t),Hs=l(e),q=a(e,"DIV",{class:!0});var Y=$(q);b(Vt.$$.fragment,Y),ya=l(Y),Un=a(Y,"P",{"data-svelte-h":!0}),u(Un)!=="svelte-1mapzk"&&(Un.textContent=gi),va=l(Y),Jn=a(Y,"UL",{"data-svelte-h":!0}),u(Jn)!=="svelte-1ob4ey9"&&(Jn.innerHTML=_i),Ma=l(Y),Nn=a(Y,"P",{"data-svelte-h":!0}),u(Nn)!=="svelte-14xlfoy"&&(Nn.innerHTML=Ti),wa=l(Y),qn=a(Y,"DIV",{class:!0});var ls=$(qn);b(Et.$$.fragment,ls),ls.forEach(t),Y.forEach(t),js=l(e),Me=a(e,"H2",{class:!0});var xn=$(Me);Ne=a(xn,"A",{id:!0,class:!0,href:!0});var ds=$(Ne);Wo=a(ds,"SPAN",{});var cs=$(Wo);b(Rt.$$.fragment,cs),cs.forEach(t),ds.forEach(t),ka=l(xn),Wn=a(xn,"SPAN",{"data-svelte-h":!0}),u(Wn)!=="svelte-6uwoyv"&&(Wn.textContent=bi),xn.forEach(t),zs=l(e),Q=a(e,"DIV",{class:!0});var pe=$(Q);b(Dt.$$.fragment,pe),$a=l(pe),Ln=a(pe,"P",{"data-svelte-h":!0}),u(Ln)!=="svelte-1ktb3mv"&&(Ln.innerHTML=yi),Ia=l(pe),Sn=a(pe,"UL",{"data-svelte-h":!0}),u(Sn)!=="svelte-ls1v46"&&(Sn.innerHTML=vi),Ga=l(pe),Zn=a(pe,"P",{"data-svelte-h":!0}),u(Zn)!=="svelte-10uwgx2"&&(Zn.innerHTML=Mi),pe.forEach(t),Fs=l(e),we=a(e,"H2",{class:!0});var Cn=$(we);qe=a(Cn,"A",{id:!0,class:!0,href:!0});var hl=$(qe);Lo=a(hl,"SPAN",{});var fl=$(Lo);b(Xt.$$.fragment,fl),fl.forEach(t),hl.forEach(t),Pa=l(Cn),Bn=a(Cn,"SPAN",{"data-svelte-h":!0}),u(Bn)!=="svelte-12sgx3"&&(Bn.textContent=wi),Cn.forEach(t),Us=l(e),ke=a(e,"DIV",{class:!0});var oa=$(ke);b(Qt.$$.fragment,oa),xa=l(oa),Vn=a(oa,"P",{"data-svelte-h":!0}),u(Vn)!=="svelte-1bm2i0r"&&(Vn.textContent=ki),oa.forEach(t),Js=l(e),$e=a(e,"DIV",{class:!0});var sa=$($e);b(Yt.$$.fragment,sa),Ca=l(sa),En=a(sa,"P",{"data-svelte-h":!0}),u(En)!=="svelte-1bm2i0r"&&(En.textContent=$i),sa.forEach(t),Ns=l(e),Ie=a(e,"H2",{class:!0});var aa=$(Ie);We=a(aa,"A",{id:!0,class:!0,href:!0});var gl=$(We);So=a(gl,"SPAN",{});var _l=$(So);b(Kt.$$.fragment,_l),_l.forEach(t),gl.forEach(t),Aa=l(aa),Rn=a(aa,"SPAN",{"data-svelte-h":!0}),u(Rn)!=="svelte-18ftn5l"&&(Rn.textContent=Ii),aa.forEach(t),qs=l(e),W=a(e,"DIV",{class:!0});var ue=$(W);b(en.$$.fragment,ue),Oa=l(ue),Dn=a(ue,"P",{"data-svelte-h":!0}),u(Dn)!=="svelte-147bz4w"&&(Dn.textContent=Gi),Ha=l(ue),Xn=a(ue,"P",{"data-svelte-h":!0}),u(Xn)!=="svelte-ev63c"&&(Xn.innerHTML=Pi),ja=l(ue),Qn=a(ue,"P",{"data-svelte-h":!0}),u(Qn)!=="svelte-hswkmf"&&(Qn.innerHTML=xi),za=l(ue),K=a(ue,"DIV",{class:!0});var _t=$(K);b(tn.$$.fragment,_t),Fa=l(_t),Yn=a(_t,"P",{"data-svelte-h":!0}),u(Yn)!=="svelte-154i6jv"&&(Yn.innerHTML=Ci),Ua=l(_t),b(Le.$$.fragment,_t),Ja=l(_t),b(Se.$$.fragment,_t),_t.forEach(t),ue.forEach(t),Ws=l(e),Ge=a(e,"H2",{class:!0});var ra=$(Ge);Ze=a(ra,"A",{id:!0,class:!0,href:!0});var Tl=$(Ze);Zo=a(Tl,"SPAN",{});var bl=$(Zo);b(nn.$$.fragment,bl),bl.forEach(t),Tl.forEach(t),Na=l(ra),Kn=a(ra,"SPAN",{"data-svelte-h":!0}),u(Kn)!=="svelte-1akoois"&&(Kn.textContent=Ai),ra.forEach(t),Ls=l(e),L=a(e,"DIV",{class:!0});var he=$(L);b(on.$$.fragment,he),qa=l(he),eo=a(he,"P",{"data-svelte-h":!0}),u(eo)!=="svelte-w06qmh"&&(eo.textContent=Oi),Wa=l(he),to=a(he,"P",{"data-svelte-h":!0}),u(to)!=="svelte-ev63c"&&(to.innerHTML=Hi),La=l(he),no=a(he,"P",{"data-svelte-h":!0}),u(no)!=="svelte-hswkmf"&&(no.innerHTML=ji),Sa=l(he),ee=a(he,"DIV",{class:!0});var Tt=$(ee);b(sn.$$.fragment,Tt),Za=l(Tt),oo=a(Tt,"P",{"data-svelte-h":!0}),u(oo)!=="svelte-1v7ypu9"&&(oo.innerHTML=zi),Ba=l(Tt),b(Be.$$.fragment,Tt),Va=l(Tt),b(Ve.$$.fragment,Tt),Tt.forEach(t),he.forEach(t),Ss=l(e),Pe=a(e,"H2",{class:!0});var ia=$(Pe);Ee=a(ia,"A",{id:!0,class:!0,href:!0});var yl=$(Ee);Bo=a(yl,"SPAN",{});var vl=$(Bo);b(an.$$.fragment,vl),vl.forEach(t),yl.forEach(t),Ea=l(ia),so=a(ia,"SPAN",{"data-svelte-h":!0}),u(so)!=="svelte-vaamwt"&&(so.textContent=Fi),ia.forEach(t),Zs=l(e),S=a(e,"DIV",{class:!0});var fe=$(S);b(rn.$$.fragment,fe),Ra=l(fe),ao=a(fe,"P",{"data-svelte-h":!0}),u(ao)!=="svelte-1iaobcj"&&(ao.textContent=Ui),Da=l(fe),ro=a(fe,"P",{"data-svelte-h":!0}),u(ro)!=="svelte-ev63c"&&(ro.innerHTML=Ji),Xa=l(fe),io=a(fe,"P",{"data-svelte-h":!0}),u(io)!=="svelte-hswkmf"&&(io.innerHTML=Ni),Qa=l(fe),te=a(fe,"DIV",{class:!0});var bt=$(te);b(ln.$$.fragment,bt),Ya=l(bt),lo=a(bt,"P",{"data-svelte-h":!0}),u(lo)!=="svelte-1sf45dv"&&(lo.innerHTML=qi),Ka=l(bt),b(Re.$$.fragment,bt),er=l(bt),b(De.$$.fragment,bt),bt.forEach(t),fe.forEach(t),Bs=l(e),xe=a(e,"H2",{class:!0});var la=$(xe);Xe=a(la,"A",{id:!0,class:!0,href:!0});var Ml=$(Xe);Vo=a(Ml,"SPAN",{});var wl=$(Vo);b(dn.$$.fragment,wl),wl.forEach(t),Ml.forEach(t),tr=l(la),co=a(la,"SPAN",{"data-svelte-h":!0}),u(co)!=="svelte-9n59yc"&&(co.textContent=Wi),la.forEach(t),Vs=l(e),Z=a(e,"DIV",{class:!0});var ge=$(Z);b(cn.$$.fragment,ge),nr=l(ge),po=a(ge,"P",{"data-svelte-h":!0}),u(po)!=="svelte-wymghu"&&(po.innerHTML=Li),or=l(ge),mo=a(ge,"P",{"data-svelte-h":!0}),u(mo)!=="svelte-ev63c"&&(mo.innerHTML=Si),sr=l(ge),uo=a(ge,"P",{"data-svelte-h":!0}),u(uo)!=="svelte-hswkmf"&&(uo.innerHTML=Zi),ar=l(ge),R=a(ge,"DIV",{class:!0});var _e=$(R);b(pn.$$.fragment,_e),rr=l(_e),ho=a(_e,"P",{"data-svelte-h":!0}),u(ho)!=="svelte-1wse4t"&&(ho.innerHTML=Bi),ir=l(_e),b(Qe.$$.fragment,_e),lr=l(_e),b(Ye.$$.fragment,_e),dr=l(_e),b(Ke.$$.fragment,_e),_e.forEach(t),ge.forEach(t),Es=l(e),Ce=a(e,"H2",{class:!0});var da=$(Ce);et=a(da,"A",{id:!0,class:!0,href:!0});var kl=$(et);Eo=a(kl,"SPAN",{});var $l=$(Eo);b(mn.$$.fragment,$l),$l.forEach(t),kl.forEach(t),cr=l(da),fo=a(da,"SPAN",{"data-svelte-h":!0}),u(fo)!=="svelte-v17o6n"&&(fo.textContent=Vi),da.forEach(t),Rs=l(e),F=a(e,"DIV",{class:!0});var ae=$(F);b(un.$$.fragment,ae),pr=l(ae),go=a(ae,"P",{"data-svelte-h":!0}),u(go)!=="svelte-147bz4w"&&(go.textContent=Ei),mr=l(ae),_o=a(ae,"P",{"data-svelte-h":!0}),u(_o)!=="svelte-1e9g3w8"&&(_o.innerHTML=Ri),ur=l(ae),To=a(ae,"P",{"data-svelte-h":!0}),u(To)!=="svelte-1ivrf8m"&&(To.innerHTML=Di),hr=l(ae),b(tt.$$.fragment,ae),fr=l(ae),ne=a(ae,"DIV",{class:!0});var yt=$(ne);b(hn.$$.fragment,yt),gr=l(yt),bo=a(yt,"P",{"data-svelte-h":!0}),u(bo)!=="svelte-1v9kvl7"&&(bo.innerHTML=Xi),_r=l(yt),b(nt.$$.fragment,yt),Tr=l(yt),b(ot.$$.fragment,yt),yt.forEach(t),ae.forEach(t),Ds=l(e),Ae=a(e,"H2",{class:!0});var ca=$(Ae);st=a(ca,"A",{id:!0,class:!0,href:!0});var Il=$(st);Ro=a(Il,"SPAN",{});var Gl=$(Ro);b(fn.$$.fragment,Gl),Gl.forEach(t),Il.forEach(t),br=l(ca),yo=a(ca,"SPAN",{"data-svelte-h":!0}),u(yo)!=="svelte-r36lca"&&(yo.textContent=Qi),ca.forEach(t),Xs=l(e),U=a(e,"DIV",{class:!0});var re=$(U);b(gn.$$.fragment,re),yr=l(re),vo=a(re,"P",{"data-svelte-h":!0}),u(vo)!=="svelte-w06qmh"&&(vo.textContent=Yi),vr=l(re),Mo=a(re,"P",{"data-svelte-h":!0}),u(Mo)!=="svelte-1e9g3w8"&&(Mo.innerHTML=Ki),Mr=l(re),wo=a(re,"P",{"data-svelte-h":!0}),u(wo)!=="svelte-1ivrf8m"&&(wo.innerHTML=el),wr=l(re),b(at.$$.fragment,re),kr=l(re),oe=a(re,"DIV",{class:!0});var vt=$(oe);b(_n.$$.fragment,vt),$r=l(vt),ko=a(vt,"P",{"data-svelte-h":!0}),u(ko)!=="svelte-1lykj5h"&&(ko.innerHTML=tl),Ir=l(vt),b(rt.$$.fragment,vt),Gr=l(vt),b(it.$$.fragment,vt),vt.forEach(t),re.forEach(t),Qs=l(e),Oe=a(e,"H2",{class:!0});var pa=$(Oe);lt=a(pa,"A",{id:!0,class:!0,href:!0});var Pl=$(lt);Do=a(Pl,"SPAN",{});var xl=$(Do);b(Tn.$$.fragment,xl),xl.forEach(t),Pl.forEach(t),Pr=l(pa),$o=a(pa,"SPAN",{"data-svelte-h":!0}),u($o)!=="svelte-i5zamr"&&($o.textContent=nl),pa.forEach(t),Ys=l(e),J=a(e,"DIV",{class:!0});var ie=$(J);b(bn.$$.fragment,ie),xr=l(ie),Io=a(ie,"P",{"data-svelte-h":!0}),u(Io)!=="svelte-1iaobcj"&&(Io.textContent=ol),Cr=l(ie),Go=a(ie,"P",{"data-svelte-h":!0}),u(Go)!=="svelte-1e9g3w8"&&(Go.innerHTML=sl),Ar=l(ie),Po=a(ie,"P",{"data-svelte-h":!0}),u(Po)!=="svelte-1ivrf8m"&&(Po.innerHTML=al),Or=l(ie),b(dt.$$.fragment,ie),Hr=l(ie),se=a(ie,"DIV",{class:!0});var Mt=$(se);b(yn.$$.fragment,Mt),jr=l(Mt),xo=a(Mt,"P",{"data-svelte-h":!0}),u(xo)!=="svelte-5j0tab"&&(xo.innerHTML=rl),zr=l(Mt),b(ct.$$.fragment,Mt),Fr=l(Mt),b(pt.$$.fragment,Mt),Mt.forEach(t),ie.forEach(t),Ks=l(e),He=a(e,"H2",{class:!0});var ma=$(He);mt=a(ma,"A",{id:!0,class:!0,href:!0});var Cl=$(mt);Xo=a(Cl,"SPAN",{});var Al=$(Xo);b(vn.$$.fragment,Al),Al.forEach(t),Cl.forEach(t),Ur=l(ma),Co=a(ma,"SPAN",{"data-svelte-h":!0}),u(Co)!=="svelte-1f8i58q"&&(Co.textContent=il),ma.forEach(t),ea=l(e),j=a(e,"DIV",{class:!0});var N=$(j);b(Mn.$$.fragment,N),Jr=l(N),Ao=a(N,"P",{"data-svelte-h":!0}),u(Ao)!=="svelte-1t263g7"&&(Ao.textContent=ll),Nr=l(N),Oo=a(N,"P",{"data-svelte-h":!0}),u(Oo)!=="svelte-s93chk"&&(Oo.innerHTML=dl),qr=l(N),Ho=a(N,"P",{"data-svelte-h":!0}),u(Ho)!=="svelte-10ugs3m"&&(Ho.innerHTML=cl),Wr=l(N),jo=a(N,"P",{"data-svelte-h":!0}),u(jo)!=="svelte-1e9g3w8"&&(jo.innerHTML=pl),Lr=l(N),zo=a(N,"P",{"data-svelte-h":!0}),u(zo)!=="svelte-1ivrf8m"&&(zo.innerHTML=ml),Sr=l(N),b(ut.$$.fragment,N),Zr=l(N),D=a(N,"DIV",{class:!0});var Te=$(D);b(wn.$$.fragment,Te),Br=l(Te),Fo=a(Te,"P",{"data-svelte-h":!0}),u(Fo)!=="svelte-1niajpd"&&(Fo.innerHTML=ul),Vr=l(Te),b(ht.$$.fragment,Te),Er=l(Te),b(ft.$$.fragment,Te),Rr=l(Te),b(gt.$$.fragment,Te),Te.forEach(t),N.forEach(t),ta=l(e),Qo=a(e,"P",{}),$(Qo).forEach(t),this.h()},h(){f(n,"name","hf:doc:metadata"),f(n,"content",JSON.stringify(id)),f(r,"id","openai-gpt"),f(r,"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"),f(r,"href","#openai-gpt"),f(k,"class","relative group"),f(P,"class","flex flex-wrap space-x-1"),f(je,"id","overview"),f(je,"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"),f(je,"href","#overview"),f(I,"class","relative group"),f(ze,"id","resources"),f(ze,"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"),f(ze,"href","#resources"),f(be,"class","relative group"),f(Fe,"id","transformers.OpenAIGPTConfig"),f(Fe,"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"),f(Fe,"href","#transformers.OpenAIGPTConfig"),f(ye,"class","relative group"),f(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Je,"id","transformers.OpenAIGPTTokenizer"),f(Je,"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"),f(Je,"href","#transformers.OpenAIGPTTokenizer"),f(ve,"class","relative group"),f(qn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ne,"id","transformers.OpenAIGPTTokenizerFast"),f(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"),f(Ne,"href","#transformers.OpenAIGPTTokenizerFast"),f(Me,"class","relative group"),f(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(qe,"id","transformers.models.openai.modeling_openai.OpenAIGPTDoubleHeadsModelOutput"),f(qe,"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"),f(qe,"href","#transformers.models.openai.modeling_openai.OpenAIGPTDoubleHeadsModelOutput"),f(we,"class","relative group"),f(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(We,"id","transformers.OpenAIGPTModel"),f(We,"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"),f(We,"href","#transformers.OpenAIGPTModel"),f(Ie,"class","relative group"),f(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ze,"id","transformers.OpenAIGPTLMHeadModel"),f(Ze,"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"),f(Ze,"href","#transformers.OpenAIGPTLMHeadModel"),f(Ge,"class","relative group"),f(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ee,"id","transformers.OpenAIGPTDoubleHeadsModel"),f(Ee,"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"),f(Ee,"href","#transformers.OpenAIGPTDoubleHeadsModel"),f(Pe,"class","relative group"),f(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Xe,"id","transformers.OpenAIGPTForSequenceClassification"),f(Xe,"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"),f(Xe,"href","#transformers.OpenAIGPTForSequenceClassification"),f(xe,"class","relative group"),f(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(et,"id","transformers.TFOpenAIGPTModel"),f(et,"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"),f(et,"href","#transformers.TFOpenAIGPTModel"),f(Ce,"class","relative group"),f(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(st,"id","transformers.TFOpenAIGPTLMHeadModel"),f(st,"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"),f(st,"href","#transformers.TFOpenAIGPTLMHeadModel"),f(Ae,"class","relative group"),f(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(lt,"id","transformers.TFOpenAIGPTDoubleHeadsModel"),f(lt,"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"),f(lt,"href","#transformers.TFOpenAIGPTDoubleHeadsModel"),f(Oe,"class","relative group"),f(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(mt,"id","transformers.TFOpenAIGPTForSequenceClassification"),f(mt,"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"),f(mt,"href","#transformers.TFOpenAIGPTForSequenceClassification"),f(He,"class","relative group"),f(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,c){o(document.head,n),d(e,_,c),d(e,m,c),d(e,p,c),d(e,k,c),o(k,r),o(r,g),y(z,g,null),o(k,A),o(k,x),d(e,C,c),d(e,P,c),d(e,h,c),d(e,I,c),o(I,je),o(je,Uo),y(wt,Uo,null),o(I,ua),o(I,An),d(e,ps,c),d(e,kt,c),d(e,ms,c),d(e,$t,c),d(e,us,c),d(e,It,c),d(e,hs,c),d(e,Gt,c),d(e,fs,c),d(e,Pt,c),d(e,gs,c),d(e,xt,c),d(e,_s,c),d(e,Ct,c),d(e,Ts,c),d(e,At,c),d(e,bs,c),d(e,Ot,c),d(e,ys,c),y(Ht,e,c),d(e,vs,c),d(e,jt,c),d(e,Ms,c),d(e,be,c),o(be,ze),o(ze,Jo),y(zt,Jo,null),o(be,ha),o(be,On),d(e,ws,c),d(e,Ft,c),d(e,ks,c),y(Ut,e,c),d(e,$s,c),d(e,Jt,c),d(e,Is,c),y(Nt,e,c),d(e,Gs,c),d(e,qt,c),d(e,Ps,c),y(Wt,e,c),d(e,xs,c),d(e,Lt,c),d(e,Cs,c),d(e,ye,c),o(ye,Fe),o(Fe,No),y(St,No,null),o(ye,fa),o(ye,Hn),d(e,As,c),d(e,X,c),y(Zt,X,null),o(X,ga),o(X,jn),o(X,_a),o(X,zn),o(X,Ta),y(Ue,X,null),d(e,Os,c),d(e,ve,c),o(ve,Je),o(Je,qo),y(Bt,qo,null),o(ve,ba),o(ve,Fn),d(e,Hs,c),d(e,q,c),y(Vt,q,null),o(q,ya),o(q,Un),o(q,va),o(q,Jn),o(q,Ma),o(q,Nn),o(q,wa),o(q,qn),y(Et,qn,null),d(e,js,c),d(e,Me,c),o(Me,Ne),o(Ne,Wo),y(Rt,Wo,null),o(Me,ka),o(Me,Wn),d(e,zs,c),d(e,Q,c),y(Dt,Q,null),o(Q,$a),o(Q,Ln),o(Q,Ia),o(Q,Sn),o(Q,Ga),o(Q,Zn),d(e,Fs,c),d(e,we,c),o(we,qe),o(qe,Lo),y(Xt,Lo,null),o(we,Pa),o(we,Bn),d(e,Us,c),d(e,ke,c),y(Qt,ke,null),o(ke,xa),o(ke,Vn),d(e,Js,c),d(e,$e,c),y(Yt,$e,null),o($e,Ca),o($e,En),d(e,Ns,c),d(e,Ie,c),o(Ie,We),o(We,So),y(Kt,So,null),o(Ie,Aa),o(Ie,Rn),d(e,qs,c),d(e,W,c),y(en,W,null),o(W,Oa),o(W,Dn),o(W,Ha),o(W,Xn),o(W,ja),o(W,Qn),o(W,za),o(W,K),y(tn,K,null),o(K,Fa),o(K,Yn),o(K,Ua),y(Le,K,null),o(K,Ja),y(Se,K,null),d(e,Ws,c),d(e,Ge,c),o(Ge,Ze),o(Ze,Zo),y(nn,Zo,null),o(Ge,Na),o(Ge,Kn),d(e,Ls,c),d(e,L,c),y(on,L,null),o(L,qa),o(L,eo),o(L,Wa),o(L,to),o(L,La),o(L,no),o(L,Sa),o(L,ee),y(sn,ee,null),o(ee,Za),o(ee,oo),o(ee,Ba),y(Be,ee,null),o(ee,Va),y(Ve,ee,null),d(e,Ss,c),d(e,Pe,c),o(Pe,Ee),o(Ee,Bo),y(an,Bo,null),o(Pe,Ea),o(Pe,so),d(e,Zs,c),d(e,S,c),y(rn,S,null),o(S,Ra),o(S,ao),o(S,Da),o(S,ro),o(S,Xa),o(S,io),o(S,Qa),o(S,te),y(ln,te,null),o(te,Ya),o(te,lo),o(te,Ka),y(Re,te,null),o(te,er),y(De,te,null),d(e,Bs,c),d(e,xe,c),o(xe,Xe),o(Xe,Vo),y(dn,Vo,null),o(xe,tr),o(xe,co),d(e,Vs,c),d(e,Z,c),y(cn,Z,null),o(Z,nr),o(Z,po),o(Z,or),o(Z,mo),o(Z,sr),o(Z,uo),o(Z,ar),o(Z,R),y(pn,R,null),o(R,rr),o(R,ho),o(R,ir),y(Qe,R,null),o(R,lr),y(Ye,R,null),o(R,dr),y(Ke,R,null),d(e,Es,c),d(e,Ce,c),o(Ce,et),o(et,Eo),y(mn,Eo,null),o(Ce,cr),o(Ce,fo),d(e,Rs,c),d(e,F,c),y(un,F,null),o(F,pr),o(F,go),o(F,mr),o(F,_o),o(F,ur),o(F,To),o(F,hr),y(tt,F,null),o(F,fr),o(F,ne),y(hn,ne,null),o(ne,gr),o(ne,bo),o(ne,_r),y(nt,ne,null),o(ne,Tr),y(ot,ne,null),d(e,Ds,c),d(e,Ae,c),o(Ae,st),o(st,Ro),y(fn,Ro,null),o(Ae,br),o(Ae,yo),d(e,Xs,c),d(e,U,c),y(gn,U,null),o(U,yr),o(U,vo),o(U,vr),o(U,Mo),o(U,Mr),o(U,wo),o(U,wr),y(at,U,null),o(U,kr),o(U,oe),y(_n,oe,null),o(oe,$r),o(oe,ko),o(oe,Ir),y(rt,oe,null),o(oe,Gr),y(it,oe,null),d(e,Qs,c),d(e,Oe,c),o(Oe,lt),o(lt,Do),y(Tn,Do,null),o(Oe,Pr),o(Oe,$o),d(e,Ys,c),d(e,J,c),y(bn,J,null),o(J,xr),o(J,Io),o(J,Cr),o(J,Go),o(J,Ar),o(J,Po),o(J,Or),y(dt,J,null),o(J,Hr),o(J,se),y(yn,se,null),o(se,jr),o(se,xo),o(se,zr),y(ct,se,null),o(se,Fr),y(pt,se,null),d(e,Ks,c),d(e,He,c),o(He,mt),o(mt,Xo),y(vn,Xo,null),o(He,Ur),o(He,Co),d(e,ea,c),d(e,j,c),y(Mn,j,null),o(j,Jr),o(j,Ao),o(j,Nr),o(j,Oo),o(j,qr),o(j,Ho),o(j,Wr),o(j,jo),o(j,Lr),o(j,zo),o(j,Sr),y(ut,j,null),o(j,Zr),o(j,D),y(wn,D,null),o(D,Br),o(D,Fo),o(D,Vr),y(ht,D,null),o(D,Er),y(ft,D,null),o(D,Rr),y(gt,D,null),d(e,ta,c),d(e,Qo,c),na=!0},p(e,[c]){const kn={};c&2&&(kn.$$scope={dirty:c,ctx:e}),Ue.$set(kn);const Yo={};c&2&&(Yo.$$scope={dirty:c,ctx:e}),Le.$set(Yo);const Ko={};c&2&&(Ko.$$scope={dirty:c,ctx:e}),Se.$set(Ko);const $n={};c&2&&($n.$$scope={dirty:c,ctx:e}),Be.$set($n);const es={};c&2&&(es.$$scope={dirty:c,ctx:e}),Ve.$set(es);const ts={};c&2&&(ts.$$scope={dirty:c,ctx:e}),Re.$set(ts);const In={};c&2&&(In.$$scope={dirty:c,ctx:e}),De.$set(In);const ns={};c&2&&(ns.$$scope={dirty:c,ctx:e}),Qe.$set(ns);const os={};c&2&&(os.$$scope={dirty:c,ctx:e}),Ye.$set(os);const Gn={};c&2&&(Gn.$$scope={dirty:c,ctx:e}),Ke.$set(Gn);const ss={};c&2&&(ss.$$scope={dirty:c,ctx:e}),tt.$set(ss);const as={};c&2&&(as.$$scope={dirty:c,ctx:e}),nt.$set(as);const ce={};c&2&&(ce.$$scope={dirty:c,ctx:e}),ot.$set(ce);const Pn={};c&2&&(Pn.$$scope={dirty:c,ctx:e}),at.$set(Pn);const rs={};c&2&&(rs.$$scope={dirty:c,ctx:e}),rt.$set(rs);const is={};c&2&&(is.$$scope={dirty:c,ctx:e}),it.$set(is);const Y={};c&2&&(Y.$$scope={dirty:c,ctx:e}),dt.$set(Y);const ls={};c&2&&(ls.$$scope={dirty:c,ctx:e}),ct.$set(ls);const xn={};c&2&&(xn.$$scope={dirty:c,ctx:e}),pt.$set(xn);const ds={};c&2&&(ds.$$scope={dirty:c,ctx:e}),ut.$set(ds);const cs={};c&2&&(cs.$$scope={dirty:c,ctx:e}),ht.$set(cs);const pe={};c&2&&(pe.$$scope={dirty:c,ctx:e}),ft.$set(pe);const Cn={};c&2&&(Cn.$$scope={dirty:c,ctx:e}),gt.$set(Cn)},i(e){na||(v(z.$$.fragment,e),v(wt.$$.fragment,e),v(Ht.$$.fragment,e),v(zt.$$.fragment,e),v(Ut.$$.fragment,e),v(Nt.$$.fragment,e),v(Wt.$$.fragment,e),v(St.$$.fragment,e),v(Zt.$$.fragment,e),v(Ue.$$.fragment,e),v(Bt.$$.fragment,e),v(Vt.$$.fragment,e),v(Et.$$.fragment,e),v(Rt.$$.fragment,e),v(Dt.$$.fragment,e),v(Xt.$$.fragment,e),v(Qt.$$.fragment,e),v(Yt.$$.fragment,e),v(Kt.$$.fragment,e),v(en.$$.fragment,e),v(tn.$$.fragment,e),v(Le.$$.fragment,e),v(Se.$$.fragment,e),v(nn.$$.fragment,e),v(on.$$.fragment,e),v(sn.$$.fragment,e),v(Be.$$.fragment,e),v(Ve.$$.fragment,e),v(an.$$.fragment,e),v(rn.$$.fragment,e),v(ln.$$.fragment,e),v(Re.$$.fragment,e),v(De.$$.fragment,e),v(dn.$$.fragment,e),v(cn.$$.fragment,e),v(pn.$$.fragment,e),v(Qe.$$.fragment,e),v(Ye.$$.fragment,e),v(Ke.$$.fragment,e),v(mn.$$.fragment,e),v(un.$$.fragment,e),v(tt.$$.fragment,e),v(hn.$$.fragment,e),v(nt.$$.fragment,e),v(ot.$$.fragment,e),v(fn.$$.fragment,e),v(gn.$$.fragment,e),v(at.$$.fragment,e),v(_n.$$.fragment,e),v(rt.$$.fragment,e),v(it.$$.fragment,e),v(Tn.$$.fragment,e),v(bn.$$.fragment,e),v(dt.$$.fragment,e),v(yn.$$.fragment,e),v(ct.$$.fragment,e),v(pt.$$.fragment,e),v(vn.$$.fragment,e),v(Mn.$$.fragment,e),v(ut.$$.fragment,e),v(wn.$$.fragment,e),v(ht.$$.fragment,e),v(ft.$$.fragment,e),v(gt.$$.fragment,e),na=!0)},o(e){M(z.$$.fragment,e),M(wt.$$.fragment,e),M(Ht.$$.fragment,e),M(zt.$$.fragment,e),M(Ut.$$.fragment,e),M(Nt.$$.fragment,e),M(Wt.$$.fragment,e),M(St.$$.fragment,e),M(Zt.$$.fragment,e),M(Ue.$$.fragment,e),M(Bt.$$.fragment,e),M(Vt.$$.fragment,e),M(Et.$$.fragment,e),M(Rt.$$.fragment,e),M(Dt.$$.fragment,e),M(Xt.$$.fragment,e),M(Qt.$$.fragment,e),M(Yt.$$.fragment,e),M(Kt.$$.fragment,e),M(en.$$.fragment,e),M(tn.$$.fragment,e),M(Le.$$.fragment,e),M(Se.$$.fragment,e),M(nn.$$.fragment,e),M(on.$$.fragment,e),M(sn.$$.fragment,e),M(Be.$$.fragment,e),M(Ve.$$.fragment,e),M(an.$$.fragment,e),M(rn.$$.fragment,e),M(ln.$$.fragment,e),M(Re.$$.fragment,e),M(De.$$.fragment,e),M(dn.$$.fragment,e),M(cn.$$.fragment,e),M(pn.$$.fragment,e),M(Qe.$$.fragment,e),M(Ye.$$.fragment,e),M(Ke.$$.fragment,e),M(mn.$$.fragment,e),M(un.$$.fragment,e),M(tt.$$.fragment,e),M(hn.$$.fragment,e),M(nt.$$.fragment,e),M(ot.$$.fragment,e),M(fn.$$.fragment,e),M(gn.$$.fragment,e),M(at.$$.fragment,e),M(_n.$$.fragment,e),M(rt.$$.fragment,e),M(it.$$.fragment,e),M(Tn.$$.fragment,e),M(bn.$$.fragment,e),M(dt.$$.fragment,e),M(yn.$$.fragment,e),M(ct.$$.fragment,e),M(pt.$$.fragment,e),M(vn.$$.fragment,e),M(Mn.$$.fragment,e),M(ut.$$.fragment,e),M(wn.$$.fragment,e),M(ht.$$.fragment,e),M(ft.$$.fragment,e),M(gt.$$.fragment,e),na=!1},d(e){e&&(t(_),t(m),t(p),t(k),t(C),t(P),t(h),t(I),t(ps),t(kt),t(ms),t($t),t(us),t(It),t(hs),t(Gt),t(fs),t(Pt),t(gs),t(xt),t(_s),t(Ct),t(Ts),t(At),t(bs),t(Ot),t(ys),t(vs),t(jt),t(Ms),t(be),t(ws),t(Ft),t(ks),t($s),t(Jt),t(Is),t(Gs),t(qt),t(Ps),t(xs),t(Lt),t(Cs),t(ye),t(As),t(X),t(Os),t(ve),t(Hs),t(q),t(js),t(Me),t(zs),t(Q),t(Fs),t(we),t(Us),t(ke),t(Js),t($e),t(Ns),t(Ie),t(qs),t(W),t(Ws),t(Ge),t(Ls),t(L),t(Ss),t(Pe),t(Zs),t(S),t(Bs),t(xe),t(Vs),t(Z),t(Es),t(Ce),t(Rs),t(F),t(Ds),t(Ae),t(Xs),t(U),t(Qs),t(Oe),t(Ys),t(J),t(Ks),t(He),t(ea),t(j),t(ta),t(Qo)),t(n),w(z),w(wt),w(Ht,e),w(zt),w(Ut,e),w(Nt,e),w(Wt,e),w(St),w(Zt),w(Ue),w(Bt),w(Vt),w(Et),w(Rt),w(Dt),w(Xt),w(Qt),w(Yt),w(Kt),w(en),w(tn),w(Le),w(Se),w(nn),w(on),w(sn),w(Be),w(Ve),w(an),w(rn),w(ln),w(Re),w(De),w(dn),w(cn),w(pn),w(Qe),w(Ye),w(Ke),w(mn),w(un),w(tt),w(hn),w(nt),w(ot),w(fn),w(gn),w(at),w(_n),w(rt),w(it),w(Tn),w(bn),w(dt),w(yn),w(ct),w(pt),w(vn),w(Mn),w(ut),w(wn),w(ht),w(ft),w(gt)}}}const id={local:"openai-gpt",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.OpenAIGPTConfig",title:"OpenAIGPTConfig"},{local:"transformers.OpenAIGPTTokenizer",title:"OpenAIGPTTokenizer"},{local:"transformers.OpenAIGPTTokenizerFast",title:"OpenAIGPTTokenizerFast"},{local:"transformers.models.openai.modeling_openai.OpenAIGPTDoubleHeadsModelOutput",title:"OpenAI specific outputs"},{local:"transformers.OpenAIGPTModel",title:"OpenAIGPTModel"},{local:"transformers.OpenAIGPTLMHeadModel",title:"OpenAIGPTLMHeadModel"},{local:"transformers.OpenAIGPTDoubleHeadsModel",title:"OpenAIGPTDoubleHeadsModel"},{local:"transformers.OpenAIGPTForSequenceClassification",title:"OpenAIGPTForSequenceClassification"},{local:"transformers.TFOpenAIGPTModel",title:"TFOpenAIGPTModel"},{local:"transformers.TFOpenAIGPTLMHeadModel",title:"TFOpenAIGPTLMHeadModel"},{local:"transformers.TFOpenAIGPTDoubleHeadsModel",title:"TFOpenAIGPTDoubleHeadsModel"},{local:"transformers.TFOpenAIGPTForSequenceClassification",title:"TFOpenAIGPTForSequenceClassification"}],title:"OpenAI GPT"};function ld(G){return Hl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _d extends jl{constructor(n){super(),zl(this,n,ld,rd,Ol,{})}}export{_d as component};
