import{S as d3,i as c3,s as m3,e as r,k as i,w as p,t as s,M as p3,c as a,d as t,m as d,a as n,x as h,h as l,b as m,G as e,g as w,y as f,q as u,o as g,B as _,v as h3,L as Ve}from"../../chunks/vendor-hf-doc-builder.js";import{T as Gp}from"../../chunks/Tip-hf-doc-builder.js";import{D as $}from"../../chunks/Docstring-hf-doc-builder.js";import{C as z}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ne}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Re}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function f3(F){let v,E,T,y,P;return y=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtY2FzZWQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMG1vZGVsJTIwdG8lMjB5b3VyJTIwbmFtZXNwYWNlJTIwd2l0aCUyMHRoZSUyMG5hbWUlMjAlMjJteS1maW5ldHVuZWQtYmVydCUyMi4lMEFtb2RlbC5wdXNoX3RvX2h1YiglMjJteS1maW5ldHVuZWQtYmVydCUyMiklMEElMEElMjMlMjBQdXNoJTIwdGhlJTIwbW9kZWwlMjB0byUyMGFuJTIwb3JnYW5pemF0aW9uJTIwd2l0aCUyMHRoZSUyMG5hbWUlMjAlMjJteS1maW5ldHVuZWQtYmVydCUyMi4lMEFtb2RlbC5wdXNoX3RvX2h1YiglMjJodWdnaW5nZmFjZSUyRm15LWZpbmV0dW5lZC1iZXJ0JTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModel

model = AutoModel.from_pretrained(<span class="hljs-string">&quot;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>)`}}),{c(){v=r("p"),E=s("Examples:"),T=i(),p(y.$$.fragment)},l(c){v=a(c,"P",{});var M=n(v);E=l(M,"Examples:"),M.forEach(t),T=d(c),h(y.$$.fragment,c)},m(c,M){w(c,v,M),e(v,E),w(c,T,M),f(y,c,M),P=!0},p:Ve,i(c){P||(u(y.$$.fragment,c),P=!0)},o(c){g(y.$$.fragment,c),P=!1},d(c){c&&t(v),c&&t(T),_(y,c)}}}function u3(F){let v,E,T,y,P;return{c(){v=r("p"),E=s("Activate the special "),T=r("a"),y=s("\u201Coffline-mode\u201D"),P=s(` to
use this method in a firewalled environment.`),this.h()},l(c){v=a(c,"P",{});var M=n(v);E=l(M,"Activate the special "),T=a(M,"A",{href:!0,rel:!0});var ct=n(T);y=l(ct,"\u201Coffline-mode\u201D"),ct.forEach(t),P=l(M,` to
use this method in a firewalled environment.`),M.forEach(t),this.h()},h(){m(T,"href","https://huggingface.co/transformers/installation.html#offline-mode"),m(T,"rel","nofollow")},m(c,M){w(c,v,M),e(v,E),e(v,T),e(T,y),e(v,P)},d(c){c&&t(v)}}}function g3(F){let v,E,T,y,P;return y=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJlcnRDb25maWclMkMlMjBCZXJ0TW9kZWwlMEElMEElMjMlMjBEb3dubG9hZCUyMG1vZGVsJTIwYW5kJTIwY29uZmlndXJhdGlvbiUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUyMGFuZCUyMGNhY2hlLiUwQW1vZGVsJTIwJTNEJTIwQmVydE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEElMjMlMjBNb2RlbCUyMHdhcyUyMHNhdmVkJTIwdXNpbmclMjAqc2F2ZV9wcmV0cmFpbmVkKCcuJTJGdGVzdCUyRnNhdmVkX21vZGVsJTJGJykqJTIwKGZvciUyMGV4YW1wbGUlMjBwdXJwb3NlcyUyQyUyMG5vdCUyMHJ1bm5hYmxlKS4lMEFtb2RlbCUyMCUzRCUyMEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyLiUyRnRlc3QlMkZzYXZlZF9tb2RlbCUyRiUyMiklMEElMjMlMjBVcGRhdGUlMjBjb25maWd1cmF0aW9uJTIwZHVyaW5nJTIwbG9hZGluZy4lMEFtb2RlbCUyMCUzRCUyMEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLXVuY2FzZWQlMjIlMkMlMjBvdXRwdXRfYXR0ZW50aW9ucyUzRFRydWUpJTBBYXNzZXJ0JTIwbW9kZWwuY29uZmlnLm91dHB1dF9hdHRlbnRpb25zJTIwJTNEJTNEJTIwVHJ1ZSUwQSUyMyUyMExvYWRpbmclMjBmcm9tJTIwYSUyMFRGJTIwY2hlY2twb2ludCUyMGZpbGUlMjBpbnN0ZWFkJTIwb2YlMjBhJTIwUHlUb3JjaCUyMG1vZGVsJTIwKHNsb3dlciUyQyUyMGZvciUyMGV4YW1wbGUlMjBwdXJwb3NlcyUyQyUyMG5vdCUyMHJ1bm5hYmxlKS4lMEFjb25maWclMjAlM0QlMjBCZXJ0Q29uZmlnLmZyb21fanNvbl9maWxlKCUyMi4lMkZ0Zl9tb2RlbCUyRm15X3RmX21vZGVsX2NvbmZpZy5qc29uJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmVydE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjIuJTJGdGZfbW9kZWwlMkZteV90Zl9jaGVja3BvaW50LmNrcHQuaW5kZXglMjIlMkMlMjBmcm9tX3RmJTNEVHJ1ZSUyQyUyMGNvbmZpZyUzRGNvbmZpZyklMEElMjMlMjBMb2FkaW5nJTIwZnJvbSUyMGElMjBGbGF4JTIwY2hlY2twb2ludCUyMGZpbGUlMjBpbnN0ZWFkJTIwb2YlMjBhJTIwUHlUb3JjaCUyMG1vZGVsJTIwKHNsb3dlciklMEFtb2RlbCUyMCUzRCUyMEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLXVuY2FzZWQlMjIlMkMlMjBmcm9tX2ZsYXglM0RUcnVlKQ==",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;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;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;bert-base-uncased&quot;</span>, from_flax=<span class="hljs-literal">True</span>)`}}),{c(){v=r("p"),E=s("Examples:"),T=i(),p(y.$$.fragment)},l(c){v=a(c,"P",{});var M=n(v);E=l(M,"Examples:"),M.forEach(t),T=d(c),h(y.$$.fragment,c)},m(c,M){w(c,v,M),e(v,E),w(c,T,M),f(y,c,M),P=!0},p:Ve,i(c){P||(u(y.$$.fragment,c),P=!0)},o(c){g(y.$$.fragment,c),P=!1},d(c){c&&t(v),c&&t(T),_(y,c)}}}function _3(F){let v,E;return{c(){v=r("p"),E=s("This API is experimental and may have some slight breaking changes in the next releases.")},l(T){v=a(T,"P",{});var y=n(v);E=l(y,"This API is experimental and may have some slight breaking changes in the next releases."),y.forEach(t)},m(T,y){w(T,v,y),e(v,E)},d(T){T&&t(v)}}}function b3(F){let v,E,T,y,P;return y=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBURkF1dG9Nb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLWNhc2VkJTIyKSUwQSUwQSUyMyUyMFB1c2glMjB0aGUlMjBtb2RlbCUyMHRvJTIweW91ciUyMG5hbWVzcGFjZSUyMHdpdGglMjB0aGUlMjBuYW1lJTIwJTIybXktZmluZXR1bmVkLWJlcnQlMjIuJTBBbW9kZWwucHVzaF90b19odWIoJTIybXktZmluZXR1bmVkLWJlcnQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMG1vZGVsJTIwdG8lMjBhbiUyMG9yZ2FuaXphdGlvbiUyMHdpdGglMjB0aGUlMjBuYW1lJTIwJTIybXktZmluZXR1bmVkLWJlcnQlMjIuJTBBbW9kZWwucHVzaF90b19odWIoJTIyaHVnZ2luZ2ZhY2UlMkZteS1maW5ldHVuZWQtYmVydCUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModel

model = TFAutoModel.from_pretrained(<span class="hljs-string">&quot;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>)`}}),{c(){v=r("p"),E=s("Examples:"),T=i(),p(y.$$.fragment)},l(c){v=a(c,"P",{});var M=n(v);E=l(M,"Examples:"),M.forEach(t),T=d(c),h(y.$$.fragment,c)},m(c,M){w(c,v,M),e(v,E),w(c,T,M),f(y,c,M),P=!0},p:Ve,i(c){P||(u(y.$$.fragment,c),P=!0)},o(c){g(y.$$.fragment,c),P=!1},d(c){c&&t(v),c&&t(T),_(y,c)}}}function v3(F){let v,E,T,y,P;return y=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJlcnRDb25maWclMkMlMjBURkJlcnRNb2RlbCUwQSUwQSUyMyUyMERvd25sb2FkJTIwbW9kZWwlMjBhbmQlMjBjb25maWd1cmF0aW9uJTIwZnJvbSUyMGh1Z2dpbmdmYWNlLmNvJTIwYW5kJTIwY2FjaGUuJTBBbW9kZWwlMjAlM0QlMjBURkJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLXVuY2FzZWQlMjIpJTBBJTIzJTIwTW9kZWwlMjB3YXMlMjBzYXZlZCUyMHVzaW5nJTIwKnNhdmVfcHJldHJhaW5lZCgnLiUyRnRlc3QlMkZzYXZlZF9tb2RlbCUyRicpKiUyMChmb3IlMjBleGFtcGxlJTIwcHVycG9zZXMlMkMlMjBub3QlMjBydW5uYWJsZSkuJTBBbW9kZWwlMjAlM0QlMjBURkJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyLiUyRnRlc3QlMkZzYXZlZF9tb2RlbCUyRiUyMiklMEElMjMlMjBVcGRhdGUlMjBjb25maWd1cmF0aW9uJTIwZHVyaW5nJTIwbG9hZGluZy4lMEFtb2RlbCUyMCUzRCUyMFRGQmVydE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtdW5jYXNlZCUyMiUyQyUyMG91dHB1dF9hdHRlbnRpb25zJTNEVHJ1ZSklMEFhc3NlcnQlMjBtb2RlbC5jb25maWcub3V0cHV0X2F0dGVudGlvbnMlMjAlM0QlM0QlMjBUcnVlJTBBJTIzJTIwTG9hZGluZyUyMGZyb20lMjBhJTIwUHl0b3JjaCUyMG1vZGVsJTIwZmlsZSUyMGluc3RlYWQlMjBvZiUyMGElMjBUZW5zb3JGbG93JTIwY2hlY2twb2ludCUyMChzbG93ZXIlMkMlMjBmb3IlMjBleGFtcGxlJTIwcHVycG9zZXMlMkMlMjBub3QlMjBydW5uYWJsZSkuJTBBY29uZmlnJTIwJTNEJTIwQmVydENvbmZpZy5mcm9tX2pzb25fZmlsZSglMjIuJTJGcHRfbW9kZWwlMkZteV9wdF9tb2RlbF9jb25maWcuanNvbiUyMiklMEFtb2RlbCUyMCUzRCUyMFRGQmVydE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjIuJTJGcHRfbW9kZWwlMkZteV9weXRvcmNoX21vZGVsLmJpbiUyMiUyQyUyMGZyb21fcHQlM0RUcnVlJTJDJTIwY29uZmlnJTNEY29uZmlnKQ==",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;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;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)`}}),{c(){v=r("p"),E=s("Examples:"),T=i(),p(y.$$.fragment)},l(c){v=a(c,"P",{});var M=n(v);E=l(M,"Examples:"),M.forEach(t),T=d(c),h(y.$$.fragment,c)},m(c,M){w(c,v,M),e(v,E),w(c,T,M),f(y,c,M),P=!0},p:Ve,i(c){P||(u(y.$$.fragment,c),P=!0)},o(c){g(y.$$.fragment,c),P=!1},d(c){c&&t(v),c&&t(T),_(y,c)}}}function y3(F){let v,E;return{c(){v=r("p"),E=s("This API is experimental and may have some slight breaking changes in the next releases.")},l(T){v=a(T,"P",{});var y=n(v);E=l(y,"This API is experimental and may have some slight breaking changes in the next releases."),y.forEach(t)},m(T,y){w(T,v,y),e(v,E)},d(T){T&&t(v)}}}function w3(F){let v,E,T,y,P;return y=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXhBdXRvTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEZsYXhBdXRvTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmJlcnQtYmFzZS1jYXNlZCUyMiklMEElMEElMjMlMjBQdXNoJTIwdGhlJTIwbW9kZWwlMjB0byUyMHlvdXIlMjBuYW1lc3BhY2UlMjB3aXRoJTIwdGhlJTIwbmFtZSUyMCUyMm15LWZpbmV0dW5lZC1iZXJ0JTIyLiUwQW1vZGVsLnB1c2hfdG9faHViKCUyMm15LWZpbmV0dW5lZC1iZXJ0JTIyKSUwQSUwQSUyMyUyMFB1c2glMjB0aGUlMjBtb2RlbCUyMHRvJTIwYW4lMjBvcmdhbml6YXRpb24lMjB3aXRoJTIwdGhlJTIwbmFtZSUyMCUyMm15LWZpbmV0dW5lZC1iZXJ0JTIyLiUwQW1vZGVsLnB1c2hfdG9faHViKCUyMmh1Z2dpbmdmYWNlJTJGbXktZmluZXR1bmVkLWJlcnQlMjIp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FlaxAutoModel

model = FlaxAutoModel.from_pretrained(<span class="hljs-string">&quot;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>)`}}),{c(){v=r("p"),E=s("Examples:"),T=i(),p(y.$$.fragment)},l(c){v=a(c,"P",{});var M=n(v);E=l(M,"Examples:"),M.forEach(t),T=d(c),h(y.$$.fragment,c)},m(c,M){w(c,v,M),e(v,E),w(c,T,M),f(y,c,M),P=!0},p:Ve,i(c){P||(u(y.$$.fragment,c),P=!0)},o(c){g(y.$$.fragment,c),P=!1},d(c){c&&t(v),c&&t(T),_(y,c)}}}function T3(F){let v,E,T,y,P;return y=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJlcnRDb25maWclMkMlMjBGbGF4QmVydE1vZGVsJTBBJTBBJTIzJTIwRG93bmxvYWQlMjBtb2RlbCUyMGFuZCUyMGNvbmZpZ3VyYXRpb24lMjBmcm9tJTIwaHVnZ2luZ2ZhY2UuY28lMjBhbmQlMjBjYWNoZS4lMEFtb2RlbCUyMCUzRCUyMEZsYXhCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmJlcnQtYmFzZS1jYXNlZCUyMiklMEElMjMlMjBNb2RlbCUyMHdhcyUyMHNhdmVkJTIwdXNpbmclMjAqc2F2ZV9wcmV0cmFpbmVkKCcuJTJGdGVzdCUyRnNhdmVkX21vZGVsJTJGJykqJTIwKGZvciUyMGV4YW1wbGUlMjBwdXJwb3NlcyUyQyUyMG5vdCUyMHJ1bm5hYmxlKS4lMEFtb2RlbCUyMCUzRCUyMEZsYXhCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMi4lMkZ0ZXN0JTJGc2F2ZWRfbW9kZWwlMkYlMjIpJTBBJTIzJTIwTG9hZGluZyUyMGZyb20lMjBhJTIwUHlUb3JjaCUyMGNoZWNrcG9pbnQlMjBmaWxlJTIwaW5zdGVhZCUyMG9mJTIwYSUyMFB5VG9yY2glMjBtb2RlbCUyMChzbG93ZXIlMkMlMjBmb3IlMjBleGFtcGxlJTIwcHVycG9zZXMlMkMlMjBub3QlMjBydW5uYWJsZSkuJTBBY29uZmlnJTIwJTNEJTIwQmVydENvbmZpZy5mcm9tX2pzb25fZmlsZSglMjIuJTJGcHRfbW9kZWwlMkZjb25maWcuanNvbiUyMiklMEFtb2RlbCUyMCUzRCUyMEZsYXhCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMi4lMkZwdF9tb2RlbCUyRnB5dG9yY2hfbW9kZWwuYmluJTIyJTJDJTIwZnJvbV9wdCUzRFRydWUlMkMlMjBjb25maWclM0Rjb25maWcp",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;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)`}}),{c(){v=r("p"),E=s("Examples:"),T=i(),p(y.$$.fragment)},l(c){v=a(c,"P",{});var M=n(v);E=l(M,"Examples:"),M.forEach(t),T=d(c),h(y.$$.fragment,c)},m(c,M){w(c,v,M),e(v,E),w(c,T,M),f(y,c,M),P=!0},p:Ve,i(c){P||(u(y.$$.fragment,c),P=!0)},o(c){g(y.$$.fragment,c),P=!1},d(c){c&&t(v),c&&t(T),_(y,c)}}}function M3(F){let v,E;return{c(){v=r("p"),E=s("This API is experimental and may have some slight breaking changes in the next releases.")},l(T){v=a(T,"P",{});var y=n(v);E=l(y,"This API is experimental and may have some slight breaking changes in the next releases."),y.forEach(t)},m(T,y){w(T,v,y),e(v,E)},d(T){T&&t(v)}}}function $3(F){let v,E,T,y,P;return y=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXhCZXJ0TW9kZWwlMEElMEElMjMlMjBsb2FkJTIwbW9kZWwlMEFtb2RlbCUyMCUzRCUyMEZsYXhCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmJlcnQtYmFzZS1jYXNlZCUyMiklMEElMjMlMjBCeSUyMGRlZmF1bHQlMkMlMjB0aGUlMjBtb2RlbCUyMHBhcmFtZXRlcnMlMjB3aWxsJTIwYmUlMjBpbiUyMGZwMzIlMjBwcmVjaXNpb24lMkMlMjB0byUyMGNhc3QlMjB0aGVzZSUyMHRvJTIwYmZsb2F0MTYlMjBwcmVjaXNpb24lMEFtb2RlbC5wYXJhbXMlMjAlM0QlMjBtb2RlbC50b19iZjE2KG1vZGVsLnBhcmFtcyklMEElMjMlMjBJZiUyMHlvdSUyMHdhbnQlMjBkb24ndCUyMHdhbnQlMjB0byUyMGNhc3QlMjBjZXJ0YWluJTIwcGFyYW1ldGVycyUyMChmb3IlMjBleGFtcGxlJTIwbGF5ZXIlMjBub3JtJTIwYmlhcyUyMGFuZCUyMHNjYWxlKSUwQSUyMyUyMHRoZW4lMjBwYXNzJTIwdGhlJTIwbWFzayUyMGFzJTIwZm9sbG93cyUwQWZyb20lMjBmbGF4JTIwaW1wb3J0JTIwdHJhdmVyc2VfdXRpbCUwQSUwQW1vZGVsJTIwJTNEJTIwRmxheEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLWNhc2VkJTIyKSUwQWZsYXRfcGFyYW1zJTIwJTNEJTIwdHJhdmVyc2VfdXRpbC5mbGF0dGVuX2RpY3QobW9kZWwucGFyYW1zKSUwQW1hc2slMjAlM0QlMjAlN0IlMEElMjAlMjAlMjAlMjBwYXRoJTNBJTIwKHBhdGglNUItMiU1RCUyMCElM0QlMjAoJTIyTGF5ZXJOb3JtJTIyJTJDJTIwJTIyYmlhcyUyMiklMjBhbmQlMjBwYXRoJTVCLTIlM0ElNUQlMjAhJTNEJTIwKCUyMkxheWVyTm9ybSUyMiUyQyUyMCUyMnNjYWxlJTIyKSklMEElMjAlMjAlMjAlMjBmb3IlMjBwYXRoJTIwaW4lMjBmbGF0X3BhcmFtcyUwQSU3RCUwQW1hc2slMjAlM0QlMjB0cmF2ZXJzZV91dGlsLnVuZmxhdHRlbl9kaWN0KG1hc2spJTBBbW9kZWwucGFyYW1zJTIwJTNEJTIwbW9kZWwudG9fYmYxNihtb2RlbC5wYXJhbXMlMkMlMjBtYXNrKQ==",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;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;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)`}}),{c(){v=r("p"),E=s("Examples:"),T=i(),p(y.$$.fragment)},l(c){v=a(c,"P",{});var M=n(v);E=l(M,"Examples:"),M.forEach(t),T=d(c),h(y.$$.fragment,c)},m(c,M){w(c,v,M),e(v,E),w(c,T,M),f(y,c,M),P=!0},p:Ve,i(c){P||(u(y.$$.fragment,c),P=!0)},o(c){g(y.$$.fragment,c),P=!1},d(c){c&&t(v),c&&t(T),_(y,c)}}}function x3(F){let v,E,T,y,P;return y=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXhCZXJ0TW9kZWwlMEElMEElMjMlMjBsb2FkJTIwbW9kZWwlMEFtb2RlbCUyMCUzRCUyMEZsYXhCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmJlcnQtYmFzZS1jYXNlZCUyMiklMEElMjMlMjBCeSUyMGRlZmF1bHQlMkMlMjB0aGUlMjBtb2RlbCUyMHBhcmFtcyUyMHdpbGwlMjBiZSUyMGluJTIwZnAzMiUyQyUyMHRvJTIwY2FzdCUyMHRoZXNlJTIwdG8lMjBmbG9hdDE2JTBBbW9kZWwucGFyYW1zJTIwJTNEJTIwbW9kZWwudG9fZnAxNihtb2RlbC5wYXJhbXMpJTBBJTIzJTIwSWYlMjB5b3UlMjB3YW50JTIwZG9uJ3QlMjB3YW50JTIwdG8lMjBjYXN0JTIwY2VydGFpbiUyMHBhcmFtZXRlcnMlMjAoZm9yJTIwZXhhbXBsZSUyMGxheWVyJTIwbm9ybSUyMGJpYXMlMjBhbmQlMjBzY2FsZSklMEElMjMlMjB0aGVuJTIwcGFzcyUyMHRoZSUyMG1hc2slMjBhcyUyMGZvbGxvd3MlMEFmcm9tJTIwZmxheCUyMGltcG9ydCUyMHRyYXZlcnNlX3V0aWwlMEElMEFtb2RlbCUyMCUzRCUyMEZsYXhCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmJlcnQtYmFzZS1jYXNlZCUyMiklMEFmbGF0X3BhcmFtcyUyMCUzRCUyMHRyYXZlcnNlX3V0aWwuZmxhdHRlbl9kaWN0KG1vZGVsLnBhcmFtcyklMEFtYXNrJTIwJTNEJTIwJTdCJTBBJTIwJTIwJTIwJTIwcGF0aCUzQSUyMChwYXRoJTVCLTIlNUQlMjAhJTNEJTIwKCUyMkxheWVyTm9ybSUyMiUyQyUyMCUyMmJpYXMlMjIpJTIwYW5kJTIwcGF0aCU1Qi0yJTNBJTVEJTIwISUzRCUyMCglMjJMYXllck5vcm0lMjIlMkMlMjAlMjJzY2FsZSUyMikpJTBBJTIwJTIwJTIwJTIwZm9yJTIwcGF0aCUyMGluJTIwZmxhdF9wYXJhbXMlMEElN0QlMEFtYXNrJTIwJTNEJTIwdHJhdmVyc2VfdXRpbC51bmZsYXR0ZW5fZGljdChtYXNrKSUwQW1vZGVsLnBhcmFtcyUyMCUzRCUyMG1vZGVsLnRvX2ZwMTYobW9kZWwucGFyYW1zJTJDJTIwbWFzayk=",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;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;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)`}}),{c(){v=r("p"),E=s("Examples:"),T=i(),p(y.$$.fragment)},l(c){v=a(c,"P",{});var M=n(v);E=l(M,"Examples:"),M.forEach(t),T=d(c),h(y.$$.fragment,c)},m(c,M){w(c,v,M),e(v,E),w(c,T,M),f(y,c,M),P=!0},p:Ve,i(c){P||(u(y.$$.fragment,c),P=!0)},o(c){g(y.$$.fragment,c),P=!1},d(c){c&&t(v),c&&t(T),_(y,c)}}}function k3(F){let v,E,T,y,P;return y=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXhCZXJ0TW9kZWwlMEElMEElMjMlMjBEb3dubG9hZCUyMG1vZGVsJTIwYW5kJTIwY29uZmlndXJhdGlvbiUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUwQW1vZGVsJTIwJTNEJTIwRmxheEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLWNhc2VkJTIyKSUwQSUyMyUyMEJ5JTIwZGVmYXVsdCUyQyUyMHRoZSUyMG1vZGVsJTIwcGFyYW1zJTIwd2lsbCUyMGJlJTIwaW4lMjBmcDMyJTJDJTIwdG8lMjBpbGx1c3RyYXRlJTIwdGhlJTIwdXNlJTIwb2YlMjB0aGlzJTIwbWV0aG9kJTJDJTBBJTIzJTIwd2UnbGwlMjBmaXJzdCUyMGNhc3QlMjB0byUyMGZwMTYlMjBhbmQlMjBiYWNrJTIwdG8lMjBmcDMyJTBBbW9kZWwucGFyYW1zJTIwJTNEJTIwbW9kZWwudG9fZjE2KG1vZGVsLnBhcmFtcyklMEElMjMlMjBub3clMjBjYXN0JTIwYmFjayUyMHRvJTIwZnAzMiUwQW1vZGVsLnBhcmFtcyUyMCUzRCUyMG1vZGVsLnRvX2ZwMzIobW9kZWwucGFyYW1zKQ==",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;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)`}}),{c(){v=r("p"),E=s("Examples:"),T=i(),p(y.$$.fragment)},l(c){v=a(c,"P",{});var M=n(v);E=l(M,"Examples:"),M.forEach(t),T=d(c),h(y.$$.fragment,c)},m(c,M){w(c,v,M),e(v,E),w(c,T,M),f(y,c,M),P=!0},p:Ve,i(c){P||(u(y.$$.fragment,c),P=!0)},o(c){g(y.$$.fragment,c),P=!1},d(c){c&&t(v),c&&t(T),_(y,c)}}}function E3(F){let v,E,T,y,P;return y=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMCU3Qm9iamVjdF9jbGFzcyU3RCUwQSUwQSU3Qm9iamVjdCU3RCUyMCUzRCUyMCU3Qm9iamVjdF9jbGFzcyU3RC5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLWNhc2VkJTIyKSUwQSUwQSUyMyUyMFB1c2glMjB0aGUlMjAlN0JvYmplY3QlN0QlMjB0byUyMHlvdXIlMjBuYW1lc3BhY2UlMjB3aXRoJTIwdGhlJTIwbmFtZSUyMCUyMm15LWZpbmV0dW5lZC1iZXJ0JTIyLiUwQSU3Qm9iamVjdCU3RC5wdXNoX3RvX2h1YiglMjJteS1maW5ldHVuZWQtYmVydCUyMiklMEElMEElMjMlMjBQdXNoJTIwdGhlJTIwJTdCb2JqZWN0JTdEJTIwdG8lMjBhbiUyMG9yZ2FuaXphdGlvbiUyMHdpdGglMjB0aGUlMjBuYW1lJTIwJTIybXktZmluZXR1bmVkLWJlcnQlMjIuJTBBJTdCb2JqZWN0JTdELnB1c2hfdG9faHViKCUyMmh1Z2dpbmdmYWNlJTJGbXktZmluZXR1bmVkLWJlcnQlMjIp",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;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>)`}}),{c(){v=r("p"),E=s("Examples:"),T=i(),p(y.$$.fragment)},l(c){v=a(c,"P",{});var M=n(v);E=l(M,"Examples:"),M.forEach(t),T=d(c),h(y.$$.fragment,c)},m(c,M){w(c,v,M),e(v,E),w(c,T,M),f(y,c,M),P=!0},p:Ve,i(c){P||(u(y.$$.fragment,c),P=!0)},o(c){g(y.$$.fragment,c),P=!1},d(c){c&&t(v),c&&t(T),_(y,c)}}}function P3(F){let v,E,T,y,P,c,M,ct,zp,_c,Q,Bp,_n,Dp,Np,bn,Rp,Vp,vn,Xp,Yp,bc,Xe,yn,Ap,qp,wn,Lp,Sp,vc,mt,Es,Hp,Qp,Ps,Op,yc,B,Kp,Tn,eh,th,js,oh,rh,Mn,ah,nh,$n,sh,lh,xn,ih,dh,wc,Ye,pt,Us,Xo,ch,Js,mh,Tc,j,Yo,ph,Fs,hh,fh,kn,En,uh,gh,_h,Ao,Is,bh,vh,Zs,yh,wh,Cs,Th,Mh,Y,Ws,me,Gs,$h,xh,Pn,kh,Eh,jn,Ph,jh,Uh,qo,pe,zs,Jh,Fh,Bs,Ih,Zh,Ds,Ch,Wh,Gh,Ae,ht,Ns,zh,Bh,Un,Dh,Nh,Rh,ft,Rs,Vh,Xh,Vs,Yh,Ah,qh,ut,Xs,Lh,Sh,Ys,Hh,Qh,Oh,As,gt,qs,Kh,ef,Ls,tf,of,rf,Ss,_t,Hs,af,nf,Qs,sf,lf,df,Os,D,Ks,cf,mf,el,pf,hf,tl,ff,uf,ol,gf,_f,rl,bf,vf,yf,he,Lo,wf,al,Tf,Mf,bt,$f,vt,So,xf,Ho,kf,nl,Ef,Pf,jf,yt,Qo,Uf,Oo,Jf,sl,Ff,If,Zf,wt,Ko,Cf,ll,Wf,Gf,I,er,zf,il,Bf,Df,qe,Nf,dl,Rf,Vf,cl,Xf,Yf,Af,tr,qf,ml,Lf,Sf,Hf,or,Qf,pl,Of,Kf,eu,Tt,tu,Mt,ou,hl,Jn,fl,ru,au,nu,ul,su,lu,gl,iu,du,A,_l,cu,mu,bl,pu,hu,vl,fu,uu,yl,gu,_u,wl,bu,vu,Tl,yu,wu,$t,rr,Tu,Ml,Mu,$u,xt,ar,xu,Fn,ku,nr,Eu,Pu,kt,sr,ju,$l,Uu,Ju,fe,lr,Fu,xl,Iu,Zu,kl,Cu,Wu,ue,ir,Gu,El,zu,Bu,Pl,Du,Nu,Et,dr,Ru,Le,Vu,jl,Xu,Yu,Ul,Au,qu,Lu,Pt,cr,Su,Jl,Hu,Qu,jt,mr,Ou,Fl,Ku,eg,ge,pr,tg,Il,og,rg,Ut,ag,_e,hr,ng,fr,sg,Zl,lg,ig,dg,ur,cg,Cl,mg,pg,hg,Jt,gr,fg,_r,ug,In,gg,_g,bg,Ft,br,vg,vr,yg,Zn,wg,Tg,Mg,It,yr,$g,Wl,xg,kg,be,wr,Eg,Gl,Pg,jg,Tr,Ug,zl,Jg,Fg,Ig,ve,Mr,Zg,Se,Cg,$r,Wg,Gg,xr,zg,Bg,Dg,He,Ng,kr,Rg,Vg,Er,Xg,Yg,Ag,Zt,Pr,qg,Bl,Lg,Mc,Cn,$c,Qe,Ct,Dl,jr,Sg,Nl,Hg,xc,ye,Qg,Wn,Og,Kg,Ur,e_,t_,kc,Wt,o_,Rl,r_,a_,Ec,Jr,Pc,Gt,n_,Vl,s_,l_,jc,O,i_,Xl,d_,c_,Yl,m_,p_,Al,h_,f_,Uc,Fr,Jc,zt,u_,ql,g_,__,Fc,Ir,Ic,Zr,Zc,Gn,b_,Cc,Cr,Wc,Bt,v_,Ll,y_,w_,Gc,Oe,Dt,Sl,Wr,T_,Hl,M_,zc,K,$_,Ql,x_,k_,Ol,E_,P_,Kl,j_,U_,Bc,Gr,Dc,we,J_,ei,F_,I_,ti,Z_,C_,Nc,zr,Rc,Nt,W_,oi,G_,z_,Vc,Br,Xc,zn,B_,Yc,Ke,Rt,ri,Dr,D_,ai,N_,Ac,C,Nr,R_,Rr,V_,ni,X_,Y_,A_,Te,Vr,q_,si,L_,S_,et,H_,li,Q_,O_,ii,K_,eb,tb,Vt,Xr,ob,di,rb,ab,Xt,Yr,nb,tt,sb,ci,lb,ib,Ar,db,cb,mb,Yt,qr,pb,mi,hb,fb,At,Lr,ub,pi,gb,_b,qt,Sr,bb,hi,vb,yb,Lt,Hr,wb,fi,Tb,Mb,St,Qr,$b,ot,xb,ui,kb,Eb,Bn,Pb,jb,qc,rt,Ht,gi,Or,Ub,_i,Jb,Lc,x,Kr,Fb,bi,Ib,Zb,Dn,Nn,Cb,Wb,Gb,ea,vi,zb,Bb,yi,Db,Nb,wi,Rb,Vb,at,Me,Ti,Xb,Yb,Rn,Ab,qb,Vn,Lb,Sb,Hb,Qt,Mi,Qb,Ob,$i,Kb,ev,tv,N,xi,ov,rv,ki,av,nv,Ei,sv,lv,Pi,iv,dv,ji,cv,mv,pv,$e,ta,hv,oa,fv,Ui,uv,gv,_v,Ot,bv,Kt,ra,vv,aa,yv,Ji,wv,Tv,Mv,eo,na,$v,Fi,xv,kv,to,sa,Ev,la,Pv,Ii,jv,Uv,Jv,oo,ia,Fv,Zi,Iv,Zv,R,da,Cv,Ci,Wv,Gv,ca,zv,Wi,Bv,Dv,Nv,ma,Rv,Gi,Vv,Xv,Yv,ro,Av,ao,pa,qv,zi,Lv,Sv,no,ha,Hv,Bi,Qv,Ov,so,fa,Kv,Di,ey,ty,lo,ua,oy,Ni,ry,ay,io,ga,ny,Ri,sy,ly,co,_a,iy,Vi,dy,cy,mo,ba,my,Xi,py,hy,po,va,fy,Yi,uy,gy,ho,ya,_y,q,by,wa,vy,yy,Ai,wy,Ty,qi,My,$y,Li,xy,ky,Ey,fo,Ta,Py,Si,jy,Uy,xe,Ma,Jy,Hi,Fy,Iy,uo,Zy,ke,$a,Cy,xa,Wy,Qi,Gy,zy,By,ka,Dy,Oi,Ny,Ry,Vy,go,Ea,Xy,Pa,Yy,Xn,Ay,qy,Ly,Yn,ja,Sy,_o,Ua,Hy,Ki,Qy,Oy,bo,Ja,Ky,ed,ew,tw,vo,Fa,ow,td,rw,aw,yo,Ia,nw,od,sw,lw,wo,Za,iw,Ca,dw,rd,cw,mw,pw,To,Wa,hw,Ga,fw,ad,uw,gw,Sc,nt,Mo,nd,za,_w,sd,bw,Hc,re,Ba,vw,Da,yw,ld,ww,Tw,Mw,$o,Na,$w,id,xw,Qc,st,xo,dd,Ra,kw,cd,Ew,Oc,J,Va,Pw,md,jw,Uw,An,qn,Jw,Fw,Iw,pd,Zw,Cw,lt,Ee,hd,Ww,Gw,Ln,zw,Bw,Sn,Dw,Nw,Rw,ko,fd,Vw,Xw,ud,Yw,Aw,qw,V,gd,Lw,Sw,_d,Hw,Qw,bd,Ow,Kw,vd,e2,t2,yd,o2,r2,a2,Pe,Xa,n2,wd,s2,l2,Eo,i2,Po,Ya,d2,ae,c2,Td,m2,p2,Md,h2,f2,$d,u2,g2,_2,X,Aa,b2,xd,v2,y2,qa,w2,kd,T2,M2,$2,La,x2,Ed,k2,E2,P2,jo,j2,je,Sa,U2,Ha,J2,Pd,F2,I2,Z2,jd,C2,W2,Ue,Qa,G2,Ud,z2,B2,Uo,D2,Jo,Oa,N2,Ka,R2,Jd,V2,X2,Y2,ee,en,A2,L,q2,Fd,L2,S2,Id,H2,Q2,Zd,O2,K2,Cd,eT,tT,oT,Wd,rT,aT,Fo,nT,te,tn,sT,S,lT,Gd,iT,dT,zd,cT,mT,Bd,pT,hT,Dd,fT,uT,gT,Nd,_T,bT,Io,vT,Je,on,yT,H,wT,Rd,TT,MT,Vd,$T,xT,Xd,kT,ET,Yd,PT,jT,UT,Zo,Kc,it,Co,Ad,rn,JT,qd,FT,em,ne,an,IT,Ld,ZT,CT,Fe,nn,WT,Sd,GT,zT,Wo,tm,dt,Go,Hd,sn,BT,Qd,DT,om,se,ln,NT,dn,RT,cn,Od,VT,XT,YT,Kd,AT,rm;return c=new Ne({}),Xo=new Ne({}),Yo=new $({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/v4.33.0/src/transformers/modeling_utils.py#L1052"}}),Lo=new $({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] = '10GB'"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = False"},{name:"revision",val:": 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 or not the repository created should be private.`,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;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.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>False</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"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/utils/hub.py#L786"}}),bt=new Re({props:{anchor:"transformers.PreTrainedModel.push_to_hub.example",$$slots:{default:[f3]},$$scope:{ctx:F}}}),So=new $({props:{name:"can_generate",anchor:"transformers.PreTrainedModel.can_generate",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L1212",returnDescription:`
<p>Whether this model can generate sequences with <code>.generate()</code>.</p>
`,returnType:`
<p><code>bool</code></p>
`}}),Qo=new $({props:{name:"disable_input_require_grads",anchor:"transformers.PreTrainedModel.disable_input_require_grads",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L1237"}}),Ko=new $({props:{name:"enable_input_require_grads",anchor:"transformers.PreTrainedModel.enable_input_require_grads",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L1226"}}),er=new $({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:": bool = None"},{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.
Valid model ids can be located at the root-level, like <code>bert-base-uncased</code>, or namespaced under a
user or organization name, like <code>dbmdz/bert-base-german-cased</code>.</li>
<li>A path to a <em>directory</em> containing model weights saved using
<a href="/docs/transformers/v4.33.0/en/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/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a>,</li>
<li>a string or path valid as input to <a href="/docs/transformers/v4.33.0/en/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/v4.33.0/en/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/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.save_pretrained">save_pretrained()</a> and
<a href="/docs/transformers/v4.33.0/en/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> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,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 \`revision=&#x201C;refs/pr/<pr_number>&#x201C;.</pr_number></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,"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L2075",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 to not use more than 1x model size in CPU memory (including peak memory) while loading the model.
This is an experimental feature and a subject to change at any moment.`,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>
</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.load_in_8bit",description:`<strong>load_in_8bit</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, will convert the loaded model into mixed-8bit quantized model. To use this feature please
install <code>bitsandbytes</code> (<code>pip install -U bitsandbytes</code>).`,name:"load_in_8bit"},{anchor:"transformers.PreTrainedModel.from_pretrained.load_in_4bit",description:`<strong>load_in_4bit</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, will convert the loaded model into 4bit precision quantized model. To use this feature
install the latest version of <code>bitsandbytes</code> (<code>pip install -U bitsandbytes</code>).`,name:"load_in_4bit"},{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)`,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.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/v4.33.0/en/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"}]}]}}),Tt=new Gp({props:{$$slots:{default:[u3]},$$scope:{ctx:F}}}),Mt=new Re({props:{anchor:"transformers.PreTrainedModel.from_pretrained.example",$$slots:{default:[g3]},$$scope:{ctx:F}}}),rr=new $({props:{name:"get_input_embeddings",anchor:"transformers.PreTrainedModel.get_input_embeddings",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L1243",returnDescription:`
<p>A torch module mapping vocabulary to hidden states.</p>
`,returnType:`
<p><code>nn.Module</code></p>
`}}),ar=new $({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/v4.33.0/src/transformers/modeling_utils.py#L2015"}}),sr=new $({props:{name:"get_output_embeddings",anchor:"transformers.PreTrainedModel.get_output_embeddings",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L1269",returnDescription:`
<p>A torch module mapping hidden states to vocabulary.</p>
`,returnType:`
<p><code>nn.Module</code></p>
`}}),lr=new $({props:{name:"gradient_checkpointing_disable",anchor:"transformers.PreTrainedModel.gradient_checkpointing_disable",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L1727"}}),ir=new $({props:{name:"gradient_checkpointing_enable",anchor:"transformers.PreTrainedModel.gradient_checkpointing_enable",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L1716"}}),dr=new $({props:{name:"init_weights",anchor:"transformers.PreTrainedModel.init_weights",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L1682"}}),cr=new $({props:{name:"post_init",anchor:"transformers.PreTrainedModel.post_init",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L1131"}}),mr=new $({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/v4.33.0/src/transformers/modeling_utils.py#L1699"}}),pr=new $({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/v4.33.0/src/transformers/modeling_utils.py#L3720"}}),Ut=new Gp({props:{warning:!0,$$slots:{default:[_3]},$$scope:{ctx:F}}}),hr=new $({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"}],parametersDescription:[{anchor:"transformers.PreTrainedModel.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 <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.</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"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L1409",returnDescription:`
<p>Pointer to the input tokens Embeddings Module of the model.</p>
`,returnType:`
<p><code>torch.nn.Embedding</code></p>
`}}),gr=new $({props:{name:"reverse_bettertransformer",anchor:"transformers.PreTrainedModel.reverse_bettertransformer",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L3774",returnDescription:`
<p>The model converted back to the original modeling.</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"
>PreTrainedModel</a></p>
`}}),br=new $({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 0x7ff179de3f70>"},{name:"push_to_hub",val:": bool = False"},{name:"max_shard_size",val:": typing.Union[int, str] = '10GB'"},{name:"safe_serialization",val:": bool = False"},{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;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.PreTrainedModel.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 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/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L1747"}}),yr=new $({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/v4.33.0/src/transformers/modeling_utils.py#L1256"}}),wr=new $({props:{name:"tie_weights",anchor:"transformers.PreTrainedModel.tie_weights",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L1293"}}),Mr=new $({props:{name:"to_bettertransformer",anchor:"transformers.PreTrainedModel.to_bettertransformer",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L3746",returnDescription:`
<p>The model converted to BetterTransformer.</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"
>PreTrainedModel</a></p>
`}}),Pr=new $({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/v4.33.0/src/transformers/modeling_utils.py#L3796"}}),jr=new Ne({}),Jr=new z({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>)`}}),Fr=new z({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>)`}}),Ir=new z({props:{code:"dDBwcC5oZl9kZXZpY2VfbWFw",highlighted:"t0pp.hf_device_map"}}),Zr=new z({props:{code:"JTdCJ3NoYXJlZCclM0ElMjAwJTJDJTBBJTIwJ2RlY29kZXIuZW1iZWRfdG9rZW5zJyUzQSUyMDAlMkMlMEElMjAnZW5jb2RlciclM0ElMjAwJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMCclM0ElMjAwJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMSclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMiclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMyclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suNCclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suNSclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suNiclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suNyclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suOCclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suOSclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMTAnJTNBJTIwMSUyQyUwQSUyMCdkZWNvZGVyLmJsb2NrLjExJyUzQSUyMDElMkMlMEElMjAnZGVjb2Rlci5ibG9jay4xMiclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMTMnJTNBJTIwMSUyQyUwQSUyMCdkZWNvZGVyLmJsb2NrLjE0JyUzQSUyMDElMkMlMEElMjAnZGVjb2Rlci5ibG9jay4xNSclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMTYnJTNBJTIwMSUyQyUwQSUyMCdkZWNvZGVyLmJsb2NrLjE3JyUzQSUyMDElMkMlMEElMjAnZGVjb2Rlci5ibG9jay4xOCclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMTknJTNBJTIwMSUyQyUwQSUyMCdkZWNvZGVyLmJsb2NrLjIwJyUzQSUyMDElMkMlMEElMjAnZGVjb2Rlci5ibG9jay4yMSclM0ElMjAxJTJDJTBBJTIwJ2RlY29kZXIuYmxvY2suMjInJTNBJTIwJ2NwdSclMkMlMEElMjAnZGVjb2Rlci5ibG9jay4yMyclM0ElMjAnY3B1JyUyQyUwQSUyMCdkZWNvZGVyLmZpbmFsX2xheWVyX25vcm0nJTNBJTIwJ2NwdSclMkMlMEElMjAnZGVjb2Rlci5kcm9wb3V0JyUzQSUyMCdjcHUnJTJDJTBBJTIwJ2xtX2hlYWQnJTNBJTIwJ2NwdSclN0Q=",highlighted:`{<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>}`}}),Cr=new z({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>}'}}),Wr=new Ne({}),Gr=new z({props:{code:"bW9kZWwlMjAlM0QlMjBUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydDUlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYp",highlighted:'model = T5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5&quot;</span>, torch_dtype=torch.float16)'}}),zr=new z({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>)'}}),Br=new z({props:{code:"Y29uZmlnJTIwJTNEJTIwVDVDb25maWcuZnJvbV9wcmV0cmFpbmVkKCUyMnQ1JTIyKSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsLmZyb21fY29uZmlnKGNvbmZpZyk=",highlighted:`config = T5Config.from_pretrained(<span class="hljs-string">&quot;t5&quot;</span>)
model = AutoModel.from_config(config)`}}),Dr=new Ne({}),Nr=new $({props:{name:"class transformers.modeling_utils.ModuleUtilsMixin",anchor:"transformers.modeling_utils.ModuleUtilsMixin",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L769"}}),Vr=new $({props:{name:"add_memory_hooks",anchor:"transformers.modeling_utils.ModuleUtilsMixin.add_memory_hooks",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L800"}}),Xr=new $({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/v4.33.0/src/transformers/modeling_utils.py#L1004",returnDescription:`
<p>The total number of tokens.</p>
`,returnType:`
<p><code>int</code></p>
`}}),Yr=new $({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/v4.33.0/src/transformers/modeling_utils.py#L1025",returnDescription:`
<p>The number of floating-point operations.</p>
`,returnType:`
<p><code>int</code></p>
`}}),qr=new $({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/v4.33.0/src/transformers/modeling_utils.py#L888",returnDescription:`
<p><code>torch.Tensor</code> The extended attention mask, with a the same dtype as <code>attention_mask.dtype</code>.</p>
`}}),Lr=new $({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/v4.33.0/src/transformers/modeling_utils.py#L940",returnDescription:`
<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>
`}}),Sr=new $({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/v4.33.0/src/transformers/modeling_utils.py#L836",returnDescription:`
<p>The inverted attention mask.</p>
`,returnType:`
<p><code>torch.Tensor</code></p>
`}}),Hr=new $({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/v4.33.0/src/transformers/modeling_utils.py#L978",returnDescription:`
<p>The number of parameters.</p>
`,returnType:`
<p><code>int</code></p>
`}}),Qr=new $({props:{name:"reset_memory_hooks_state",anchor:"transformers.modeling_utils.ModuleUtilsMixin.reset_memory_hooks_state",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_utils.py#L812"}}),Or=new Ne({}),Kr=new $({props:{name:"class transformers.TFPreTrainedModel",anchor:"transformers.TFPreTrainedModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_tf_utils.py#L1057"}}),ta=new $({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 or not the repository created should be private.`,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/v4.33.0/src/transformers/modeling_tf_utils.py#L3047"}}),Ot=new Re({props:{anchor:"transformers.TFPreTrainedModel.push_to_hub.example",$$slots:{default:[b3]},$$scope:{ctx:F}}}),ra=new $({props:{name:"can_generate",anchor:"transformers.TFPreTrainedModel.can_generate",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_tf_utils.py#L1302",returnDescription:`
<p>Whether this model can generate sequences with <code>.generate()</code>.</p>
`,returnType:`
<p><code>bool</code></p>
`}}),na=new $({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/v4.33.0/src/transformers/modeling_tf_utils.py#L1497"}}),sa=new $({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/v4.33.0/src/transformers/modeling_tf_utils.py#L1792"}}),ia=new $({props:{name:"eager_serving",anchor:"transformers.TFPreTrainedModel.eager_serving",parameters:[{name:"inputs",val:""}],parametersDescription:[{anchor:"transformers.TFPreTrainedModel.eager_serving.inputs",description:`<strong>inputs</strong> (<code>Dict[str, tf.Tensor]</code>) &#x2014;
The input of the saved model as a dictionary of tensors.`,name:"inputs"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_tf_utils.py#L1214"}}),da=new $({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:"**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.
Valid model ids can be located at the root-level, like <code>bert-base-uncased</code>, or namespaced under a
user or organization name, like <code>dbmdz/bert-base-german-cased</code>.</li>
<li>A path to a <em>directory</em> containing model weights saved using
<a href="/docs/transformers/v4.33.0/en/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/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a>,</li>
<li>a string valid as input to <a href="/docs/transformers/v4.33.0/en/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/v4.33.0/en/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> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.
proxies &#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:"resume_download"},{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 doanloading 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/v4.33.0/src/transformers/modeling_tf_utils.py#L2499"}}),ro=new Re({props:{anchor:"transformers.TFPreTrainedModel.from_pretrained.example",$$slots:{default:[v3]},$$scope:{ctx:F}}}),pa=new $({props:{name:"get_bias",anchor:"transformers.TFPreTrainedModel.get_bias",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_tf_utils.py#L1932",returnDescription:`
<p>The weights representing the bias, None if not an LM model.</p>
`,returnType:`
<p><code>tf.Variable</code></p>
`}}),ha=new $({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/v4.33.0/src/transformers/modeling_tf_utils.py#L1169",returnDescription:`
<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>
`}}),fa=new $({props:{name:"get_input_embeddings",anchor:"transformers.TFPreTrainedModel.get_input_embeddings",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_tf_utils.py#L1316",returnDescription:`
<p>The embeddings layer mapping vocabulary to hidden states.</p>
`,returnType:`
<p><code>tf.Variable</code></p>
`}}),ua=new $({props:{name:"get_lm_head",anchor:"transformers.TFPreTrainedModel.get_lm_head",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_tf_utils.py#L1965",returnDescription:`
<p>The LM head layer if the model has one, None if not.</p>
`,returnType:`
<p><code>tf.keras.layers.Layer</code></p>
`}}),ga=new $({props:{name:"get_output_embeddings",anchor:"transformers.TFPreTrainedModel.get_output_embeddings",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_tf_utils.py#L1872",returnDescription:`
<p>The new weights mapping vocabulary to hidden states.</p>
`,returnType:`
<p><code>tf.Variable</code></p>
`}}),_a=new $({props:{name:"get_output_layer_with_bias",anchor:"transformers.TFPreTrainedModel.get_output_layer_with_bias",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_tf_utils.py#L1909",returnDescription:`
<p>The layer that handles the bias, None if not an LM model.</p>
`,returnType:`
<p><code>tf.keras.layers.Layer</code></p>
`}}),ba=new $({props:{name:"get_prefix_bias_name",anchor:"transformers.TFPreTrainedModel.get_prefix_bias_name",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_tf_utils.py#L1922",returnDescription:`
<p>The _prefix name of the bias.</p>
`,returnType:`
<p><code>str</code></p>
`}}),va=new $({props:{name:"load_repo_checkpoint",anchor:"transformers.TFPreTrainedModel.load_repo_checkpoint",parameters:[{name:"repo_path_or_name",val:""}],parametersDescription:[{anchor:"transformers.TFPreTrainedModel.load_repo_checkpoint.repo_path_or_name",description:`<strong>repo_path_or_name</strong> (<code>str</code>) &#x2014;
Can either be a repository name for your {object} in the Hub or a path to a local folder (in which case
the repository will have the name of that local folder).`,name:"repo_path_or_name"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_tf_utils.py#L1343",returnDescription:`
<p>A dictionary of extra metadata from the checkpoint, most commonly an \u201Cepoch\u201D count.</p>
`,returnType:`
<p><code>dict</code></p>
`}}),ya=new $({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>, 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/v4.33.0/en/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/v4.33.0/src/transformers/modeling_tf_utils.py#L1392",returnDescription:`
<p>A <code>tf.data.Dataset</code> which is ready to pass to the Keras API.</p>
`,returnType:`
<p><code>Dataset</code></p>
`}}),Ta=new $({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/v4.33.0/src/transformers/modeling_tf_utils.py#L2312"}}),Ma=new $({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/v4.33.0/src/transformers/modeling_tf_utils.py#L3155"}}),uo=new Gp({props:{warning:!0,$$slots:{default:[y3]},$$scope:{ctx:F}}}),$a=new $({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/v4.33.0/src/transformers/modeling_tf_utils.py#L1974",returnDescription:`
<p>Pointer to the input tokens of the model.</p>
`,returnType:`
<p><code>tf.Variable</code> or <code>tf.keras.layers.Embedding</code></p>
`}}),Ea=new $({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] = '10GB'"},{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 PyTorch way (that uses <code>pickle</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/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_tf_utils.py#L2324"}}),ja=new $({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"}]}}),Ua=new $({props:{name:"serving_output",anchor:"transformers.TFPreTrainedModel.serving_output",parameters:[{name:"output",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_tf_utils.py#L1278"}}),Ja=new $({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/v4.33.0/src/transformers/modeling_tf_utils.py#L1949"}}),Fa=new $({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/v4.33.0/src/transformers/modeling_tf_utils.py#L1852"}}),Ia=new $({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/v4.33.0/src/transformers/modeling_tf_utils.py#L1892"}}),Za=new $({props:{name:"test_step",anchor:"transformers.TFPreTrainedModel.test_step",parameters:[{name:"data",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_tf_utils.py#L1688"}}),Wa=new $({props:{name:"train_step",anchor:"transformers.TFPreTrainedModel.train_step",parameters:[{name:"data",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_tf_utils.py#L1580"}}),za=new Ne({}),Ba=new $({props:{name:"class transformers.modeling_tf_utils.TFModelUtilsMixin",anchor:"transformers.modeling_tf_utils.TFModelUtilsMixin",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_tf_utils.py#L105"}}),Na=new $({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/v4.33.0/src/transformers/modeling_tf_utils.py#L110",returnDescription:`
<p>The number of parameters.</p>
`,returnType:`
<p><code>int</code></p>
`}}),Ra=new Ne({}),Va=new $({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/v4.33.0/src/transformers/modeling_flax_utils.py#L158"}}),Xa=new $({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] = '10GB'"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = False"},{name:"revision",val:": 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 or not the repository created should be private.`,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;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.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>False</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"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/utils/hub.py#L786"}}),Eo=new Re({props:{anchor:"transformers.FlaxPreTrainedModel.push_to_hub.example",$$slots:{default:[w3]},$$scope:{ctx:F}}}),Ya=new $({props:{name:"can_generate",anchor:"transformers.FlaxPreTrainedModel.can_generate",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_flax_utils.py#L472"}}),Aa=new $({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[bool, str, 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.
Valid model ids can be located at the root-level, like <code>bert-base-uncased</code>, or namespaced under a
user or organization name, like <code>dbmdz/bert-base-german-cased</code>.</li>
<li>A path to a <em>directory</em> containing model weights saved using
<a href="/docs/transformers/v4.33.0/en/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/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.33.0/en/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/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a>,</li>
<li>a string or path valid as input to <a href="/docs/transformers/v4.33.0/en/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/v4.33.0/en/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> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,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/v4.33.0/src/transformers/modeling_flax_utils.py#L484"}}),jo=new Re({props:{anchor:"transformers.FlaxPreTrainedModel.from_pretrained.example",$$slots:{default:[T3]},$$scope:{ctx:F}}}),Sa=new $({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/v4.33.0/src/transformers/modeling_flax_utils.py#L425",returnDescription:`
<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:`
<p><code>Dict</code></p>
`}}),Qa=new $({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/v4.33.0/src/transformers/modeling_flax_utils.py#L1149"}}),Uo=new Gp({props:{warning:!0,$$slots:{default:[M3]},$$scope:{ctx:F}}}),Oa=new $({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[bool, str, NoneType] = None"},{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/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_flax_utils.py#L1022"}}),en=new $({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/v4.33.0/src/transformers/modeling_flax_utils.py#L320"}}),Fo=new Re({props:{anchor:"transformers.FlaxPreTrainedModel.to_bf16.example",$$slots:{default:[$3]},$$scope:{ctx:F}}}),tn=new $({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/v4.33.0/src/transformers/modeling_flax_utils.py#L386"}}),Io=new Re({props:{anchor:"transformers.FlaxPreTrainedModel.to_fp16.example",$$slots:{default:[x3]},$$scope:{ctx:F}}}),on=new $({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/v4.33.0/src/transformers/modeling_flax_utils.py#L359"}}),Zo=new Re({props:{anchor:"transformers.FlaxPreTrainedModel.to_fp32.example",$$slots:{default:[k3]},$$scope:{ctx:F}}}),rn=new Ne({}),an=new $({props:{name:"class transformers.utils.PushToHubMixin",anchor:"transformers.utils.PushToHubMixin",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/utils/hub.py#L672"}}),nn=new $({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] = '10GB'"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = False"},{name:"revision",val:": 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 or not the repository created should be private.`,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;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.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>False</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"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/utils/hub.py#L786"}}),Wo=new Re({props:{anchor:"transformers.utils.PushToHubMixin.push_to_hub.example",$$slots:{default:[E3]},$$scope:{ctx:F}}}),sn=new Ne({}),ln=new $({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/v4.33.0/src/transformers/modeling_utils.py#L377",returnDescription:`
<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:`
<p><code>NamedTuple</code></p>
`}}),{c(){v=r("meta"),E=i(),T=r("h1"),y=r("a"),P=r("span"),p(c.$$.fragment),M=i(),ct=r("span"),zp=s("Models"),_c=i(),Q=r("p"),Bp=s("The base classes "),_n=r("a"),Dp=s("PreTrainedModel"),Np=s(", "),bn=r("a"),Rp=s("TFPreTrainedModel"),Vp=s(`, and
`),vn=r("a"),Xp=s("FlaxPreTrainedModel"),Yp=s(` implement the common methods for loading/saving a model either from a local
file or directory, or from a pretrained model configuration provided by the library (downloaded from HuggingFace\u2019s AWS
S3 repository).`),bc=i(),Xe=r("p"),yn=r("a"),Ap=s("PreTrainedModel"),qp=s(" and "),wn=r("a"),Lp=s("TFPreTrainedModel"),Sp=s(` also implement a few methods which
are common among all the models to:`),vc=i(),mt=r("ul"),Es=r("li"),Hp=s("resize the input token embeddings when new tokens are added to the vocabulary"),Qp=i(),Ps=r("li"),Op=s("prune the attention heads of the model."),yc=i(),B=r("p"),Kp=s("The other methods that are common to each model are defined in "),Tn=r("a"),eh=s("ModuleUtilsMixin"),th=s(`
(for the PyTorch models) and `),js=r("code"),oh=s("~modeling_tf_utils.TFModuleUtilsMixin"),rh=s(` (for the TensorFlow models) or
for text generation, `),Mn=r("a"),ah=s("GenerationMixin"),nh=s(` (for the PyTorch models),
`),$n=r("a"),sh=s("TFGenerationMixin"),lh=s(` (for the TensorFlow models) and
`),xn=r("a"),ih=s("FlaxGenerationMixin"),dh=s(" (for the Flax/JAX models)."),wc=i(),Ye=r("h2"),pt=r("a"),Us=r("span"),p(Xo.$$.fragment),ch=i(),Js=r("span"),mh=s("PreTrainedModel"),Tc=i(),j=r("div"),p(Yo.$$.fragment),ph=i(),Fs=r("p"),hh=s("Base class for all models."),fh=i(),kn=r("p"),En=r("a"),uh=s("PreTrainedModel"),gh=s(` 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:`),_h=i(),Ao=r("ul"),Is=r("li"),bh=s("resize the input embeddings,"),vh=i(),Zs=r("li"),yh=s("prune heads in the self-attention heads."),wh=i(),Cs=r("p"),Th=s("Class attributes (overridden by derived classes):"),Mh=i(),Y=r("ul"),Ws=r("li"),me=r("p"),Gs=r("strong"),$h=s("config_class"),xh=s(" ("),Pn=r("a"),kh=s("PretrainedConfig"),Eh=s(") \u2014 A subclass of "),jn=r("a"),Ph=s("PretrainedConfig"),jh=s(` to use as configuration class
for this model architecture.`),Uh=i(),qo=r("li"),pe=r("p"),zs=r("strong"),Jh=s("load_tf_weights"),Fh=s(" ("),Bs=r("code"),Ih=s("Callable"),Zh=s(") \u2014 A python "),Ds=r("em"),Ch=s("method"),Wh=s(` for loading a TensorFlow checkpoint in a PyTorch model,
taking as arguments:`),Gh=i(),Ae=r("ul"),ht=r("li"),Ns=r("strong"),zh=s("model"),Bh=s(" ("),Un=r("a"),Dh=s("PreTrainedModel"),Nh=s(") \u2014 An instance of the model on which to load the TensorFlow checkpoint."),Rh=i(),ft=r("li"),Rs=r("strong"),Vh=s("config"),Xh=s(" ("),Vs=r("code"),Yh=s("PreTrainedConfig"),Ah=s(") \u2014 An instance of the configuration associated to the model."),qh=i(),ut=r("li"),Xs=r("strong"),Lh=s("path"),Sh=s(" ("),Ys=r("code"),Hh=s("str"),Qh=s(") \u2014 A path to the TensorFlow checkpoint."),Oh=i(),As=r("li"),gt=r("p"),qs=r("strong"),Kh=s("base_model_prefix"),ef=s(" ("),Ls=r("code"),tf=s("str"),of=s(`) \u2014 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.`),rf=i(),Ss=r("li"),_t=r("p"),Hs=r("strong"),af=s("is_parallelizable"),nf=s(" ("),Qs=r("code"),sf=s("bool"),lf=s(") \u2014 A flag indicating whether this model supports model parallelization."),df=i(),Os=r("li"),D=r("p"),Ks=r("strong"),cf=s("main_input_name"),mf=s(" ("),el=r("code"),pf=s("str"),hf=s(") \u2014 The name of the principal input to the model (often "),tl=r("code"),ff=s("input_ids"),uf=s(` for NLP
models, `),ol=r("code"),gf=s("pixel_values"),_f=s(" for vision models and "),rl=r("code"),bf=s("input_values"),vf=s(" for speech models)."),yf=i(),he=r("div"),p(Lo.$$.fragment),wf=i(),al=r("p"),Tf=s("Upload the model file to the \u{1F917} Model Hub."),Mf=i(),p(bt.$$.fragment),$f=i(),vt=r("div"),p(So.$$.fragment),xf=i(),Ho=r("p"),kf=s("Returns whether this model can generate sequences with "),nl=r("code"),Ef=s(".generate()"),Pf=s("."),jf=i(),yt=r("div"),p(Qo.$$.fragment),Uf=i(),Oo=r("p"),Jf=s("Removes the "),sl=r("code"),Ff=s("_require_grads_hook"),If=s("."),Zf=i(),wt=r("div"),p(Ko.$$.fragment),Cf=i(),ll=r("p"),Wf=s(`Enables the gradients for the input embeddings. This is useful for fine-tuning adapter weights while keeping
the model weights fixed.`),Gf=i(),I=r("div"),p(er.$$.fragment),zf=i(),il=r("p"),Bf=s("Instantiate a pretrained pytorch model from a pre-trained model configuration."),Df=i(),qe=r("p"),Nf=s("The model is set in evaluation mode by default using "),dl=r("code"),Rf=s("model.eval()"),Vf=s(` (Dropout modules are deactivated). To train
the model, you should first set it back in training mode with `),cl=r("code"),Xf=s("model.train()"),Yf=s("."),Af=i(),tr=r("p"),qf=s("The warning "),ml=r("em"),Lf=s("Weights from XXX not initialized from pretrained model"),Sf=s(` 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.`),Hf=i(),or=r("p"),Qf=s("The warning "),pl=r("em"),Of=s("Weights from XXX not used in YYY"),Kf=s(` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),eu=i(),p(Tt.$$.fragment),tu=i(),p(Mt.$$.fragment),ou=i(),hl=r("ul"),Jn=r("li"),fl=r("code"),ru=s("low_cpu_mem_usage"),au=s(" algorithm:"),nu=i(),ul=r("p"),su=s("This is an experimental function that loads the model using ~1x model size CPU memory"),lu=i(),gl=r("p"),iu=s("Here is how it works:"),du=i(),A=r("ol"),_l=r("li"),cu=s("save which state_dict keys we have"),mu=i(),bl=r("li"),pu=s("drop state_dict before the model is created, since the latter takes 1x model size CPU memory"),hu=i(),vl=r("li"),fu=s(`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`),uu=i(),yl=r("li"),gu=s("load state_dict 2nd time"),_u=i(),wl=r("li"),bu=s("replace the params/buffers from the state_dict"),vu=i(),Tl=r("p"),yu=s("Currently, it can\u2019t handle deepspeed ZeRO stage 3 and ignores loading errors"),wu=i(),$t=r("div"),p(rr.$$.fragment),Tu=i(),Ml=r("p"),Mu=s("Returns the model\u2019s input embeddings."),$u=i(),xt=r("div"),p(ar.$$.fragment),xu=i(),Fn=r("p"),ku=s(`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: `),nr=r("a"),Eu=s("https://discuss.pytorch.org/t/gpu-memory-that-model-uses/56822/2"),Pu=i(),kt=r("div"),p(sr.$$.fragment),ju=i(),$l=r("p"),Uu=s("Returns the model\u2019s output embeddings."),Ju=i(),fe=r("div"),p(lr.$$.fragment),Fu=i(),xl=r("p"),Iu=s("Deactivates gradient checkpointing for the current model."),Zu=i(),kl=r("p"),Cu=s(`Note that in other frameworks this feature can be referred to as \u201Cactivation checkpointing\u201D or \u201Ccheckpoint
activations\u201D.`),Wu=i(),ue=r("div"),p(ir.$$.fragment),Gu=i(),El=r("p"),zu=s("Activates gradient checkpointing for the current model."),Bu=i(),Pl=r("p"),Du=s(`Note that in other frameworks this feature can be referred to as \u201Cactivation checkpointing\u201D or \u201Ccheckpoint
activations\u201D.`),Nu=i(),Et=r("div"),p(dr.$$.fragment),Ru=i(),Le=r("p"),Vu=s("If needed prunes and maybe initializes weights. If using a custom "),jl=r("code"),Xu=s("PreTrainedModel"),Yu=s(`, you need to implement any
initialization logic in `),Ul=r("code"),Au=s("_init_weights"),qu=s("."),Lu=i(),Pt=r("div"),p(cr.$$.fragment),Su=i(),Jl=r("p"),Hu=s(`A method executed at the end of each Transformer model initialization, to execute code that needs the model\u2019s
modules properly initialized (such as weight initialization).`),Qu=i(),jt=r("div"),p(mr.$$.fragment),Ou=i(),Fl=r("p"),Ku=s("Prunes heads of the base model."),eg=i(),ge=r("div"),p(pr.$$.fragment),tg=i(),Il=r("p"),og=s(`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.`),rg=i(),p(Ut.$$.fragment),ag=i(),_e=r("div"),p(hr.$$.fragment),ng=i(),fr=r("p"),sg=s("Resizes input token embeddings matrix of the model if "),Zl=r("code"),lg=s("new_num_tokens != config.vocab_size"),ig=s("."),dg=i(),ur=r("p"),cg=s("Takes care of tying weights embeddings afterwards if the model class has a "),Cl=r("code"),mg=s("tie_weights()"),pg=s(" method."),hg=i(),Jt=r("div"),p(gr.$$.fragment),fg=i(),_r=r("p"),ug=s("Reverts the transformation from "),In=r("a"),gg=s("to_bettertransformer()"),_g=s(` so that the original modeling is
used, for example in order to save the model.`),bg=i(),Ft=r("div"),p(br.$$.fragment),vg=i(),vr=r("p"),yg=s(`Save a model and its configuration file to a directory, so that it can be re-loaded using the
`),Zn=r("a"),wg=s("from_pretrained()"),Tg=s(" class method."),Mg=i(),It=r("div"),p(yr.$$.fragment),$g=i(),Wl=r("p"),xg=s("Set model\u2019s input embeddings."),kg=i(),be=r("div"),p(wr.$$.fragment),Eg=i(),Gl=r("p"),Pg=s("Tie the weights between the input embeddings and the output embeddings."),jg=i(),Tr=r("p"),Ug=s("If the "),zl=r("code"),Jg=s("torchscript"),Fg=s(` flag is set in the configuration, can\u2019t handle parameter sharing so we are cloning the
weights instead.`),Ig=i(),ve=r("div"),p(Mr.$$.fragment),Zg=i(),Se=r("p"),Cg=s("Converts the model to use "),$r=r("a"),Wg=s(`PyTorch\u2019s native attention
implementation`),Gg=s(`, integrated to
Transformers through `),xr=r("a"),zg=s("Optimum library"),Bg=s(`. Only a
subset of all Transformers models are supported.`),Dg=i(),He=r("p"),Ng=s("PyTorch\u2019s attention fastpath allows to speed up inference through kernel fusions and the use of "),kr=r("a"),Rg=s(`nested
tensors`),Vg=s(". Detailed benchmarks can be found in "),Er=r("a"),Xg=s(`this blog
post`),Yg=s("."),Ag=i(),Zt=r("div"),p(Pr.$$.fragment),qg=i(),Bl=r("p"),Lg=s("Shows a one-time warning if the input_ids appear to contain padding and no attention mask was given."),Mc=i(),Cn=r("a"),$c=i(),Qe=r("h3"),Ct=r("a"),Dl=r("span"),p(jr.$$.fragment),Sg=i(),Nl=r("span"),Hg=s("Large model loading"),xc=i(),ye=r("p"),Qg=s("In Transformers 4.20.0, the "),Wn=r("a"),Og=s("from_pretrained()"),Kg=s(" method has been reworked to accommodate large models using "),Ur=r("a"),e_=s("Accelerate"),t_=s(". This requires Accelerate >= 0.9.0 and PyTorch >= 1.9.0. Instead of creating the full model, then loading the pretrained weights inside it (which takes twice the size of the model in RAM, one for the randomly initialized model, one for the weights), there is an option to create the model as an empty shell, then only materialize its parameters when the pretrained weights are loaded."),kc=i(),Wt=r("p"),o_=s("This option can be activated with "),Rl=r("code"),r_=s("low_cpu_mem_usage=True"),a_=s(". The model is first created on the Meta device (with empty weights) and the state dict is then loaded inside it (shard by shard in the case of a sharded checkpoint). This way the maximum RAM used is the full size of the model only."),Ec=i(),p(Jr.$$.fragment),Pc=i(),Gt=r("p"),n_=s("Moreover, you can directly place the model on different devices if it doesn\u2019t fully fit in RAM (only works for inference for now). With "),Vl=r("code"),s_=s('device_map="auto"'),l_=s(", Accelerate will determine where to put each layer to maximize the use of your fastest devices (GPUs) and offload the rest on the CPU, or even the hard drive if you don\u2019t have enough GPU RAM (or CPU RAM). Even if the model is split across several devices, it will run as you would normally expect."),jc=i(),O=r("p"),i_=s("When passing a "),Xl=r("code"),d_=s("device_map"),c_=s(", "),Yl=r("code"),m_=s("low_cpu_mem_usage"),p_=s(" is automatically set to "),Al=r("code"),h_=s("True"),f_=s(", so you don\u2019t need to specify it:"),Uc=i(),p(Fr.$$.fragment),Jc=i(),zt=r("p"),u_=s("You can inspect how the model was split across devices by looking at its "),ql=r("code"),g_=s("hf_device_map"),__=s(" attribute:"),Fc=i(),p(Ir.$$.fragment),Ic=i(),p(Zr.$$.fragment),Zc=i(),Gn=r("p"),b_=s("You can also write your own device map following the same format (a dictionary layer name to device). It should map all parameters of the model to a given device, but you don\u2019t have to detail where all the submodules of one layer go if that layer is entirely on the same device. For instance, the following device map would work properly for T0pp (as long as you have the GPU memory):"),Cc=i(),p(Cr.$$.fragment),Wc=i(),Bt=r("p"),v_=s("Another way to minimize the memory impact of your model is to instantiate it at a lower precision dtype (like "),Ll=r("code"),y_=s("torch.float16"),w_=s(") or use direct quantization techniques as described below."),Gc=i(),Oe=r("h3"),Dt=r("a"),Sl=r("span"),p(Wr.$$.fragment),T_=i(),Hl=r("span"),M_=s("Model Instantiation dtype"),zc=i(),K=r("p"),$_=s("Under Pytorch a model normally gets instantiated with "),Ql=r("code"),x_=s("torch.float32"),k_=s(` format. This can be an issue if one tries to
load a model whose weights are in fp16, since it\u2019d require twice as much memory. To overcome this limitation, you can
either explicitly pass the desired `),Ol=r("code"),E_=s("dtype"),P_=s(" using "),Kl=r("code"),j_=s("torch_dtype"),U_=s(" argument:"),Bc=i(),p(Gr.$$.fragment),Dc=i(),we=r("p"),J_=s("or, if you want the model to always load in the most optimal memory pattern, you can use the special value "),ei=r("code"),F_=s('"auto"'),I_=s(`,
and then `),ti=r("code"),Z_=s("dtype"),C_=s(" will be automatically derived from the model\u2019s weights:"),Nc=i(),p(zr.$$.fragment),Rc=i(),Nt=r("p"),W_=s("Models instantiated from scratch can also be told which "),oi=r("code"),G_=s("dtype"),z_=s(" to use with:"),Vc=i(),p(Br.$$.fragment),Xc=i(),zn=r("p"),B_=s("Due to Pytorch design, this functionality is only available for floating dtypes."),Yc=i(),Ke=r("h2"),Rt=r("a"),ri=r("span"),p(Dr.$$.fragment),D_=i(),ai=r("span"),N_=s("ModuleUtilsMixin"),Ac=i(),C=r("div"),p(Nr.$$.fragment),R_=i(),Rr=r("p"),V_=s("A few utilities for "),ni=r("code"),X_=s("torch.nn.Modules"),Y_=s(", to be used as a mixin."),A_=i(),Te=r("div"),p(Vr.$$.fragment),q_=i(),si=r("p"),L_=s("Add a memory hook before and after each sub-module forward pass to record increase in memory consumption."),S_=i(),et=r("p"),H_=s("Increase in memory consumption is stored in a "),li=r("code"),Q_=s("mem_rss_diff"),O_=s(` attribute for each module and can be reset to zero
with `),ii=r("code"),K_=s("model.reset_memory_hooks_state()"),eb=s("."),tb=i(),Vt=r("div"),p(Xr.$$.fragment),ob=i(),di=r("p"),rb=s("Helper function to estimate the total number of tokens from the model inputs."),ab=i(),Xt=r("div"),p(Yr.$$.fragment),nb=i(),tt=r("p"),sb=s(`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 `),ci=r("code"),lb=s("12 * d_model << sequence_length"),ib=s(") as laid out in "),Ar=r("a"),db=s(`this
paper`),cb=s(` 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.`),mb=i(),Yt=r("div"),p(qr.$$.fragment),pb=i(),mi=r("p"),hb=s("Makes broadcastable attention and causal masks so that future and masked tokens are ignored."),fb=i(),At=r("div"),p(Lr.$$.fragment),ub=i(),pi=r("p"),gb=s("Prepare the head mask if needed."),_b=i(),qt=r("div"),p(Sr.$$.fragment),bb=i(),hi=r("p"),vb=s("Invert an attention mask (e.g., switches 0. and 1.)."),yb=i(),Lt=r("div"),p(Hr.$$.fragment),wb=i(),fi=r("p"),Tb=s("Get number of (optionally, trainable or non-embeddings) parameters in the module."),Mb=i(),St=r("div"),p(Qr.$$.fragment),$b=i(),ot=r("p"),xb=s("Reset the "),ui=r("code"),kb=s("mem_rss_diff"),Eb=s(" attribute of each module (see "),Bn=r("a"),Pb=s("add_memory_hooks()"),jb=s(")."),qc=i(),rt=r("h2"),Ht=r("a"),gi=r("span"),p(Or.$$.fragment),Ub=i(),_i=r("span"),Jb=s("TFPreTrainedModel"),Lc=i(),x=r("div"),p(Kr.$$.fragment),Fb=i(),bi=r("p"),Ib=s("Base class for all TF models."),Zb=i(),Dn=r("p"),Nn=r("a"),Cb=s("TFPreTrainedModel"),Wb=s(` 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:`),Gb=i(),ea=r("ul"),vi=r("li"),zb=s("resize the input embeddings,"),Bb=i(),yi=r("li"),Db=s("prune heads in the self-attention heads."),Nb=i(),wi=r("p"),Rb=s("Class attributes (overridden by derived classes):"),Vb=i(),at=r("ul"),Me=r("li"),Ti=r("strong"),Xb=s("config_class"),Yb=s(" ("),Rn=r("a"),Ab=s("PretrainedConfig"),qb=s(") \u2014 A subclass of "),Vn=r("a"),Lb=s("PretrainedConfig"),Sb=s(` to use as configuration class
for this model architecture.`),Hb=i(),Qt=r("li"),Mi=r("strong"),Qb=s("base_model_prefix"),Ob=s(" ("),$i=r("code"),Kb=s("str"),ev=s(`) \u2014 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.`),tv=i(),N=r("li"),xi=r("strong"),ov=s("main_input_name"),rv=s(" ("),ki=r("code"),av=s("str"),nv=s(") \u2014 The name of the principal input to the model (often "),Ei=r("code"),sv=s("input_ids"),lv=s(` for NLP
models, `),Pi=r("code"),iv=s("pixel_values"),dv=s(" for vision models and "),ji=r("code"),cv=s("input_values"),mv=s(" for speech models)."),pv=i(),$e=r("div"),p(ta.$$.fragment),hv=i(),oa=r("p"),fv=s("Upload the model files to the \u{1F917} Model Hub while synchronizing a local clone of the repo in "),Ui=r("code"),uv=s("repo_path_or_name"),gv=s("."),_v=i(),p(Ot.$$.fragment),bv=i(),Kt=r("div"),p(ra.$$.fragment),vv=i(),aa=r("p"),yv=s("Returns whether this model can generate sequences with "),Ji=r("code"),wv=s(".generate()"),Tv=s("."),Mv=i(),eo=r("div"),p(na.$$.fragment),$v=i(),Fi=r("p"),xv=s(`This is a thin wrapper that sets the model\u2019s loss output head as the loss if the user does not specify a loss
function themselves.`),kv=i(),to=r("div"),p(sa.$$.fragment),Ev=i(),la=r("p"),Pv=s("Creates a draft of a model card using the information available to the "),Ii=r("code"),jv=s("Trainer"),Uv=s("."),Jv=i(),oo=r("div"),p(ia.$$.fragment),Fv=i(),Zi=r("p"),Iv=s("Method used for serving the model. This method is deprecated, and will be removed."),Zv=i(),R=r("div"),p(da.$$.fragment),Cv=i(),Ci=r("p"),Wv=s("Instantiate a pretrained TF 2.0 model from a pre-trained model configuration."),Gv=i(),ca=r("p"),zv=s("The warning "),Wi=r("em"),Bv=s("Weights from XXX not initialized from pretrained model"),Dv=s(` 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.`),Nv=i(),ma=r("p"),Rv=s("The warning "),Gi=r("em"),Vv=s("Weights from XXX not used in YYY"),Xv=s(` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),Yv=i(),p(ro.$$.fragment),Av=i(),ao=r("div"),p(pa.$$.fragment),qv=i(),zi=r("p"),Lv=s("Dict of bias attached to an LM head. The key represents the name of the bias attribute."),Sv=i(),no=r("div"),p(ha.$$.fragment),Hv=i(),Bi=r("p"),Qv=s("Prepare the head mask if needed."),Ov=i(),so=r("div"),p(fa.$$.fragment),Kv=i(),Di=r("p"),ey=s("Returns the model\u2019s input embeddings layer."),ty=i(),lo=r("div"),p(ua.$$.fragment),oy=i(),Ni=r("p"),ry=s("The LM Head layer. This method must be overwritten by all the models that have a lm head."),ay=i(),io=r("div"),p(ga.$$.fragment),ny=i(),Ri=r("p"),sy=s("Returns the model\u2019s output embeddings"),ly=i(),co=r("div"),p(_a.$$.fragment),iy=i(),Vi=r("p"),dy=s(`Get the layer that handles a bias attribute in case the model has an LM head with weights tied to the
embeddings`),cy=i(),mo=r("div"),p(ba.$$.fragment),my=i(),Xi=r("p"),py=s("Get the concatenated _prefix name of the bias from the model name to the parent layer"),hy=i(),po=r("div"),p(va.$$.fragment),fy=i(),Yi=r("p"),uy=s(`Loads a saved checkpoint (model weights and optimizer state) from a repo. Returns the current epoch count when
the checkpoint was made.`),gy=i(),ho=r("div"),p(ya.$$.fragment),_y=i(),q=r("p"),by=s("Wraps a HuggingFace "),wa=r("a"),vy=s("Dataset"),yy=s(" as a "),Ai=r("code"),wy=s("tf.data.Dataset"),Ty=s(` with collation and batching. This method is
designed to create a \u201Cready-to-use\u201D dataset that can be passed directly to Keras methods like `),qi=r("code"),My=s("fit()"),$y=s(` without
further modification. The method will drop columns from the dataset if they don\u2019t 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 `),Li=r("code"),xy=s("Dataset.to_tf_dataset()"),ky=s(" instead."),Ey=i(),fo=r("div"),p(Ta.$$.fragment),Py=i(),Si=r("p"),jy=s("Prunes heads of the base model."),Uy=i(),xe=r("div"),p(Ma.$$.fragment),Jy=i(),Hi=r("p"),Fy=s(`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.`),Iy=i(),p(uo.$$.fragment),Zy=i(),ke=r("div"),p($a.$$.fragment),Cy=i(),xa=r("p"),Wy=s("Resizes input token embeddings matrix of the model if "),Qi=r("code"),Gy=s("new_num_tokens != config.vocab_size"),zy=s("."),By=i(),ka=r("p"),Dy=s("Takes care of tying weights embeddings afterwards if the model class has a "),Oi=r("code"),Ny=s("tie_weights()"),Ry=s(" method."),Vy=i(),go=r("div"),p(Ea.$$.fragment),Xy=i(),Pa=r("p"),Yy=s(`Save a model and its configuration file to a directory, so that it can be re-loaded using the
`),Xn=r("a"),Ay=s("from_pretrained()"),qy=s(" class method."),Ly=i(),Yn=r("div"),p(ja.$$.fragment),Sy=i(),_o=r("div"),p(Ua.$$.fragment),Hy=i(),Ki=r("p"),Qy=s("Prepare the output of the saved model. Can be overridden if specific serving modifications are required."),Oy=i(),bo=r("div"),p(Ja.$$.fragment),Ky=i(),ed=r("p"),ew=s("Set all the bias in the LM head."),tw=i(),vo=r("div"),p(Fa.$$.fragment),ow=i(),td=r("p"),rw=s("Set model\u2019s input embeddings"),aw=i(),yo=r("div"),p(Ia.$$.fragment),nw=i(),od=r("p"),sw=s("Set model\u2019s output embeddings"),lw=i(),wo=r("div"),p(Za.$$.fragment),iw=i(),Ca=r("p"),dw=s("A modification of Keras\u2019s default "),rd=r("code"),cw=s("train_step"),mw=s(` 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.`),pw=i(),To=r("div"),p(Wa.$$.fragment),hw=i(),Ga=r("p"),fw=s("A modification of Keras\u2019s default "),ad=r("code"),uw=s("train_step"),gw=s(` 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.`),Sc=i(),nt=r("h2"),Mo=r("a"),nd=r("span"),p(za.$$.fragment),_w=i(),sd=r("span"),bw=s("TFModelUtilsMixin"),Hc=i(),re=r("div"),p(Ba.$$.fragment),vw=i(),Da=r("p"),yw=s("A few utilities for "),ld=r("code"),ww=s("tf.keras.Model"),Tw=s(", to be used as a mixin."),Mw=i(),$o=r("div"),p(Na.$$.fragment),$w=i(),id=r("p"),xw=s("Get the number of (optionally, trainable) parameters in the model."),Qc=i(),st=r("h2"),xo=r("a"),dd=r("span"),p(Ra.$$.fragment),kw=i(),cd=r("span"),Ew=s("FlaxPreTrainedModel"),Oc=i(),J=r("div"),p(Va.$$.fragment),Pw=i(),md=r("p"),jw=s("Base class for all models."),Uw=i(),An=r("p"),qn=r("a"),Jw=s("FlaxPreTrainedModel"),Fw=s(` takes care of storing the configuration of the models and handles methods for loading,
downloading and saving models.`),Iw=i(),pd=r("p"),Zw=s("Class attributes (overridden by derived classes):"),Cw=i(),lt=r("ul"),Ee=r("li"),hd=r("strong"),Ww=s("config_class"),Gw=s(" ("),Ln=r("a"),zw=s("PretrainedConfig"),Bw=s(") \u2014 A subclass of "),Sn=r("a"),Dw=s("PretrainedConfig"),Nw=s(` to use as configuration class
for this model architecture.`),Rw=i(),ko=r("li"),fd=r("strong"),Vw=s("base_model_prefix"),Xw=s(" ("),ud=r("code"),Yw=s("str"),Aw=s(`) \u2014 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.`),qw=i(),V=r("li"),gd=r("strong"),Lw=s("main_input_name"),Sw=s(" ("),_d=r("code"),Hw=s("str"),Qw=s(") \u2014 The name of the principal input to the model (often "),bd=r("code"),Ow=s("input_ids"),Kw=s(` for NLP
models, `),vd=r("code"),e2=s("pixel_values"),t2=s(" for vision models and "),yd=r("code"),o2=s("input_values"),r2=s(" for speech models)."),a2=i(),Pe=r("div"),p(Xa.$$.fragment),n2=i(),wd=r("p"),s2=s("Upload the model checkpoint to the \u{1F917} Model Hub."),l2=i(),p(Eo.$$.fragment),i2=i(),Po=r("div"),p(Ya.$$.fragment),d2=i(),ae=r("p"),c2=s("Returns whether this model can generate sequences with "),Td=r("code"),m2=s(".generate()"),p2=s(`. Returns:
`),Md=r("code"),h2=s("bool"),f2=s(": Whether this model can generate sequences with "),$d=r("code"),u2=s(".generate()"),g2=s("."),_2=i(),X=r("div"),p(Aa.$$.fragment),b2=i(),xd=r("p"),v2=s("Instantiate a pretrained flax model from a pre-trained model configuration."),y2=i(),qa=r("p"),w2=s("The warning "),kd=r("em"),T2=s("Weights from XXX not initialized from pretrained model"),M2=s(` 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.`),$2=i(),La=r("p"),x2=s("The warning "),Ed=r("em"),k2=s("Weights from XXX not used in YYY"),E2=s(` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),P2=i(),p(jo.$$.fragment),j2=i(),je=r("div"),p(Sa.$$.fragment),U2=i(),Ha=r("p"),J2=s("This is the same as "),Pd=r("code"),F2=s("flax.serialization.from_bytes"),I2=s(`
(https:lax.readthedocs.io/en/latest/_modules/flax/serialization.html#from_bytes) but for a sharded checkpoint.`),Z2=i(),jd=r("p"),C2=s(`This load is performed efficiently: each checkpoint shard is loaded one by one in RAM and deleted after being
loaded in the model.`),W2=i(),Ue=r("div"),p(Qa.$$.fragment),G2=i(),Ud=r("p"),z2=s(`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.`),B2=i(),p(Uo.$$.fragment),D2=i(),Jo=r("div"),p(Oa.$$.fragment),N2=i(),Ka=r("p"),R2=s(`Save a model and its configuration file to a directory, so that it can be re-loaded using the
`),Jd=r("code"),V2=s("[from_pretrained()](/docs/transformers/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained)"),X2=s(" class method"),Y2=i(),ee=r("div"),p(en.$$.fragment),A2=i(),L=r("p"),q2=s("Cast the floating-point "),Fd=r("code"),L2=s("params"),S2=s(" to "),Id=r("code"),H2=s("jax.numpy.bfloat16"),Q2=s(". This returns a new "),Zd=r("code"),O2=s("params"),K2=s(` tree and does not cast
the `),Cd=r("code"),eT=s("params"),tT=s(" in place."),oT=i(),Wd=r("p"),rT=s(`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.`),aT=i(),p(Fo.$$.fragment),nT=i(),te=r("div"),p(tn.$$.fragment),sT=i(),S=r("p"),lT=s("Cast the floating-point "),Gd=r("code"),iT=s("parmas"),dT=s(" to "),zd=r("code"),cT=s("jax.numpy.float16"),mT=s(". This returns a new "),Bd=r("code"),pT=s("params"),hT=s(` tree and does not cast the
`),Dd=r("code"),fT=s("params"),uT=s(" in place."),gT=i(),Nd=r("p"),_T=s(`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.`),bT=i(),p(Io.$$.fragment),vT=i(),Je=r("div"),p(on.$$.fragment),yT=i(),H=r("p"),wT=s("Cast the floating-point "),Rd=r("code"),TT=s("parmas"),MT=s(" to "),Vd=r("code"),$T=s("jax.numpy.float32"),xT=s(`. This method can be used to explicitly convert the
model parameters to fp32 precision. This returns a new `),Xd=r("code"),kT=s("params"),ET=s(" tree and does not cast the "),Yd=r("code"),PT=s("params"),jT=s(" in place."),UT=i(),p(Zo.$$.fragment),Kc=i(),it=r("h2"),Co=r("a"),Ad=r("span"),p(rn.$$.fragment),JT=i(),qd=r("span"),FT=s("Pushing to the Hub"),em=i(),ne=r("div"),p(an.$$.fragment),IT=i(),Ld=r("p"),ZT=s("A Mixin containing the functionality to push a model or tokenizer to the hub."),CT=i(),Fe=r("div"),p(nn.$$.fragment),WT=i(),Sd=r("p"),GT=s("Upload the {object_files} to the \u{1F917} Model Hub."),zT=i(),p(Wo.$$.fragment),tm=i(),dt=r("h2"),Go=r("a"),Hd=r("span"),p(sn.$$.fragment),BT=i(),Qd=r("span"),DT=s("Sharded checkpoints"),om=i(),se=r("div"),p(ln.$$.fragment),NT=i(),dn=r("p"),RT=s(`This is the same as
`),cn=r("a"),Od=r("code"),VT=s("torch.nn.Module.load_state_dict"),XT=s(`
but for a sharded checkpoint.`),YT=i(),Kd=r("p"),AT=s(`This load is performed efficiently: each checkpoint shard is loaded one by one in RAM and deleted after being
loaded in the model.`),this.h()},l(o){const b=p3('[data-svelte="svelte-1phssyn"]',document.head);v=a(b,"META",{name:!0,content:!0}),b.forEach(t),E=d(o),T=a(o,"H1",{class:!0});var mn=n(T);y=a(mn,"A",{id:!0,class:!0,href:!0});var ec=n(y);P=a(ec,"SPAN",{});var tc=n(P);h(c.$$.fragment,tc),tc.forEach(t),ec.forEach(t),M=d(mn),ct=a(mn,"SPAN",{});var oc=n(ct);zp=l(oc,"Models"),oc.forEach(t),mn.forEach(t),_c=d(o),Q=a(o,"P",{});var le=n(Q);Bp=l(le,"The base classes "),_n=a(le,"A",{href:!0});var rc=n(_n);Dp=l(rc,"PreTrainedModel"),rc.forEach(t),Np=l(le,", "),bn=a(le,"A",{href:!0});var ac=n(bn);Rp=l(ac,"TFPreTrainedModel"),ac.forEach(t),Vp=l(le,`, and
`),vn=a(le,"A",{href:!0});var nc=n(vn);Xp=l(nc,"FlaxPreTrainedModel"),nc.forEach(t),Yp=l(le,` implement the common methods for loading/saving a model either from a local
file or directory, or from a pretrained model configuration provided by the library (downloaded from HuggingFace\u2019s AWS
S3 repository).`),le.forEach(t),bc=d(o),Xe=a(o,"P",{});var zo=n(Xe);yn=a(zo,"A",{href:!0});var sc=n(yn);Ap=l(sc,"PreTrainedModel"),sc.forEach(t),qp=l(zo," and "),wn=a(zo,"A",{href:!0});var lc=n(wn);Lp=l(lc,"TFPreTrainedModel"),lc.forEach(t),Sp=l(zo,` also implement a few methods which
are common among all the models to:`),zo.forEach(t),vc=d(o),mt=a(o,"UL",{});var pn=n(mt);Es=a(pn,"LI",{});var ic=n(Es);Hp=l(ic,"resize the input token embeddings when new tokens are added to the vocabulary"),ic.forEach(t),Qp=d(pn),Ps=a(pn,"LI",{});var dc=n(Ps);Op=l(dc,"prune the attention heads of the model."),dc.forEach(t),pn.forEach(t),yc=d(o),B=a(o,"P",{});var oe=n(B);Kp=l(oe,"The other methods that are common to each model are defined in "),Tn=a(oe,"A",{href:!0});var OT=n(Tn);eh=l(OT,"ModuleUtilsMixin"),OT.forEach(t),th=l(oe,`
(for the PyTorch models) and `),js=a(oe,"CODE",{});var KT=n(js);oh=l(KT,"~modeling_tf_utils.TFModuleUtilsMixin"),KT.forEach(t),rh=l(oe,` (for the TensorFlow models) or
for text generation, `),Mn=a(oe,"A",{href:!0});var eM=n(Mn);ah=l(eM,"GenerationMixin"),eM.forEach(t),nh=l(oe,` (for the PyTorch models),
`),$n=a(oe,"A",{href:!0});var tM=n($n);sh=l(tM,"TFGenerationMixin"),tM.forEach(t),lh=l(oe,` (for the TensorFlow models) and
`),xn=a(oe,"A",{href:!0});var oM=n(xn);ih=l(oM,"FlaxGenerationMixin"),oM.forEach(t),dh=l(oe," (for the Flax/JAX models)."),oe.forEach(t),wc=d(o),Ye=a(o,"H2",{class:!0});var am=n(Ye);pt=a(am,"A",{id:!0,class:!0,href:!0});var rM=n(pt);Us=a(rM,"SPAN",{});var aM=n(Us);h(Xo.$$.fragment,aM),aM.forEach(t),rM.forEach(t),ch=d(am),Js=a(am,"SPAN",{});var nM=n(Js);mh=l(nM,"PreTrainedModel"),nM.forEach(t),am.forEach(t),Tc=d(o),j=a(o,"DIV",{class:!0});var U=n(j);h(Yo.$$.fragment,U),ph=d(U),Fs=a(U,"P",{});var sM=n(Fs);hh=l(sM,"Base class for all models."),sM.forEach(t),fh=d(U),kn=a(U,"P",{});var qT=n(kn);En=a(qT,"A",{href:!0});var lM=n(En);uh=l(lM,"PreTrainedModel"),lM.forEach(t),gh=l(qT,` 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:`),qT.forEach(t),_h=d(U),Ao=a(U,"UL",{});var nm=n(Ao);Is=a(nm,"LI",{});var iM=n(Is);bh=l(iM,"resize the input embeddings,"),iM.forEach(t),vh=d(nm),Zs=a(nm,"LI",{});var dM=n(Zs);yh=l(dM,"prune heads in the self-attention heads."),dM.forEach(t),nm.forEach(t),wh=d(U),Cs=a(U,"P",{});var cM=n(Cs);Th=l(cM,"Class attributes (overridden by derived classes):"),cM.forEach(t),Mh=d(U),Y=a(U,"UL",{});var Ie=n(Y);Ws=a(Ie,"LI",{});var mM=n(Ws);me=a(mM,"P",{});var hn=n(me);Gs=a(hn,"STRONG",{});var pM=n(Gs);$h=l(pM,"config_class"),pM.forEach(t),xh=l(hn," ("),Pn=a(hn,"A",{href:!0});var hM=n(Pn);kh=l(hM,"PretrainedConfig"),hM.forEach(t),Eh=l(hn,") \u2014 A subclass of "),jn=a(hn,"A",{href:!0});var fM=n(jn);Ph=l(fM,"PretrainedConfig"),fM.forEach(t),jh=l(hn,` to use as configuration class
for this model architecture.`),hn.forEach(t),mM.forEach(t),Uh=d(Ie),qo=a(Ie,"LI",{});var sm=n(qo);pe=a(sm,"P",{});var fn=n(pe);zs=a(fn,"STRONG",{});var uM=n(zs);Jh=l(uM,"load_tf_weights"),uM.forEach(t),Fh=l(fn," ("),Bs=a(fn,"CODE",{});var gM=n(Bs);Ih=l(gM,"Callable"),gM.forEach(t),Zh=l(fn,") \u2014 A python "),Ds=a(fn,"EM",{});var _M=n(Ds);Ch=l(_M,"method"),_M.forEach(t),Wh=l(fn,` for loading a TensorFlow checkpoint in a PyTorch model,
taking as arguments:`),fn.forEach(t),Gh=d(sm),Ae=a(sm,"UL",{});var Hn=n(Ae);ht=a(Hn,"LI",{});var cc=n(ht);Ns=a(cc,"STRONG",{});var bM=n(Ns);zh=l(bM,"model"),bM.forEach(t),Bh=l(cc," ("),Un=a(cc,"A",{href:!0});var vM=n(Un);Dh=l(vM,"PreTrainedModel"),vM.forEach(t),Nh=l(cc,") \u2014 An instance of the model on which to load the TensorFlow checkpoint."),cc.forEach(t),Rh=d(Hn),ft=a(Hn,"LI",{});var mc=n(ft);Rs=a(mc,"STRONG",{});var yM=n(Rs);Vh=l(yM,"config"),yM.forEach(t),Xh=l(mc," ("),Vs=a(mc,"CODE",{});var wM=n(Vs);Yh=l(wM,"PreTrainedConfig"),wM.forEach(t),Ah=l(mc,") \u2014 An instance of the configuration associated to the model."),mc.forEach(t),qh=d(Hn),ut=a(Hn,"LI",{});var pc=n(ut);Xs=a(pc,"STRONG",{});var TM=n(Xs);Lh=l(TM,"path"),TM.forEach(t),Sh=l(pc," ("),Ys=a(pc,"CODE",{});var MM=n(Ys);Hh=l(MM,"str"),MM.forEach(t),Qh=l(pc,") \u2014 A path to the TensorFlow checkpoint."),pc.forEach(t),Hn.forEach(t),sm.forEach(t),Oh=d(Ie),As=a(Ie,"LI",{});var $M=n(As);gt=a($M,"P",{});var hc=n(gt);qs=a(hc,"STRONG",{});var xM=n(qs);Kh=l(xM,"base_model_prefix"),xM.forEach(t),ef=l(hc," ("),Ls=a(hc,"CODE",{});var kM=n(Ls);tf=l(kM,"str"),kM.forEach(t),of=l(hc,`) \u2014 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.`),hc.forEach(t),$M.forEach(t),rf=d(Ie),Ss=a(Ie,"LI",{});var EM=n(Ss);_t=a(EM,"P",{});var fc=n(_t);Hs=a(fc,"STRONG",{});var PM=n(Hs);af=l(PM,"is_parallelizable"),PM.forEach(t),nf=l(fc," ("),Qs=a(fc,"CODE",{});var jM=n(Qs);sf=l(jM,"bool"),jM.forEach(t),lf=l(fc,") \u2014 A flag indicating whether this model supports model parallelization."),fc.forEach(t),EM.forEach(t),df=d(Ie),Os=a(Ie,"LI",{});var UM=n(Os);D=a(UM,"P",{});var ie=n(D);Ks=a(ie,"STRONG",{});var JM=n(Ks);cf=l(JM,"main_input_name"),JM.forEach(t),mf=l(ie," ("),el=a(ie,"CODE",{});var FM=n(el);pf=l(FM,"str"),FM.forEach(t),hf=l(ie,") \u2014 The name of the principal input to the model (often "),tl=a(ie,"CODE",{});var IM=n(tl);ff=l(IM,"input_ids"),IM.forEach(t),uf=l(ie,` for NLP
models, `),ol=a(ie,"CODE",{});var ZM=n(ol);gf=l(ZM,"pixel_values"),ZM.forEach(t),_f=l(ie," for vision models and "),rl=a(ie,"CODE",{});var CM=n(rl);bf=l(CM,"input_values"),CM.forEach(t),vf=l(ie," for speech models)."),ie.forEach(t),UM.forEach(t),Ie.forEach(t),yf=d(U),he=a(U,"DIV",{class:!0});var Qn=n(he);h(Lo.$$.fragment,Qn),wf=d(Qn),al=a(Qn,"P",{});var WM=n(al);Tf=l(WM,"Upload the model file to the \u{1F917} Model Hub."),WM.forEach(t),Mf=d(Qn),h(bt.$$.fragment,Qn),Qn.forEach(t),$f=d(U),vt=a(U,"DIV",{class:!0});var lm=n(vt);h(So.$$.fragment,lm),xf=d(lm),Ho=a(lm,"P",{});var im=n(Ho);kf=l(im,"Returns whether this model can generate sequences with "),nl=a(im,"CODE",{});var GM=n(nl);Ef=l(GM,".generate()"),GM.forEach(t),Pf=l(im,"."),im.forEach(t),lm.forEach(t),jf=d(U),yt=a(U,"DIV",{class:!0});var dm=n(yt);h(Qo.$$.fragment,dm),Uf=d(dm),Oo=a(dm,"P",{});var cm=n(Oo);Jf=l(cm,"Removes the "),sl=a(cm,"CODE",{});var zM=n(sl);Ff=l(zM,"_require_grads_hook"),zM.forEach(t),If=l(cm,"."),cm.forEach(t),dm.forEach(t),Zf=d(U),wt=a(U,"DIV",{class:!0});var mm=n(wt);h(Ko.$$.fragment,mm),Cf=d(mm),ll=a(mm,"P",{});var BM=n(ll);Wf=l(BM,`Enables the gradients for the input embeddings. This is useful for fine-tuning adapter weights while keeping
the model weights fixed.`),BM.forEach(t),mm.forEach(t),Gf=d(U),I=a(U,"DIV",{class:!0});var W=n(I);h(er.$$.fragment,W),zf=d(W),il=a(W,"P",{});var DM=n(il);Bf=l(DM,"Instantiate a pretrained pytorch model from a pre-trained model configuration."),DM.forEach(t),Df=d(W),qe=a(W,"P",{});var On=n(qe);Nf=l(On,"The model is set in evaluation mode by default using "),dl=a(On,"CODE",{});var NM=n(dl);Rf=l(NM,"model.eval()"),NM.forEach(t),Vf=l(On,` (Dropout modules are deactivated). To train
the model, you should first set it back in training mode with `),cl=a(On,"CODE",{});var RM=n(cl);Xf=l(RM,"model.train()"),RM.forEach(t),Yf=l(On,"."),On.forEach(t),Af=d(W),tr=a(W,"P",{});var pm=n(tr);qf=l(pm,"The warning "),ml=a(pm,"EM",{});var VM=n(ml);Lf=l(VM,"Weights from XXX not initialized from pretrained model"),VM.forEach(t),Sf=l(pm,` 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.`),pm.forEach(t),Hf=d(W),or=a(W,"P",{});var hm=n(or);Qf=l(hm,"The warning "),pl=a(hm,"EM",{});var XM=n(pl);Of=l(XM,"Weights from XXX not used in YYY"),XM.forEach(t),Kf=l(hm,` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),hm.forEach(t),eu=d(W),h(Tt.$$.fragment,W),tu=d(W),h(Mt.$$.fragment,W),ou=d(W),hl=a(W,"UL",{});var YM=n(hl);Jn=a(YM,"LI",{});var LT=n(Jn);fl=a(LT,"CODE",{});var AM=n(fl);ru=l(AM,"low_cpu_mem_usage"),AM.forEach(t),au=l(LT," algorithm:"),LT.forEach(t),YM.forEach(t),nu=d(W),ul=a(W,"P",{});var qM=n(ul);su=l(qM,"This is an experimental function that loads the model using ~1x model size CPU memory"),qM.forEach(t),lu=d(W),gl=a(W,"P",{});var LM=n(gl);iu=l(LM,"Here is how it works:"),LM.forEach(t),du=d(W),A=a(W,"OL",{});var Ze=n(A);_l=a(Ze,"LI",{});var SM=n(_l);cu=l(SM,"save which state_dict keys we have"),SM.forEach(t),mu=d(Ze),bl=a(Ze,"LI",{});var HM=n(bl);pu=l(HM,"drop state_dict before the model is created, since the latter takes 1x model size CPU memory"),HM.forEach(t),hu=d(Ze),vl=a(Ze,"LI",{});var QM=n(vl);fu=l(QM,`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`),QM.forEach(t),uu=d(Ze),yl=a(Ze,"LI",{});var OM=n(yl);gu=l(OM,"load state_dict 2nd time"),OM.forEach(t),_u=d(Ze),wl=a(Ze,"LI",{});var KM=n(wl);bu=l(KM,"replace the params/buffers from the state_dict"),KM.forEach(t),Ze.forEach(t),vu=d(W),Tl=a(W,"P",{});var e1=n(Tl);yu=l(e1,"Currently, it can\u2019t handle deepspeed ZeRO stage 3 and ignores loading errors"),e1.forEach(t),W.forEach(t),wu=d(U),$t=a(U,"DIV",{class:!0});var fm=n($t);h(rr.$$.fragment,fm),Tu=d(fm),Ml=a(fm,"P",{});var t1=n(Ml);Mu=l(t1,"Returns the model\u2019s input embeddings."),t1.forEach(t),fm.forEach(t),$u=d(U),xt=a(U,"DIV",{class:!0});var um=n(xt);h(ar.$$.fragment,um),xu=d(um),Fn=a(um,"P",{});var ST=n(Fn);ku=l(ST,`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: `),nr=a(ST,"A",{href:!0,rel:!0});var o1=n(nr);Eu=l(o1,"https://discuss.pytorch.org/t/gpu-memory-that-model-uses/56822/2"),o1.forEach(t),ST.forEach(t),um.forEach(t),Pu=d(U),kt=a(U,"DIV",{class:!0});var gm=n(kt);h(sr.$$.fragment,gm),ju=d(gm),$l=a(gm,"P",{});var r1=n($l);Uu=l(r1,"Returns the model\u2019s output embeddings."),r1.forEach(t),gm.forEach(t),Ju=d(U),fe=a(U,"DIV",{class:!0});var Kn=n(fe);h(lr.$$.fragment,Kn),Fu=d(Kn),xl=a(Kn,"P",{});var a1=n(xl);Iu=l(a1,"Deactivates gradient checkpointing for the current model."),a1.forEach(t),Zu=d(Kn),kl=a(Kn,"P",{});var n1=n(kl);Cu=l(n1,`Note that in other frameworks this feature can be referred to as \u201Cactivation checkpointing\u201D or \u201Ccheckpoint
activations\u201D.`),n1.forEach(t),Kn.forEach(t),Wu=d(U),ue=a(U,"DIV",{class:!0});var es=n(ue);h(ir.$$.fragment,es),Gu=d(es),El=a(es,"P",{});var s1=n(El);zu=l(s1,"Activates gradient checkpointing for the current model."),s1.forEach(t),Bu=d(es),Pl=a(es,"P",{});var l1=n(Pl);Du=l(l1,`Note that in other frameworks this feature can be referred to as \u201Cactivation checkpointing\u201D or \u201Ccheckpoint
activations\u201D.`),l1.forEach(t),es.forEach(t),Nu=d(U),Et=a(U,"DIV",{class:!0});var _m=n(Et);h(dr.$$.fragment,_m),Ru=d(_m),Le=a(_m,"P",{});var ts=n(Le);Vu=l(ts,"If needed prunes and maybe initializes weights. If using a custom "),jl=a(ts,"CODE",{});var i1=n(jl);Xu=l(i1,"PreTrainedModel"),i1.forEach(t),Yu=l(ts,`, you need to implement any
initialization logic in `),Ul=a(ts,"CODE",{});var d1=n(Ul);Au=l(d1,"_init_weights"),d1.forEach(t),qu=l(ts,"."),ts.forEach(t),_m.forEach(t),Lu=d(U),Pt=a(U,"DIV",{class:!0});var bm=n(Pt);h(cr.$$.fragment,bm),Su=d(bm),Jl=a(bm,"P",{});var c1=n(Jl);Hu=l(c1,`A method executed at the end of each Transformer model initialization, to execute code that needs the model\u2019s
modules properly initialized (such as weight initialization).`),c1.forEach(t),bm.forEach(t),Qu=d(U),jt=a(U,"DIV",{class:!0});var vm=n(jt);h(mr.$$.fragment,vm),Ou=d(vm),Fl=a(vm,"P",{});var m1=n(Fl);Ku=l(m1,"Prunes heads of the base model."),m1.forEach(t),vm.forEach(t),eg=d(U),ge=a(U,"DIV",{class:!0});var os=n(ge);h(pr.$$.fragment,os),tg=d(os),Il=a(os,"P",{});var p1=n(Il);og=l(p1,`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.`),p1.forEach(t),rg=d(os),h(Ut.$$.fragment,os),os.forEach(t),ag=d(U),_e=a(U,"DIV",{class:!0});var rs=n(_e);h(hr.$$.fragment,rs),ng=d(rs),fr=a(rs,"P",{});var ym=n(fr);sg=l(ym,"Resizes input token embeddings matrix of the model if "),Zl=a(ym,"CODE",{});var h1=n(Zl);lg=l(h1,"new_num_tokens != config.vocab_size"),h1.forEach(t),ig=l(ym,"."),ym.forEach(t),dg=d(rs),ur=a(rs,"P",{});var wm=n(ur);cg=l(wm,"Takes care of tying weights embeddings afterwards if the model class has a "),Cl=a(wm,"CODE",{});var f1=n(Cl);mg=l(f1,"tie_weights()"),f1.forEach(t),pg=l(wm," method."),wm.forEach(t),rs.forEach(t),hg=d(U),Jt=a(U,"DIV",{class:!0});var Tm=n(Jt);h(gr.$$.fragment,Tm),fg=d(Tm),_r=a(Tm,"P",{});var Mm=n(_r);ug=l(Mm,"Reverts the transformation from "),In=a(Mm,"A",{href:!0});var u1=n(In);gg=l(u1,"to_bettertransformer()"),u1.forEach(t),_g=l(Mm,` so that the original modeling is
used, for example in order to save the model.`),Mm.forEach(t),Tm.forEach(t),bg=d(U),Ft=a(U,"DIV",{class:!0});var $m=n(Ft);h(br.$$.fragment,$m),vg=d($m),vr=a($m,"P",{});var xm=n(vr);yg=l(xm,`Save a model and its configuration file to a directory, so that it can be re-loaded using the
`),Zn=a(xm,"A",{href:!0});var g1=n(Zn);wg=l(g1,"from_pretrained()"),g1.forEach(t),Tg=l(xm," class method."),xm.forEach(t),$m.forEach(t),Mg=d(U),It=a(U,"DIV",{class:!0});var km=n(It);h(yr.$$.fragment,km),$g=d(km),Wl=a(km,"P",{});var _1=n(Wl);xg=l(_1,"Set model\u2019s input embeddings."),_1.forEach(t),km.forEach(t),kg=d(U),be=a(U,"DIV",{class:!0});var as=n(be);h(wr.$$.fragment,as),Eg=d(as),Gl=a(as,"P",{});var b1=n(Gl);Pg=l(b1,"Tie the weights between the input embeddings and the output embeddings."),b1.forEach(t),jg=d(as),Tr=a(as,"P",{});var Em=n(Tr);Ug=l(Em,"If the "),zl=a(Em,"CODE",{});var v1=n(zl);Jg=l(v1,"torchscript"),v1.forEach(t),Fg=l(Em,` flag is set in the configuration, can\u2019t handle parameter sharing so we are cloning the
weights instead.`),Em.forEach(t),as.forEach(t),Ig=d(U),ve=a(U,"DIV",{class:!0});var ns=n(ve);h(Mr.$$.fragment,ns),Zg=d(ns),Se=a(ns,"P",{});var ss=n(Se);Cg=l(ss,"Converts the model to use "),$r=a(ss,"A",{href:!0,rel:!0});var y1=n($r);Wg=l(y1,`PyTorch\u2019s native attention
implementation`),y1.forEach(t),Gg=l(ss,`, integrated to
Transformers through `),xr=a(ss,"A",{href:!0,rel:!0});var w1=n(xr);zg=l(w1,"Optimum library"),w1.forEach(t),Bg=l(ss,`. Only a
subset of all Transformers models are supported.`),ss.forEach(t),Dg=d(ns),He=a(ns,"P",{});var ls=n(He);Ng=l(ls,"PyTorch\u2019s attention fastpath allows to speed up inference through kernel fusions and the use of "),kr=a(ls,"A",{href:!0,rel:!0});var T1=n(kr);Rg=l(T1,`nested
tensors`),T1.forEach(t),Vg=l(ls,". Detailed benchmarks can be found in "),Er=a(ls,"A",{href:!0,rel:!0});var M1=n(Er);Xg=l(M1,`this blog
post`),M1.forEach(t),Yg=l(ls,"."),ls.forEach(t),ns.forEach(t),Ag=d(U),Zt=a(U,"DIV",{class:!0});var Pm=n(Zt);h(Pr.$$.fragment,Pm),qg=d(Pm),Bl=a(Pm,"P",{});var $1=n(Bl);Lg=l($1,"Shows a one-time warning if the input_ids appear to contain padding and no attention mask was given."),$1.forEach(t),Pm.forEach(t),U.forEach(t),Mc=d(o),Cn=a(o,"A",{id:!0}),n(Cn).forEach(t),$c=d(o),Qe=a(o,"H3",{class:!0});var jm=n(Qe);Ct=a(jm,"A",{id:!0,class:!0,href:!0});var x1=n(Ct);Dl=a(x1,"SPAN",{});var k1=n(Dl);h(jr.$$.fragment,k1),k1.forEach(t),x1.forEach(t),Sg=d(jm),Nl=a(jm,"SPAN",{});var E1=n(Nl);Hg=l(E1,"Large model loading"),E1.forEach(t),jm.forEach(t),xc=d(o),ye=a(o,"P",{});var is=n(ye);Qg=l(is,"In Transformers 4.20.0, the "),Wn=a(is,"A",{href:!0});var P1=n(Wn);Og=l(P1,"from_pretrained()"),P1.forEach(t),Kg=l(is," method has been reworked to accommodate large models using "),Ur=a(is,"A",{href:!0,rel:!0});var j1=n(Ur);e_=l(j1,"Accelerate"),j1.forEach(t),t_=l(is,". This requires Accelerate >= 0.9.0 and PyTorch >= 1.9.0. Instead of creating the full model, then loading the pretrained weights inside it (which takes twice the size of the model in RAM, one for the randomly initialized model, one for the weights), there is an option to create the model as an empty shell, then only materialize its parameters when the pretrained weights are loaded."),is.forEach(t),kc=d(o),Wt=a(o,"P",{});var Um=n(Wt);o_=l(Um,"This option can be activated with "),Rl=a(Um,"CODE",{});var U1=n(Rl);r_=l(U1,"low_cpu_mem_usage=True"),U1.forEach(t),a_=l(Um,". The model is first created on the Meta device (with empty weights) and the state dict is then loaded inside it (shard by shard in the case of a sharded checkpoint). This way the maximum RAM used is the full size of the model only."),Um.forEach(t),Ec=d(o),h(Jr.$$.fragment,o),Pc=d(o),Gt=a(o,"P",{});var Jm=n(Gt);n_=l(Jm,"Moreover, you can directly place the model on different devices if it doesn\u2019t fully fit in RAM (only works for inference for now). With "),Vl=a(Jm,"CODE",{});var J1=n(Vl);s_=l(J1,'device_map="auto"'),J1.forEach(t),l_=l(Jm,", Accelerate will determine where to put each layer to maximize the use of your fastest devices (GPUs) and offload the rest on the CPU, or even the hard drive if you don\u2019t have enough GPU RAM (or CPU RAM). Even if the model is split across several devices, it will run as you would normally expect."),Jm.forEach(t),jc=d(o),O=a(o,"P",{});var Bo=n(O);i_=l(Bo,"When passing a "),Xl=a(Bo,"CODE",{});var F1=n(Xl);d_=l(F1,"device_map"),F1.forEach(t),c_=l(Bo,", "),Yl=a(Bo,"CODE",{});var I1=n(Yl);m_=l(I1,"low_cpu_mem_usage"),I1.forEach(t),p_=l(Bo," is automatically set to "),Al=a(Bo,"CODE",{});var Z1=n(Al);h_=l(Z1,"True"),Z1.forEach(t),f_=l(Bo,", so you don\u2019t need to specify it:"),Bo.forEach(t),Uc=d(o),h(Fr.$$.fragment,o),Jc=d(o),zt=a(o,"P",{});var Fm=n(zt);u_=l(Fm,"You can inspect how the model was split across devices by looking at its "),ql=a(Fm,"CODE",{});var C1=n(ql);g_=l(C1,"hf_device_map"),C1.forEach(t),__=l(Fm," attribute:"),Fm.forEach(t),Fc=d(o),h(Ir.$$.fragment,o),Ic=d(o),h(Zr.$$.fragment,o),Zc=d(o),Gn=a(o,"P",{});var W1=n(Gn);b_=l(W1,"You can also write your own device map following the same format (a dictionary layer name to device). It should map all parameters of the model to a given device, but you don\u2019t have to detail where all the submodules of one layer go if that layer is entirely on the same device. For instance, the following device map would work properly for T0pp (as long as you have the GPU memory):"),W1.forEach(t),Cc=d(o),h(Cr.$$.fragment,o),Wc=d(o),Bt=a(o,"P",{});var Im=n(Bt);v_=l(Im,"Another way to minimize the memory impact of your model is to instantiate it at a lower precision dtype (like "),Ll=a(Im,"CODE",{});var G1=n(Ll);y_=l(G1,"torch.float16"),G1.forEach(t),w_=l(Im,") or use direct quantization techniques as described below."),Im.forEach(t),Gc=d(o),Oe=a(o,"H3",{class:!0});var Zm=n(Oe);Dt=a(Zm,"A",{id:!0,class:!0,href:!0});var z1=n(Dt);Sl=a(z1,"SPAN",{});var B1=n(Sl);h(Wr.$$.fragment,B1),B1.forEach(t),z1.forEach(t),T_=d(Zm),Hl=a(Zm,"SPAN",{});var D1=n(Hl);M_=l(D1,"Model Instantiation dtype"),D1.forEach(t),Zm.forEach(t),zc=d(o),K=a(o,"P",{});var Do=n(K);$_=l(Do,"Under Pytorch a model normally gets instantiated with "),Ql=a(Do,"CODE",{});var N1=n(Ql);x_=l(N1,"torch.float32"),N1.forEach(t),k_=l(Do,` format. This can be an issue if one tries to
load a model whose weights are in fp16, since it\u2019d require twice as much memory. To overcome this limitation, you can
either explicitly pass the desired `),Ol=a(Do,"CODE",{});var R1=n(Ol);E_=l(R1,"dtype"),R1.forEach(t),P_=l(Do," using "),Kl=a(Do,"CODE",{});var V1=n(Kl);j_=l(V1,"torch_dtype"),V1.forEach(t),U_=l(Do," argument:"),Do.forEach(t),Bc=d(o),h(Gr.$$.fragment,o),Dc=d(o),we=a(o,"P",{});var ds=n(we);J_=l(ds,"or, if you want the model to always load in the most optimal memory pattern, you can use the special value "),ei=a(ds,"CODE",{});var X1=n(ei);F_=l(X1,'"auto"'),X1.forEach(t),I_=l(ds,`,
and then `),ti=a(ds,"CODE",{});var Y1=n(ti);Z_=l(Y1,"dtype"),Y1.forEach(t),C_=l(ds," will be automatically derived from the model\u2019s weights:"),ds.forEach(t),Nc=d(o),h(zr.$$.fragment,o),Rc=d(o),Nt=a(o,"P",{});var Cm=n(Nt);W_=l(Cm,"Models instantiated from scratch can also be told which "),oi=a(Cm,"CODE",{});var A1=n(oi);G_=l(A1,"dtype"),A1.forEach(t),z_=l(Cm," to use with:"),Cm.forEach(t),Vc=d(o),h(Br.$$.fragment,o),Xc=d(o),zn=a(o,"P",{});var q1=n(zn);B_=l(q1,"Due to Pytorch design, this functionality is only available for floating dtypes."),q1.forEach(t),Yc=d(o),Ke=a(o,"H2",{class:!0});var Wm=n(Ke);Rt=a(Wm,"A",{id:!0,class:!0,href:!0});var L1=n(Rt);ri=a(L1,"SPAN",{});var S1=n(ri);h(Dr.$$.fragment,S1),S1.forEach(t),L1.forEach(t),D_=d(Wm),ai=a(Wm,"SPAN",{});var H1=n(ai);N_=l(H1,"ModuleUtilsMixin"),H1.forEach(t),Wm.forEach(t),Ac=d(o),C=a(o,"DIV",{class:!0});var G=n(C);h(Nr.$$.fragment,G),R_=d(G),Rr=a(G,"P",{});var Gm=n(Rr);V_=l(Gm,"A few utilities for "),ni=a(Gm,"CODE",{});var Q1=n(ni);X_=l(Q1,"torch.nn.Modules"),Q1.forEach(t),Y_=l(Gm,", to be used as a mixin."),Gm.forEach(t),A_=d(G),Te=a(G,"DIV",{class:!0});var cs=n(Te);h(Vr.$$.fragment,cs),q_=d(cs),si=a(cs,"P",{});var O1=n(si);L_=l(O1,"Add a memory hook before and after each sub-module forward pass to record increase in memory consumption."),O1.forEach(t),S_=d(cs),et=a(cs,"P",{});var ms=n(et);H_=l(ms,"Increase in memory consumption is stored in a "),li=a(ms,"CODE",{});var K1=n(li);Q_=l(K1,"mem_rss_diff"),K1.forEach(t),O_=l(ms,` attribute for each module and can be reset to zero
with `),ii=a(ms,"CODE",{});var e0=n(ii);K_=l(e0,"model.reset_memory_hooks_state()"),e0.forEach(t),eb=l(ms,"."),ms.forEach(t),cs.forEach(t),tb=d(G),Vt=a(G,"DIV",{class:!0});var zm=n(Vt);h(Xr.$$.fragment,zm),ob=d(zm),di=a(zm,"P",{});var t0=n(di);rb=l(t0,"Helper function to estimate the total number of tokens from the model inputs."),t0.forEach(t),zm.forEach(t),ab=d(G),Xt=a(G,"DIV",{class:!0});var Bm=n(Xt);h(Yr.$$.fragment,Bm),nb=d(Bm),tt=a(Bm,"P",{});var ps=n(tt);sb=l(ps,`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 `),ci=a(ps,"CODE",{});var o0=n(ci);lb=l(o0,"12 * d_model << sequence_length"),o0.forEach(t),ib=l(ps,") as laid out in "),Ar=a(ps,"A",{href:!0,rel:!0});var r0=n(Ar);db=l(r0,`this
paper`),r0.forEach(t),cb=l(ps,` 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.`),ps.forEach(t),Bm.forEach(t),mb=d(G),Yt=a(G,"DIV",{class:!0});var Dm=n(Yt);h(qr.$$.fragment,Dm),pb=d(Dm),mi=a(Dm,"P",{});var a0=n(mi);hb=l(a0,"Makes broadcastable attention and causal masks so that future and masked tokens are ignored."),a0.forEach(t),Dm.forEach(t),fb=d(G),At=a(G,"DIV",{class:!0});var Nm=n(At);h(Lr.$$.fragment,Nm),ub=d(Nm),pi=a(Nm,"P",{});var n0=n(pi);gb=l(n0,"Prepare the head mask if needed."),n0.forEach(t),Nm.forEach(t),_b=d(G),qt=a(G,"DIV",{class:!0});var Rm=n(qt);h(Sr.$$.fragment,Rm),bb=d(Rm),hi=a(Rm,"P",{});var s0=n(hi);vb=l(s0,"Invert an attention mask (e.g., switches 0. and 1.)."),s0.forEach(t),Rm.forEach(t),yb=d(G),Lt=a(G,"DIV",{class:!0});var Vm=n(Lt);h(Hr.$$.fragment,Vm),wb=d(Vm),fi=a(Vm,"P",{});var l0=n(fi);Tb=l(l0,"Get number of (optionally, trainable or non-embeddings) parameters in the module."),l0.forEach(t),Vm.forEach(t),Mb=d(G),St=a(G,"DIV",{class:!0});var Xm=n(St);h(Qr.$$.fragment,Xm),$b=d(Xm),ot=a(Xm,"P",{});var hs=n(ot);xb=l(hs,"Reset the "),ui=a(hs,"CODE",{});var i0=n(ui);kb=l(i0,"mem_rss_diff"),i0.forEach(t),Eb=l(hs," attribute of each module (see "),Bn=a(hs,"A",{href:!0});var d0=n(Bn);Pb=l(d0,"add_memory_hooks()"),d0.forEach(t),jb=l(hs,")."),hs.forEach(t),Xm.forEach(t),G.forEach(t),qc=d(o),rt=a(o,"H2",{class:!0});var Ym=n(rt);Ht=a(Ym,"A",{id:!0,class:!0,href:!0});var c0=n(Ht);gi=a(c0,"SPAN",{});var m0=n(gi);h(Or.$$.fragment,m0),m0.forEach(t),c0.forEach(t),Ub=d(Ym),_i=a(Ym,"SPAN",{});var p0=n(_i);Jb=l(p0,"TFPreTrainedModel"),p0.forEach(t),Ym.forEach(t),Lc=d(o),x=a(o,"DIV",{class:!0});var k=n(x);h(Kr.$$.fragment,k),Fb=d(k),bi=a(k,"P",{});var h0=n(bi);Ib=l(h0,"Base class for all TF models."),h0.forEach(t),Zb=d(k),Dn=a(k,"P",{});var HT=n(Dn);Nn=a(HT,"A",{href:!0});var f0=n(Nn);Cb=l(f0,"TFPreTrainedModel"),f0.forEach(t),Wb=l(HT,` 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:`),HT.forEach(t),Gb=d(k),ea=a(k,"UL",{});var Am=n(ea);vi=a(Am,"LI",{});var u0=n(vi);zb=l(u0,"resize the input embeddings,"),u0.forEach(t),Bb=d(Am),yi=a(Am,"LI",{});var g0=n(yi);Db=l(g0,"prune heads in the self-attention heads."),g0.forEach(t),Am.forEach(t),Nb=d(k),wi=a(k,"P",{});var _0=n(wi);Rb=l(_0,"Class attributes (overridden by derived classes):"),_0.forEach(t),Vb=d(k),at=a(k,"UL",{});var fs=n(at);Me=a(fs,"LI",{});var un=n(Me);Ti=a(un,"STRONG",{});var b0=n(Ti);Xb=l(b0,"config_class"),b0.forEach(t),Yb=l(un," ("),Rn=a(un,"A",{href:!0});var v0=n(Rn);Ab=l(v0,"PretrainedConfig"),v0.forEach(t),qb=l(un,") \u2014 A subclass of "),Vn=a(un,"A",{href:!0});var y0=n(Vn);Lb=l(y0,"PretrainedConfig"),y0.forEach(t),Sb=l(un,` to use as configuration class
for this model architecture.`),un.forEach(t),Hb=d(fs),Qt=a(fs,"LI",{});var uc=n(Qt);Mi=a(uc,"STRONG",{});var w0=n(Mi);Qb=l(w0,"base_model_prefix"),w0.forEach(t),Ob=l(uc," ("),$i=a(uc,"CODE",{});var T0=n($i);Kb=l(T0,"str"),T0.forEach(t),ev=l(uc,`) \u2014 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.`),uc.forEach(t),tv=d(fs),N=a(fs,"LI",{});var de=n(N);xi=a(de,"STRONG",{});var M0=n(xi);ov=l(M0,"main_input_name"),M0.forEach(t),rv=l(de," ("),ki=a(de,"CODE",{});var $0=n(ki);av=l($0,"str"),$0.forEach(t),nv=l(de,") \u2014 The name of the principal input to the model (often "),Ei=a(de,"CODE",{});var x0=n(Ei);sv=l(x0,"input_ids"),x0.forEach(t),lv=l(de,` for NLP
models, `),Pi=a(de,"CODE",{});var k0=n(Pi);iv=l(k0,"pixel_values"),k0.forEach(t),dv=l(de," for vision models and "),ji=a(de,"CODE",{});var E0=n(ji);cv=l(E0,"input_values"),E0.forEach(t),mv=l(de," for speech models)."),de.forEach(t),fs.forEach(t),pv=d(k),$e=a(k,"DIV",{class:!0});var us=n($e);h(ta.$$.fragment,us),hv=d(us),oa=a(us,"P",{});var qm=n(oa);fv=l(qm,"Upload the model files to the \u{1F917} Model Hub while synchronizing a local clone of the repo in "),Ui=a(qm,"CODE",{});var P0=n(Ui);uv=l(P0,"repo_path_or_name"),P0.forEach(t),gv=l(qm,"."),qm.forEach(t),_v=d(us),h(Ot.$$.fragment,us),us.forEach(t),bv=d(k),Kt=a(k,"DIV",{class:!0});var Lm=n(Kt);h(ra.$$.fragment,Lm),vv=d(Lm),aa=a(Lm,"P",{});var Sm=n(aa);yv=l(Sm,"Returns whether this model can generate sequences with "),Ji=a(Sm,"CODE",{});var j0=n(Ji);wv=l(j0,".generate()"),j0.forEach(t),Tv=l(Sm,"."),Sm.forEach(t),Lm.forEach(t),Mv=d(k),eo=a(k,"DIV",{class:!0});var Hm=n(eo);h(na.$$.fragment,Hm),$v=d(Hm),Fi=a(Hm,"P",{});var U0=n(Fi);xv=l(U0,`This is a thin wrapper that sets the model\u2019s loss output head as the loss if the user does not specify a loss
function themselves.`),U0.forEach(t),Hm.forEach(t),kv=d(k),to=a(k,"DIV",{class:!0});var Qm=n(to);h(sa.$$.fragment,Qm),Ev=d(Qm),la=a(Qm,"P",{});var Om=n(la);Pv=l(Om,"Creates a draft of a model card using the information available to the "),Ii=a(Om,"CODE",{});var J0=n(Ii);jv=l(J0,"Trainer"),J0.forEach(t),Uv=l(Om,"."),Om.forEach(t),Qm.forEach(t),Jv=d(k),oo=a(k,"DIV",{class:!0});var Km=n(oo);h(ia.$$.fragment,Km),Fv=d(Km),Zi=a(Km,"P",{});var F0=n(Zi);Iv=l(F0,"Method used for serving the model. This method is deprecated, and will be removed."),F0.forEach(t),Km.forEach(t),Zv=d(k),R=a(k,"DIV",{class:!0});var Ce=n(R);h(da.$$.fragment,Ce),Cv=d(Ce),Ci=a(Ce,"P",{});var I0=n(Ci);Wv=l(I0,"Instantiate a pretrained TF 2.0 model from a pre-trained model configuration."),I0.forEach(t),Gv=d(Ce),ca=a(Ce,"P",{});var ep=n(ca);zv=l(ep,"The warning "),Wi=a(ep,"EM",{});var Z0=n(Wi);Bv=l(Z0,"Weights from XXX not initialized from pretrained model"),Z0.forEach(t),Dv=l(ep,` 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.`),ep.forEach(t),Nv=d(Ce),ma=a(Ce,"P",{});var tp=n(ma);Rv=l(tp,"The warning "),Gi=a(tp,"EM",{});var C0=n(Gi);Vv=l(C0,"Weights from XXX not used in YYY"),C0.forEach(t),Xv=l(tp,` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),tp.forEach(t),Yv=d(Ce),h(ro.$$.fragment,Ce),Ce.forEach(t),Av=d(k),ao=a(k,"DIV",{class:!0});var op=n(ao);h(pa.$$.fragment,op),qv=d(op),zi=a(op,"P",{});var W0=n(zi);Lv=l(W0,"Dict of bias attached to an LM head. The key represents the name of the bias attribute."),W0.forEach(t),op.forEach(t),Sv=d(k),no=a(k,"DIV",{class:!0});var rp=n(no);h(ha.$$.fragment,rp),Hv=d(rp),Bi=a(rp,"P",{});var G0=n(Bi);Qv=l(G0,"Prepare the head mask if needed."),G0.forEach(t),rp.forEach(t),Ov=d(k),so=a(k,"DIV",{class:!0});var ap=n(so);h(fa.$$.fragment,ap),Kv=d(ap),Di=a(ap,"P",{});var z0=n(Di);ey=l(z0,"Returns the model\u2019s input embeddings layer."),z0.forEach(t),ap.forEach(t),ty=d(k),lo=a(k,"DIV",{class:!0});var np=n(lo);h(ua.$$.fragment,np),oy=d(np),Ni=a(np,"P",{});var B0=n(Ni);ry=l(B0,"The LM Head layer. This method must be overwritten by all the models that have a lm head."),B0.forEach(t),np.forEach(t),ay=d(k),io=a(k,"DIV",{class:!0});var sp=n(io);h(ga.$$.fragment,sp),ny=d(sp),Ri=a(sp,"P",{});var D0=n(Ri);sy=l(D0,"Returns the model\u2019s output embeddings"),D0.forEach(t),sp.forEach(t),ly=d(k),co=a(k,"DIV",{class:!0});var lp=n(co);h(_a.$$.fragment,lp),iy=d(lp),Vi=a(lp,"P",{});var N0=n(Vi);dy=l(N0,`Get the layer that handles a bias attribute in case the model has an LM head with weights tied to the
embeddings`),N0.forEach(t),lp.forEach(t),cy=d(k),mo=a(k,"DIV",{class:!0});var ip=n(mo);h(ba.$$.fragment,ip),my=d(ip),Xi=a(ip,"P",{});var R0=n(Xi);py=l(R0,"Get the concatenated _prefix name of the bias from the model name to the parent layer"),R0.forEach(t),ip.forEach(t),hy=d(k),po=a(k,"DIV",{class:!0});var dp=n(po);h(va.$$.fragment,dp),fy=d(dp),Yi=a(dp,"P",{});var V0=n(Yi);uy=l(V0,`Loads a saved checkpoint (model weights and optimizer state) from a repo. Returns the current epoch count when
the checkpoint was made.`),V0.forEach(t),dp.forEach(t),gy=d(k),ho=a(k,"DIV",{class:!0});var cp=n(ho);h(ya.$$.fragment,cp),_y=d(cp),q=a(cp,"P",{});var We=n(q);by=l(We,"Wraps a HuggingFace "),wa=a(We,"A",{href:!0,rel:!0});var X0=n(wa);vy=l(X0,"Dataset"),X0.forEach(t),yy=l(We," as a "),Ai=a(We,"CODE",{});var Y0=n(Ai);wy=l(Y0,"tf.data.Dataset"),Y0.forEach(t),Ty=l(We,` with collation and batching. This method is
designed to create a \u201Cready-to-use\u201D dataset that can be passed directly to Keras methods like `),qi=a(We,"CODE",{});var A0=n(qi);My=l(A0,"fit()"),A0.forEach(t),$y=l(We,` without
further modification. The method will drop columns from the dataset if they don\u2019t 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 `),Li=a(We,"CODE",{});var q0=n(Li);xy=l(q0,"Dataset.to_tf_dataset()"),q0.forEach(t),ky=l(We," instead."),We.forEach(t),cp.forEach(t),Ey=d(k),fo=a(k,"DIV",{class:!0});var mp=n(fo);h(Ta.$$.fragment,mp),Py=d(mp),Si=a(mp,"P",{});var L0=n(Si);jy=l(L0,"Prunes heads of the base model."),L0.forEach(t),mp.forEach(t),Uy=d(k),xe=a(k,"DIV",{class:!0});var gs=n(xe);h(Ma.$$.fragment,gs),Jy=d(gs),Hi=a(gs,"P",{});var S0=n(Hi);Fy=l(S0,`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.`),S0.forEach(t),Iy=d(gs),h(uo.$$.fragment,gs),gs.forEach(t),Zy=d(k),ke=a(k,"DIV",{class:!0});var _s=n(ke);h($a.$$.fragment,_s),Cy=d(_s),xa=a(_s,"P",{});var pp=n(xa);Wy=l(pp,"Resizes input token embeddings matrix of the model if "),Qi=a(pp,"CODE",{});var H0=n(Qi);Gy=l(H0,"new_num_tokens != config.vocab_size"),H0.forEach(t),zy=l(pp,"."),pp.forEach(t),By=d(_s),ka=a(_s,"P",{});var hp=n(ka);Dy=l(hp,"Takes care of tying weights embeddings afterwards if the model class has a "),Oi=a(hp,"CODE",{});var Q0=n(Oi);Ny=l(Q0,"tie_weights()"),Q0.forEach(t),Ry=l(hp," method."),hp.forEach(t),_s.forEach(t),Vy=d(k),go=a(k,"DIV",{class:!0});var fp=n(go);h(Ea.$$.fragment,fp),Xy=d(fp),Pa=a(fp,"P",{});var up=n(Pa);Yy=l(up,`Save a model and its configuration file to a directory, so that it can be re-loaded using the
`),Xn=a(up,"A",{href:!0});var O0=n(Xn);Ay=l(O0,"from_pretrained()"),O0.forEach(t),qy=l(up," class method."),up.forEach(t),fp.forEach(t),Ly=d(k),Yn=a(k,"DIV",{class:!0});var K0=n(Yn);h(ja.$$.fragment,K0),K0.forEach(t),Sy=d(k),_o=a(k,"DIV",{class:!0});var gp=n(_o);h(Ua.$$.fragment,gp),Hy=d(gp),Ki=a(gp,"P",{});var e$=n(Ki);Qy=l(e$,"Prepare the output of the saved model. Can be overridden if specific serving modifications are required."),e$.forEach(t),gp.forEach(t),Oy=d(k),bo=a(k,"DIV",{class:!0});var _p=n(bo);h(Ja.$$.fragment,_p),Ky=d(_p),ed=a(_p,"P",{});var t$=n(ed);ew=l(t$,"Set all the bias in the LM head."),t$.forEach(t),_p.forEach(t),tw=d(k),vo=a(k,"DIV",{class:!0});var bp=n(vo);h(Fa.$$.fragment,bp),ow=d(bp),td=a(bp,"P",{});var o$=n(td);rw=l(o$,"Set model\u2019s input embeddings"),o$.forEach(t),bp.forEach(t),aw=d(k),yo=a(k,"DIV",{class:!0});var vp=n(yo);h(Ia.$$.fragment,vp),nw=d(vp),od=a(vp,"P",{});var r$=n(od);sw=l(r$,"Set model\u2019s output embeddings"),r$.forEach(t),vp.forEach(t),lw=d(k),wo=a(k,"DIV",{class:!0});var yp=n(wo);h(Za.$$.fragment,yp),iw=d(yp),Ca=a(yp,"P",{});var wp=n(Ca);dw=l(wp,"A modification of Keras\u2019s default "),rd=a(wp,"CODE",{});var a$=n(rd);cw=l(a$,"train_step"),a$.forEach(t),mw=l(wp,` 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.`),wp.forEach(t),yp.forEach(t),pw=d(k),To=a(k,"DIV",{class:!0});var Tp=n(To);h(Wa.$$.fragment,Tp),hw=d(Tp),Ga=a(Tp,"P",{});var Mp=n(Ga);fw=l(Mp,"A modification of Keras\u2019s default "),ad=a(Mp,"CODE",{});var n$=n(ad);uw=l(n$,"train_step"),n$.forEach(t),gw=l(Mp,` 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.`),Mp.forEach(t),Tp.forEach(t),k.forEach(t),Sc=d(o),nt=a(o,"H2",{class:!0});var $p=n(nt);Mo=a($p,"A",{id:!0,class:!0,href:!0});var s$=n(Mo);nd=a(s$,"SPAN",{});var l$=n(nd);h(za.$$.fragment,l$),l$.forEach(t),s$.forEach(t),_w=d($p),sd=a($p,"SPAN",{});var i$=n(sd);bw=l(i$,"TFModelUtilsMixin"),i$.forEach(t),$p.forEach(t),Hc=d(o),re=a(o,"DIV",{class:!0});var bs=n(re);h(Ba.$$.fragment,bs),vw=d(bs),Da=a(bs,"P",{});var xp=n(Da);yw=l(xp,"A few utilities for "),ld=a(xp,"CODE",{});var d$=n(ld);ww=l(d$,"tf.keras.Model"),d$.forEach(t),Tw=l(xp,", to be used as a mixin."),xp.forEach(t),Mw=d(bs),$o=a(bs,"DIV",{class:!0});var kp=n($o);h(Na.$$.fragment,kp),$w=d(kp),id=a(kp,"P",{});var c$=n(id);xw=l(c$,"Get the number of (optionally, trainable) parameters in the model."),c$.forEach(t),kp.forEach(t),bs.forEach(t),Qc=d(o),st=a(o,"H2",{class:!0});var Ep=n(st);xo=a(Ep,"A",{id:!0,class:!0,href:!0});var m$=n(xo);dd=a(m$,"SPAN",{});var p$=n(dd);h(Ra.$$.fragment,p$),p$.forEach(t),m$.forEach(t),kw=d(Ep),cd=a(Ep,"SPAN",{});var h$=n(cd);Ew=l(h$,"FlaxPreTrainedModel"),h$.forEach(t),Ep.forEach(t),Oc=d(o),J=a(o,"DIV",{class:!0});var Z=n(J);h(Va.$$.fragment,Z),Pw=d(Z),md=a(Z,"P",{});var f$=n(md);jw=l(f$,"Base class for all models."),f$.forEach(t),Uw=d(Z),An=a(Z,"P",{});var QT=n(An);qn=a(QT,"A",{href:!0});var u$=n(qn);Jw=l(u$,"FlaxPreTrainedModel"),u$.forEach(t),Fw=l(QT,` takes care of storing the configuration of the models and handles methods for loading,
downloading and saving models.`),QT.forEach(t),Iw=d(Z),pd=a(Z,"P",{});var g$=n(pd);Zw=l(g$,"Class attributes (overridden by derived classes):"),g$.forEach(t),Cw=d(Z),lt=a(Z,"UL",{});var vs=n(lt);Ee=a(vs,"LI",{});var gn=n(Ee);hd=a(gn,"STRONG",{});var _$=n(hd);Ww=l(_$,"config_class"),_$.forEach(t),Gw=l(gn," ("),Ln=a(gn,"A",{href:!0});var b$=n(Ln);zw=l(b$,"PretrainedConfig"),b$.forEach(t),Bw=l(gn,") \u2014 A subclass of "),Sn=a(gn,"A",{href:!0});var v$=n(Sn);Dw=l(v$,"PretrainedConfig"),v$.forEach(t),Nw=l(gn,` to use as configuration class
for this model architecture.`),gn.forEach(t),Rw=d(vs),ko=a(vs,"LI",{});var gc=n(ko);fd=a(gc,"STRONG",{});var y$=n(fd);Vw=l(y$,"base_model_prefix"),y$.forEach(t),Xw=l(gc," ("),ud=a(gc,"CODE",{});var w$=n(ud);Yw=l(w$,"str"),w$.forEach(t),Aw=l(gc,`) \u2014 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.`),gc.forEach(t),qw=d(vs),V=a(vs,"LI",{});var ce=n(V);gd=a(ce,"STRONG",{});var T$=n(gd);Lw=l(T$,"main_input_name"),T$.forEach(t),Sw=l(ce," ("),_d=a(ce,"CODE",{});var M$=n(_d);Hw=l(M$,"str"),M$.forEach(t),Qw=l(ce,") \u2014 The name of the principal input to the model (often "),bd=a(ce,"CODE",{});var $$=n(bd);Ow=l($$,"input_ids"),$$.forEach(t),Kw=l(ce,` for NLP
models, `),vd=a(ce,"CODE",{});var x$=n(vd);e2=l(x$,"pixel_values"),x$.forEach(t),t2=l(ce," for vision models and "),yd=a(ce,"CODE",{});var k$=n(yd);o2=l(k$,"input_values"),k$.forEach(t),r2=l(ce," for speech models)."),ce.forEach(t),vs.forEach(t),a2=d(Z),Pe=a(Z,"DIV",{class:!0});var ys=n(Pe);h(Xa.$$.fragment,ys),n2=d(ys),wd=a(ys,"P",{});var E$=n(wd);s2=l(E$,"Upload the model checkpoint to the \u{1F917} Model Hub."),E$.forEach(t),l2=d(ys),h(Eo.$$.fragment,ys),ys.forEach(t),i2=d(Z),Po=a(Z,"DIV",{class:!0});var Pp=n(Po);h(Ya.$$.fragment,Pp),d2=d(Pp),ae=a(Pp,"P",{});var No=n(ae);c2=l(No,"Returns whether this model can generate sequences with "),Td=a(No,"CODE",{});var P$=n(Td);m2=l(P$,".generate()"),P$.forEach(t),p2=l(No,`. Returns:
`),Md=a(No,"CODE",{});var j$=n(Md);h2=l(j$,"bool"),j$.forEach(t),f2=l(No,": Whether this model can generate sequences with "),$d=a(No,"CODE",{});var U$=n($d);u2=l(U$,".generate()"),U$.forEach(t),g2=l(No,"."),No.forEach(t),Pp.forEach(t),_2=d(Z),X=a(Z,"DIV",{class:!0});var Ge=n(X);h(Aa.$$.fragment,Ge),b2=d(Ge),xd=a(Ge,"P",{});var J$=n(xd);v2=l(J$,"Instantiate a pretrained flax model from a pre-trained model configuration."),J$.forEach(t),y2=d(Ge),qa=a(Ge,"P",{});var jp=n(qa);w2=l(jp,"The warning "),kd=a(jp,"EM",{});var F$=n(kd);T2=l(F$,"Weights from XXX not initialized from pretrained model"),F$.forEach(t),M2=l(jp,` 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.`),jp.forEach(t),$2=d(Ge),La=a(Ge,"P",{});var Up=n(La);x2=l(Up,"The warning "),Ed=a(Up,"EM",{});var I$=n(Ed);k2=l(I$,"Weights from XXX not used in YYY"),I$.forEach(t),E2=l(Up,` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),Up.forEach(t),P2=d(Ge),h(jo.$$.fragment,Ge),Ge.forEach(t),j2=d(Z),je=a(Z,"DIV",{class:!0});var ws=n(je);h(Sa.$$.fragment,ws),U2=d(ws),Ha=a(ws,"P",{});var Jp=n(Ha);J2=l(Jp,"This is the same as "),Pd=a(Jp,"CODE",{});var Z$=n(Pd);F2=l(Z$,"flax.serialization.from_bytes"),Z$.forEach(t),I2=l(Jp,`
(https:lax.readthedocs.io/en/latest/_modules/flax/serialization.html#from_bytes) but for a sharded checkpoint.`),Jp.forEach(t),Z2=d(ws),jd=a(ws,"P",{});var C$=n(jd);C2=l(C$,`This load is performed efficiently: each checkpoint shard is loaded one by one in RAM and deleted after being
loaded in the model.`),C$.forEach(t),ws.forEach(t),W2=d(Z),Ue=a(Z,"DIV",{class:!0});var Ts=n(Ue);h(Qa.$$.fragment,Ts),G2=d(Ts),Ud=a(Ts,"P",{});var W$=n(Ud);z2=l(W$,`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.`),W$.forEach(t),B2=d(Ts),h(Uo.$$.fragment,Ts),Ts.forEach(t),D2=d(Z),Jo=a(Z,"DIV",{class:!0});var Fp=n(Jo);h(Oa.$$.fragment,Fp),N2=d(Fp),Ka=a(Fp,"P",{});var Ip=n(Ka);R2=l(Ip,`Save a model and its configuration file to a directory, so that it can be re-loaded using the
`),Jd=a(Ip,"CODE",{});var G$=n(Jd);V2=l(G$,"[from_pretrained()](/docs/transformers/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained)"),G$.forEach(t),X2=l(Ip," class method"),Ip.forEach(t),Fp.forEach(t),Y2=d(Z),ee=a(Z,"DIV",{class:!0});var Ro=n(ee);h(en.$$.fragment,Ro),A2=d(Ro),L=a(Ro,"P",{});var ze=n(L);q2=l(ze,"Cast the floating-point "),Fd=a(ze,"CODE",{});var z$=n(Fd);L2=l(z$,"params"),z$.forEach(t),S2=l(ze," to "),Id=a(ze,"CODE",{});var B$=n(Id);H2=l(B$,"jax.numpy.bfloat16"),B$.forEach(t),Q2=l(ze,". This returns a new "),Zd=a(ze,"CODE",{});var D$=n(Zd);O2=l(D$,"params"),D$.forEach(t),K2=l(ze,` tree and does not cast
the `),Cd=a(ze,"CODE",{});var N$=n(Cd);eT=l(N$,"params"),N$.forEach(t),tT=l(ze," in place."),ze.forEach(t),oT=d(Ro),Wd=a(Ro,"P",{});var R$=n(Wd);rT=l(R$,`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.`),R$.forEach(t),aT=d(Ro),h(Fo.$$.fragment,Ro),Ro.forEach(t),nT=d(Z),te=a(Z,"DIV",{class:!0});var Vo=n(te);h(tn.$$.fragment,Vo),sT=d(Vo),S=a(Vo,"P",{});var Be=n(S);lT=l(Be,"Cast the floating-point "),Gd=a(Be,"CODE",{});var V$=n(Gd);iT=l(V$,"parmas"),V$.forEach(t),dT=l(Be," to "),zd=a(Be,"CODE",{});var X$=n(zd);cT=l(X$,"jax.numpy.float16"),X$.forEach(t),mT=l(Be,". This returns a new "),Bd=a(Be,"CODE",{});var Y$=n(Bd);pT=l(Y$,"params"),Y$.forEach(t),hT=l(Be,` tree and does not cast the
`),Dd=a(Be,"CODE",{});var A$=n(Dd);fT=l(A$,"params"),A$.forEach(t),uT=l(Be," in place."),Be.forEach(t),gT=d(Vo),Nd=a(Vo,"P",{});var q$=n(Nd);_T=l(q$,`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.`),q$.forEach(t),bT=d(Vo),h(Io.$$.fragment,Vo),Vo.forEach(t),vT=d(Z),Je=a(Z,"DIV",{class:!0});var Ms=n(Je);h(on.$$.fragment,Ms),yT=d(Ms),H=a(Ms,"P",{});var De=n(H);wT=l(De,"Cast the floating-point "),Rd=a(De,"CODE",{});var L$=n(Rd);TT=l(L$,"parmas"),L$.forEach(t),MT=l(De," to "),Vd=a(De,"CODE",{});var S$=n(Vd);$T=l(S$,"jax.numpy.float32"),S$.forEach(t),xT=l(De,`. This method can be used to explicitly convert the
model parameters to fp32 precision. This returns a new `),Xd=a(De,"CODE",{});var H$=n(Xd);kT=l(H$,"params"),H$.forEach(t),ET=l(De," tree and does not cast the "),Yd=a(De,"CODE",{});var Q$=n(Yd);PT=l(Q$,"params"),Q$.forEach(t),jT=l(De," in place."),De.forEach(t),UT=d(Ms),h(Zo.$$.fragment,Ms),Ms.forEach(t),Z.forEach(t),Kc=d(o),it=a(o,"H2",{class:!0});var Zp=n(it);Co=a(Zp,"A",{id:!0,class:!0,href:!0});var O$=n(Co);Ad=a(O$,"SPAN",{});var K$=n(Ad);h(rn.$$.fragment,K$),K$.forEach(t),O$.forEach(t),JT=d(Zp),qd=a(Zp,"SPAN",{});var e3=n(qd);FT=l(e3,"Pushing to the Hub"),e3.forEach(t),Zp.forEach(t),em=d(o),ne=a(o,"DIV",{class:!0});var $s=n(ne);h(an.$$.fragment,$s),IT=d($s),Ld=a($s,"P",{});var t3=n(Ld);ZT=l(t3,"A Mixin containing the functionality to push a model or tokenizer to the hub."),t3.forEach(t),CT=d($s),Fe=a($s,"DIV",{class:!0});var xs=n(Fe);h(nn.$$.fragment,xs),WT=d(xs),Sd=a(xs,"P",{});var o3=n(Sd);GT=l(o3,"Upload the {object_files} to the \u{1F917} Model Hub."),o3.forEach(t),zT=d(xs),h(Wo.$$.fragment,xs),xs.forEach(t),$s.forEach(t),tm=d(o),dt=a(o,"H2",{class:!0});var Cp=n(dt);Go=a(Cp,"A",{id:!0,class:!0,href:!0});var r3=n(Go);Hd=a(r3,"SPAN",{});var a3=n(Hd);h(sn.$$.fragment,a3),a3.forEach(t),r3.forEach(t),BT=d(Cp),Qd=a(Cp,"SPAN",{});var n3=n(Qd);DT=l(n3,"Sharded checkpoints"),n3.forEach(t),Cp.forEach(t),om=d(o),se=a(o,"DIV",{class:!0});var ks=n(se);h(ln.$$.fragment,ks),NT=d(ks),dn=a(ks,"P",{});var Wp=n(dn);RT=l(Wp,`This is the same as
`),cn=a(Wp,"A",{href:!0,rel:!0});var s3=n(cn);Od=a(s3,"CODE",{});var l3=n(Od);VT=l(l3,"torch.nn.Module.load_state_dict"),l3.forEach(t),s3.forEach(t),XT=l(Wp,`
but for a sharded checkpoint.`),Wp.forEach(t),YT=d(ks),Kd=a(ks,"P",{});var i3=n(Kd);AT=l(i3,`This load is performed efficiently: each checkpoint shard is loaded one by one in RAM and deleted after being
loaded in the model.`),i3.forEach(t),ks.forEach(t),this.h()},h(){m(v,"name","hf:doc:metadata"),m(v,"content",JSON.stringify(j3)),m(y,"id","models"),m(y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(y,"href","#models"),m(T,"class","relative group"),m(_n,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),m(bn,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(vn,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(yn,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),m(wn,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(Tn,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.modeling_utils.ModuleUtilsMixin"),m(Mn,"href","/docs/transformers/v4.33.0/en/main_classes/text_generation#transformers.GenerationMixin"),m($n,"href","/docs/transformers/v4.33.0/en/main_classes/text_generation#transformers.TFGenerationMixin"),m(xn,"href","/docs/transformers/v4.33.0/en/main_classes/text_generation#transformers.FlaxGenerationMixin"),m(pt,"id","transformers.PreTrainedModel"),m(pt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(pt,"href","#transformers.PreTrainedModel"),m(Ye,"class","relative group"),m(En,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),m(Pn,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),m(jn,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),m(Un,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),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(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(I,"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(nr,"href","https://discuss.pytorch.org/t/gpu-memory-that-model-uses/56822/2"),m(nr,"rel","nofollow"),m(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(kt,"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(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(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(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(jt,"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(_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(In,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.to_bettertransformer"),m(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Zn,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained"),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(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(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($r,"href","https://pytorch.org/docs/stable/generated/torch.nn.MultiheadAttention.html"),m($r,"rel","nofollow"),m(xr,"href","https://huggingface.co/docs/optimum/bettertransformer/overview"),m(xr,"rel","nofollow"),m(kr,"href","https://pytorch.org/docs/stable/nested.html"),m(kr,"rel","nofollow"),m(Er,"href","https://medium.com/pytorch/bettertransformer-out-of-the-box-performance-for-huggingface-transformers-3fbe27d50ab2"),m(Er,"rel","nofollow"),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(Zt,"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(Cn,"id","from_pretrained-torch-dtype"),m(Ct,"id","large-model-loading"),m(Ct,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Ct,"href","#large-model-loading"),m(Qe,"class","relative group"),m(Wn,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained"),m(Ur,"href","https://huggingface.co/docs/accelerate/big_modeling"),m(Ur,"rel","nofollow"),m(Dt,"id","model-instantiation-dtype"),m(Dt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Dt,"href","#model-instantiation-dtype"),m(Oe,"class","relative group"),m(Rt,"id","transformers.modeling_utils.ModuleUtilsMixin"),m(Rt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Rt,"href","#transformers.modeling_utils.ModuleUtilsMixin"),m(Ke,"class","relative group"),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(Vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ar,"href","https://arxiv.org/pdf/2001.08361.pdf"),m(Ar,"rel","nofollow"),m(Xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Yt,"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(qt,"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(Bn,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.modeling_utils.ModuleUtilsMixin.add_memory_hooks"),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(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ht,"id","transformers.TFPreTrainedModel"),m(Ht,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Ht,"href","#transformers.TFPreTrainedModel"),m(rt,"class","relative group"),m(Nn,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(Rn,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),m(Vn,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),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(Kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(eo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(to,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(oo,"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(ao,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(no,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(so,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(io,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(co,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(mo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(po,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(wa,"href","https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset"),m(wa,"rel","nofollow"),m(ho,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(fo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(xe,"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(Xn,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained"),m(go,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Yn,"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(bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(yo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(wo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(To,"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(Mo,"id","transformers.modeling_tf_utils.TFModelUtilsMixin"),m(Mo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Mo,"href","#transformers.modeling_tf_utils.TFModelUtilsMixin"),m(nt,"class","relative group"),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(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(xo,"id","transformers.FlaxPreTrainedModel"),m(xo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(xo,"href","#transformers.FlaxPreTrainedModel"),m(st,"class","relative group"),m(qn,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(Ln,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),m(Sn,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),m(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Po,"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(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(Jo,"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(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(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(Co,"id","transformers.utils.PushToHubMixin"),m(Co,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Co,"href","#transformers.utils.PushToHubMixin"),m(it,"class","relative group"),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(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(Go,"id","transformers.modeling_utils.load_sharded_checkpoint"),m(Go,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Go,"href","#transformers.modeling_utils.load_sharded_checkpoint"),m(dt,"class","relative group"),m(cn,"href","https://pytorch.org/docs/stable/generated/torch.nn.Module.html?highlight=load_state_dict#torch.nn.Module.load_state_dict"),m(cn,"rel","nofollow"),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(o,b){e(document.head,v),w(o,E,b),w(o,T,b),e(T,y),e(y,P),f(c,P,null),e(T,M),e(T,ct),e(ct,zp),w(o,_c,b),w(o,Q,b),e(Q,Bp),e(Q,_n),e(_n,Dp),e(Q,Np),e(Q,bn),e(bn,Rp),e(Q,Vp),e(Q,vn),e(vn,Xp),e(Q,Yp),w(o,bc,b),w(o,Xe,b),e(Xe,yn),e(yn,Ap),e(Xe,qp),e(Xe,wn),e(wn,Lp),e(Xe,Sp),w(o,vc,b),w(o,mt,b),e(mt,Es),e(Es,Hp),e(mt,Qp),e(mt,Ps),e(Ps,Op),w(o,yc,b),w(o,B,b),e(B,Kp),e(B,Tn),e(Tn,eh),e(B,th),e(B,js),e(js,oh),e(B,rh),e(B,Mn),e(Mn,ah),e(B,nh),e(B,$n),e($n,sh),e(B,lh),e(B,xn),e(xn,ih),e(B,dh),w(o,wc,b),w(o,Ye,b),e(Ye,pt),e(pt,Us),f(Xo,Us,null),e(Ye,ch),e(Ye,Js),e(Js,mh),w(o,Tc,b),w(o,j,b),f(Yo,j,null),e(j,ph),e(j,Fs),e(Fs,hh),e(j,fh),e(j,kn),e(kn,En),e(En,uh),e(kn,gh),e(j,_h),e(j,Ao),e(Ao,Is),e(Is,bh),e(Ao,vh),e(Ao,Zs),e(Zs,yh),e(j,wh),e(j,Cs),e(Cs,Th),e(j,Mh),e(j,Y),e(Y,Ws),e(Ws,me),e(me,Gs),e(Gs,$h),e(me,xh),e(me,Pn),e(Pn,kh),e(me,Eh),e(me,jn),e(jn,Ph),e(me,jh),e(Y,Uh),e(Y,qo),e(qo,pe),e(pe,zs),e(zs,Jh),e(pe,Fh),e(pe,Bs),e(Bs,Ih),e(pe,Zh),e(pe,Ds),e(Ds,Ch),e(pe,Wh),e(qo,Gh),e(qo,Ae),e(Ae,ht),e(ht,Ns),e(Ns,zh),e(ht,Bh),e(ht,Un),e(Un,Dh),e(ht,Nh),e(Ae,Rh),e(Ae,ft),e(ft,Rs),e(Rs,Vh),e(ft,Xh),e(ft,Vs),e(Vs,Yh),e(ft,Ah),e(Ae,qh),e(Ae,ut),e(ut,Xs),e(Xs,Lh),e(ut,Sh),e(ut,Ys),e(Ys,Hh),e(ut,Qh),e(Y,Oh),e(Y,As),e(As,gt),e(gt,qs),e(qs,Kh),e(gt,ef),e(gt,Ls),e(Ls,tf),e(gt,of),e(Y,rf),e(Y,Ss),e(Ss,_t),e(_t,Hs),e(Hs,af),e(_t,nf),e(_t,Qs),e(Qs,sf),e(_t,lf),e(Y,df),e(Y,Os),e(Os,D),e(D,Ks),e(Ks,cf),e(D,mf),e(D,el),e(el,pf),e(D,hf),e(D,tl),e(tl,ff),e(D,uf),e(D,ol),e(ol,gf),e(D,_f),e(D,rl),e(rl,bf),e(D,vf),e(j,yf),e(j,he),f(Lo,he,null),e(he,wf),e(he,al),e(al,Tf),e(he,Mf),f(bt,he,null),e(j,$f),e(j,vt),f(So,vt,null),e(vt,xf),e(vt,Ho),e(Ho,kf),e(Ho,nl),e(nl,Ef),e(Ho,Pf),e(j,jf),e(j,yt),f(Qo,yt,null),e(yt,Uf),e(yt,Oo),e(Oo,Jf),e(Oo,sl),e(sl,Ff),e(Oo,If),e(j,Zf),e(j,wt),f(Ko,wt,null),e(wt,Cf),e(wt,ll),e(ll,Wf),e(j,Gf),e(j,I),f(er,I,null),e(I,zf),e(I,il),e(il,Bf),e(I,Df),e(I,qe),e(qe,Nf),e(qe,dl),e(dl,Rf),e(qe,Vf),e(qe,cl),e(cl,Xf),e(qe,Yf),e(I,Af),e(I,tr),e(tr,qf),e(tr,ml),e(ml,Lf),e(tr,Sf),e(I,Hf),e(I,or),e(or,Qf),e(or,pl),e(pl,Of),e(or,Kf),e(I,eu),f(Tt,I,null),e(I,tu),f(Mt,I,null),e(I,ou),e(I,hl),e(hl,Jn),e(Jn,fl),e(fl,ru),e(Jn,au),e(I,nu),e(I,ul),e(ul,su),e(I,lu),e(I,gl),e(gl,iu),e(I,du),e(I,A),e(A,_l),e(_l,cu),e(A,mu),e(A,bl),e(bl,pu),e(A,hu),e(A,vl),e(vl,fu),e(A,uu),e(A,yl),e(yl,gu),e(A,_u),e(A,wl),e(wl,bu),e(I,vu),e(I,Tl),e(Tl,yu),e(j,wu),e(j,$t),f(rr,$t,null),e($t,Tu),e($t,Ml),e(Ml,Mu),e(j,$u),e(j,xt),f(ar,xt,null),e(xt,xu),e(xt,Fn),e(Fn,ku),e(Fn,nr),e(nr,Eu),e(j,Pu),e(j,kt),f(sr,kt,null),e(kt,ju),e(kt,$l),e($l,Uu),e(j,Ju),e(j,fe),f(lr,fe,null),e(fe,Fu),e(fe,xl),e(xl,Iu),e(fe,Zu),e(fe,kl),e(kl,Cu),e(j,Wu),e(j,ue),f(ir,ue,null),e(ue,Gu),e(ue,El),e(El,zu),e(ue,Bu),e(ue,Pl),e(Pl,Du),e(j,Nu),e(j,Et),f(dr,Et,null),e(Et,Ru),e(Et,Le),e(Le,Vu),e(Le,jl),e(jl,Xu),e(Le,Yu),e(Le,Ul),e(Ul,Au),e(Le,qu),e(j,Lu),e(j,Pt),f(cr,Pt,null),e(Pt,Su),e(Pt,Jl),e(Jl,Hu),e(j,Qu),e(j,jt),f(mr,jt,null),e(jt,Ou),e(jt,Fl),e(Fl,Ku),e(j,eg),e(j,ge),f(pr,ge,null),e(ge,tg),e(ge,Il),e(Il,og),e(ge,rg),f(Ut,ge,null),e(j,ag),e(j,_e),f(hr,_e,null),e(_e,ng),e(_e,fr),e(fr,sg),e(fr,Zl),e(Zl,lg),e(fr,ig),e(_e,dg),e(_e,ur),e(ur,cg),e(ur,Cl),e(Cl,mg),e(ur,pg),e(j,hg),e(j,Jt),f(gr,Jt,null),e(Jt,fg),e(Jt,_r),e(_r,ug),e(_r,In),e(In,gg),e(_r,_g),e(j,bg),e(j,Ft),f(br,Ft,null),e(Ft,vg),e(Ft,vr),e(vr,yg),e(vr,Zn),e(Zn,wg),e(vr,Tg),e(j,Mg),e(j,It),f(yr,It,null),e(It,$g),e(It,Wl),e(Wl,xg),e(j,kg),e(j,be),f(wr,be,null),e(be,Eg),e(be,Gl),e(Gl,Pg),e(be,jg),e(be,Tr),e(Tr,Ug),e(Tr,zl),e(zl,Jg),e(Tr,Fg),e(j,Ig),e(j,ve),f(Mr,ve,null),e(ve,Zg),e(ve,Se),e(Se,Cg),e(Se,$r),e($r,Wg),e(Se,Gg),e(Se,xr),e(xr,zg),e(Se,Bg),e(ve,Dg),e(ve,He),e(He,Ng),e(He,kr),e(kr,Rg),e(He,Vg),e(He,Er),e(Er,Xg),e(He,Yg),e(j,Ag),e(j,Zt),f(Pr,Zt,null),e(Zt,qg),e(Zt,Bl),e(Bl,Lg),w(o,Mc,b),w(o,Cn,b),w(o,$c,b),w(o,Qe,b),e(Qe,Ct),e(Ct,Dl),f(jr,Dl,null),e(Qe,Sg),e(Qe,Nl),e(Nl,Hg),w(o,xc,b),w(o,ye,b),e(ye,Qg),e(ye,Wn),e(Wn,Og),e(ye,Kg),e(ye,Ur),e(Ur,e_),e(ye,t_),w(o,kc,b),w(o,Wt,b),e(Wt,o_),e(Wt,Rl),e(Rl,r_),e(Wt,a_),w(o,Ec,b),f(Jr,o,b),w(o,Pc,b),w(o,Gt,b),e(Gt,n_),e(Gt,Vl),e(Vl,s_),e(Gt,l_),w(o,jc,b),w(o,O,b),e(O,i_),e(O,Xl),e(Xl,d_),e(O,c_),e(O,Yl),e(Yl,m_),e(O,p_),e(O,Al),e(Al,h_),e(O,f_),w(o,Uc,b),f(Fr,o,b),w(o,Jc,b),w(o,zt,b),e(zt,u_),e(zt,ql),e(ql,g_),e(zt,__),w(o,Fc,b),f(Ir,o,b),w(o,Ic,b),f(Zr,o,b),w(o,Zc,b),w(o,Gn,b),e(Gn,b_),w(o,Cc,b),f(Cr,o,b),w(o,Wc,b),w(o,Bt,b),e(Bt,v_),e(Bt,Ll),e(Ll,y_),e(Bt,w_),w(o,Gc,b),w(o,Oe,b),e(Oe,Dt),e(Dt,Sl),f(Wr,Sl,null),e(Oe,T_),e(Oe,Hl),e(Hl,M_),w(o,zc,b),w(o,K,b),e(K,$_),e(K,Ql),e(Ql,x_),e(K,k_),e(K,Ol),e(Ol,E_),e(K,P_),e(K,Kl),e(Kl,j_),e(K,U_),w(o,Bc,b),f(Gr,o,b),w(o,Dc,b),w(o,we,b),e(we,J_),e(we,ei),e(ei,F_),e(we,I_),e(we,ti),e(ti,Z_),e(we,C_),w(o,Nc,b),f(zr,o,b),w(o,Rc,b),w(o,Nt,b),e(Nt,W_),e(Nt,oi),e(oi,G_),e(Nt,z_),w(o,Vc,b),f(Br,o,b),w(o,Xc,b),w(o,zn,b),e(zn,B_),w(o,Yc,b),w(o,Ke,b),e(Ke,Rt),e(Rt,ri),f(Dr,ri,null),e(Ke,D_),e(Ke,ai),e(ai,N_),w(o,Ac,b),w(o,C,b),f(Nr,C,null),e(C,R_),e(C,Rr),e(Rr,V_),e(Rr,ni),e(ni,X_),e(Rr,Y_),e(C,A_),e(C,Te),f(Vr,Te,null),e(Te,q_),e(Te,si),e(si,L_),e(Te,S_),e(Te,et),e(et,H_),e(et,li),e(li,Q_),e(et,O_),e(et,ii),e(ii,K_),e(et,eb),e(C,tb),e(C,Vt),f(Xr,Vt,null),e(Vt,ob),e(Vt,di),e(di,rb),e(C,ab),e(C,Xt),f(Yr,Xt,null),e(Xt,nb),e(Xt,tt),e(tt,sb),e(tt,ci),e(ci,lb),e(tt,ib),e(tt,Ar),e(Ar,db),e(tt,cb),e(C,mb),e(C,Yt),f(qr,Yt,null),e(Yt,pb),e(Yt,mi),e(mi,hb),e(C,fb),e(C,At),f(Lr,At,null),e(At,ub),e(At,pi),e(pi,gb),e(C,_b),e(C,qt),f(Sr,qt,null),e(qt,bb),e(qt,hi),e(hi,vb),e(C,yb),e(C,Lt),f(Hr,Lt,null),e(Lt,wb),e(Lt,fi),e(fi,Tb),e(C,Mb),e(C,St),f(Qr,St,null),e(St,$b),e(St,ot),e(ot,xb),e(ot,ui),e(ui,kb),e(ot,Eb),e(ot,Bn),e(Bn,Pb),e(ot,jb),w(o,qc,b),w(o,rt,b),e(rt,Ht),e(Ht,gi),f(Or,gi,null),e(rt,Ub),e(rt,_i),e(_i,Jb),w(o,Lc,b),w(o,x,b),f(Kr,x,null),e(x,Fb),e(x,bi),e(bi,Ib),e(x,Zb),e(x,Dn),e(Dn,Nn),e(Nn,Cb),e(Dn,Wb),e(x,Gb),e(x,ea),e(ea,vi),e(vi,zb),e(ea,Bb),e(ea,yi),e(yi,Db),e(x,Nb),e(x,wi),e(wi,Rb),e(x,Vb),e(x,at),e(at,Me),e(Me,Ti),e(Ti,Xb),e(Me,Yb),e(Me,Rn),e(Rn,Ab),e(Me,qb),e(Me,Vn),e(Vn,Lb),e(Me,Sb),e(at,Hb),e(at,Qt),e(Qt,Mi),e(Mi,Qb),e(Qt,Ob),e(Qt,$i),e($i,Kb),e(Qt,ev),e(at,tv),e(at,N),e(N,xi),e(xi,ov),e(N,rv),e(N,ki),e(ki,av),e(N,nv),e(N,Ei),e(Ei,sv),e(N,lv),e(N,Pi),e(Pi,iv),e(N,dv),e(N,ji),e(ji,cv),e(N,mv),e(x,pv),e(x,$e),f(ta,$e,null),e($e,hv),e($e,oa),e(oa,fv),e(oa,Ui),e(Ui,uv),e(oa,gv),e($e,_v),f(Ot,$e,null),e(x,bv),e(x,Kt),f(ra,Kt,null),e(Kt,vv),e(Kt,aa),e(aa,yv),e(aa,Ji),e(Ji,wv),e(aa,Tv),e(x,Mv),e(x,eo),f(na,eo,null),e(eo,$v),e(eo,Fi),e(Fi,xv),e(x,kv),e(x,to),f(sa,to,null),e(to,Ev),e(to,la),e(la,Pv),e(la,Ii),e(Ii,jv),e(la,Uv),e(x,Jv),e(x,oo),f(ia,oo,null),e(oo,Fv),e(oo,Zi),e(Zi,Iv),e(x,Zv),e(x,R),f(da,R,null),e(R,Cv),e(R,Ci),e(Ci,Wv),e(R,Gv),e(R,ca),e(ca,zv),e(ca,Wi),e(Wi,Bv),e(ca,Dv),e(R,Nv),e(R,ma),e(ma,Rv),e(ma,Gi),e(Gi,Vv),e(ma,Xv),e(R,Yv),f(ro,R,null),e(x,Av),e(x,ao),f(pa,ao,null),e(ao,qv),e(ao,zi),e(zi,Lv),e(x,Sv),e(x,no),f(ha,no,null),e(no,Hv),e(no,Bi),e(Bi,Qv),e(x,Ov),e(x,so),f(fa,so,null),e(so,Kv),e(so,Di),e(Di,ey),e(x,ty),e(x,lo),f(ua,lo,null),e(lo,oy),e(lo,Ni),e(Ni,ry),e(x,ay),e(x,io),f(ga,io,null),e(io,ny),e(io,Ri),e(Ri,sy),e(x,ly),e(x,co),f(_a,co,null),e(co,iy),e(co,Vi),e(Vi,dy),e(x,cy),e(x,mo),f(ba,mo,null),e(mo,my),e(mo,Xi),e(Xi,py),e(x,hy),e(x,po),f(va,po,null),e(po,fy),e(po,Yi),e(Yi,uy),e(x,gy),e(x,ho),f(ya,ho,null),e(ho,_y),e(ho,q),e(q,by),e(q,wa),e(wa,vy),e(q,yy),e(q,Ai),e(Ai,wy),e(q,Ty),e(q,qi),e(qi,My),e(q,$y),e(q,Li),e(Li,xy),e(q,ky),e(x,Ey),e(x,fo),f(Ta,fo,null),e(fo,Py),e(fo,Si),e(Si,jy),e(x,Uy),e(x,xe),f(Ma,xe,null),e(xe,Jy),e(xe,Hi),e(Hi,Fy),e(xe,Iy),f(uo,xe,null),e(x,Zy),e(x,ke),f($a,ke,null),e(ke,Cy),e(ke,xa),e(xa,Wy),e(xa,Qi),e(Qi,Gy),e(xa,zy),e(ke,By),e(ke,ka),e(ka,Dy),e(ka,Oi),e(Oi,Ny),e(ka,Ry),e(x,Vy),e(x,go),f(Ea,go,null),e(go,Xy),e(go,Pa),e(Pa,Yy),e(Pa,Xn),e(Xn,Ay),e(Pa,qy),e(x,Ly),e(x,Yn),f(ja,Yn,null),e(x,Sy),e(x,_o),f(Ua,_o,null),e(_o,Hy),e(_o,Ki),e(Ki,Qy),e(x,Oy),e(x,bo),f(Ja,bo,null),e(bo,Ky),e(bo,ed),e(ed,ew),e(x,tw),e(x,vo),f(Fa,vo,null),e(vo,ow),e(vo,td),e(td,rw),e(x,aw),e(x,yo),f(Ia,yo,null),e(yo,nw),e(yo,od),e(od,sw),e(x,lw),e(x,wo),f(Za,wo,null),e(wo,iw),e(wo,Ca),e(Ca,dw),e(Ca,rd),e(rd,cw),e(Ca,mw),e(x,pw),e(x,To),f(Wa,To,null),e(To,hw),e(To,Ga),e(Ga,fw),e(Ga,ad),e(ad,uw),e(Ga,gw),w(o,Sc,b),w(o,nt,b),e(nt,Mo),e(Mo,nd),f(za,nd,null),e(nt,_w),e(nt,sd),e(sd,bw),w(o,Hc,b),w(o,re,b),f(Ba,re,null),e(re,vw),e(re,Da),e(Da,yw),e(Da,ld),e(ld,ww),e(Da,Tw),e(re,Mw),e(re,$o),f(Na,$o,null),e($o,$w),e($o,id),e(id,xw),w(o,Qc,b),w(o,st,b),e(st,xo),e(xo,dd),f(Ra,dd,null),e(st,kw),e(st,cd),e(cd,Ew),w(o,Oc,b),w(o,J,b),f(Va,J,null),e(J,Pw),e(J,md),e(md,jw),e(J,Uw),e(J,An),e(An,qn),e(qn,Jw),e(An,Fw),e(J,Iw),e(J,pd),e(pd,Zw),e(J,Cw),e(J,lt),e(lt,Ee),e(Ee,hd),e(hd,Ww),e(Ee,Gw),e(Ee,Ln),e(Ln,zw),e(Ee,Bw),e(Ee,Sn),e(Sn,Dw),e(Ee,Nw),e(lt,Rw),e(lt,ko),e(ko,fd),e(fd,Vw),e(ko,Xw),e(ko,ud),e(ud,Yw),e(ko,Aw),e(lt,qw),e(lt,V),e(V,gd),e(gd,Lw),e(V,Sw),e(V,_d),e(_d,Hw),e(V,Qw),e(V,bd),e(bd,Ow),e(V,Kw),e(V,vd),e(vd,e2),e(V,t2),e(V,yd),e(yd,o2),e(V,r2),e(J,a2),e(J,Pe),f(Xa,Pe,null),e(Pe,n2),e(Pe,wd),e(wd,s2),e(Pe,l2),f(Eo,Pe,null),e(J,i2),e(J,Po),f(Ya,Po,null),e(Po,d2),e(Po,ae),e(ae,c2),e(ae,Td),e(Td,m2),e(ae,p2),e(ae,Md),e(Md,h2),e(ae,f2),e(ae,$d),e($d,u2),e(ae,g2),e(J,_2),e(J,X),f(Aa,X,null),e(X,b2),e(X,xd),e(xd,v2),e(X,y2),e(X,qa),e(qa,w2),e(qa,kd),e(kd,T2),e(qa,M2),e(X,$2),e(X,La),e(La,x2),e(La,Ed),e(Ed,k2),e(La,E2),e(X,P2),f(jo,X,null),e(J,j2),e(J,je),f(Sa,je,null),e(je,U2),e(je,Ha),e(Ha,J2),e(Ha,Pd),e(Pd,F2),e(Ha,I2),e(je,Z2),e(je,jd),e(jd,C2),e(J,W2),e(J,Ue),f(Qa,Ue,null),e(Ue,G2),e(Ue,Ud),e(Ud,z2),e(Ue,B2),f(Uo,Ue,null),e(J,D2),e(J,Jo),f(Oa,Jo,null),e(Jo,N2),e(Jo,Ka),e(Ka,R2),e(Ka,Jd),e(Jd,V2),e(Ka,X2),e(J,Y2),e(J,ee),f(en,ee,null),e(ee,A2),e(ee,L),e(L,q2),e(L,Fd),e(Fd,L2),e(L,S2),e(L,Id),e(Id,H2),e(L,Q2),e(L,Zd),e(Zd,O2),e(L,K2),e(L,Cd),e(Cd,eT),e(L,tT),e(ee,oT),e(ee,Wd),e(Wd,rT),e(ee,aT),f(Fo,ee,null),e(J,nT),e(J,te),f(tn,te,null),e(te,sT),e(te,S),e(S,lT),e(S,Gd),e(Gd,iT),e(S,dT),e(S,zd),e(zd,cT),e(S,mT),e(S,Bd),e(Bd,pT),e(S,hT),e(S,Dd),e(Dd,fT),e(S,uT),e(te,gT),e(te,Nd),e(Nd,_T),e(te,bT),f(Io,te,null),e(J,vT),e(J,Je),f(on,Je,null),e(Je,yT),e(Je,H),e(H,wT),e(H,Rd),e(Rd,TT),e(H,MT),e(H,Vd),e(Vd,$T),e(H,xT),e(H,Xd),e(Xd,kT),e(H,ET),e(H,Yd),e(Yd,PT),e(H,jT),e(Je,UT),f(Zo,Je,null),w(o,Kc,b),w(o,it,b),e(it,Co),e(Co,Ad),f(rn,Ad,null),e(it,JT),e(it,qd),e(qd,FT),w(o,em,b),w(o,ne,b),f(an,ne,null),e(ne,IT),e(ne,Ld),e(Ld,ZT),e(ne,CT),e(ne,Fe),f(nn,Fe,null),e(Fe,WT),e(Fe,Sd),e(Sd,GT),e(Fe,zT),f(Wo,Fe,null),w(o,tm,b),w(o,dt,b),e(dt,Go),e(Go,Hd),f(sn,Hd,null),e(dt,BT),e(dt,Qd),e(Qd,DT),w(o,om,b),w(o,se,b),f(ln,se,null),e(se,NT),e(se,dn),e(dn,RT),e(dn,cn),e(cn,Od),e(Od,VT),e(dn,XT),e(se,YT),e(se,Kd),e(Kd,AT),rm=!0},p(o,[b]){const mn={};b&2&&(mn.$$scope={dirty:b,ctx:o}),bt.$set(mn);const ec={};b&2&&(ec.$$scope={dirty:b,ctx:o}),Tt.$set(ec);const tc={};b&2&&(tc.$$scope={dirty:b,ctx:o}),Mt.$set(tc);const oc={};b&2&&(oc.$$scope={dirty:b,ctx:o}),Ut.$set(oc);const le={};b&2&&(le.$$scope={dirty:b,ctx:o}),Ot.$set(le);const rc={};b&2&&(rc.$$scope={dirty:b,ctx:o}),ro.$set(rc);const ac={};b&2&&(ac.$$scope={dirty:b,ctx:o}),uo.$set(ac);const nc={};b&2&&(nc.$$scope={dirty:b,ctx:o}),Eo.$set(nc);const zo={};b&2&&(zo.$$scope={dirty:b,ctx:o}),jo.$set(zo);const sc={};b&2&&(sc.$$scope={dirty:b,ctx:o}),Uo.$set(sc);const lc={};b&2&&(lc.$$scope={dirty:b,ctx:o}),Fo.$set(lc);const pn={};b&2&&(pn.$$scope={dirty:b,ctx:o}),Io.$set(pn);const ic={};b&2&&(ic.$$scope={dirty:b,ctx:o}),Zo.$set(ic);const dc={};b&2&&(dc.$$scope={dirty:b,ctx:o}),Wo.$set(dc)},i(o){rm||(u(c.$$.fragment,o),u(Xo.$$.fragment,o),u(Yo.$$.fragment,o),u(Lo.$$.fragment,o),u(bt.$$.fragment,o),u(So.$$.fragment,o),u(Qo.$$.fragment,o),u(Ko.$$.fragment,o),u(er.$$.fragment,o),u(Tt.$$.fragment,o),u(Mt.$$.fragment,o),u(rr.$$.fragment,o),u(ar.$$.fragment,o),u(sr.$$.fragment,o),u(lr.$$.fragment,o),u(ir.$$.fragment,o),u(dr.$$.fragment,o),u(cr.$$.fragment,o),u(mr.$$.fragment,o),u(pr.$$.fragment,o),u(Ut.$$.fragment,o),u(hr.$$.fragment,o),u(gr.$$.fragment,o),u(br.$$.fragment,o),u(yr.$$.fragment,o),u(wr.$$.fragment,o),u(Mr.$$.fragment,o),u(Pr.$$.fragment,o),u(jr.$$.fragment,o),u(Jr.$$.fragment,o),u(Fr.$$.fragment,o),u(Ir.$$.fragment,o),u(Zr.$$.fragment,o),u(Cr.$$.fragment,o),u(Wr.$$.fragment,o),u(Gr.$$.fragment,o),u(zr.$$.fragment,o),u(Br.$$.fragment,o),u(Dr.$$.fragment,o),u(Nr.$$.fragment,o),u(Vr.$$.fragment,o),u(Xr.$$.fragment,o),u(Yr.$$.fragment,o),u(qr.$$.fragment,o),u(Lr.$$.fragment,o),u(Sr.$$.fragment,o),u(Hr.$$.fragment,o),u(Qr.$$.fragment,o),u(Or.$$.fragment,o),u(Kr.$$.fragment,o),u(ta.$$.fragment,o),u(Ot.$$.fragment,o),u(ra.$$.fragment,o),u(na.$$.fragment,o),u(sa.$$.fragment,o),u(ia.$$.fragment,o),u(da.$$.fragment,o),u(ro.$$.fragment,o),u(pa.$$.fragment,o),u(ha.$$.fragment,o),u(fa.$$.fragment,o),u(ua.$$.fragment,o),u(ga.$$.fragment,o),u(_a.$$.fragment,o),u(ba.$$.fragment,o),u(va.$$.fragment,o),u(ya.$$.fragment,o),u(Ta.$$.fragment,o),u(Ma.$$.fragment,o),u(uo.$$.fragment,o),u($a.$$.fragment,o),u(Ea.$$.fragment,o),u(ja.$$.fragment,o),u(Ua.$$.fragment,o),u(Ja.$$.fragment,o),u(Fa.$$.fragment,o),u(Ia.$$.fragment,o),u(Za.$$.fragment,o),u(Wa.$$.fragment,o),u(za.$$.fragment,o),u(Ba.$$.fragment,o),u(Na.$$.fragment,o),u(Ra.$$.fragment,o),u(Va.$$.fragment,o),u(Xa.$$.fragment,o),u(Eo.$$.fragment,o),u(Ya.$$.fragment,o),u(Aa.$$.fragment,o),u(jo.$$.fragment,o),u(Sa.$$.fragment,o),u(Qa.$$.fragment,o),u(Uo.$$.fragment,o),u(Oa.$$.fragment,o),u(en.$$.fragment,o),u(Fo.$$.fragment,o),u(tn.$$.fragment,o),u(Io.$$.fragment,o),u(on.$$.fragment,o),u(Zo.$$.fragment,o),u(rn.$$.fragment,o),u(an.$$.fragment,o),u(nn.$$.fragment,o),u(Wo.$$.fragment,o),u(sn.$$.fragment,o),u(ln.$$.fragment,o),rm=!0)},o(o){g(c.$$.fragment,o),g(Xo.$$.fragment,o),g(Yo.$$.fragment,o),g(Lo.$$.fragment,o),g(bt.$$.fragment,o),g(So.$$.fragment,o),g(Qo.$$.fragment,o),g(Ko.$$.fragment,o),g(er.$$.fragment,o),g(Tt.$$.fragment,o),g(Mt.$$.fragment,o),g(rr.$$.fragment,o),g(ar.$$.fragment,o),g(sr.$$.fragment,o),g(lr.$$.fragment,o),g(ir.$$.fragment,o),g(dr.$$.fragment,o),g(cr.$$.fragment,o),g(mr.$$.fragment,o),g(pr.$$.fragment,o),g(Ut.$$.fragment,o),g(hr.$$.fragment,o),g(gr.$$.fragment,o),g(br.$$.fragment,o),g(yr.$$.fragment,o),g(wr.$$.fragment,o),g(Mr.$$.fragment,o),g(Pr.$$.fragment,o),g(jr.$$.fragment,o),g(Jr.$$.fragment,o),g(Fr.$$.fragment,o),g(Ir.$$.fragment,o),g(Zr.$$.fragment,o),g(Cr.$$.fragment,o),g(Wr.$$.fragment,o),g(Gr.$$.fragment,o),g(zr.$$.fragment,o),g(Br.$$.fragment,o),g(Dr.$$.fragment,o),g(Nr.$$.fragment,o),g(Vr.$$.fragment,o),g(Xr.$$.fragment,o),g(Yr.$$.fragment,o),g(qr.$$.fragment,o),g(Lr.$$.fragment,o),g(Sr.$$.fragment,o),g(Hr.$$.fragment,o),g(Qr.$$.fragment,o),g(Or.$$.fragment,o),g(Kr.$$.fragment,o),g(ta.$$.fragment,o),g(Ot.$$.fragment,o),g(ra.$$.fragment,o),g(na.$$.fragment,o),g(sa.$$.fragment,o),g(ia.$$.fragment,o),g(da.$$.fragment,o),g(ro.$$.fragment,o),g(pa.$$.fragment,o),g(ha.$$.fragment,o),g(fa.$$.fragment,o),g(ua.$$.fragment,o),g(ga.$$.fragment,o),g(_a.$$.fragment,o),g(ba.$$.fragment,o),g(va.$$.fragment,o),g(ya.$$.fragment,o),g(Ta.$$.fragment,o),g(Ma.$$.fragment,o),g(uo.$$.fragment,o),g($a.$$.fragment,o),g(Ea.$$.fragment,o),g(ja.$$.fragment,o),g(Ua.$$.fragment,o),g(Ja.$$.fragment,o),g(Fa.$$.fragment,o),g(Ia.$$.fragment,o),g(Za.$$.fragment,o),g(Wa.$$.fragment,o),g(za.$$.fragment,o),g(Ba.$$.fragment,o),g(Na.$$.fragment,o),g(Ra.$$.fragment,o),g(Va.$$.fragment,o),g(Xa.$$.fragment,o),g(Eo.$$.fragment,o),g(Ya.$$.fragment,o),g(Aa.$$.fragment,o),g(jo.$$.fragment,o),g(Sa.$$.fragment,o),g(Qa.$$.fragment,o),g(Uo.$$.fragment,o),g(Oa.$$.fragment,o),g(en.$$.fragment,o),g(Fo.$$.fragment,o),g(tn.$$.fragment,o),g(Io.$$.fragment,o),g(on.$$.fragment,o),g(Zo.$$.fragment,o),g(rn.$$.fragment,o),g(an.$$.fragment,o),g(nn.$$.fragment,o),g(Wo.$$.fragment,o),g(sn.$$.fragment,o),g(ln.$$.fragment,o),rm=!1},d(o){t(v),o&&t(E),o&&t(T),_(c),o&&t(_c),o&&t(Q),o&&t(bc),o&&t(Xe),o&&t(vc),o&&t(mt),o&&t(yc),o&&t(B),o&&t(wc),o&&t(Ye),_(Xo),o&&t(Tc),o&&t(j),_(Yo),_(Lo),_(bt),_(So),_(Qo),_(Ko),_(er),_(Tt),_(Mt),_(rr),_(ar),_(sr),_(lr),_(ir),_(dr),_(cr),_(mr),_(pr),_(Ut),_(hr),_(gr),_(br),_(yr),_(wr),_(Mr),_(Pr),o&&t(Mc),o&&t(Cn),o&&t($c),o&&t(Qe),_(jr),o&&t(xc),o&&t(ye),o&&t(kc),o&&t(Wt),o&&t(Ec),_(Jr,o),o&&t(Pc),o&&t(Gt),o&&t(jc),o&&t(O),o&&t(Uc),_(Fr,o),o&&t(Jc),o&&t(zt),o&&t(Fc),_(Ir,o),o&&t(Ic),_(Zr,o),o&&t(Zc),o&&t(Gn),o&&t(Cc),_(Cr,o),o&&t(Wc),o&&t(Bt),o&&t(Gc),o&&t(Oe),_(Wr),o&&t(zc),o&&t(K),o&&t(Bc),_(Gr,o),o&&t(Dc),o&&t(we),o&&t(Nc),_(zr,o),o&&t(Rc),o&&t(Nt),o&&t(Vc),_(Br,o),o&&t(Xc),o&&t(zn),o&&t(Yc),o&&t(Ke),_(Dr),o&&t(Ac),o&&t(C),_(Nr),_(Vr),_(Xr),_(Yr),_(qr),_(Lr),_(Sr),_(Hr),_(Qr),o&&t(qc),o&&t(rt),_(Or),o&&t(Lc),o&&t(x),_(Kr),_(ta),_(Ot),_(ra),_(na),_(sa),_(ia),_(da),_(ro),_(pa),_(ha),_(fa),_(ua),_(ga),_(_a),_(ba),_(va),_(ya),_(Ta),_(Ma),_(uo),_($a),_(Ea),_(ja),_(Ua),_(Ja),_(Fa),_(Ia),_(Za),_(Wa),o&&t(Sc),o&&t(nt),_(za),o&&t(Hc),o&&t(re),_(Ba),_(Na),o&&t(Qc),o&&t(st),_(Ra),o&&t(Oc),o&&t(J),_(Va),_(Xa),_(Eo),_(Ya),_(Aa),_(jo),_(Sa),_(Qa),_(Uo),_(Oa),_(en),_(Fo),_(tn),_(Io),_(on),_(Zo),o&&t(Kc),o&&t(it),_(rn),o&&t(em),o&&t(ne),_(an),_(nn),_(Wo),o&&t(tm),o&&t(dt),_(sn),o&&t(om),o&&t(se),_(ln)}}}const j3={local:"models",sections:[{local:"transformers.PreTrainedModel",sections:[{local:"large-model-loading",title:"Large model loading"},{local:"model-instantiation-dtype",title:"Model Instantiation dtype"}],title:"PreTrainedModel"},{local:"transformers.modeling_utils.ModuleUtilsMixin",title:"ModuleUtilsMixin"},{local:"transformers.TFPreTrainedModel",title:"TFPreTrainedModel"},{local:"transformers.modeling_tf_utils.TFModelUtilsMixin",title:"TFModelUtilsMixin"},{local:"transformers.FlaxPreTrainedModel",title:"FlaxPreTrainedModel"},{local:"transformers.utils.PushToHubMixin",title:"Pushing to the Hub"},{local:"transformers.modeling_utils.load_sharded_checkpoint",title:"Sharded checkpoints"}],title:"Models"};function U3(F){return h3(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class G3 extends d3{constructor(v){super();c3(this,v,U3,P3,m3,{})}}export{G3 as default,j3 as metadata};
