import{s as fr,n as _r,o as vr}from"../chunks/scheduler.d627b047.js";import{S as br,i as $r,g as o,s as r,r as l,A as wr,h as n,f as d,c as a,j as f,u as i,x as _,k as v,y as t,a as b,v as m,d as p,t as c,w as g}from"../chunks/index.73c51727.js";import{D as $}from"../chunks/Docstring.0ad99a5d.js";import{H as De,E as Mr}from"../chunks/index.8df1db42.js";function Tr(Ut){let L,Ie,qe,Ee,z,ze,N,Kt="With the <code>AutoModelForCausalLMWithValueHead</code> class TRL supports all decoder model architectures in transformers such as GPT-2, OPT, and GPT-Neo. In addition, with <code>AutoModelForSeq2SeqLMWithValueHead</code> you can use encoder-decoder architectures such as T5. TRL also requires reference models which are frozen copies of the model that is trained. With <code>create_reference_model</code> you can easily create a frozen copy and also share layers between the two models to save memory.",Ne,G,Ge,u,j,pt,ce,Bt=`A wrapper class around a (<code>transformers.PreTrainedModel</code>) to be compatible with the
(<code>~transformers.PreTrained</code>) class in order to keep some attributes and methods of the
(<code>~transformers.PreTrainedModel</code>) class.`,ct,k,O,gt,ge,Jt=`Add and load a reward modeling adapter. This method can only be used if the
model is a <code>PeftModel</code> and if you have initialized the model with the <code>reward_modeling_adapter_id</code>
argument, pointing to the id of the reward modeling adapter. The latest needs also to contain the
score head in order to produce the reward.`,ut,H,R,ht,ue,Qt=`Computes the reward score for a given input. The method has first to enable the adapter
and then compute the reward score. After that the model disables the reward modeling
adapter and enables the default ppo adapter again.`,ft,W,U,_t,he,Xt=`Instantiates a new model from a pretrained model from <code>transformers</code>. The
pretrained model is loaded using the <code>from_pretrained</code> method of the
<code>transformers.PreTrainedModel</code> class. The arguments that are specific to the
<code>transformers.PreTrainedModel</code> class are passed along this method and filtered
out from the <code>kwargs</code> argument.`,vt,C,K,bt,fe,Yt=`Post initialization method. This method is called after the model is
instantiated and loaded from a checkpoint. It can be used to perform
additional operations such as loading the state_dict.`,$t,V,B,wt,_e,Zt=`Push the pretrained model to the hub. This method is a wrapper around
<code>transformers.PreTrainedModel.push_to_hub</code>. Please refer to the documentation
of <code>transformers.PreTrainedModel.push_to_hub</code> for more information.`,Mt,A,J,Tt,ve,er=`Save the pretrained model to a directory. This method is a wrapper around
<code>transformers.PreTrainedModel.save_pretrained</code>. Please refer to the documentation
of <code>transformers.PreTrainedModel.save_pretrained</code> for more information.`,yt,F,Q,xt,be,tr="Return the state_dict of the pretrained model.",je,X,Oe,h,Y,Lt,$e,rr=`An autoregressive model with a value head in addition to the language model head.
This class inherits from <code>~trl.PreTrainedModelWrapper</code> and wraps a
<code>transformers.PreTrainedModel</code> class. The wrapper class supports classic functions
such as <code>from_pretrained</code>, <code>push_to_hub</code> and <code>generate</code>. To call a method of the wrapped
model, simply manipulate the <code>pretrained_model</code> attribute of this class.`,Pt,we,ar="Class attributes:",kt,Me,or=`<li><strong>transformers_parent_class</strong> (<code>transformers.PreTrainedModel</code>) — The parent class of the wrapped model. This
should be set to <code>transformers.AutoModelForCausalLM</code> for this class.</li> <li><strong>supported_args</strong> (<code>tuple</code>) — A tuple of strings that are used to identify the arguments that are supported
by the <code>ValueHead</code> class. Currently, the supported args are:<ul><li><strong>summary_dropout_prob</strong> (<code>float</code>, <code>optional</code>, defaults to <code>None</code>) — The dropout probability for the
<code>ValueHead</code> class.</li> <li><strong>v_head_initializer_range</strong> (<code>float</code>, <code>optional</code>, defaults to <code>0.2</code>) — The initializer range for the
<code>ValueHead</code> if a specific initialization strategy is selected.</li> <li><strong>v_head_init_strategy</strong> (<code>str</code>, <code>optional</code>, defaults to <code>None</code>) — The initialization strategy for the
<code>ValueHead</code>. Currently, the supported strategies are:<ul><li><strong><code>None</code></strong> — Initializes the weights of the <code>ValueHead</code> with a random distribution. This is the default
strategy.</li> <li><strong>“normal”</strong> — Initializes the weights of the <code>ValueHead</code> with a normal distribution.</li></ul></li></ul></li>`,Ht,q,Z,Wt,Te,nr="Initializes the model.",Ct,S,ee,Vt,ye,dr="Applies a forward pass to the wrapped model and returns the logits of the value head.",At,D,te,Ft,xe,sr=`A simple wrapper around the <code>generate</code> method of the wrapped model.
Please refer to the <a href="https://huggingface.co/docs/transformers/internal/generation_utils" rel="nofollow"><code>generate</code></a>
method of the wrapped model for more information about the supported arguments.`,qt,x,re,St,Le,lr=`Initializes the weights of the value head. The default initialization strategy is random.
Users can pass a different initialization strategy by passing the <code>v_head_init_strategy</code> argument
when calling <code>.from_pretrained</code>. Supported strategies are:`,Dt,Pe,ir="<li><code>normal</code>: initializes the weights with a normal distribution.</li>",Re,ae,Ue,M,oe,It,ke,mr=`A seq2seq model with a value head in addition to the language model head.
This class inherits from <code>~trl.PreTrainedModelWrapper</code> and wraps a
<code>transformers.PreTrainedModel</code> class. The wrapper class supports classic functions
such as <code>from_pretrained</code> and <code>push_to_hub</code> and also provides some additional
functionalities such as <code>generate</code>.`,Et,He,ne,zt,We,de,Nt,I,se,Gt,Ce,pr="We call <code>generate</code> on the wrapped model.",jt,E,le,Ot,Ve,cr="We initialize the weights of the value head.",Ke,ie,Be,P,me,Rt,Ae,gr="Creates a static reference copy of a model. Note that model will be in <code>.eval()</code> mode.",Je,pe,Qe,Se,Xe;return z=new De({props:{title:"Models",local:"models",headingTag:"h1"}}),G=new De({props:{title:"PreTrainedModelWrapper",local:"trl.PreTrainedModelWrapper",headingTag:"h2"}}),j=new $({props:{name:"class trl.PreTrainedModelWrapper",anchor:"trl.PreTrainedModelWrapper",parameters:[{name:"pretrained_model",val:" = None"},{name:"score_module",val:" = None"},{name:"supports_rm_adapter",val:" = False"},{name:"rm_adapter_name",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"trl.PreTrainedModelWrapper.pretrained_model",description:`<strong>pretrained_model</strong> (<code>transformers.PreTrainedModel</code>) &#x2014;
The model to be wrapped.`,name:"pretrained_model"},{anchor:"trl.PreTrainedModelWrapper.parent_class",description:`<strong>parent_class</strong> (<code>transformers.PreTrainedModel</code>) &#x2014;
The parent class of the model to be wrapped.`,name:"parent_class"},{anchor:"trl.PreTrainedModelWrapper.supported_args",description:`<strong>supported_args</strong> (<code>list</code>) &#x2014;
The list of arguments that are supported by the wrapper class.`,name:"supported_args"}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_base.py#L59"}}),O=new $({props:{name:"add_and_load_reward_modeling_adapter",anchor:"trl.PreTrainedModelWrapper.add_and_load_reward_modeling_adapter",parameters:[{name:"pretrained_model",val:""},{name:"adapter_model_id",val:""},{name:"adapter_name",val:" = 'reward_model_adapter'"},{name:"token",val:" = None"}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_base.py#L443"}}),R=new $({props:{name:"compute_reward_score",anchor:"trl.PreTrainedModelWrapper.compute_reward_score",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_base.py#L574"}}),U=new $({props:{name:"from_pretrained",anchor:"trl.PreTrainedModelWrapper.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:""},{name:"*model_args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"trl.PreTrainedModelWrapper.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>transformers.PreTrainedModel</code>) &#x2014;
The path to the pretrained model or its name.`,name:"pretrained_model_name_or_path"},{anchor:"trl.PreTrainedModelWrapper.from_pretrained.*model_args",description:`<strong>*model_args</strong> (<code>list</code>, <em>optional</em>)) &#x2014;
Additional positional arguments passed along to the underlying model&#x2019;s
<code>from_pretrained</code> method.`,name:"*model_args"},{anchor:"trl.PreTrainedModelWrapper.from_pretrained.*kwargs",description:`*<strong>*kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Additional keyword arguments passed along to the underlying model&#x2019;s
<code>from_pretrained</code> method. We also pre-process the kwargs to extract
the arguments that are specific to the <code>transformers.PreTrainedModel</code>
class and the arguments that are specific to trl models. The kwargs
also support <code>prepare_model_for_kbit_training</code> arguments from
<code>peft</code> library.`,name:"*kwargs"}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_base.py#L111"}}),K=new $({props:{name:"post_init",anchor:"trl.PreTrainedModelWrapper.post_init",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_base.py#L566"}}),B=new $({props:{name:"push_to_hub",anchor:"trl.PreTrainedModelWrapper.push_to_hub",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"trl.PreTrainedModelWrapper.push_to_hub.*args",description:`<strong>*args</strong> (<code>list</code>, <em>optional</em>) &#x2014;
Positional arguments passed along to the underlying model&#x2019;s
<code>push_to_hub</code> method.`,name:"*args"},{anchor:"trl.PreTrainedModelWrapper.push_to_hub.*kwargs",description:`*<strong>*kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Keyword arguments passed along to the underlying model&#x2019;s
<code>push_to_hub</code> method.`,name:"*kwargs"}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_base.py#L515"}}),J=new $({props:{name:"save_pretrained",anchor:"trl.PreTrainedModelWrapper.save_pretrained",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"trl.PreTrainedModelWrapper.save_pretrained.*args",description:`<strong>*args</strong> (<code>list</code>, <em>optional</em>) &#x2014;
Positional arguments passed along to the underlying model&#x2019;s
<code>save_pretrained</code> method.`,name:"*args"},{anchor:"trl.PreTrainedModelWrapper.save_pretrained.*kwargs",description:`*<strong>*kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Keyword arguments passed along to the underlying model&#x2019;s
<code>save_pretrained</code> method.`,name:"*kwargs"}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_base.py#L531"}}),Q=new $({props:{name:"state_dict",anchor:"trl.PreTrainedModelWrapper.state_dict",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_base.py#L560"}}),X=new De({props:{title:"AutoModelForCausalLMWithValueHead",local:"trl.AutoModelForCausalLMWithValueHead",headingTag:"h2"}}),Y=new $({props:{name:"class trl.AutoModelForCausalLMWithValueHead",anchor:"trl.AutoModelForCausalLMWithValueHead",parameters:[{name:"pretrained_model",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_value_head.py#L62"}}),Z=new $({props:{name:"__init__",anchor:"trl.AutoModelForCausalLMWithValueHead.__init__",parameters:[{name:"pretrained_model",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"trl.AutoModelForCausalLMWithValueHead.__init__.pretrained_model",description:`<strong>pretrained_model</strong> (<code>transformers.PreTrainedModel</code>) &#x2014;
The model to wrap. It should be a causal language model such as GPT2.
or any model mapped inside the <code>AutoModelForCausalLM</code> class.`,name:"pretrained_model"},{anchor:"trl.AutoModelForCausalLMWithValueHead.__init__.kwargs",description:`<strong>kwargs</strong> (<code>dict</code>, <code>optional</code>) &#x2014;
Additional keyword arguments, that are passed to the <code>ValueHead</code> class.`,name:"kwargs"}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_value_head.py#L93"}}),ee=new $({props:{name:"forward",anchor:"trl.AutoModelForCausalLMWithValueHead.forward",parameters:[{name:"input_ids",val:" = None"},{name:"past_key_values",val:" = None"},{name:"attention_mask",val:" = None"},{name:"return_past_key_values",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"trl.AutoModelForCausalLMWithValueHead.forward.input_ids",description:`<strong>input_ids</strong> (<em>torch.LongTensor</em> of shape <em>(batch_size, sequence_length)</em>) &#x2014;
Indices of input sequence tokens in the vocabulary.`,name:"input_ids"},{anchor:"trl.AutoModelForCausalLMWithValueHead.forward.past_key_values",description:`<strong>past_key_values</strong> (<em>tuple(tuple(torch.FloatTensor))</em>, <em>optional</em>) &#x2014;
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model
(see <em>past_key_values</em> input) to speed up sequential decoding.`,name:"past_key_values"},{anchor:"trl.AutoModelForCausalLMWithValueHead.forward.attention_mask",description:`<strong>attention_mask</strong> (<em>torch.FloatTensor</em> of shape <em>(batch_size, sequence_length)</em>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"trl.AutoModelForCausalLMWithValueHead.forward.return_past_key_values",description:"<strong>return_past_key_values</strong> (bool) &#x2014; A flag indicating if the computed hidden-states should be returned.",name:"return_past_key_values"},{anchor:"trl.AutoModelForCausalLMWithValueHead.forward.kwargs",description:`<strong>kwargs</strong> (<em>dict</em>, <em>optional</em>) &#x2014;
Additional keyword arguments, that are passed to the wrapped model.`,name:"kwargs"}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_value_head.py#L132"}}),te=new $({props:{name:"generate",anchor:"trl.AutoModelForCausalLMWithValueHead.generate",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"trl.AutoModelForCausalLMWithValueHead.generate.*args",description:`<strong>*args</strong> (<code>list</code>, <em>optional</em>) &#x2014;
Positional arguments passed to the <code>generate</code> method of the wrapped model.`,name:"*args"},{anchor:"trl.AutoModelForCausalLMWithValueHead.generate.*kwargs",description:`*<strong>*kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Keyword arguments passed to the <code>generate</code> method of the wrapped model.`,name:"*kwargs"}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_value_head.py#L187"}}),re=new $({props:{name:"_init_weights",anchor:"trl.AutoModelForCausalLMWithValueHead._init_weights",parameters:[{name:"**kwargs",val:""}],parametersDescription:[{anchor:"trl.AutoModelForCausalLMWithValueHead._init_weights.*kwargs",description:`*<strong>*kwargs</strong> (<code>dict</code>, <code>optional</code>) &#x2014;
Additional keyword arguments, that are passed to the <code>ValueHead</code> class. These arguments
can contain the <code>v_head_init_strategy</code> argument as well as the <code>v_head_initializer_range</code>
argument.`,name:"*kwargs"}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_value_head.py#L109"}}),ae=new De({props:{title:"AutoModelForSeq2SeqLMWithValueHead",local:"trl.AutoModelForSeq2SeqLMWithValueHead",headingTag:"h2"}}),oe=new $({props:{name:"class trl.AutoModelForSeq2SeqLMWithValueHead",anchor:"trl.AutoModelForSeq2SeqLMWithValueHead",parameters:[{name:"pretrained_model",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"trl.AutoModelForSeq2SeqLMWithValueHead.pretrained_model",description:`<strong>pretrained_model</strong> (<code>transformers.PreTrainedModel</code>) &#x2014;
The model to wrap. It should be a causal language model such as GPT2.
or any model mapped inside the <code>AutoModelForSeq2SeqLM</code> class.`,name:"pretrained_model"},{anchor:"trl.AutoModelForSeq2SeqLMWithValueHead.kwargs",description:`<strong>kwargs</strong> &#x2014;
Additional keyword arguments passed along to the <code>ValueHead</code> class.`,name:"kwargs"}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_value_head.py#L267"}}),ne=new $({props:{name:"__init__",anchor:"trl.AutoModelForSeq2SeqLMWithValueHead.__init__",parameters:[{name:"pretrained_model",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_value_head.py#L291"}}),de=new $({props:{name:"forward",anchor:"trl.AutoModelForSeq2SeqLMWithValueHead.forward",parameters:[{name:"input_ids",val:" = None"},{name:"past_key_values",val:" = None"},{name:"attention_mask",val:" = None"},{name:"return_past_key_values",val:" = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_value_head.py#L399"}}),se=new $({props:{name:"generate",anchor:"trl.AutoModelForSeq2SeqLMWithValueHead.generate",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_value_head.py#L433"}}),le=new $({props:{name:"_init_weights",anchor:"trl.AutoModelForSeq2SeqLMWithValueHead._init_weights",parameters:[{name:"**kwargs",val:""}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_value_head.py#L385"}}),ie=new De({props:{title:"create_reference_model",local:"trl.create_reference_model",headingTag:"h2"}}),me=new $({props:{name:"trl.create_reference_model",anchor:"trl.create_reference_model",parameters:[{name:"model",val:": PreTrainedModelWrapper"},{name:"num_shared_layers",val:": typing.Optional[int] = None"},{name:"pattern",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"trl.create_reference_model.model",description:"<strong>model</strong> (<code>PreTrainedModelWrapper</code>) &#x2014; The model to be copied.",name:"model"},{anchor:"trl.create_reference_model.num_shared_layers",description:"<strong>num_shared_layers</strong> (<code>int</code>, <em>optional</em>) &#x2014; The number of initial layers that are shared between both models and kept frozen.",name:"num_shared_layers"},{anchor:"trl.create_reference_model.pattern",description:`<strong>pattern</strong> (<code>str</code>, <em>optional</em>) &#x2014; The shared layers are selected with a string pattern
(e.g. &#x201C;transformer.h.{layer}&#x201D; for GPT2) and if a custom pattern is necessary it can be passed here.`,name:"pattern"}],source:"https://github.com/huggingface/trl/blob/main/trl/models/modeling_base.py#L605",returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>PreTrainedModelWrapper</code></p>
`}}),pe=new Mr({props:{source:"https://github.com/huggingface/trl/blob/main/docs/source/models.md"}}),{c(){L=o("meta"),Ie=r(),qe=o("p"),Ee=r(),l(z.$$.fragment),ze=r(),N=o("p"),N.innerHTML=Kt,Ne=r(),l(G.$$.fragment),Ge=r(),u=o("div"),l(j.$$.fragment),pt=r(),ce=o("p"),ce.innerHTML=Bt,ct=r(),k=o("div"),l(O.$$.fragment),gt=r(),ge=o("p"),ge.innerHTML=Jt,ut=r(),H=o("div"),l(R.$$.fragment),ht=r(),ue=o("p"),ue.textContent=Qt,ft=r(),W=o("div"),l(U.$$.fragment),_t=r(),he=o("p"),he.innerHTML=Xt,vt=r(),C=o("div"),l(K.$$.fragment),bt=r(),fe=o("p"),fe.textContent=Yt,$t=r(),V=o("div"),l(B.$$.fragment),wt=r(),_e=o("p"),_e.innerHTML=Zt,Mt=r(),A=o("div"),l(J.$$.fragment),Tt=r(),ve=o("p"),ve.innerHTML=er,yt=r(),F=o("div"),l(Q.$$.fragment),xt=r(),be=o("p"),be.textContent=tr,je=r(),l(X.$$.fragment),Oe=r(),h=o("div"),l(Y.$$.fragment),Lt=r(),$e=o("p"),$e.innerHTML=rr,Pt=r(),we=o("p"),we.textContent=ar,kt=r(),Me=o("ul"),Me.innerHTML=or,Ht=r(),q=o("div"),l(Z.$$.fragment),Wt=r(),Te=o("p"),Te.textContent=nr,Ct=r(),S=o("div"),l(ee.$$.fragment),Vt=r(),ye=o("p"),ye.textContent=dr,At=r(),D=o("div"),l(te.$$.fragment),Ft=r(),xe=o("p"),xe.innerHTML=sr,qt=r(),x=o("div"),l(re.$$.fragment),St=r(),Le=o("p"),Le.innerHTML=lr,Dt=r(),Pe=o("ul"),Pe.innerHTML=ir,Re=r(),l(ae.$$.fragment),Ue=r(),M=o("div"),l(oe.$$.fragment),It=r(),ke=o("p"),ke.innerHTML=mr,Et=r(),He=o("div"),l(ne.$$.fragment),zt=r(),We=o("div"),l(de.$$.fragment),Nt=r(),I=o("div"),l(se.$$.fragment),Gt=r(),Ce=o("p"),Ce.innerHTML=pr,jt=r(),E=o("div"),l(le.$$.fragment),Ot=r(),Ve=o("p"),Ve.textContent=cr,Ke=r(),l(ie.$$.fragment),Be=r(),P=o("div"),l(me.$$.fragment),Rt=r(),Ae=o("p"),Ae.innerHTML=gr,Je=r(),l(pe.$$.fragment),Qe=r(),Se=o("p"),this.h()},l(e){const s=wr("svelte-u9bgzb",document.head);L=n(s,"META",{name:!0,content:!0}),s.forEach(d),Ie=a(e),qe=n(e,"P",{}),f(qe).forEach(d),Ee=a(e),i(z.$$.fragment,e),ze=a(e),N=n(e,"P",{"data-svelte-h":!0}),_(N)!=="svelte-qyymc3"&&(N.innerHTML=Kt),Ne=a(e),i(G.$$.fragment,e),Ge=a(e),u=n(e,"DIV",{class:!0});var w=f(u);i(j.$$.fragment,w),pt=a(w),ce=n(w,"P",{"data-svelte-h":!0}),_(ce)!=="svelte-1n50mvm"&&(ce.innerHTML=Bt),ct=a(w),k=n(w,"DIV",{class:!0});var Ye=f(k);i(O.$$.fragment,Ye),gt=a(Ye),ge=n(Ye,"P",{"data-svelte-h":!0}),_(ge)!=="svelte-m652k7"&&(ge.innerHTML=Jt),Ye.forEach(d),ut=a(w),H=n(w,"DIV",{class:!0});var Ze=f(H);i(R.$$.fragment,Ze),ht=a(Ze),ue=n(Ze,"P",{"data-svelte-h":!0}),_(ue)!=="svelte-k7tmfv"&&(ue.textContent=Qt),Ze.forEach(d),ft=a(w),W=n(w,"DIV",{class:!0});var et=f(W);i(U.$$.fragment,et),_t=a(et),he=n(et,"P",{"data-svelte-h":!0}),_(he)!=="svelte-y1arf1"&&(he.innerHTML=Xt),et.forEach(d),vt=a(w),C=n(w,"DIV",{class:!0});var tt=f(C);i(K.$$.fragment,tt),bt=a(tt),fe=n(tt,"P",{"data-svelte-h":!0}),_(fe)!=="svelte-zh6uxe"&&(fe.textContent=Yt),tt.forEach(d),$t=a(w),V=n(w,"DIV",{class:!0});var rt=f(V);i(B.$$.fragment,rt),wt=a(rt),_e=n(rt,"P",{"data-svelte-h":!0}),_(_e)!=="svelte-s0c5wy"&&(_e.innerHTML=Zt),rt.forEach(d),Mt=a(w),A=n(w,"DIV",{class:!0});var at=f(A);i(J.$$.fragment,at),Tt=a(at),ve=n(at,"P",{"data-svelte-h":!0}),_(ve)!=="svelte-17n3j6h"&&(ve.innerHTML=er),at.forEach(d),yt=a(w),F=n(w,"DIV",{class:!0});var ot=f(F);i(Q.$$.fragment,ot),xt=a(ot),be=n(ot,"P",{"data-svelte-h":!0}),_(be)!=="svelte-1cyq38c"&&(be.textContent=tr),ot.forEach(d),w.forEach(d),je=a(e),i(X.$$.fragment,e),Oe=a(e),h=n(e,"DIV",{class:!0});var T=f(h);i(Y.$$.fragment,T),Lt=a(T),$e=n(T,"P",{"data-svelte-h":!0}),_($e)!=="svelte-5lvbj6"&&($e.innerHTML=rr),Pt=a(T),we=n(T,"P",{"data-svelte-h":!0}),_(we)!=="svelte-wz8va1"&&(we.textContent=ar),kt=a(T),Me=n(T,"UL",{"data-svelte-h":!0}),_(Me)!=="svelte-wywj2g"&&(Me.innerHTML=or),Ht=a(T),q=n(T,"DIV",{class:!0});var nt=f(q);i(Z.$$.fragment,nt),Wt=a(nt),Te=n(nt,"P",{"data-svelte-h":!0}),_(Te)!=="svelte-1vif237"&&(Te.textContent=nr),nt.forEach(d),Ct=a(T),S=n(T,"DIV",{class:!0});var dt=f(S);i(ee.$$.fragment,dt),Vt=a(dt),ye=n(dt,"P",{"data-svelte-h":!0}),_(ye)!=="svelte-117t42l"&&(ye.textContent=dr),dt.forEach(d),At=a(T),D=n(T,"DIV",{class:!0});var st=f(D);i(te.$$.fragment,st),Ft=a(st),xe=n(st,"P",{"data-svelte-h":!0}),_(xe)!=="svelte-2025ty"&&(xe.innerHTML=sr),st.forEach(d),qt=a(T),x=n(T,"DIV",{class:!0});var Fe=f(x);i(re.$$.fragment,Fe),St=a(Fe),Le=n(Fe,"P",{"data-svelte-h":!0}),_(Le)!=="svelte-milcea"&&(Le.innerHTML=lr),Dt=a(Fe),Pe=n(Fe,"UL",{"data-svelte-h":!0}),_(Pe)!=="svelte-xrw96c"&&(Pe.innerHTML=ir),Fe.forEach(d),T.forEach(d),Re=a(e),i(ae.$$.fragment,e),Ue=a(e),M=n(e,"DIV",{class:!0});var y=f(M);i(oe.$$.fragment,y),It=a(y),ke=n(y,"P",{"data-svelte-h":!0}),_(ke)!=="svelte-bm1hiz"&&(ke.innerHTML=mr),Et=a(y),He=n(y,"DIV",{class:!0});var ur=f(He);i(ne.$$.fragment,ur),ur.forEach(d),zt=a(y),We=n(y,"DIV",{class:!0});var hr=f(We);i(de.$$.fragment,hr),hr.forEach(d),Nt=a(y),I=n(y,"DIV",{class:!0});var lt=f(I);i(se.$$.fragment,lt),Gt=a(lt),Ce=n(lt,"P",{"data-svelte-h":!0}),_(Ce)!=="svelte-14hfc8g"&&(Ce.innerHTML=pr),lt.forEach(d),jt=a(y),E=n(y,"DIV",{class:!0});var it=f(E);i(le.$$.fragment,it),Ot=a(it),Ve=n(it,"P",{"data-svelte-h":!0}),_(Ve)!=="svelte-19noyid"&&(Ve.textContent=cr),it.forEach(d),y.forEach(d),Ke=a(e),i(ie.$$.fragment,e),Be=a(e),P=n(e,"DIV",{class:!0});var mt=f(P);i(me.$$.fragment,mt),Rt=a(mt),Ae=n(mt,"P",{"data-svelte-h":!0}),_(Ae)!=="svelte-1dbdjd0"&&(Ae.innerHTML=gr),mt.forEach(d),Je=a(e),i(pe.$$.fragment,e),Qe=a(e),Se=n(e,"P",{}),f(Se).forEach(d),this.h()},h(){v(L,"name","hf:doc:metadata"),v(L,"content",yr),v(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(u,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,s){t(document.head,L),b(e,Ie,s),b(e,qe,s),b(e,Ee,s),m(z,e,s),b(e,ze,s),b(e,N,s),b(e,Ne,s),m(G,e,s),b(e,Ge,s),b(e,u,s),m(j,u,null),t(u,pt),t(u,ce),t(u,ct),t(u,k),m(O,k,null),t(k,gt),t(k,ge),t(u,ut),t(u,H),m(R,H,null),t(H,ht),t(H,ue),t(u,ft),t(u,W),m(U,W,null),t(W,_t),t(W,he),t(u,vt),t(u,C),m(K,C,null),t(C,bt),t(C,fe),t(u,$t),t(u,V),m(B,V,null),t(V,wt),t(V,_e),t(u,Mt),t(u,A),m(J,A,null),t(A,Tt),t(A,ve),t(u,yt),t(u,F),m(Q,F,null),t(F,xt),t(F,be),b(e,je,s),m(X,e,s),b(e,Oe,s),b(e,h,s),m(Y,h,null),t(h,Lt),t(h,$e),t(h,Pt),t(h,we),t(h,kt),t(h,Me),t(h,Ht),t(h,q),m(Z,q,null),t(q,Wt),t(q,Te),t(h,Ct),t(h,S),m(ee,S,null),t(S,Vt),t(S,ye),t(h,At),t(h,D),m(te,D,null),t(D,Ft),t(D,xe),t(h,qt),t(h,x),m(re,x,null),t(x,St),t(x,Le),t(x,Dt),t(x,Pe),b(e,Re,s),m(ae,e,s),b(e,Ue,s),b(e,M,s),m(oe,M,null),t(M,It),t(M,ke),t(M,Et),t(M,He),m(ne,He,null),t(M,zt),t(M,We),m(de,We,null),t(M,Nt),t(M,I),m(se,I,null),t(I,Gt),t(I,Ce),t(M,jt),t(M,E),m(le,E,null),t(E,Ot),t(E,Ve),b(e,Ke,s),m(ie,e,s),b(e,Be,s),b(e,P,s),m(me,P,null),t(P,Rt),t(P,Ae),b(e,Je,s),m(pe,e,s),b(e,Qe,s),b(e,Se,s),Xe=!0},p:_r,i(e){Xe||(p(z.$$.fragment,e),p(G.$$.fragment,e),p(j.$$.fragment,e),p(O.$$.fragment,e),p(R.$$.fragment,e),p(U.$$.fragment,e),p(K.$$.fragment,e),p(B.$$.fragment,e),p(J.$$.fragment,e),p(Q.$$.fragment,e),p(X.$$.fragment,e),p(Y.$$.fragment,e),p(Z.$$.fragment,e),p(ee.$$.fragment,e),p(te.$$.fragment,e),p(re.$$.fragment,e),p(ae.$$.fragment,e),p(oe.$$.fragment,e),p(ne.$$.fragment,e),p(de.$$.fragment,e),p(se.$$.fragment,e),p(le.$$.fragment,e),p(ie.$$.fragment,e),p(me.$$.fragment,e),p(pe.$$.fragment,e),Xe=!0)},o(e){c(z.$$.fragment,e),c(G.$$.fragment,e),c(j.$$.fragment,e),c(O.$$.fragment,e),c(R.$$.fragment,e),c(U.$$.fragment,e),c(K.$$.fragment,e),c(B.$$.fragment,e),c(J.$$.fragment,e),c(Q.$$.fragment,e),c(X.$$.fragment,e),c(Y.$$.fragment,e),c(Z.$$.fragment,e),c(ee.$$.fragment,e),c(te.$$.fragment,e),c(re.$$.fragment,e),c(ae.$$.fragment,e),c(oe.$$.fragment,e),c(ne.$$.fragment,e),c(de.$$.fragment,e),c(se.$$.fragment,e),c(le.$$.fragment,e),c(ie.$$.fragment,e),c(me.$$.fragment,e),c(pe.$$.fragment,e),Xe=!1},d(e){e&&(d(Ie),d(qe),d(Ee),d(ze),d(N),d(Ne),d(Ge),d(u),d(je),d(Oe),d(h),d(Re),d(Ue),d(M),d(Ke),d(Be),d(P),d(Je),d(Qe),d(Se)),d(L),g(z,e),g(G,e),g(j),g(O),g(R),g(U),g(K),g(B),g(J),g(Q),g(X,e),g(Y),g(Z),g(ee),g(te),g(re),g(ae,e),g(oe),g(ne),g(de),g(se),g(le),g(ie,e),g(me),g(pe,e)}}}const yr='{"title":"Models","local":"models","sections":[{"title":"PreTrainedModelWrapper","local":"trl.PreTrainedModelWrapper","sections":[],"depth":2},{"title":"AutoModelForCausalLMWithValueHead","local":"trl.AutoModelForCausalLMWithValueHead","sections":[],"depth":2},{"title":"AutoModelForSeq2SeqLMWithValueHead","local":"trl.AutoModelForSeq2SeqLMWithValueHead","sections":[],"depth":2},{"title":"create_reference_model","local":"trl.create_reference_model","sections":[],"depth":2}],"depth":1}';function xr(Ut){return vr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Wr extends br{constructor(L){super(),$r(this,L,xr,Tr,fr,{})}}export{Wr as component};
