import{s as Th,o as xh,n as L}from"../chunks/scheduler.25b97de1.js";import{S as wh,i as $h,g as r,s as o,r as c,A as kh,h as a,f as s,c as n,j as v,u as p,x as l,k as M,y as t,a as b,v as h,d as f,t as u,w as g}from"../chunks/index.d9030fc9.js";import{T as wi}from"../chunks/Tip.baa67368.js";import{D as T}from"../chunks/Docstring.ffac8efa.js";import{C as G}from"../chunks/CodeBlock.e6cd0d95.js";import{E as D}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as wt,E as Ch}from"../chunks/EditOnGithub.91d95064.js";function Jh(P){let d,U="Examples:",y,_,k;return _=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUtYmVydCUyRmJlcnQtYmFzZS1jYXNlZCUyMiklMEElMEElMjMlMjBQdXNoJTIwdGhlJTIwbW9kZWwlMjB0byUyMHlvdXIlMjBuYW1lc3BhY2UlMjB3aXRoJTIwdGhlJTIwbmFtZSUyMCUyMm15LWZpbmV0dW5lZC1iZXJ0JTIyLiUwQW1vZGVsLnB1c2hfdG9faHViKCUyMm15LWZpbmV0dW5lZC1iZXJ0JTIyKSUwQSUwQSUyMyUyMFB1c2glMjB0aGUlMjBtb2RlbCUyMHRvJTIwYW4lMjBvcmdhbml6YXRpb24lMjB3aXRoJTIwdGhlJTIwbmFtZSUyMCUyMm15LWZpbmV0dW5lZC1iZXJ0JTIyLiUwQW1vZGVsLnB1c2hfdG9faHViKCUyMmh1Z2dpbmdmYWNlJTJGbXktZmluZXR1bmVkLWJlcnQlMjIp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModel

model = AutoModel.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-cased&quot;</span>)

<span class="hljs-comment"># Push the model to your namespace with the name &quot;my-finetuned-bert&quot;.</span>
model.push_to_hub(<span class="hljs-string">&quot;my-finetuned-bert&quot;</span>)

<span class="hljs-comment"># Push the model to an organization with the name &quot;my-finetuned-bert&quot;.</span>
model.push_to_hub(<span class="hljs-string">&quot;huggingface/my-finetuned-bert&quot;</span>)`,wrap:!1}}),{c(){d=r("p"),d.textContent=U,y=o(),c(_.$$.fragment)},l(i){d=a(i,"P",{"data-svelte-h":!0}),l(d)!=="svelte-kvfsh7"&&(d.textContent=U),y=n(i),p(_.$$.fragment,i)},m(i,J){b(i,d,J),b(i,y,J),h(_,i,J),k=!0},p:L,i(i){k||(f(_.$$.fragment,i),k=!0)},o(i){u(_.$$.fragment,i),k=!1},d(i){i&&(s(d),s(y)),g(_,i)}}}function Uh(P){let d,U="Examples:",y,_,k;return _=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUtYmVydCUyRmJlcnQtYmFzZS1jYXNlZCUyMiklMEElMEFtb2RlbC5hZGRfbW9kZWxfdGFncyglNUIlMjJjdXN0b20lMjIlMkMlMjAlMjJjdXN0b20tYmVydCUyMiU1RCklMEElMEElMjMlMjBQdXNoJTIwdGhlJTIwbW9kZWwlMjB0byUyMHlvdXIlMjBuYW1lc3BhY2UlMjB3aXRoJTIwdGhlJTIwbmFtZSUyMCUyMm15LWN1c3RvbS1iZXJ0JTIyLiUwQW1vZGVsLnB1c2hfdG9faHViKCUyMm15LWN1c3RvbS1iZXJ0JTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModel

model = AutoModel.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-cased&quot;</span>)

model.add_model_tags([<span class="hljs-string">&quot;custom&quot;</span>, <span class="hljs-string">&quot;custom-bert&quot;</span>])

<span class="hljs-comment"># Push the model to your namespace with the name &quot;my-custom-bert&quot;.</span>
model.push_to_hub(<span class="hljs-string">&quot;my-custom-bert&quot;</span>)`,wrap:!1}}),{c(){d=r("p"),d.textContent=U,y=o(),c(_.$$.fragment)},l(i){d=a(i,"P",{"data-svelte-h":!0}),l(d)!=="svelte-kvfsh7"&&(d.textContent=U),y=n(i),p(_.$$.fragment,i)},m(i,J){b(i,d,J),b(i,y,J),h(_,i,J),k=!0},p:L,i(i){k||(f(_.$$.fragment,i),k=!0)},o(i){u(_.$$.fragment,i),k=!1},d(i){i&&(s(d),s(y)),g(_,i)}}}function jh(P){let d,U=`Activate the special <a href="https://huggingface.co/transformers/installation.html#offline-mode" rel="nofollow">“offline-mode”</a> to
use this method in a firewalled environment.`;return{c(){d=r("p"),d.innerHTML=U},l(y){d=a(y,"P",{"data-svelte-h":!0}),l(d)!=="svelte-13hahdn"&&(d.innerHTML=U)},m(y,_){b(y,d,_)},p:L,d(y){y&&s(d)}}}function Ph(P){let d,U="Examples:",y,_,k;return _=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJlcnRDb25maWclMkMlMjBCZXJ0TW9kZWwlMEElMEElMjMlMjBEb3dubG9hZCUyMG1vZGVsJTIwYW5kJTIwY29uZmlndXJhdGlvbiUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUyMGFuZCUyMGNhY2hlLiUwQW1vZGVsJTIwJTNEJTIwQmVydE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUtYmVydCUyRmJlcnQtYmFzZS11bmNhc2VkJTIyKSUwQSUyMyUyME1vZGVsJTIwd2FzJTIwc2F2ZWQlMjB1c2luZyUyMCpzYXZlX3ByZXRyYWluZWQoJy4lMkZ0ZXN0JTJGc2F2ZWRfbW9kZWwlMkYnKSolMjAoZm9yJTIwZXhhbXBsZSUyMHB1cnBvc2VzJTJDJTIwbm90JTIwcnVubmFibGUpLiUwQW1vZGVsJTIwJTNEJTIwQmVydE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjIuJTJGdGVzdCUyRnNhdmVkX21vZGVsJTJGJTIyKSUwQSUyMyUyMFVwZGF0ZSUyMGNvbmZpZ3VyYXRpb24lMjBkdXJpbmclMjBsb2FkaW5nLiUwQW1vZGVsJTIwJTNEJTIwQmVydE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUtYmVydCUyRmJlcnQtYmFzZS11bmNhc2VkJTIyJTJDJTIwb3V0cHV0X2F0dGVudGlvbnMlM0RUcnVlKSUwQWFzc2VydCUyMG1vZGVsLmNvbmZpZy5vdXRwdXRfYXR0ZW50aW9ucyUyMCUzRCUzRCUyMFRydWUlMEElMjMlMjBMb2FkaW5nJTIwZnJvbSUyMGElMjBURiUyMGNoZWNrcG9pbnQlMjBmaWxlJTIwaW5zdGVhZCUyMG9mJTIwYSUyMFB5VG9yY2glMjBtb2RlbCUyMChzbG93ZXIlMkMlMjBmb3IlMjBleGFtcGxlJTIwcHVycG9zZXMlMkMlMjBub3QlMjBydW5uYWJsZSkuJTBBY29uZmlnJTIwJTNEJTIwQmVydENvbmZpZy5mcm9tX2pzb25fZmlsZSglMjIuJTJGdGZfbW9kZWwlMkZteV90Zl9tb2RlbF9jb25maWcuanNvbiUyMiklMEFtb2RlbCUyMCUzRCUyMEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyLiUyRnRmX21vZGVsJTJGbXlfdGZfY2hlY2twb2ludC5ja3B0LmluZGV4JTIyJTJDJTIwZnJvbV90ZiUzRFRydWUlMkMlMjBjb25maWclM0Rjb25maWcpJTBBJTIzJTIwTG9hZGluZyUyMGZyb20lMjBhJTIwRmxheCUyMGNoZWNrcG9pbnQlMjBmaWxlJTIwaW5zdGVhZCUyMG9mJTIwYSUyMFB5VG9yY2glMjBtb2RlbCUyMChzbG93ZXIpJTBBbW9kZWwlMjAlM0QlMjBCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZS1iZXJ0JTJGYmVydC1iYXNlLXVuY2FzZWQlMjIlMkMlMjBmcm9tX2ZsYXglM0RUcnVlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertConfig, BertModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download model and configuration from huggingface.co and cache.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertModel.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Model was saved using *save_pretrained(&#x27;./test/saved_model/&#x27;)* (for example purposes, not runnable).</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertModel.from_pretrained(<span class="hljs-string">&quot;./test/saved_model/&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Update configuration during loading.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertModel.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-uncased&quot;</span>, output_attentions=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> model.config.output_attentions == <span class="hljs-literal">True</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Loading from a TF checkpoint file instead of a PyTorch model (slower, for example purposes, not runnable).</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config = BertConfig.from_json_file(<span class="hljs-string">&quot;./tf_model/my_tf_model_config.json&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertModel.from_pretrained(<span class="hljs-string">&quot;./tf_model/my_tf_checkpoint.ckpt.index&quot;</span>, from_tf=<span class="hljs-literal">True</span>, config=config)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Loading from a Flax checkpoint file instead of a PyTorch model (slower)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertModel.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-uncased&quot;</span>, from_flax=<span class="hljs-literal">True</span>)`,wrap:!1}}),{c(){d=r("p"),d.textContent=U,y=o(),c(_.$$.fragment)},l(i){d=a(i,"P",{"data-svelte-h":!0}),l(d)!=="svelte-kvfsh7"&&(d.textContent=U),y=n(i),p(_.$$.fragment,i)},m(i,J){b(i,d,J),b(i,y,J),h(_,i,J),k=!0},p:L,i(i){k||(f(_.$$.fragment,i),k=!0)},o(i){u(_.$$.fragment,i),k=!1},d(i){i&&(s(d),s(y)),g(_,i)}}}function Zh(P){let d,U="This API is experimental and may have some slight breaking changes in the next releases.";return{c(){d=r("p"),d.textContent=U},l(y){d=a(y,"P",{"data-svelte-h":!0}),l(d)!=="svelte-15rpg4"&&(d.textContent=U)},m(y,_){b(y,d,_)},p:L,d(y){y&&s(d)}}}function Fh(P){let d,U="Examples:",y,_,k;return _=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBURkF1dG9Nb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlLWJlcnQlMkZiZXJ0LWJhc2UtY2FzZWQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMG1vZGVsJTIwdG8lMjB5b3VyJTIwbmFtZXNwYWNlJTIwd2l0aCUyMHRoZSUyMG5hbWUlMjAlMjJteS1maW5ldHVuZWQtYmVydCUyMi4lMEFtb2RlbC5wdXNoX3RvX2h1YiglMjJteS1maW5ldHVuZWQtYmVydCUyMiklMEElMEElMjMlMjBQdXNoJTIwdGhlJTIwbW9kZWwlMjB0byUyMGFuJTIwb3JnYW5pemF0aW9uJTIwd2l0aCUyMHRoZSUyMG5hbWUlMjAlMjJteS1maW5ldHVuZWQtYmVydCUyMi4lMEFtb2RlbC5wdXNoX3RvX2h1YiglMjJodWdnaW5nZmFjZSUyRm15LWZpbmV0dW5lZC1iZXJ0JTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModel

model = TFAutoModel.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-cased&quot;</span>)

<span class="hljs-comment"># Push the model to your namespace with the name &quot;my-finetuned-bert&quot;.</span>
model.push_to_hub(<span class="hljs-string">&quot;my-finetuned-bert&quot;</span>)

<span class="hljs-comment"># Push the model to an organization with the name &quot;my-finetuned-bert&quot;.</span>
model.push_to_hub(<span class="hljs-string">&quot;huggingface/my-finetuned-bert&quot;</span>)`,wrap:!1}}),{c(){d=r("p"),d.textContent=U,y=o(),c(_.$$.fragment)},l(i){d=a(i,"P",{"data-svelte-h":!0}),l(d)!=="svelte-kvfsh7"&&(d.textContent=U),y=n(i),p(_.$$.fragment,i)},m(i,J){b(i,d,J),b(i,y,J),h(_,i,J),k=!0},p:L,i(i){k||(f(_.$$.fragment,i),k=!0)},o(i){u(_.$$.fragment,i),k=!1},d(i){i&&(s(d),s(y)),g(_,i)}}}function Ih(P){let d,U="Examples:",y,_,k;return _=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJlcnRDb25maWclMkMlMjBURkJlcnRNb2RlbCUwQSUwQSUyMyUyMERvd25sb2FkJTIwbW9kZWwlMjBhbmQlMjBjb25maWd1cmF0aW9uJTIwZnJvbSUyMGh1Z2dpbmdmYWNlLmNvJTIwYW5kJTIwY2FjaGUuJTBBbW9kZWwlMjAlM0QlMjBURkJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlLWJlcnQlMkZiZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEElMjMlMjBNb2RlbCUyMHdhcyUyMHNhdmVkJTIwdXNpbmclMjAqc2F2ZV9wcmV0cmFpbmVkKCcuJTJGdGVzdCUyRnNhdmVkX21vZGVsJTJGJykqJTIwKGZvciUyMGV4YW1wbGUlMjBwdXJwb3NlcyUyQyUyMG5vdCUyMHJ1bm5hYmxlKS4lMEFtb2RlbCUyMCUzRCUyMFRGQmVydE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjIuJTJGdGVzdCUyRnNhdmVkX21vZGVsJTJGJTIyKSUwQSUyMyUyMFVwZGF0ZSUyMGNvbmZpZ3VyYXRpb24lMjBkdXJpbmclMjBsb2FkaW5nLiUwQW1vZGVsJTIwJTNEJTIwVEZCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZS1iZXJ0JTJGYmVydC1iYXNlLXVuY2FzZWQlMjIlMkMlMjBvdXRwdXRfYXR0ZW50aW9ucyUzRFRydWUpJTBBYXNzZXJ0JTIwbW9kZWwuY29uZmlnLm91dHB1dF9hdHRlbnRpb25zJTIwJTNEJTNEJTIwVHJ1ZSUwQSUyMyUyMExvYWRpbmclMjBmcm9tJTIwYSUyMFB5dG9yY2glMjBtb2RlbCUyMGZpbGUlMjBpbnN0ZWFkJTIwb2YlMjBhJTIwVGVuc29yRmxvdyUyMGNoZWNrcG9pbnQlMjAoc2xvd2VyJTJDJTIwZm9yJTIwZXhhbXBsZSUyMHB1cnBvc2VzJTJDJTIwbm90JTIwcnVubmFibGUpLiUwQWNvbmZpZyUyMCUzRCUyMEJlcnRDb25maWcuZnJvbV9qc29uX2ZpbGUoJTIyLiUyRnB0X21vZGVsJTJGbXlfcHRfbW9kZWxfY29uZmlnLmpzb24lMjIpJTBBbW9kZWwlMjAlM0QlMjBURkJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyLiUyRnB0X21vZGVsJTJGbXlfcHl0b3JjaF9tb2RlbC5iaW4lMjIlMkMlMjBmcm9tX3B0JTNEVHJ1ZSUyQyUyMGNvbmZpZyUzRGNvbmZpZyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertConfig, TFBertModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download model and configuration from huggingface.co and cache.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertModel.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Model was saved using *save_pretrained(&#x27;./test/saved_model/&#x27;)* (for example purposes, not runnable).</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertModel.from_pretrained(<span class="hljs-string">&quot;./test/saved_model/&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Update configuration during loading.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertModel.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-uncased&quot;</span>, output_attentions=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> model.config.output_attentions == <span class="hljs-literal">True</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Loading from a Pytorch model file instead of a TensorFlow checkpoint (slower, for example purposes, not runnable).</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config = BertConfig.from_json_file(<span class="hljs-string">&quot;./pt_model/my_pt_model_config.json&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertModel.from_pretrained(<span class="hljs-string">&quot;./pt_model/my_pytorch_model.bin&quot;</span>, from_pt=<span class="hljs-literal">True</span>, config=config)`,wrap:!1}}),{c(){d=r("p"),d.textContent=U,y=o(),c(_.$$.fragment)},l(i){d=a(i,"P",{"data-svelte-h":!0}),l(d)!=="svelte-kvfsh7"&&(d.textContent=U),y=n(i),p(_.$$.fragment,i)},m(i,J){b(i,d,J),b(i,y,J),h(_,i,J),k=!0},p:L,i(i){k||(f(_.$$.fragment,i),k=!0)},o(i){u(_.$$.fragment,i),k=!1},d(i){i&&(s(d),s(y)),g(_,i)}}}function Wh(P){let d,U="This API is experimental and may have some slight breaking changes in the next releases.";return{c(){d=r("p"),d.textContent=U},l(y){d=a(y,"P",{"data-svelte-h":!0}),l(d)!=="svelte-15rpg4"&&(d.textContent=U)},m(y,_){b(y,d,_)},p:L,d(y){y&&s(d)}}}function zh(P){let d,U="Examples:",y,_,k;return _=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXhBdXRvTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEZsYXhBdXRvTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZS1iZXJ0JTJGYmVydC1iYXNlLWNhc2VkJTIyKSUwQSUwQSUyMyUyMFB1c2glMjB0aGUlMjBtb2RlbCUyMHRvJTIweW91ciUyMG5hbWVzcGFjZSUyMHdpdGglMjB0aGUlMjBuYW1lJTIwJTIybXktZmluZXR1bmVkLWJlcnQlMjIuJTBBbW9kZWwucHVzaF90b19odWIoJTIybXktZmluZXR1bmVkLWJlcnQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMG1vZGVsJTIwdG8lMjBhbiUyMG9yZ2FuaXphdGlvbiUyMHdpdGglMjB0aGUlMjBuYW1lJTIwJTIybXktZmluZXR1bmVkLWJlcnQlMjIuJTBBbW9kZWwucHVzaF90b19odWIoJTIyaHVnZ2luZ2ZhY2UlMkZteS1maW5ldHVuZWQtYmVydCUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FlaxAutoModel

model = FlaxAutoModel.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-cased&quot;</span>)

<span class="hljs-comment"># Push the model to your namespace with the name &quot;my-finetuned-bert&quot;.</span>
model.push_to_hub(<span class="hljs-string">&quot;my-finetuned-bert&quot;</span>)

<span class="hljs-comment"># Push the model to an organization with the name &quot;my-finetuned-bert&quot;.</span>
model.push_to_hub(<span class="hljs-string">&quot;huggingface/my-finetuned-bert&quot;</span>)`,wrap:!1}}),{c(){d=r("p"),d.textContent=U,y=o(),c(_.$$.fragment)},l(i){d=a(i,"P",{"data-svelte-h":!0}),l(d)!=="svelte-kvfsh7"&&(d.textContent=U),y=n(i),p(_.$$.fragment,i)},m(i,J){b(i,d,J),b(i,y,J),h(_,i,J),k=!0},p:L,i(i){k||(f(_.$$.fragment,i),k=!0)},o(i){u(_.$$.fragment,i),k=!1},d(i){i&&(s(d),s(y)),g(_,i)}}}function Gh(P){let d,U="Examples:",y,_,k;return _=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJlcnRDb25maWclMkMlMjBGbGF4QmVydE1vZGVsJTBBJTBBJTIzJTIwRG93bmxvYWQlMjBtb2RlbCUyMGFuZCUyMGNvbmZpZ3VyYXRpb24lMjBmcm9tJTIwaHVnZ2luZ2ZhY2UuY28lMjBhbmQlMjBjYWNoZS4lMEFtb2RlbCUyMCUzRCUyMEZsYXhCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZS1iZXJ0JTJGYmVydC1iYXNlLWNhc2VkJTIyKSUwQSUyMyUyME1vZGVsJTIwd2FzJTIwc2F2ZWQlMjB1c2luZyUyMCpzYXZlX3ByZXRyYWluZWQoJy4lMkZ0ZXN0JTJGc2F2ZWRfbW9kZWwlMkYnKSolMjAoZm9yJTIwZXhhbXBsZSUyMHB1cnBvc2VzJTJDJTIwbm90JTIwcnVubmFibGUpLiUwQW1vZGVsJTIwJTNEJTIwRmxheEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyLiUyRnRlc3QlMkZzYXZlZF9tb2RlbCUyRiUyMiklMEElMjMlMjBMb2FkaW5nJTIwZnJvbSUyMGElMjBQeVRvcmNoJTIwY2hlY2twb2ludCUyMGZpbGUlMjBpbnN0ZWFkJTIwb2YlMjBhJTIwUHlUb3JjaCUyMG1vZGVsJTIwKHNsb3dlciUyQyUyMGZvciUyMGV4YW1wbGUlMjBwdXJwb3NlcyUyQyUyMG5vdCUyMHJ1bm5hYmxlKS4lMEFjb25maWclMjAlM0QlMjBCZXJ0Q29uZmlnLmZyb21fanNvbl9maWxlKCUyMi4lMkZwdF9tb2RlbCUyRmNvbmZpZy5qc29uJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyLiUyRnB0X21vZGVsJTJGcHl0b3JjaF9tb2RlbC5iaW4lMjIlMkMlMjBmcm9tX3B0JTNEVHJ1ZSUyQyUyMGNvbmZpZyUzRGNvbmZpZyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertConfig, FlaxBertModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download model and configuration from huggingface.co and cache.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertModel.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Model was saved using *save_pretrained(&#x27;./test/saved_model/&#x27;)* (for example purposes, not runnable).</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertModel.from_pretrained(<span class="hljs-string">&quot;./test/saved_model/&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Loading from a PyTorch checkpoint file instead of a PyTorch model (slower, for example purposes, not runnable).</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config = BertConfig.from_json_file(<span class="hljs-string">&quot;./pt_model/config.json&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertModel.from_pretrained(<span class="hljs-string">&quot;./pt_model/pytorch_model.bin&quot;</span>, from_pt=<span class="hljs-literal">True</span>, config=config)`,wrap:!1}}),{c(){d=r("p"),d.textContent=U,y=o(),c(_.$$.fragment)},l(i){d=a(i,"P",{"data-svelte-h":!0}),l(d)!=="svelte-kvfsh7"&&(d.textContent=U),y=n(i),p(_.$$.fragment,i)},m(i,J){b(i,d,J),b(i,y,J),h(_,i,J),k=!0},p:L,i(i){k||(f(_.$$.fragment,i),k=!0)},o(i){u(_.$$.fragment,i),k=!1},d(i){i&&(s(d),s(y)),g(_,i)}}}function Lh(P){let d,U="This API is experimental and may have some slight breaking changes in the next releases.";return{c(){d=r("p"),d.textContent=U},l(y){d=a(y,"P",{"data-svelte-h":!0}),l(d)!=="svelte-15rpg4"&&(d.textContent=U)},m(y,_){b(y,d,_)},p:L,d(y){y&&s(d)}}}function Bh(P){let d,U="Examples:",y,_,k;return _=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXhCZXJ0TW9kZWwlMEElMEElMjMlMjBsb2FkJTIwbW9kZWwlMEFtb2RlbCUyMCUzRCUyMEZsYXhCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZS1iZXJ0JTJGYmVydC1iYXNlLWNhc2VkJTIyKSUwQSUyMyUyMEJ5JTIwZGVmYXVsdCUyQyUyMHRoZSUyMG1vZGVsJTIwcGFyYW1ldGVycyUyMHdpbGwlMjBiZSUyMGluJTIwZnAzMiUyMHByZWNpc2lvbiUyQyUyMHRvJTIwY2FzdCUyMHRoZXNlJTIwdG8lMjBiZmxvYXQxNiUyMHByZWNpc2lvbiUwQW1vZGVsLnBhcmFtcyUyMCUzRCUyMG1vZGVsLnRvX2JmMTYobW9kZWwucGFyYW1zKSUwQSUyMyUyMElmJTIweW91JTIwd2FudCUyMGRvbid0JTIwd2FudCUyMHRvJTIwY2FzdCUyMGNlcnRhaW4lMjBwYXJhbWV0ZXJzJTIwKGZvciUyMGV4YW1wbGUlMjBsYXllciUyMG5vcm0lMjBiaWFzJTIwYW5kJTIwc2NhbGUpJTBBJTIzJTIwdGhlbiUyMHBhc3MlMjB0aGUlMjBtYXNrJTIwYXMlMjBmb2xsb3dzJTBBZnJvbSUyMGZsYXglMjBpbXBvcnQlMjB0cmF2ZXJzZV91dGlsJTBBJTBBbW9kZWwlMjAlM0QlMjBGbGF4QmVydE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUtYmVydCUyRmJlcnQtYmFzZS1jYXNlZCUyMiklMEFmbGF0X3BhcmFtcyUyMCUzRCUyMHRyYXZlcnNlX3V0aWwuZmxhdHRlbl9kaWN0KG1vZGVsLnBhcmFtcyklMEFtYXNrJTIwJTNEJTIwJTdCJTBBJTIwJTIwJTIwJTIwcGF0aCUzQSUyMChwYXRoJTVCLTIlNUQlMjAhJTNEJTIwKCUyMkxheWVyTm9ybSUyMiUyQyUyMCUyMmJpYXMlMjIpJTIwYW5kJTIwcGF0aCU1Qi0yJTNBJTVEJTIwISUzRCUyMCglMjJMYXllck5vcm0lMjIlMkMlMjAlMjJzY2FsZSUyMikpJTBBJTIwJTIwJTIwJTIwZm9yJTIwcGF0aCUyMGluJTIwZmxhdF9wYXJhbXMlMEElN0QlMEFtYXNrJTIwJTNEJTIwdHJhdmVyc2VfdXRpbC51bmZsYXR0ZW5fZGljdChtYXNrKSUwQW1vZGVsLnBhcmFtcyUyMCUzRCUyMG1vZGVsLnRvX2JmMTYobW9kZWwucGFyYW1zJTJDJTIwbWFzayk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FlaxBertModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertModel.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># By default, the model parameters will be in fp32 precision, to cast these to bfloat16 precision</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.params = model.to_bf16(model.params)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># If you want don&#x27;t want to cast certain parameters (for example layer norm bias and scale)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># then pass the mask as follows</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax <span class="hljs-keyword">import</span> traverse_util

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertModel.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>flat_params = traverse_util.flatten_dict(model.params)
<span class="hljs-meta">&gt;&gt;&gt; </span>mask = {
<span class="hljs-meta">... </span>    path: (path[-<span class="hljs-number">2</span>] != (<span class="hljs-string">&quot;LayerNorm&quot;</span>, <span class="hljs-string">&quot;bias&quot;</span>) <span class="hljs-keyword">and</span> path[-<span class="hljs-number">2</span>:] != (<span class="hljs-string">&quot;LayerNorm&quot;</span>, <span class="hljs-string">&quot;scale&quot;</span>))
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> path <span class="hljs-keyword">in</span> flat_params
<span class="hljs-meta">... </span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>mask = traverse_util.unflatten_dict(mask)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.params = model.to_bf16(model.params, mask)`,wrap:!1}}),{c(){d=r("p"),d.textContent=U,y=o(),c(_.$$.fragment)},l(i){d=a(i,"P",{"data-svelte-h":!0}),l(d)!=="svelte-kvfsh7"&&(d.textContent=U),y=n(i),p(_.$$.fragment,i)},m(i,J){b(i,d,J),b(i,y,J),h(_,i,J),k=!0},p:L,i(i){k||(f(_.$$.fragment,i),k=!0)},o(i){u(_.$$.fragment,i),k=!1},d(i){i&&(s(d),s(y)),g(_,i)}}}function Vh(P){let d,U="Examples:",y,_,k;return _=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXhCZXJ0TW9kZWwlMEElMEElMjMlMjBsb2FkJTIwbW9kZWwlMEFtb2RlbCUyMCUzRCUyMEZsYXhCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZS1iZXJ0JTJGYmVydC1iYXNlLWNhc2VkJTIyKSUwQSUyMyUyMEJ5JTIwZGVmYXVsdCUyQyUyMHRoZSUyMG1vZGVsJTIwcGFyYW1zJTIwd2lsbCUyMGJlJTIwaW4lMjBmcDMyJTJDJTIwdG8lMjBjYXN0JTIwdGhlc2UlMjB0byUyMGZsb2F0MTYlMEFtb2RlbC5wYXJhbXMlMjAlM0QlMjBtb2RlbC50b19mcDE2KG1vZGVsLnBhcmFtcyklMEElMjMlMjBJZiUyMHlvdSUyMHdhbnQlMjBkb24ndCUyMHdhbnQlMjB0byUyMGNhc3QlMjBjZXJ0YWluJTIwcGFyYW1ldGVycyUyMChmb3IlMjBleGFtcGxlJTIwbGF5ZXIlMjBub3JtJTIwYmlhcyUyMGFuZCUyMHNjYWxlKSUwQSUyMyUyMHRoZW4lMjBwYXNzJTIwdGhlJTIwbWFzayUyMGFzJTIwZm9sbG93cyUwQWZyb20lMjBmbGF4JTIwaW1wb3J0JTIwdHJhdmVyc2VfdXRpbCUwQSUwQW1vZGVsJTIwJTNEJTIwRmxheEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlLWJlcnQlMkZiZXJ0LWJhc2UtY2FzZWQlMjIpJTBBZmxhdF9wYXJhbXMlMjAlM0QlMjB0cmF2ZXJzZV91dGlsLmZsYXR0ZW5fZGljdChtb2RlbC5wYXJhbXMpJTBBbWFzayUyMCUzRCUyMCU3QiUwQSUyMCUyMCUyMCUyMHBhdGglM0ElMjAocGF0aCU1Qi0yJTVEJTIwISUzRCUyMCglMjJMYXllck5vcm0lMjIlMkMlMjAlMjJiaWFzJTIyKSUyMGFuZCUyMHBhdGglNUItMiUzQSU1RCUyMCElM0QlMjAoJTIyTGF5ZXJOb3JtJTIyJTJDJTIwJTIyc2NhbGUlMjIpKSUwQSUyMCUyMCUyMCUyMGZvciUyMHBhdGglMjBpbiUyMGZsYXRfcGFyYW1zJTBBJTdEJTBBbWFzayUyMCUzRCUyMHRyYXZlcnNlX3V0aWwudW5mbGF0dGVuX2RpY3QobWFzayklMEFtb2RlbC5wYXJhbXMlMjAlM0QlMjBtb2RlbC50b19mcDE2KG1vZGVsLnBhcmFtcyUyQyUyMG1hc2sp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FlaxBertModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertModel.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># By default, the model params will be in fp32, to cast these to float16</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.params = model.to_fp16(model.params)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># If you want don&#x27;t want to cast certain parameters (for example layer norm bias and scale)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># then pass the mask as follows</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax <span class="hljs-keyword">import</span> traverse_util

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertModel.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>flat_params = traverse_util.flatten_dict(model.params)
<span class="hljs-meta">&gt;&gt;&gt; </span>mask = {
<span class="hljs-meta">... </span>    path: (path[-<span class="hljs-number">2</span>] != (<span class="hljs-string">&quot;LayerNorm&quot;</span>, <span class="hljs-string">&quot;bias&quot;</span>) <span class="hljs-keyword">and</span> path[-<span class="hljs-number">2</span>:] != (<span class="hljs-string">&quot;LayerNorm&quot;</span>, <span class="hljs-string">&quot;scale&quot;</span>))
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> path <span class="hljs-keyword">in</span> flat_params
<span class="hljs-meta">... </span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>mask = traverse_util.unflatten_dict(mask)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.params = model.to_fp16(model.params, mask)`,wrap:!1}}),{c(){d=r("p"),d.textContent=U,y=o(),c(_.$$.fragment)},l(i){d=a(i,"P",{"data-svelte-h":!0}),l(d)!=="svelte-kvfsh7"&&(d.textContent=U),y=n(i),p(_.$$.fragment,i)},m(i,J){b(i,d,J),b(i,y,J),h(_,i,J),k=!0},p:L,i(i){k||(f(_.$$.fragment,i),k=!0)},o(i){u(_.$$.fragment,i),k=!1},d(i){i&&(s(d),s(y)),g(_,i)}}}function Hh(P){let d,U="Examples:",y,_,k;return _=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXhCZXJ0TW9kZWwlMEElMEElMjMlMjBEb3dubG9hZCUyMG1vZGVsJTIwYW5kJTIwY29uZmlndXJhdGlvbiUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUwQW1vZGVsJTIwJTNEJTIwRmxheEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlLWJlcnQlMkZiZXJ0LWJhc2UtY2FzZWQlMjIpJTBBJTIzJTIwQnklMjBkZWZhdWx0JTJDJTIwdGhlJTIwbW9kZWwlMjBwYXJhbXMlMjB3aWxsJTIwYmUlMjBpbiUyMGZwMzIlMkMlMjB0byUyMGlsbHVzdHJhdGUlMjB0aGUlMjB1c2UlMjBvZiUyMHRoaXMlMjBtZXRob2QlMkMlMEElMjMlMjB3ZSdsbCUyMGZpcnN0JTIwY2FzdCUyMHRvJTIwZnAxNiUyMGFuZCUyMGJhY2slMjB0byUyMGZwMzIlMEFtb2RlbC5wYXJhbXMlMjAlM0QlMjBtb2RlbC50b19mMTYobW9kZWwucGFyYW1zKSUwQSUyMyUyMG5vdyUyMGNhc3QlMjBiYWNrJTIwdG8lMjBmcDMyJTBBbW9kZWwucGFyYW1zJTIwJTNEJTIwbW9kZWwudG9fZnAzMihtb2RlbC5wYXJhbXMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FlaxBertModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download model and configuration from huggingface.co</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertModel.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># By default, the model params will be in fp32, to illustrate the use of this method,</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># we&#x27;ll first cast to fp16 and back to fp32</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.params = model.to_f16(model.params)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># now cast back to fp32</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.params = model.to_fp32(model.params)`,wrap:!1}}),{c(){d=r("p"),d.textContent=U,y=o(),c(_.$$.fragment)},l(i){d=a(i,"P",{"data-svelte-h":!0}),l(d)!=="svelte-kvfsh7"&&(d.textContent=U),y=n(i),p(_.$$.fragment,i)},m(i,J){b(i,d,J),b(i,y,J),h(_,i,J),k=!0},p:L,i(i){k||(f(_.$$.fragment,i),k=!0)},o(i){u(_.$$.fragment,i),k=!1},d(i){i&&(s(d),s(y)),g(_,i)}}}function qh(P){let d,U="Examples:",y,_,k;return _=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMCU3Qm9iamVjdF9jbGFzcyU3RCUwQSUwQSU3Qm9iamVjdCU3RCUyMCUzRCUyMCU3Qm9iamVjdF9jbGFzcyU3RC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlLWJlcnQlMkZiZXJ0LWJhc2UtY2FzZWQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMCU3Qm9iamVjdCU3RCUyMHRvJTIweW91ciUyMG5hbWVzcGFjZSUyMHdpdGglMjB0aGUlMjBuYW1lJTIwJTIybXktZmluZXR1bmVkLWJlcnQlMjIuJTBBJTdCb2JqZWN0JTdELnB1c2hfdG9faHViKCUyMm15LWZpbmV0dW5lZC1iZXJ0JTIyKSUwQSUwQSUyMyUyMFB1c2glMjB0aGUlMjAlN0JvYmplY3QlN0QlMjB0byUyMGFuJTIwb3JnYW5pemF0aW9uJTIwd2l0aCUyMHRoZSUyMG5hbWUlMjAlMjJteS1maW5ldHVuZWQtYmVydCUyMi4lMEElN0JvYmplY3QlN0QucHVzaF90b19odWIoJTIyaHVnZ2luZ2ZhY2UlMkZteS1maW5ldHVuZWQtYmVydCUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> {object_class}

{<span class="hljs-built_in">object</span>} = {object_class}.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-cased&quot;</span>)

