import{S as bu,i as yu,s as vu,e as a,k as p,w as v,t as n,M as wu,c as r,d as t,m as u,a as l,x as w,h as s,b as d,G as e,g as f,y as M,q as k,o as $,B as P,v as Mu,L as Tt}from"../../chunks/vendor-hf-doc-builder.js";import{T as Fs}from"../../chunks/Tip-hf-doc-builder.js";import{D}from"../../chunks/Docstring-hf-doc-builder.js";import{C as bt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ne}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as _t}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Mc}from"../../chunks/PipelineTag-hf-doc-builder.js";function ku(O){let c,b,_,m,T;return m=new bt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME9QVENvbmZpZyUyQyUyME9QVE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyME9QVCUyMGZhY2Vib29rJTJGb3B0LWxhcmdlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyME9QVENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBmYWNlYm9vayUyRm9wdC1sYXJnZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwT1BUTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> OPTConfig, OPTModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a OPT facebook/opt-large style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = OPTConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/opt-large style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OPTModel(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(){c=a("p"),b=n("Example:"),_=p(),v(m.$$.fragment)},l(i){c=r(i,"P",{});var h=l(c);b=s(h,"Example:"),h.forEach(t),_=u(i),w(m.$$.fragment,i)},m(i,h){f(i,c,h),e(c,b),f(i,_,h),M(m,i,h),T=!0},p:Tt,i(i){T||(k(m.$$.fragment,i),T=!0)},o(i){$(m.$$.fragment,i),T=!1},d(i){i&&t(c),i&&t(_),P(m,i)}}}function $u(O){let c,b,_,m,T;return{c(){c=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),m=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){c=r(i,"P",{});var h=l(c);b=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(h,"CODE",{});var C=l(_);m=s(C,"Module"),C.forEach(t),T=s(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){f(i,c,h),e(c,b),e(c,_),e(_,m),e(c,T)},d(i){i&&t(c)}}}function Pu(O){let c,b,_,m,T;return m=new bt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBPUFRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZvcHQtMzUwbSUyMiklMEFtb2RlbCUyMCUzRCUyME9QVE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm9wdC0zNTBtJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, OPTModel
<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;facebook/opt-350m&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OPTModel.from_pretrained(<span class="hljs-string">&quot;facebook/opt-350m&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(){c=a("p"),b=n("Example:"),_=p(),v(m.$$.fragment)},l(i){c=r(i,"P",{});var h=l(c);b=s(h,"Example:"),h.forEach(t),_=u(i),w(m.$$.fragment,i)},m(i,h){f(i,c,h),e(c,b),f(i,_,h),M(m,i,h),T=!0},p:Tt,i(i){T||(k(m.$$.fragment,i),T=!0)},o(i){$(m.$$.fragment,i),T=!1},d(i){i&&t(c),i&&t(_),P(m,i)}}}function Fu(O){let c,b,_,m,T;return m=new bt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBPUFRGb3JDYXVzYWxMTSUwQSUwQW1vZGVsJTIwJTNEJTIwT1BURm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGb3B0LTM1MG0lMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZvcHQtMzUwbSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJIZXklMkMlMjBhcmUlMjB5b3UlMjBjb25zY2lvdXJzJTNGJTIwQ2FuJTIweW91JTIwdGFsayUyMHRvJTIwbWUlM0YlMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocHJvbXB0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEElMjMlMjBHZW5lcmF0ZSUwQWdlbmVyYXRlX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cy5pbnB1dF9pZHMlMkMlMjBtYXhfbGVuZ3RoJTNEMzApJTBBdG9rZW5pemVyLmJhdGNoX2RlY29kZShnZW5lcmF0ZV9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSUyQyUyMGNsZWFuX3VwX3Rva2VuaXphdGlvbl9zcGFjZXMlM0RGYWxzZSklNUIwJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, OPTForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = OPTForCausalLM.from_pretrained(<span class="hljs-string">&quot;facebook/opt-350m&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/opt-350m&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;Hey, are you consciours? Can you talk to me?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generate_ids = model.generate(inputs.input_ids, max_length=<span class="hljs-number">30</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;Hey, are you consciours? Can you talk to me?\\nI&#x27;m not consciours, but I can talk to you.&quot;</span>`}}),{c(){c=a("p"),b=n("Example:"),_=p(),v(m.$$.fragment)},l(i){c=r(i,"P",{});var h=l(c);b=s(h,"Example:"),h.forEach(t),_=u(i),w(m.$$.fragment,i)},m(i,h){f(i,c,h),e(c,b),f(i,_,h),M(m,i,h),T=!0},p:Tt,i(i){T||(k(m.$$.fragment,i),T=!0)},o(i){$(m.$$.fragment,i),T=!1},d(i){i&&t(c),i&&t(_),P(m,i)}}}function Ou(O){let c,b,_,m,T,i,h,C,Ge,je,I,K,te,F,Be,R,Ve,Ce,A,Se,oe,ne,Le,ze,S,Re,Je,L,ye,Qe,me,z,Z,xe,N,se,Xe,Q,He,Ye,W,ae,re,ve,De,le,Ue,x,X,ie,de,Ke,H,q,et,J,tt,ot;return{c(){c=a("p"),b=n("TensorFlow models and layers in "),_=a("code"),m=n("transformers"),T=n(" accept two formats as input:"),i=p(),h=a("ul"),C=a("li"),Ge=n("having all inputs as keyword arguments (like PyTorch models), or"),je=p(),I=a("li"),K=n("having all inputs as a list, tuple or dict in the first positional argument."),te=p(),F=a("p"),Be=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=a("code"),Ve=n("model.fit()"),Ce=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),A=a("code"),Se=n("model.fit()"),oe=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),ne=a("code"),Le=n("fit()"),ze=n(" and "),S=a("code"),Re=n("predict()"),Je=n(`, such as when creating your own layers or models with
the Keras `),L=a("code"),ye=n("Functional"),Qe=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),me=p(),z=a("ul"),Z=a("li"),xe=n("a single Tensor with "),N=a("code"),se=n("input_ids"),Xe=n(" only and nothing else: "),Q=a("code"),He=n("model(input_ids)"),Ye=p(),W=a("li"),ae=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),re=a("code"),ve=n("model([input_ids, attention_mask])"),De=n(" or "),le=a("code"),Ue=n("model([input_ids, attention_mask, token_type_ids])"),x=p(),X=a("li"),ie=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),de=a("code"),Ke=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),H=p(),q=a("p"),et=n(`Note that when creating models and layers with
`),J=a("a"),tt=n("subclassing"),ot=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(y){c=r(y,"P",{});var E=l(c);b=s(E,"TensorFlow models and layers in "),_=r(E,"CODE",{});var yt=l(_);m=s(yt,"transformers"),yt.forEach(t),T=s(E," accept two formats as input:"),E.forEach(t),i=u(y),h=r(y,"UL",{});var fe=l(h);C=r(fe,"LI",{});var ce=l(C);Ge=s(ce,"having all inputs as keyword arguments (like PyTorch models), or"),ce.forEach(t),je=u(fe),I=r(fe,"LI",{});var ge=l(I);K=s(ge,"having all inputs as a list, tuple or dict in the first positional argument."),ge.forEach(t),fe.forEach(t),te=u(y),F=r(y,"P",{});var j=l(F);Be=s(j,`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 `),R=r(j,"CODE",{});var we=l(R);Ve=s(we,"model.fit()"),we.forEach(t),Ce=s(j,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),A=r(j,"CODE",{});var vt=l(A);Se=s(vt,"model.fit()"),vt.forEach(t),oe=s(j,` supports! If, however, you want to use the second
format outside of Keras methods like `),ne=r(j,"CODE",{});var nt=l(ne);Le=s(nt,"fit()"),nt.forEach(t),ze=s(j," and "),S=r(j,"CODE",{});var wt=l(S);Re=s(wt,"predict()"),wt.forEach(t),Je=s(j,`, such as when creating your own layers or models with
the Keras `),L=r(j,"CODE",{});var rt=l(L);ye=s(rt,"Functional"),rt.forEach(t),Qe=s(j,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),j.forEach(t),me=u(y),z=r(y,"UL",{});var G=l(z);Z=r(G,"LI",{});var pe=l(Z);xe=s(pe,"a single Tensor with "),N=r(pe,"CODE",{});var lt=l(N);se=s(lt,"input_ids"),lt.forEach(t),Xe=s(pe," only and nothing else: "),Q=r(pe,"CODE",{});var Me=l(Q);He=s(Me,"model(input_ids)"),Me.forEach(t),pe.forEach(t),Ye=u(G),W=r(G,"LI",{});var ee=l(W);ae=s(ee,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),re=r(ee,"CODE",{});var U=l(re);ve=s(U,"model([input_ids, attention_mask])"),U.forEach(t),De=s(ee," or "),le=r(ee,"CODE",{});var ke=l(le);Ue=s(ke,"model([input_ids, attention_mask, token_type_ids])"),ke.forEach(t),ee.forEach(t),x=u(G),X=r(G,"LI",{});var st=l(X);ie=s(st,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),de=r(st,"CODE",{});var $e=l(de);Ke=s($e,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),$e.forEach(t),st.forEach(t),G.forEach(t),H=u(y),q=r(y,"P",{});var Pe=l(q);et=s(Pe,`Note that when creating models and layers with
`),J=r(Pe,"A",{href:!0,rel:!0});var Mt=l(J);tt=s(Mt,"subclassing"),Mt.forEach(t),ot=s(Pe,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),Pe.forEach(t),this.h()},h(){d(J,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),d(J,"rel","nofollow")},m(y,E){f(y,c,E),e(c,b),e(c,_),e(_,m),e(c,T),f(y,i,E),f(y,h,E),e(h,C),e(C,Ge),e(h,je),e(h,I),e(I,K),f(y,te,E),f(y,F,E),e(F,Be),e(F,R),e(R,Ve),e(F,Ce),e(F,A),e(A,Se),e(F,oe),e(F,ne),e(ne,Le),e(F,ze),e(F,S),e(S,Re),e(F,Je),e(F,L),e(L,ye),e(F,Qe),f(y,me,E),f(y,z,E),e(z,Z),e(Z,xe),e(Z,N),e(N,se),e(Z,Xe),e(Z,Q),e(Q,He),e(z,Ye),e(z,W),e(W,ae),e(W,re),e(re,ve),e(W,De),e(W,le),e(le,Ue),e(z,x),e(z,X),e(X,ie),e(X,de),e(de,Ke),f(y,H,E),f(y,q,E),e(q,et),e(q,J),e(J,tt),e(q,ot)},d(y){y&&t(c),y&&t(i),y&&t(h),y&&t(te),y&&t(F),y&&t(me),y&&t(z),y&&t(H),y&&t(q)}}}function Eu(O){let c,b,_,m,T;return{c(){c=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),m=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){c=r(i,"P",{});var h=l(c);b=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(h,"CODE",{});var C=l(_);m=s(C,"Module"),C.forEach(t),T=s(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){f(i,c,h),e(c,b),e(c,_),e(_,m),e(c,T)},d(i){i&&t(c)}}}function ju(O){let c,b,_,m,T;return m=new bt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURk9QVE1vZGVsJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm9wdC0zNTBtJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZPUFRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZvcHQtMzUwbSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFOPTModel
<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;facebook/opt-350m&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFOPTModel.from_pretrained(<span class="hljs-string">&quot;facebook/opt-350m&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(){c=a("p"),b=n("Example:"),_=p(),v(m.$$.fragment)},l(i){c=r(i,"P",{});var h=l(c);b=s(h,"Example:"),h.forEach(t),_=u(i),w(m.$$.fragment,i)},m(i,h){f(i,c,h),e(c,b),f(i,_,h),M(m,i,h),T=!0},p:Tt,i(i){T||(k(m.$$.fragment,i),T=!0)},o(i){$(m.$$.fragment,i),T=!1},d(i){i&&t(c),i&&t(_),P(m,i)}}}function Cu(O){let c,b,_,m,T,i,h,C,Ge,je,I,K,te,F,Be,R,Ve,Ce,A,Se,oe,ne,Le,ze,S,Re,Je,L,ye,Qe,me,z,Z,xe,N,se,Xe,Q,He,Ye,W,ae,re,ve,De,le,Ue,x,X,ie,de,Ke,H,q,et,J,tt,ot;return{c(){c=a("p"),b=n("TensorFlow models and layers in "),_=a("code"),m=n("transformers"),T=n(" accept two formats as input:"),i=p(),h=a("ul"),C=a("li"),Ge=n("having all inputs as keyword arguments (like PyTorch models), or"),je=p(),I=a("li"),K=n("having all inputs as a list, tuple or dict in the first positional argument."),te=p(),F=a("p"),Be=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=a("code"),Ve=n("model.fit()"),Ce=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),A=a("code"),Se=n("model.fit()"),oe=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),ne=a("code"),Le=n("fit()"),ze=n(" and "),S=a("code"),Re=n("predict()"),Je=n(`, such as when creating your own layers or models with
the Keras `),L=a("code"),ye=n("Functional"),Qe=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),me=p(),z=a("ul"),Z=a("li"),xe=n("a single Tensor with "),N=a("code"),se=n("input_ids"),Xe=n(" only and nothing else: "),Q=a("code"),He=n("model(input_ids)"),Ye=p(),W=a("li"),ae=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),re=a("code"),ve=n("model([input_ids, attention_mask])"),De=n(" or "),le=a("code"),Ue=n("model([input_ids, attention_mask, token_type_ids])"),x=p(),X=a("li"),ie=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),de=a("code"),Ke=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),H=p(),q=a("p"),et=n(`Note that when creating models and layers with
`),J=a("a"),tt=n("subclassing"),ot=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(y){c=r(y,"P",{});var E=l(c);b=s(E,"TensorFlow models and layers in "),_=r(E,"CODE",{});var yt=l(_);m=s(yt,"transformers"),yt.forEach(t),T=s(E," accept two formats as input:"),E.forEach(t),i=u(y),h=r(y,"UL",{});var fe=l(h);C=r(fe,"LI",{});var ce=l(C);Ge=s(ce,"having all inputs as keyword arguments (like PyTorch models), or"),ce.forEach(t),je=u(fe),I=r(fe,"LI",{});var ge=l(I);K=s(ge,"having all inputs as a list, tuple or dict in the first positional argument."),ge.forEach(t),fe.forEach(t),te=u(y),F=r(y,"P",{});var j=l(F);Be=s(j,`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 `),R=r(j,"CODE",{});var we=l(R);Ve=s(we,"model.fit()"),we.forEach(t),Ce=s(j,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),A=r(j,"CODE",{});var vt=l(A);Se=s(vt,"model.fit()"),vt.forEach(t),oe=s(j,` supports! If, however, you want to use the second
format outside of Keras methods like `),ne=r(j,"CODE",{});var nt=l(ne);Le=s(nt,"fit()"),nt.forEach(t),ze=s(j," and "),S=r(j,"CODE",{});var wt=l(S);Re=s(wt,"predict()"),wt.forEach(t),Je=s(j,`, such as when creating your own layers or models with
the Keras `),L=r(j,"CODE",{});var rt=l(L);ye=s(rt,"Functional"),rt.forEach(t),Qe=s(j,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),j.forEach(t),me=u(y),z=r(y,"UL",{});var G=l(z);Z=r(G,"LI",{});var pe=l(Z);xe=s(pe,"a single Tensor with "),N=r(pe,"CODE",{});var lt=l(N);se=s(lt,"input_ids"),lt.forEach(t),Xe=s(pe," only and nothing else: "),Q=r(pe,"CODE",{});var Me=l(Q);He=s(Me,"model(input_ids)"),Me.forEach(t),pe.forEach(t),Ye=u(G),W=r(G,"LI",{});var ee=l(W);ae=s(ee,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),re=r(ee,"CODE",{});var U=l(re);ve=s(U,"model([input_ids, attention_mask])"),U.forEach(t),De=s(ee," or "),le=r(ee,"CODE",{});var ke=l(le);Ue=s(ke,"model([input_ids, attention_mask, token_type_ids])"),ke.forEach(t),ee.forEach(t),x=u(G),X=r(G,"LI",{});var st=l(X);ie=s(st,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),de=r(st,"CODE",{});var $e=l(de);Ke=s($e,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),$e.forEach(t),st.forEach(t),G.forEach(t),H=u(y),q=r(y,"P",{});var Pe=l(q);et=s(Pe,`Note that when creating models and layers with
`),J=r(Pe,"A",{href:!0,rel:!0});var Mt=l(J);tt=s(Mt,"subclassing"),Mt.forEach(t),ot=s(Pe,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),Pe.forEach(t),this.h()},h(){d(J,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),d(J,"rel","nofollow")},m(y,E){f(y,c,E),e(c,b),e(c,_),e(_,m),e(c,T),f(y,i,E),f(y,h,E),e(h,C),e(C,Ge),e(h,je),e(h,I),e(I,K),f(y,te,E),f(y,F,E),e(F,Be),e(F,R),e(R,Ve),e(F,Ce),e(F,A),e(A,Se),e(F,oe),e(F,ne),e(ne,Le),e(F,ze),e(F,S),e(S,Re),e(F,Je),e(F,L),e(L,ye),e(F,Qe),f(y,me,E),f(y,z,E),e(z,Z),e(Z,xe),e(Z,N),e(N,se),e(Z,Xe),e(Z,Q),e(Q,He),e(z,Ye),e(z,W),e(W,ae),e(W,re),e(re,ve),e(W,De),e(W,le),e(le,Ue),e(z,x),e(z,X),e(X,ie),e(X,de),e(de,Ke),f(y,H,E),f(y,q,E),e(q,et),e(q,J),e(J,tt),e(q,ot)},d(y){y&&t(c),y&&t(i),y&&t(h),y&&t(te),y&&t(F),y&&t(me),y&&t(z),y&&t(H),y&&t(q)}}}function zu(O){let c,b,_,m,T;return m=new bt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURk9QVEZvckNhdXNhbExNJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm9wdC0zNTBtJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZPUFRGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZvcHQtMzUwbSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFOPTForCausalLM
<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;facebook/opt-350m&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFOPTForCausalLM.from_pretrained(<span class="hljs-string">&quot;facebook/opt-350m&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(){c=a("p"),b=n("Example:"),_=p(),v(m.$$.fragment)},l(i){c=r(i,"P",{});var h=l(c);b=s(h,"Example:"),h.forEach(t),_=u(i),w(m.$$.fragment,i)},m(i,h){f(i,c,h),e(c,b),f(i,_,h),M(m,i,h),T=!0},p:Tt,i(i){T||(k(m.$$.fragment,i),T=!0)},o(i){$(m.$$.fragment,i),T=!1},d(i){i&&t(c),i&&t(_),P(m,i)}}}function Ju(O){let c,b,_,m,T;return{c(){c=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),m=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){c=r(i,"P",{});var h=l(c);b=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(h,"CODE",{});var C=l(_);m=s(C,"Module"),C.forEach(t),T=s(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){f(i,c,h),e(c,b),e(c,_),e(_,m),e(c,T)},d(i){i&&t(c)}}}function xu(O){let c,b,_,m,T;return m=new bt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME9QVEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJBcnRodXJaJTJGb3B0LTM1MG0tZHVtbXktc2MlMjIpJTBBbW9kZWwlMjAlM0QlMjBPUFRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJBcnRodXJaJTJGb3B0LTM1MG0tZHVtbXktc2MlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwbG9naXRzLmFyZ21heCgpLml0ZW0oKSUwQW1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9jbGFzc19pZCU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyME9QVEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMkFydGh1clolMkZvcHQtMzUwbS1kdW1teS1zYyUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcyUwQXJvdW5kKGxvc3MuaXRlbSgpJTJDJTIwMik=",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, OPTForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;ArthurZ/opt-350m-dummy-sc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OPTForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;ArthurZ/opt-350m-dummy-sc&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
<span class="hljs-string">&#x27;LABEL_0&#x27;</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 = OPTForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;ArthurZ/opt-350m-dummy-sc&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">1.71</span>`}}),{c(){c=a("p"),b=n("Example of single-label classification:"),_=p(),v(m.$$.fragment)},l(i){c=r(i,"P",{});var h=l(c);b=s(h,"Example of single-label classification:"),h.forEach(t),_=u(i),w(m.$$.fragment,i)},m(i,h){f(i,c,h),e(c,b),f(i,_,h),M(m,i,h),T=!0},p:Tt,i(i){T||(k(m.$$.fragment,i),T=!0)},o(i){$(m.$$.fragment,i),T=!1},d(i){i&&t(c),i&&t(_),P(m,i)}}}function Uu(O){let c,b,_,m,T;return m=new bt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME9QVEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJBcnRodXJaJTJGb3B0LTM1MG0tZHVtbXktc2MlMjIpJTBBbW9kZWwlMjAlM0QlMjBPUFRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJBcnRodXJaJTJGb3B0LTM1MG0tZHVtbXktc2MlMjIlMkMlMjBwcm9ibGVtX3R5cGUlM0QlMjJtdWx0aV9sYWJlbF9jbGFzc2lmaWNhdGlvbiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJhbmdlKDAlMkMlMjBsb2dpdHMuc2hhcGUlNUItMSU1RCklNUJ0b3JjaC5zaWdtb2lkKGxvZ2l0cykuc3F1ZWV6ZShkaW0lM0QwKSUyMCUzRSUyMDAuNSU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyME9QVEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMkFydGh1clolMkZvcHQtMzUwbS1kdW1teS1zYyUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, OPTForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;ArthurZ/opt-350m-dummy-sc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OPTForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;ArthurZ/opt-350m-dummy-sc&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 = OPTForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;ArthurZ/opt-350m-dummy-sc&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(){c=a("p"),b=n("Example of multi-label classification:"),_=p(),v(m.$$.fragment)},l(i){c=r(i,"P",{});var h=l(c);b=s(h,"Example of multi-label classification:"),h.forEach(t),_=u(i),w(m.$$.fragment,i)},m(i,h){f(i,c,h),e(c,b),f(i,_,h),M(m,i,h),T=!0},p:Tt,i(i){T||(k(m.$$.fragment,i),T=!0)},o(i){$(m.$$.fragment,i),T=!1},d(i){i&&t(c),i&&t(_),P(m,i)}}}function Iu(O){let c,b,_,m,T;return{c(){c=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),m=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){c=r(i,"P",{});var h=l(c);b=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(h,"CODE",{});var C=l(_);m=s(C,"Module"),C.forEach(t),T=s(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){f(i,c,h),e(c,b),e(c,_),e(_,m),e(c,T)},d(i){i&&t(c)}}}function Zu(O){let c,b,_,m,T;return m=new bt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBPUFRGb3JRdWVzdGlvbkFuc3dlcmluZyUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9yY2gubWFudWFsX3NlZWQoNCklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm9wdC0zNTBtJTIyKSUwQSUwQSUyMyUyMG5vdGUlM0ElMjB3ZSUyMGFyZSUyMGxvYWRpbmclMjBhJTIwT1BURm9yUXVlc3Rpb25BbnN3ZXJpbmclMjBmcm9tJTIwdGhlJTIwaHViJTIwaGVyZSUyQyUwQSUyMyUyMHNvJTIwdGhlJTIwaGVhZCUyMHdpbGwlMjBiZSUyMHJhbmRvbWx5JTIwaW5pdGlhbGl6ZWQlMkMlMjBoZW5jZSUyMHRoZSUyMHByZWRpY3Rpb25zJTIwd2lsbCUyMGJlJTIwcmFuZG9tJTBBbW9kZWwlMjAlM0QlMjBPUFRGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZvcHQtMzUwbSUyMiklMEElMEFxdWVzdGlvbiUyQyUyMHRleHQlMjAlM0QlMjAlMjJXaG8lMjB3YXMlMjBKaW0lMjBIZW5zb24lM0YlMjIlMkMlMjAlMjJKaW0lMjBIZW5zb24lMjB3YXMlMjBhJTIwbmljZSUyMHB1cHBldCUyMiUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihxdWVzdGlvbiUyQyUyMHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNEJTIwb3V0cHV0cy5zdGFydF9sb2dpdHMuYXJnbWF4KCklMEFhbnN3ZXJfZW5kX2luZGV4JTIwJTNEJTIwb3V0cHV0cy5lbmRfbG9naXRzLmFyZ21heCgpJTBBJTBBYW5zd2VyX29mZnNldCUyMCUzRCUyMGxlbih0b2tlbml6ZXIocXVlc3Rpb24pJTVCMCU1RCklMEElMEFwcmVkaWN0X2Fuc3dlcl90b2tlbnMlMjAlM0QlMjBpbnB1dHMuaW5wdXRfaWRzJTVCJTBBJTIwJTIwJTIwJTIwMCUyQyUyMGFuc3dlcl9vZmZzZXQlMjAlMkIlMjBhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0ElMjBhbnN3ZXJfb2Zmc2V0JTIwJTJCJTIwYW5zd2VyX2VuZF9pbmRleCUyMCUyQiUyMDElMEElNUQlMEFwcmVkaWN0ZWQlMjAlM0QlMjB0b2tlbml6ZXIuZGVjb2RlKHByZWRpY3RfYW5zd2VyX3Rva2VucyklMEFwcmVkaWN0ZWQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, OPTForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">4</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/opt-350m&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># note: we are loading a OPTForQuestionAnswering from the hub here,</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># so the head will be randomly initialized, hence the predictions will be random</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OPTForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;facebook/opt-350m&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, 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>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = outputs.start_logits.argmax()
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = outputs.end_logits.argmax()

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_offset = <span class="hljs-built_in">len</span>(tokenizer(question)[<span class="hljs-number">0</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[
<span class="hljs-meta">... </span>    <span class="hljs-number">0</span>, answer_offset + answer_start_index : answer_offset + answer_end_index + <span class="hljs-number">1</span>
<span class="hljs-meta">... </span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted = tokenizer.decode(predict_answer_tokens)
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted
<span class="hljs-string">&#x27; a nice puppet&#x27;</span>`}}),{c(){c=a("p"),b=n("Example:"),_=p(),v(m.$$.fragment)},l(i){c=r(i,"P",{});var h=l(c);b=s(h,"Example:"),h.forEach(t),_=u(i),w(m.$$.fragment,i)},m(i,h){f(i,c,h),e(c,b),f(i,_,h),M(m,i,h),T=!0},p:Tt,i(i){T||(k(m.$$.fragment,i),T=!0)},o(i){$(m.$$.fragment,i),T=!1},d(i){i&&t(c),i&&t(_),P(m,i)}}}function Wu(O){let c,b,_,m,T;return m=new bt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4T1BUTW9kZWwlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm9wdC0zNTBtJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheE9QVE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm9wdC0zNTBtJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJqYXglMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxOPTModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/opt-350m&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxOPTModel.from_pretrained(<span class="hljs-string">&quot;facebook/opt-350m&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;jax&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(){c=a("p"),b=n("Example:"),_=p(),v(m.$$.fragment)},l(i){c=r(i,"P",{});var h=l(c);b=s(h,"Example:"),h.forEach(t),_=u(i),w(m.$$.fragment,i)},m(i,h){f(i,c,h),e(c,b),f(i,_,h),M(m,i,h),T=!0},p:Tt,i(i){T||(k(m.$$.fragment,i),T=!0)},o(i){$(m.$$.fragment,i),T=!1},d(i){i&&t(c),i&&t(_),P(m,i)}}}function qu(O){let c,b,_,m,T;return m=new bt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4T1BURm9yQ2F1c2FsTE0lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm9wdC0zNTBtJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheE9QVEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm9wdC0zNTBtJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBJTIzJTIwcmV0cmlldmUlMjBsb2d0cyUyMGZvciUyMG5leHQlMjB0b2tlbiUwQW5leHRfdG9rZW5fbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlNUIlM0ElMkMlMjAtMSU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxOPTForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/opt-350m&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxOPTForCausalLM.from_pretrained(<span class="hljs-string">&quot;facebook/opt-350m&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;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve logts for next token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_token_logits = outputs.logits[:, -<span class="hljs-number">1</span>]`}}),{c(){c=a("p"),b=n("Example:"),_=p(),v(m.$$.fragment)},l(i){c=r(i,"P",{});var h=l(c);b=s(h,"Example:"),h.forEach(t),_=u(i),w(m.$$.fragment,i)},m(i,h){f(i,c,h),e(c,b),f(i,_,h),M(m,i,h),T=!0},p:Tt,i(i){T||(k(m.$$.fragment,i),T=!0)},o(i){$(m.$$.fragment,i),T=!1},d(i){i&&t(c),i&&t(_),P(m,i)}}}function Au(O){let c,b,_,m,T,i,h,C,Ge,je,I,K,te,F,Be,R,Ve,Ce,A,Se,oe,ne,Le,ze,S,Re,Je,L,ye,Qe,me,z,Z,xe,N,se,Xe,Q,He,Ye,W,ae,re,ve,De,le,Ue,x,X,ie,de,Ke,H,q,et,J,tt,ot,y,E,yt,fe,ce,ge,j,we,vt,nt,wt,rt,G,pe,lt,Me,ee,U,ke,st,$e,Pe,Mt,Or,Fo,Er,Oo,jr,Cr,zr,Xn,Eo,Jr,xr,Ur,it,Hn,Ir,Zr,jo,Wr,qr,Co,Ar,Nr,Gr,dt,Yn,Br,Vr,zo,Sr,Lr,Jo,Rr,Qr,Xr,Gt,Dn,Hr,Yr,xo,Dr,Kr,Ma,Uo,ka,Bt,Os,Kn,el,tl,ct,es,ol,nl,Io,sl,al,Zo,rl,ll,$a,Wo,Pa,Vt,pt,ts,il,dl,qo,cl,pl,Ao,ul,hl,ml,os,No,fl,gl,Fa,ns,_l,Oa,ss,Go,Tl,Bo,bl,yl,Ea,kt,St,Es,Vo,vl,js,wl,ja,Fe,So,Ml,$t,kl,as,$l,Pl,Lo,Fl,Ol,El,Pt,jl,rs,Cl,zl,ls,Jl,xl,Ul,Lt,Ca,Ft,Rt,Cs,Ro,Il,zs,Zl,za,Oe,Qo,Wl,Xo,ql,is,Al,Nl,Gl,Ho,Bl,Yo,Vl,Sl,Ll,Ie,Do,Rl,Ot,Ql,ds,Xl,Hl,Js,Yl,Dl,Kl,Qt,ei,Xt,Ja,Et,Ht,xs,Ko,ti,Us,oi,xa,jt,en,ni,Yt,tn,si,Dt,Ua,Ct,Kt,Is,on,ai,Zs,ri,Ia,ue,nn,li,sn,ii,cs,di,ci,pi,an,ui,rn,hi,mi,fi,eo,gi,Ze,ln,_i,zt,Ti,ps,bi,yi,Ws,vi,wi,Mi,to,ki,oo,Za,Jt,no,qs,dn,$i,As,Pi,Wa,Y,cn,Fi,Ns,Oi,Ei,pn,ji,us,Ci,zi,Ji,un,xi,hn,Ui,Ii,Zi,so,Wi,ao,mn,qi,ro,qa,xt,lo,Gs,fn,Ai,Bs,Ni,Aa,B,gn,Gi,Vs,Bi,Vi,hs,ms,Si,Li,Ri,Ee,Qi,Ss,Xi,Hi,Ls,Yi,Di,Rs,Ki,ed,Qs,td,od,nd,_n,sd,fs,ad,rd,ld,Tn,id,bn,dd,cd,pd,_e,yn,ud,Ut,hd,gs,md,fd,Xs,gd,_d,Td,io,bd,co,yd,po,Na,It,uo,Hs,vn,vd,Ys,wd,Ga,he,wn,Md,Zt,kd,Ds,$d,Pd,Ks,Fd,Od,Ed,Mn,jd,_s,Cd,zd,Jd,kn,xd,$n,Ud,Id,Zd,We,Pn,Wd,Wt,qd,Ts,Ad,Nd,ea,Gd,Bd,Vd,ho,Sd,mo,Ba,qt,fo,ta,Fn,Ld,oa,Rd,Va,At,On,Qd,go,En,Xd,_o,Sa,Nt,To,na,jn,Hd,sa,Yd,La,V,Cn,Dd,aa,Kd,ec,zn,tc,bs,oc,nc,sc,Jn,ac,xn,rc,lc,ic,ra,dc,cc,at,la,Un,pc,uc,ia,In,hc,mc,da,Zn,fc,gc,ca,Wn,_c,Tc,bo,qn,bc,yo,Ra;return i=new Ne({}),F=new Ne({}),we=new Ne({}),Me=new Mc({props:{pipeline:"text-generation"}}),Uo=new Mc({props:{pipeline:"text-classification"}}),Wo=new Mc({props:{pipeline:"question-answering"}}),Vo=new Ne({}),So=new D({props:{name:"class transformers.OPTConfig",anchor:"transformers.OPTConfig",parameters:[{name:"vocab_size",val:" = 50272"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"ffn_dim",val:" = 3072"},{name:"max_position_embeddings",val:" = 2048"},{name:"do_layer_norm_before",val:" = True"},{name:"_remove_final_layer_norm",val:" = False"},{name:"word_embed_proj_dim",val:" = None"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.0"},{name:"num_attention_heads",val:" = 12"},{name:"activation_function",val:" = 'relu'"},{name:"layerdrop",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 2"},{name:"eos_token_id",val:" = 2"},{name:"enable_bias",val:" = True"},{name:"layer_norm_elementwise_affine",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OPTConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50272) &#x2014;
Vocabulary size of the OPT 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.30.0/en/model_doc/opt#transformers.OPTModel">OPTModel</a>`,name:"vocab_size"},{anchor:"transformers.OPTConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.OPTConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of decoder layers.`,name:"num_hidden_layers"},{anchor:"transformers.OPTConfig.ffn_dim",description:`<strong>ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"ffn_dim"},{anchor:"transformers.OPTConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"num_attention_heads"},{anchor:"transformers.OPTConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;relu&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:"activation_function"},{anchor:"transformers.OPTConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#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:"max_position_embeddings"},{anchor:"transformers.OPTConfig.do_layer_norm_before",description:`<strong>do_layer_norm_before</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to perform layer normalization before the attention block.`,name:"do_layer_norm_before"},{anchor:"transformers.OPTConfig.word_embed_proj_dim",description:`<strong>word_embed_proj_dim</strong> (<code>int</code>, <em>optional</em>) &#x2014;
<code>word_embed_proj_dim</code> can be set to down-project word embeddings, <em>e.g.</em> <code>opt-350m</code>. Defaults to
<code>hidden_size</code>.`,name:"word_embed_proj_dim"},{anchor:"transformers.OPTConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.OPTConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.OPTConfig.layerdrop",description:`<strong>layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>) for more
details.`,name:"layerdrop"},{anchor:"transformers.OPTConfig.init_std",description:`<strong>init_std</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:"init_std"},{anchor:"transformers.OPTConfig.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"},{anchor:"transformers.OPTConfig.enable_bias",description:`<strong>enable_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not if the linear layers in the attention blocks should use the bias term.`,name:"enable_bias"},{anchor:"transformers.OPTConfig.layer_norm_elementwise_affine",description:`<strong>layer_norm_elementwise_affine</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not if the layer norms should have learnable parameters.`,name:"layer_norm_elementwise_affine"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/opt/configuration_opt.py#L32"}}),Lt=new _t({props:{anchor:"transformers.OPTConfig.example",$$slots:{default:[ku]},$$scope:{ctx:O}}}),Ro=new Ne({}),Qo=new D({props:{name:"class transformers.OPTModel",anchor:"transformers.OPTModel",parameters:[{name:"config",val:": OPTConfig"}],parametersDescription:[{anchor:"transformers.OPTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTConfig">OPTConfig</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.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/opt/modeling_opt.py#L753"}}),Do=new D({props:{name:"forward",anchor:"transformers.OPTModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.OPTModel.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. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.OPTModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</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></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.`,name:"attention_mask"},{anchor:"transformers.OPTModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. 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.OPTModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.OPTModel.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.OPTModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.OPTModel.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.OPTModel.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.OPTModel.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.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/opt/modeling_opt.py#L769",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTConfig"
>OPTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qt=new Fs({props:{$$slots:{default:[$u]},$$scope:{ctx:O}}}),Xt=new _t({props:{anchor:"transformers.OPTModel.forward.example",$$slots:{default:[Pu]},$$scope:{ctx:O}}}),Ko=new Ne({}),en=new D({props:{name:"class transformers.OPTForCausalLM",anchor:"transformers.OPTForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/opt/modeling_opt.py#L819"}}),tn=new D({props:{name:"forward",anchor:"transformers.OPTForCausalLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.OPTForCausalLM.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. Padding will be ignored by default should you
provide it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.OPTForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</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.OPTForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(num_hidden_layers, num_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.OPTForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of
shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>. The two additional
tensors are only required when the model is used as a decoder in a Sequence to Sequence model.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the
cross-attention blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those
that don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of
all <code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.OPTForCausalLM.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.OPTForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"},{anchor:"transformers.OPTForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding
(see <code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.OPTForCausalLM.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.OPTForCausalLM.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.OPTForCausalLM.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.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/opt/modeling_opt.py#L850",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTConfig"
>OPTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Dt=new _t({props:{anchor:"transformers.OPTForCausalLM.forward.example",$$slots:{default:[Fu]},$$scope:{ctx:O}}}),on=new Ne({}),nn=new D({props:{name:"class transformers.TFOPTModel",anchor:"transformers.TFOPTModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFOPTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTConfig">OPTConfig</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.30.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/opt/modeling_tf_opt.py#L761"}}),eo=new Fs({props:{$$slots:{default:[Ou]},$$scope:{ctx:O}}}),ln=new D({props:{name:"call",anchor:"transformers.TFOPTModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"past_key_values",val:": Optional[Tuple[Tuple[Union[np.ndarray, tf.Tensor]]]] = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"use_cache",val:": Optional[bool] = 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"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFOPTModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.TFOPTModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>({0})</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.TFOPTModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. 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.TFOPTModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFOPTModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"},{anchor:"transformers.TFOPTModel.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.TFOPTModel.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.TFOPTModel.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.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFOPTModel.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.30.0/src/transformers/models/opt/modeling_tf_opt.py#L775",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPast"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPast</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTConfig"
>OPTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPast"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPast</a> or <code>tuple(tf.Tensor)</code></p>
`}}),to=new Fs({props:{$$slots:{default:[Eu]},$$scope:{ctx:O}}}),oo=new _t({props:{anchor:"transformers.TFOPTModel.call.example",$$slots:{default:[ju]},$$scope:{ctx:O}}}),dn=new Ne({}),cn=new D({props:{name:"class transformers.TFOPTForCausalLM",anchor:"transformers.TFOPTForCausalLM",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFOPTForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTConfig">OPTConfig</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.30.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/opt/modeling_tf_opt.py#L847"}}),so=new Fs({props:{$$slots:{default:[Cu]},$$scope:{ctx:O}}}),mn=new D({props:{name:"call",anchor:"transformers.TFOPTForCausalLM.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"past_key_values",val:": Optional[Tuple[Tuple[Union[np.ndarray, tf.Tensor]]]] = None"},{name:"attention_mask",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:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"use_cache",val:": Optional[bool] = 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"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFOPTForCausalLM.call.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. Padding will be ignored by default should you
provide it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.TFOPTForCausalLM.call.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</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.TFOPTForCausalLM.call.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(num_hidden_layers, num_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.TFOPTForCausalLM.call.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of
shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>. The two additional
tensors are only required when the model is used as a decoder in a Sequence to Sequence model.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the
cross-attention blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFOPTForCausalLM.call.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.TFOPTForCausalLM.call.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"},{anchor:"transformers.TFOPTForCausalLM.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding
(see <code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.TFOPTForCausalLM.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.`,name:"output_attentions"},{anchor:"transformers.TFOPTForCausalLM.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.`,name:"output_hidden_states"},{anchor:"transformers.TFOPTForCausalLM.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.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/opt/modeling_tf_opt.py#L872",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithPast"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithPast</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTConfig"
>OPTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithPast"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithPast</a> or <code>tuple(tf.Tensor)</code>: A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithPast"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithPast</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTConfig"
>OPTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithPast"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithPast</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ro=new _t({props:{anchor:"transformers.TFOPTForCausalLM.call.example",$$slots:{default:[zu]},$$scope:{ctx:O}}}),fn=new Ne({}),gn=new D({props:{name:"class transformers.OPTForSequenceClassification",anchor:"transformers.OPTForSequenceClassification",parameters:[{name:"config",val:": OPTConfig"}],parametersDescription:[{anchor:"transformers.OPTForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTConfig">OPTConfig</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.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/opt/modeling_opt.py#L1026"}}),yn=new D({props:{name:"forward",anchor:"transformers.OPTForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.OPTForSequenceClassification.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. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.OPTForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</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></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.`,name:"attention_mask"},{anchor:"transformers.OPTForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. 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.OPTForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.OPTForSequenceClassification.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.OPTForSequenceClassification.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.OPTForSequenceClassification.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.OPTForSequenceClassification.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.OPTForSequenceClassification.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.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.OPTForSequenceClassification.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.30.0/src/transformers/models/opt/modeling_opt.py#L1038",returnDescription:`
<p>A <code>transformers.modeling_outputs.SequenceClassifierOutputWithPast</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTConfig"
>OPTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_outputs.SequenceClassifierOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),io=new Fs({props:{$$slots:{default:[Ju]},$$scope:{ctx:O}}}),co=new _t({props:{anchor:"transformers.OPTForSequenceClassification.forward.example",$$slots:{default:[xu]},$$scope:{ctx:O}}}),po=new _t({props:{anchor:"transformers.OPTForSequenceClassification.forward.example-2",$$slots:{default:[Uu]},$$scope:{ctx:O}}}),vn=new Ne({}),wn=new D({props:{name:"class transformers.OPTForQuestionAnswering",anchor:"transformers.OPTForQuestionAnswering",parameters:[{name:"config",val:": OPTConfig"}],parametersDescription:[{anchor:"transformers.OPTForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTConfig">OPTConfig</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.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/opt/modeling_opt.py#L1148"}}),Pn=new D({props:{name:"forward",anchor:"transformers.OPTForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.OPTForQuestionAnswering.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. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.OPTForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</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></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.`,name:"attention_mask"},{anchor:"transformers.OPTForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. 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.OPTForQuestionAnswering.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.OPTForQuestionAnswering.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.OPTForQuestionAnswering.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.OPTForQuestionAnswering.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.OPTForQuestionAnswering.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.OPTForQuestionAnswering.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.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.OPTForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.OPTForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/opt/modeling_opt.py#L1159",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</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.30.0/en/model_doc/opt#transformers.OPTConfig"
>OPTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ho=new Fs({props:{$$slots:{default:[Iu]},$$scope:{ctx:O}}}),mo=new _t({props:{anchor:"transformers.OPTForQuestionAnswering.forward.example",$$slots:{default:[Zu]},$$scope:{ctx:O}}}),Fn=new Ne({}),On=new D({props:{name:"class transformers.FlaxOPTModel",anchor:"transformers.FlaxOPTModel",parameters:[{name:"config",val:": OPTConfig"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/opt/modeling_flax_opt.py#L690"}}),En=new D({props:{name:"__call__",anchor:"transformers.FlaxOPTModel.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"params",val:": dict = None"},{name:"past_key_values",val:": dict = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"deterministic",val:": bool = True"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/opt/modeling_flax_opt.py#L583",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</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.30.0/en/model_doc/opt#transformers.OPTConfig"
>OPTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</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(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</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.30.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_o=new _t({props:{anchor:"transformers.FlaxOPTModel.__call__.example",$$slots:{default:[Wu]},$$scope:{ctx:O}}}),jn=new Ne({}),Cn=new D({props:{name:"class transformers.FlaxOPTForCausalLM",anchor:"transformers.FlaxOPTForCausalLM",parameters:[{name:"config",val:": OPTConfig"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxOPTForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTConfig">OPTConfig</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.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxOPTForCausalLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/opt/modeling_flax_opt.py#L763"}}),qn=new D({props:{name:"__call__",anchor:"transformers.FlaxOPTForCausalLM.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"params",val:": dict = None"},{name:"past_key_values",val:": dict = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"deterministic",val:": bool = True"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/opt/modeling_flax_opt.py#L583",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</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.30.0/en/model_doc/opt#transformers.OPTConfig"
>OPTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</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(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</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.30.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),yo=new _t({props:{anchor:"transformers.FlaxOPTForCausalLM.__call__.example",$$slots:{default:[qu]},$$scope:{ctx:O}}}),{c(){c=a("meta"),b=p(),_=a("h1"),m=a("a"),T=a("span"),v(i.$$.fragment),h=p(),C=a("span"),Ge=n("OPT"),je=p(),I=a("h2"),K=a("a"),te=a("span"),v(F.$$.fragment),Be=p(),R=a("span"),Ve=n("Overview"),Ce=p(),A=a("p"),Se=n("The OPT model was proposed in "),oe=a("a"),ne=n("Open Pre-trained Transformer Language Models"),Le=n(` by Meta AI.
OPT is a series of open-sourced large causal language models which perform similar in performance to GPT3.`),ze=p(),S=a("p"),Re=n("The abstract from the paper is the following:"),Je=p(),L=a("p"),ye=a("em"),Qe=n("Large language models, which are often trained for hundreds of thousands of compute days, have shown remarkable capabilities for zero- and few-shot learning. Given their computational cost, these models are difficult to replicate without significant capital. For the few that are available through APIs, no access is granted to the full model weights, making them difficult to study. We present Open Pre-trained Transformers (OPT), a suite of decoder-only pre-trained transformers ranging from 125M to 175B parameters, which we aim to fully and responsibly share with interested researchers. We show that OPT-175B is comparable to GPT-3, while requiring only 1/7th the carbon footprint to develop. We are also releasing our logbook detailing the infrastructure challenges we faced, along with code for experimenting with all of the released models."),me=p(),z=a("p"),Z=n("Tips:"),xe=p(),N=a("ul"),se=a("li"),Xe=n("OPT has the same architecture as "),Q=a("code"),He=n("BartDecoder"),Ye=n("."),W=p(),ae=a("li"),re=n("Contrary to GPT2, OPT adds the EOS token "),ve=a("code"),De=n("</s>"),le=n(" to the beginning of every prompt."),Ue=p(),x=a("p"),X=n("This model was contributed by "),ie=a("a"),de=n("Arthur Zucker"),Ke=n(", "),H=a("a"),q=n("Younes Belkada"),et=n(", and "),J=a("a"),tt=n("Patrick Von Platen"),ot=n(`.
The original code can be found `),y=a("a"),E=n("here"),yt=n("."),fe=p(),ce=a("h2"),ge=a("a"),j=a("span"),v(we.$$.fragment),vt=p(),nt=a("span"),wt=n("Resources"),rt=p(),G=a("p"),pe=n(`A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with OPT. If you\u2019re
interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it.
The resource should ideally demonstrate something new instead of duplicating an existing resource.`),lt=p(),v(Me.$$.fragment),ee=p(),U=a("ul"),ke=a("li"),st=n("A notebook on "),$e=a("a"),Pe=n("fine-tuning OPT with PEFT, bitsandbytes, and Transformers"),Mt=n(". \u{1F30E}"),Or=p(),Fo=a("li"),Er=n("A blog post on "),Oo=a("a"),jr=n("decoding strategies with OPT"),Cr=n("."),zr=p(),Xn=a("li"),Eo=a("a"),Jr=n("Causal language modeling"),xr=n(" chapter of the \u{1F917} Hugging Face Course."),Ur=p(),it=a("li"),Hn=a("a"),Ir=n("OPTForCausalLM"),Zr=n(" is supported by this "),jo=a("a"),Wr=n("causal language modeling example script"),qr=n(" and "),Co=a("a"),Ar=n("notebook"),Nr=n("."),Gr=p(),dt=a("li"),Yn=a("a"),Br=n("TFOPTForCausalLM"),Vr=n(" is supported by this "),zo=a("a"),Sr=n("causal language modeling example script"),Lr=n(" and "),Jo=a("a"),Rr=n("notebook"),Qr=n("."),Xr=p(),Gt=a("li"),Dn=a("a"),Hr=n("FlaxOPTForCausalLM"),Yr=n(" is supported by this "),xo=a("a"),Dr=n("causal language modeling example script"),Kr=n("."),Ma=p(),v(Uo.$$.fragment),ka=p(),Bt=a("ul"),Os=a("li"),Kn=a("a"),el=n("Text classification task guide"),tl=p(),ct=a("li"),es=a("a"),ol=n("OPTForSequenceClassification"),nl=n(" is supported by this "),Io=a("a"),sl=n("example script"),al=n(" and "),Zo=a("a"),rl=n("notebook"),ll=n("."),$a=p(),v(Wo.$$.fragment),Pa=p(),Vt=a("ul"),pt=a("li"),ts=a("a"),il=n("OPTForQuestionAnswering"),dl=n(" is supported by this "),qo=a("a"),cl=n("question answering example script"),pl=n(" and "),Ao=a("a"),ul=n("notebook"),hl=n("."),ml=p(),os=a("li"),No=a("a"),fl=n("Question answering"),gl=n(` chapter
of the \u{1F917} Hugging Face Course.`),Fa=p(),ns=a("p"),_l=n("\u26A1\uFE0F Inference"),Oa=p(),ss=a("ul"),Go=a("li"),Tl=n("A blog post on "),Bo=a("a"),bl=n("How \u{1F917} Accelerate runs very large models thanks to PyTorch"),yl=n(" with OPT."),Ea=p(),kt=a("h2"),St=a("a"),Es=a("span"),v(Vo.$$.fragment),vl=p(),js=a("span"),wl=n("OPTConfig"),ja=p(),Fe=a("div"),v(So.$$.fragment),Ml=p(),$t=a("p"),kl=n("This is the configuration class to store the configuration of a "),as=a("a"),$l=n("OPTModel"),Pl=n(`. It is used to instantiate a OPT 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 OPT
`),Lo=a("a"),Fl=n("facebook/opt-350m"),Ol=n(" architecture."),El=p(),Pt=a("p"),jl=n("Configuration objects inherit from "),rs=a("a"),Cl=n("PretrainedConfig"),zl=n(` and can be used to control the model outputs. Read the
documentation from `),ls=a("a"),Jl=n("PretrainedConfig"),xl=n(" for more information."),Ul=p(),v(Lt.$$.fragment),Ca=p(),Ft=a("h2"),Rt=a("a"),Cs=a("span"),v(Ro.$$.fragment),Il=p(),zs=a("span"),Zl=n("OPTModel"),za=p(),Oe=a("div"),v(Qo.$$.fragment),Wl=p(),Xo=a("p"),ql=n(`The bare OPT Model outputting raw hidden-states without any specific head on top.
This model inherits from `),is=a("a"),Al=n("PreTrainedModel"),Nl=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Gl=p(),Ho=a("p"),Bl=n("This model is also a PyTorch "),Yo=a("a"),Vl=n("torch.nn.Module"),Sl=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ll=p(),Ie=a("div"),v(Do.$$.fragment),Rl=p(),Ot=a("p"),Ql=n("The "),ds=a("a"),Xl=n("OPTModel"),Hl=n(" forward method, overrides the "),Js=a("code"),Yl=n("__call__"),Dl=n(" special method."),Kl=p(),v(Qt.$$.fragment),ei=p(),v(Xt.$$.fragment),Ja=p(),Et=a("h2"),Ht=a("a"),xs=a("span"),v(Ko.$$.fragment),ti=p(),Us=a("span"),oi=n("OPTForCausalLM"),xa=p(),jt=a("div"),v(en.$$.fragment),ni=p(),Yt=a("div"),v(tn.$$.fragment),si=p(),v(Dt.$$.fragment),Ua=p(),Ct=a("h2"),Kt=a("a"),Is=a("span"),v(on.$$.fragment),ai=p(),Zs=a("span"),ri=n("TFOPTModel"),Ia=p(),ue=a("div"),v(nn.$$.fragment),li=p(),sn=a("p"),ii=n(`The bare TF OPT Model outputting raw hidden-states without any specific head on top.
This model inherits from `),cs=a("a"),di=n("TFPreTrainedModel"),ci=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),pi=p(),an=a("p"),ui=n("This model is also a "),rn=a("a"),hi=n("tf.keras.Model"),mi=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),fi=p(),v(eo.$$.fragment),gi=p(),Ze=a("div"),v(ln.$$.fragment),_i=p(),zt=a("p"),Ti=n("The "),ps=a("a"),bi=n("TFOPTModel"),yi=n(" forward method, overrides the "),Ws=a("code"),vi=n("__call__"),wi=n(" special method."),Mi=p(),v(to.$$.fragment),ki=p(),v(oo.$$.fragment),Za=p(),Jt=a("h2"),no=a("a"),qs=a("span"),v(dn.$$.fragment),$i=p(),As=a("span"),Pi=n("TFOPTForCausalLM"),Wa=p(),Y=a("div"),v(cn.$$.fragment),Fi=p(),Ns=a("p"),Oi=n("The OPT Model transformer with a language modeling head on top."),Ei=p(),pn=a("p"),ji=n("This model inherits from "),us=a("a"),Ci=n("TFPreTrainedModel"),zi=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ji=p(),un=a("p"),xi=n("This model is also a "),hn=a("a"),Ui=n("tf.keras.Model"),Ii=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Zi=p(),v(so.$$.fragment),Wi=p(),ao=a("div"),v(mn.$$.fragment),qi=p(),v(ro.$$.fragment),qa=p(),xt=a("h2"),lo=a("a"),Gs=a("span"),v(fn.$$.fragment),Ai=p(),Bs=a("span"),Ni=n("OPTForSequenceClassification"),Aa=p(),B=a("div"),v(gn.$$.fragment),Gi=p(),Vs=a("p"),Bi=n("The OPT Model transformer with a sequence classification head on top (linear layer)."),Vi=p(),hs=a("p"),ms=a("a"),Si=n("OPTForSequenceClassification"),Li=n(` uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`),Ri=p(),Ee=a("p"),Qi=n(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Ss=a("code"),Xi=n("pad_token_id"),Hi=n(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Ls=a("code"),Yi=n("pad_token_id"),Di=n(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),Rs=a("code"),Ki=n("inputs_embeds"),ed=n(" are passed instead of "),Qs=a("code"),td=n("input_ids"),od=n(`, it does the same (take the last value in
each row of the batch).`),nd=p(),_n=a("p"),sd=n("This model inherits from "),fs=a("a"),ad=n("PreTrainedModel"),rd=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ld=p(),Tn=a("p"),id=n("This model is also a PyTorch "),bn=a("a"),dd=n("torch.nn.Module"),cd=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pd=p(),_e=a("div"),v(yn.$$.fragment),ud=p(),Ut=a("p"),hd=n("The "),gs=a("a"),md=n("OPTForSequenceClassification"),fd=n(" forward method, overrides the "),Xs=a("code"),gd=n("__call__"),_d=n(" special method."),Td=p(),v(io.$$.fragment),bd=p(),v(co.$$.fragment),yd=p(),v(po.$$.fragment),Na=p(),It=a("h2"),uo=a("a"),Hs=a("span"),v(vn.$$.fragment),vd=p(),Ys=a("span"),wd=n("OPTForQuestionAnswering"),Ga=p(),he=a("div"),v(wn.$$.fragment),Md=p(),Zt=a("p"),kd=n(`The OPT Model transformer with a span classification head on top for extractive question-answering tasks like SQuAD
(a linear layers on top of the hidden-states output to compute `),Ds=a("code"),$d=n("span start logits"),Pd=n(" and "),Ks=a("code"),Fd=n("span end logits"),Od=n(")."),Ed=p(),Mn=a("p"),jd=n("This model inherits from "),_s=a("a"),Cd=n("PreTrainedModel"),zd=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Jd=p(),kn=a("p"),xd=n("This model is also a PyTorch "),$n=a("a"),Ud=n("torch.nn.Module"),Id=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Zd=p(),We=a("div"),v(Pn.$$.fragment),Wd=p(),Wt=a("p"),qd=n("The "),Ts=a("a"),Ad=n("OPTForQuestionAnswering"),Nd=n(" forward method, overrides the "),ea=a("code"),Gd=n("__call__"),Bd=n(" special method."),Vd=p(),v(ho.$$.fragment),Sd=p(),v(mo.$$.fragment),Ba=p(),qt=a("h2"),fo=a("a"),ta=a("span"),v(Fn.$$.fragment),Ld=p(),oa=a("span"),Rd=n("FlaxOPTModel"),Va=p(),At=a("div"),v(On.$$.fragment),Qd=p(),go=a("div"),v(En.$$.fragment),Xd=p(),v(_o.$$.fragment),Sa=p(),Nt=a("h2"),To=a("a"),na=a("span"),v(jn.$$.fragment),Hd=p(),sa=a("span"),Yd=n("FlaxOPTForCausalLM"),La=p(),V=a("div"),v(Cn.$$.fragment),Dd=p(),aa=a("p"),Kd=n(`OPT Model with a language modeling head on top (linear layer with weights tied to the input embeddings) e.g for
autoregressive tasks.`),ec=p(),zn=a("p"),tc=n("This model inherits from "),bs=a("a"),oc=n("FlaxPreTrainedModel"),nc=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),sc=p(),Jn=a("p"),ac=n(`This model is also a Flax Linen
`),xn=a("a"),rc=n("flax.nn.Module"),lc=n(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),ic=p(),ra=a("p"),dc=n("Finally, this model supports inherent JAX features such as:"),cc=p(),at=a("ul"),la=a("li"),Un=a("a"),pc=n("Just-In-Time (JIT) compilation"),uc=p(),ia=a("li"),In=a("a"),hc=n("Automatic Differentiation"),mc=p(),da=a("li"),Zn=a("a"),fc=n("Vectorization"),gc=p(),ca=a("li"),Wn=a("a"),_c=n("Parallelization"),Tc=p(),bo=a("div"),v(qn.$$.fragment),bc=p(),v(yo.$$.fragment),this.h()},l(o){const g=wu('[data-svelte="svelte-1phssyn"]',document.head);c=r(g,"META",{name:!0,content:!0}),g.forEach(t),b=u(o),_=r(o,"H1",{class:!0});var An=l(_);m=r(An,"A",{id:!0,class:!0,href:!0});var pa=l(m);T=r(pa,"SPAN",{});var ua=l(T);w(i.$$.fragment,ua),ua.forEach(t),pa.forEach(t),h=u(An),C=r(An,"SPAN",{});var ha=l(C);Ge=s(ha,"OPT"),ha.forEach(t),An.forEach(t),je=u(o),I=r(o,"H2",{class:!0});var Nn=l(I);K=r(Nn,"A",{id:!0,class:!0,href:!0});var ma=l(K);te=r(ma,"SPAN",{});var fa=l(te);w(F.$$.fragment,fa),fa.forEach(t),ma.forEach(t),Be=u(Nn),R=r(Nn,"SPAN",{});var ga=l(R);Ve=s(ga,"Overview"),ga.forEach(t),Nn.forEach(t),Ce=u(o),A=r(o,"P",{});var Gn=l(A);Se=s(Gn,"The OPT model was proposed in "),oe=r(Gn,"A",{href:!0,rel:!0});var _a=l(oe);ne=s(_a,"Open Pre-trained Transformer Language Models"),_a.forEach(t),Le=s(Gn,` by Meta AI.
OPT is a series of open-sourced large causal language models which perform similar in performance to GPT3.`),Gn.forEach(t),ze=u(o),S=r(o,"P",{});var Ta=l(S);Re=s(Ta,"The abstract from the paper is the following:"),Ta.forEach(t),Je=u(o),L=r(o,"P",{});var ba=l(L);ye=r(ba,"EM",{});var ya=l(ye);Qe=s(ya,"Large language models, which are often trained for hundreds of thousands of compute days, have shown remarkable capabilities for zero- and few-shot learning. Given their computational cost, these models are difficult to replicate without significant capital. For the few that are available through APIs, no access is granted to the full model weights, making them difficult to study. We present Open Pre-trained Transformers (OPT), a suite of decoder-only pre-trained transformers ranging from 125M to 175B parameters, which we aim to fully and responsibly share with interested researchers. We show that OPT-175B is comparable to GPT-3, while requiring only 1/7th the carbon footprint to develop. We are also releasing our logbook detailing the infrastructure challenges we faced, along with code for experimenting with all of the released models."),ya.forEach(t),ba.forEach(t),me=u(o),z=r(o,"P",{});var va=l(z);Z=s(va,"Tips:"),va.forEach(t),xe=u(o),N=r(o,"UL",{});var Bn=l(N);se=r(Bn,"LI",{});var Vn=l(se);Xe=s(Vn,"OPT has the same architecture as "),Q=r(Vn,"CODE",{});var kc=l(Q);He=s(kc,"BartDecoder"),kc.forEach(t),Ye=s(Vn,"."),Vn.forEach(t),W=u(Bn),ae=r(Bn,"LI",{});var Qa=l(ae);re=s(Qa,"Contrary to GPT2, OPT adds the EOS token "),ve=r(Qa,"CODE",{});var $c=l(ve);De=s($c,"</s>"),$c.forEach(t),le=s(Qa," to the beginning of every prompt."),Qa.forEach(t),Bn.forEach(t),Ue=u(o),x=r(o,"P",{});var ut=l(x);X=s(ut,"This model was contributed by "),ie=r(ut,"A",{href:!0,rel:!0});var Pc=l(ie);de=s(Pc,"Arthur Zucker"),Pc.forEach(t),Ke=s(ut,", "),H=r(ut,"A",{href:!0,rel:!0});var Fc=l(H);q=s(Fc,"Younes Belkada"),Fc.forEach(t),et=s(ut,", and "),J=r(ut,"A",{href:!0,rel:!0});var Oc=l(J);tt=s(Oc,"Patrick Von Platen"),Oc.forEach(t),ot=s(ut,`.
The original code can be found `),y=r(ut,"A",{href:!0,rel:!0});var Ec=l(y);E=s(Ec,"here"),Ec.forEach(t),yt=s(ut,"."),ut.forEach(t),fe=u(o),ce=r(o,"H2",{class:!0});var Xa=l(ce);ge=r(Xa,"A",{id:!0,class:!0,href:!0});var jc=l(ge);j=r(jc,"SPAN",{});var Cc=l(j);w(we.$$.fragment,Cc),Cc.forEach(t),jc.forEach(t),vt=u(Xa),nt=r(Xa,"SPAN",{});var zc=l(nt);wt=s(zc,"Resources"),zc.forEach(t),Xa.forEach(t),rt=u(o),G=r(o,"P",{});var Jc=l(G);pe=s(Jc,`A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with OPT. If you\u2019re
interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it.
The resource should ideally demonstrate something new instead of duplicating an existing resource.`),Jc.forEach(t),lt=u(o),w(Me.$$.fragment,o),ee=u(o),U=r(o,"UL",{});var qe=l(U);ke=r(qe,"LI",{});var Ha=l(ke);st=s(Ha,"A notebook on "),$e=r(Ha,"A",{href:!0,rel:!0});var xc=l($e);Pe=s(xc,"fine-tuning OPT with PEFT, bitsandbytes, and Transformers"),xc.forEach(t),Mt=s(Ha,". \u{1F30E}"),Ha.forEach(t),Or=u(qe),Fo=r(qe,"LI",{});var Ya=l(Fo);Er=s(Ya,"A blog post on "),Oo=r(Ya,"A",{href:!0,rel:!0});var Uc=l(Oo);jr=s(Uc,"decoding strategies with OPT"),Uc.forEach(t),Cr=s(Ya,"."),Ya.forEach(t),zr=u(qe),Xn=r(qe,"LI",{});var yc=l(Xn);Eo=r(yc,"A",{href:!0,rel:!0});var Ic=l(Eo);Jr=s(Ic,"Causal language modeling"),Ic.forEach(t),xr=s(yc," chapter of the \u{1F917} Hugging Face Course."),yc.forEach(t),Ur=u(qe),it=r(qe,"LI",{});var Sn=l(it);Hn=r(Sn,"A",{href:!0});var Zc=l(Hn);Ir=s(Zc,"OPTForCausalLM"),Zc.forEach(t),Zr=s(Sn," is supported by this "),jo=r(Sn,"A",{href:!0,rel:!0});var Wc=l(jo);Wr=s(Wc,"causal language modeling example script"),Wc.forEach(t),qr=s(Sn," and "),Co=r(Sn,"A",{href:!0,rel:!0});var qc=l(Co);Ar=s(qc,"notebook"),qc.forEach(t),Nr=s(Sn,"."),Sn.forEach(t),Gr=u(qe),dt=r(qe,"LI",{});var Ln=l(dt);Yn=r(Ln,"A",{href:!0});var Ac=l(Yn);Br=s(Ac,"TFOPTForCausalLM"),Ac.forEach(t),Vr=s(Ln," is supported by this "),zo=r(Ln,"A",{href:!0,rel:!0});var Nc=l(zo);Sr=s(Nc,"causal language modeling example script"),Nc.forEach(t),Lr=s(Ln," and "),Jo=r(Ln,"A",{href:!0,rel:!0});var Gc=l(Jo);Rr=s(Gc,"notebook"),Gc.forEach(t),Qr=s(Ln,"."),Ln.forEach(t),Xr=u(qe),Gt=r(qe,"LI",{});var wa=l(Gt);Dn=r(wa,"A",{href:!0});var Bc=l(Dn);Hr=s(Bc,"FlaxOPTForCausalLM"),Bc.forEach(t),Yr=s(wa," is supported by this "),xo=r(wa,"A",{href:!0,rel:!0});var Vc=l(xo);Dr=s(Vc,"causal language modeling example script"),Vc.forEach(t),Kr=s(wa,"."),wa.forEach(t),qe.forEach(t),Ma=u(o),w(Uo.$$.fragment,o),ka=u(o),Bt=r(o,"UL",{});var Da=l(Bt);Os=r(Da,"LI",{});var Sc=l(Os);Kn=r(Sc,"A",{href:!0});var Lc=l(Kn);el=s(Lc,"Text classification task guide"),Lc.forEach(t),Sc.forEach(t),tl=u(Da),ct=r(Da,"LI",{});var Rn=l(ct);es=r(Rn,"A",{href:!0});var Rc=l(es);ol=s(Rc,"OPTForSequenceClassification"),Rc.forEach(t),nl=s(Rn," is supported by this "),Io=r(Rn,"A",{href:!0,rel:!0});var Qc=l(Io);sl=s(Qc,"example script"),Qc.forEach(t),al=s(Rn," and "),Zo=r(Rn,"A",{href:!0,rel:!0});var Xc=l(Zo);rl=s(Xc,"notebook"),Xc.forEach(t),ll=s(Rn,"."),Rn.forEach(t),Da.forEach(t),$a=u(o),w(Wo.$$.fragment,o),Pa=u(o),Vt=r(o,"UL",{});var Ka=l(Vt);pt=r(Ka,"LI",{});var Qn=l(pt);ts=r(Qn,"A",{href:!0});var Hc=l(ts);il=s(Hc,"OPTForQuestionAnswering"),Hc.forEach(t),dl=s(Qn," is supported by this "),qo=r(Qn,"A",{href:!0,rel:!0});var Yc=l(qo);cl=s(Yc,"question answering example script"),Yc.forEach(t),pl=s(Qn," and "),Ao=r(Qn,"A",{href:!0,rel:!0});var Dc=l(Ao);ul=s(Dc,"notebook"),Dc.forEach(t),hl=s(Qn,"."),Qn.forEach(t),ml=u(Ka),os=r(Ka,"LI",{});var vc=l(os);No=r(vc,"A",{href:!0,rel:!0});var Kc=l(No);fl=s(Kc,"Question answering"),Kc.forEach(t),gl=s(vc,` chapter
of the \u{1F917} Hugging Face Course.`),vc.forEach(t),Ka.forEach(t),Fa=u(o),ns=r(o,"P",{});var ep=l(ns);_l=s(ep,"\u26A1\uFE0F Inference"),ep.forEach(t),Oa=u(o),ss=r(o,"UL",{});var tp=l(ss);Go=r(tp,"LI",{});var er=l(Go);Tl=s(er,"A blog post on "),Bo=r(er,"A",{href:!0,rel:!0});var op=l(Bo);bl=s(op,"How \u{1F917} Accelerate runs very large models thanks to PyTorch"),op.forEach(t),yl=s(er," with OPT."),er.forEach(t),tp.forEach(t),Ea=u(o),kt=r(o,"H2",{class:!0});var tr=l(kt);St=r(tr,"A",{id:!0,class:!0,href:!0});var np=l(St);Es=r(np,"SPAN",{});var sp=l(Es);w(Vo.$$.fragment,sp),sp.forEach(t),np.forEach(t),vl=u(tr),js=r(tr,"SPAN",{});var ap=l(js);wl=s(ap,"OPTConfig"),ap.forEach(t),tr.forEach(t),ja=u(o),Fe=r(o,"DIV",{class:!0});var vo=l(Fe);w(So.$$.fragment,vo),Ml=u(vo),$t=r(vo,"P",{});var ys=l($t);kl=s(ys,"This is the configuration class to store the configuration of a "),as=r(ys,"A",{href:!0});var rp=l(as);$l=s(rp,"OPTModel"),rp.forEach(t),Pl=s(ys,`. It is used to instantiate a OPT 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 OPT
`),Lo=r(ys,"A",{href:!0,rel:!0});var lp=l(Lo);Fl=s(lp,"facebook/opt-350m"),lp.forEach(t),Ol=s(ys," architecture."),ys.forEach(t),El=u(vo),Pt=r(vo,"P",{});var vs=l(Pt);jl=s(vs,"Configuration objects inherit from "),rs=r(vs,"A",{href:!0});var ip=l(rs);Cl=s(ip,"PretrainedConfig"),ip.forEach(t),zl=s(vs,` and can be used to control the model outputs. Read the
documentation from `),ls=r(vs,"A",{href:!0});var dp=l(ls);Jl=s(dp,"PretrainedConfig"),dp.forEach(t),xl=s(vs," for more information."),vs.forEach(t),Ul=u(vo),w(Lt.$$.fragment,vo),vo.forEach(t),Ca=u(o),Ft=r(o,"H2",{class:!0});var or=l(Ft);Rt=r(or,"A",{id:!0,class:!0,href:!0});var cp=l(Rt);Cs=r(cp,"SPAN",{});var pp=l(Cs);w(Ro.$$.fragment,pp),pp.forEach(t),cp.forEach(t),Il=u(or),zs=r(or,"SPAN",{});var up=l(zs);Zl=s(up,"OPTModel"),up.forEach(t),or.forEach(t),za=u(o),Oe=r(o,"DIV",{class:!0});var wo=l(Oe);w(Qo.$$.fragment,wo),Wl=u(wo),Xo=r(wo,"P",{});var nr=l(Xo);ql=s(nr,`The bare OPT Model outputting raw hidden-states without any specific head on top.
This model inherits from `),is=r(nr,"A",{href:!0});var hp=l(is);Al=s(hp,"PreTrainedModel"),hp.forEach(t),Nl=s(nr,`. 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.)`),nr.forEach(t),Gl=u(wo),Ho=r(wo,"P",{});var sr=l(Ho);Bl=s(sr,"This model is also a PyTorch "),Yo=r(sr,"A",{href:!0,rel:!0});var mp=l(Yo);Vl=s(mp,"torch.nn.Module"),mp.forEach(t),Sl=s(sr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),sr.forEach(t),Ll=u(wo),Ie=r(wo,"DIV",{class:!0});var Mo=l(Ie);w(Do.$$.fragment,Mo),Rl=u(Mo),Ot=r(Mo,"P",{});var ws=l(Ot);Ql=s(ws,"The "),ds=r(ws,"A",{href:!0});var fp=l(ds);Xl=s(fp,"OPTModel"),fp.forEach(t),Hl=s(ws," forward method, overrides the "),Js=r(ws,"CODE",{});var gp=l(Js);Yl=s(gp,"__call__"),gp.forEach(t),Dl=s(ws," special method."),ws.forEach(t),Kl=u(Mo),w(Qt.$$.fragment,Mo),ei=u(Mo),w(Xt.$$.fragment,Mo),Mo.forEach(t),wo.forEach(t),Ja=u(o),Et=r(o,"H2",{class:!0});var ar=l(Et);Ht=r(ar,"A",{id:!0,class:!0,href:!0});var _p=l(Ht);xs=r(_p,"SPAN",{});var Tp=l(xs);w(Ko.$$.fragment,Tp),Tp.forEach(t),_p.forEach(t),ti=u(ar),Us=r(ar,"SPAN",{});var bp=l(Us);oi=s(bp,"OPTForCausalLM"),bp.forEach(t),ar.forEach(t),xa=u(o),jt=r(o,"DIV",{class:!0});var rr=l(jt);w(en.$$.fragment,rr),ni=u(rr),Yt=r(rr,"DIV",{class:!0});var lr=l(Yt);w(tn.$$.fragment,lr),si=u(lr),w(Dt.$$.fragment,lr),lr.forEach(t),rr.forEach(t),Ua=u(o),Ct=r(o,"H2",{class:!0});var ir=l(Ct);Kt=r(ir,"A",{id:!0,class:!0,href:!0});var yp=l(Kt);Is=r(yp,"SPAN",{});var vp=l(Is);w(on.$$.fragment,vp),vp.forEach(t),yp.forEach(t),ai=u(ir),Zs=r(ir,"SPAN",{});var wp=l(Zs);ri=s(wp,"TFOPTModel"),wp.forEach(t),ir.forEach(t),Ia=u(o),ue=r(o,"DIV",{class:!0});var ht=l(ue);w(nn.$$.fragment,ht),li=u(ht),sn=r(ht,"P",{});var dr=l(sn);ii=s(dr,`The bare TF OPT Model outputting raw hidden-states without any specific head on top.
This model inherits from `),cs=r(dr,"A",{href:!0});var Mp=l(cs);di=s(Mp,"TFPreTrainedModel"),Mp.forEach(t),ci=s(dr,`. 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.)`),dr.forEach(t),pi=u(ht),an=r(ht,"P",{});var cr=l(an);ui=s(cr,"This model is also a "),rn=r(cr,"A",{href:!0,rel:!0});var kp=l(rn);hi=s(kp,"tf.keras.Model"),kp.forEach(t),mi=s(cr,` 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.`),cr.forEach(t),fi=u(ht),w(eo.$$.fragment,ht),gi=u(ht),Ze=r(ht,"DIV",{class:!0});var ko=l(Ze);w(ln.$$.fragment,ko),_i=u(ko),zt=r(ko,"P",{});var Ms=l(zt);Ti=s(Ms,"The "),ps=r(Ms,"A",{href:!0});var $p=l(ps);bi=s($p,"TFOPTModel"),$p.forEach(t),yi=s(Ms," forward method, overrides the "),Ws=r(Ms,"CODE",{});var Pp=l(Ws);vi=s(Pp,"__call__"),Pp.forEach(t),wi=s(Ms," special method."),Ms.forEach(t),Mi=u(ko),w(to.$$.fragment,ko),ki=u(ko),w(oo.$$.fragment,ko),ko.forEach(t),ht.forEach(t),Za=u(o),Jt=r(o,"H2",{class:!0});var pr=l(Jt);no=r(pr,"A",{id:!0,class:!0,href:!0});var Fp=l(no);qs=r(Fp,"SPAN",{});var Op=l(qs);w(dn.$$.fragment,Op),Op.forEach(t),Fp.forEach(t),$i=u(pr),As=r(pr,"SPAN",{});var Ep=l(As);Pi=s(Ep,"TFOPTForCausalLM"),Ep.forEach(t),pr.forEach(t),Wa=u(o),Y=r(o,"DIV",{class:!0});var Ae=l(Y);w(cn.$$.fragment,Ae),Fi=u(Ae),Ns=r(Ae,"P",{});var jp=l(Ns);Oi=s(jp,"The OPT Model transformer with a language modeling head on top."),jp.forEach(t),Ei=u(Ae),pn=r(Ae,"P",{});var ur=l(pn);ji=s(ur,"This model inherits from "),us=r(ur,"A",{href:!0});var Cp=l(us);Ci=s(Cp,"TFPreTrainedModel"),Cp.forEach(t),zi=s(ur,`. 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.forEach(t),Ji=u(Ae),un=r(Ae,"P",{});var hr=l(un);xi=s(hr,"This model is also a "),hn=r(hr,"A",{href:!0,rel:!0});var zp=l(hn);Ui=s(zp,"tf.keras.Model"),zp.forEach(t),Ii=s(hr,` 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.forEach(t),Zi=u(Ae),w(so.$$.fragment,Ae),Wi=u(Ae),ao=r(Ae,"DIV",{class:!0});var mr=l(ao);w(mn.$$.fragment,mr),qi=u(mr),w(ro.$$.fragment,mr),mr.forEach(t),Ae.forEach(t),qa=u(o),xt=r(o,"H2",{class:!0});var fr=l(xt);lo=r(fr,"A",{id:!0,class:!0,href:!0});var Jp=l(lo);Gs=r(Jp,"SPAN",{});var xp=l(Gs);w(fn.$$.fragment,xp),xp.forEach(t),Jp.forEach(t),Ai=u(fr),Bs=r(fr,"SPAN",{});var Up=l(Bs);Ni=s(Up,"OPTForSequenceClassification"),Up.forEach(t),fr.forEach(t),Aa=u(o),B=r(o,"DIV",{class:!0});var Te=l(B);w(gn.$$.fragment,Te),Gi=u(Te),Vs=r(Te,"P",{});var Ip=l(Vs);Bi=s(Ip,"The OPT Model transformer with a sequence classification head on top (linear layer)."),Ip.forEach(t),Vi=u(Te),hs=r(Te,"P",{});var wc=l(hs);ms=r(wc,"A",{href:!0});var Zp=l(ms);Si=s(Zp,"OPTForSequenceClassification"),Zp.forEach(t),Li=s(wc,` uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`),wc.forEach(t),Ri=u(Te),Ee=r(Te,"P",{});var mt=l(Ee);Qi=s(mt,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),Ss=r(mt,"CODE",{});var Wp=l(Ss);Xi=s(Wp,"pad_token_id"),Wp.forEach(t),Hi=s(mt,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Ls=r(mt,"CODE",{});var qp=l(Ls);Yi=s(qp,"pad_token_id"),qp.forEach(t),Di=s(mt,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),Rs=r(mt,"CODE",{});var Ap=l(Rs);Ki=s(Ap,"inputs_embeds"),Ap.forEach(t),ed=s(mt," are passed instead of "),Qs=r(mt,"CODE",{});var Np=l(Qs);td=s(Np,"input_ids"),Np.forEach(t),od=s(mt,`, it does the same (take the last value in
each row of the batch).`),mt.forEach(t),nd=u(Te),_n=r(Te,"P",{});var gr=l(_n);sd=s(gr,"This model inherits from "),fs=r(gr,"A",{href:!0});var Gp=l(fs);ad=s(Gp,"PreTrainedModel"),Gp.forEach(t),rd=s(gr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),gr.forEach(t),ld=u(Te),Tn=r(Te,"P",{});var _r=l(Tn);id=s(_r,"This model is also a PyTorch "),bn=r(_r,"A",{href:!0,rel:!0});var Bp=l(bn);dd=s(Bp,"torch.nn.Module"),Bp.forEach(t),cd=s(_r,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_r.forEach(t),pd=u(Te),_e=r(Te,"DIV",{class:!0});var ft=l(_e);w(yn.$$.fragment,ft),ud=u(ft),Ut=r(ft,"P",{});var ks=l(Ut);hd=s(ks,"The "),gs=r(ks,"A",{href:!0});var Vp=l(gs);md=s(Vp,"OPTForSequenceClassification"),Vp.forEach(t),fd=s(ks," forward method, overrides the "),Xs=r(ks,"CODE",{});var Sp=l(Xs);gd=s(Sp,"__call__"),Sp.forEach(t),_d=s(ks," special method."),ks.forEach(t),Td=u(ft),w(io.$$.fragment,ft),bd=u(ft),w(co.$$.fragment,ft),yd=u(ft),w(po.$$.fragment,ft),ft.forEach(t),Te.forEach(t),Na=u(o),It=r(o,"H2",{class:!0});var Tr=l(It);uo=r(Tr,"A",{id:!0,class:!0,href:!0});var Lp=l(uo);Hs=r(Lp,"SPAN",{});var Rp=l(Hs);w(vn.$$.fragment,Rp),Rp.forEach(t),Lp.forEach(t),vd=u(Tr),Ys=r(Tr,"SPAN",{});var Qp=l(Ys);wd=s(Qp,"OPTForQuestionAnswering"),Qp.forEach(t),Tr.forEach(t),Ga=u(o),he=r(o,"DIV",{class:!0});var gt=l(he);w(wn.$$.fragment,gt),Md=u(gt),Zt=r(gt,"P",{});var $s=l(Zt);kd=s($s,`The OPT Model transformer with a span classification head on top for extractive question-answering tasks like SQuAD
(a linear layers on top of the hidden-states output to compute `),Ds=r($s,"CODE",{});var Xp=l(Ds);$d=s(Xp,"span start logits"),Xp.forEach(t),Pd=s($s," and "),Ks=r($s,"CODE",{});var Hp=l(Ks);Fd=s(Hp,"span end logits"),Hp.forEach(t),Od=s($s,")."),$s.forEach(t),Ed=u(gt),Mn=r(gt,"P",{});var br=l(Mn);jd=s(br,"This model inherits from "),_s=r(br,"A",{href:!0});var Yp=l(_s);Cd=s(Yp,"PreTrainedModel"),Yp.forEach(t),zd=s(br,`. 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.)`),br.forEach(t),Jd=u(gt),kn=r(gt,"P",{});var yr=l(kn);xd=s(yr,"This model is also a PyTorch "),$n=r(yr,"A",{href:!0,rel:!0});var Dp=l($n);Ud=s(Dp,"torch.nn.Module"),Dp.forEach(t),Id=s(yr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),yr.forEach(t),Zd=u(gt),We=r(gt,"DIV",{class:!0});var $o=l(We);w(Pn.$$.fragment,$o),Wd=u($o),Wt=r($o,"P",{});var Ps=l(Wt);qd=s(Ps,"The "),Ts=r(Ps,"A",{href:!0});var Kp=l(Ts);Ad=s(Kp,"OPTForQuestionAnswering"),Kp.forEach(t),Nd=s(Ps," forward method, overrides the "),ea=r(Ps,"CODE",{});var eu=l(ea);Gd=s(eu,"__call__"),eu.forEach(t),Bd=s(Ps," special method."),Ps.forEach(t),Vd=u($o),w(ho.$$.fragment,$o),Sd=u($o),w(mo.$$.fragment,$o),$o.forEach(t),gt.forEach(t),Ba=u(o),qt=r(o,"H2",{class:!0});var vr=l(qt);fo=r(vr,"A",{id:!0,class:!0,href:!0});var tu=l(fo);ta=r(tu,"SPAN",{});var ou=l(ta);w(Fn.$$.fragment,ou),ou.forEach(t),tu.forEach(t),Ld=u(vr),oa=r(vr,"SPAN",{});var nu=l(oa);Rd=s(nu,"FlaxOPTModel"),nu.forEach(t),vr.forEach(t),Va=u(o),At=r(o,"DIV",{class:!0});var wr=l(At);w(On.$$.fragment,wr),Qd=u(wr),go=r(wr,"DIV",{class:!0});var Mr=l(go);w(En.$$.fragment,Mr),Xd=u(Mr),w(_o.$$.fragment,Mr),Mr.forEach(t),wr.forEach(t),Sa=u(o),Nt=r(o,"H2",{class:!0});var kr=l(Nt);To=r(kr,"A",{id:!0,class:!0,href:!0});var su=l(To);na=r(su,"SPAN",{});var au=l(na);w(jn.$$.fragment,au),au.forEach(t),su.forEach(t),Hd=u(kr),sa=r(kr,"SPAN",{});var ru=l(sa);Yd=s(ru,"FlaxOPTForCausalLM"),ru.forEach(t),kr.forEach(t),La=u(o),V=r(o,"DIV",{class:!0});var be=l(V);w(Cn.$$.fragment,be),Dd=u(be),aa=r(be,"P",{});var lu=l(aa);Kd=s(lu,`OPT Model with a language modeling head on top (linear layer with weights tied to the input embeddings) e.g for
autoregressive tasks.`),lu.forEach(t),ec=u(be),zn=r(be,"P",{});var $r=l(zn);tc=s($r,"This model inherits from "),bs=r($r,"A",{href:!0});var iu=l(bs);oc=s(iu,"FlaxPreTrainedModel"),iu.forEach(t),nc=s($r,`. 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.)`),$r.forEach(t),sc=u(be),Jn=r(be,"P",{});var Pr=l(Jn);ac=s(Pr,`This model is also a Flax Linen
`),xn=r(Pr,"A",{href:!0,rel:!0});var du=l(xn);rc=s(du,"flax.nn.Module"),du.forEach(t),lc=s(Pr,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Pr.forEach(t),ic=u(be),ra=r(be,"P",{});var cu=l(ra);dc=s(cu,"Finally, this model supports inherent JAX features such as:"),cu.forEach(t),cc=u(be),at=r(be,"UL",{});var Po=l(at);la=r(Po,"LI",{});var pu=l(la);Un=r(pu,"A",{href:!0,rel:!0});var uu=l(Un);pc=s(uu,"Just-In-Time (JIT) compilation"),uu.forEach(t),pu.forEach(t),uc=u(Po),ia=r(Po,"LI",{});var hu=l(ia);In=r(hu,"A",{href:!0,rel:!0});var mu=l(In);hc=s(mu,"Automatic Differentiation"),mu.forEach(t),hu.forEach(t),mc=u(Po),da=r(Po,"LI",{});var fu=l(da);Zn=r(fu,"A",{href:!0,rel:!0});var gu=l(Zn);fc=s(gu,"Vectorization"),gu.forEach(t),fu.forEach(t),gc=u(Po),ca=r(Po,"LI",{});var _u=l(ca);Wn=r(_u,"A",{href:!0,rel:!0});var Tu=l(Wn);_c=s(Tu,"Parallelization"),Tu.forEach(t),_u.forEach(t),Po.forEach(t),Tc=u(be),bo=r(be,"DIV",{class:!0});var Fr=l(bo);w(qn.$$.fragment,Fr),bc=u(Fr),w(yo.$$.fragment,Fr),Fr.forEach(t),be.forEach(t),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(Nu)),d(m,"id","opt"),d(m,"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"),d(m,"href","#opt"),d(_,"class","relative group"),d(K,"id","overview"),d(K,"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"),d(K,"href","#overview"),d(I,"class","relative group"),d(oe,"href","https://arxiv.org/pdf/2205.01068"),d(oe,"rel","nofollow"),d(ie,"href","https://huggingface.co/ArthurZ"),d(ie,"rel","nofollow"),d(H,"href","https://huggingface.co/ybelkada"),d(H,"rel","nofollow"),d(J,"href","https://huggingface.co/patrickvonplaten"),d(J,"rel","nofollow"),d(y,"href","https://github.com/facebookresearch/metaseq"),d(y,"rel","nofollow"),d(ge,"id","resources"),d(ge,"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"),d(ge,"href","#resources"),d(ce,"class","relative group"),d($e,"href","https://colab.research.google.com/drive/1jCkpikz0J2o20FBQmYmAGdiKmJGOMo-o?usp=sharing"),d($e,"rel","nofollow"),d(Oo,"href","https://huggingface.co/blog/introducing-csearch#62-example-two---opt"),d(Oo,"rel","nofollow"),d(Eo,"href","https://huggingface.co/course/en/chapter7/6?fw=pt#training-a-causal-language-model-from-scratch"),d(Eo,"rel","nofollow"),d(Hn,"href","/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTForCausalLM"),d(jo,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/language-modeling#gpt-2gpt-and-causal-language-modeling"),d(jo,"rel","nofollow"),d(Co,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb"),d(Co,"rel","nofollow"),d(Yn,"href","/docs/transformers/v4.30.0/en/model_doc/opt#transformers.TFOPTForCausalLM"),d(zo,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/language-modeling#run_clmpy"),d(zo,"rel","nofollow"),d(Jo,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb"),d(Jo,"rel","nofollow"),d(Dn,"href","/docs/transformers/v4.30.0/en/model_doc/opt#transformers.FlaxOPTForCausalLM"),d(xo,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/language-modeling#causal-language-modeling"),d(xo,"rel","nofollow"),d(Kn,"href","sequence_classification.mdx"),d(es,"href","/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTForSequenceClassification"),d(Io,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/text-classification"),d(Io,"rel","nofollow"),d(Zo,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification.ipynb"),d(Zo,"rel","nofollow"),d(ts,"href","/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTForQuestionAnswering"),d(qo,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/question-answering"),d(qo,"rel","nofollow"),d(Ao,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/question_answering.ipynb"),d(Ao,"rel","nofollow"),d(No,"href","https://huggingface.co/course/chapter7/7?fw=pt"),d(No,"rel","nofollow"),d(Bo,"href","https://huggingface.co/blog/accelerate-large-models"),d(Bo,"rel","nofollow"),d(St,"id","transformers.OPTConfig"),d(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"),d(St,"href","#transformers.OPTConfig"),d(kt,"class","relative group"),d(as,"href","/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTModel"),d(Lo,"href","https://huggingface.co/facebook/opt-350m"),d(Lo,"rel","nofollow"),d(rs,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(ls,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Rt,"id","transformers.OPTModel"),d(Rt,"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"),d(Rt,"href","#transformers.OPTModel"),d(Ft,"class","relative group"),d(is,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel"),d(Yo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Yo,"rel","nofollow"),d(ds,"href","/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTModel"),d(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ht,"id","transformers.OPTForCausalLM"),d(Ht,"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"),d(Ht,"href","#transformers.OPTForCausalLM"),d(Et,"class","relative group"),d(Yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Kt,"id","transformers.TFOPTModel"),d(Kt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Kt,"href","#transformers.TFOPTModel"),d(Ct,"class","relative group"),d(cs,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.TFPreTrainedModel"),d(rn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(rn,"rel","nofollow"),d(ps,"href","/docs/transformers/v4.30.0/en/model_doc/opt#transformers.TFOPTModel"),d(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(no,"id","transformers.TFOPTForCausalLM"),d(no,"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"),d(no,"href","#transformers.TFOPTForCausalLM"),d(Jt,"class","relative group"),d(us,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.TFPreTrainedModel"),d(hn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(hn,"rel","nofollow"),d(ao,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(lo,"id","transformers.OPTForSequenceClassification"),d(lo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(lo,"href","#transformers.OPTForSequenceClassification"),d(xt,"class","relative group"),d(ms,"href","/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTForSequenceClassification"),d(fs,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel"),d(bn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(bn,"rel","nofollow"),d(gs,"href","/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTForSequenceClassification"),d(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(uo,"id","transformers.OPTForQuestionAnswering"),d(uo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(uo,"href","#transformers.OPTForQuestionAnswering"),d(It,"class","relative group"),d(_s,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel"),d($n,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d($n,"rel","nofollow"),d(Ts,"href","/docs/transformers/v4.30.0/en/model_doc/opt#transformers.OPTForQuestionAnswering"),d(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(fo,"id","transformers.FlaxOPTModel"),d(fo,"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"),d(fo,"href","#transformers.FlaxOPTModel"),d(qt,"class","relative group"),d(go,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(To,"id","transformers.FlaxOPTForCausalLM"),d(To,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(To,"href","#transformers.FlaxOPTForCausalLM"),d(Nt,"class","relative group"),d(bs,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(xn,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),d(xn,"rel","nofollow"),d(Un,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(Un,"rel","nofollow"),d(In,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(In,"rel","nofollow"),d(Zn,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(Zn,"rel","nofollow"),d(Wn,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(Wn,"rel","nofollow"),d(bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,g){e(document.head,c),f(o,b,g),f(o,_,g),e(_,m),e(m,T),M(i,T,null),e(_,h),e(_,C),e(C,Ge),f(o,je,g),f(o,I,g),e(I,K),e(K,te),M(F,te,null),e(I,Be),e(I,R),e(R,Ve),f(o,Ce,g),f(o,A,g),e(A,Se),e(A,oe),e(oe,ne),e(A,Le),f(o,ze,g),f(o,S,g),e(S,Re),f(o,Je,g),f(o,L,g),e(L,ye),e(ye,Qe),f(o,me,g),f(o,z,g),e(z,Z),f(o,xe,g),f(o,N,g),e(N,se),e(se,Xe),e(se,Q),e(Q,He),e(se,Ye),e(N,W),e(N,ae),e(ae,re),e(ae,ve),e(ve,De),e(ae,le),f(o,Ue,g),f(o,x,g),e(x,X),e(x,ie),e(ie,de),e(x,Ke),e(x,H),e(H,q),e(x,et),e(x,J),e(J,tt),e(x,ot),e(x,y),e(y,E),e(x,yt),f(o,fe,g),f(o,ce,g),e(ce,ge),e(ge,j),M(we,j,null),e(ce,vt),e(ce,nt),e(nt,wt),f(o,rt,g),f(o,G,g),e(G,pe),f(o,lt,g),M(Me,o,g),f(o,ee,g),f(o,U,g),e(U,ke),e(ke,st),e(ke,$e),e($e,Pe),e(ke,Mt),e(U,Or),e(U,Fo),e(Fo,Er),e(Fo,Oo),e(Oo,jr),e(Fo,Cr),e(U,zr),e(U,Xn),e(Xn,Eo),e(Eo,Jr),e(Xn,xr),e(U,Ur),e(U,it),e(it,Hn),e(Hn,Ir),e(it,Zr),e(it,jo),e(jo,Wr),e(it,qr),e(it,Co),e(Co,Ar),e(it,Nr),e(U,Gr),e(U,dt),e(dt,Yn),e(Yn,Br),e(dt,Vr),e(dt,zo),e(zo,Sr),e(dt,Lr),e(dt,Jo),e(Jo,Rr),e(dt,Qr),e(U,Xr),e(U,Gt),e(Gt,Dn),e(Dn,Hr),e(Gt,Yr),e(Gt,xo),e(xo,Dr),e(Gt,Kr),f(o,Ma,g),M(Uo,o,g),f(o,ka,g),f(o,Bt,g),e(Bt,Os),e(Os,Kn),e(Kn,el),e(Bt,tl),e(Bt,ct),e(ct,es),e(es,ol),e(ct,nl),e(ct,Io),e(Io,sl),e(ct,al),e(ct,Zo),e(Zo,rl),e(ct,ll),f(o,$a,g),M(Wo,o,g),f(o,Pa,g),f(o,Vt,g),e(Vt,pt),e(pt,ts),e(ts,il),e(pt,dl),e(pt,qo),e(qo,cl),e(pt,pl),e(pt,Ao),e(Ao,ul),e(pt,hl),e(Vt,ml),e(Vt,os),e(os,No),e(No,fl),e(os,gl),f(o,Fa,g),f(o,ns,g),e(ns,_l),f(o,Oa,g),f(o,ss,g),e(ss,Go),e(Go,Tl),e(Go,Bo),e(Bo,bl),e(Go,yl),f(o,Ea,g),f(o,kt,g),e(kt,St),e(St,Es),M(Vo,Es,null),e(kt,vl),e(kt,js),e(js,wl),f(o,ja,g),f(o,Fe,g),M(So,Fe,null),e(Fe,Ml),e(Fe,$t),e($t,kl),e($t,as),e(as,$l),e($t,Pl),e($t,Lo),e(Lo,Fl),e($t,Ol),e(Fe,El),e(Fe,Pt),e(Pt,jl),e(Pt,rs),e(rs,Cl),e(Pt,zl),e(Pt,ls),e(ls,Jl),e(Pt,xl),e(Fe,Ul),M(Lt,Fe,null),f(o,Ca,g),f(o,Ft,g),e(Ft,Rt),e(Rt,Cs),M(Ro,Cs,null),e(Ft,Il),e(Ft,zs),e(zs,Zl),f(o,za,g),f(o,Oe,g),M(Qo,Oe,null),e(Oe,Wl),e(Oe,Xo),e(Xo,ql),e(Xo,is),e(is,Al),e(Xo,Nl),e(Oe,Gl),e(Oe,Ho),e(Ho,Bl),e(Ho,Yo),e(Yo,Vl),e(Ho,Sl),e(Oe,Ll),e(Oe,Ie),M(Do,Ie,null),e(Ie,Rl),e(Ie,Ot),e(Ot,Ql),e(Ot,ds),e(ds,Xl),e(Ot,Hl),e(Ot,Js),e(Js,Yl),e(Ot,Dl),e(Ie,Kl),M(Qt,Ie,null),e(Ie,ei),M(Xt,Ie,null),f(o,Ja,g),f(o,Et,g),e(Et,Ht),e(Ht,xs),M(Ko,xs,null),e(Et,ti),e(Et,Us),e(Us,oi),f(o,xa,g),f(o,jt,g),M(en,jt,null),e(jt,ni),e(jt,Yt),M(tn,Yt,null),e(Yt,si),M(Dt,Yt,null),f(o,Ua,g),f(o,Ct,g),e(Ct,Kt),e(Kt,Is),M(on,Is,null),e(Ct,ai),e(Ct,Zs),e(Zs,ri),f(o,Ia,g),f(o,ue,g),M(nn,ue,null),e(ue,li),e(ue,sn),e(sn,ii),e(sn,cs),e(cs,di),e(sn,ci),e(ue,pi),e(ue,an),e(an,ui),e(an,rn),e(rn,hi),e(an,mi),e(ue,fi),M(eo,ue,null),e(ue,gi),e(ue,Ze),M(ln,Ze,null),e(Ze,_i),e(Ze,zt),e(zt,Ti),e(zt,ps),e(ps,bi),e(zt,yi),e(zt,Ws),e(Ws,vi),e(zt,wi),e(Ze,Mi),M(to,Ze,null),e(Ze,ki),M(oo,Ze,null),f(o,Za,g),f(o,Jt,g),e(Jt,no),e(no,qs),M(dn,qs,null),e(Jt,$i),e(Jt,As),e(As,Pi),f(o,Wa,g),f(o,Y,g),M(cn,Y,null),e(Y,Fi),e(Y,Ns),e(Ns,Oi),e(Y,Ei),e(Y,pn),e(pn,ji),e(pn,us),e(us,Ci),e(pn,zi),e(Y,Ji),e(Y,un),e(un,xi),e(un,hn),e(hn,Ui),e(un,Ii),e(Y,Zi),M(so,Y,null),e(Y,Wi),e(Y,ao),M(mn,ao,null),e(ao,qi),M(ro,ao,null),f(o,qa,g),f(o,xt,g),e(xt,lo),e(lo,Gs),M(fn,Gs,null),e(xt,Ai),e(xt,Bs),e(Bs,Ni),f(o,Aa,g),f(o,B,g),M(gn,B,null),e(B,Gi),e(B,Vs),e(Vs,Bi),e(B,Vi),e(B,hs),e(hs,ms),e(ms,Si),e(hs,Li),e(B,Ri),e(B,Ee),e(Ee,Qi),e(Ee,Ss),e(Ss,Xi),e(Ee,Hi),e(Ee,Ls),e(Ls,Yi),e(Ee,Di),e(Ee,Rs),e(Rs,Ki),e(Ee,ed),e(Ee,Qs),e(Qs,td),e(Ee,od),e(B,nd),e(B,_n),e(_n,sd),e(_n,fs),e(fs,ad),e(_n,rd),e(B,ld),e(B,Tn),e(Tn,id),e(Tn,bn),e(bn,dd),e(Tn,cd),e(B,pd),e(B,_e),M(yn,_e,null),e(_e,ud),e(_e,Ut),e(Ut,hd),e(Ut,gs),e(gs,md),e(Ut,fd),e(Ut,Xs),e(Xs,gd),e(Ut,_d),e(_e,Td),M(io,_e,null),e(_e,bd),M(co,_e,null),e(_e,yd),M(po,_e,null),f(o,Na,g),f(o,It,g),e(It,uo),e(uo,Hs),M(vn,Hs,null),e(It,vd),e(It,Ys),e(Ys,wd),f(o,Ga,g),f(o,he,g),M(wn,he,null),e(he,Md),e(he,Zt),e(Zt,kd),e(Zt,Ds),e(Ds,$d),e(Zt,Pd),e(Zt,Ks),e(Ks,Fd),e(Zt,Od),e(he,Ed),e(he,Mn),e(Mn,jd),e(Mn,_s),e(_s,Cd),e(Mn,zd),e(he,Jd),e(he,kn),e(kn,xd),e(kn,$n),e($n,Ud),e(kn,Id),e(he,Zd),e(he,We),M(Pn,We,null),e(We,Wd),e(We,Wt),e(Wt,qd),e(Wt,Ts),e(Ts,Ad),e(Wt,Nd),e(Wt,ea),e(ea,Gd),e(Wt,Bd),e(We,Vd),M(ho,We,null),e(We,Sd),M(mo,We,null),f(o,Ba,g),f(o,qt,g),e(qt,fo),e(fo,ta),M(Fn,ta,null),e(qt,Ld),e(qt,oa),e(oa,Rd),f(o,Va,g),f(o,At,g),M(On,At,null),e(At,Qd),e(At,go),M(En,go,null),e(go,Xd),M(_o,go,null),f(o,Sa,g),f(o,Nt,g),e(Nt,To),e(To,na),M(jn,na,null),e(Nt,Hd),e(Nt,sa),e(sa,Yd),f(o,La,g),f(o,V,g),M(Cn,V,null),e(V,Dd),e(V,aa),e(aa,Kd),e(V,ec),e(V,zn),e(zn,tc),e(zn,bs),e(bs,oc),e(zn,nc),e(V,sc),e(V,Jn),e(Jn,ac),e(Jn,xn),e(xn,rc),e(Jn,lc),e(V,ic),e(V,ra),e(ra,dc),e(V,cc),e(V,at),e(at,la),e(la,Un),e(Un,pc),e(at,uc),e(at,ia),e(ia,In),e(In,hc),e(at,mc),e(at,da),e(da,Zn),e(Zn,fc),e(at,gc),e(at,ca),e(ca,Wn),e(Wn,_c),e(V,Tc),e(V,bo),M(qn,bo,null),e(bo,bc),M(yo,bo,null),Ra=!0},p(o,[g]){const An={};g&2&&(An.$$scope={dirty:g,ctx:o}),Lt.$set(An);const pa={};g&2&&(pa.$$scope={dirty:g,ctx:o}),Qt.$set(pa);const ua={};g&2&&(ua.$$scope={dirty:g,ctx:o}),Xt.$set(ua);const ha={};g&2&&(ha.$$scope={dirty:g,ctx:o}),Dt.$set(ha);const Nn={};g&2&&(Nn.$$scope={dirty:g,ctx:o}),eo.$set(Nn);const ma={};g&2&&(ma.$$scope={dirty:g,ctx:o}),to.$set(ma);const fa={};g&2&&(fa.$$scope={dirty:g,ctx:o}),oo.$set(fa);const ga={};g&2&&(ga.$$scope={dirty:g,ctx:o}),so.$set(ga);const Gn={};g&2&&(Gn.$$scope={dirty:g,ctx:o}),ro.$set(Gn);const _a={};g&2&&(_a.$$scope={dirty:g,ctx:o}),io.$set(_a);const Ta={};g&2&&(Ta.$$scope={dirty:g,ctx:o}),co.$set(Ta);const ba={};g&2&&(ba.$$scope={dirty:g,ctx:o}),po.$set(ba);const ya={};g&2&&(ya.$$scope={dirty:g,ctx:o}),ho.$set(ya);const va={};g&2&&(va.$$scope={dirty:g,ctx:o}),mo.$set(va);const Bn={};g&2&&(Bn.$$scope={dirty:g,ctx:o}),_o.$set(Bn);const Vn={};g&2&&(Vn.$$scope={dirty:g,ctx:o}),yo.$set(Vn)},i(o){Ra||(k(i.$$.fragment,o),k(F.$$.fragment,o),k(we.$$.fragment,o),k(Me.$$.fragment,o),k(Uo.$$.fragment,o),k(Wo.$$.fragment,o),k(Vo.$$.fragment,o),k(So.$$.fragment,o),k(Lt.$$.fragment,o),k(Ro.$$.fragment,o),k(Qo.$$.fragment,o),k(Do.$$.fragment,o),k(Qt.$$.fragment,o),k(Xt.$$.fragment,o),k(Ko.$$.fragment,o),k(en.$$.fragment,o),k(tn.$$.fragment,o),k(Dt.$$.fragment,o),k(on.$$.fragment,o),k(nn.$$.fragment,o),k(eo.$$.fragment,o),k(ln.$$.fragment,o),k(to.$$.fragment,o),k(oo.$$.fragment,o),k(dn.$$.fragment,o),k(cn.$$.fragment,o),k(so.$$.fragment,o),k(mn.$$.fragment,o),k(ro.$$.fragment,o),k(fn.$$.fragment,o),k(gn.$$.fragment,o),k(yn.$$.fragment,o),k(io.$$.fragment,o),k(co.$$.fragment,o),k(po.$$.fragment,o),k(vn.$$.fragment,o),k(wn.$$.fragment,o),k(Pn.$$.fragment,o),k(ho.$$.fragment,o),k(mo.$$.fragment,o),k(Fn.$$.fragment,o),k(On.$$.fragment,o),k(En.$$.fragment,o),k(_o.$$.fragment,o),k(jn.$$.fragment,o),k(Cn.$$.fragment,o),k(qn.$$.fragment,o),k(yo.$$.fragment,o),Ra=!0)},o(o){$(i.$$.fragment,o),$(F.$$.fragment,o),$(we.$$.fragment,o),$(Me.$$.fragment,o),$(Uo.$$.fragment,o),$(Wo.$$.fragment,o),$(Vo.$$.fragment,o),$(So.$$.fragment,o),$(Lt.$$.fragment,o),$(Ro.$$.fragment,o),$(Qo.$$.fragment,o),$(Do.$$.fragment,o),$(Qt.$$.fragment,o),$(Xt.$$.fragment,o),$(Ko.$$.fragment,o),$(en.$$.fragment,o),$(tn.$$.fragment,o),$(Dt.$$.fragment,o),$(on.$$.fragment,o),$(nn.$$.fragment,o),$(eo.$$.fragment,o),$(ln.$$.fragment,o),$(to.$$.fragment,o),$(oo.$$.fragment,o),$(dn.$$.fragment,o),$(cn.$$.fragment,o),$(so.$$.fragment,o),$(mn.$$.fragment,o),$(ro.$$.fragment,o),$(fn.$$.fragment,o),$(gn.$$.fragment,o),$(yn.$$.fragment,o),$(io.$$.fragment,o),$(co.$$.fragment,o),$(po.$$.fragment,o),$(vn.$$.fragment,o),$(wn.$$.fragment,o),$(Pn.$$.fragment,o),$(ho.$$.fragment,o),$(mo.$$.fragment,o),$(Fn.$$.fragment,o),$(On.$$.fragment,o),$(En.$$.fragment,o),$(_o.$$.fragment,o),$(jn.$$.fragment,o),$(Cn.$$.fragment,o),$(qn.$$.fragment,o),$(yo.$$.fragment,o),Ra=!1},d(o){t(c),o&&t(b),o&&t(_),P(i),o&&t(je),o&&t(I),P(F),o&&t(Ce),o&&t(A),o&&t(ze),o&&t(S),o&&t(Je),o&&t(L),o&&t(me),o&&t(z),o&&t(xe),o&&t(N),o&&t(Ue),o&&t(x),o&&t(fe),o&&t(ce),P(we),o&&t(rt),o&&t(G),o&&t(lt),P(Me,o),o&&t(ee),o&&t(U),o&&t(Ma),P(Uo,o),o&&t(ka),o&&t(Bt),o&&t($a),P(Wo,o),o&&t(Pa),o&&t(Vt),o&&t(Fa),o&&t(ns),o&&t(Oa),o&&t(ss),o&&t(Ea),o&&t(kt),P(Vo),o&&t(ja),o&&t(Fe),P(So),P(Lt),o&&t(Ca),o&&t(Ft),P(Ro),o&&t(za),o&&t(Oe),P(Qo),P(Do),P(Qt),P(Xt),o&&t(Ja),o&&t(Et),P(Ko),o&&t(xa),o&&t(jt),P(en),P(tn),P(Dt),o&&t(Ua),o&&t(Ct),P(on),o&&t(Ia),o&&t(ue),P(nn),P(eo),P(ln),P(to),P(oo),o&&t(Za),o&&t(Jt),P(dn),o&&t(Wa),o&&t(Y),P(cn),P(so),P(mn),P(ro),o&&t(qa),o&&t(xt),P(fn),o&&t(Aa),o&&t(B),P(gn),P(yn),P(io),P(co),P(po),o&&t(Na),o&&t(It),P(vn),o&&t(Ga),o&&t(he),P(wn),P(Pn),P(ho),P(mo),o&&t(Ba),o&&t(qt),P(Fn),o&&t(Va),o&&t(At),P(On),P(En),P(_o),o&&t(Sa),o&&t(Nt),P(jn),o&&t(La),o&&t(V),P(Cn),P(qn),P(yo)}}}const Nu={local:"opt",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.OPTConfig",title:"OPTConfig"},{local:"transformers.OPTModel",title:"OPTModel"},{local:"transformers.OPTForCausalLM",title:"OPTForCausalLM"},{local:"transformers.TFOPTModel",title:"TFOPTModel"},{local:"transformers.TFOPTForCausalLM",title:"TFOPTForCausalLM"},{local:"transformers.OPTForSequenceClassification",title:"OPTForSequenceClassification"},{local:"transformers.OPTForQuestionAnswering",title:"OPTForQuestionAnswering"},{local:"transformers.FlaxOPTModel",title:"FlaxOPTModel"},{local:"transformers.FlaxOPTForCausalLM",title:"FlaxOPTForCausalLM"}],title:"OPT"};function Gu(O){return Mu(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Hu extends bu{constructor(c){super();yu(this,c,Gu,Au,vu,{})}}export{Hu as default,Nu as metadata};
