import{s as he,o as _e,n as ft}from"../chunks/scheduler.6062bdaf.js";import{S as pe,i as me,g as c,s as n,r as _,A as ge,h as d,f as a,c as i,j as et,u as p,x as w,k as st,y as l,a as r,v as m,d as g,t as f,w as u}from"../chunks/index.4bca734e.js";import{T as Ct}from"../chunks/Tip.b9ac1f03.js";import{D as gt}from"../chunks/Docstring.d7918b6d.js";import{C as fe}from"../chunks/CodeBlock.fa01571c.js";import{E as ue}from"../chunks/ExampleCodeBlock.d27cbfa4.js";import{H,E as $e}from"../chunks/EditOnGithub.74ab2baa.js";function be(J){let s,$=`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(){s=c("p"),s.innerHTML=$},l(o){s=d(o,"P",{"data-svelte-h":!0}),w(s)!=="svelte-16sq104"&&(s.innerHTML=$)},m(o,h){r(o,s,h)},p:ft,d(o){o&&a(s)}}}function we(J){let s,$=`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(){s=c("p"),s.innerHTML=$},l(o){s=d(o,"P",{"data-svelte-h":!0}),w(s)!=="svelte-16sq104"&&(s.innerHTML=$)},m(o,h){r(o,s,h)},p:ft,d(o){o&&a(s)}}}function Te(J){let s,$=`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(){s=c("p"),s.innerHTML=$},l(o){s=d(o,"P",{"data-svelte-h":!0}),w(s)!=="svelte-16sq104"&&(s.innerHTML=$)},m(o,h){r(o,s,h)},p:ft,d(o){o&&a(s)}}}function Me(J){let s,$="Example:",o,h,B;return h=new fe({props:{code:"aW1wb3J0JTIwanNvbiUwQWltcG9ydCUyMG9zJTBBZnJvbSUyMHNhZmV0ZW5zb3JzLnRvcmNoJTIwaW1wb3J0JTIwc2F2ZV9maWxlJTIwYXMlMjBzYWZlX3NhdmVfZmlsZSUwQWZyb20lMjBodWdnaW5nZmFjZV9odWIlMjBpbXBvcnQlMjBzcGxpdF90b3JjaF9zdGF0ZV9kaWN0X2ludG9fc2hhcmRzJTBBJTBBZGVmJTIwc2F2ZV9zdGF0ZV9kaWN0KHN0YXRlX2RpY3QlM0ElMjBEaWN0JTVCc3RyJTJDJTIwdG9yY2guVGVuc29yJTVEJTJDJTIwc2F2ZV9kaXJlY3RvcnklM0ElMjBzdHIpJTNBJTBBJTIwJTIwJTIwJTIwc3RhdGVfZGljdF9zcGxpdCUyMCUzRCUyMHNwbGl0X3RvcmNoX3N0YXRlX2RpY3RfaW50b19zaGFyZHMoc3RhdGVfZGljdCklMEElMjAlMjAlMjAlMjBmb3IlMjBmaWxlbmFtZSUyQyUyMHRlbnNvcnMlMjBpbiUyMHN0YXRlX2RpY3Rfc3BsaXQuZmlsZW5hbWVfdG9fdGVuc29ycy5pdGVtcygpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2hhcmQlMjAlM0QlMjAlN0J0ZW5zb3IlM0ElMjBzdGF0ZV9kaWN0JTVCdGVuc29yJTVEJTIwZm9yJTIwdGVuc29yJTIwaW4lMjB0ZW5zb3JzJTdEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2FmZV9zYXZlX2ZpbGUoJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2hhcmQlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvcy5wYXRoLmpvaW4oc2F2ZV9kaXJlY3RvcnklMkMlMjBmaWxlbmFtZSklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBtZXRhZGF0YSUzRCU3QiUyMmZvcm1hdCUyMiUzQSUyMCUyMnB0JTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKSUwQSUyMCUyMCUyMCUyMGlmJTIwc3RhdGVfZGljdF9zcGxpdC5pc19zaGFyZGVkJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaW5kZXglMjAlM0QlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJtZXRhZGF0YSUyMiUzQSUyMHN0YXRlX2RpY3Rfc3BsaXQubWV0YWRhdGElMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJ3ZWlnaHRfbWFwJTIyJTNBJTIwc3RhdGVfZGljdF9zcGxpdC50ZW5zb3JfdG9fZmlsZW5hbWUlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0QlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB3aXRoJTIwb3Blbihvcy5wYXRoLmpvaW4oc2F2ZV9kaXJlY3RvcnklMkMlMjAlMjJtb2RlbC5zYWZldGVuc29ycy5pbmRleC5qc29uJTIyKSUyQyUyMCUyMnclMjIpJTIwYXMlMjBmJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZi53cml0ZShqc29uLmR1bXBzKGluZGV4JTJDJTIwaW5kZW50JTNEMikp",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.items():
<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(){s=c("p"),s.textContent=$,o=n(),_(h.$$.fragment)},l(b){s=d(b,"P",{"data-svelte-h":!0}),w(s)!=="svelte-11lpom8"&&(s.textContent=$),o=i(b),p(h.$$.fragment,b)},m(b,G){r(b,s,G),r(b,o,G),m(h,b,G),B=!0},p:ft,i(b){B||(g(h.$$.fragment,b),B=!0)},o(b){f(h.$$.fragment,b),B=!1},d(b){b&&(a(s),a(o)),u(h,b)}}}function je(J){let s,$=`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(){s=c("p"),s.innerHTML=$},l(o){s=d(o,"P",{"data-svelte-h":!0}),w(s)!=="svelte-16sq104"&&(s.innerHTML=$)},m(o,h){r(o,s,h)},p:ft,d(o){o&&a(s)}}}function xe(J){let s,$,o,h,B,b,G,Qt="<code>huggingface_hub</code>에는 ML 라이브러리가 모델 가중치를 표준화된 방식으로 직렬화 할 수 있도록 돕는 헬퍼를 포함하고 있습니다. 라이브러리의 이 부분은 아직 개발 중이며 향후 버전에서 개선될 예정입니다. 개선 목표는 Hub에서 가중치의 직렬화 방식을 통일하고, 라이브러리 간 코드 중복을 줄이며, Hub에서의 규약을 촉진하는 것입니다.",ut,R,$t,V,Kt="현재 이 모듈은 상태 딕셔너리(예: 레이어 이름과 관련 텐서 간의 매핑)를 받아 여러 샤드로 나누고, 이 과정에서 적절한 인덱스를 생성하는 단일 헬퍼를 포함하고 있습니다. 이 헬퍼는 <code>torch</code>, <code>tensorflow</code>, <code>numpy</code> 텐서에 사용 가능하며, 다른 ML 프레임워크로 쉽게 확장될 수 있도록 설계되었습니다.",bt,q,wt,M,S,Zt,at,Ot="Split a model state dictionary in shards so that each shard is smaller than a given size.",Dt,nt,te=`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].`,Et,C,Tt,U,Mt,j,W,Lt,it,ee="Split a model state dictionary in shards so that each shard is smaller than a given size.",Ht,rt,se=`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].`,Rt,Z,jt,P,xt,T,X,Vt,ot,ae="Split a model state dictionary in shards so that each shard is smaller than a given size.",qt,lt,ne=`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].`,St,D,Ut,E,yt,F,vt,N,ie='이것은 각 프레임워크별 헬퍼가 파생되는 기본 틀입니다. 실제로는 아직 지원되지 않는 프레임워크에 맞게 조정할 필요가 있는 경우가 아니면 이 틀을 직접 사용할 것으로 예상되지 않습니다. 그런 경우가 있다면, <code>huggingface_hub</code> 리포지토리에 <a href="https://github.com/huggingface/huggingface_hub/issues/new" rel="nofollow">새로운 이슈를 개설</a> 하여 알려주세요.',Jt,x,Y,Wt,ct,re="Split a model state dictionary in shards so that each shard is smaller than a given size.",Pt,dt,oe=`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].`,Xt,L,Bt,Q,Gt,K,It,y,O,Ft,ht,le="Return unique identifier to a tensor storage.",Nt,_t,ce=`Multiple different tensors can share the same underlying storage. For
example, “meta” tensors all share the same storage, and thus their identifier will all be equal. This identifier is
guaranteed to be unique and constant for this tensor’s storage during its lifetime. Two tensor storages with
non-overlapping lifetimes may have the same id.`,Yt,pt,de='Taken from <a href="https://github.com/huggingface/transformers/blob/1ecf5f7c982d761b4daaa96719d162c324187c64/src/transformers/pytorch_utils.py#L278" rel="nofollow">https://github.com/huggingface/transformers/blob/1ecf5f7c982d761b4daaa96719d162c324187c64/src/transformers/pytorch_utils.py#L278</a>.',zt,tt,At,mt,kt;return B=new H({props:{title:"직렬화",local:"serialization",headingTag:"h1"}}),R=new H({props:{title:"상태 사전을 샤드로 나누기",local:"split-state-dict-into-shards",headingTag:"h2"}}),q=new H({props:{title:"split_numpy_state_dict_into_shards",local:"huggingface_hub.split_numpy_state_dict_into_shards ][ huggingface_hub.split_numpy_state_dict_into_shards",headingTag:"h3"}}),S=new gt({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:": Union = 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>
`}}),C=new Ct({props:{warning:!0,$$slots:{default:[be]},$$scope:{ctx:J}}}),U=new H({props:{title:"split_tf_state_dict_into_shards",local:"huggingface_hub.split_tf_state_dict_into_shards ][ huggingface_hub.split_tf_state_dict_into_shards",headingTag:"h3"}}),W=new gt({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:": Union = 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>
`}}),Z=new Ct({props:{warning:!0,$$slots:{default:[we]},$$scope:{ctx:J}}}),P=new H({props:{title:"split_torch_state_dict_into_shards",local:"huggingface_hub.split_torch_state_dict_into_shards ][ huggingface_hub.split_torch_state_dict_into_shards",headingTag:"h3"}}),X=new gt({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:": Union = 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>
`}}),D=new Ct({props:{warning:!0,$$slots:{default:[Te]},$$scope:{ctx:J}}}),E=new ue({props:{anchor:"huggingface_hub.split_torch_state_dict_into_shards.example",$$slots:{default:[Me]},$$scope:{ctx:J}}}),F=new H({props:{title:"split_state_dict_into_shards_factory",local:"huggingface_hub.split_state_dict_into_shards_factory ][ huggingface_hub.split_state_dict_into_shards_factory",headingTag:"h3"}}),Y=new gt({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 0x7f06e2536e60>"},{name:"filename_pattern",val:": str = 'model{suffix}.safetensors'"},{name:"max_shard_size",val:": Union = 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>
`}}),L=new Ct({props:{warning:!0,$$slots:{default:[je]},$$scope:{ctx:J}}}),Q=new H({props:{title:"도우미",local:"도우미",headingTag:"h2"}}),K=new H({props:{title:"get_torch_storage_id",local:"huggingface_hub.get_torch_storage_id ][ huggingface_hub.get_torch_storage_id",headingTag:"h3"}}),O=new gt({props:{name:"huggingface_hub.get_torch_storage_id",anchor:"huggingface_hub.get_torch_storage_id",parameters:[{name:"tensor",val:": torch.Tensor"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/serialization/_torch.py#L95"}}),tt=new $e({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/ko/package_reference/serialization.md"}}),{c(){s=c("meta"),$=n(),o=c("p"),h=n(),_(B.$$.fragment),b=n(),G=c("p"),G.innerHTML=Qt,ut=n(),_(R.$$.fragment),$t=n(),V=c("p"),V.innerHTML=Kt,bt=n(),_(q.$$.fragment),wt=n(),M=c("div"),_(S.$$.fragment),Zt=n(),at=c("p"),at.textContent=Ot,Dt=n(),nt=c("p"),nt.innerHTML=te,Et=n(),_(C.$$.fragment),Tt=n(),_(U.$$.fragment),Mt=n(),j=c("div"),_(W.$$.fragment),Lt=n(),it=c("p"),it.textContent=ee,Ht=n(),rt=c("p"),rt.innerHTML=se,Rt=n(),_(Z.$$.fragment),jt=n(),_(P.$$.fragment),xt=n(),T=c("div"),_(X.$$.fragment),Vt=n(),ot=c("p"),ot.textContent=ae,qt=n(),lt=c("p"),lt.innerHTML=ne,St=n(),_(D.$$.fragment),Ut=n(),_(E.$$.fragment),yt=n(),_(F.$$.fragment),vt=n(),N=c("p"),N.innerHTML=ie,Jt=n(),x=c("div"),_(Y.$$.fragment),Wt=n(),ct=c("p"),ct.textContent=re,Pt=n(),dt=c("p"),dt.innerHTML=oe,Xt=n(),_(L.$$.fragment),Bt=n(),_(Q.$$.fragment),Gt=n(),_(K.$$.fragment),It=n(),y=c("div"),_(O.$$.fragment),Ft=n(),ht=c("p"),ht.textContent=le,Nt=n(),_t=c("p"),_t.textContent=ce,Yt=n(),pt=c("p"),pt.innerHTML=de,zt=n(),_(tt.$$.fragment),At=n(),mt=c("p"),this.h()},l(t){const e=ge("svelte-u9bgzb",document.head);s=d(e,"META",{name:!0,content:!0}),e.forEach(a),$=i(t),o=d(t,"P",{}),et(o).forEach(a),h=i(t),p(B.$$.fragment,t),b=i(t),G=d(t,"P",{"data-svelte-h":!0}),w(G)!=="svelte-1t3dxwg"&&(G.innerHTML=Qt),ut=i(t),p(R.$$.fragment,t),$t=i(t),V=d(t,"P",{"data-svelte-h":!0}),w(V)!=="svelte-144hjru"&&(V.innerHTML=Kt),bt=i(t),p(q.$$.fragment,t),wt=i(t),M=d(t,"DIV",{class:!0});var I=et(M);p(S.$$.fragment,I),Zt=i(I),at=d(I,"P",{"data-svelte-h":!0}),w(at)!=="svelte-1q1pe7b"&&(at.textContent=Ot),Dt=i(I),nt=d(I,"P",{"data-svelte-h":!0}),w(nt)!=="svelte-17rio2z"&&(nt.innerHTML=te),Et=i(I),p(C.$$.fragment,I),I.forEach(a),Tt=i(t),p(U.$$.fragment,t),Mt=i(t),j=d(t,"DIV",{class:!0});var z=et(j);p(W.$$.fragment,z),Lt=i(z),it=d(z,"P",{"data-svelte-h":!0}),w(it)!=="svelte-1q1pe7b"&&(it.textContent=ee),Ht=i(z),rt=d(z,"P",{"data-svelte-h":!0}),w(rt)!=="svelte-17rio2z"&&(rt.innerHTML=se),Rt=i(z),p(Z.$$.fragment,z),z.forEach(a),jt=i(t),p(P.$$.fragment,t),xt=i(t),T=d(t,"DIV",{class:!0});var v=et(T);p(X.$$.fragment,v),Vt=i(v),ot=d(v,"P",{"data-svelte-h":!0}),w(ot)!=="svelte-1q1pe7b"&&(ot.textContent=ae),qt=i(v),lt=d(v,"P",{"data-svelte-h":!0}),w(lt)!=="svelte-17rio2z"&&(lt.innerHTML=ne),St=i(v),p(D.$$.fragment,v),Ut=i(v),p(E.$$.fragment,v),v.forEach(a),yt=i(t),p(F.$$.fragment,t),vt=i(t),N=d(t,"P",{"data-svelte-h":!0}),w(N)!=="svelte-70bx2r"&&(N.innerHTML=ie),Jt=i(t),x=d(t,"DIV",{class:!0});var A=et(x);p(Y.$$.fragment,A),Wt=i(A),ct=d(A,"P",{"data-svelte-h":!0}),w(ct)!=="svelte-1q1pe7b"&&(ct.textContent=re),Pt=i(A),dt=d(A,"P",{"data-svelte-h":!0}),w(dt)!=="svelte-17rio2z"&&(dt.innerHTML=oe),Xt=i(A),p(L.$$.fragment,A),A.forEach(a),Bt=i(t),p(Q.$$.fragment,t),Gt=i(t),p(K.$$.fragment,t),It=i(t),y=d(t,"DIV",{class:!0});var k=et(y);p(O.$$.fragment,k),Ft=i(k),ht=d(k,"P",{"data-svelte-h":!0}),w(ht)!=="svelte-lfv2l4"&&(ht.textContent=le),Nt=i(k),_t=d(k,"P",{"data-svelte-h":!0}),w(_t)!=="svelte-4klsmr"&&(_t.textContent=ce),Yt=i(k),pt=d(k,"P",{"data-svelte-h":!0}),w(pt)!=="svelte-akggeo"&&(pt.innerHTML=de),k.forEach(a),zt=i(t),p(tt.$$.fragment,t),At=i(t),mt=d(t,"P",{}),et(mt).forEach(a),this.h()},h(){st(s,"name","hf:doc:metadata"),st(s,"content",ye),st(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),st(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),st(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),st(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),st(y,"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,e){l(document.head,s),r(t,$,e),r(t,o,e),r(t,h,e),m(B,t,e),r(t,b,e),r(t,G,e),r(t,ut,e),m(R,t,e),r(t,$t,e),r(t,V,e),r(t,bt,e),m(q,t,e),r(t,wt,e),r(t,M,e),m(S,M,null),l(M,Zt),l(M,at),l(M,Dt),l(M,nt),l(M,Et),m(C,M,null),r(t,Tt,e),m(U,t,e),r(t,Mt,e),r(t,j,e),m(W,j,null),l(j,Lt),l(j,it),l(j,Ht),l(j,rt),l(j,Rt),m(Z,j,null),r(t,jt,e),m(P,t,e),r(t,xt,e),r(t,T,e),m(X,T,null),l(T,Vt),l(T,ot),l(T,qt),l(T,lt),l(T,St),m(D,T,null),l(T,Ut),m(E,T,null),r(t,yt,e),m(F,t,e),r(t,vt,e),r(t,N,e),r(t,Jt,e),r(t,x,e),m(Y,x,null),l(x,Wt),l(x,ct),l(x,Pt),l(x,dt),l(x,Xt),m(L,x,null),r(t,Bt,e),m(Q,t,e),r(t,Gt,e),m(K,t,e),r(t,It,e),r(t,y,e),m(O,y,null),l(y,Ft),l(y,ht),l(y,Nt),l(y,_t),l(y,Yt),l(y,pt),r(t,zt,e),m(tt,t,e),r(t,At,e),r(t,mt,e),kt=!0},p(t,[e]){const I={};e&2&&(I.$$scope={dirty:e,ctx:t}),C.$set(I);const z={};e&2&&(z.$$scope={dirty:e,ctx:t}),Z.$set(z);const v={};e&2&&(v.$$scope={dirty:e,ctx:t}),D.$set(v);const A={};e&2&&(A.$$scope={dirty:e,ctx:t}),E.$set(A);const k={};e&2&&(k.$$scope={dirty:e,ctx:t}),L.$set(k)},i(t){kt||(g(B.$$.fragment,t),g(R.$$.fragment,t),g(q.$$.fragment,t),g(S.$$.fragment,t),g(C.$$.fragment,t),g(U.$$.fragment,t),g(W.$$.fragment,t),g(Z.$$.fragment,t),g(P.$$.fragment,t),g(X.$$.fragment,t),g(D.$$.fragment,t),g(E.$$.fragment,t),g(F.$$.fragment,t),g(Y.$$.fragment,t),g(L.$$.fragment,t),g(Q.$$.fragment,t),g(K.$$.fragment,t),g(O.$$.fragment,t),g(tt.$$.fragment,t),kt=!0)},o(t){f(B.$$.fragment,t),f(R.$$.fragment,t),f(q.$$.fragment,t),f(S.$$.fragment,t),f(C.$$.fragment,t),f(U.$$.fragment,t),f(W.$$.fragment,t),f(Z.$$.fragment,t),f(P.$$.fragment,t),f(X.$$.fragment,t),f(D.$$.fragment,t),f(E.$$.fragment,t),f(F.$$.fragment,t),f(Y.$$.fragment,t),f(L.$$.fragment,t),f(Q.$$.fragment,t),f(K.$$.fragment,t),f(O.$$.fragment,t),f(tt.$$.fragment,t),kt=!1},d(t){t&&(a($),a(o),a(h),a(b),a(G),a(ut),a($t),a(V),a(bt),a(wt),a(M),a(Tt),a(Mt),a(j),a(jt),a(xt),a(T),a(yt),a(vt),a(N),a(Jt),a(x),a(Bt),a(Gt),a(It),a(y),a(zt),a(At),a(mt)),a(s),u(B,t),u(R,t),u(q,t),u(S),u(C),u(U,t),u(W),u(Z),u(P,t),u(X),u(D),u(E),u(F,t),u(Y),u(L),u(Q,t),u(K,t),u(O),u(tt,t)}}}const ye='{"title":"직렬화","local":"serialization","sections":[{"title":"상태 사전을 샤드로 나누기","local":"split-state-dict-into-shards","sections":[{"title":"split_numpy_state_dict_into_shards","local":"huggingface_hub.split_numpy_state_dict_into_shards ][ 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 ][ 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 ][ 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 ][ huggingface_hub.split_state_dict_into_shards_factory","sections":[],"depth":3}],"depth":2},{"title":"도우미","local":"도우미","sections":[{"title":"get_torch_storage_id","local":"huggingface_hub.get_torch_storage_id ][ huggingface_hub.get_torch_storage_id","sections":[],"depth":3}],"depth":2}],"depth":1}';function ve(J){return _e(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ce extends pe{constructor(s){super(),me(this,s,ve,xe,he,{})}}export{Ce as component};