<span class="hljs-comment"># Push the {object} to your namespace with the name &quot;my-finetuned-bert&quot;.</span>
{<span class="hljs-built_in">object</span>}.push_to_hub(<span class="hljs-string">&quot;my-finetuned-bert&quot;</span>)

<span class="hljs-comment"># Push the {object} to an organization with the name &quot;my-finetuned-bert&quot;.</span>
{<span class="hljs-built_in">object</span>}.push_to_hub(<span class="hljs-string">&quot;huggingface/my-finetuned-bert&quot;</span>)`,wrap:!1}}),{c(){d=r("p"),d.textContent=U,y=o(),c(_.$$.fragment)},l(i){d=a(i,"P",{"data-svelte-h":!0}),l(d)!=="svelte-kvfsh7"&&(d.textContent=U),y=n(i),p(_.$$.fragment,i)},m(i,J){b(i,d,J),b(i,y,J),h(_,i,J),k=!0},p:L,i(i){k||(f(_.$$.fragment,i),k=!0)},o(i){u(_.$$.fragment,i),k=!1},d(i){i&&(s(d),s(y)),g(_,i)}}}function Nh(P){let d,U,y,_,k,i,J,oc='基类 <a href="/docs/transformers/main/zh/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>、<a href="/docs/transformers/main/zh/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> 和 <a href="/docs/transformers/main/zh/main_classes/model#transformers.FlaxPreTrainedModel">FlaxPreTrainedModel</a> 实现了从本地文件或目录加载/保存模型的常用方法，或者从库上提供的预训练模型配置（从 HuggingFace 的 AWS S3 存储库下载）加载模型。',ts,$t,nc='<a href="/docs/transformers/main/zh/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> 和 <a href="/docs/transformers/main/zh/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> 还实现了一些所有模型共有的方法：',os,kt,rc="<li>在向量词嵌入增加新词汇时调整输入标记（token）的大小</li> <li>对模型的注意力头进行修剪。</li>",ns,Ct,ac='其他的通用方法在 <a href="/docs/transformers/main/zh/main_classes/model#transformers.modeling_utils.ModuleUtilsMixin">ModuleUtilsMixin</a>（用于 PyTorch 模型）和 <code>~modeling_tf_utils.TFModuleUtilsMixin</code>（用于 TensorFlow 模型）中定义；文本生成方面的方法则定义在 <a href="/docs/transformers/main/zh/main_classes/text_generation#transformers.GenerationMixin">GenerationMixin</a>（用于 PyTorch 模型）、<a href="/docs/transformers/main/zh/main_classes/text_generation#transformers.TFGenerationMixin">TFGenerationMixin</a>（用于 TensorFlow 模型）和 <a href="/docs/transformers/main/zh/main_classes/text_generation#transformers.FlaxGenerationMixin">FlaxGenerationMixin</a>（用于 Flax/JAX 模型）中。',rs,Jt,as,x,Ut,$i,In,sc="Base class for all models.",ki,Wn,ic=`<a href="/docs/transformers/main/zh/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> takes care of storing the configuration of the models and handles methods for loading,
downloading and saving models as well as a few methods common to all models to:`,Ci,zn,lc="<li>resize the input embeddings,</li> <li>prune heads in the self-attention heads.</li>",Ji,Gn,dc="Class attributes (overridden by derived classes):",Ui,Ln,mc=`<li><p><strong>config_class</strong> (<a href="/docs/transformers/main/zh/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a>) — A subclass of <a href="/docs/transformers/main/zh/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> to use as configuration class
for this model architecture.</p></li> <li><p><strong>load_tf_weights</strong> (<code>Callable</code>) — A python <em>method</em> for loading a TensorFlow checkpoint in a PyTorch model,
taking as arguments:</p> <ul><li><strong>model</strong> (<a href="/docs/transformers/main/zh/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>) — An instance of the model on which to load the TensorFlow checkpoint.</li> <li><strong>config</strong> (<code>PreTrainedConfig</code>) — An instance of the configuration associated to the model.</li> <li><strong>path</strong> (<code>str</code>) — A path to the TensorFlow checkpoint.</li></ul></li> <li><p><strong>base_model_prefix</strong> (<code>str</code>) — A string indicating the attribute associated to the base model in derived
classes of the same architecture adding modules on top of the base model.</p></li> <li><p><strong>is_parallelizable</strong> (<code>bool</code>) — A flag indicating whether this model supports model parallelization.</p></li> <li><p><strong>main_input_name</strong> (<code>str</code>) — The name of the principal input to the model (often <code>input_ids</code> for NLP
models, <code>pixel_values</code> for vision models and <code>input_values</code> for speech models).</p></li>`,ji,Q,jt,Pi,Bn,cc="Upload the model file to the 🤗 Model Hub.",Zi,ge,Fi,A,Pt,Ii,Vn,pc=`Add custom tags into the model that gets pushed to the Hugging Face Hub. Will
not overwrite existing tags in the model.`,Wi,_e,zi,be,Zt,Gi,Hn,hc="Returns whether this model can generate sequences with <code>.generate()</code>.",Li,ye,Ft,Bi,qn,fc=`Potentially dequantize the model in case it has been quantized by a quantization method that support
dequantization.`,Vi,ve,It,Hi,Nn,uc="Removes the <code>_require_grads_hook</code>.",qi,Me,Wt,Ni,Xn,gc=`Enables the gradients for the input embeddings. This is useful for fine-tuning adapter weights while keeping
the model weights fixed.`,Xi,Z,zt,Ei,En,_c="Instantiate a pretrained pytorch model from a pre-trained model configuration.",Ri,Rn,bc=`The model is set in evaluation mode by default using <code>model.eval()</code> (Dropout modules are deactivated). To train
the model, you should first set it back in training mode with <code>model.train()</code>.`,Yi,Yn,yc=`The warning <em>Weights from XXX not initialized from pretrained model</em> means that the weights of XXX do not come
pretrained with the rest of the model. It is up to you to train those weights with a downstream fine-tuning
task.`,Di,Dn,vc=`The warning <em>Weights from XXX not used in YYY</em> means that the layer XXX is not used by YYY, therefore those
weights are discarded.`,Qi,Qn,Mc=`If model weights are the same precision as the base model (and is a supported model), weights will be lazily loaded
in using the <code>meta</code> device and brought into memory once an input is passed through that layer regardless of
<code>low_cpu_mem_usage</code>.`,Ai,Te,Si,xe,Oi,An,Tc="<li><code>low_cpu_mem_usage</code> algorithm:</li>",Ki,Sn,xc="This is an experimental function that loads the model using ~1x model size CPU memory",el,On,wc="Here is how it works:",tl,Kn,$c=`<li>save which state_dict keys we have</li> <li>drop state_dict before the model is created, since the latter takes 1x model size CPU memory</li> <li>after the model has been instantiated switch to the meta device all params/buffers that
are going to be replaced from the loaded state_dict</li> <li>load state_dict 2nd time</li> <li>replace the params/buffers from the state_dict</li>`,ol,er,kc="Currently, it can’t handle deepspeed ZeRO stage 3 and ignores loading errors",nl,we,Gt,rl,tr,Cc=`Return a <code>torch.compile</code>‘d version of <code>self.__call__</code>. This is useful to dynamically choose between
non-compiled/compiled <code>forward</code> during inference, especially to switch between prefill (where we don’t
want to use compiled version to avoid recomputing the graph with new shapes) and iterative decoding
(where we want the speed-ups of compiled version with static shapes).`,al,$e,Lt,sl,or,Jc="Returns the model’s input embeddings.",il,ke,Bt,ll,nr,Uc=`Get the memory footprint of a model. This will return the memory footprint of the current model in bytes.
Useful to benchmark the memory footprint of the current model and design some tests. Solution inspired from the
PyTorch discussions: <a href="https://discuss.pytorch.org/t/gpu-memory-that-model-uses/56822/2" rel="nofollow">https://discuss.pytorch.org/t/gpu-memory-that-model-uses/56822/2</a>`,dl,Ce,Vt,ml,rr,jc="Returns the model’s output embeddings.",cl,S,Ht,pl,ar,Pc="Deactivates gradient checkpointing for the current model.",hl,sr,Zc=`Note that in other frameworks this feature can be referred to as “activation checkpointing” or “checkpoint
activations”.`,fl,H,qt,ul,ir,Fc="Activates gradient checkpointing for the current model.",gl,lr,Ic=`Note that in other frameworks this feature can be referred to as “activation checkpointing” or “checkpoint
activations”.`,_l,dr,Wc=`We pass the <code>__call__</code> method of the modules instead of <code>forward</code> because <code>__call__</code> attaches all the hooks of
the module. <a href="https://discuss.pytorch.org/t/any-different-between-model-input-and-model-forward-input/3690/2" rel="nofollow">https://discuss.pytorch.org/t/any-different-between-model-input-and-model-forward-input/3690/2</a>`,bl,Je,Nt,yl,mr,zc=`If needed prunes and maybe initializes weights. If using a custom <code>PreTrainedModel</code>, you need to implement any
initialization logic in <code>_init_weights</code>.`,vl,Ue,Xt,Ml,cr,Gc=`A method executed at the end of each Transformer model initialization, to execute code that needs the model’s
modules properly initialized (such as weight initialization).`,Tl,je,Et,xl,pr,Lc="Prunes heads of the base model.",wl,O,Rt,$l,hr,Bc=`Register this class with a given auto class. This should only be used for custom models as the ones in the
library are already mapped with an auto class.`,kl,Pe,Cl,K,Yt,Jl,fr,Vc="Resizes input token embeddings matrix of the model if <code>new_num_tokens != config.vocab_size</code>.",Ul,ur,Hc="Takes care of tying weights embeddings afterwards if the model class has a <code>tie_weights()</code> method.",jl,Ze,Dt,Pl,gr,qc=`Reverts the transformation from <a href="/docs/transformers/main/zh/main_classes/model#transformers.PreTrainedModel.to_bettertransformer">to_bettertransformer()</a> so that the original modeling is
used, for example in order to save the model.`,Zl,Fe,Qt,Fl,_r,Nc=`Save a model and its configuration file to a directory, so that it can be re-loaded using the
<a href="/docs/transformers/main/zh/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> class method.`,Il,Ie,At,Wl,br,Xc="Set model’s input embeddings.",zl,We,St,Gl,yr,Ec="Tensor parallelize the model across the given device mesh.",Ll,ee,Ot,Bl,vr,Rc="Tie the weights between the input embeddings and the output embeddings.",Vl,Mr,Yc=`If the <code>torchscript</code> flag is set in the configuration, can’t handle parameter sharing so we are cloning the
weights instead.`,Hl,te,Kt,ql,Tr,Dc=`Converts the model to use <a href="https://pytorch.org/docs/stable/generated/torch.nn.MultiheadAttention.html" rel="nofollow">PyTorch’s native attention
implementation</a>, integrated to
Transformers through <a href="https://huggingface.co/docs/optimum/bettertransformer/overview" rel="nofollow">Optimum library</a>. Only a
subset of all Transformers models are supported.`,Nl,xr,Qc=`PyTorch’s attention fastpath allows to speed up inference through kernel fusions and the use of <a href="https://pytorch.org/docs/stable/nested.html" rel="nofollow">nested
tensors</a>. Detailed benchmarks can be found in <a href="https://medium.com/pytorch/bettertransformer-out-of-the-box-performance-for-huggingface-transformers-3fbe27d50ab2" rel="nofollow">this blog
post</a>.`,Xl,ze,eo,El,wr,Ac="Shows a one-time warning if the input_ids appear to contain padding and no attention mask was given.",ss,$r,is,to,ls,oo,Sc='在 Transformers 4.20.0 中，<a href="/docs/transformers/main/zh/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> 方法已重新设计，以适应使用 <a href="https://huggingface.co/docs/accelerate/big_modeling" rel="nofollow">Accelerate</a> 加载大型模型的场景。这需要您使用的 Accelerate 和 PyTorch 版本满足： Accelerate &gt;= 0.9.0， PyTorch &gt;= 1.9.0。除了创建完整模型，然后在其中加载预训练权重（这会占用两倍于模型大小的内存空间，一个用于随机初始化模型，一个用于预训练权重），我们提供了一种选项，将模型创建为空壳，然后只有在加载预训练权重时才实例化其参数。',ds,no,Oc="您可以使用 <code>low_cpu_mem_usage=True</code> 激活此选项。首先，在 Meta 设备上创建模型（带有空权重），然后将状态字典加载到其中（在分片检查点的情况下逐片加载）。这样，最大使用的内存占用仅为模型的完整大小。",ms,ro,cs,ao,Kc="此外，如果内存不足以放下加载整个模型（目前仅适用于推理），您可以直接将模型放置在不同的设备上。使用 <code>device_map=&quot;auto&quot;</code>，Accelerate 将确定将每一层放置在哪个设备上，以最大化使用最快的设备（GPU），并将其余部分卸载到 CPU，甚至硬盘上（如果您没有足够的 GPU 内存 或 CPU 内存）。即使模型分布在几个设备上，它也将像您通常期望的那样运行。",ps,so,ep="在传递 <code>device_map</code> 时，<code>low_cpu_mem_usage</code> 会自动设置为 <code>True</code>，因此您不需要指定它：",hs,io,fs,lo,tp="您可以通过 <code>hf_device_map</code> 属性来查看模型是如何在设备上分割的：",us,mo,gs,co,op="您还可以按照相同的格式（一个层名称到设备的映射关系的字典）编写自己的设备映射规则。它应该将模型的所有参数映射到给定的设备上，如果该层的所有子模块都在同一设备上，您不必详细说明其中所有子模块的位置。例如，以下设备映射对于 T0pp 将正常工作（只要您有 GPU 内存）：",_s,po,bs,ho,np="另一种减少模型内存影响的方法是以较低精度的 dtype（例如 <code>torch.float16</code>）实例化它，或者使用下面介绍的直接量化技术。",ys,fo,vs,uo,rp="在 PyTorch 下，模型通常以 <code>torch.float32</code> 格式实例化。如果尝试加载权重为 fp16 的模型，这可能会导致问题，因为它将需要两倍的内存。为了克服此限制，您可以使用 <code>torch_dtype</code> 参数显式传递所需的 <code>dtype</code>：",Ms,go,Ts,_o,ap="或者，如果您希望模型始终以最优的内存模式加载，则可以使用特殊值 <code>&quot;auto&quot;</code>，然后 <code>dtype</code> 将自动从模型的权重中推导出：",xs,bo,ws,yo,sp="也可以通过以下方式告知从头开始实例化的模型要使用哪种 <code>dtype</code>：",$s,vo,ks,Mo,ip="由于 PyTorch 的设计，此功能仅适用于浮点类型。",Cs,To,Js,W,xo,Rl,kr,lp="A few utilities for <code>torch.nn.Modules</code>, to be used as a mixin.",Yl,oe,wo,Dl,Cr,dp="Add a memory hook before and after each sub-module forward pass to record increase in memory consumption.",Ql,Jr,mp=`Increase in memory consumption is stored in a <code>mem_rss_diff</code> attribute for each module and can be reset to zero
with <code>model.reset_memory_hooks_state()</code>.`,Al,Ge,$o,Sl,Ur,cp="Helper function to estimate the total number of tokens from the model inputs.",Ol,Le,ko,Kl,jr,pp=`Get number of (optionally, non-embeddings) floating-point operations for the forward and backward passes of a
batch with this transformer model. Default approximation neglects the quadratic dependency on the number of
tokens (valid if <code>12 * d_model &lt;&lt; sequence_length</code>) as laid out in <a href="https://arxiv.org/pdf/2001.08361.pdf" rel="nofollow">this
paper</a> section 2.1. Should be overridden for transformers with parameter
re-use e.g. Albert or Universal Transformers, or if doing long-range modeling with very high sequence lengths.`,ed,Be,Co,td,Pr,hp="Makes broadcastable attention and causal masks so that future and masked tokens are ignored.",od,Ve,Jo,nd,Zr,fp="Prepare the head mask if needed.",rd,He,Uo,ad,Fr,up="Invert an attention mask (e.g., switches 0. and 1.).",sd,qe,jo,id,Ir,gp="Get number of (optionally, trainable or non-embeddings) parameters in the module.",ld,Ne,Po,dd,Wr,_p='Reset the <code>mem_rss_diff</code> attribute of each module (see <a href="/docs/transformers/main/zh/main_classes/model#transformers.modeling_utils.ModuleUtilsMixin.add_memory_hooks">add_memory_hooks()</a>).',Us,Zo,bp="TFPreTrainedModel",js,w,Fo,md,zr,yp="Base class for all TF models.",cd,Gr,vp=`<a href="/docs/transformers/main/zh/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> takes care of storing the configuration of the models and handles methods for loading,
downloading and saving models as well as a few methods common to all models to:`,pd,Lr,Mp="<li>resize the input embeddings,</li> <li>prune heads in the self-attention heads.</li>",hd,Br,Tp="Class attributes (overridden by derived classes):",fd,Vr,xp=`<li><strong>config_class</strong> (<a href="/docs/transformers/main/zh/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a>) — A subclass of <a href="/docs/transformers/main/zh/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> to use as configuration class
for this model architecture.</li> <li><strong>base_model_prefix</strong> (<code>str</code>) — A string indicating the attribute associated to the base model in derived
classes of the same architecture adding modules on top of the base model.</li> <li><strong>main_input_name</strong> (<code>str</code>) — The name of the principal input to the model (often <code>input_ids</code> for NLP
models, <code>pixel_values</code> for vision models and <code>input_values</code> for speech models).</li>`,ud,ne,Io,gd,Hr,wp="Upload the model files to the 🤗 Model Hub while synchronizing a local clone of the repo in <code>repo_path_or_name</code>.",_d,Xe,bd,Ee,Wo,yd,qr,$p="Returns whether this model can generate sequences with <code>.generate()</code>.",vd,Re,zo,Md,Nr,kp=`This is a thin wrapper that sets the model’s loss output head as the loss if the user does not specify a loss
function themselves.`,Td,Ye,Go,xd,Xr,Cp="Creates a draft of a model card using the information available to the <code>Trainer</code>.",wd,B,Lo,$d,Er,Jp="Instantiate a pretrained TF 2.0 model from a pre-trained model configuration.",kd,Rr,Up=`The warning <em>Weights from XXX not initialized from pretrained model</em> means that the weights of XXX do not come
pretrained with the rest of the model. It is up to you to train those weights with a downstream fine-tuning
task.`,Cd,Yr,jp=`The warning <em>Weights from XXX not used in YYY</em> means that the layer XXX is not used by YYY, therefore those
weights are discarded.`,Jd,De,Ud,Qe,Bo,jd,Dr,Pp="Dict of bias attached to an LM head. The key represents the name of the bias attribute.",Pd,Ae,Vo,Zd,Qr,Zp="Prepare the head mask if needed.",Fd,Se,Ho,Id,Ar,Fp="Returns the model’s input embeddings layer.",Wd,Oe,qo,zd,Sr,Ip="The LM Head layer. This method must be overwritten by all the models that have a lm head.",Gd,Ke,No,Ld,Or,Wp="Returns the model’s output embeddings",Bd,et,Xo,Vd,Kr,zp=`Get the layer that handles a bias attribute in case the model has an LM head with weights tied to the
embeddings`,Hd,tt,Eo,qd,ea,Gp="Get the concatenated _prefix name of the bias from the model name to the parent layer",Nd,ot,Ro,Xd,ta,Lp=`Wraps a HuggingFace <code>Dataset</code> as a <code>tf.data.Dataset</code> with collation and batching. This method is
designed to create a “ready-to-use” dataset that can be passed directly to Keras methods like <code>fit()</code> without
further modification. The method will drop columns from the dataset if they don’t match input names for the
model. If you want to specify the column names to return rather than using the names that match this model, we
recommend using <code>Dataset.to_tf_dataset()</code> instead.`,Ed,nt,Yo,Rd,oa,Bp="Prunes heads of the base model.",Yd,re,Do,Dd,na,Vp=`Register this class with a given auto class. This should only be used for custom models as the ones in the
library are already mapped with an auto class.`,Qd,rt,Ad,ae,Qo,Sd,ra,Hp="Resizes input token embeddings matrix of the model if <code>new_num_tokens != config.vocab_size</code>.",Od,aa,qp="Takes care of tying weights embeddings afterwards if the model class has a <code>tie_weights()</code> method.",Kd,at,Ao,em,sa,Np=`Save a model and its configuration file to a directory, so that it can be re-loaded using the
<a href="/docs/transformers/main/zh/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> class method.`,tm,ia,So,om,st,Oo,nm,la,Xp="Prepare the output of the saved model. Can be overridden if specific serving modifications are required.",rm,it,Ko,am,da,Ep="Set all the bias in the LM head.",sm,lt,en,im,ma,Rp="Set model’s input embeddings",lm,dt,tn,dm,ca,Yp="Set model’s output embeddings",mm,mt,on,cm,pa,Dp=`A modification of Keras’s default <code>train_step</code> that correctly handles matching outputs to labels for our models
and supports directly training on the loss output head. In addition, it ensures input keys are copied to the
labels where appropriate. It will also copy label keys into the input dict when using the dummy loss, to ensure
that they are available to the model during the forward pass.`,pm,ct,nn,hm,ha,Qp=`A modification of Keras’s default <code>train_step</code> that correctly handles matching outputs to labels for our models
and supports directly training on the loss output head. In addition, it ensures input keys are copied to the
labels where appropriate. It will also copy label keys into the input dict when using the dummy loss, to ensure
that they are available to the model during the forward pass.`,Ps,rn,Zs,X,an,fm,fa,Ap="A few utilities for <code>keras.Model</code>, to be used as a mixin.",um,pt,sn,gm,ua,Sp="Get the number of (optionally, trainable) parameters in the model.",Fs,ln,Op="FlaxPreTrainedModel",Is,j,dn,_m,ga,Kp="Base class for all models.",bm,_a,eh=`<a href="/docs/transformers/main/zh/main_classes/model#transformers.FlaxPreTrainedModel">FlaxPreTrainedModel</a> takes care of storing the configuration of the models and handles methods for loading,
downloading and saving models.`,ym,ba,th="Class attributes (overridden by derived classes):",vm,ya,oh=`<li><strong>config_class</strong> (<a href="/docs/transformers/main/zh/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a>) — A subclass of <a href="/docs/transformers/main/zh/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> to use as configuration class
for this model architecture.</li> <li><strong>base_model_prefix</strong> (<code>str</code>) — A string indicating the attribute associated to the base model in derived
classes of the same architecture adding modules on top of the base model.</li> <li><strong>main_input_name</strong> (<code>str</code>) — The name of the principal input to the model (often <code>input_ids</code> for NLP
models, <code>pixel_values</code> for vision models and <code>input_values</code> for speech models).</li>`,Mm,se,mn,Tm,va,nh="Upload the model checkpoint to the 🤗 Model Hub.",xm,ht,wm,ft,cn,$m,Ma,rh=`Returns whether this model can generate sequences with <code>.generate()</code>. Returns:
<code>bool</code>: Whether this model can generate sequences with <code>.generate()</code>.`,km,V,pn,Cm,Ta,ah="Instantiate a pretrained flax model from a pre-trained model configuration.",Jm,xa,sh=`The warning <em>Weights from XXX not initialized from pretrained model</em> means that the weights of XXX do not come
pretrained with the rest of the model. It is up to you to train those weights with a downstream fine-tuning
task.`,Um,wa,ih=`The warning <em>Weights from XXX not used in YYY</em> means that the layer XXX is not used by YYY, therefore those
weights are discarded.`,jm,ut,Pm,ie,hn,Zm,$a,lh=`This is the same as <code>flax.serialization.from_bytes</code>
(https:lax.readthedocs.io/en/latest/_modules/flax/serialization.html#from_bytes) but for a sharded checkpoint.`,Fm,ka,dh=`This load is performed efficiently: each checkpoint shard is loaded one by one in RAM and deleted after being
loaded in the model.`,Im,le,fn,Wm,Ca,mh=`Register this class with a given auto class. This should only be used for custom models as the ones in the
library are already mapped with an auto class.`,zm,gt,Gm,_t,un,Lm,Ja,ch=`Save a model and its configuration file to a directory, so that it can be re-loaded using the
<code>[from_pretrained()](/docs/transformers/main/zh/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained)</code> class method`,Bm,q,gn,Vm,Ua,ph=`Cast the floating-point <code>params</code> to <code>jax.numpy.bfloat16</code>. This returns a new <code>params</code> tree and does not cast
the <code>params</code> in place.`,Hm,ja,hh=`This method can be used on TPU to explicitly convert the model parameters to bfloat16 precision to do full
half-precision training or to save weights in bfloat16 for inference in order to save memory and improve speed.`,qm,bt,Nm,N,_n,Xm,Pa,fh=`Cast the floating-point <code>parmas</code> to <code>jax.numpy.float16</code>. This returns a new <code>params</code> tree and does not cast the
<code>params</code> in place.`,Em,Za,uh=`This method can be used on GPU to explicitly convert the model parameters to float16 precision to do full
half-precision training or to save weights in float16 for inference in order to save memory and improve speed.`,Rm,yt,Ym,de,bn,Dm,Fa,gh=`Cast the floating-point <code>parmas</code> to <code>jax.numpy.float32</code>. This method can be used to explicitly convert the
model parameters to fp32 precision. This returns a new <code>params</code> tree and does not cast the <code>params</code> in place.`,Qm,vt,Ws,yn,zs,E,vn,Am,Ia,_h="A Mixin containing the functionality to push a model or tokenizer to the hub.",Sm,me,Mn,Om,Wa,bh="Upload the {object_files} to the 🤗 Model Hub.",Km,Mt,Gs,Tn,Ls,R,xn,ec,za,yh=`This is the same as
<a href="https://pytorch.org/docs/stable/generated/torch.nn.Module.html?highlight=load_state_dict#torch.nn.Module.load_state_dict" rel="nofollow"><code>torch.nn.Module.load_state_dict</code></a>
but for a sharded checkpoint.`,tc,Ga,vh=`This load is performed efficiently: each checkpoint shard is loaded one by one in RAM and deleted after being
loaded in the model.`,Bs,wn,Vs,es,Hs;return k=new wt({props:{title:"模型",local:"模型",headingTag:"h1"}}),Jt=new wt({props:{title:"PreTrainedModel",local:"transformers.PreTrainedModel",headingTag:"h2"}}),Ut=new T({props:{name:"class transformers.PreTrainedModel",anchor:"transformers.PreTrainedModel",parameters:[{name:"config",val:": PretrainedConfig"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1216"}}),jt=new T({props:{name:"push_to_hub",anchor:"transformers.PreTrainedModel.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"use_temp_dir",val:": typing.Optional[bool] = None"},{name:"commit_message",val:": typing.Optional[str] = None"},{name:"private",val:": typing.Optional[bool] = None"},{name:"token",val:": typing.Union[bool, str, NoneType] = None"},{name:"max_shard_size",val:": typing.Union[int, str, NoneType] = '5GB'"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = True"},{name:"revision",val:": str = None"},{name:"commit_description",val:": str = None"},{name:"tags",val:": typing.Optional[typing.List[str]] = None"},{name:"**deprecated_kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedModel.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repository you want to push your model to. It should contain your organization name
when pushing to a given organization.`,name:"repo_id"},{anchor:"transformers.PreTrainedModel.push_to_hub.use_temp_dir",description:`<strong>use_temp_dir</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to use a temporary directory to store the files saved before they are pushed to the Hub.
Will default to <code>True</code> if there is no directory named like <code>repo_id</code>, <code>False</code> otherwise.`,name:"use_temp_dir"},{anchor:"transformers.PreTrainedModel.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Message to commit while pushing. Will default to <code>&quot;Upload model&quot;</code>.`,name:"commit_message"},{anchor:"transformers.PreTrainedModel.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to make the repo private. If <code>None</code> (default), the repo will be public unless the organization&#x2019;s default is private. This value is ignored if the repo already exists.`,name:"private"},{anchor:"transformers.PreTrainedModel.push_to_hub.token",description:`<strong>token</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>). Will default to <code>True</code> if <code>repo_url</code>
is not specified.`,name:"token"},{anchor:"transformers.PreTrainedModel.push_to_hub.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>, defaults to <code>&quot;5GB&quot;</code>) &#x2014;
Only applicable for models. The maximum size for a checkpoint before being sharded. Checkpoints shard
will then be each of size lower than this size. If expressed as a string, needs to be digits followed
by a unit (like <code>&quot;5MB&quot;</code>). We default it to <code>&quot;5GB&quot;</code> so that users can easily load models on free-tier
Google Colab instances without any CPU OOM issues.`,name:"max_shard_size"},{anchor:"transformers.PreTrainedModel.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"},{anchor:"transformers.PreTrainedModel.push_to_hub.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to convert the model weights in safetensors format for safer serialization.`,name:"safe_serialization"},{anchor:"transformers.PreTrainedModel.push_to_hub.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Branch to push the uploaded files to.`,name:"revision"},{anchor:"transformers.PreTrainedModel.push_to_hub.commit_description",description:`<strong>commit_description</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The description of the commit that will be created`,name:"commit_description"},{anchor:"transformers.PreTrainedModel.push_to_hub.tags",description:`<strong>tags</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
List of tags to push on the Hub.`,name:"tags"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/hub.py#L828"}}),ge=new D({props:{anchor:"transformers.PreTrainedModel.push_to_hub.example",$$slots:{default:[Jh]},$$scope:{ctx:P}}}),Pt=new T({props:{name:"add_model_tags",anchor:"transformers.PreTrainedModel.add_model_tags",parameters:[{name:"tags",val:": typing.Union[typing.List[str], str]"}],parametersDescription:[{anchor:"transformers.PreTrainedModel.add_model_tags.tags",description:`<strong>tags</strong> (<code>Union[List[str], str]</code>) &#x2014;
The desired tags to inject in the model`,name:"tags"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1359"}}),_e=new D({props:{anchor:"transformers.PreTrainedModel.add_model_tags.example",$$slots:{default:[Uh]},$$scope:{ctx:P}}}),Zt=new T({props:{name:"can_generate",anchor:"transformers.PreTrainedModel.can_generate",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1583",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Whether this model can generate sequences with <code>.generate()</code>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>bool</code></p>
`}}),Ft=new T({props:{name:"dequantize",anchor:"transformers.PreTrainedModel.dequantize",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1341"}}),It=new T({props:{name:"disable_input_require_grads",anchor:"transformers.PreTrainedModel.disable_input_require_grads",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1786"}}),Wt=new T({props:{name:"enable_input_require_grads",anchor:"transformers.PreTrainedModel.enable_input_require_grads",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1775"}}),zt=new T({props:{name:"from_pretrained",anchor:"transformers.PreTrainedModel.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike, NoneType]"},{name:"*model_args",val:""},{name:"config",val:": typing.Union[transformers.configuration_utils.PretrainedConfig, str, os.PathLike, NoneType] = None"},{name:"cache_dir",val:": typing.Union[str, os.PathLike, NoneType] = None"},{name:"ignore_mismatched_sizes",val:": bool = False"},{name:"force_download",val:": bool = False"},{name:"local_files_only",val:": bool = False"},{name:"token",val:": typing.Union[str, bool, NoneType] = None"},{name:"revision",val:": str = 'main'"},{name:"use_safetensors",val:": typing.Optional[bool] = None"},{name:"weights_only",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedModel.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on huggingface.co.</li>
<li>A path to a <em>directory</em> containing model weights saved using
<a href="/docs/transformers/main/zh/main_classes/model#transformers.PreTrainedModel.save_pretrained">save_pretrained()</a>, e.g., <code>./my_model_directory/</code>.</li>
<li>A path or url to a <em>tensorflow index checkpoint file</em> (e.g, <code>./tf_model/model.ckpt.index</code>). In
this case, <code>from_tf</code> should be set to <code>True</code> and a configuration object should be provided as
<code>config</code> argument. This loading path is slower than converting the TensorFlow checkpoint in a
PyTorch model using the provided conversion scripts and loading the PyTorch model afterwards.</li>
<li>A path or url to a model folder containing a <em>flax checkpoint file</em> in <em>.msgpack</em> format (e.g,
<code>./flax_model/</code> containing <code>flax_model.msgpack</code>). In this case, <code>from_flax</code> should be set to
<code>True</code>.</li>
<li><code>None</code> if you are both providing the configuration and state dictionary (resp. with keyword
arguments <code>config</code> and <code>state_dict</code>).</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"transformers.PreTrainedModel.from_pretrained.model_args",description:`<strong>model_args</strong> (sequence of positional arguments, <em>optional</em>) &#x2014;
All remaining positional arguments will be passed to the underlying model&#x2019;s <code>__init__</code> method.`,name:"model_args"},{anchor:"transformers.PreTrainedModel.from_pretrained.config",description:`<strong>config</strong> (<code>Union[PretrainedConfig, str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Can be either:</p>
<ul>
<li>an instance of a class derived from <a href="/docs/transformers/main/zh/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a>,</li>
<li>a string or path valid as input to <a href="/docs/transformers/main/zh/main_classes/configuration#transformers.PretrainedConfig.from_pretrained">from_pretrained()</a>.</li>
</ul>
<p>Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded when:</p>
<ul>
<li>The model is a model provided by the library (loaded with the <em>model id</em> string of a pretrained
model).</li>
<li>The model was saved using <a href="/docs/transformers/main/zh/main_classes/model#transformers.PreTrainedModel.save_pretrained">save_pretrained()</a> and is reloaded by supplying the
save directory.</li>
<li>The model is loaded by supplying a local directory as <code>pretrained_model_name_or_path</code> and a
configuration JSON file named <em>config.json</em> is found in the directory.</li>
</ul>`,name:"config"},{anchor:"transformers.PreTrainedModel.from_pretrained.state_dict",description:`<strong>state_dict</strong> (<code>Dict[str, torch.Tensor]</code>, <em>optional</em>) &#x2014;
A state dictionary to use instead of a state dictionary loaded from saved weights file.</p>
<p>This option can be used if you want to create a model from a pretrained configuration but load your own
weights. In this case though, you should check if using <a href="/docs/transformers/main/zh/main_classes/model#transformers.PreTrainedModel.save_pretrained">save_pretrained()</a> and
<a href="/docs/transformers/main/zh/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> is not a simpler option.`,name:"state_dict"},{anchor:"transformers.PreTrainedModel.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"transformers.PreTrainedModel.from_pretrained.from_tf",description:`<strong>from_tf</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Load the model weights from a TensorFlow checkpoint save file (see docstring of
<code>pretrained_model_name_or_path</code> argument).`,name:"from_tf"},{anchor:"transformers.PreTrainedModel.from_pretrained.from_flax",description:`<strong>from_flax</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Load the model weights from a Flax checkpoint save file (see docstring of
<code>pretrained_model_name_or_path</code> argument).`,name:"from_flax"},{anchor:"transformers.PreTrainedModel.from_pretrained.ignore_mismatched_sizes",description:`<strong>ignore_mismatched_sizes</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to raise an error if some of the weights from the checkpoint do not have the same size
as the weights of the model (if for instance, you are instantiating a model with 10 labels from a
checkpoint with 3 labels).`,name:"ignore_mismatched_sizes"},{anchor:"transformers.PreTrainedModel.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"transformers.PreTrainedModel.from_pretrained.resume_download",description:`<strong>resume_download</strong> &#x2014;
Deprecated and ignored. All downloads are now resumed by default when possible.
Will be removed in v5 of Transformers.`,name:"resume_download"},{anchor:"transformers.PreTrainedModel.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"transformers.PreTrainedModel.from_pretrained.output_loading_info(bool,",description:`<strong>output_loading_info(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether ot not to also return a dictionary containing missing keys, unexpected keys and error messages.`,name:"output_loading_info(bool,"},{anchor:"transformers.PreTrainedModel.from_pretrained.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"transformers.PreTrainedModel.from_pretrained.token",description:`<strong>token</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, or not specified, will use
the token generated when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"transformers.PreTrainedModel.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>To test a pull request you made on the Hub, you can pass <code>revision=&quot;refs/pr/&lt;pr_number&gt;&quot;</code>.</p>

					</div>`,name:"revision"},{anchor:"transformers.PreTrainedModel.from_pretrained.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information.`,name:"mirror"},{anchor:"transformers.PreTrainedModel.from_pretrained._fast_init(bool,",description:`<strong>_fast_init(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to disable fast initialization.</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>One should only disable <em>_fast_init</em> to ensure backwards compatibility with <code>transformers.__version__ &lt; 4.6.0</code> for seeded model initialization. This argument will be removed at the next major version. See
<a href="https://github.com/huggingface/transformers/pull/11471" rel="nofollow">pull request 11471</a> for more information.</p>

					</div>`,name:"_fast_init(bool,"},{anchor:"transformers.PreTrainedModel.from_pretrained.attn_implementation",description:`<strong>attn_implementation</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The attention implementation to use in the model (if relevant). Can be any of <code>&quot;eager&quot;</code> (manual implementation of the attention), <code>&quot;sdpa&quot;</code> (using <a href="https://pytorch.org/docs/master/generated/torch.nn.functional.scaled_dot_product_attention.html" rel="nofollow"><code>F.scaled_dot_product_attention</code></a>), or <code>&quot;flash_attention_2&quot;</code> (using <a href="https://github.com/Dao-AILab/flash-attention" rel="nofollow">Dao-AILab/flash-attention</a>). By default, if available, SDPA will be used for torch&gt;=2.1.1. The default is otherwise the manual <code>&quot;eager&quot;</code> implementation.`,name:"attn_implementation"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L3121",parameterGroups:[{title:"Parameters for big model inference",parametersDescription:[{anchor:"transformers.PreTrainedModel.from_pretrained.low_cpu_mem_usage(bool,",description:`<strong>low_cpu_mem_usage(<code>bool</code>,</strong> <em>optional</em>) &#x2014;
Tries not to use more than 1x model size in CPU memory (including peak memory) while loading the model.
Generally should be combined with a <code>device_map</code> (such as <code>&quot;auto&quot;</code>) for best results.
This is an experimental feature and a subject to change at any moment.</p>

If the model weights are in the same precision as the model loaded in, \`low_cpu_mem_usage\` (without
\`device_map\`) is redundant and will not provide any benefit in regards to CPU memory usage. However,
this should still be enabled if you are passing in a \`device_map\`.`,name:"low_cpu_mem_usage(bool,"},{anchor:"transformers.PreTrainedModel.from_pretrained.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model under a specific <code>dtype</code>. The different options
are:</p>
<ol>
<li>
<p><code>torch.float16</code> or <code>torch.bfloat16</code> or <code>torch.float</code>: load in a specified
<code>dtype</code>, ignoring the model&#x2019;s <code>config.torch_dtype</code> if one exists. If not specified</p>
<ul>
<li>the model will get loaded in <code>torch.float</code> (fp32).</li>
</ul>
</li>
<li>
<p><code>&quot;auto&quot;</code> - A <code>torch_dtype</code> entry in the <code>config.json</code> file of the model will be
attempted to be used. If this entry isn&#x2019;t found then next check the <code>dtype</code> of the first weight in
the checkpoint that&#x2019;s of a floating point type and use that as <code>dtype</code>. This will load the model
using the <code>dtype</code> it was saved in at the end of the training. It can&#x2019;t be used as an indicator of how
the model was trained. Since it could be trained in one of half precision dtypes, but saved in fp32.</p>
</li>
<li>
<p>A string that is a valid <code>torch.dtype</code>. E.g. &#x201C;float32&#x201D; loads the model in <code>torch.float32</code>, &#x201C;float16&#x201D; loads in <code>torch.float16</code> etc.</p>
</li>
</ol>
<tip>
<p>For some models the <code>dtype</code> they were trained in is unknown - you may try to check the model&#x2019;s paper or
reach out to the authors and ask them to add this information to the model&#x2019;s card and to insert the
<code>torch_dtype</code> entry in <code>config.json</code> on the hub.</p>
</tip>`,name:"torch_dtype"},{anchor:"transformers.PreTrainedModel.from_pretrained.device_map",description:`<strong>device_map</strong> (<code>str</code> or <code>Dict[str, Union[int, str, torch.device]]</code> or <code>int</code> or <code>torch.device</code>, <em>optional</em>) &#x2014;
A map that specifies where each submodule should go. It doesn&#x2019;t need to be refined to each
parameter/buffer name, once a given module name is inside, every submodule of it will be sent to the
same device. If we only pass the device (<em>e.g.</em>, <code>&quot;cpu&quot;</code>, <code>&quot;cuda:1&quot;</code>, <code>&quot;mps&quot;</code>, or a GPU ordinal rank
like <code>1</code>) on which the model will be allocated, the device map will map the entire model to this
device. Passing <code>device_map = 0</code> means put the whole model on GPU 0.</p>
<p>To have Accelerate compute the most optimized <code>device_map</code> automatically, set <code>device_map=&quot;auto&quot;</code>. For
more information about each option see <a href="https://hf.co/docs/accelerate/main/en/usage_guides/big_modeling#designing-a-device-map" rel="nofollow">designing a device
map</a>.`,name:"device_map"},{anchor:"transformers.PreTrainedModel.from_pretrained.max_memory",description:`<strong>max_memory</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
A dictionary device identifier to maximum memory. Will default to the maximum memory available for each
GPU and the available CPU RAM if unset.`,name:"max_memory"},{anchor:"transformers.PreTrainedModel.from_pretrained.offload_folder",description:`<strong>offload_folder</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
If the <code>device_map</code> contains any value <code>&quot;disk&quot;</code>, the folder where we will offload weights.`,name:"offload_folder"},{anchor:"transformers.PreTrainedModel.from_pretrained.offload_state_dict",description:`<strong>offload_state_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If <code>True</code>, will temporarily offload the CPU state dict to the hard drive to avoid getting out of CPU
RAM if the weight of the CPU state dict + the biggest shard of the checkpoint does not fit. Defaults to
<code>True</code> when there is some disk offload.`,name:"offload_state_dict"},{anchor:"transformers.PreTrainedModel.from_pretrained.offload_buffers",description:`<strong>offload_buffers</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to offload the buffers with the model parameters.`,name:"offload_buffers"},{anchor:"transformers.PreTrainedModel.from_pretrained.quantization_config",description:`<strong>quantization_config</strong> (<code>Union[QuantizationConfigMixin,Dict]</code>, <em>optional</em>) &#x2014;
A dictionary of configuration parameters or a QuantizationConfigMixin object for quantization (e.g
bitsandbytes, gptq). There may be other quantization-related kwargs, including <code>load_in_4bit</code> and
<code>load_in_8bit</code>, which are parsed by QuantizationConfigParser. Supported only for bitsandbytes
quantizations and not preferred. consider inserting all such arguments into quantization_config
instead.`,name:"quantization_config"},{anchor:"transformers.PreTrainedModel.from_pretrained.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
In case the relevant files are located inside a subfolder of the model repo on huggingface.co, you can
specify the folder name here.`,name:"subfolder"},{anchor:"transformers.PreTrainedModel.from_pretrained.variant",description:`<strong>variant</strong> (<code>str</code>, <em>optional</em>) &#x2014;
If specified load weights from <code>variant</code> filename, <em>e.g.</em> pytorch_model.<variant>.bin. <code>variant</code> is
ignored when using <code>from_tf</code> or <code>from_flax</code>.</variant>`,name:"variant"},{anchor:"transformers.PreTrainedModel.from_pretrained.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Whether or not to use <code>safetensors</code> checkpoints. Defaults to <code>None</code>. If not specified and <code>safetensors</code>
is not installed, it will be set to <code>False</code>.`,name:"use_safetensors"},{anchor:"transformers.PreTrainedModel.from_pretrained.weights_only",description:`<strong>weights_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Indicates whether unpickler should be restricted to loading only tensors, primitive types,
dictionaries and any types added via torch.serialization.add_safe_globals().
When set to False, we can load wrapper tensor subclass weights.`,name:"weights_only"},{anchor:"transformers.PreTrainedModel.from_pretrained.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to update the configuration object (after it being loaded) and initiate the model (e.g.,
<code>output_attentions=True</code>). Behaves differently depending on whether a <code>config</code> is provided or
automatically loaded:</p>
<ul>
<li>If a configuration is provided with <code>config</code>, <code>**kwargs</code> will be directly passed to the
underlying model&#x2019;s <code>__init__</code> method (we assume all relevant updates to the configuration have
already been done)</li>
<li>If a configuration is not provided, <code>kwargs</code> will be first passed to the configuration class
initialization function (<a href="/docs/transformers/main/zh/main_classes/configuration#transformers.PretrainedConfig.from_pretrained">from_pretrained()</a>). Each key of <code>kwargs</code> that
corresponds to a configuration attribute will be used to override said attribute with the
supplied <code>kwargs</code> value. Remaining keys that do not correspond to any configuration attribute
will be passed to the underlying model&#x2019;s <code>__init__</code> function.</li>
</ul>`,name:"kwargs"}]}]}}),Te=new wi({props:{$$slots:{default:[jh]},$$scope:{ctx:P}}}),xe=new D({props:{anchor:"transformers.PreTrainedModel.from_pretrained.example",$$slots:{default:[Ph]},$$scope:{ctx:P}}}),Gt=new T({props:{name:"get_compiled_call",anchor:"transformers.PreTrainedModel.get_compiled_call",parameters:[{name:"compile_config",val:": CompileConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L5136"}}),Lt=new T({props:{name:"get_input_embeddings",anchor:"transformers.PreTrainedModel.get_input_embeddings",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1792",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A torch module mapping vocabulary to hidden states.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>nn.Module</code></p>
`}}),Bt=new T({props:{name:"get_memory_footprint",anchor:"transformers.PreTrainedModel.get_memory_footprint",parameters:[{name:"return_buffers",val:" = True"}],parametersDescription:[{anchor:"transformers.PreTrainedModel.get_memory_footprint.return_buffers",description:`<strong>return_buffers</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to return the size of the buffer tensors in the computation of the memory footprint. Buffers
are tensors that do not require gradients and not registered as parameters. E.g. mean and std in batch
norm layers. Please see: <a href="https://discuss.pytorch.org/t/what-pytorch-means-by-buffers/120266/2" rel="nofollow">https://discuss.pytorch.org/t/what-pytorch-means-by-buffers/120266/2</a>`,name:"return_buffers"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L3024"}}),Vt=new T({props:{name:"get_output_embeddings",anchor:"transformers.PreTrainedModel.get_output_embeddings",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1818",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A torch module mapping hidden states to vocabulary.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>nn.Module</code></p>
`}}),Ht=new T({props:{name:"gradient_checkpointing_disable",anchor:"transformers.PreTrainedModel.gradient_checkpointing_disable",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L2574"}}),qt=new T({props:{name:"gradient_checkpointing_enable",anchor:"transformers.PreTrainedModel.gradient_checkpointing_enable",parameters:[{name:"gradient_checkpointing_kwargs",val:" = None"}],parametersDescription:[{anchor:"transformers.PreTrainedModel.gradient_checkpointing_enable.gradient_checkpointing_kwargs",description:`<strong>gradient_checkpointing_kwargs</strong> (dict, <em>optional</em>) &#x2014;
Additional keyword arguments passed along to the <code>torch.utils.checkpoint.checkpoint</code> function.`,name:"gradient_checkpointing_kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L2510"}}),Nt=new T({props:{name:"init_weights",anchor:"transformers.PreTrainedModel.init_weights",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L2476"}}),Xt=new T({props:{name:"post_init",anchor:"transformers.PreTrainedModel.post_init",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1330"}}),Et=new T({props:{name:"prune_heads",anchor:"transformers.PreTrainedModel.prune_heads",parameters:[{name:"heads_to_prune",val:": typing.Dict[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.PreTrainedModel.prune_heads.heads_to_prune",description:`<strong>heads_to_prune</strong> (<code>Dict[int, List[int]]</code>) &#x2014;
Dictionary with keys being selected layer indices (<code>int</code>) and associated values being the list of heads
to prune in said layer (list of <code>int</code>). For instance {1: [0, 2], 2: [2, 3]} will prune heads 0 and 2 on
layer 1 and heads 2 and 3 on layer 2.`,name:"heads_to_prune"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L2493"}}),Rt=new T({props:{name:"register_for_auto_class",anchor:"transformers.PreTrainedModel.register_for_auto_class",parameters:[{name:"auto_class",val:" = 'AutoModel'"}],parametersDescription:[{anchor:"transformers.PreTrainedModel.register_for_auto_class.auto_class",description:`<strong>auto_class</strong> (<code>str</code> or <code>type</code>, <em>optional</em>, defaults to <code>&quot;AutoModel&quot;</code>) &#x2014;
The auto class to register this new model with.`,name:"auto_class"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L4942"}}),Pe=new wi({props:{warning:!0,$$slots:{default:[Zh]},$$scope:{ctx:P}}}),Yt=new T({props:{name:"resize_token_embeddings",anchor:"transformers.PreTrainedModel.resize_token_embeddings",parameters:[{name:"new_num_tokens",val:": typing.Optional[int] = None"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"mean_resizing",val:": bool = True"}],parametersDescription:[{anchor:"transformers.PreTrainedModel.resize_token_embeddings.new_num_tokens",description:`<strong>new_num_tokens</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The new number of tokens in the embedding matrix. Increasing the size will add newly initialized
vectors at the end. Reducing the size will remove vectors from the end. If not provided or <code>None</code>, just
returns a pointer to the input tokens <code>torch.nn.Embedding</code> module of the model without doing anything.`,name:"new_num_tokens"},{anchor:"transformers.PreTrainedModel.resize_token_embeddings.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the embedding matrix to a multiple of the provided value.If <code>new_num_tokens</code> is set to
<code>None</code> will just pad the embedding to a multiple of <code>pad_to_multiple_of</code>.</p>
<p>This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
<code>&gt;= 7.5</code> (Volta), or on TPUs which benefit from having sequence lengths be a multiple of 128. For more
details about this, or help on choosing the correct value for resizing, refer to this guide:
<a href="https://docs.nvidia.com/deeplearning/performance/dl-performance-matrix-multiplication/index.html#requirements-tc" rel="nofollow">https://docs.nvidia.com/deeplearning/performance/dl-performance-matrix-multiplication/index.html#requirements-tc</a>`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedModel.resize_token_embeddings.mean_resizing",description:`<strong>mean_resizing</strong> (<code>bool</code>) &#x2014;
Whether to initialize the added embeddings from a multivariate normal distribution that has old embeddings&#x2019; mean and
covariance or to initialize them with a normal distribution that has a mean of zero and std equals <code>config.initializer_range</code>.</p>
<p>Setting <code>mean_resizing</code> to <code>True</code> is useful when increasing the size of the embeddings of causal language models,
where the generated tokens&#x2019; probabilities won&#x2019;t be affected by the added embeddings because initializing the new embeddings with the
old embeddings&#x2019; mean will reduce the kl-divergence between the next token probability before and after adding the new embeddings.
Refer to this article for more information: <a href="https://nlp.stanford.edu/~johnhew/vocab-expansion.html" rel="nofollow">https://nlp.stanford.edu/~johnhew/vocab-expansion.html</a>`,name:"mean_resizing"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L2011",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Pointer to the input tokens Embeddings Module of the model.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>torch.nn.Embedding</code></p>
`}}),Dt=new T({props:{name:"reverse_bettertransformer",anchor:"transformers.PreTrainedModel.reverse_bettertransformer",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L4996",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The model converted back to the original modeling.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/zh/main_classes/model#transformers.PreTrainedModel"
>PreTrainedModel</a></p>
`}}),Qt=new T({props:{name:"save_pretrained",anchor:"transformers.PreTrainedModel.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"is_main_process",val:": bool = True"},{name:"state_dict",val:": typing.Optional[dict] = None"},{name:"save_function",val:": typing.Callable = <function save at 0x7f986f145f30>"},{name:"push_to_hub",val:": bool = False"},{name:"max_shard_size",val:": typing.Union[int, str] = '5GB'"},{name:"safe_serialization",val:": bool = True"},{name:"variant",val:": typing.Optional[str] = None"},{name:"token",val:": typing.Union[str, bool, NoneType] = None"},{name:"save_peft_format",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedModel.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to which to save. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"transformers.PreTrainedModel.save_pretrained.is_main_process",description:`<strong>is_main_process</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the process calling this is the main process or not. Useful when in distributed training like
TPUs and need to call this function on all processes. In this case, set <code>is_main_process=True</code> only on
the main process to avoid race conditions.`,name:"is_main_process"},{anchor:"transformers.PreTrainedModel.save_pretrained.state_dict",description:`<strong>state_dict</strong> (nested dictionary of <code>torch.Tensor</code>) &#x2014;
The state dictionary of the model to save. Will default to <code>self.state_dict()</code>, but can be used to only
save parts of the model or if special precautions need to be taken when recovering the state dictionary
of a model (like when using model parallelism).`,name:"state_dict"},{anchor:"transformers.PreTrainedModel.save_pretrained.save_function",description:`<strong>save_function</strong> (<code>Callable</code>) &#x2014;
The function to use to save the state dictionary. Useful on distributed training like TPUs when one
need to replace <code>torch.save</code> by another method.`,name:"save_function"},{anchor:"transformers.PreTrainedModel.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).`,name:"push_to_hub"},{anchor:"transformers.PreTrainedModel.save_pretrained.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>, defaults to <code>&quot;5GB&quot;</code>) &#x2014;
The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size
lower than this size. If expressed as a string, needs to be digits followed by a unit (like <code>&quot;5MB&quot;</code>).
We default it to 5GB in order for models to be able to run easily on free-tier google colab instances
without CPU OOM issues.</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>If a single weight of the model is bigger than <code>max_shard_size</code>, it will be in its own checkpoint shard
which will be bigger than <code>max_shard_size</code>.</p>

					</div>`,name:"max_shard_size"},{anchor:"transformers.PreTrainedModel.save_pretrained.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to save the model using <code>safetensors</code> or the traditional PyTorch way (that uses <code>pickle</code>).`,name:"safe_serialization"},{anchor:"transformers.PreTrainedModel.save_pretrained.variant",description:`<strong>variant</strong> (<code>str</code>, <em>optional</em>) &#x2014;
If specified, weights are saved in the format pytorch_model.<variant>.bin.</variant>`,name:"variant"},{anchor:"transformers.PreTrainedModel.save_pretrained.token",description:`<strong>token</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, or not specified, will use
the token generated when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"transformers.PreTrainedModel.save_pretrained.save_peft_format",description:`<strong>save_peft_format</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
For backward compatibility with PEFT library, in case adapter weights are attached to the model, all
keys of the state dict of adapters needs to be pre-pended with <code>base_model.model</code>. Advanced users can
disable this behaviours by setting <code>save_peft_format</code> to <code>False</code>.`,name:"save_peft_format"},{anchor:"transformers.PreTrainedModel.save_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional key word arguments passed along to the <a href="/docs/transformers/main/zh/main_classes/model#transformers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L2607"}}),At=new T({props:{name:"set_input_embeddings",anchor:"transformers.PreTrainedModel.set_input_embeddings",parameters:[{name:"value",val:": Module"}],parametersDescription:[{anchor:"transformers.PreTrainedModel.set_input_embeddings.value",description:"<strong>value</strong> (<code>nn.Module</code>) &#x2014; A module mapping vocabulary to hidden states.",name:"value"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1805"}}),St=new T({props:{name:"tensor_parallel",anchor:"transformers.PreTrainedModel.tensor_parallel",parameters:[{name:"device_mesh",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedModel.tensor_parallel.device_mesh",description:`<strong>device_mesh</strong> (<code>torch.distributed.DeviceMesh</code>) &#x2014;
The device mesh to use for tensor parallelism.`,name:"device_mesh"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L5077"}}),Ot=new T({props:{name:"tie_weights",anchor:"transformers.PreTrainedModel.tie_weights",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1845"}}),Kt=new T({props:{name:"to_bettertransformer",anchor:"transformers.PreTrainedModel.to_bettertransformer",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L4968",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The model converted to BetterTransformer.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/zh/main_classes/model#transformers.PreTrainedModel"
>PreTrainedModel</a></p>
`}}),eo=new T({props:{name:"warn_if_padding_and_no_attention_mask",anchor:"transformers.PreTrainedModel.warn_if_padding_and_no_attention_mask",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L5018"}}),to=new wt({props:{title:"大模型加载",local:"大模型加载",headingTag:"h3"}}),ro=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcTJTZXFMTSUwQSUwQXQwcHAlMjAlM0QlMjBBdXRvTW9kZWxGb3JTZXEyU2VxTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmJpZ3NjaWVuY2UlMkZUMHBwJTIyJTJDJTIwbG93X2NwdV9tZW1fdXNhZ2UlM0RUcnVlKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSeq2SeqLM

t0pp = AutoModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;bigscience/T0pp&quot;</span>, low_cpu_mem_usage=<span class="hljs-literal">True</span>)`,wrap:!1}}),io=new G({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcTJTZXFMTSUwQSUwQXQwcHAlMjAlM0QlMjBBdXRvTW9kZWxGb3JTZXEyU2VxTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmJpZ3NjaWVuY2UlMkZUMHBwJTIyJTJDJTIwZGV2aWNlX21hcCUzRCUyMmF1dG8lMjIp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSeq2SeqLM

t0pp = AutoModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;bigscience/T0pp&quot;</span>, device_map=<span class="hljs-string">&quot;auto&quot;</span>)`,wrap:!1}}),mo=new G({props:{code:"dDBwcC5oZl9kZXZpY2VfbWFwJTBBJTdCJ3NoYXJlZCclM0ElMjAwJTJDJTBBJTIwJ2RlY29kZXIuZW1iZWRfdG9rZW5zJyUzQSUyMDAlMkMlMEElMjAnZW5jb2RlciclM0ElMjAwJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMCclM0ElMjAwJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMSclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMiclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMyclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suNCclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suNSclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suNiclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suNyclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suOCclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suOSclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMTAnJTNBJTIwMSUyQyUwQSUyMCdkZWNvZGVyLmJsb2NrLjExJyUzQSUyMDElMkMlMEElMjAnZGVjb2Rlci5ibG9jay4xMiclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMTMnJTNBJTIwMSUyQyUwQSUyMCdkZWNvZGVyLmJsb2NrLjE0JyUzQSUyMDElMkMlMEElMjAnZGVjb2Rlci5ibG9jay4xNSclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMTYnJTNBJTIwMSUyQyUwQSUyMCdkZWNvZGVyLmJsb2NrLjE3JyUzQSUyMDElMkMlMEElMjAnZGVjb2Rlci5ibG9jay4xOCclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMTknJTNBJTIwMSUyQyUwQSUyMCdkZWNvZGVyLmJsb2NrLjIwJyUzQSUyMDElMkMlMEElMjAnZGVjb2Rlci5ibG9jay4yMSclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMjInJTNBJTIwJ2NwdSclMkMlMEElMjAnZGVjb2Rlci5ibG9jay4yMyclM0ElMjAnY3B1JyUyQyUwQSUyMCdkZWNvZGVyLmZpbmFsX2xheWVyX25vcm0nJTNBJTIwJ2NwdSclMkMlMEElMjAnZGVjb2Rlci5kcm9wb3V0JyUzQSUyMCdjcHUnJTJDJTBBJTIwJ2xtX2hlYWQnJTNBJTIwJ2NwdSclN0Q=",highlighted:`t0pp.hf_device_map
{<span class="hljs-string">&#x27;shared&#x27;</span>: <span class="hljs-number">0</span>,
 <span class="hljs-string">&#x27;decoder.embed_tokens&#x27;</span>: <span class="hljs-number">0</span>,
 <span class="hljs-string">&#x27;encoder&#x27;</span>: <span class="hljs-number">0</span>,
 <span class="hljs-string">&#x27;decoder.block.0&#x27;</span>: <span class="hljs-number">0</span>,
 <span class="hljs-string">&#x27;decoder.block.1&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.2&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.3&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.4&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.5&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.6&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.7&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.8&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.9&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.10&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.11&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.12&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.13&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.14&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.15&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.16&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.17&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.18&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.19&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.20&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.21&#x27;</span>: <span class="hljs-number">1</span>,
 <span class="hljs-string">&#x27;decoder.block.22&#x27;</span>: <span class="hljs-string">&#x27;cpu&#x27;</span>,
 <span class="hljs-string">&#x27;decoder.block.23&#x27;</span>: <span class="hljs-string">&#x27;cpu&#x27;</span>,
 <span class="hljs-string">&#x27;decoder.final_layer_norm&#x27;</span>: <span class="hljs-string">&#x27;cpu&#x27;</span>,
 <span class="hljs-string">&#x27;decoder.dropout&#x27;</span>: <span class="hljs-string">&#x27;cpu&#x27;</span>,
 <span class="hljs-string">&#x27;lm_head&#x27;</span>: <span class="hljs-string">&#x27;cpu&#x27;</span>}`,wrap:!1}}),po=new G({props:{code:"ZGV2aWNlX21hcCUyMCUzRCUyMCU3QiUyMnNoYXJlZCUyMiUzQSUyMDAlMkMlMjAlMjJlbmNvZGVyJTIyJTNBJTIwMCUyQyUyMCUyMmRlY29kZXIlMjIlM0ElMjAxJTJDJTIwJTIybG1faGVhZCUyMiUzQSUyMDElN0Q=",highlighted:'device_map = {<span class="hljs-string">&quot;shared&quot;</span>: <span class="hljs-number">0</span>, <span class="hljs-string">&quot;encoder&quot;</span>: <span class="hljs-number">0</span>, <span class="hljs-string">&quot;decoder&quot;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&quot;lm_head&quot;</span>: <span class="hljs-number">1</span>}',wrap:!1}}),fo=new wt({props:{title:"模型实例化 dtype",local:"模型实例化-dtype",headingTag:"h3"}}),go=new G({props:{code:"bW9kZWwlMjAlM0QlMjBUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydDUlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYp",highlighted:'model = T5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5&quot;</span>, torch_dtype=torch.float16)',wrap:!1}}),bo=new G({props:{code:"bW9kZWwlMjAlM0QlMjBUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydDUlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRCUyMmF1dG8lMjIp",highlighted:'model = T5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5&quot;</span>, torch_dtype=<span class="hljs-string">&quot;auto&quot;</span>)',wrap:!1}}),vo=new G({props:{code:"Y29uZmlnJTIwJTNEJTIwVDVDb25maWcuZnJvbV9wcmV0cmFpbmVkKCUyMnQ1JTIyKSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsLmZyb21fY29uZmlnKGNvbmZpZyk=",highlighted:`config = T5Config.from_pretrained(<span class="hljs-string">&quot;t5&quot;</span>)
model = AutoModel.from_config(config)`,wrap:!1}}),To=new wt({props:{title:"ModuleUtilsMixin",local:"transformers.modeling_utils.ModuleUtilsMixin",headingTag:"h2"}}),xo=new T({props:{name:"class transformers.modeling_utils.ModuleUtilsMixin",anchor:"transformers.modeling_utils.ModuleUtilsMixin",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L904"}}),wo=new T({props:{name:"add_memory_hooks",anchor:"transformers.modeling_utils.ModuleUtilsMixin.add_memory_hooks",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L935"}}),$o=new T({props:{name:"estimate_tokens",anchor:"transformers.modeling_utils.ModuleUtilsMixin.estimate_tokens",parameters:[{name:"input_dict",val:": typing.Dict[str, typing.Union[torch.Tensor, typing.Any]]"}],parametersDescription:[{anchor:"transformers.modeling_utils.ModuleUtilsMixin.estimate_tokens.inputs",description:"<strong>inputs</strong> (<code>dict</code>) &#x2014; The model inputs.",name:"inputs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1167",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The total number of tokens.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>int</code></p>
`}}),ko=new T({props:{name:"floating_point_ops",anchor:"transformers.modeling_utils.ModuleUtilsMixin.floating_point_ops",parameters:[{name:"input_dict",val:": typing.Dict[str, typing.Union[torch.Tensor, typing.Any]]"},{name:"exclude_embeddings",val:": bool = True"}],parametersDescription:[{anchor:"transformers.modeling_utils.ModuleUtilsMixin.floating_point_ops.batch_size",description:`<strong>batch_size</strong> (<code>int</code>) &#x2014;
The batch size for the forward pass.`,name:"batch_size"},{anchor:"transformers.modeling_utils.ModuleUtilsMixin.floating_point_ops.sequence_length",description:`<strong>sequence_length</strong> (<code>int</code>) &#x2014;
The number of tokens in each line of the batch.`,name:"sequence_length"},{anchor:"transformers.modeling_utils.ModuleUtilsMixin.floating_point_ops.exclude_embeddings",description:`<strong>exclude_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to count embedding and softmax operations.`,name:"exclude_embeddings"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1188",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The number of floating-point operations.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>int</code></p>
`}}),Co=new T({props:{name:"get_extended_attention_mask",anchor:"transformers.modeling_utils.ModuleUtilsMixin.get_extended_attention_mask",parameters:[{name:"attention_mask",val:": Tensor"},{name:"input_shape",val:": typing.Tuple[int]"},{name:"device",val:": device = None"},{name:"dtype",val:": torch.float32 = None"}],parametersDescription:[{anchor:"transformers.modeling_utils.ModuleUtilsMixin.get_extended_attention_mask.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code>) &#x2014;
Mask with ones indicating tokens to attend to, zeros for tokens to ignore.`,name:"attention_mask"},{anchor:"transformers.modeling_utils.ModuleUtilsMixin.get_extended_attention_mask.input_shape",description:`<strong>input_shape</strong> (<code>Tuple[int]</code>) &#x2014;
The shape of the input to the model.`,name:"input_shape"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1023",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>torch.Tensor</code> The extended attention mask, with a the same dtype as <code>attention_mask.dtype</code>.</p>
`}}),Jo=new T({props:{name:"get_head_mask",anchor:"transformers.modeling_utils.ModuleUtilsMixin.get_head_mask",parameters:[{name:"head_mask",val:": typing.Optional[torch.Tensor]"},{name:"num_hidden_layers",val:": int"},{name:"is_attention_chunked",val:": bool = False"}],parametersDescription:[{anchor:"transformers.modeling_utils.ModuleUtilsMixin.get_head_mask.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> with shape <code>[num_heads]</code> or <code>[num_hidden_layers x num_heads]</code>, <em>optional</em>) &#x2014;
The mask indicating if we should keep the heads or not (1.0 for keep, 0.0 for discard).`,name:"head_mask"},{anchor:"transformers.modeling_utils.ModuleUtilsMixin.get_head_mask.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>) &#x2014;
The number of hidden layers in the model.`,name:"num_hidden_layers"},{anchor:"transformers.modeling_utils.ModuleUtilsMixin.get_head_mask.is_attention_chunked",description:`<strong>is_attention_chunked</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the attentions scores are computed by chunks or not.`,name:"is_attention_chunked"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1075",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>torch.Tensor</code> with shape <code>[num_hidden_layers x batch x num_heads x seq_length x seq_length]</code> or list with
<code>[None]</code> for each layer.</p>
`}}),Uo=new T({props:{name:"invert_attention_mask",anchor:"transformers.modeling_utils.ModuleUtilsMixin.invert_attention_mask",parameters:[{name:"encoder_attention_mask",val:": Tensor"}],parametersDescription:[{anchor:"transformers.modeling_utils.ModuleUtilsMixin.invert_attention_mask.encoder_attention_mask",description:"<strong>encoder_attention_mask</strong> (<code>torch.Tensor</code>) &#x2014; An attention mask.",name:"encoder_attention_mask"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L971",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The inverted attention mask.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>torch.Tensor</code></p>
`}}),jo=new T({props:{name:"num_parameters",anchor:"transformers.modeling_utils.ModuleUtilsMixin.num_parameters",parameters:[{name:"only_trainable",val:": bool = False"},{name:"exclude_embeddings",val:": bool = False"}],parametersDescription:[{anchor:"transformers.modeling_utils.ModuleUtilsMixin.num_parameters.only_trainable",description:`<strong>only_trainable</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return only the number of trainable parameters`,name:"only_trainable"},{anchor:"transformers.modeling_utils.ModuleUtilsMixin.num_parameters.exclude_embeddings",description:`<strong>exclude_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return only the number of non-embeddings parameters`,name:"exclude_embeddings"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1113",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The number of parameters.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>int</code></p>
`}}),Po=new T({props:{name:"reset_memory_hooks_state",anchor:"transformers.modeling_utils.ModuleUtilsMixin.reset_memory_hooks_state",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L947"}}),Fo=new T({props:{name:"class transformers.TFPreTrainedModel",anchor:"transformers.TFPreTrainedModel",parameters:[{name:"config",val:""},{name:"*inputs",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1129"}}),Io=new T({props:{name:"push_to_hub",anchor:"transformers.TFPreTrainedModel.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"use_temp_dir",val:": Optional[bool] = None"},{name:"commit_message",val:": Optional[str] = None"},{name:"private",val:": Optional[bool] = None"},{name:"max_shard_size",val:": Optional[Union[int, str]] = '10GB'"},{name:"token",val:": Optional[Union[bool, str]] = None"},{name:"use_auth_token",val:": Optional[Union[bool, str]] = None"},{name:"create_pr",val:": bool = False"},{name:"**base_model_card_args",val:""}],parametersDescription:[{anchor:"transformers.TFPreTrainedModel.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repository you want to push your model to. It should contain your organization name
when pushing to a given organization.`,name:"repo_id"},{anchor:"transformers.TFPreTrainedModel.push_to_hub.use_temp_dir",description:`<strong>use_temp_dir</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to use a temporary directory to store the files saved before they are pushed to the Hub.
Will default to <code>True</code> if there is no directory named like <code>repo_id</code>, <code>False</code> otherwise.`,name:"use_temp_dir"},{anchor:"transformers.TFPreTrainedModel.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Message to commit while pushing. Will default to <code>&quot;Upload model&quot;</code>.`,name:"commit_message"},{anchor:"transformers.TFPreTrainedModel.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to make the repo private. If <code>None</code> (default), the repo will be public unless the organization&#x2019;s default is private. This value is ignored if the repo already exists.`,name:"private"},{anchor:"transformers.TFPreTrainedModel.push_to_hub.token",description:`<strong>token</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>). Will default to <code>True</code> if <code>repo_url</code>
is not specified.`,name:"token"},{anchor:"transformers.TFPreTrainedModel.push_to_hub.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>, defaults to <code>&quot;10GB&quot;</code>) &#x2014;
Only applicable for models. The maximum size for a checkpoint before being sharded. Checkpoints shard
will then be each of size lower than this size. If expressed as a string, needs to be digits followed
by a unit (like <code>&quot;5MB&quot;</code>).`,name:"max_shard_size"},{anchor:"transformers.TFPreTrainedModel.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L3137"}}),Xe=new D({props:{anchor:"transformers.TFPreTrainedModel.push_to_hub.example",$$slots:{default:[Fh]},$$scope:{ctx:P}}}),Wo=new T({props:{name:"can_generate",anchor:"transformers.TFPreTrainedModel.can_generate",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1385",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Whether this model can generate sequences with <code>.generate()</code>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>bool</code></p>
`}}),zo=new T({props:{name:"compile",anchor:"transformers.TFPreTrainedModel.compile",parameters:[{name:"optimizer",val:" = 'rmsprop'"},{name:"loss",val:" = 'auto_with_warning'"},{name:"metrics",val:" = None"},{name:"loss_weights",val:" = None"},{name:"weighted_metrics",val:" = None"},{name:"run_eagerly",val:" = None"},{name:"steps_per_execution",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1531"}}),Go=new T({props:{name:"create_model_card",anchor:"transformers.TFPreTrainedModel.create_model_card",parameters:[{name:"output_dir",val:""},{name:"model_name",val:": str"},{name:"language",val:": Optional[str] = None"},{name:"license",val:": Optional[str] = None"},{name:"tags",val:": Optional[str] = None"},{name:"finetuned_from",val:": Optional[str] = None"},{name:"tasks",val:": Optional[str] = None"},{name:"dataset_tags",val:": Optional[Union[str, List[str]]] = None"},{name:"dataset",val:": Optional[Union[str, List[str]]] = None"},{name:"dataset_args",val:": Optional[Union[str, List[str]]] = None"}],parametersDescription:[{anchor:"transformers.TFPreTrainedModel.create_model_card.output_dir",description:`<strong>output_dir</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
The folder in which to create the model card.`,name:"output_dir"},{anchor:"transformers.TFPreTrainedModel.create_model_card.model_name",description:`<strong>model_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The name of the model.`,name:"model_name"},{anchor:"transformers.TFPreTrainedModel.create_model_card.language",description:`<strong>language</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The language of the model (if applicable)`,name:"language"},{anchor:"transformers.TFPreTrainedModel.create_model_card.license",description:`<strong>license</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The license of the model. Will default to the license of the pretrained model used, if the original
model given to the <code>Trainer</code> comes from a repo on the Hub.`,name:"license"},{anchor:"transformers.TFPreTrainedModel.create_model_card.tags",description:`<strong>tags</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Some tags to be included in the metadata of the model card.`,name:"tags"},{anchor:"transformers.TFPreTrainedModel.create_model_card.finetuned_from",description:`<strong>finetuned_from</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The name of the model used to fine-tune this one (if applicable). Will default to the name of the repo
of the original model given to the <code>Trainer</code> (if it comes from the Hub).`,name:"finetuned_from"},{anchor:"transformers.TFPreTrainedModel.create_model_card.tasks",description:`<strong>tasks</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
One or several task identifiers, to be included in the metadata of the model card.`,name:"tasks"},{anchor:"transformers.TFPreTrainedModel.create_model_card.dataset_tags",description:`<strong>dataset_tags</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
One or several dataset tags, to be included in the metadata of the model card.`,name:"dataset_tags"},{anchor:"transformers.TFPreTrainedModel.create_model_card.dataset",description:`<strong>dataset</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
One or several dataset identifiers, to be included in the metadata of the model card.`,name:"dataset"},{anchor:"transformers.TFPreTrainedModel.create_model_card.dataset_args",description:`<strong>dataset_args</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
One or several dataset arguments, to be included in the metadata of the model card.`,name:"dataset_args"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1826"}}),Lo=new T({props:{name:"from_pretrained",anchor:"transformers.TFPreTrainedModel.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": Optional[Union[str, os.PathLike]]"},{name:"*model_args",val:""},{name:"config",val:": Optional[Union[PretrainedConfig, str, os.PathLike]] = None"},{name:"cache_dir",val:": Optional[Union[str, os.PathLike]] = None"},{name:"ignore_mismatched_sizes",val:": bool = False"},{name:"force_download",val:": bool = False"},{name:"local_files_only",val:": bool = False"},{name:"token",val:": Optional[Union[str, bool]] = None"},{name:"revision",val:": str = 'main'"},{name:"use_safetensors",val:": bool = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFPreTrainedModel.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on huggingface.co.</li>
<li>A path to a <em>directory</em> containing model weights saved using
<a href="/docs/transformers/main/zh/main_classes/model#transformers.TFPreTrainedModel.save_pretrained">save_pretrained()</a>, e.g., <code>./my_model_directory/</code>.</li>
<li>A path or url to a <em>PyTorch state_dict save file</em> (e.g, <code>./pt_model/pytorch_model.bin</code>). In this
case, <code>from_pt</code> should be set to <code>True</code> and a configuration object should be provided as <code>config</code>
argument. This loading path is slower than converting the PyTorch model in a TensorFlow model
using the provided conversion scripts and loading the TensorFlow model afterwards.</li>
<li><code>None</code> if you are both providing the configuration and state dictionary (resp. with keyword
arguments <code>config</code> and <code>state_dict</code>).</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"transformers.TFPreTrainedModel.from_pretrained.model_args",description:`<strong>model_args</strong> (sequence of positional arguments, <em>optional</em>) &#x2014;
All remaining positional arguments will be passed to the underlying model&#x2019;s <code>__init__</code> method.`,name:"model_args"},{anchor:"transformers.TFPreTrainedModel.from_pretrained.config",description:`<strong>config</strong> (<code>Union[PretrainedConfig, str]</code>, <em>optional</em>) &#x2014;
Can be either:</p>
<ul>
<li>an instance of a class derived from <a href="/docs/transformers/main/zh/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a>,</li>
<li>a string valid as input to <a href="/docs/transformers/main/zh/main_classes/configuration#transformers.PretrainedConfig.from_pretrained">from_pretrained()</a>.</li>
</ul>
<p>Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded when:</p>
<ul>
<li>The model is a model provided by the library (loaded with the <em>model id</em> string of a pretrained
model).</li>
<li>The model was saved using <a href="/docs/transformers/main/zh/main_classes/model#transformers.TFPreTrainedModel.save_pretrained">save_pretrained()</a> and is reloaded by supplying the
save directory.</li>
<li>The model is loaded by supplying a local directory as <code>pretrained_model_name_or_path</code> and a
configuration JSON file named <em>config.json</em> is found in the directory.</li>
</ul>`,name:"config"},{anchor:"transformers.TFPreTrainedModel.from_pretrained.from_pt",description:`<strong>from_pt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Load the model weights from a PyTorch state_dict save file (see docstring of
<code>pretrained_model_name_or_path</code> argument).`,name:"from_pt"},{anchor:"transformers.TFPreTrainedModel.from_pretrained.ignore_mismatched_sizes",description:`<strong>ignore_mismatched_sizes</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to raise an error if some of the weights from the checkpoint do not have the same size
as the weights of the model (if for instance, you are instantiating a model with 10 labels from a
checkpoint with 3 labels).`,name:"ignore_mismatched_sizes"},{anchor:"transformers.TFPreTrainedModel.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"transformers.TFPreTrainedModel.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"transformers.TFPreTrainedModel.from_pretrained.resume_download",description:`<strong>resume_download</strong> &#x2014;
Deprecated and ignored. All downloads are now resumed by default when possible.
Will be removed in v5 of Transformers.`,name:"resume_download"},{anchor:"transformers.TFPreTrainedModel.from_pretrained.proxies",description:`<strong>proxies</strong> &#x2014;
(<code>Dict[str, str], </code>optional<code>): A dictionary of proxy servers to use by protocol or endpoint, e.g., </code>{&#x2018;http&#x2019;: &#x2018;foo.bar:3128&#x2019;, &#x2018;http://hostname&#x2019;: &#x2018;foo.bar:4012&#x2019;}<code>. The proxies are used on each request. output_loading_info(</code>bool<code>, *optional*, defaults to </code>False\`): Whether ot not to also return a
dictionary containing missing keys, unexpected keys and error messages.`,name:"proxies"},{anchor:"transformers.TFPreTrainedModel.from_pretrained.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (e.g., not try downloading the model).`,name:"local_files_only(bool,"},{anchor:"transformers.TFPreTrainedModel.from_pretrained.token",description:`<strong>token</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, or not specified, will use
the token generated when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"transformers.TFPreTrainedModel.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L2541"}}),De=new D({props:{anchor:"transformers.TFPreTrainedModel.from_pretrained.example",$$slots:{default:[Ih]},$$scope:{ctx:P}}}),Bo=new T({props:{name:"get_bias",anchor:"transformers.TFPreTrainedModel.get_bias",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1966",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The weights representing the bias, None if not an LM model.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>tf.Variable</code></p>
`}}),Vo=new T({props:{name:"get_head_mask",anchor:"transformers.TFPreTrainedModel.get_head_mask",parameters:[{name:"head_mask",val:": tf.Tensor | None"},{name:"num_hidden_layers",val:": int"}],parametersDescription:[{anchor:"transformers.TFPreTrainedModel.get_head_mask.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> with shape <code>[num_heads]</code> or <code>[num_hidden_layers x num_heads]</code>, <em>optional</em>) &#x2014;
The mask indicating if we should keep the heads or not (1.0 for keep, 0.0 for discard).`,name:"head_mask"},{anchor:"transformers.TFPreTrainedModel.get_head_mask.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>) &#x2014;
The number of hidden layers in the model.`,name:"num_hidden_layers"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1269",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>tf.Tensor</code> with shape <code>[num_hidden_layers x batch x num_heads x seq_length x seq_length]</code> or list with
<code>[None]</code> for each layer.</p>
`}}),Ho=new T({props:{name:"get_input_embeddings",anchor:"transformers.TFPreTrainedModel.get_input_embeddings",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1399",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The embeddings layer mapping vocabulary to hidden states.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>tf.Variable</code></p>
`}}),qo=new T({props:{name:"get_lm_head",anchor:"transformers.TFPreTrainedModel.get_lm_head",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1999",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The LM head layer if the model has one, None if not.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>keras.layers.Layer</code></p>
`}}),No=new T({props:{name:"get_output_embeddings",anchor:"transformers.TFPreTrainedModel.get_output_embeddings",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1906",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The new weights mapping vocabulary to hidden states.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>tf.Variable</code></p>
`}}),Xo=new T({props:{name:"get_output_layer_with_bias",anchor:"transformers.TFPreTrainedModel.get_output_layer_with_bias",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1943",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The layer that handles the bias, None if not an LM model.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>keras.layers.Layer</code></p>
`}}),Eo=new T({props:{name:"get_prefix_bias_name",anchor:"transformers.TFPreTrainedModel.get_prefix_bias_name",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1956",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The _prefix name of the bias.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>str</code></p>
`}}),Ro=new T({props:{name:"prepare_tf_dataset",anchor:"transformers.TFPreTrainedModel.prepare_tf_dataset",parameters:[{name:"dataset",val:": 'datasets.Dataset'"},{name:"batch_size",val:": int = 8"},{name:"shuffle",val:": bool = True"},{name:"tokenizer",val:": Optional['PreTrainedTokenizerBase'] = None"},{name:"collate_fn",val:": Optional[Callable] = None"},{name:"collate_fn_args",val:": Optional[Dict[str, Any]] = None"},{name:"drop_remainder",val:": Optional[bool] = None"},{name:"prefetch",val:": bool = True"}],parametersDescription:[{anchor:"transformers.TFPreTrainedModel.prepare_tf_dataset.dataset",description:`<strong>dataset</strong> (<code>Any</code>) &#x2014;
A [~<code>datasets.Dataset</code>] to be wrapped as a <code>tf.data.Dataset</code>.`,name:"dataset"},{anchor:"transformers.TFPreTrainedModel.prepare_tf_dataset.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
The size of batches to return.`,name:"batch_size"},{anchor:"transformers.TFPreTrainedModel.prepare_tf_dataset.shuffle",description:`<strong>shuffle</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to return samples from the dataset in random order. Usually <code>True</code> for training datasets and
<code>False</code> for validation/test datasets.`,name:"shuffle"},{anchor:"transformers.TFPreTrainedModel.prepare_tf_dataset.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/zh/internal/tokenization_utils#transformers.PreTrainedTokenizerBase">PreTrainedTokenizerBase</a>, <em>optional</em>) &#x2014;
A <code>PreTrainedTokenizer</code> that will be used to pad samples to create batches. Has no effect if a specific
<code>collate_fn</code> is passed instead.`,name:"tokenizer"},{anchor:"transformers.TFPreTrainedModel.prepare_tf_dataset.collate_fn",description:`<strong>collate_fn</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that collates samples from the dataset into a single batch. Defaults to
<code>DefaultDataCollator</code> if no <code>tokenizer</code> is supplied or <code>DataCollatorWithPadding</code> if a <code>tokenizer</code> is
passed.`,name:"collate_fn"},{anchor:"transformers.TFPreTrainedModel.prepare_tf_dataset.collate_fn_args",description:`<strong>collate_fn_args</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
A dict of arguments to pass to the <code>collate_fn</code> alongside the list of samples.`,name:"collate_fn_args"},{anchor:"transformers.TFPreTrainedModel.prepare_tf_dataset.drop_remainder",description:`<strong>drop_remainder</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to drop the final batch, if the batch_size does not evenly divide the dataset length. Defaults
to the same setting as <code>shuffle</code>.`,name:"drop_remainder"},{anchor:"transformers.TFPreTrainedModel.prepare_tf_dataset.prefetch",description:`<strong>prefetch</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to add prefetching to the end of the <code>tf.data</code> pipeline. This is almost always beneficial for
performance, but can be disabled in edge cases.`,name:"prefetch"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1426",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>tf.data.Dataset</code> which is ready to pass to the Keras API.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>Dataset</code></p>
`}}),Yo=new T({props:{name:"prune_heads",anchor:"transformers.TFPreTrainedModel.prune_heads",parameters:[{name:"heads_to_prune",val:""}],parametersDescription:[{anchor:"transformers.TFPreTrainedModel.prune_heads.heads_to_prune",description:`<strong>heads_to_prune</strong> (<code>Dict[int, List[int]]</code>) &#x2014;
Dictionary with keys being selected layer indices (<code>int</code>) and associated values being the list of heads
to prune in said layer (list of <code>int</code>). For instance {1: [0, 2], 2: [2, 3]} will prune heads 0 and 2 on
layer 1 and heads 2 and 3 on layer 2.`,name:"heads_to_prune"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L2346"}}),Do=new T({props:{name:"register_for_auto_class",anchor:"transformers.TFPreTrainedModel.register_for_auto_class",parameters:[{name:"auto_class",val:" = 'TFAutoModel'"}],parametersDescription:[{anchor:"transformers.TFPreTrainedModel.register_for_auto_class.auto_class",description:`<strong>auto_class</strong> (<code>str</code> or <code>type</code>, <em>optional</em>, defaults to <code>&quot;TFAutoModel&quot;</code>) &#x2014;
The auto class to register this new model with.`,name:"auto_class"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L3246"}}),rt=new wi({props:{warning:!0,$$slots:{default:[Wh]},$$scope:{ctx:P}}}),Qo=new T({props:{name:"resize_token_embeddings",anchor:"transformers.TFPreTrainedModel.resize_token_embeddings",parameters:[{name:"new_num_tokens",val:": Optional[int] = None"}],parametersDescription:[{anchor:"transformers.TFPreTrainedModel.resize_token_embeddings.new_num_tokens",description:`<strong>new_num_tokens</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of new tokens in the embedding matrix. Increasing the size will add newly initialized
vectors at the end. Reducing the size will remove vectors from the end. If not provided or <code>None</code>, just
returns a pointer to the input tokens without doing anything.`,name:"new_num_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L2008",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Pointer to the input tokens of the model.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>tf.Variable</code> or <code>keras.layers.Embedding</code></p>
`}}),Ao=new T({props:{name:"save_pretrained",anchor:"transformers.TFPreTrainedModel.save_pretrained",parameters:[{name:"save_directory",val:""},{name:"saved_model",val:" = False"},{name:"version",val:" = 1"},{name:"push_to_hub",val:" = False"},{name:"signatures",val:" = None"},{name:"max_shard_size",val:": Union[int, str] = '5GB'"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = False"},{name:"token",val:": Optional[Union[str, bool]] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFPreTrainedModel.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code>) &#x2014;
Directory to which to save. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"transformers.TFPreTrainedModel.save_pretrained.saved_model",description:`<strong>saved_model</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If the model has to be saved in saved model format as well or not.`,name:"saved_model"},{anchor:"transformers.TFPreTrainedModel.save_pretrained.version",description:`<strong>version</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The version of the saved model. A saved model needs to be versioned in order to be properly loaded by
TensorFlow Serving as detailed in the official documentation
<a href="https://www.tensorflow.org/tfx/serving/serving_basic" rel="nofollow">https://www.tensorflow.org/tfx/serving/serving_basic</a>`,name:"version"},{anchor:"transformers.TFPreTrainedModel.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).`,name:"push_to_hub"},{anchor:"transformers.TFPreTrainedModel.save_pretrained.signatures",description:`<strong>signatures</strong> (<code>dict</code> or <code>tf.function</code>, <em>optional</em>) &#x2014;
Model&#x2019;s signature used for serving. This will be passed to the <code>signatures</code> argument of model.save().`,name:"signatures"},{anchor:"transformers.TFPreTrainedModel.save_pretrained.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>, defaults to <code>&quot;10GB&quot;</code>) &#x2014;
The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size
lower than this size. If expressed as a string, needs to be digits followed by a unit (like <code>&quot;5MB&quot;</code>).</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>If a single weight of the model is bigger than <code>max_shard_size</code>, it will be in its own checkpoint shard
which will be bigger than <code>max_shard_size</code>.</p>

					</div>`,name:"max_shard_size"},{anchor:"transformers.TFPreTrainedModel.save_pretrained.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"},{anchor:"transformers.TFPreTrainedModel.save_pretrained.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to save the model using <code>safetensors</code> or the traditional TensorFlow way (that uses <code>h5</code>).`,name:"safe_serialization"},{anchor:"transformers.TFPreTrainedModel.save_pretrained.token",description:`<strong>token</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, or not specified, will use
the token generated when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"transformers.TFPreTrainedModel.save_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional key word arguments passed along to the <a href="/docs/transformers/main/zh/main_classes/model#transformers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L2358"}}),So=new T({props:{name:"serving",anchor:"transformers.TFPreTrainedModel.serving",parameters:[{name:"inputs",val:""}],parametersDescription:[{anchor:"transformers.TFPreTrainedModel.serving.Method",description:"<strong>Method</strong> used for serving the model. Does not have a specific signature, but will be specialized as concrete &#x2014;",name:"Method"},{anchor:"transformers.TFPreTrainedModel.serving.functions",description:`<strong>functions</strong> when saving with <code>save_pretrained</code>. &#x2014;
inputs (<code>Dict[str, tf.Tensor]</code>):
The input of the saved model as a dictionary of tensors.`,name:"functions"}]}}),Oo=new T({props:{name:"serving_output",anchor:"transformers.TFPreTrainedModel.serving_output",parameters:[{name:"output",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1361"}}),Ko=new T({props:{name:"set_bias",anchor:"transformers.TFPreTrainedModel.set_bias",parameters:[{name:"value",val:""}],parametersDescription:[{anchor:"transformers.TFPreTrainedModel.set_bias.value",description:`<strong>value</strong> (<code>Dict[tf.Variable]</code>) &#x2014;
All the new bias attached to an LM head.`,name:"value"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1983"}}),en=new T({props:{name:"set_input_embeddings",anchor:"transformers.TFPreTrainedModel.set_input_embeddings",parameters:[{name:"value",val:""}],parametersDescription:[{anchor:"transformers.TFPreTrainedModel.set_input_embeddings.value",description:`<strong>value</strong> (<code>tf.Variable</code>) &#x2014;
The new weights mapping hidden states to vocabulary.`,name:"value"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1886"}}),tn=new T({props:{name:"set_output_embeddings",anchor:"transformers.TFPreTrainedModel.set_output_embeddings",parameters:[{name:"value",val:""}],parametersDescription:[{anchor:"transformers.TFPreTrainedModel.set_output_embeddings.value",description:`<strong>value</strong> (<code>tf.Variable</code>) &#x2014;
The new weights mapping hidden states to vocabulary.`,name:"value"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1926"}}),on=new T({props:{name:"test_step",anchor:"transformers.TFPreTrainedModel.test_step",parameters:[{name:"data",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1722"}}),nn=new T({props:{name:"train_step",anchor:"transformers.TFPreTrainedModel.train_step",parameters:[{name:"data",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L1614"}}),rn=new wt({props:{title:"TFModelUtilsMixin",local:"transformers.modeling_tf_utils.TFModelUtilsMixin",headingTag:"h2"}}),an=new T({props:{name:"class transformers.modeling_tf_utils.TFModelUtilsMixin",anchor:"transformers.modeling_tf_utils.TFModelUtilsMixin",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L126"}}),sn=new T({props:{name:"num_parameters",anchor:"transformers.modeling_tf_utils.TFModelUtilsMixin.num_parameters",parameters:[{name:"only_trainable",val:": bool = False"}],parametersDescription:[{anchor:"transformers.modeling_tf_utils.TFModelUtilsMixin.num_parameters.only_trainable",description:`<strong>only_trainable</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return only the number of trainable parameters`,name:"only_trainable"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_tf_utils.py#L131",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The number of parameters.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>int</code></p>
`}}),dn=new T({props:{name:"class transformers.FlaxPreTrainedModel",anchor:"transformers.FlaxPreTrainedModel",parameters:[{name:"config",val:": PretrainedConfig"},{name:"module",val:": Module"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_flax_utils.py#L167"}}),mn=new T({props:{name:"push_to_hub",anchor:"transformers.FlaxPreTrainedModel.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"use_temp_dir",val:": typing.Optional[bool] = None"},{name:"commit_message",val:": typing.Optional[str] = None"},{name:"private",val:": typing.Optional[bool] = None"},{name:"token",val:": typing.Union[bool, str, NoneType] = None"},{name:"max_shard_size",val:": typing.Union[int, str, NoneType] = '5GB'"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = True"},{name:"revision",val:": str = None"},{name:"commit_description",val:": str = None"},{name:"tags",val:": typing.Optional[typing.List[str]] = None"},{name:"**deprecated_kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxPreTrainedModel.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repository you want to push your model to. It should contain your organization name
when pushing to a given organization.`,name:"repo_id"},{anchor:"transformers.FlaxPreTrainedModel.push_to_hub.use_temp_dir",description:`<strong>use_temp_dir</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to use a temporary directory to store the files saved before they are pushed to the Hub.
Will default to <code>True</code> if there is no directory named like <code>repo_id</code>, <code>False</code> otherwise.`,name:"use_temp_dir"},{anchor:"transformers.FlaxPreTrainedModel.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Message to commit while pushing. Will default to <code>&quot;Upload model&quot;</code>.`,name:"commit_message"},{anchor:"transformers.FlaxPreTrainedModel.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to make the repo private. If <code>None</code> (default), the repo will be public unless the organization&#x2019;s default is private. This value is ignored if the repo already exists.`,name:"private"},{anchor:"transformers.FlaxPreTrainedModel.push_to_hub.token",description:`<strong>token</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>). Will default to <code>True</code> if <code>repo_url</code>
is not specified.`,name:"token"},{anchor:"transformers.FlaxPreTrainedModel.push_to_hub.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>, defaults to <code>&quot;5GB&quot;</code>) &#x2014;
Only applicable for models. The maximum size for a checkpoint before being sharded. Checkpoints shard
will then be each of size lower than this size. If expressed as a string, needs to be digits followed
by a unit (like <code>&quot;5MB&quot;</code>). We default it to <code>&quot;5GB&quot;</code> so that users can easily load models on free-tier
Google Colab instances without any CPU OOM issues.`,name:"max_shard_size"},{anchor:"transformers.FlaxPreTrainedModel.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"},{anchor:"transformers.FlaxPreTrainedModel.push_to_hub.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to convert the model weights in safetensors format for safer serialization.`,name:"safe_serialization"},{anchor:"transformers.FlaxPreTrainedModel.push_to_hub.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Branch to push the uploaded files to.`,name:"revision"},{anchor:"transformers.FlaxPreTrainedModel.push_to_hub.commit_description",description:`<strong>commit_description</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The description of the commit that will be created`,name:"commit_description"},{anchor:"transformers.FlaxPreTrainedModel.push_to_hub.tags",description:`<strong>tags</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
List of tags to push on the Hub.`,name:"tags"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/hub.py#L828"}}),ht=new D({props:{anchor:"transformers.FlaxPreTrainedModel.push_to_hub.example",$$slots:{default:[zh]},$$scope:{ctx:P}}}),cn=new T({props:{name:"can_generate",anchor:"transformers.FlaxPreTrainedModel.can_generate",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_flax_utils.py#L506"}}),pn=new T({props:{name:"from_pretrained",anchor:"transformers.FlaxPreTrainedModel.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike]"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"*model_args",val:""},{name:"config",val:": typing.Union[transformers.configuration_utils.PretrainedConfig, str, os.PathLike, NoneType] = None"},{name:"cache_dir",val:": typing.Union[str, os.PathLike, NoneType] = None"},{name:"ignore_mismatched_sizes",val:": bool = False"},{name:"force_download",val:": bool = False"},{name:"local_files_only",val:": bool = False"},{name:"token",val:": typing.Union[str, bool, NoneType] = None"},{name:"revision",val:": str = 'main'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxPreTrainedModel.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on huggingface.co.</li>
<li>A path to a <em>directory</em> containing model weights saved using
<a href="/docs/transformers/main/zh/main_classes/model#transformers.FlaxPreTrainedModel.save_pretrained">save_pretrained()</a>, e.g., <code>./my_model_directory/</code>.</li>
<li>A path or url to a <em>pt index checkpoint file</em> (e.g, <code>./tf_model/model.ckpt.index</code>). In this case,
<code>from_pt</code> should be set to <code>True</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"transformers.FlaxPreTrainedModel.from_pretrained.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/zh/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/zh/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxPreTrainedModel.from_pretrained.model_args",description:`<strong>model_args</strong> (sequence of positional arguments, <em>optional</em>) &#x2014;
All remaining positional arguments will be passed to the underlying model&#x2019;s <code>__init__</code> method.`,name:"model_args"},{anchor:"transformers.FlaxPreTrainedModel.from_pretrained.config",description:`<strong>config</strong> (<code>Union[PretrainedConfig, str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Can be either:</p>
<ul>
<li>an instance of a class derived from <a href="/docs/transformers/main/zh/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a>,</li>
<li>a string or path valid as input to <a href="/docs/transformers/main/zh/main_classes/configuration#transformers.PretrainedConfig.from_pretrained">from_pretrained()</a>.</li>
</ul>
<p>Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded when:</p>
<ul>
<li>The model is a model provided by the library (loaded with the <em>model id</em> string of a pretrained
model).</li>
<li>The model was saved using <a href="/docs/transformers/main/zh/main_classes/model#transformers.PreTrainedModel.save_pretrained">save_pretrained()</a> and is reloaded by supplying the
save directory.</li>
<li>The model is loaded by supplying a local directory as <code>pretrained_model_name_or_path</code> and a
configuration JSON file named <em>config.json</em> is found in the directory.</li>
</ul>`,name:"config"},{anchor:"transformers.FlaxPreTrainedModel.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"transformers.FlaxPreTrainedModel.from_pretrained.from_pt",description:`<strong>from_pt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Load the model weights from a PyTorch checkpoint save file (see docstring of
<code>pretrained_model_name_or_path</code> argument).`,name:"from_pt"},{anchor:"transformers.FlaxPreTrainedModel.from_pretrained.ignore_mismatched_sizes",description:`<strong>ignore_mismatched_sizes</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to raise an error if some of the weights from the checkpoint do not have the same size
as the weights of the model (if for instance, you are instantiating a model with 10 labels from a
checkpoint with 3 labels).`,name:"ignore_mismatched_sizes"},{anchor:"transformers.FlaxPreTrainedModel.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"transformers.FlaxPreTrainedModel.from_pretrained.resume_download",description:`<strong>resume_download</strong> &#x2014;
Deprecated and ignored. All downloads are now resumed by default when possible.
Will be removed in v5 of Transformers.`,name:"resume_download"},{anchor:"transformers.FlaxPreTrainedModel.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"transformers.FlaxPreTrainedModel.from_pretrained.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"transformers.FlaxPreTrainedModel.from_pretrained.token",description:`<strong>token</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, or not specified, will use
the token generated when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"transformers.FlaxPreTrainedModel.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_flax_utils.py#L518"}}),ut=new D({props:{anchor:"transformers.FlaxPreTrainedModel.from_pretrained.example",$$slots:{default:[Gh]},$$scope:{ctx:P}}}),hn=new T({props:{name:"load_flax_sharded_weights",anchor:"transformers.FlaxPreTrainedModel.load_flax_sharded_weights",parameters:[{name:"shard_files",val:""}],parametersDescription:[{anchor:"transformers.FlaxPreTrainedModel.load_flax_sharded_weights.shard_files",description:`<strong>shard_files</strong> (<code>List[str]</code> &#x2014;
The list of shard files to load.`,name:"shard_files"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_flax_utils.py#L459",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A nested dictionary of the model parameters, in the expected format for flax models : <code>&#123;'model': &#123;'params': &#123;'...'&#125;&#125;&#125;</code>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>Dict</code></p>
`}}),fn=new T({props:{name:"register_for_auto_class",anchor:"transformers.FlaxPreTrainedModel.register_for_auto_class",parameters:[{name:"auto_class",val:" = 'FlaxAutoModel'"}],parametersDescription:[{anchor:"transformers.FlaxPreTrainedModel.register_for_auto_class.auto_class",description:`<strong>auto_class</strong> (<code>str</code> or <code>type</code>, <em>optional</em>, defaults to <code>&quot;FlaxAutoModel&quot;</code>) &#x2014;
The auto class to register this new model with.`,name:"auto_class"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_flax_utils.py#L1227"}}),gt=new wi({props:{warning:!0,$$slots:{default:[Lh]},$$scope:{ctx:P}}}),un=new T({props:{name:"save_pretrained",anchor:"transformers.FlaxPreTrainedModel.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"params",val:" = None"},{name:"push_to_hub",val:" = False"},{name:"max_shard_size",val:" = '10GB'"},{name:"token",val:": typing.Union[str, bool, NoneType] = None"},{name:"safe_serialization",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxPreTrainedModel.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to which to save. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"transformers.FlaxPreTrainedModel.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).`,name:"push_to_hub"},{anchor:"transformers.FlaxPreTrainedModel.save_pretrained.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>, defaults to <code>&quot;10GB&quot;</code>) &#x2014;
The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size
lower than this size. If expressed as a string, needs to be digits followed by a unit (like <code>&quot;5MB&quot;</code>).</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>If a single weight of the model is bigger than <code>max_shard_size</code>, it will be in its own checkpoint shard
which will be bigger than <code>max_shard_size</code>.</p>

					</div>`,name:"max_shard_size"},{anchor:"transformers.FlaxPreTrainedModel.save_pretrained.token",description:`<strong>token</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, or not specified, will use
the token generated when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"transformers.FlaxPreTrainedModel.save_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional key word arguments passed along to the <a href="/docs/transformers/main/zh/main_classes/model#transformers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"},{anchor:"transformers.FlaxPreTrainedModel.save_pretrained.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to save the model using <code>safetensors</code> or through msgpack.`,name:"safe_serialization"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_flax_utils.py#L1089"}}),gn=new T({props:{name:"to_bf16",anchor:"transformers.FlaxPreTrainedModel.to_bf16",parameters:[{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"mask",val:": typing.Any = None"}],parametersDescription:[{anchor:"transformers.FlaxPreTrainedModel.to_bf16.params",description:`<strong>params</strong> (<code>Union[Dict, FrozenDict]</code>) &#x2014;
A <code>PyTree</code> of model parameters.`,name:"params"},{anchor:"transformers.FlaxPreTrainedModel.to_bf16.mask",description:`<strong>mask</strong> (<code>Union[Dict, FrozenDict]</code>) &#x2014;
A <code>PyTree</code> with same structure as the <code>params</code> tree. The leaves should be booleans, <code>True</code> for params
you want to cast, and should be <code>False</code> for those you want to skip.`,name:"mask"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_flax_utils.py#L329"}}),bt=new D({props:{anchor:"transformers.FlaxPreTrainedModel.to_bf16.example",$$slots:{default:[Bh]},$$scope:{ctx:P}}}),_n=new T({props:{name:"to_fp16",anchor:"transformers.FlaxPreTrainedModel.to_fp16",parameters:[{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"mask",val:": typing.Any = None"}],parametersDescription:[{anchor:"transformers.FlaxPreTrainedModel.to_fp16.params",description:`<strong>params</strong> (<code>Union[Dict, FrozenDict]</code>) &#x2014;
A <code>PyTree</code> of model parameters.`,name:"params"},{anchor:"transformers.FlaxPreTrainedModel.to_fp16.mask",description:`<strong>mask</strong> (<code>Union[Dict, FrozenDict]</code>) &#x2014;
A <code>PyTree</code> with same structure as the <code>params</code> tree. The leaves should be booleans, <code>True</code> for params
you want to cast, and should be <code>False</code> for those you want to skip`,name:"mask"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_flax_utils.py#L395"}}),yt=new D({props:{anchor:"transformers.FlaxPreTrainedModel.to_fp16.example",$$slots:{default:[Vh]},$$scope:{ctx:P}}}),bn=new T({props:{name:"to_fp32",anchor:"transformers.FlaxPreTrainedModel.to_fp32",parameters:[{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"mask",val:": typing.Any = None"}],parametersDescription:[{anchor:"transformers.FlaxPreTrainedModel.to_fp32.params",description:`<strong>params</strong> (<code>Union[Dict, FrozenDict]</code>) &#x2014;
A <code>PyTree</code> of model parameters.`,name:"params"},{anchor:"transformers.FlaxPreTrainedModel.to_fp32.mask",description:`<strong>mask</strong> (<code>Union[Dict, FrozenDict]</code>) &#x2014;
A <code>PyTree</code> with same structure as the <code>params</code> tree. The leaves should be booleans, <code>True</code> for params
you want to cast, and should be <code>False</code> for those you want to skip`,name:"mask"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_flax_utils.py#L368"}}),vt=new D({props:{anchor:"transformers.FlaxPreTrainedModel.to_fp32.example",$$slots:{default:[Hh]},$$scope:{ctx:P}}}),yn=new wt({props:{title:"推送到 Hub",local:"transformers.utils.PushToHubMixin",headingTag:"h2"}}),vn=new T({props:{name:"class transformers.utils.PushToHubMixin",anchor:"transformers.utils.PushToHubMixin",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/hub.py#L703"}}),Mn=new T({props:{name:"push_to_hub",anchor:"transformers.utils.PushToHubMixin.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"use_temp_dir",val:": typing.Optional[bool] = None"},{name:"commit_message",val:": typing.Optional[str] = None"},{name:"private",val:": typing.Optional[bool] = None"},{name:"token",val:": typing.Union[bool, str, NoneType] = None"},{name:"max_shard_size",val:": typing.Union[int, str, NoneType] = '5GB'"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = True"},{name:"revision",val:": str = None"},{name:"commit_description",val:": str = None"},{name:"tags",val:": typing.Optional[typing.List[str]] = None"},{name:"**deprecated_kwargs",val:""}],parametersDescription:[{anchor:"transformers.utils.PushToHubMixin.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repository you want to push your {object} to. It should contain your organization name
when pushing to a given organization.`,name:"repo_id"},{anchor:"transformers.utils.PushToHubMixin.push_to_hub.use_temp_dir",description:`<strong>use_temp_dir</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to use a temporary directory to store the files saved before they are pushed to the Hub.
Will default to <code>True</code> if there is no directory named like <code>repo_id</code>, <code>False</code> otherwise.`,name:"use_temp_dir"},{anchor:"transformers.utils.PushToHubMixin.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Message to commit while pushing. Will default to <code>&quot;Upload {object}&quot;</code>.`,name:"commit_message"},{anchor:"transformers.utils.PushToHubMixin.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to make the repo private. If <code>None</code> (default), the repo will be public unless the organization&#x2019;s default is private. This value is ignored if the repo already exists.`,name:"private"},{anchor:"transformers.utils.PushToHubMixin.push_to_hub.token",description:`<strong>token</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>). Will default to <code>True</code> if <code>repo_url</code>
is not specified.`,name:"token"},{anchor:"transformers.utils.PushToHubMixin.push_to_hub.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>, defaults to <code>&quot;5GB&quot;</code>) &#x2014;
Only applicable for models. The maximum size for a checkpoint before being sharded. Checkpoints shard
will then be each of size lower than this size. If expressed as a string, needs to be digits followed
by a unit (like <code>&quot;5MB&quot;</code>). We default it to <code>&quot;5GB&quot;</code> so that users can easily load models on free-tier
Google Colab instances without any CPU OOM issues.`,name:"max_shard_size"},{anchor:"transformers.utils.PushToHubMixin.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"},{anchor:"transformers.utils.PushToHubMixin.push_to_hub.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to convert the model weights in safetensors format for safer serialization.`,name:"safe_serialization"},{anchor:"transformers.utils.PushToHubMixin.push_to_hub.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Branch to push the uploaded files to.`,name:"revision"},{anchor:"transformers.utils.PushToHubMixin.push_to_hub.commit_description",description:`<strong>commit_description</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The description of the commit that will be created`,name:"commit_description"},{anchor:"transformers.utils.PushToHubMixin.push_to_hub.tags",description:`<strong>tags</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
List of tags to push on the Hub.`,name:"tags"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/hub.py#L828"}}),Mt=new D({props:{anchor:"transformers.utils.PushToHubMixin.push_to_hub.example",$$slots:{default:[qh]},$$scope:{ctx:P}}}),Tn=new wt({props:{title:"分片检查点",local:"transformers.modeling_utils.load_sharded_checkpoint",headingTag:"h2"}}),xn=new T({props:{name:"transformers.modeling_utils.load_sharded_checkpoint",anchor:"transformers.modeling_utils.load_sharded_checkpoint",parameters:[{name:"model",val:""},{name:"folder",val:""},{name:"strict",val:" = True"},{name:"prefer_safe",val:" = True"}],parametersDescription:[{anchor:"transformers.modeling_utils.load_sharded_checkpoint.model",description:"<strong>model</strong> (<code>torch.nn.Module</code>) &#x2014; The model in which to load the checkpoint.",name:"model"},{anchor:"transformers.modeling_utils.load_sharded_checkpoint.folder",description:"<strong>folder</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014; A path to a folder containing the sharded checkpoint.",name:"folder"},{anchor:"transformers.modeling_utils.load_sharded_checkpoint.strict",description:"<strong>strict</strong> (<code>bool</code>, *optional<code>, defaults to </code>True`) &#x2014;\nWhether to strictly enforce that the keys in the model state dict match the keys in the sharded checkpoint.",name:"strict"},{anchor:"transformers.modeling_utils.load_sharded_checkpoint.prefer_safe",description:`<strong>prefer_safe</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If both safetensors and PyTorch save files are present in checkpoint and <code>prefer_safe</code> is True, the
safetensors files will be loaded. Otherwise, PyTorch files are always loaded when possible.`,name:"prefer_safe"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L408",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A named tuple with <code>missing_keys</code> and <code>unexpected_keys</code> fields</p>
<ul>
<li><code>missing_keys</code> is a list of str containing the missing keys</li>
<li><code>unexpected_keys</code> is a list of str containing the unexpected keys</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>NamedTuple</code></p>
`}}),wn=new Ch({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/zh/main_classes/model.md"}}),{c(){d=r("meta"),U=o(),y=r("p"),_=o(),c(k.$$.fragment),i=o(),J=r("p"),J.innerHTML=oc,ts=o(),$t=r("p"),$t.innerHTML=nc,os=o(),kt=r("ul"),kt.innerHTML=rc,ns=o(),Ct=r("p"),Ct.innerHTML=ac,rs=o(),c(Jt.$$.fragment),as=o(),x=r("div"),c(Ut.$$.fragment),$i=o(),In=r("p"),In.textContent=sc,ki=o(),Wn=r("p"),Wn.innerHTML=ic,Ci=o(),zn=r("ul"),zn.innerHTML=lc,Ji=o(),Gn=r("p"),Gn.textContent=dc,Ui=o(),Ln=r("ul"),Ln.innerHTML=mc,ji=o(),Q=r("div"),c(jt.$$.fragment),Pi=o(),Bn=r("p"),Bn.textContent=cc,Zi=o(),c(ge.$$.fragment),Fi=o(),A=r("div"),c(Pt.$$.fragment),Ii=o(),Vn=r("p"),Vn.textContent=pc,Wi=o(),c(_e.$$.fragment),zi=o(),be=r("div"),c(Zt.$$.fragment),Gi=o(),Hn=r("p"),Hn.innerHTML=hc,Li=o(),ye=r("div"),c(Ft.$$.fragment),Bi=o(),qn=r("p"),qn.textContent=fc,Vi=o(),ve=r("div"),c(It.$$.fragment),Hi=o(),Nn=r("p"),Nn.innerHTML=uc,qi=o(),Me=r("div"),c(Wt.$$.fragment),Ni=o(),Xn=r("p"),Xn.textContent=gc,Xi=o(),Z=r("div"),c(zt.$$.fragment),Ei=o(),En=r("p"),En.textContent=_c,Ri=o(),Rn=r("p"),Rn.innerHTML=bc,Yi=o(),Yn=r("p"),Yn.innerHTML=yc,Di=o(),Dn=r("p"),Dn.innerHTML=vc,Qi=o(),Qn=r("p"),Qn.innerHTML=Mc,Ai=o(),c(Te.$$.fragment),Si=o(),c(xe.$$.fragment),Oi=o(),An=r("ul"),An.innerHTML=Tc,Ki=o(),Sn=r("p"),Sn.textContent=xc,el=o(),On=r("p"),On.textContent=wc,tl=o(),Kn=r("ol"),Kn.innerHTML=$c,ol=o(),er=r("p"),er.textContent=kc,nl=o(),we=r("div"),c(Gt.$$.fragment),rl=o(),tr=r("p"),tr.innerHTML=Cc,al=o(),$e=r("div"),c(Lt.$$.fragment),sl=o(),or=r("p"),or.textContent=Jc,il=o(),ke=r("div"),c(Bt.$$.fragment),ll=o(),nr=r("p"),nr.innerHTML=Uc,dl=o(),Ce=r("div"),c(Vt.$$.fragment),ml=o(),rr=r("p"),rr.textContent=jc,cl=o(),S=r("div"),c(Ht.$$.fragment),pl=o(),ar=r("p"),ar.textContent=Pc,hl=o(),sr=r("p"),sr.textContent=Zc,fl=o(),H=r("div"),c(qt.$$.fragment),ul=o(),ir=r("p"),ir.textContent=Fc,gl=o(),lr=r("p"),lr.textContent=Ic,_l=o(),dr=r("p"),dr.innerHTML=Wc,bl=o(),Je=r("div"),c(Nt.$$.fragment),yl=o(),mr=r("p"),mr.innerHTML=zc,vl=o(),Ue=r("div"),c(Xt.$$.fragment),Ml=o(),cr=r("p"),cr.textContent=Gc,Tl=o(),je=r("div"),c(Et.$$.fragment),xl=o(),pr=r("p"),pr.textContent=Lc,wl=o(),O=r("div"),c(Rt.$$.fragment),$l=o(),hr=r("p"),hr.textContent=Bc,kl=o(),c(Pe.$$.fragment),Cl=o(),K=r("div"),c(Yt.$$.fragment),Jl=o(),fr=r("p"),fr.innerHTML=Vc,Ul=o(),ur=r("p"),ur.innerHTML=Hc,jl=o(),Ze=r("div"),c(Dt.$$.fragment),Pl=o(),gr=r("p"),gr.innerHTML=qc,Zl=o(),Fe=r("div"),c(Qt.$$.fragment),Fl=o(),_r=r("p"),_r.innerHTML=Nc,Il=o(),Ie=r("div"),c(At.$$.fragment),Wl=o(),br=r("p"),br.textContent=Xc,zl=o(),We=r("div"),c(St.$$.fragment),Gl=o(),yr=r("p"),yr.textContent=Ec,Ll=o(),ee=r("div"),c(Ot.$$.fragment),Bl=o(),vr=r("p"),vr.textContent=Rc,Vl=o(),Mr=r("p"),Mr.innerHTML=Yc,Hl=o(),te=r("div"),c(Kt.$$.fragment),ql=o(),Tr=r("p"),Tr.innerHTML=Dc,Nl=o(),xr=r("p"),xr.innerHTML=Qc,Xl=o(),ze=r("div"),c(eo.$$.fragment),El=o(),wr=r("p"),wr.textContent=Ac,ss=o(),$r=r("a"),is=o(),c(to.$$.fragment),ls=o(),oo=r("p"),oo.innerHTML=Sc,ds=o(),no=r("p"),no.innerHTML=Oc,ms=o(),c(ro.$$.fragment),cs=o(),ao=r("p"),ao.innerHTML=Kc,ps=o(),so=r("p"),so.innerHTML=ep,hs=o(),c(io.$$.fragment),fs=o(),lo=r("p"),lo.innerHTML=tp,us=o(),c(mo.$$.fragment),gs=o(),co=r("p"),co.textContent=op,_s=o(),c(po.$$.fragment),bs=o(),ho=r("p"),ho.innerHTML=np,ys=o(),c(fo.$$.fragment),vs=o(),uo=r("p"),uo.innerHTML=rp,Ms=o(),c(go.$$.fragment),Ts=o(),_o=r("p"),_o.innerHTML=ap,xs=o(),c(bo.$$.fragment),ws=o(),yo=r("p"),yo.innerHTML=sp,$s=o(),c(vo.$$.fragment),ks=o(),Mo=r("p"),Mo.textContent=ip,Cs=o(),c(To.$$.fragment),Js=o(),W=r("div"),c(xo.$$.fragment),Rl=o(),kr=r("p"),kr.innerHTML=lp,Yl=o(),oe=r("div"),c(wo.$$.fragment),Dl=o(),Cr=r("p"),Cr.textContent=dp,Ql=o(),Jr=r("p"),Jr.innerHTML=mp,Al=o(),Ge=r("div"),c($o.$$.fragment),Sl=o(),Ur=r("p"),Ur.textContent=cp,Ol=o(),Le=r("div"),c(ko.$$.fragment),Kl=o(),jr=r("p"),jr.innerHTML=pp,ed=o(),Be=r("div"),c(Co.$$.fragment),td=o(),Pr=r("p"),Pr.textContent=hp,od=o(),Ve=r("div"),c(Jo.$$.fragment),nd=o(),Zr=r("p"),Zr.textContent=fp,rd=o(),He=r("div"),c(Uo.$$.fragment),ad=o(),Fr=r("p"),Fr.textContent=up,sd=o(),qe=r("div"),c(jo.$$.fragment),id=o(),Ir=r("p"),Ir.textContent=gp,ld=o(),Ne=r("div"),c(Po.$$.fragment),dd=o(),Wr=r("p"),Wr.innerHTML=_p,Us=o(),Zo=r("p"),Zo.textContent=bp,js=o(),w=r("div"),c(Fo.$$.fragment),md=o(),zr=r("p"),zr.textContent=yp,cd=o(),Gr=r("p"),Gr.innerHTML=vp,pd=o(),Lr=r("ul"),Lr.innerHTML=Mp,hd=o(),Br=r("p"),Br.textContent=Tp,fd=o(),Vr=r("ul"),Vr.innerHTML=xp,ud=o(),ne=r("div"),c(Io.$$.fragment),gd=o(),Hr=r("p"),Hr.innerHTML=wp,_d=o(),c(Xe.$$.fragment),bd=o(),Ee=r("div"),c(Wo.$$.fragment),yd=o(),qr=r("p"),qr.innerHTML=$p,vd=o(),Re=r("div"),c(zo.$$.fragment),Md=o(),Nr=r("p"),Nr.textContent=kp,Td=o(),Ye=r("div"),c(Go.$$.fragment),xd=o(),Xr=r("p"),Xr.innerHTML=Cp,wd=o(),B=r("div"),c(Lo.$$.fragment),$d=o(),Er=r("p"),Er.textContent=Jp,kd=o(),Rr=r("p"),Rr.innerHTML=Up,Cd=o(),Yr=r("p"),Yr.innerHTML=jp,Jd=o(),c(De.$$.fragment),Ud=o(),Qe=r("div"),c(Bo.$$.fragment),jd=o(),Dr=r("p"),Dr.textContent=Pp,Pd=o(),Ae=r("div"),c(Vo.$$.fragment),Zd=o(),Qr=r("p"),Qr.textContent=Zp,Fd=o(),Se=r("div"),c(Ho.$$.fragment),Id=o(),Ar=r("p"),Ar.textContent=Fp,Wd=o(),Oe=r("div"),c(qo.$$.fragment),zd=o(),Sr=r("p"),Sr.textContent=Ip,Gd=o(),Ke=r("div"),c(No.$$.fragment),Ld=o(),Or=r("p"),Or.textContent=Wp,Bd=o(),et=r("div"),c(Xo.$$.fragment),Vd=o(),Kr=r("p"),Kr.textContent=zp,Hd=o(),tt=r("div"),c(Eo.$$.fragment),qd=o(),ea=r("p"),ea.textContent=Gp,Nd=o(),ot=r("div"),c(Ro.$$.fragment),Xd=o(),ta=r("p"),ta.innerHTML=Lp,Ed=o(),nt=r("div"),c(Yo.$$.fragment),Rd=o(),oa=r("p"),oa.textContent=Bp,Yd=o(),re=r("div"),c(Do.$$.fragment),Dd=o(),na=r("p"),na.textContent=Vp,Qd=o(),c(rt.$$.fragment),Ad=o(),ae=r("div"),c(Qo.$$.fragment),Sd=o(),ra=r("p"),ra.innerHTML=Hp,Od=o(),aa=r("p"),aa.innerHTML=qp,Kd=o(),at=r("div"),c(Ao.$$.fragment),em=o(),sa=r("p"),sa.innerHTML=Np,tm=o(),ia=r("div"),c(So.$$.fragment),om=o(),st=r("div"),c(Oo.$$.fragment),nm=o(),la=r("p"),la.textContent=Xp,rm=o(),it=r("div"),c(Ko.$$.fragment),am=o(),da=r("p"),da.textContent=Ep,sm=o(),lt=r("div"),c(en.$$.fragment),im=o(),ma=r("p"),ma.textContent=Rp,lm=o(),dt=r("div"),c(tn.$$.fragment),dm=o(),ca=r("p"),ca.textContent=Yp,mm=o(),mt=r("div"),c(on.$$.fragment),cm=o(),pa=r("p"),pa.innerHTML=Dp,pm=o(),ct=r("div"),c(nn.$$.fragment),hm=o(),ha=r("p"),ha.innerHTML=Qp,Ps=o(),c(rn.$$.fragment),Zs=o(),X=r("div"),c(an.$$.fragment),fm=o(),fa=r("p"),fa.innerHTML=Ap,um=o(),pt=r("div"),c(sn.$$.fragment),gm=o(),ua=r("p"),ua.textContent=Sp,Fs=o(),ln=r("p"),ln.textContent=Op,Is=o(),j=r("div"),c(dn.$$.fragment),_m=o(),ga=r("p"),ga.textContent=Kp,bm=o(),_a=r("p"),_a.innerHTML=eh,ym=o(),ba=r("p"),ba.textContent=th,vm=o(),ya=r("ul"),ya.innerHTML=oh,Mm=o(),se=r("div"),c(mn.$$.fragment),Tm=o(),va=r("p"),va.textContent=nh,xm=o(),c(ht.$$.fragment),wm=o(),ft=r("div"),c(cn.$$.fragment),$m=o(),Ma=r("p"),Ma.innerHTML=rh,km=o(),V=r("div"),c(pn.$$.fragment),Cm=o(),Ta=r("p"),Ta.textContent=ah,Jm=o(),xa=r("p"),xa.innerHTML=sh,Um=o(),wa=r("p"),wa.innerHTML=ih,jm=o(),c(ut.$$.fragment),Pm=o(),ie=r("div"),c(hn.$$.fragment),Zm=o(),$a=r("p"),$a.innerHTML=lh,Fm=o(),ka=r("p"),ka.textContent=dh,Im=o(),le=r("div"),c(fn.$$.fragment),Wm=o(),Ca=r("p"),Ca.textContent=mh,zm=o(),c(gt.$$.fragment),Gm=o(),_t=r("div"),c(un.$$.fragment),Lm=o(),Ja=r("p"),Ja.innerHTML=ch,Bm=o(),q=r("div"),c(gn.$$.fragment),Vm=o(),Ua=r("p"),Ua.innerHTML=ph,Hm=o(),ja=r("p"),ja.textContent=hh,qm=o(),c(bt.$$.fragment),Nm=o(),N=r("div"),c(_n.$$.fragment),Xm=o(),Pa=r("p"),Pa.innerHTML=fh,Em=o(),Za=r("p"),Za.textContent=uh,Rm=o(),c(yt.$$.fragment),Ym=o(),de=r("div"),c(bn.$$.fragment),Dm=o(),Fa=r("p"),Fa.innerHTML=gh,Qm=o(),c(vt.$$.fragment),Ws=o(),c(yn.$$.fragment),zs=o(),E=r("div"),c(vn.$$.fragment),Am=o(),Ia=r("p"),Ia.textContent=_h,Sm=o(),me=r("div"),c(Mn.$$.fragment),Om=o(),Wa=r("p"),Wa.textContent=bh,Km=o(),c(Mt.$$.fragment),Gs=o(),c(Tn.$$.fragment),Ls=o(),R=r("div"),c(xn.$$.fragment),ec=o(),za=r("p"),za.innerHTML=yh,tc=o(),Ga=r("p"),Ga.textContent=vh,Bs=o(),c(wn.$$.fragment),Vs=o(),es=r("p"),this.h()},l(e){const m=kh("svelte-u9bgzb",document.head);d=a(m,"META",{name:!0,content:!0}),m.forEach(s),U=n(e),y=a(e,"P",{}),v(y).forEach(s),_=n(e),p(k.$$.fragment,e),i=n(e),J=a(e,"P",{"data-svelte-h":!0}),l(J)!=="svelte-1coius4"&&(J.innerHTML=oc),ts=n(e),$t=a(e,"P",{"data-svelte-h":!0}),l($t)!=="svelte-13f6y70"&&($t.innerHTML=nc),os=n(e),kt=a(e,"UL",{"data-svelte-h":!0}),l(kt)!=="svelte-koiaxy"&&(kt.innerHTML=rc),ns=n(e),Ct=a(e,"P",{"data-svelte-h":!0}),l(Ct)!=="svelte-1qwz3g3"&&(Ct.innerHTML=ac),rs=n(e),p(Jt.$$.fragment,e),as=n(e),x=a(e,"DIV",{class:!0});var $=v(x);p(Ut.$$.fragment,$),$i=n($),In=a($,"P",{"data-svelte-h":!0}),l(In)!=="svelte-12nk4t7"&&(In.textContent=sc),ki=n($),Wn=a($,"P",{"data-svelte-h":!0}),l(Wn)!=="svelte-hvvqnh"&&(Wn.innerHTML=ic),Ci=n($),zn=a($,"UL",{"data-svelte-h":!0}),l(zn)!=="svelte-6o6r8w"&&(zn.innerHTML=lc),Ji=n($),Gn=a($,"P",{"data-svelte-h":!0}),l(Gn)!=="svelte-1qxxkvo"&&(Gn.textContent=dc),Ui=n($),Ln=a($,"UL",{"data-svelte-h":!0}),l(Ln)!=="svelte-136044h"&&(Ln.innerHTML=mc),ji=n($),Q=a($,"DIV",{class:!0});var he=v(Q);p(jt.$$.fragment,he),Pi=n(he),Bn=a(he,"P",{"data-svelte-h":!0}),l(Bn)!=="svelte-1j9019y"&&(Bn.textContent=cc),Zi=n(he),p(ge.$$.fragment,he),he.forEach(s),Fi=n($),A=a($,"DIV",{class:!0});var fe=v(A);p(Pt.$$.fragment,fe),Ii=n(fe),Vn=a(fe,"P",{"data-svelte-h":!0}),l(Vn)!=="svelte-1mcxpi"&&(Vn.textContent=pc),Wi=n(fe),p(_e.$$.fragment,fe),fe.forEach(s),zi=n($),be=a($,"DIV",{class:!0});var $n=v(be);p(Zt.$$.fragment,$n),Gi=n($n),Hn=a($n,"P",{"data-svelte-h":!0}),l(Hn)!=="svelte-1r2xt0l"&&(Hn.innerHTML=hc),$n.forEach(s),Li=n($),ye=a($,"DIV",{class:!0});var kn=v(ye);p(Ft.$$.fragment,kn),Bi=n(kn),qn=a(kn,"P",{"data-svelte-h":!0}),l(qn)!=="svelte-on69a4"&&(qn.textContent=fc),kn.forEach(s),Vi=n($),ve=a($,"DIV",{class:!0});var Cn=v(ve);p(It.$$.fragment,Cn),Hi=n(Cn),Nn=a(Cn,"P",{"data-svelte-h":!0}),l(Nn)!=="svelte-1arq2q9"&&(Nn.innerHTML=uc),Cn.forEach(s),qi=n($),Me=a($,"DIV",{class:!0});var Jn=v(Me);p(Wt.$$.fragment,Jn),Ni=n(Jn),Xn=a(Jn,"P",{"data-svelte-h":!0}),l(Xn)!=="svelte-gf3f10"&&(Xn.textContent=gc),Jn.forEach(s),Xi=n($),Z=a($,"DIV",{class:!0});var F=v(Z);p(zt.$$.fragment,F),Ei=n(F),En=a(F,"P",{"data-svelte-h":!0}),l(En)!=="svelte-1m220hc"&&(En.textContent=_c),Ri=n(F),Rn=a(F,"P",{"data-svelte-h":!0}),l(Rn)!=="svelte-1vvzid2"&&(Rn.innerHTML=bc),Yi=n(F),Yn=a(F,"P",{"data-svelte-h":!0}),l(Yn)!=="svelte-floidm"&&(Yn.innerHTML=yc),Di=n(F),Dn=a(F,"P",{"data-svelte-h":!0}),l(Dn)!=="svelte-5vnnmn"&&(Dn.innerHTML=vc),Qi=n(F),Qn=a(F,"P",{"data-svelte-h":!0}),l(Qn)!=="svelte-1f411sa"&&(Qn.innerHTML=Mc),Ai=n(F),p(Te.$$.fragment,F),Si=n(F),p(xe.$$.fragment,F),Oi=n(F),An=a(F,"UL",{"data-svelte-h":!0}),l(An)!=="svelte-14hq6us"&&(An.innerHTML=Tc),Ki=n(F),Sn=a(F,"P",{"data-svelte-h":!0}),l(Sn)!=="svelte-1ndujqx"&&(Sn.textContent=xc),el=n(F),On=a(F,"P",{"data-svelte-h":!0}),l(On)!=="svelte-h5finb"&&(On.textContent=wc),tl=n(F),Kn=a(F,"OL",{"data-svelte-h":!0}),l(Kn)!=="svelte-17iv4ty"&&(Kn.innerHTML=$c),ol=n(F),er=a(F,"P",{"data-svelte-h":!0}),l(er)!=="svelte-1kh2krb"&&(er.textContent=kc),F.forEach(s),nl=n($),we=a($,"DIV",{class:!0});var Un=v(we);p(Gt.$$.fragment,Un),rl=n(Un),tr=a(Un,"P",{"data-svelte-h":!0}),l(tr)!=="svelte-1jqter6"&&(tr.innerHTML=Cc),Un.forEach(s),al=n($),$e=a($,"DIV",{class:!0});var jn=v($e);p(Lt.$$.fragment,jn),sl=n(jn),or=a(jn,"P",{"data-svelte-h":!0}),l(or)!=="svelte-1oe3d1l"&&(or.textContent=Jc),jn.forEach(s),il=n($),ke=a($,"DIV",{class:!0});var Pn=v(ke);p(Bt.$$.fragment,Pn),ll=n(Pn),nr=a(Pn,"P",{"data-svelte-h":!0}),l(nr)!=="svelte-1o6lvix"&&(nr.innerHTML=Uc),Pn.forEach(s),dl=n($),Ce=a($,"DIV",{class:!0});var Zn=v(Ce);p(Vt.$$.fragment,Zn),ml=n(Zn),rr=a(Zn,"P",{"data-svelte-h":!0}),l(rr)!=="svelte-1en7lnm"&&(rr.textContent=jc),Zn.forEach(s),cl=n($),S=a($,"DIV",{class:!0});var ue=v(S);p(Ht.$$.fragment,ue),pl=n(ue),ar=a(ue,"P",{"data-svelte-h":!0}),l(ar)!=="svelte-x1yzxn"&&(ar.textContent=Pc),hl=n(ue),sr=a(ue,"P",{"data-svelte-h":!0}),l(sr)!=="svelte-1c0vp3s"&&(sr.textContent=Zc),ue.forEach(s),fl=n($),H=a($,"DIV",{class:!0});var Y=v(H);p(qt.$$.fragment,Y),ul=n(Y),ir=a(Y,"P",{"data-svelte-h":!0}),l(ir)!=="svelte-vu1mp6"&&(ir.textContent=Fc),gl=n(Y),lr=a(Y,"P",{"data-svelte-h":!0}),l(lr)!=="svelte-1c0vp3s"&&(lr.textContent=Ic),_l=n(Y),dr=a(Y,"P",{"data-svelte-h":!0}),l(dr)!=="svelte-1entg0x"&&(dr.innerHTML=Wc),Y.forEach(s),bl=n($),Je=a($,"DIV",{class:!0});var Fn=v(Je);p(Nt.$$.fragment,Fn),yl=n(Fn),mr=a(Fn,"P",{"data-svelte-h":!0}),l(mr)!=="svelte-1gceydr"&&(mr.innerHTML=zc),Fn.forEach(s),vl=n($),Ue=a($,"DIV",{class:!0});var qs=v(Ue);p(Xt.$$.fragment,qs),Ml=n(qs),cr=a(qs,"P",{"data-svelte-h":!0}),l(cr)!=="svelte-kxy0hj"&&(cr.textContent=Gc),qs.forEach(s),Tl=n($),je=a($,"DIV",{class:!0});var Ns=v(je);p(Et.$$.fragment,Ns),xl=n(Ns),pr=a(Ns,"P",{"data-svelte-h":!0}),l(pr)!=="svelte-qvrpxu"&&(pr.textContent=Lc),Ns.forEach(s),wl=n($),O=a($,"DIV",{class:!0});var La=v(O);p(Rt.$$.fragment,La),$l=n(La),hr=a(La,"P",{"data-svelte-h":!0}),l(hr)!=="svelte-1ie4sav"&&(hr.textContent=Bc),kl=n(La),p(Pe.$$.fragment,La),La.forEach(s),Cl=n($),K=a($,"DIV",{class:!0});var Ba=v(K);p(Yt.$$.fragment,Ba),Jl=n(Ba),fr=a(Ba,"P",{"data-svelte-h":!0}),l(fr)!=="svelte-sgsur1"&&(fr.innerHTML=Vc),Ul=n(Ba),ur=a(Ba,"P",{"data-svelte-h":!0}),l(ur)!=="svelte-1t4xas4"&&(ur.innerHTML=Hc),Ba.forEach(s),jl=n($),Ze=a($,"DIV",{class:!0});var Xs=v(Ze);p(Dt.$$.fragment,Xs),Pl=n(Xs),gr=a(Xs,"P",{"data-svelte-h":!0}),l(gr)!=="svelte-82zzvf"&&(gr.innerHTML=qc),Xs.forEach(s),Zl=n($),Fe=a($,"DIV",{class:!0});var Es=v(Fe);p(Qt.$$.fragment,Es),Fl=n(Es),_r=a(Es,"P",{"data-svelte-h":!0}),l(_r)!=="svelte-xt7asw"&&(_r.innerHTML=Nc),Es.forEach(s),Il=n($),Ie=a($,"DIV",{class:!0});var Rs=v(Ie);p(At.$$.fragment,Rs),Wl=n(Rs),br=a(Rs,"P",{"data-svelte-h":!0}),l(br)!=="svelte-107jmv5"&&(br.textContent=Xc),Rs.forEach(s),zl=n($),We=a($,"DIV",{class:!0});var Ys=v(We);p(St.$$.fragment,Ys),Gl=n(Ys),yr=a(Ys,"P",{"data-svelte-h":!0}),l(yr)!=="svelte-1xopsua"&&(yr.textContent=Ec),Ys.forEach(s),Ll=n($),ee=a($,"DIV",{class:!0});var Va=v(ee);p(Ot.$$.fragment,Va),Bl=n(Va),vr=a(Va,"P",{"data-svelte-h":!0}),l(vr)!=="svelte-5nt4be"&&(vr.textContent=Rc),Vl=n(Va),Mr=a(Va,"P",{"data-svelte-h":!0}),l(Mr)!=="svelte-1ti0hxu"&&(Mr.innerHTML=Yc),Va.forEach(s),Hl=n($),te=a($,"DIV",{class:!0});var Ha=v(te);p(Kt.$$.fragment,Ha),ql=n(Ha),Tr=a(Ha,"P",{"data-svelte-h":!0}),l(Tr)!=="svelte-1sq1344"&&(Tr.innerHTML=Dc),Nl=n(Ha),xr=a(Ha,"P",{"data-svelte-h":!0}),l(xr)!=="svelte-1p16ejc"&&(xr.innerHTML=Qc),Ha.forEach(s),Xl=n($),ze=a($,"DIV",{class:!0});var Ds=v(ze);p(eo.$$.fragment,Ds),El=n(Ds),wr=a(Ds,"P",{"data-svelte-h":!0}),l(wr)!=="svelte-nkp8sx"&&(wr.textContent=Ac),Ds.forEach(s),$.forEach(s),ss=n(e),$r=a(e,"A",{id:!0}),v($r).forEach(s),is=n(e),p(to.$$.fragment,e),ls=n(e),oo=a(e,"P",{"data-svelte-h":!0}),l(oo)!=="svelte-nfcprv"&&(oo.innerHTML=Sc),ds=n(e),no=a(e,"P",{"data-svelte-h":!0}),l(no)!=="svelte-qrb1dj"&&(no.innerHTML=Oc),ms=n(e),p(ro.$$.fragment,e),cs=n(e),ao=a(e,"P",{"data-svelte-h":!0}),l(ao)!=="svelte-xmvuux"&&(ao.innerHTML=Kc),ps=n(e),so=a(e,"P",{"data-svelte-h":!0}),l(so)!=="svelte-7m1yxv"&&(so.innerHTML=ep),hs=n(e),p(io.$$.fragment,e),fs=n(e),lo=a(e,"P",{"data-svelte-h":!0}),l(lo)!=="svelte-ojcu9d"&&(lo.innerHTML=tp),us=n(e),p(mo.$$.fragment,e),gs=n(e),co=a(e,"P",{"data-svelte-h":!0}),l(co)!=="svelte-1mbamxm"&&(co.textContent=op),_s=n(e),p(po.$$.fragment,e),bs=n(e),ho=a(e,"P",{"data-svelte-h":!0}),l(ho)!=="svelte-lqp8cl"&&(ho.innerHTML=np),ys=n(e),p(fo.$$.fragment,e),vs=n(e),uo=a(e,"P",{"data-svelte-h":!0}),l(uo)!=="svelte-1yg4npf"&&(uo.innerHTML=rp),Ms=n(e),p(go.$$.fragment,e),Ts=n(e),_o=a(e,"P",{"data-svelte-h":!0}),l(_o)!=="svelte-1sbnz4p"&&(_o.innerHTML=ap),xs=n(e),p(bo.$$.fragment,e),ws=n(e),yo=a(e,"P",{"data-svelte-h":!0}),l(yo)!=="svelte-1vubc7v"&&(yo.innerHTML=sp),$s=n(e),p(vo.$$.fragment,e),ks=n(e),Mo=a(e,"P",{"data-svelte-h":!0}),l(Mo)!=="svelte-1mmpgkn"&&(Mo.textContent=ip),Cs=n(e),p(To.$$.fragment,e),Js=n(e),W=a(e,"DIV",{class:!0});var z=v(W);p(xo.$$.fragment,z),Rl=n(z),kr=a(z,"P",{"data-svelte-h":!0}),l(kr)!=="svelte-9daxpl"&&(kr.innerHTML=lp),Yl=n(z),oe=a(z,"DIV",{class:!0});var qa=v(oe);p(wo.$$.fragment,qa),Dl=n(qa),Cr=a(qa,"P",{"data-svelte-h":!0}),l(Cr)!=="svelte-bszdl"&&(Cr.textContent=dp),Ql=n(qa),Jr=a(qa,"P",{"data-svelte-h":!0}),l(Jr)!=="svelte-1yhz50g"&&(Jr.innerHTML=mp),qa.forEach(s),Al=n(z),Ge=a(z,"DIV",{class:!0});var Qs=v(Ge);p($o.$$.fragment,Qs),Sl=n(Qs),Ur=a(Qs,"P",{"data-svelte-h":!0}),l(Ur)!=="svelte-1vzpsnb"&&(Ur.textContent=cp),Qs.forEach(s),Ol=n(z),Le=a(z,"DIV",{class:!0});var As=v(Le);p(ko.$$.fragment,As),Kl=n(As),jr=a(As,"P",{"data-svelte-h":!0}),l(jr)!=="svelte-1quexap"&&(jr.innerHTML=pp),As.forEach(s),ed=n(z),Be=a(z,"DIV",{class:!0});var Ss=v(Be);p(Co.$$.fragment,Ss),td=n(Ss),Pr=a(Ss,"P",{"data-svelte-h":!0}),l(Pr)!=="svelte-qy1xxb"&&(Pr.textContent=hp),Ss.forEach(s),od=n(z),Ve=a(z,"DIV",{class:!0});var Os=v(Ve);p(Jo.$$.fragment,Os),nd=n(Os),Zr=a(Os,"P",{"data-svelte-h":!0}),l(Zr)!=="svelte-1y1rtu0"&&(Zr.textContent=fp),Os.forEach(s),rd=n(z),He=a(z,"DIV",{class:!0});var Ks=v(He);p(Uo.$$.fragment,Ks),ad=n(Ks),Fr=a(Ks,"P",{"data-svelte-h":!0}),l(Fr)!=="svelte-1tbhnug"&&(Fr.textContent=up),Ks.forEach(s),sd=n(z),qe=a(z,"DIV",{class:!0});var ei=v(qe);p(jo.$$.fragment,ei),id=n(ei),Ir=a(ei,"P",{"data-svelte-h":!0}),l(Ir)!=="svelte-vktrn"&&(Ir.textContent=gp),ei.forEach(s),ld=n(z),Ne=a(z,"DIV",{class:!0});var ti=v(Ne);p(Po.$$.fragment,ti),dd=n(ti),Wr=a(ti,"P",{"data-svelte-h":!0}),l(Wr)!=="svelte-17dokk"&&(Wr.innerHTML=_p),ti.forEach(s),z.forEach(s),Us=n(e),Zo=a(e,"P",{"data-svelte-h":!0}),l(Zo)!=="svelte-t5gx7b"&&(Zo.textContent=bp),js=n(e),w=a(e,"DIV",{class:!0});var C=v(w);p(Fo.$$.fragment,C),md=n(C),zr=a(C,"P",{"data-svelte-h":!0}),l(zr)!=="svelte-ho56tp"&&(zr.textContent=yp),cd=n(C),Gr=a(C,"P",{"data-svelte-h":!0}),l(Gr)!=="svelte-14b9gvp"&&(Gr.innerHTML=vp),pd=n(C),Lr=a(C,"UL",{"data-svelte-h":!0}),l(Lr)!=="svelte-6o6r8w"&&(Lr.innerHTML=Mp),hd=n(C),Br=a(C,"P",{"data-svelte-h":!0}),l(Br)!=="svelte-1qxxkvo"&&(Br.textContent=Tp),fd=n(C),Vr=a(C,"UL",{"data-svelte-h":!0}),l(Vr)!=="svelte-1skzrdh"&&(Vr.innerHTML=xp),ud=n(C),ne=a(C,"DIV",{class:!0});var Na=v(ne);p(Io.$$.fragment,Na),gd=n(Na),Hr=a(Na,"P",{"data-svelte-h":!0}),l(Hr)!=="svelte-8nftbo"&&(Hr.innerHTML=wp),_d=n(Na),p(Xe.$$.fragment,Na),Na.forEach(s),bd=n(C),Ee=a(C,"DIV",{class:!0});var oi=v(Ee);p(Wo.$$.fragment,oi),yd=n(oi),qr=a(oi,"P",{"data-svelte-h":!0}),l(qr)!=="svelte-1r2xt0l"&&(qr.innerHTML=$p),oi.forEach(s),vd=n(C),Re=a(C,"DIV",{class:!0});var ni=v(Re);p(zo.$$.fragment,ni),Md=n(ni),Nr=a(ni,"P",{"data-svelte-h":!0}),l(Nr)!=="svelte-wsnq9n"&&(Nr.textContent=kp),ni.forEach(s),Td=n(C),Ye=a(C,"DIV",{class:!0});var ri=v(Ye);p(Go.$$.fragment,ri),xd=n(ri),Xr=a(ri,"P",{"data-svelte-h":!0}),l(Xr)!=="svelte-1mh859w"&&(Xr.innerHTML=Cp),ri.forEach(s),wd=n(C),B=a(C,"DIV",{class:!0});var ce=v(B);p(Lo.$$.fragment,ce),$d=n(ce),Er=a(ce,"P",{"data-svelte-h":!0}),l(Er)!=="svelte-vc5x03"&&(Er.textContent=Jp),kd=n(ce),Rr=a(ce,"P",{"data-svelte-h":!0}),l(Rr)!=="svelte-floidm"&&(Rr.innerHTML=Up),Cd=n(ce),Yr=a(ce,"P",{"data-svelte-h":!0}),l(Yr)!=="svelte-5vnnmn"&&(Yr.innerHTML=jp),Jd=n(ce),p(De.$$.fragment,ce),ce.forEach(s),Ud=n(C),Qe=a(C,"DIV",{class:!0});var ai=v(Qe);p(Bo.$$.fragment,ai),jd=n(ai),Dr=a(ai,"P",{"data-svelte-h":!0}),l(Dr)!=="svelte-ja4l5b"&&(Dr.textContent=Pp),ai.forEach(s),Pd=n(C),Ae=a(C,"DIV",{class:!0});var si=v(Ae);p(Vo.$$.fragment,si),Zd=n(si),Qr=a(si,"P",{"data-svelte-h":!0}),l(Qr)!=="svelte-1y1rtu0"&&(Qr.textContent=Zp),si.forEach(s),Fd=n(C),Se=a(C,"DIV",{class:!0});var ii=v(Se);p(Ho.$$.fragment,ii),Id=n(ii),Ar=a(ii,"P",{"data-svelte-h":!0}),l(Ar)!=="svelte-1g2truu"&&(Ar.textContent=Fp),ii.forEach(s),Wd=n(C),Oe=a(C,"DIV",{class:!0});var li=v(Oe);p(qo.$$.fragment,li),zd=n(li),Sr=a(li,"P",{"data-svelte-h":!0}),l(Sr)!=="svelte-1hvwe3j"&&(Sr.textContent=Ip),li.forEach(s),Gd=n(C),Ke=a(C,"DIV",{class:!0});var di=v(Ke);p(No.$$.fragment,di),Ld=n(di),Or=a(di,"P",{"data-svelte-h":!0}),l(Or)!=="svelte-1mu3td8"&&(Or.textContent=Wp),di.forEach(s),Bd=n(C),et=a(C,"DIV",{class:!0});var mi=v(et);p(Xo.$$.fragment,mi),Vd=n(mi),Kr=a(mi,"P",{"data-svelte-h":!0}),l(Kr)!=="svelte-ib1802"&&(Kr.textContent=zp),mi.forEach(s),Hd=n(C),tt=a(C,"DIV",{class:!0});var ci=v(tt);p(Eo.$$.fragment,ci),qd=n(ci),ea=a(ci,"P",{"data-svelte-h":!0}),l(ea)!=="svelte-1vipzyv"&&(ea.textContent=Gp),ci.forEach(s),Nd=n(C),ot=a(C,"DIV",{class:!0});var pi=v(ot);p(Ro.$$.fragment,pi),Xd=n(pi),ta=a(pi,"P",{"data-svelte-h":!0}),l(ta)!=="svelte-q8rs5u"&&(ta.innerHTML=Lp),pi.forEach(s),Ed=n(C),nt=a(C,"DIV",{class:!0});var hi=v(nt);p(Yo.$$.fragment,hi),Rd=n(hi),oa=a(hi,"P",{"data-svelte-h":!0}),l(oa)!=="svelte-qvrpxu"&&(oa.textContent=Bp),hi.forEach(s),Yd=n(C),re=a(C,"DIV",{class:!0});var Xa=v(re);p(Do.$$.fragment,Xa),Dd=n(Xa),na=a(Xa,"P",{"data-svelte-h":!0}),l(na)!=="svelte-1ie4sav"&&(na.textContent=Vp),Qd=n(Xa),p(rt.$$.fragment,Xa),Xa.forEach(s),Ad=n(C),ae=a(C,"DIV",{class:!0});var Ea=v(ae);p(Qo.$$.fragment,Ea),Sd=n(Ea),ra=a(Ea,"P",{"data-svelte-h":!0}),l(ra)!=="svelte-sgsur1"&&(ra.innerHTML=Hp),Od=n(Ea),aa=a(Ea,"P",{"data-svelte-h":!0}),l(aa)!=="svelte-1t4xas4"&&(aa.innerHTML=qp),Ea.forEach(s),Kd=n(C),at=a(C,"DIV",{class:!0});var fi=v(at);p(Ao.$$.fragment,fi),em=n(fi),sa=a(fi,"P",{"data-svelte-h":!0}),l(sa)!=="svelte-1olaqb6"&&(sa.innerHTML=Np),fi.forEach(s),tm=n(C),ia=a(C,"DIV",{class:!0});var Mh=v(ia);p(So.$$.fragment,Mh),Mh.forEach(s),om=n(C),st=a(C,"DIV",{class:!0});var ui=v(st);p(Oo.$$.fragment,ui),nm=n(ui),la=a(ui,"P",{"data-svelte-h":!0}),l(la)!=="svelte-4zpnur"&&(la.textContent=Xp),ui.forEach(s),rm=n(C),it=a(C,"DIV",{class:!0});var gi=v(it);p(Ko.$$.fragment,gi),am=n(gi),da=a(gi,"P",{"data-svelte-h":!0}),l(da)!=="svelte-cmhrcy"&&(da.textContent=Ep),gi.forEach(s),sm=n(C),lt=a(C,"DIV",{class:!0});var _i=v(lt);p(en.$$.fragment,_i),im=n(_i),ma=a(_i,"P",{"data-svelte-h":!0}),l(ma)!=="svelte-1ouwbwr"&&(ma.textContent=Rp),_i.forEach(s),lm=n(C),dt=a(C,"DIV",{class:!0});var bi=v(dt);p(tn.$$.fragment,bi),dm=n(bi),ca=a(bi,"P",{"data-svelte-h":!0}),l(ca)!=="svelte-x8fgs0"&&(ca.textContent=Yp),bi.forEach(s),mm=n(C),mt=a(C,"DIV",{class:!0});var yi=v(mt);p(on.$$.fragment,yi),cm=n(yi),pa=a(yi,"P",{"data-svelte-h":!0}),l(pa)!=="svelte-oo8tit"&&(pa.innerHTML=Dp),yi.forEach(s),pm=n(C),ct=a(C,"DIV",{class:!0});var vi=v(ct);p(nn.$$.fragment,vi),hm=n(vi),ha=a(vi,"P",{"data-svelte-h":!0}),l(ha)!=="svelte-oo8tit"&&(ha.innerHTML=Qp),vi.forEach(s),C.forEach(s),Ps=n(e),p(rn.$$.fragment,e),Zs=n(e),X=a(e,"DIV",{class:!0});var Ra=v(X);p(an.$$.fragment,Ra),fm=n(Ra),fa=a(Ra,"P",{"data-svelte-h":!0}),l(fa)!=="svelte-1dqi2f3"&&(fa.innerHTML=Ap),um=n(Ra),pt=a(Ra,"DIV",{class:!0});var Mi=v(pt);p(sn.$$.fragment,Mi),gm=n(Mi),ua=a(Mi,"P",{"data-svelte-h":!0}),l(ua)!=="svelte-im20fs"&&(ua.textContent=Sp),Mi.forEach(s),Ra.forEach(s),Fs=n(e),ln=a(e,"P",{"data-svelte-h":!0}),l(ln)!=="svelte-11sh6ng"&&(ln.textContent=Op),Is=n(e),j=a(e,"DIV",{class:!0});var I=v(j);p(dn.$$.fragment,I),_m=n(I),ga=a(I,"P",{"data-svelte-h":!0}),l(ga)!=="svelte-12nk4t7"&&(ga.textContent=Kp),bm=n(I),_a=a(I,"P",{"data-svelte-h":!0}),l(_a)!=="svelte-v1s2xo"&&(_a.innerHTML=eh),ym=n(I),ba=a(I,"P",{"data-svelte-h":!0}),l(ba)!=="svelte-1qxxkvo"&&(ba.textContent=th),vm=n(I),ya=a(I,"UL",{"data-svelte-h":!0}),l(ya)!=="svelte-1skzrdh"&&(ya.innerHTML=oh),Mm=n(I),se=a(I,"DIV",{class:!0});var Ya=v(se);p(mn.$$.fragment,Ya),Tm=n(Ya),va=a(Ya,"P",{"data-svelte-h":!0}),l(va)!=="svelte-a8hf5e"&&(va.textContent=nh),xm=n(Ya),p(ht.$$.fragment,Ya),Ya.forEach(s),wm=n(I),ft=a(I,"DIV",{class:!0});var Ti=v(ft);p(cn.$$.fragment,Ti),$m=n(Ti),Ma=a(Ti,"P",{"data-svelte-h":!0}),l(Ma)!=="svelte-12hq10t"&&(Ma.innerHTML=rh),Ti.forEach(s),km=n(I),V=a(I,"DIV",{class:!0});var pe=v(V);p(pn.$$.fragment,pe),Cm=n(pe),Ta=a(pe,"P",{"data-svelte-h":!0}),l(Ta)!=="svelte-1oaqdrm"&&(Ta.textContent=ah),Jm=n(pe),xa=a(pe,"P",{"data-svelte-h":!0}),l(xa)!=="svelte-floidm"&&(xa.innerHTML=sh),Um=n(pe),wa=a(pe,"P",{"data-svelte-h":!0}),l(wa)!=="svelte-5vnnmn"&&(wa.innerHTML=ih),jm=n(pe),p(ut.$$.fragment,pe),pe.forEach(s),Pm=n(I),ie=a(I,"DIV",{class:!0});var Da=v(ie);p(hn.$$.fragment,Da),Zm=n(Da),$a=a(Da,"P",{"data-svelte-h":!0}),l($a)!=="svelte-plzzd0"&&($a.innerHTML=lh),Fm=n(Da),ka=a(Da,"P",{"data-svelte-h":!0}),l(ka)!=="svelte-bzl1lx"&&(ka.textContent=dh),Da.forEach(s),Im=n(I),le=a(I,"DIV",{class:!0});var Qa=v(le);p(fn.$$.fragment,Qa),Wm=n(Qa),Ca=a(Qa,"P",{"data-svelte-h":!0}),l(Ca)!=="svelte-1ie4sav"&&(Ca.textContent=mh),zm=n(Qa),p(gt.$$.fragment,Qa),Qa.forEach(s),Gm=n(I),_t=a(I,"DIV",{class:!0});var xi=v(_t);p(un.$$.fragment,xi),Lm=n(xi),Ja=a(xi,"P",{"data-svelte-h":!0}),l(Ja)!=="svelte-1ly2tj0"&&(Ja.innerHTML=ch),xi.forEach(s),Bm=n(I),q=a(I,"DIV",{class:!0});var Tt=v(q);p(gn.$$.fragment,Tt),Vm=n(Tt),Ua=a(Tt,"P",{"data-svelte-h":!0}),l(Ua)!=="svelte-16uni9u"&&(Ua.innerHTML=ph),Hm=n(Tt),ja=a(Tt,"P",{"data-svelte-h":!0}),l(ja)!=="svelte-qh3hgx"&&(ja.textContent=hh),qm=n(Tt),p(bt.$$.fragment,Tt),Tt.forEach(s),Nm=n(I),N=a(I,"DIV",{class:!0});var xt=v(N);p(_n.$$.fragment,xt),Xm=n(xt),Pa=a(xt,"P",{"data-svelte-h":!0}),l(Pa)!=="svelte-uock64"&&(Pa.innerHTML=fh),Em=n(xt),Za=a(xt,"P",{"data-svelte-h":!0}),l(Za)!=="svelte-1rko7go"&&(Za.textContent=uh),Rm=n(xt),p(yt.$$.fragment,xt),xt.forEach(s),Ym=n(I),de=a(I,"DIV",{class:!0});var Aa=v(de);p(bn.$$.fragment,Aa),Dm=n(Aa),Fa=a(Aa,"P",{"data-svelte-h":!0}),l(Fa)!=="svelte-1jvan3s"&&(Fa.innerHTML=gh),Qm=n(Aa),p(vt.$$.fragment,Aa),Aa.forEach(s),I.forEach(s),Ws=n(e),p(yn.$$.fragment,e),zs=n(e),E=a(e,"DIV",{class:!0});var Sa=v(E);p(vn.$$.fragment,Sa),Am=n(Sa),Ia=a(Sa,"P",{"data-svelte-h":!0}),l(Ia)!=="svelte-s2i98"&&(Ia.textContent=_h),Sm=n(Sa),me=a(Sa,"DIV",{class:!0});var Oa=v(me);p(Mn.$$.fragment,Oa),Om=n(Oa),Wa=a(Oa,"P",{"data-svelte-h":!0}),l(Wa)!=="svelte-am4l6x"&&(Wa.textContent=bh),Km=n(Oa),p(Mt.$$.fragment,Oa),Oa.forEach(s),Sa.forEach(s),Gs=n(e),p(Tn.$$.fragment,e),Ls=n(e),R=a(e,"DIV",{class:!0});var Ka=v(R);p(xn.$$.fragment,Ka),ec=n(Ka),za=a(Ka,"P",{"data-svelte-h":!0}),l(za)!=="svelte-16tfby7"&&(za.innerHTML=yh),tc=n(Ka),Ga=a(Ka,"P",{"data-svelte-h":!0}),l(Ga)!=="svelte-bzl1lx"&&(Ga.textContent=vh),Ka.forEach(s),Bs=n(e),p(wn.$$.fragment,e),Vs=n(e),es=a(e,"P",{}),v(es).forEach(s),this.h()},h(){M(d,"name","hf:doc:metadata"),M(d,"content",Xh),M(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(we,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M($r,"id","from_pretrained-torch-dtype"),M(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ia,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(le,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(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(me,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(R,"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,m){t(document.head,d),b(e,U,m),b(e,y,m),b(e,_,m),h(k,e,m),b(e,i,m),b(e,J,m),b(e,ts,m),b(e,$t,m),b(e,os,m),b(e,kt,m),b(e,ns,m),b(e,Ct,m),b(e,rs,m),h(Jt,e,m),b(e,as,m),b(e,x,m),h(Ut,x,null),t(x,$i),t(x,In),t(x,ki),t(x,Wn),t(x,Ci),t(x,zn),t(x,Ji),t(x,Gn),t(x,Ui),t(x,Ln),t(x,ji),t(x,Q),h(jt,Q,null),t(Q,Pi),t(Q,Bn),t(Q,Zi),h(ge,Q,null),t(x,Fi),t(x,A),h(Pt,A,null),t(A,Ii),t(A,Vn),t(A,Wi),h(_e,A,null),t(x,zi),t(x,be),h(Zt,be,null),t(be,Gi),t(be,Hn),t(x,Li),t(x,ye),h(Ft,ye,null),t(ye,Bi),t(ye,qn),t(x,Vi),t(x,ve),h(It,ve,null),t(ve,Hi),t(ve,Nn),t(x,qi),t(x,Me),h(Wt,Me,null),t(Me,Ni),t(Me,Xn),t(x,Xi),t(x,Z),h(zt,Z,null),t(Z,Ei),t(Z,En),t(Z,Ri),t(Z,Rn),t(Z,Yi),t(Z,Yn),t(Z,Di),t(Z,Dn),t(Z,Qi),t(Z,Qn),t(Z,Ai),h(Te,Z,null),t(Z,Si),h(xe,Z,null),t(Z,Oi),t(Z,An),t(Z,Ki),t(Z,Sn),t(Z,el),t(Z,On),t(Z,tl),t(Z,Kn),t(Z,ol),t(Z,er),t(x,nl),t(x,we),h(Gt,we,null),t(we,rl),t(we,tr),t(x,al),t(x,$e),h(Lt,$e,null),t($e,sl),t($e,or),t(x,il),t(x,ke),h(Bt,ke,null),t(ke,ll),t(ke,nr),t(x,dl),t(x,Ce),h(Vt,Ce,null),t(Ce,ml),t(Ce,rr),t(x,cl),t(x,S),h(Ht,S,null),t(S,pl),t(S,ar),t(S,hl),t(S,sr),t(x,fl),t(x,H),h(qt,H,null),t(H,ul),t(H,ir),t(H,gl),t(H,lr),t(H,_l),t(H,dr),t(x,bl),t(x,Je),h(Nt,Je,null),t(Je,yl),t(Je,mr),t(x,vl),t(x,Ue),h(Xt,Ue,null),t(Ue,Ml),t(Ue,cr),t(x,Tl),t(x,je),h(Et,je,null),t(je,xl),t(je,pr),t(x,wl),t(x,O),h(Rt,O,null),t(O,$l),t(O,hr),t(O,kl),h(Pe,O,null),t(x,Cl),t(x,K),h(Yt,K,null),t(K,Jl),t(K,fr),t(K,Ul),t(K,ur),t(x,jl),t(x,Ze),h(Dt,Ze,null),t(Ze,Pl),t(Ze,gr),t(x,Zl),t(x,Fe),h(Qt,Fe,null),t(Fe,Fl),t(Fe,_r),t(x,Il),t(x,Ie),h(At,Ie,null),t(Ie,Wl),t(Ie,br),t(x,zl),t(x,We),h(St,We,null),t(We,Gl),t(We,yr),t(x,Ll),t(x,ee),h(Ot,ee,null),t(ee,Bl),t(ee,vr),t(ee,Vl),t(ee,Mr),t(x,Hl),t(x,te),h(Kt,te,null),t(te,ql),t(te,Tr),t(te,Nl),t(te,xr),t(x,Xl),t(x,ze),h(eo,ze,null),t(ze,El),t(ze,wr),b(e,ss,m),b(e,$r,m),b(e,is,m),h(to,e,m),b(e,ls,m),b(e,oo,m),b(e,ds,m),b(e,no,m),b(e,ms,m),h(ro,e,m),b(e,cs,m),b(e,ao,m),b(e,ps,m),b(e,so,m),b(e,hs,m),h(io,e,m),b(e,fs,m),b(e,lo,m),b(e,us,m),h(mo,e,m),b(e,gs,m),b(e,co,m),b(e,_s,m),h(po,e,m),b(e,bs,m),b(e,ho,m),b(e,ys,m),h(fo,e,m),b(e,vs,m),b(e,uo,m),b(e,Ms,m),h(go,e,m),b(e,Ts,m),b(e,_o,m),b(e,xs,m),h(bo,e,m),b(e,ws,m),b(e,yo,m),b(e,$s,m),h(vo,e,m),b(e,ks,m),b(e,Mo,m),b(e,Cs,m),h(To,e,m),b(e,Js,m),b(e,W,m),h(xo,W,null),t(W,Rl),t(W,kr),t(W,Yl),t(W,oe),h(wo,oe,null),t(oe,Dl),t(oe,Cr),t(oe,Ql),t(oe,Jr),t(W,Al),t(W,Ge),h($o,Ge,null),t(Ge,Sl),t(Ge,Ur),t(W,Ol),t(W,Le),h(ko,Le,null),t(Le,Kl),t(Le,jr),t(W,ed),t(W,Be),h(Co,Be,null),t(Be,td),t(Be,Pr),t(W,od),t(W,Ve),h(Jo,Ve,null),t(Ve,nd),t(Ve,Zr),t(W,rd),t(W,He),h(Uo,He,null),t(He,ad),t(He,Fr),t(W,sd),t(W,qe),h(jo,qe,null),t(qe,id),t(qe,Ir),t(W,ld),t(W,Ne),h(Po,Ne,null),t(Ne,dd),t(Ne,Wr),b(e,Us,m),b(e,Zo,m),b(e,js,m),b(e,w,m),h(Fo,w,null),t(w,md),t(w,zr),t(w,cd),t(w,Gr),t(w,pd),t(w,Lr),t(w,hd),t(w,Br),t(w,fd),t(w,Vr),t(w,ud),t(w,ne),h(Io,ne,null),t(ne,gd),t(ne,Hr),t(ne,_d),h(Xe,ne,null),t(w,bd),t(w,Ee),h(Wo,Ee,null),t(Ee,yd),t(Ee,qr),t(w,vd),t(w,Re),h(zo,Re,null),t(Re,Md),t(Re,Nr),t(w,Td),t(w,Ye),h(Go,Ye,null),t(Ye,xd),t(Ye,Xr),t(w,wd),t(w,B),h(Lo,B,null),t(B,$d),t(B,Er),t(B,kd),t(B,Rr),t(B,Cd),t(B,Yr),t(B,Jd),h(De,B,null),t(w,Ud),t(w,Qe),h(Bo,Qe,null),t(Qe,jd),t(Qe,Dr),t(w,Pd),t(w,Ae),h(Vo,Ae,null),t(Ae,Zd),t(Ae,Qr),t(w,Fd),t(w,Se),h(Ho,Se,null),t(Se,Id),t(Se,Ar),t(w,Wd),t(w,Oe),h(qo,Oe,null),t(Oe,zd),t(Oe,Sr),t(w,Gd),t(w,Ke),h(No,Ke,null),t(Ke,Ld),t(Ke,Or),t(w,Bd),t(w,et),h(Xo,et,null),t(et,Vd),t(et,Kr),t(w,Hd),t(w,tt),h(Eo,tt,null),t(tt,qd),t(tt,ea),t(w,Nd),t(w,ot),h(Ro,ot,null),t(ot,Xd),t(ot,ta),t(w,Ed),t(w,nt),h(Yo,nt,null),t(nt,Rd),t(nt,oa),t(w,Yd),t(w,re),h(Do,re,null),t(re,Dd),t(re,na),t(re,Qd),h(rt,re,null),t(w,Ad),t(w,ae),h(Qo,ae,null),t(ae,Sd),t(ae,ra),t(ae,Od),t(ae,aa),t(w,Kd),t(w,at),h(Ao,at,null),t(at,em),t(at,sa),t(w,tm),t(w,ia),h(So,ia,null),t(w,om),t(w,st),h(Oo,st,null),t(st,nm),t(st,la),t(w,rm),t(w,it),h(Ko,it,null),t(it,am),t(it,da),t(w,sm),t(w,lt),h(en,lt,null),t(lt,im),t(lt,ma),t(w,lm),t(w,dt),h(tn,dt,null),t(dt,dm),t(dt,ca),t(w,mm),t(w,mt),h(on,mt,null),t(mt,cm),t(mt,pa),t(w,pm),t(w,ct),h(nn,ct,null),t(ct,hm),t(ct,ha),b(e,Ps,m),h(rn,e,m),b(e,Zs,m),b(e,X,m),h(an,X,null),t(X,fm),t(X,fa),t(X,um),t(X,pt),h(sn,pt,null),t(pt,gm),t(pt,ua),b(e,Fs,m),b(e,ln,m),b(e,Is,m),b(e,j,m),h(dn,j,null),t(j,_m),t(j,ga),t(j,bm),t(j,_a),t(j,ym),t(j,ba),t(j,vm),t(j,ya),t(j,Mm),t(j,se),h(mn,se,null),t(se,Tm),t(se,va),t(se,xm),h(ht,se,null),t(j,wm),t(j,ft),h(cn,ft,null),t(ft,$m),t(ft,Ma),t(j,km),t(j,V),h(pn,V,null),t(V,Cm),t(V,Ta),t(V,Jm),t(V,xa),t(V,Um),t(V,wa),t(V,jm),h(ut,V,null),t(j,Pm),t(j,ie),h(hn,ie,null),t(ie,Zm),t(ie,$a),t(ie,Fm),t(ie,ka),t(j,Im),t(j,le),h(fn,le,null),t(le,Wm),t(le,Ca),t(le,zm),h(gt,le,null),t(j,Gm),t(j,_t),h(un,_t,null),t(_t,Lm),t(_t,Ja),t(j,Bm),t(j,q),h(gn,q,null),t(q,Vm),t(q,Ua),t(q,Hm),t(q,ja),t(q,qm),h(bt,q,null),t(j,Nm),t(j,N),h(_n,N,null),t(N,Xm),t(N,Pa),t(N,Em),t(N,Za),t(N,Rm),h(yt,N,null),t(j,Ym),t(j,de),h(bn,de,null),t(de,Dm),t(de,Fa),t(de,Qm),h(vt,de,null),b(e,Ws,m),h(yn,e,m),b(e,zs,m),b(e,E,m),h(vn,E,null),t(E,Am),t(E,Ia),t(E,Sm),t(E,me),h(Mn,me,null),t(me,Om),t(me,Wa),t(me,Km),h(Mt,me,null),b(e,Gs,m),h(Tn,e,m),b(e,Ls,m),b(e,R,m),h(xn,R,null),t(R,ec),t(R,za),t(R,tc),t(R,Ga),b(e,Bs,m),h(wn,e,m),b(e,Vs,m),b(e,es,m),Hs=!0},p(e,[m]){const $={};m&2&&($.$$scope={dirty:m,ctx:e}),ge.$set($);const he={};m&2&&(he.$$scope={dirty:m,ctx:e}),_e.$set(he);const fe={};m&2&&(fe.$$scope={dirty:m,ctx:e}),Te.$set(fe);const $n={};m&2&&($n.$$scope={dirty:m,ctx:e}),xe.$set($n);const kn={};m&2&&(kn.$$scope={dirty:m,ctx:e}),Pe.$set(kn);const Cn={};m&2&&(Cn.$$scope={dirty:m,ctx:e}),Xe.$set(Cn);const Jn={};m&2&&(Jn.$$scope={dirty:m,ctx:e}),De.$set(Jn);const F={};m&2&&(F.$$scope={dirty:m,ctx:e}),rt.$set(F);const Un={};m&2&&(Un.$$scope={dirty:m,ctx:e}),ht.$set(Un);const jn={};m&2&&(jn.$$scope={dirty:m,ctx:e}),ut.$set(jn);const Pn={};m&2&&(Pn.$$scope={dirty:m,ctx:e}),gt.$set(Pn);const Zn={};m&2&&(Zn.$$scope={dirty:m,ctx:e}),bt.$set(Zn);const ue={};m&2&&(ue.$$scope={dirty:m,ctx:e}),yt.$set(ue);const Y={};m&2&&(Y.$$scope={dirty:m,ctx:e}),vt.$set(Y);const Fn={};m&2&&(Fn.$$scope={dirty:m,ctx:e}),Mt.$set(Fn)},i(e){Hs||(f(k.$$.fragment,e),f(Jt.$$.fragment,e),f(Ut.$$.fragment,e),f(jt.$$.fragment,e),f(ge.$$.fragment,e),f(Pt.$$.fragment,e),f(_e.$$.fragment,e),f(Zt.$$.fragment,e),f(Ft.$$.fragment,e),f(It.$$.fragment,e),f(Wt.$$.fragment,e),f(zt.$$.fragment,e),f(Te.$$.fragment,e),f(xe.$$.fragment,e),f(Gt.$$.fragment,e),f(Lt.$$.fragment,e),f(Bt.$$.fragment,e),f(Vt.$$.fragment,e),f(Ht.$$.fragment,e),f(qt.$$.fragment,e),f(Nt.$$.fragment,e),f(Xt.$$.fragment,e),f(Et.$$.fragment,e),f(Rt.$$.fragment,e),f(Pe.$$.fragment,e),f(Yt.$$.fragment,e),f(Dt.$$.fragment,e),f(Qt.$$.fragment,e),f(At.$$.fragment,e),f(St.$$.fragment,e),f(Ot.$$.fragment,e),f(Kt.$$.fragment,e),f(eo.$$.fragment,e),f(to.$$.fragment,e),f(ro.$$.fragment,e),f(io.$$.fragment,e),f(mo.$$.fragment,e),f(po.$$.fragment,e),f(fo.$$.fragment,e),f(go.$$.fragment,e),f(bo.$$.fragment,e),f(vo.$$.fragment,e),f(To.$$.fragment,e),f(xo.$$.fragment,e),f(wo.$$.fragment,e),f($o.$$.fragment,e),f(ko.$$.fragment,e),f(Co.$$.fragment,e),f(Jo.$$.fragment,e),f(Uo.$$.fragment,e),f(jo.$$.fragment,e),f(Po.$$.fragment,e),f(Fo.$$.fragment,e),f(Io.$$.fragment,e),f(Xe.$$.fragment,e),f(Wo.$$.fragment,e),f(zo.$$.fragment,e),f(Go.$$.fragment,e),f(Lo.$$.fragment,e),f(De.$$.fragment,e),f(Bo.$$.fragment,e),f(Vo.$$.fragment,e),f(Ho.$$.fragment,e),f(qo.$$.fragment,e),f(No.$$.fragment,e),f(Xo.$$.fragment,e),f(Eo.$$.fragment,e),f(Ro.$$.fragment,e),f(Yo.$$.fragment,e),f(Do.$$.fragment,e),f(rt.$$.fragment,e),f(Qo.$$.fragment,e),f(Ao.$$.fragment,e),f(So.$$.fragment,e),f(Oo.$$.fragment,e),f(Ko.$$.fragment,e),f(en.$$.fragment,e),f(tn.$$.fragment,e),f(on.$$.fragment,e),f(nn.$$.fragment,e),f(rn.$$.fragment,e),f(an.$$.fragment,e),f(sn.$$.fragment,e),f(dn.$$.fragment,e),f(mn.$$.fragment,e),f(ht.$$.fragment,e),f(cn.$$.fragment,e),f(pn.$$.fragment,e),f(ut.$$.fragment,e),f(hn.$$.fragment,e),f(fn.$$.fragment,e),f(gt.$$.fragment,e),f(un.$$.fragment,e),f(gn.$$.fragment,e),f(bt.$$.fragment,e),f(_n.$$.fragment,e),f(yt.$$.fragment,e),f(bn.$$.fragment,e),f(vt.$$.fragment,e),f(yn.$$.fragment,e),f(vn.$$.fragment,e),f(Mn.$$.fragment,e),f(Mt.$$.fragment,e),f(Tn.$$.fragment,e),f(xn.$$.fragment,e),f(wn.$$.fragment,e),Hs=!0)},o(e){u(k.$$.fragment,e),u(Jt.$$.fragment,e),u(Ut.$$.fragment,e),u(jt.$$.fragment,e),u(ge.$$.fragment,e),u(Pt.$$.fragment,e),u(_e.$$.fragment,e),u(Zt.$$.fragment,e),u(Ft.$$.fragment,e),u(It.$$.fragment,e),u(Wt.$$.fragment,e),u(zt.$$.fragment,e),u(Te.$$.fragment,e),u(xe.$$.fragment,e),u(Gt.$$.fragment,e),u(Lt.$$.fragment,e),u(Bt.$$.fragment,e),u(Vt.$$.fragment,e),u(Ht.$$.fragment,e),u(qt.$$.fragment,e),u(Nt.$$.fragment,e),u(Xt.$$.fragment,e),u(Et.$$.fragment,e),u(Rt.$$.fragment,e),u(Pe.$$.fragment,e),u(Yt.$$.fragment,e),u(Dt.$$.fragment,e),u(Qt.$$.fragment,e),u(At.$$.fragment,e),u(St.$$.fragment,e),u(Ot.$$.fragment,e),u(Kt.$$.fragment,e),u(eo.$$.fragment,e),u(to.$$.fragment,e),u(ro.$$.fragment,e),u(io.$$.fragment,e),u(mo.$$.fragment,e),u(po.$$.fragment,e),u(fo.$$.fragment,e),u(go.$$.fragment,e),u(bo.$$.fragment,e),u(vo.$$.fragment,e),u(To.$$.fragment,e),u(xo.$$.fragment,e),u(wo.$$.fragment,e),u($o.$$.fragment,e),u(ko.$$.fragment,e),u(Co.$$.fragment,e),u(Jo.$$.fragment,e),u(Uo.$$.fragment,e),u(jo.$$.fragment,e),u(Po.$$.fragment,e),u(Fo.$$.fragment,e),u(Io.$$.fragment,e),u(Xe.$$.fragment,e),u(Wo.$$.fragment,e),u(zo.$$.fragment,e),u(Go.$$.fragment,e),u(Lo.$$.fragment,e),u(De.$$.fragment,e),u(Bo.$$.fragment,e),u(Vo.$$.fragment,e),u(Ho.$$.fragment,e),u(qo.$$.fragment,e),u(No.$$.fragment,e),u(Xo.$$.fragment,e),u(Eo.$$.fragment,e),u(Ro.$$.fragment,e),u(Yo.$$.fragment,e),u(Do.$$.fragment,e),u(rt.$$.fragment,e),u(Qo.$$.fragment,e),u(Ao.$$.fragment,e),u(So.$$.fragment,e),u(Oo.$$.fragment,e),u(Ko.$$.fragment,e),u(en.$$.fragment,e),u(tn.$$.fragment,e),u(on.$$.fragment,e),u(nn.$$.fragment,e),u(rn.$$.fragment,e),u(an.$$.fragment,e),u(sn.$$.fragment,e),u(dn.$$.fragment,e),u(mn.$$.fragment,e),u(ht.$$.fragment,e),u(cn.$$.fragment,e),u(pn.$$.fragment,e),u(ut.$$.fragment,e),u(hn.$$.fragment,e),u(fn.$$.fragment,e),u(gt.$$.fragment,e),u(un.$$.fragment,e),u(gn.$$.fragment,e),u(bt.$$.fragment,e),u(_n.$$.fragment,e),u(yt.$$.fragment,e),u(bn.$$.fragment,e),u(vt.$$.fragment,e),u(yn.$$.fragment,e),u(vn.$$.fragment,e),u(Mn.$$.fragment,e),u(Mt.$$.fragment,e),u(Tn.$$.fragment,e),u(xn.$$.fragment,e),u(wn.$$.fragment,e),Hs=!1},d(e){e&&(s(U),s(y),s(_),s(i),s(J),s(ts),s($t),s(os),s(kt),s(ns),s(Ct),s(rs),s(as),s(x),s(ss),s($r),s(is),s(ls),s(oo),s(ds),s(no),s(ms),s(cs),s(ao),s(ps),s(so),s(hs),s(fs),s(lo),s(us),s(gs),s(co),s(_s),s(bs),s(ho),s(ys),s(vs),s(uo),s(Ms),s(Ts),s(_o),s(xs),s(ws),s(yo),s($s),s(ks),s(Mo),s(Cs),s(Js),s(W),s(Us),s(Zo),s(js),s(w),s(Ps),s(Zs),s(X),s(Fs),s(ln),s(Is),s(j),s(Ws),s(zs),s(E),s(Gs),s(Ls),s(R),s(Bs),s(Vs),s(es)),s(d),g(k,e),g(Jt,e),g(Ut),g(jt),g(ge),g(Pt),g(_e),g(Zt),g(Ft),g(It),g(Wt),g(zt),g(Te),g(xe),g(Gt),g(Lt),g(Bt),g(Vt),g(Ht),g(qt),g(Nt),g(Xt),g(Et),g(Rt),g(Pe),g(Yt),g(Dt),g(Qt),g(At),g(St),g(Ot),g(Kt),g(eo),g(to,e),g(ro,e),g(io,e),g(mo,e),g(po,e),g(fo,e),g(go,e),g(bo,e),g(vo,e),g(To,e),g(xo),g(wo),g($o),g(ko),g(Co),g(Jo),g(Uo),g(jo),g(Po),g(Fo),g(Io),g(Xe),g(Wo),g(zo),g(Go),g(Lo),g(De),g(Bo),g(Vo),g(Ho),g(qo),g(No),g(Xo),g(Eo),g(Ro),g(Yo),g(Do),g(rt),g(Qo),g(Ao),g(So),g(Oo),g(Ko),g(en),g(tn),g(on),g(nn),g(rn,e),g(an),g(sn),g(dn),g(mn),g(ht),g(cn),g(pn),g(ut),g(hn),g(fn),g(gt),g(un),g(gn),g(bt),g(_n),g(yt),g(bn),g(vt),g(yn,e),g(vn),g(Mn),g(Mt),g(Tn,e),g(xn),g(wn,e)}}}const Xh='{"title":"模型","local":"模型","sections":[{"title":"PreTrainedModel","local":"transformers.PreTrainedModel","sections":[{"title":"大模型加载","local":"大模型加载","sections":[],"depth":3},{"title":"模型实例化 dtype","local":"模型实例化-dtype","sections":[],"depth":3}],"depth":2},{"title":"ModuleUtilsMixin","local":"transformers.modeling_utils.ModuleUtilsMixin","sections":[],"depth":2},{"title":"TFModelUtilsMixin","local":"transformers.modeling_tf_utils.TFModelUtilsMixin","sections":[],"depth":2},{"title":"推送到 Hub","local":"transformers.utils.PushToHubMixin","sections":[],"depth":2},{"title":"分片检查点","local":"transformers.modeling_utils.load_sharded_checkpoint","sections":[],"depth":2}],"depth":1}';function Eh(P){return xh(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Kh extends wh{constructor(d){super(),$h(this,d,Eh,Nh,Th,{})}}export{Kh as component};
