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