import{s as Pt,o as Qt,n as ot}from"../chunks/scheduler.6062bdaf.js";import{S as Yt,i as Ft,g as l,s as o,r as m,A as At,h as d,f as a,c as r,j as st,u as f,x as T,k as at,y as c,a as i,v as g,d as u,t as w,w as y}from"../chunks/index.4bca734e.js";import{T as Tt}from"../chunks/Tip.b9ac1f03.js";import{D as bt}from"../chunks/Docstring.ed07512f.js";import{C as Kt}from"../chunks/CodeBlock.fa01571c.js";import{E as Ot}from"../chunks/ExampleCodeBlock.823fb173.js";import{H as nt}from"../chunks/Heading.723dceba.js";function te(v){let e,p=`If one of the model’s tensor is bigger than <code>max_shard_size</code>, it will end up in its own shard which will have a
size greater than <code>max_shard_size</code>.`;return{c(){e=l("p"),e.innerHTML=p},l(n){e=d(n,"P",{"data-svelte-h":!0}),T(e)!=="svelte-16sq104"&&(e.innerHTML=p)},m(n,h){i(n,e,h)},p:ot,d(n){n&&a(e)}}}function ee(v){let e,p=`If one of the model’s tensor is bigger than <code>max_shard_size</code>, it will end up in its own shard which will have a
size greater than <code>max_shard_size</code>.`;return{c(){e=l("p"),e.innerHTML=p},l(n){e=d(n,"P",{"data-svelte-h":!0}),T(e)!=="svelte-16sq104"&&(e.innerHTML=p)},m(n,h){i(n,e,h)},p:ot,d(n){n&&a(e)}}}function se(v){let e,p=`If one of the model’s tensor is bigger than <code>max_shard_size</code>, it will end up in its own shard which will have a
size greater than <code>max_shard_size</code>.`;return{c(){e=l("p"),e.innerHTML=p},l(n){e=d(n,"P",{"data-svelte-h":!0}),T(e)!=="svelte-16sq104"&&(e.innerHTML=p)},m(n,h){i(n,e,h)},p:ot,d(n){n&&a(e)}}}function ae(v){let e,p="Example:",n,h,C;return h=new Kt({props:{code:"aW1wb3J0JTIwanNvbiUwQWltcG9ydCUyMG9zJTBBZnJvbSUyMHNhZmV0ZW5zb3JzLnRvcmNoJTIwaW1wb3J0JTIwc2F2ZV9maWxlJTIwYXMlMjBzYWZlX3NhdmVfZmlsZSUwQWZyb20lMjBodWdnaW5nZmFjZV9odWIlMjBpbXBvcnQlMjBzcGxpdF90b3JjaF9zdGF0ZV9kaWN0X2ludG9fc2hhcmRzJTBBJTBBZGVmJTIwc2F2ZV9zdGF0ZV9kaWN0KHN0YXRlX2RpY3QlM0ElMjBEaWN0JTVCc3RyJTJDJTIwdG9yY2guVGVuc29yJTVEJTJDJTIwc2F2ZV9kaXJlY3RvcnklM0ElMjBzdHIpJTNBJTBBJTIwJTIwJTIwJTIwc3RhdGVfZGljdF9zcGxpdCUyMCUzRCUyMHNwbGl0X3RvcmNoX3N0YXRlX2RpY3RfaW50b19zaGFyZHMoc3RhdGVfZGljdCklMEElMjAlMjAlMjAlMjBmb3IlMjBmaWxlbmFtZSUyQyUyMHRlbnNvcnMlMjBpbiUyMHN0YXRlX2RpY3Rfc3BsaXQuZmlsZW5hbWVfdG9fdGVuc29ycy52YWx1ZXMoKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHNoYXJkJTIwJTNEJTIwJTdCdGVuc29yJTNBJTIwc3RhdGVfZGljdCU1QnRlbnNvciU1RCUyMGZvciUyMHRlbnNvciUyMGluJTIwdGVuc29ycyU3RCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHNhZmVfc2F2ZV9maWxlKCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHNoYXJkJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwb3MucGF0aC5qb2luKHNhdmVfZGlyZWN0b3J5JTJDJTIwZmlsZW5hbWUpJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbWV0YWRhdGElM0QlN0IlMjJmb3JtYXQlMjIlM0ElMjAlMjJwdCUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCklMEElMjAlMjAlMjAlMjBpZiUyMHN0YXRlX2RpY3Rfc3BsaXQuaXNfc2hhcmRlZCUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGluZGV4JTIwJTNEJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybWV0YWRhdGElMjIlM0ElMjBzdGF0ZV9kaWN0X3NwbGl0Lm1ldGFkYXRhJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyd2VpZ2h0X21hcCUyMiUzQSUyMHN0YXRlX2RpY3Rfc3BsaXQudGVuc29yX3RvX2ZpbGVuYW1lJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwd2l0aCUyMG9wZW4ob3MucGF0aC5qb2luKHNhdmVfZGlyZWN0b3J5JTJDJTIwJTIybW9kZWwuc2FmZXRlbnNvcnMuaW5kZXguanNvbiUyMiklMkMlMjAlMjJ3JTIyKSUyMGFzJTIwZiUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGYud3JpdGUoanNvbi5kdW1wcyhpbmRleCUyQyUyMGluZGVudCUzRDIpKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> json
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> os
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> safetensors.torch <span class="hljs-keyword">import</span> save_file <span class="hljs-keyword">as</span> safe_save_file
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> split_torch_state_dict_into_shards

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">save_state_dict</span>(<span class="hljs-params">state_dict: <span class="hljs-type">Dict</span>[<span class="hljs-built_in">str</span>, torch.Tensor], save_directory: <span class="hljs-built_in">str</span></span>):
<span class="hljs-meta">... </span>    state_dict_split = split_torch_state_dict_into_shards(state_dict)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> filename, tensors <span class="hljs-keyword">in</span> state_dict_split.filename_to_tensors.values():
<span class="hljs-meta">... </span>        shard = {tensor: state_dict[tensor] <span class="hljs-keyword">for</span> tensor <span class="hljs-keyword">in</span> tensors}
<span class="hljs-meta">... </span>        safe_save_file(
<span class="hljs-meta">... </span>            shard,
<span class="hljs-meta">... </span>            os.path.join(save_directory, filename),
<span class="hljs-meta">... </span>            metadata={<span class="hljs-string">&quot;format&quot;</span>: <span class="hljs-string">&quot;pt&quot;</span>},
<span class="hljs-meta">... </span>        )
<span class="hljs-meta">... </span>    <span class="hljs-keyword">if</span> state_dict_split.is_sharded:
<span class="hljs-meta">... </span>        index = {
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;metadata&quot;</span>: state_dict_split.metadata,
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;weight_map&quot;</span>: state_dict_split.tensor_to_filename,
<span class="hljs-meta">... </span>        }
<span class="hljs-meta">... </span>        <span class="hljs-keyword">with</span> <span class="hljs-built_in">open</span>(os.path.join(save_directory, <span class="hljs-string">&quot;model.safetensors.index.json&quot;</span>), <span class="hljs-string">&quot;w&quot;</span>) <span class="hljs-keyword">as</span> f:
<span class="hljs-meta">... </span>            f.write(json.dumps(index, indent=<span class="hljs-number">2</span>))`,wrap:!1}}),{c(){e=l("p"),e.textContent=p,n=o(),m(h.$$.fragment)},l(_){e=d(_,"P",{"data-svelte-h":!0}),T(e)!=="svelte-11lpom8"&&(e.textContent=p),n=r(_),f(h.$$.fragment,_)},m(_,I){i(_,e,I),i(_,n,I),g(h,_,I),C=!0},p:ot,i(_){C||(u(h.$$.fragment,_),C=!0)},o(_){w(h.$$.fragment,_),C=!1},d(_){_&&(a(e),a(n)),y(h,_)}}}function ne(v){let e,p=`If one of the model’s tensor is bigger than <code>max_shard_size</code>, it will end up in its own shard which will have a
size greater than <code>max_shard_size</code>.`;return{c(){e=l("p"),e.innerHTML=p},l(n){e=d(n,"P",{"data-svelte-h":!0}),T(e)!=="svelte-16sq104"&&(e.innerHTML=p)},m(n,h){i(n,e,h)},p:ot,d(n){n&&a(e)}}}function ie(v){let e,p,n,h,C,_,I,Dt="<code>huggingface_hub</code> contains helpers to help ML libraries to serialize models weights in a standardized way. This part of the lib is still under development and will be improved in future releases. The goal is to harmonize how weights are serialized on the Hub, both to remove code duplication across libraries and to foster conventions on the Hub.",rt,S,lt,H,Zt="At the moment, this module contains a single helper that takes a state dictionary (e.g. a mapping between layer names and related tensors) and split it into several shards, while creating a proper index in the process. This helper is available for <code>torch</code>, <code>tensorflow</code> and <code>numpy</code> tensors and is designed to be easily extended to any other ML frameworks.",dt,R,ct,$,V,$t,Q,St="Split a model state dictionary in shards so that each shard is smaller than a given size.",Mt,Y,Ht=`The shards are determined by iterating through the <code>state_dict</code> in the order of its keys. There is no optimization
made to make each shard as close as possible to the maximum size passed. For example, if the limit is 10GB and we
have tensors of sizes [6GB, 6GB, 2GB, 6GB, 2GB, 2GB] they will get sharded as [6GB], [6+2GB], [6+2+2GB] and not
[6+2+2GB], [6+2GB], [6GB].`,Jt,z,ht,N,pt,M,q,xt,F,Rt="Split a model state dictionary in shards so that each shard is smaller than a given size.",vt,A,Vt=`The shards are determined by iterating through the <code>state_dict</code> in the order of its keys. There is no optimization
made to make each shard as close as possible to the maximum size passed. For example, if the limit is 10GB and we
have tensors of sizes [6GB, 6GB, 2GB, 6GB, 2GB, 2GB] they will get sharded as [6GB], [6+2GB], [6+2+2GB] and not
[6+2+2GB], [6+2GB], [6GB].`,Ct,j,_t,W,mt,b,X,It,K,Nt="Split a model state dictionary in shards so that each shard is smaller than a given size.",Gt,O,qt=`The shards are determined by iterating through the <code>state_dict</code> in the order of its keys. There is no optimization
made to make each shard as close as possible to the maximum size passed. For example, if the limit is 10GB and we
have tensors of sizes [6GB, 6GB, 2GB, 6GB, 2GB, 2GB] they will get sharded as [6GB], [6+2GB], [6+2+2GB] and not
[6+2+2GB], [6+2GB], [6GB].`,Ut,k,Bt,D,ft,L,gt,E,Wt='This is the underlying factory from which each framework-specific helper is derived. In practice, you are not expected to use this factory directly except if you need to adapt it to a framework that is not yet supported. If that is the case, please let us know by <a href="https://github.com/huggingface/huggingface_hub/issues/new" rel="nofollow">opening a new issue</a> on the <code>huggingface_hub</code> repo.',ut,J,P,zt,tt,Xt="Split a model state dictionary in shards so that each shard is smaller than a given size.",jt,et,Lt=`The shards are determined by iterating through the <code>state_dict</code> in the order of its keys. There is no optimization
made to make each shard as close as possible to the maximum size passed. For example, if the limit is 10GB and we
have tensors of sizes [6GB, 6GB, 2GB, 6GB, 2GB, 2GB] they will get sharded as [6GB], [6+2GB], [6+2+2GB] and not
[6+2+2GB], [6+2GB], [6GB].`,kt,Z,wt,it,yt;return C=new nt({props:{title:"Serialization",local:"serialization",headingTag:"h1"}}),S=new nt({props:{title:"Split state dict into shards",local:"split-state-dict-into-shards",headingTag:"h2"}}),R=new nt({props:{title:"split_numpy_state_dict_into_shards",local:"huggingface_hub.split_numpy_state_dict_into_shards",headingTag:"h3"}}),V=new bt({props:{name:"huggingface_hub.split_numpy_state_dict_into_shards",anchor:"huggingface_hub.split_numpy_state_dict_into_shards",parameters:[{name:"state_dict",val:": Dict"},{name:"filename_pattern",val:": str = 'model{suffix}.safetensors'"},{name:"max_shard_size",val:": int = 5000000000"}],parametersDescription:[{anchor:"huggingface_hub.split_numpy_state_dict_into_shards.state_dict",description:`<strong>state_dict</strong> (<code>Dict[str, np.ndarray]</code>) &#x2014;
The state dictionary to save.`,name:"state_dict"},{anchor:"huggingface_hub.split_numpy_state_dict_into_shards.filename_pattern",description:`<strong>filename_pattern</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The pattern to generate the files names in which the model will be saved. Pattern must be a string that
can be formatted with <code>filename_pattern.format(suffix=...)</code> and must contain the keyword <code>suffix</code>
Defaults to <code>&quot;model{suffix}.safetensors&quot;</code>.`,name:"filename_pattern"},{anchor:"huggingface_hub.split_numpy_state_dict_into_shards.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>) &#x2014;
The maximum size of each shard, in bytes. Defaults to 5GB.`,name:"max_shard_size"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/serialization/_numpy.py#L25",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>StateDictSplit</code> object containing the shards and the index to retrieve them.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>StateDictSplit</code></p>
`}}),z=new Tt({props:{warning:!0,$$slots:{default:[te]},$$scope:{ctx:v}}}),N=new nt({props:{title:"split_tf_state_dict_into_shards",local:"huggingface_hub.split_tf_state_dict_into_shards",headingTag:"h3"}}),q=new bt({props:{name:"huggingface_hub.split_tf_state_dict_into_shards",anchor:"huggingface_hub.split_tf_state_dict_into_shards",parameters:[{name:"state_dict",val:": Dict"},{name:"filename_pattern",val:": str = 'tf_model{suffix}.h5'"},{name:"max_shard_size",val:": int = 5000000000"}],parametersDescription:[{anchor:"huggingface_hub.split_tf_state_dict_into_shards.state_dict",description:`<strong>state_dict</strong> (<code>Dict[str, Tensor]</code>) &#x2014;
The state dictionary to save.`,name:"state_dict"},{anchor:"huggingface_hub.split_tf_state_dict_into_shards.filename_pattern",description:`<strong>filename_pattern</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The pattern to generate the files names in which the model will be saved. Pattern must be a string that
can be formatted with <code>filename_pattern.format(suffix=...)</code> and must contain the keyword <code>suffix</code>
Defaults to <code>&quot;tf_model{suffix}.h5&quot;</code>.`,name:"filename_pattern"},{anchor:"huggingface_hub.split_tf_state_dict_into_shards.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>) &#x2014;
The maximum size of each shard, in bytes. Defaults to 5GB.`,name:"max_shard_size"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/serialization/_tensorflow.py#L27",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>StateDictSplit</code> object containing the shards and the index to retrieve them.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>StateDictSplit</code></p>
`}}),j=new Tt({props:{warning:!0,$$slots:{default:[ee]},$$scope:{ctx:v}}}),W=new nt({props:{title:"split_torch_state_dict_into_shards",local:"huggingface_hub.split_torch_state_dict_into_shards",headingTag:"h3"}}),X=new bt({props:{name:"huggingface_hub.split_torch_state_dict_into_shards",anchor:"huggingface_hub.split_torch_state_dict_into_shards",parameters:[{name:"state_dict",val:": Dict"},{name:"filename_pattern",val:": str = 'model{suffix}.safetensors'"},{name:"max_shard_size",val:": int = 5000000000"}],parametersDescription:[{anchor:"huggingface_hub.split_torch_state_dict_into_shards.state_dict",description:`<strong>state_dict</strong> (<code>Dict[str, torch.Tensor]</code>) &#x2014;
The state dictionary to save.`,name:"state_dict"},{anchor:"huggingface_hub.split_torch_state_dict_into_shards.filename_pattern",description:`<strong>filename_pattern</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The pattern to generate the files names in which the model will be saved. Pattern must be a string that
can be formatted with <code>filename_pattern.format(suffix=...)</code> and must contain the keyword <code>suffix</code>
Defaults to <code>&quot;model{suffix}.safetensors&quot;</code>.`,name:"filename_pattern"},{anchor:"huggingface_hub.split_torch_state_dict_into_shards.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>) &#x2014;
The maximum size of each shard, in bytes. Defaults to 5GB.`,name:"max_shard_size"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/serialization/_torch.py#L27",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>StateDictSplit</code> object containing the shards and the index to retrieve them.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>StateDictSplit</code></p>
`}}),k=new Tt({props:{warning:!0,$$slots:{default:[se]},$$scope:{ctx:v}}}),D=new Ot({props:{anchor:"huggingface_hub.split_torch_state_dict_into_shards.example",$$slots:{default:[ae]},$$scope:{ctx:v}}}),L=new nt({props:{title:"split_state_dict_into_shards_factory",local:"huggingface_hub.split_state_dict_into_shards_factory",headingTag:"h3"}}),P=new bt({props:{name:"huggingface_hub.split_state_dict_into_shards_factory",anchor:"huggingface_hub.split_state_dict_into_shards_factory",parameters:[{name:"state_dict",val:": Dict"},{name:"get_tensor_size",val:": Callable"},{name:"get_storage_id",val:": Callable = <function <lambda> at 0x7fdb098c93f0>"},{name:"filename_pattern",val:": str = 'model{suffix}.safetensors'"},{name:"max_shard_size",val:": int = 5000000000"}],parametersDescription:[{anchor:"huggingface_hub.split_state_dict_into_shards_factory.state_dict",description:`<strong>state_dict</strong> (<code>Dict[str, Tensor]</code>) &#x2014;
The state dictionary to save.`,name:"state_dict"},{anchor:"huggingface_hub.split_state_dict_into_shards_factory.get_tensor_size",description:`<strong>get_tensor_size</strong> (<code>Callable[[Tensor], int]</code>) &#x2014;
A function that returns the size of a tensor in bytes.`,name:"get_tensor_size"},{anchor:"huggingface_hub.split_state_dict_into_shards_factory.get_storage_id",description:`<strong>get_storage_id</strong> (<code>Callable[[Tensor], Optional[Any]]</code>, <em>optional</em>) &#x2014;
A function that returns a unique identifier to a tensor storage. Multiple different tensors can share the
same underlying storage. This identifier is guaranteed to be unique and constant for this tensor&#x2019;s storage
during its lifetime. Two tensor storages with non-overlapping lifetimes may have the same id.`,name:"get_storage_id"},{anchor:"huggingface_hub.split_state_dict_into_shards_factory.filename_pattern",description:`<strong>filename_pattern</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The pattern to generate the files names in which the model will be saved. Pattern must be a string that
can be formatted with <code>filename_pattern.format(suffix=...)</code> and must contain the keyword <code>suffix</code>
Defaults to <code>&quot;model{suffix}.safetensors&quot;</code>.`,name:"filename_pattern"},{anchor:"huggingface_hub.split_state_dict_into_shards_factory.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>) &#x2014;
The maximum size of each shard, in bytes. Defaults to 5GB.`,name:"max_shard_size"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/serialization/_base.py#L43",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>StateDictSplit</code> object containing the shards and the index to retrieve them.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>StateDictSplit</code></p>
`}}),Z=new Tt({props:{warning:!0,$$slots:{default:[ne]},$$scope:{ctx:v}}}),{c(){e=l("meta"),p=o(),n=l("p"),h=o(),m(C.$$.fragment),_=o(),I=l("p"),I.innerHTML=Dt,rt=o(),m(S.$$.fragment),lt=o(),H=l("p"),H.innerHTML=Zt,dt=o(),m(R.$$.fragment),ct=o(),$=l("div"),m(V.$$.fragment),$t=o(),Q=l("p"),Q.textContent=St,Mt=o(),Y=l("p"),Y.innerHTML=Ht,Jt=o(),m(z.$$.fragment),ht=o(),m(N.$$.fragment),pt=o(),M=l("div"),m(q.$$.fragment),xt=o(),F=l("p"),F.textContent=Rt,vt=o(),A=l("p"),A.innerHTML=Vt,Ct=o(),m(j.$$.fragment),_t=o(),m(W.$$.fragment),mt=o(),b=l("div"),m(X.$$.fragment),It=o(),K=l("p"),K.textContent=Nt,Gt=o(),O=l("p"),O.innerHTML=qt,Ut=o(),m(k.$$.fragment),Bt=o(),m(D.$$.fragment),ft=o(),m(L.$$.fragment),gt=o(),E=l("p"),E.innerHTML=Wt,ut=o(),J=l("div"),m(P.$$.fragment),zt=o(),tt=l("p"),tt.textContent=Xt,jt=o(),et=l("p"),et.innerHTML=Lt,kt=o(),m(Z.$$.fragment),wt=o(),it=l("p"),this.h()},l(t){const s=At("svelte-u9bgzb",document.head);e=d(s,"META",{name:!0,content:!0}),s.forEach(a),p=r(t),n=d(t,"P",{}),st(n).forEach(a),h=r(t),f(C.$$.fragment,t),_=r(t),I=d(t,"P",{"data-svelte-h":!0}),T(I)!=="svelte-1v36qzv"&&(I.innerHTML=Dt),rt=r(t),f(S.$$.fragment,t),lt=r(t),H=d(t,"P",{"data-svelte-h":!0}),T(H)!=="svelte-b8tyi2"&&(H.innerHTML=Zt),dt=r(t),f(R.$$.fragment,t),ct=r(t),$=d(t,"DIV",{class:!0});var G=st($);f(V.$$.fragment,G),$t=r(G),Q=d(G,"P",{"data-svelte-h":!0}),T(Q)!=="svelte-1q1pe7b"&&(Q.textContent=St),Mt=r(G),Y=d(G,"P",{"data-svelte-h":!0}),T(Y)!=="svelte-17rio2z"&&(Y.innerHTML=Ht),Jt=r(G),f(z.$$.fragment,G),G.forEach(a),ht=r(t),f(N.$$.fragment,t),pt=r(t),M=d(t,"DIV",{class:!0});var U=st(M);f(q.$$.fragment,U),xt=r(U),F=d(U,"P",{"data-svelte-h":!0}),T(F)!=="svelte-1q1pe7b"&&(F.textContent=Rt),vt=r(U),A=d(U,"P",{"data-svelte-h":!0}),T(A)!=="svelte-17rio2z"&&(A.innerHTML=Vt),Ct=r(U),f(j.$$.fragment,U),U.forEach(a),_t=r(t),f(W.$$.fragment,t),mt=r(t),b=d(t,"DIV",{class:!0});var x=st(b);f(X.$$.fragment,x),It=r(x),K=d(x,"P",{"data-svelte-h":!0}),T(K)!=="svelte-1q1pe7b"&&(K.textContent=Nt),Gt=r(x),O=d(x,"P",{"data-svelte-h":!0}),T(O)!=="svelte-17rio2z"&&(O.innerHTML=qt),Ut=r(x),f(k.$$.fragment,x),Bt=r(x),f(D.$$.fragment,x),x.forEach(a),ft=r(t),f(L.$$.fragment,t),gt=r(t),E=d(t,"P",{"data-svelte-h":!0}),T(E)!=="svelte-1hva642"&&(E.innerHTML=Wt),ut=r(t),J=d(t,"DIV",{class:!0});var B=st(J);f(P.$$.fragment,B),zt=r(B),tt=d(B,"P",{"data-svelte-h":!0}),T(tt)!=="svelte-1q1pe7b"&&(tt.textContent=Xt),jt=r(B),et=d(B,"P",{"data-svelte-h":!0}),T(et)!=="svelte-17rio2z"&&(et.innerHTML=Lt),kt=r(B),f(Z.$$.fragment,B),B.forEach(a),wt=r(t),it=d(t,"P",{}),st(it).forEach(a),this.h()},h(){at(e,"name","hf:doc:metadata"),at(e,"content",oe),at($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),at(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),at(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),at(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,s){c(document.head,e),i(t,p,s),i(t,n,s),i(t,h,s),g(C,t,s),i(t,_,s),i(t,I,s),i(t,rt,s),g(S,t,s),i(t,lt,s),i(t,H,s),i(t,dt,s),g(R,t,s),i(t,ct,s),i(t,$,s),g(V,$,null),c($,$t),c($,Q),c($,Mt),c($,Y),c($,Jt),g(z,$,null),i(t,ht,s),g(N,t,s),i(t,pt,s),i(t,M,s),g(q,M,null),c(M,xt),c(M,F),c(M,vt),c(M,A),c(M,Ct),g(j,M,null),i(t,_t,s),g(W,t,s),i(t,mt,s),i(t,b,s),g(X,b,null),c(b,It),c(b,K),c(b,Gt),c(b,O),c(b,Ut),g(k,b,null),c(b,Bt),g(D,b,null),i(t,ft,s),g(L,t,s),i(t,gt,s),i(t,E,s),i(t,ut,s),i(t,J,s),g(P,J,null),c(J,zt),c(J,tt),c(J,jt),c(J,et),c(J,kt),g(Z,J,null),i(t,wt,s),i(t,it,s),yt=!0},p(t,[s]){const G={};s&2&&(G.$$scope={dirty:s,ctx:t}),z.$set(G);const U={};s&2&&(U.$$scope={dirty:s,ctx:t}),j.$set(U);const x={};s&2&&(x.$$scope={dirty:s,ctx:t}),k.$set(x);const B={};s&2&&(B.$$scope={dirty:s,ctx:t}),D.$set(B);const Et={};s&2&&(Et.$$scope={dirty:s,ctx:t}),Z.$set(Et)},i(t){yt||(u(C.$$.fragment,t),u(S.$$.fragment,t),u(R.$$.fragment,t),u(V.$$.fragment,t),u(z.$$.fragment,t),u(N.$$.fragment,t),u(q.$$.fragment,t),u(j.$$.fragment,t),u(W.$$.fragment,t),u(X.$$.fragment,t),u(k.$$.fragment,t),u(D.$$.fragment,t),u(L.$$.fragment,t),u(P.$$.fragment,t),u(Z.$$.fragment,t),yt=!0)},o(t){w(C.$$.fragment,t),w(S.$$.fragment,t),w(R.$$.fragment,t),w(V.$$.fragment,t),w(z.$$.fragment,t),w(N.$$.fragment,t),w(q.$$.fragment,t),w(j.$$.fragment,t),w(W.$$.fragment,t),w(X.$$.fragment,t),w(k.$$.fragment,t),w(D.$$.fragment,t),w(L.$$.fragment,t),w(P.$$.fragment,t),w(Z.$$.fragment,t),yt=!1},d(t){t&&(a(p),a(n),a(h),a(_),a(I),a(rt),a(lt),a(H),a(dt),a(ct),a($),a(ht),a(pt),a(M),a(_t),a(mt),a(b),a(ft),a(gt),a(E),a(ut),a(J),a(wt),a(it)),a(e),y(C,t),y(S,t),y(R,t),y(V),y(z),y(N,t),y(q),y(j),y(W,t),y(X),y(k),y(D),y(L,t),y(P),y(Z)}}}const oe='{"title":"Serialization","local":"serialization","sections":[{"title":"Split state dict into shards","local":"split-state-dict-into-shards","sections":[{"title":"split_numpy_state_dict_into_shards","local":"huggingface_hub.split_numpy_state_dict_into_shards","sections":[],"depth":3},{"title":"split_tf_state_dict_into_shards","local":"huggingface_hub.split_tf_state_dict_into_shards","sections":[],"depth":3},{"title":"split_torch_state_dict_into_shards","local":"huggingface_hub.split_torch_state_dict_into_shards","sections":[],"depth":3},{"title":"split_state_dict_into_shards_factory","local":"huggingface_hub.split_state_dict_into_shards_factory","sections":[],"depth":3}],"depth":2}],"depth":1}';function re(v){return Qt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class fe extends Yt{constructor(e){super(),Ft(this,e,re,ie,Pt,{})}}export{fe as component};
