import{s as Be,o as Ye,n as R}from"../chunks/scheduler.d627b047.js";import{S as Ae,i as Ke,g as v,s as p,r as _,A as et,h as C,f as l,c as m,j as ze,u as y,x as U,k as le,y as tt,a,v as b,d as w,t as M,w as T}from"../chunks/index.73c51727.js";import{T as Pe}from"../chunks/Tip.a82942ec.js";import{C as G}from"../chunks/CodeBlock.5f78c87f.js";import{H as ie,E as nt}from"../chunks/index.8df1db42.js";import{H as ke,a as W}from"../chunks/HfOption.d6c7dc54.js";function st(h){let t,i="Section under construction. Feel free to contribute!";return{c(){t=v("p"),t.textContent=i},l(n){t=C(n,"P",{"data-svelte-h":!0}),U(t)!=="svelte-txx63b"&&(t.textContent=i)},m(n,o){a(n,t,o)},p:R,d(n){n&&l(t)}}}function lt(h){let t,i="DPO truncation is applied first to the prompt and to the completion via the <code>max_prompt_length</code> and <code>max_completion_length</code> parameters. The <code>max_length</code> parameter is then used to truncate the resulting sequence.",n,o,r='<img src="https://huggingface.co/datasets/trl-lib/documentation-images/resolve/main/truncation_prompt_completion.png" alt="Truncation prompt completion" width="600"/>',g,u,Z="To set the truncation parameters, use the following code snippet:",f,c,j,d,J="You can also use the <code>max_completion_length</code> parameter to truncate the completion, though this is less common since the goal is typically to preserve the completion’s full length whenever possible.",P,x,F;return c=new G({props:{code:"ZnJvbSUyMHRybCUyMGltcG9ydCUyMERQT0NvbmZpZyUwQSUwQXRyYWluaW5nX2FyZ3MlMjAlM0QlMjBEUE9Db25maWcoLi4uJTJDJTIwbWF4X3Byb21wdF9sZW5ndGglM0QuLi4lMkMlMjBtYXhfbGVuZ3RoJTNELi4uKQ==",highlighted:`<span class="hljs-keyword">from</span> trl <span class="hljs-keyword">import</span> DPOConfig

training_args = DPOConfig(..., max_prompt_length=..., max_length=...)`,wrap:!1}}),x=new G({props:{code:"ZnJvbSUyMHRybCUyMGltcG9ydCUyMERQT0NvbmZpZyUwQSUwQXRyYWluaW5nX2FyZ3MlMjAlM0QlMjBEUE9Db25maWcoLi4uJTJDJTIwbWF4X2NvbXBsZXRpb25fbGVuZ3RoJTNELi4uKQ==",highlighted:`<span class="hljs-keyword">from</span> trl <span class="hljs-keyword">import</span> DPOConfig

training_args = DPOConfig(..., max_completion_length=...)`,wrap:!1}}),{c(){t=v("p"),t.innerHTML=i,n=p(),o=v("div"),o.innerHTML=r,g=p(),u=v("p"),u.textContent=Z,f=p(),_(c.$$.fragment),j=p(),d=v("p"),d.innerHTML=J,P=p(),_(x.$$.fragment),this.h()},l($){t=C($,"P",{"data-svelte-h":!0}),U(t)!=="svelte-cly35y"&&(t.innerHTML=i),n=m($),o=C($,"DIV",{class:!0,"data-svelte-h":!0}),U(o)!=="svelte-1f9vb58"&&(o.innerHTML=r),g=m($),u=C($,"P",{"data-svelte-h":!0}),U(u)!=="svelte-1r0zv8c"&&(u.textContent=Z),f=m($),y(c.$$.fragment,$),j=m($),d=C($,"P",{"data-svelte-h":!0}),U(d)!=="svelte-10jd0vs"&&(d.innerHTML=J),P=m($),y(x.$$.fragment,$),this.h()},h(){le(o,"class","flex justify-center")},m($,k){a($,t,k),a($,n,k),a($,o,k),a($,g,k),a($,u,k),a($,f,k),b(c,$,k),a($,j,k),a($,d,k),a($,P,k),b(x,$,k),F=!0},p:R,i($){F||(w(c.$$.fragment,$),w(x.$$.fragment,$),F=!0)},o($){M(c.$$.fragment,$),M(x.$$.fragment,$),F=!1},d($){$&&(l(t),l(n),l(o),l(g),l(u),l(f),l(j),l(d),l(P)),T(c,$),T(x,$)}}}function at(h){let t,i="SFT truncation is applied to the input sequence via the <code>max_length</code> parameter.",n,o,r='<img src="https://huggingface.co/datasets/trl-lib/documentation-images/resolve/main/truncation_input_ids.png" alt="Truncation input ids" width="600"/>',g,u,Z="To set the truncation parameter, use the following code snippet:",f,c,j;return c=new G({props:{code:"ZnJvbSUyMHRybCUyMGltcG9ydCUyMFNGVENvbmZpZyUwQSUwQXRyYWluaW5nX2FyZ3MlMjAlM0QlMjBTRlRDb25maWcoLi4uJTJDJTIwbWF4X2xlbmd0aCUzRC4uLik=",highlighted:`<span class="hljs-keyword">from</span> trl <span class="hljs-keyword">import</span> SFTConfig

training_args = SFTConfig(..., max_length=...)`,wrap:!1}}),{c(){t=v("p"),t.innerHTML=i,n=p(),o=v("div"),o.innerHTML=r,g=p(),u=v("p"),u.textContent=Z,f=p(),_(c.$$.fragment),this.h()},l(d){t=C(d,"P",{"data-svelte-h":!0}),U(t)!=="svelte-1ytup32"&&(t.innerHTML=i),n=m(d),o=C(d,"DIV",{class:!0,"data-svelte-h":!0}),U(o)!=="svelte-58s4ua"&&(o.innerHTML=r),g=m(d),u=C(d,"P",{"data-svelte-h":!0}),U(u)!=="svelte-ijv2jp"&&(u.textContent=Z),f=m(d),y(c.$$.fragment,d),this.h()},h(){le(o,"class","flex justify-center")},m(d,J){a(d,t,J),a(d,n,J),a(d,o,J),a(d,g,J),a(d,u,J),a(d,f,J),b(c,d,J),j=!0},p:R,i(d){j||(w(c.$$.fragment,d),j=!0)},o(d){M(c.$$.fragment,d),j=!1},d(d){d&&(l(t),l(n),l(o),l(g),l(u),l(f)),T(c,d)}}}function it(h){let t,i,n,o;return t=new W({props:{id:"dpo",option:"DPO",$$slots:{default:[lt]},$$scope:{ctx:h}}}),n=new W({props:{id:"dpo",option:"SFT",$$slots:{default:[at]},$$scope:{ctx:h}}}),{c(){_(t.$$.fragment),i=p(),_(n.$$.fragment)},l(r){y(t.$$.fragment,r),i=m(r),y(n.$$.fragment,r)},m(r,g){b(t,r,g),a(r,i,g),b(n,r,g),o=!0},p(r,g){const u={};g&2&&(u.$$scope={dirty:g,ctx:r}),t.$set(u);const Z={};g&2&&(Z.$$scope={dirty:g,ctx:r}),n.$set(Z)},i(r){o||(w(t.$$.fragment,r),w(n.$$.fragment,r),o=!0)},o(r){M(t.$$.fragment,r),M(n.$$.fragment,r),o=!1},d(r){r&&l(i),T(t,r),T(n,r)}}}function rt(h){let t,i="This technique applies only to SFT.";return{c(){t=v("p"),t.textContent=i},l(n){t=C(n,"P",{"data-svelte-h":!0}),U(t)!=="svelte-o7a208"&&(t.textContent=i)},m(n,o){a(n,t,o)},p:R,d(n){n&&l(t)}}}function ot(h){let t,i='Packing may cause batch contamination, where adjacent sequences influence one another. This can be problematic for some applications. For more details, see <a href="https://github.com/huggingface/trl/issues/1230" rel="nofollow">#1230</a>.';return{c(){t=v("p"),t.innerHTML=i},l(n){t=C(n,"P",{"data-svelte-h":!0}),U(t)!=="svelte-6zyodn"&&(t.innerHTML=i)},m(n,o){a(n,t,o)},p:R,d(n){n&&l(t)}}}function ft(h){let t,i="It’s highly recommended to use padding-free batching with <strong>Flash Attention 2</strong>. Otherwise, you may encounter batch contamination issues.";return{c(){t=v("p"),t.innerHTML=i},l(n){t=C(n,"P",{"data-svelte-h":!0}),U(t)!=="svelte-1953gpl"&&(t.innerHTML=i)},m(n,o){a(n,t,o)},p:R,d(n){n&&l(t)}}}function pt(h){let t,i;return t=new G({props:{code:"ZnJvbSUyMHRybCUyMGltcG9ydCUyMERQT0NvbmZpZyUwQSUwQXRyYWluaW5nX2FyZ3MlMjAlM0QlMjBEUE9Db25maWcoLi4uJTJDJTIwcGFkZGluZ19mcmVlJTNEVHJ1ZSUyQyUyMG1vZGVsX2luaXRfa3dhcmdzJTNEJTdCJTIyYXR0bl9pbXBsZW1lbnRhdGlvbiUyMiUzQSUyMCUyMmZsYXNoX2F0dGVudGlvbl8yJTIyJTdEKQ==",highlighted:`<span class="hljs-keyword">from</span> trl <span class="hljs-keyword">import</span> DPOConfig

training_args = DPOConfig(..., padding_free=<span class="hljs-literal">True</span>, model_init_kwargs={<span class="hljs-string">&quot;attn_implementation&quot;</span>: <span class="hljs-string">&quot;flash_attention_2&quot;</span>})`,wrap:!1}}),{c(){_(t.$$.fragment)},l(n){y(t.$$.fragment,n)},m(n,o){b(t,n,o),i=!0},p:R,i(n){i||(w(t.$$.fragment,n),i=!0)},o(n){M(t.$$.fragment,n),i=!1},d(n){T(t,n)}}}function mt(h){let t,i;return t=new G({props:{code:"ZnJvbSUyMHRybCUyMGltcG9ydCUyMFNGVENvbmZpZyUwQSUwQXRyYWluaW5nX2FyZ3MlMjAlM0QlMjBTRlRDb25maWcoLi4uJTJDJTIwcGFkZGluZ19mcmVlJTNEVHJ1ZSUyQyUyMG1vZGVsX2luaXRfa3dhcmdzJTNEJTdCJTIyYXR0bl9pbXBsZW1lbnRhdGlvbiUyMiUzQSUyMCUyMmZsYXNoX2F0dGVudGlvbl8yJTIyJTdEKQ==",highlighted:`<span class="hljs-keyword">from</span> trl <span class="hljs-keyword">import</span> SFTConfig

training_args = SFTConfig(..., padding_free=<span class="hljs-literal">True</span>, model_init_kwargs={<span class="hljs-string">&quot;attn_implementation&quot;</span>: <span class="hljs-string">&quot;flash_attention_2&quot;</span>})`,wrap:!1}}),{c(){_(t.$$.fragment)},l(n){y(t.$$.fragment,n)},m(n,o){b(t,n,o),i=!0},p:R,i(n){i||(w(t.$$.fragment,n),i=!0)},o(n){M(t.$$.fragment,n),i=!1},d(n){T(t,n)}}}function $t(h){let t,i,n,o;return t=new W({props:{id:"padding-free",option:"DPO",$$slots:{default:[pt]},$$scope:{ctx:h}}}),n=new W({props:{id:"padding-free",option:"SFT",$$slots:{default:[mt]},$$scope:{ctx:h}}}),{c(){_(t.$$.fragment),i=p(),_(n.$$.fragment)},l(r){y(t.$$.fragment,r),i=m(r),y(n.$$.fragment,r)},m(r,g){b(t,r,g),a(r,i,g),b(n,r,g),o=!0},p(r,g){const u={};g&2&&(u.$$scope={dirty:g,ctx:r}),t.$set(u);const Z={};g&2&&(Z.$$scope={dirty:g,ctx:r}),n.$set(Z)},i(r){o||(w(t.$$.fragment,r),w(n.$$.fragment,r),o=!0)},o(r){M(t.$$.fragment,r),M(n.$$.fragment,r),o=!1},d(r){r&&l(i),T(t,r),T(n,r)}}}function ut(h){let t,i;return t=new G({props:{code:"ZnJvbSUyMHRybCUyMGltcG9ydCUyMEdSUE9Db25maWclMEElMEF0cmFpbmluZ19hcmdzJTIwJTNEJTIwR1JQT0NvbmZpZyguLi4lMkMlMjBkczNfZ2F0aGVyX2Zvcl9nZW5lcmF0aW9uJTNERmFsc2Up",highlighted:`<span class="hljs-keyword">from</span> trl <span class="hljs-keyword">import</span> GRPOConfig

training_args = GRPOConfig(..., ds3_gather_for_generation=<span class="hljs-literal">False</span>)`,wrap:!1}}),{c(){_(t.$$.fragment)},l(n){y(t.$$.fragment,n)},m(n,o){b(t,n,o),i=!0},p:R,i(n){i||(w(t.$$.fragment,n),i=!0)},o(n){M(t.$$.fragment,n),i=!1},d(n){T(t,n)}}}function gt(h){let t,i;return t=new G({props:{code:"ZnJvbSUyMHRybCUyMGltcG9ydCUyME9ubGluZURQT0NvbmZpZyUwQSUwQXRyYWluaW5nX2FyZ3MlMjAlM0QlMjBPbmxpbmVEUE9Db25maWcoLi4uJTJDJTIwZHMzX2dhdGhlcl9mb3JfZ2VuZXJhdGlvbiUzREZhbHNlKQ==",highlighted:`<span class="hljs-keyword">from</span> trl <span class="hljs-keyword">import</span> OnlineDPOConfig

training_args = OnlineDPOConfig(..., ds3_gather_for_generation=<span class="hljs-literal">False</span>)`,wrap:!1}}),{c(){_(t.$$.fragment)},l(n){y(t.$$.fragment,n)},m(n,o){b(t,n,o),i=!0},p:R,i(n){i||(w(t.$$.fragment,n),i=!0)},o(n){M(t.$$.fragment,n),i=!1},d(n){T(t,n)}}}function ct(h){let t,i;return t=new G({props:{code:"ZnJvbSUyMHRybCUyMGltcG9ydCUyMFBQT0NvbmZpZyUwQSUwQXRyYWluaW5nX2FyZ3MlMjAlM0QlMjBQUE9Db25maWcoLi4uJTJDJTIwZHMzX2dhdGhlcl9mb3JfZ2VuZXJhdGlvbiUzREZhbHNlKQ==",highlighted:`<span class="hljs-keyword">from</span> trl <span class="hljs-keyword">import</span> PPOConfig

training_args = PPOConfig(..., ds3_gather_for_generation=<span class="hljs-literal">False</span>)`,wrap:!1}}),{c(){_(t.$$.fragment)},l(n){y(t.$$.fragment,n)},m(n,o){b(t,n,o),i=!0},p:R,i(n){i||(w(t.$$.fragment,n),i=!0)},o(n){M(t.$$.fragment,n),i=!1},d(n){T(t,n)}}}function dt(h){let t,i;return t=new G({props:{code:"ZnJvbSUyMHRybCUyMGltcG9ydCUyMFJMT09Db25maWclMEElMEF0cmFpbmluZ19hcmdzJTIwJTNEJTIwUkxPT0NvbmZpZyguLi4lMkMlMjBkczNfZ2F0aGVyX2Zvcl9nZW5lcmF0aW9uJTNERmFsc2Up",highlighted:`<span class="hljs-keyword">from</span> trl <span class="hljs-keyword">import</span> RLOOConfig

training_args = RLOOConfig(..., ds3_gather_for_generation=<span class="hljs-literal">False</span>)`,wrap:!1}}),{c(){_(t.$$.fragment)},l(n){y(t.$$.fragment,n)},m(n,o){b(t,n,o),i=!0},p:R,i(n){i||(w(t.$$.fragment,n),i=!0)},o(n){M(t.$$.fragment,n),i=!1},d(n){T(t,n)}}}function ht(h){let t,i,n,o,r,g,u,Z;return t=new W({props:{id:"ds3_gather_for_generation",option:"GRPO",$$slots:{default:[ut]},$$scope:{ctx:h}}}),n=new W({props:{id:"ds3_gather_for_generation",option:"Online DPO",$$slots:{default:[gt]},$$scope:{ctx:h}}}),r=new W({props:{id:"ds3_gather_for_generation",option:"PPO",$$slots:{default:[ct]},$$scope:{ctx:h}}}),u=new W({props:{id:"ds3_gather_for_generation",option:"RLOO",$$slots:{default:[dt]},$$scope:{ctx:h}}}),{c(){_(t.$$.fragment),i=p(),_(n.$$.fragment),o=p(),_(r.$$.fragment),g=p(),_(u.$$.fragment)},l(f){y(t.$$.fragment,f),i=m(f),y(n.$$.fragment,f),o=m(f),y(r.$$.fragment,f),g=m(f),y(u.$$.fragment,f)},m(f,c){b(t,f,c),a(f,i,c),b(n,f,c),a(f,o,c),b(r,f,c),a(f,g,c),b(u,f,c),Z=!0},p(f,c){const j={};c&2&&(j.$$scope={dirty:c,ctx:f}),t.$set(j);const d={};c&2&&(d.$$scope={dirty:c,ctx:f}),n.$set(d);const J={};c&2&&(J.$$scope={dirty:c,ctx:f}),r.$set(J);const P={};c&2&&(P.$$scope={dirty:c,ctx:f}),u.$set(P)},i(f){Z||(w(t.$$.fragment,f),w(n.$$.fragment,f),w(r.$$.fragment,f),w(u.$$.fragment,f),Z=!0)},o(f){M(t.$$.fragment,f),M(n.$$.fragment,f),M(r.$$.fragment,f),M(u.$$.fragment,f),Z=!1},d(f){f&&(l(i),l(o),l(g)),T(t,f),T(n,f),T(r,f),T(u,f)}}}function _t(h){let t,i,n,o,r,g,u,Z,f,c,j,d="Sequence lengths in the dataset can vary widely. When data is batched, sequences are padded to match the longest one in the batch, which can cause high memory usage, even if most sequences are relatively short.",J,P,x='<img src="https://huggingface.co/datasets/trl-lib/documentation-images/resolve/main/why_you_should_truncate.png" alt="Truncation prompt completion" width="600"/>',F,$,k="To reduce memory usage, it’s important to truncate sequences to a reasonable length. While TRL trainers truncate sequences by default, you may want to adjust the default truncation length to better align with your specific use case.",re,L,oe,N,fe,H,pe,q,Re='<a href="#truncation">Truncation</a> has several drawbacks:',me,I,xe="<li><strong>Loss of information</strong>: Key data at the end of a sequence may be discarded.</li> <li><strong>Choosing truncation length</strong>: Too short loses data; too long undermines efficiency.</li>",$e,V,Ge='Packing, introduced in <a href="https://huggingface.co/papers/1910.10683" rel="nofollow">Raffel et al., 2020</a>, addresses these issues by grouping sequences instead of truncating. It concatenates and splits dataset sequences into the desired lengths.',ue,E,Fe='<img src="https://huggingface.co/datasets/trl-lib/documentation-images/resolve/main/packing.png" alt="Packing" width="600"/>',ge,z,Le='Packing eliminates padding, preserves all sequence information, and allows for flexible sequence lengths, making it a more efficient alternative to truncation. To enable packing, use <code>packing=True</code> in the <a href="/docs/trl/main/en/sft_trainer#trl.SFTConfig">SFTConfig</a>:',ce,B,de,O,he,Y,_e,A,He="Padding-free batching is an alternative approach for reducing memory usage. In this method, a batch is first sampled and then flattened into a single sequence, avoiding padding. Unlike packing, which can result in incomplete sequences by combining parts of different samples, padding-free batching ensures that all sequences remain complete and intact.",ye,Q,Ee='<img src="https://huggingface.co/datasets/trl-lib/documentation-images/resolve/main/padding-free.png" alt="Padding-free batching" width="600"/>',be,S,we,D,Me,K,Te,ee,Oe='When using DeepSpeed ZeRO-3, model weights are sharded across multiple GPUs. Online methods involve generating completions from the model as part of the training process. During this step, the model weights are temporarily gathered on a single GPU for generation. For very large models, this gathering can lead to out-of-memory (OOM) errors, as described in this issue: <a href="https://github.com/huggingface/trl/issues/2250#issue-2598304204" rel="nofollow">#2250</a>.',ve,te,Qe="If you encounter this issue, you can disable the gathering of model weights for generation by setting the following parameter:",Ce,X,Ue,ne,Se="This adjustment prevents model weights from being gathered, avoiding OOM errors, but it may result in slower generation speeds.",Ze,se,je,ae,Je;return r=new ie({props:{title:"Reducing Memory Usage",local:"reducing-memory-usage",headingTag:"h1"}}),u=new Pe({props:{warning:!0,$$slots:{default:[st]},$$scope:{ctx:h}}}),f=new ie({props:{title:"Truncation",local:"truncation",headingTag:"h2"}}),L=new ke({props:{id:"dpo",options:["DPO","SFT"],$$slots:{default:[it]},$$scope:{ctx:h}}}),N=new ie({props:{title:"Packing",local:"packing",headingTag:"h2"}}),H=new Pe({props:{$$slots:{default:[rt]},$$scope:{ctx:h}}}),B=new G({props:{code:"ZnJvbSUyMHRybCUyMGltcG9ydCUyMFNGVENvbmZpZyUwQSUwQXRyYWluaW5nX2FyZ3MlMjAlM0QlMjBTRlRDb25maWcoLi4uJTJDJTIwcGFja2luZyUzRFRydWUlMkMlMjBtYXhfbGVuZ3RoJTNENTEyKQ==",highlighted:`<span class="hljs-keyword">from</span> trl <span class="hljs-keyword">import</span> SFTConfig

training_args = SFTConfig(..., packing=<span class="hljs-literal">True</span>, max_length=<span class="hljs-number">512</span>)`,wrap:!1}}),O=new Pe({props:{warning:!0,$$slots:{default:[ot]},$$scope:{ctx:h}}}),Y=new ie({props:{title:"Padding-free",local:"padding-free",headingTag:"h2"}}),S=new Pe({props:{warning:!0,$$slots:{default:[ft]},$$scope:{ctx:h}}}),D=new ke({props:{id:"padding-free",options:["DPO","SFT"],$$slots:{default:[$t]},$$scope:{ctx:h}}}),K=new ie({props:{title:"Disabling model gathering for generation in online methods",local:"disabling-model-gathering-for-generation-in-online-methods",headingTag:"h2"}}),X=new ke({props:{id:"ds3_gather_for_generation",options:["GRPO","Online DPO","PPO","RLOO"],$$slots:{default:[ht]},$$scope:{ctx:h}}}),se=new nt({props:{source:"https://github.com/huggingface/trl/blob/main/docs/source/reducing_memory_usage.md"}}),{c(){t=v("meta"),i=p(),n=v("p"),o=p(),_(r.$$.fragment),g=p(),_(u.$$.fragment),Z=p(),_(f.$$.fragment),c=p(),j=v("p"),j.textContent=d,J=p(),P=v("div"),P.innerHTML=x,F=p(),$=v("p"),$.textContent=k,re=p(),_(L.$$.fragment),oe=p(),_(N.$$.fragment),fe=p(),_(H.$$.fragment),pe=p(),q=v("p"),q.innerHTML=Re,me=p(),I=v("ol"),I.innerHTML=xe,$e=p(),V=v("p"),V.innerHTML=Ge,ue=p(),E=v("div"),E.innerHTML=Fe,ge=p(),z=v("p"),z.innerHTML=Le,ce=p(),_(B.$$.fragment),de=p(),_(O.$$.fragment),he=p(),_(Y.$$.fragment),_e=p(),A=v("p"),A.textContent=He,ye=p(),Q=v("div"),Q.innerHTML=Ee,be=p(),_(S.$$.fragment),we=p(),_(D.$$.fragment),Me=p(),_(K.$$.fragment),Te=p(),ee=v("p"),ee.innerHTML=Oe,ve=p(),te=v("p"),te.textContent=Qe,Ce=p(),_(X.$$.fragment),Ue=p(),ne=v("p"),ne.textContent=Se,Ze=p(),_(se.$$.fragment),je=p(),ae=v("p"),this.h()},l(e){const s=et("svelte-u9bgzb",document.head);t=C(s,"META",{name:!0,content:!0}),s.forEach(l),i=m(e),n=C(e,"P",{}),ze(n).forEach(l),o=m(e),y(r.$$.fragment,e),g=m(e),y(u.$$.fragment,e),Z=m(e),y(f.$$.fragment,e),c=m(e),j=C(e,"P",{"data-svelte-h":!0}),U(j)!=="svelte-1lhmd25"&&(j.textContent=d),J=m(e),P=C(e,"DIV",{class:!0,"data-svelte-h":!0}),U(P)!=="svelte-4pi4g0"&&(P.innerHTML=x),F=m(e),$=C(e,"P",{"data-svelte-h":!0}),U($)!=="svelte-15aiza5"&&($.textContent=k),re=m(e),y(L.$$.fragment,e),oe=m(e),y(N.$$.fragment,e),fe=m(e),y(H.$$.fragment,e),pe=m(e),q=C(e,"P",{"data-svelte-h":!0}),U(q)!=="svelte-6rm19q"&&(q.innerHTML=Re),me=m(e),I=C(e,"OL",{"data-svelte-h":!0}),U(I)!=="svelte-17zhqal"&&(I.innerHTML=xe),$e=m(e),V=C(e,"P",{"data-svelte-h":!0}),U(V)!=="svelte-1016bgl"&&(V.innerHTML=Ge),ue=m(e),E=C(e,"DIV",{class:!0,"data-svelte-h":!0}),U(E)!=="svelte-ah8vi2"&&(E.innerHTML=Fe),ge=m(e),z=C(e,"P",{"data-svelte-h":!0}),U(z)!=="svelte-dmfmdn"&&(z.innerHTML=Le),ce=m(e),y(B.$$.fragment,e),de=m(e),y(O.$$.fragment,e),he=m(e),y(Y.$$.fragment,e),_e=m(e),A=C(e,"P",{"data-svelte-h":!0}),U(A)!=="svelte-igqq2g"&&(A.textContent=He),ye=m(e),Q=C(e,"DIV",{class:!0,"data-svelte-h":!0}),U(Q)!=="svelte-k4w76c"&&(Q.innerHTML=Ee),be=m(e),y(S.$$.fragment,e),we=m(e),y(D.$$.fragment,e),Me=m(e),y(K.$$.fragment,e),Te=m(e),ee=C(e,"P",{"data-svelte-h":!0}),U(ee)!=="svelte-1dxf8zd"&&(ee.innerHTML=Oe),ve=m(e),te=C(e,"P",{"data-svelte-h":!0}),U(te)!=="svelte-gun0x9"&&(te.textContent=Qe),Ce=m(e),y(X.$$.fragment,e),Ue=m(e),ne=C(e,"P",{"data-svelte-h":!0}),U(ne)!=="svelte-14mh10t"&&(ne.textContent=Se),Ze=m(e),y(se.$$.fragment,e),je=m(e),ae=C(e,"P",{}),ze(ae).forEach(l),this.h()},h(){le(t,"name","hf:doc:metadata"),le(t,"content",yt),le(P,"class","flex justify-center"),le(E,"class","flex justify-center"),le(Q,"class","flex justify-center")},m(e,s){tt(document.head,t),a(e,i,s),a(e,n,s),a(e,o,s),b(r,e,s),a(e,g,s),b(u,e,s),a(e,Z,s),b(f,e,s),a(e,c,s),a(e,j,s),a(e,J,s),a(e,P,s),a(e,F,s),a(e,$,s),a(e,re,s),b(L,e,s),a(e,oe,s),b(N,e,s),a(e,fe,s),b(H,e,s),a(e,pe,s),a(e,q,s),a(e,me,s),a(e,I,s),a(e,$e,s),a(e,V,s),a(e,ue,s),a(e,E,s),a(e,ge,s),a(e,z,s),a(e,ce,s),b(B,e,s),a(e,de,s),b(O,e,s),a(e,he,s),b(Y,e,s),a(e,_e,s),a(e,A,s),a(e,ye,s),a(e,Q,s),a(e,be,s),b(S,e,s),a(e,we,s),b(D,e,s),a(e,Me,s),b(K,e,s),a(e,Te,s),a(e,ee,s),a(e,ve,s),a(e,te,s),a(e,Ce,s),b(X,e,s),a(e,Ue,s),a(e,ne,s),a(e,Ze,s),b(se,e,s),a(e,je,s),a(e,ae,s),Je=!0},p(e,[s]){const De={};s&2&&(De.$$scope={dirty:s,ctx:e}),u.$set(De);const Xe={};s&2&&(Xe.$$scope={dirty:s,ctx:e}),L.$set(Xe);const We={};s&2&&(We.$$scope={dirty:s,ctx:e}),H.$set(We);const Ne={};s&2&&(Ne.$$scope={dirty:s,ctx:e}),O.$set(Ne);const qe={};s&2&&(qe.$$scope={dirty:s,ctx:e}),S.$set(qe);const Ie={};s&2&&(Ie.$$scope={dirty:s,ctx:e}),D.$set(Ie);const Ve={};s&2&&(Ve.$$scope={dirty:s,ctx:e}),X.$set(Ve)},i(e){Je||(w(r.$$.fragment,e),w(u.$$.fragment,e),w(f.$$.fragment,e),w(L.$$.fragment,e),w(N.$$.fragment,e),w(H.$$.fragment,e),w(B.$$.fragment,e),w(O.$$.fragment,e),w(Y.$$.fragment,e),w(S.$$.fragment,e),w(D.$$.fragment,e),w(K.$$.fragment,e),w(X.$$.fragment,e),w(se.$$.fragment,e),Je=!0)},o(e){M(r.$$.fragment,e),M(u.$$.fragment,e),M(f.$$.fragment,e),M(L.$$.fragment,e),M(N.$$.fragment,e),M(H.$$.fragment,e),M(B.$$.fragment,e),M(O.$$.fragment,e),M(Y.$$.fragment,e),M(S.$$.fragment,e),M(D.$$.fragment,e),M(K.$$.fragment,e),M(X.$$.fragment,e),M(se.$$.fragment,e),Je=!1},d(e){e&&(l(i),l(n),l(o),l(g),l(Z),l(c),l(j),l(J),l(P),l(F),l($),l(re),l(oe),l(fe),l(pe),l(q),l(me),l(I),l($e),l(V),l(ue),l(E),l(ge),l(z),l(ce),l(de),l(he),l(_e),l(A),l(ye),l(Q),l(be),l(we),l(Me),l(Te),l(ee),l(ve),l(te),l(Ce),l(Ue),l(ne),l(Ze),l(je),l(ae)),l(t),T(r,e),T(u,e),T(f,e),T(L,e),T(N,e),T(H,e),T(B,e),T(O,e),T(Y,e),T(S,e),T(D,e),T(K,e),T(X,e),T(se,e)}}}const yt='{"title":"Reducing Memory Usage","local":"reducing-memory-usage","sections":[{"title":"Truncation","local":"truncation","sections":[],"depth":2},{"title":"Packing","local":"packing","sections":[],"depth":2},{"title":"Padding-free","local":"padding-free","sections":[],"depth":2},{"title":"Disabling model gathering for generation in online methods","local":"disabling-model-gathering-for-generation-in-online-methods","sections":[],"depth":2}],"depth":1}';function bt(h){return Ye(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Zt extends Ae{constructor(t){super(),Ke(this,t,bt,_t,Be,{})}}export{Zt as component};
