import{s as oa,o as na,n as Ae}from"../chunks/scheduler.6062bdaf.js";import{S as sa,i as la,g as i,s as n,r as m,A as ra,h as d,f as a,c as s,j as x,u as g,x as M,k as J,y as t,a as p,v as u,d as f,t as _,w as b}from"../chunks/index.4bca734e.js";import{T as aa}from"../chunks/Tip.b9ac1f03.js";import{D as k}from"../chunks/Docstring.ed07512f.js";import{C as Wt}from"../chunks/CodeBlock.fa01571c.js";import{E as Bt}from"../chunks/ExampleCodeBlock.823fb173.js";import{H as ze}from"../chunks/Heading.723dceba.js";function ia($){let o,y="Example:",c,h,T;return h=new Wt({props:{code:"ZnJvbSUyMGRhdGFjbGFzc2VzJTIwaW1wb3J0JTIwZGF0YWNsYXNzJTBBZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyME1vZGVsSHViTWl4aW4lMEElMEElNDBkYXRhY2xhc3MlMEFjbGFzcyUyMENvbmZpZyUzQSUwQSUyMCUyMCUyMCUyMGZvbyUzQSUyMGludCUyMCUzRCUyMDUxMiUwQSUyMCUyMCUyMCUyMGJhciUzQSUyMHN0ciUyMCUzRCUyMCUyMmNwdSUyMiUwQSUwQWNsYXNzJTIwTXlDdXN0b21Nb2RlbChNb2RlbEh1Yk1peGluKSUzQSUwQSUyMCUyMCUyMCUyMGRlZiUyMF9faW5pdF9fKHNlbGYlMkMlMjBjb25maWclM0ElMjBDb25maWcpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIzJTIwZGVmaW5lJTIwaG93JTIwdG8lMjBpbml0aWFsaXplJTIweW91ciUyMG1vZGVsJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc3VwZXIoKS5fX2luaXRfXygpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwLi4uJTBBJTIwJTIwJTIwJTIwZGVmJTIwX3NhdmVfcHJldHJhaW5lZChzZWxmJTJDJTIwc2F2ZV9kaXJlY3RvcnklM0ElMjBQYXRoKSUyMC0lM0UlMjBOb25lJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIzJTIwZGVmaW5lJTIwaG93JTIwdG8lMjBzZXJpYWxpemUlMjB5b3VyJTIwbW9kZWwlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAuLi4lMEElMjAlMjAlMjAlMjAlNDBjbGFzc21ldGhvZCUwQSUyMCUyMCUyMCUyMGRlZiUyMGZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBjbHMlM0ElMjBUeXBlJTVCVCU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHByZXRyYWluZWRfbW9kZWxfbmFtZV9vcl9wYXRoJTNBJTIwVW5pb24lNUJzdHIlMkMlMjBQYXRoJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGZvcmNlX2Rvd25sb2FkJTNBJTIwYm9vbCUyMCUzRCUyMEZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmVzdW1lX2Rvd25sb2FkJTNBJTIwYm9vbCUyMCUzRCUyMEZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcHJveGllcyUzQSUyME9wdGlvbmFsJTVCRGljdCU1RCUyMCUzRCUyME5vbmUlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB0b2tlbiUzQSUyME9wdGlvbmFsJTVCVW5pb24lNUJzdHIlMkMlMjBib29sJTVEJTVEJTIwJTNEJTIwTm9uZSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGNhY2hlX2RpciUzQSUyME9wdGlvbmFsJTVCVW5pb24lNUJzdHIlMkMlMjBQYXRoJTVEJTVEJTIwJTNEJTIwTm9uZSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxvY2FsX2ZpbGVzX29ubHklM0ElMjBib29sJTIwJTNEJTIwRmFsc2UlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXZpc2lvbiUzQSUyME9wdGlvbmFsJTVCc3RyJTVEJTIwJTNEJTIwTm9uZSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCoqbW9kZWxfa3dhcmdzJTJDJTBBJTIwJTIwJTIwJTIwKSUyMC0lM0UlMjBUJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIzJTIwZGVmaW5lJTIwaG93JTIwdG8lMjBkZXNlcmlhbGl6ZSUyMHlvdXIlMjBtb2RlbCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC4uLiUwQSUwQW1vZGVsJTIwJTNEJTIwTXlDdXN0b21Nb2RlbChjb25maWclM0RDb25maWcoZm9vJTNEMjU2JTJDJTIwYmFyJTNEJTIyZ3B1JTIyKSklMEElMEFtb2RlbC5zYXZlX3ByZXRyYWluZWQoJTIybXktYXdlc29tZS1tb2RlbCUyMiklMEElMEFtb2RlbC5wdXNoX3RvX2h1YiglMjJteS1hd2Vzb21lLW1vZGVsJTIyKSUwQSUwQXJlbG9hZGVkX21vZGVsJTIwJTNEJTIwTXlDdXN0b21Nb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIydXNlcm5hbWUlMkZteS1hd2Vzb21lLW1vZGVsJTIyKSUwQXJlbG9hZGVkX21vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> dataclasses <span class="hljs-keyword">import</span> dataclass
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> ModelHubMixin

<span class="hljs-comment"># Define your model configuration (optional)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>@dataclass
<span class="hljs-meta">... </span><span class="hljs-keyword">class</span> <span class="hljs-title class_">Config</span>:
<span class="hljs-meta">... </span>    foo: <span class="hljs-built_in">int</span> = <span class="hljs-number">512</span>
<span class="hljs-meta">... </span>    bar: <span class="hljs-built_in">str</span> = <span class="hljs-string">&quot;cpu&quot;</span>

<span class="hljs-comment"># Inherit from ModelHubMixin (and optionally from your framework&#x27;s model class)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">class</span> <span class="hljs-title class_">MyCustomModel</span>(<span class="hljs-title class_ inherited__">ModelHubMixin</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, config: Config</span>):
<span class="hljs-meta">... </span>        <span class="hljs-comment"># define how to initialize your model</span>
<span class="hljs-meta">... </span>        <span class="hljs-built_in">super</span>().__init__()
<span class="hljs-meta">... </span>        ...
...
<span class="hljs-meta">... </span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">_save_pretrained</span>(<span class="hljs-params">self, save_directory: Path</span>) -&gt; <span class="hljs-literal">None</span>:
<span class="hljs-meta">... </span>        <span class="hljs-comment"># define how to serialize your model</span>
<span class="hljs-meta">... </span>        ...
...
<span class="hljs-meta">... </span>    @<span class="hljs-built_in">classmethod</span>
<span class="hljs-meta">... </span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">from_pretrained</span>(<span class="hljs-params">
<span class="hljs-meta">... </span>        cls: <span class="hljs-type">Type</span>[T],
<span class="hljs-meta">... </span>        pretrained_model_name_or_path: <span class="hljs-type">Union</span>[<span class="hljs-built_in">str</span>, Path],
<span class="hljs-meta">... </span>        *,
<span class="hljs-meta">... </span>        force_download: <span class="hljs-built_in">bool</span> = <span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>        resume_download: <span class="hljs-built_in">bool</span> = <span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>        proxies: <span class="hljs-type">Optional</span>[<span class="hljs-type">Dict</span>] = <span class="hljs-literal">None</span>,
<span class="hljs-meta">... </span>        token: <span class="hljs-type">Optional</span>[<span class="hljs-type">Union</span>[<span class="hljs-built_in">str</span>, <span class="hljs-built_in">bool</span>]] = <span class="hljs-literal">None</span>,
<span class="hljs-meta">... </span>        cache_dir: <span class="hljs-type">Optional</span>[<span class="hljs-type">Union</span>[<span class="hljs-built_in">str</span>, Path]] = <span class="hljs-literal">None</span>,
<span class="hljs-meta">... </span>        local_files_only: <span class="hljs-built_in">bool</span> = <span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>        revision: <span class="hljs-type">Optional</span>[<span class="hljs-built_in">str</span>] = <span class="hljs-literal">None</span>,
<span class="hljs-meta">... </span>        **model_kwargs,
<span class="hljs-meta">... </span>    </span>) -&gt; T:
<span class="hljs-meta">... </span>        <span class="hljs-comment"># define how to deserialize your model</span>
<span class="hljs-meta">... </span>        ...

<span class="hljs-meta">&gt;&gt;&gt; </span>model = MyCustomModel(config=Config(foo=<span class="hljs-number">256</span>, bar=<span class="hljs-string">&quot;gpu&quot;</span>))

<span class="hljs-comment"># Save model weights to local directory</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.save_pretrained(<span class="hljs-string">&quot;my-awesome-model&quot;</span>)

<span class="hljs-comment"># Push model weights to the Hub</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.push_to_hub(<span class="hljs-string">&quot;my-awesome-model&quot;</span>)

<span class="hljs-comment"># Download and initialize weights from the Hub</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>reloaded_model = MyCustomModel.from_pretrained(<span class="hljs-string">&quot;username/my-awesome-model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>reloaded_model.config
Config(foo=<span class="hljs-number">256</span>, bar=<span class="hljs-string">&quot;gpu&quot;</span>)`,wrap:!1}}),{c(){o=i("p"),o.textContent=y,c=n(),m(h.$$.fragment)},l(r){o=d(r,"P",{"data-svelte-h":!0}),M(o)!=="svelte-11lpom8"&&(o.textContent=y),c=s(r),g(h.$$.fragment,r)},m(r,j){p(r,o,j),p(r,c,j),u(h,r,j),T=!0},p:Ae,i(r){T||(f(h.$$.fragment,r),T=!0)},o(r){_(h.$$.fragment,r),T=!1},d(r){r&&(a(o),a(c)),b(h,r)}}}function da($){let o,y="Example:",c,h,T;return h=new Wt({props:{code:"ZnJvbSUyMGRhdGFjbGFzc2VzJTIwaW1wb3J0JTIwZGF0YWNsYXNzJTBBaW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjB0b3JjaC5ubiUyMGFzJTIwbm4lMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwUHlUb3JjaE1vZGVsSHViTWl4aW4lMEElMEElNDBkYXRhY2xhc3MlMEFjbGFzcyUyMENvbmZpZyUzQSUwQSUyMCUyMCUyMCUyMGhpZGRlbl9zaXplJTNBJTIwaW50JTIwJTNEJTIwNTEyJTBBJTIwJTIwJTIwJTIwdm9jYWJfc2l6ZSUzQSUyMGludCUyMCUzRCUyMDMwMDAwJTBBJTIwJTIwJTIwJTIwb3V0cHV0X3NpemUlM0ElMjBpbnQlMjAlM0QlMjA0JTBBJTBBY2xhc3MlMjBNeU1vZGVsKG5uLk1vZHVsZSUyQyUyMFB5VG9yY2hNb2RlbEh1Yk1peGluKSUzQSUwQSUyMCUyMCUyMCUyMGRlZiUyMF9faW5pdF9fKHNlbGYlMkMlMjBjb25maWclM0ElMjBDb25maWcpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc3VwZXIoKS5fX2luaXRfXygpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2VsZi5wYXJhbSUyMCUzRCUyMG5uLlBhcmFtZXRlcih0b3JjaC5yYW5kKGNvbmZpZy5oaWRkZW5fc2l6ZSUyQyUyMGNvbmZpZy52b2NhYl9zaXplKSklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBzZWxmLmxpbmVhciUyMCUzRCUyMG5uLkxpbmVhcihjb25maWcub3V0cHV0X3NpemUlMkMlMjBjb25maWcudm9jYWJfc2l6ZSklMEElMEElMjAlMjAlMjAlMjBkZWYlMjBmb3J3YXJkKHNlbGYlMkMlMjB4KSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMHNlbGYubGluZWFyKHglMjAlMkIlMjBzZWxmLnBhcmFtKSUwQW1vZGVsJTIwJTNEJTIwTXlNb2RlbCgpJTBBJTBBbW9kZWwuc2F2ZV9wcmV0cmFpbmVkKCUyMm15LWF3ZXNvbWUtbW9kZWwlMjIpJTBBJTBBbW9kZWwucHVzaF90b19odWIoJTIybXktYXdlc29tZS1tb2RlbCUyMiklMEElMEFtb2RlbCUyMCUzRCUyME15TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnVzZXJuYW1lJTJGbXktYXdlc29tZS1tb2RlbCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> dataclasses <span class="hljs-keyword">import</span> dataclass
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch.nn <span class="hljs-keyword">as</span> nn
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> PyTorchModelHubMixin

<span class="hljs-meta">&gt;&gt;&gt; </span>@dataclass
<span class="hljs-meta">... </span><span class="hljs-keyword">class</span> <span class="hljs-title class_">Config</span>:
<span class="hljs-meta">... </span>    hidden_size: <span class="hljs-built_in">int</span> = <span class="hljs-number">512</span>
<span class="hljs-meta">... </span>    vocab_size: <span class="hljs-built_in">int</span> = <span class="hljs-number">30000</span>
<span class="hljs-meta">... </span>    output_size: <span class="hljs-built_in">int</span> = <span class="hljs-number">4</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">class</span> <span class="hljs-title class_">MyModel</span>(nn.Module, PyTorchModelHubMixin):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, config: Config</span>):
<span class="hljs-meta">... </span>        <span class="hljs-built_in">super</span>().__init__()
<span class="hljs-meta">... </span>        self.param = nn.Parameter(torch.rand(config.hidden_size, config.vocab_size))
<span class="hljs-meta">... </span>        self.linear = nn.Linear(config.output_size, config.vocab_size)

<span class="hljs-meta">... </span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, x</span>):
<span class="hljs-meta">... </span>        <span class="hljs-keyword">return</span> self.linear(x + self.param)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MyModel()

<span class="hljs-comment"># Save model weights to local directory</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.save_pretrained(<span class="hljs-string">&quot;my-awesome-model&quot;</span>)

<span class="hljs-comment"># Push model weights to the Hub</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.push_to_hub(<span class="hljs-string">&quot;my-awesome-model&quot;</span>)

<span class="hljs-comment"># Download and initialize weights from the Hub</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MyModel.from_pretrained(<span class="hljs-string">&quot;username/my-awesome-model&quot;</span>)`,wrap:!1}}),{c(){o=i("p"),o.textContent=y,c=n(),m(h.$$.fragment)},l(r){o=d(r,"P",{"data-svelte-h":!0}),M(o)!=="svelte-11lpom8"&&(o.textContent=y),c=s(r),g(h.$$.fragment,r)},m(r,j){p(r,o,j),p(r,c,j),u(h,r,j),T=!0},p:Ae,i(r){T||(f(h.$$.fragment,r),T=!0)},o(r){_(h.$$.fragment,r),T=!1},d(r){r&&(a(o),a(c)),b(h,r)}}}function ca($){let o,y;return o=new Wt({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwS2VyYXNNb2RlbEh1Yk1peGluJTBBJTBBJTBBY2xhc3MlMjBNeU1vZGVsKHRmLmtlcmFzLk1vZGVsJTJDJTIwS2VyYXNNb2RlbEh1Yk1peGluKSUzQSUwQSUyMCUyMCUyMCUyMGRlZiUyMF9faW5pdF9fKHNlbGYlMkMlMjAqKmt3YXJncyklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBzdXBlcigpLl9faW5pdF9fKCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBzZWxmLmNvbmZpZyUyMCUzRCUyMGt3YXJncy5wb3AoJTIyY29uZmlnJTIyJTJDJTIwTm9uZSklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBzZWxmLmR1bW15X2lucHV0cyUyMCUzRCUyMC4uLiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHNlbGYubGF5ZXIlMjAlM0QlMjAuLi4lMEElMEElMjAlMjAlMjAlMjBkZWYlMjBjYWxsKHNlbGYlMkMlMjAqYXJncyklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjAuLi4lMEElMEElMEElMjMlMjBJbml0aWFsaXplJTIwYW5kJTIwY29tcGlsZSUyMHRoZSUyMG1vZGVsJTIwYXMlMjB5b3UlMjBub3JtYWxseSUyMHdvdWxkJTBBbW9kZWwlMjAlM0QlMjBNeU1vZGVsKCklMEFtb2RlbC5jb21waWxlKC4uLiklMEElMjMlMjBCdWlsZCUyMHRoZSUyMGdyYXBoJTIwYnklMjB0cmFpbmluZyUyMGl0JTIwb3IlMjBwYXNzaW5nJTIwZHVtbXklMjBpbnB1dHMlMEFfJTIwJTNEJTIwbW9kZWwobW9kZWwuZHVtbXlfaW5wdXRzKSUwQSUyMyUyMFNhdmUlMjBtb2RlbCUyMHdlaWdodHMlMjB0byUyMGxvY2FsJTIwZGlyZWN0b3J5JTBBbW9kZWwuc2F2ZV9wcmV0cmFpbmVkKCUyMm15LWF3ZXNvbWUtbW9kZWwlMjIpJTBBJTIzJTIwUHVzaCUyMG1vZGVsJTIwd2VpZ2h0cyUyMHRvJTIwdGhlJTIwSHViJTBBbW9kZWwucHVzaF90b19odWIoJTIybXktYXdlc29tZS1tb2RlbCUyMiklMEElMjMlMjBEb3dubG9hZCUyMGFuZCUyMGluaXRpYWxpemUlMjB3ZWlnaHRzJTIwZnJvbSUyMHRoZSUyMEh1YiUwQW1vZGVsJTIwJTNEJTIwTXlNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIydXNlcm5hbWUlMkZzdXBlci1jb29sLW1vZGVsJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> KerasModelHubMixin


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">class</span> <span class="hljs-title class_">MyModel</span>(tf.keras.Model, KerasModelHubMixin):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, **kwargs</span>):
<span class="hljs-meta">... </span>        <span class="hljs-built_in">super</span>().__init__()
<span class="hljs-meta">... </span>        self.config = kwargs.pop(<span class="hljs-string">&quot;config&quot;</span>, <span class="hljs-literal">None</span>)
<span class="hljs-meta">... </span>        self.dummy_inputs = ...
<span class="hljs-meta">... </span>        self.layer = ...

<span class="hljs-meta">... </span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">call</span>(<span class="hljs-params">self, *args</span>):
<span class="hljs-meta">... </span>        <span class="hljs-keyword">return</span> ...


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initialize and compile the model as you normally would</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MyModel()
<span class="hljs-meta">&gt;&gt;&gt; </span>model.<span class="hljs-built_in">compile</span>(...)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Build the graph by training it or passing dummy inputs</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>_ = model(model.dummy_inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Save model weights to local directory</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.save_pretrained(<span class="hljs-string">&quot;my-awesome-model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Push model weights to the Hub</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.push_to_hub(<span class="hljs-string">&quot;my-awesome-model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download and initialize weights from the Hub</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MyModel.from_pretrained(<span class="hljs-string">&quot;username/super-cool-model&quot;</span>)`,wrap:!1}}),{c(){m(o.$$.fragment)},l(c){g(o.$$.fragment,c)},m(c,h){u(o,c,h),y=!0},p:Ae,i(c){y||(f(o.$$.fragment,c),y=!0)},o(c){_(o.$$.fragment,c),y=!1},d(c){b(o,c)}}}function pa($){let o,y=`Passing <code>token=True</code> is required when you want to use a private
model.`;return{c(){o=i("p"),o.innerHTML=y},l(c){o=d(c,"P",{"data-svelte-h":!0}),M(o)!=="svelte-1j5fb81"&&(o.innerHTML=y)},m(c,h){p(c,o,h)},p:Ae,d(c){c&&a(o)}}}function ha($){let o,y="Raises the following error:",c,h,T=`<li><a href="https://docs.python.org/3/library/exceptions.html#ValueError" rel="nofollow"><em>ValueError</em></a>
if the user is not log on to the Hugging Face Hub.</li>`;return{c(){o=i("p"),o.textContent=y,c=n(),h=i("ul"),h.innerHTML=T},l(r){o=d(r,"P",{"data-svelte-h":!0}),M(o)!=="svelte-1f6kjc7"&&(o.textContent=y),c=s(r),h=d(r,"UL",{"data-svelte-h":!0}),M(h)!=="svelte-qftit0"&&(h.innerHTML=T)},m(r,j){p(r,o,j),p(r,c,j),p(r,h,j)},p:Ae,d(r){r&&(a(o),a(c),a(h))}}}function ma($){let o,y,c,h,T,r,j,Ve,D,Et=`The <code>huggingface_hub</code> library offers a range of mixins that can be used as a parent class for your objects, in order to
provide simple uploading and downloading functions. Check out our <a href="../guides/integrations">integration guide</a> to learn
how to integrate any ML framework with the Hub.`,Fe,Q,Se,w,q,st,ue,Nt="A generic mixin to integrate ANY machine learning framework with the Hub.",lt,fe,zt=`To integrate your framework, your model class must inherit from this class. Custom logic for saving/loading models
have to be overwritten in  <code>_from_pretrained</code> and <code>_save_pretrained</code>. <a href="/docs/huggingface_hub/v0.21.3/en/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin">PyTorchModelHubMixin</a> is a good example
of mixin integration with the Hub. Check out our <a href="../guides/integrations">integration guide</a> for more instructions.`,rt,A,it,V,K,dt,_e,Gt=`Overwrite this method in subclass to define how to save your model.
Check out our <a href="../guides/integrations">integration guide</a> for instructions.`,ct,I,O,pt,be,At="Overwrite this method in subclass to define how to load your model from pretrained.",ht,Me,Vt=`Use <a href="/docs/huggingface_hub/v0.21.3/en/package_reference/file_download#huggingface_hub.hf_hub_download">hf_hub_download()</a> or <a href="/docs/huggingface_hub/v0.21.3/en/package_reference/file_download#huggingface_hub.snapshot_download">snapshot_download()</a> to download files from the Hub before loading them. Most
args taken as input can be directly passed to those 2 methods. If needed, you can add more arguments to this
method using “model_kwargs”. For example <code>PyTorchModelHubMixin._from_pretrained()</code> takes as input a <code>map_location</code>
parameter to set on which device the model should be loaded.`,mt,we,Ft='Check out our <a href="../guides/integrations">integration guide</a> for more instructions.',gt,F,ee,ut,ye,St="Download a model from the Huggingface Hub and instantiate it.",ft,E,te,_t,ve,Xt="Upload model checkpoint to the Hub.",bt,Te,Lt=`Use <code>allow_patterns</code> and <code>ignore_patterns</code> to precisely filter which files should be pushed to the hub. Use
<code>delete_patterns</code> to delete existing remote files in the same commit. See <a href="/docs/huggingface_hub/v0.21.3/en/package_reference/hf_api#huggingface_hub.HfApi.upload_folder">upload_folder()</a> reference for more
details.`,Mt,S,ae,wt,je,Rt="Save weights in local directory.",Xe,oe,Le,C,ne,yt,xe,Pt=`Implementation of <a href="/docs/huggingface_hub/v0.21.3/en/package_reference/mixins#huggingface_hub.ModelHubMixin">ModelHubMixin</a> to provide model Hub upload/download capabilities to PyTorch models. The model
is set in evaluation mode by default using <code>model.eval()</code> (dropout modules are deactivated). To train the model,
you should first set it back in training mode with <code>model.train()</code>.`,vt,X,Re,se,Pe,H,le,Tt,Je,Yt=`Implementation of <a href="/docs/huggingface_hub/v0.21.3/en/package_reference/mixins#huggingface_hub.ModelHubMixin">ModelHubMixin</a> to provide model Hub upload/download
capabilities to Keras models.`,jt,L,Ye,Z,re,xt,Ue,Dt=`Instantiate a pretrained Keras model from a pre-trained model from the Hub.
The model is expected to be in <code>SavedModel</code> format.`,Jt,R,De,B,ie,Ut,ke,Qt="Upload model checkpoint to the Hub.",kt,$e,qt=`Use <code>allow_patterns</code> and <code>ignore_patterns</code> to precisely filter which files should be pushed to the hub. Use
<code>delete_patterns</code> to delete existing remote files in the same commit. See <a href="/docs/huggingface_hub/v0.21.3/en/package_reference/hf_api#huggingface_hub.HfApi.upload_folder">upload_folder()</a> reference for more
details.`,Qe,N,de,$t,Ie,Kt=`Saves a Keras model to save_directory in SavedModel format. Use this if
you’re using the Functional or Sequential APIs.`,qe,ce,Ke,z,pe,It,Ce,Ot="Load pretrained fastai model from the Hub or from a local directory.",Oe,U,he,Ct,He,ea="Upload learner checkpoint files to the Hub.",Ht,Ze,ta=`Use <em>allow_patterns</em> and <em>ignore_patterns</em> to precisely filter which files should be pushed to the hub. Use
<em>delete_patterns</em> to delete existing remote files in the same commit. See [<em>upload_folder</em>] reference for more
details.`,Zt,P,et,Ge,tt;return T=new ze({props:{title:"Mixins & serialization methods",local:"mixins--serialization-methods",headingTag:"h1"}}),j=new ze({props:{title:"Mixins",local:"mixins",headingTag:"h2"}}),Q=new ze({props:{title:"Generic",local:"huggingface_hub.ModelHubMixin",headingTag:"h3"}}),q=new k({props:{name:"class huggingface_hub.ModelHubMixin",anchor:"huggingface_hub.ModelHubMixin",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.3/src/huggingface_hub/hub_mixin.py#L40"}}),A=new Bt({props:{anchor:"huggingface_hub.ModelHubMixin.example",$$slots:{default:[ia]},$$scope:{ctx:$}}}),K=new k({props:{name:"_save_pretrained",anchor:"huggingface_hub.ModelHubMixin._save_pretrained",parameters:[{name:"save_directory",val:": Path"}],parametersDescription:[{anchor:"huggingface_hub.ModelHubMixin._save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>Path</code>) &#x2014;
Path to directory in which the model weights and configuration will be saved.`,name:"save_directory"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.3/src/huggingface_hub/hub_mixin.py#L171"}}),O=new k({props:{name:"_from_pretrained",anchor:"huggingface_hub.ModelHubMixin._from_pretrained",parameters:[{name:"model_id",val:": str"},{name:"revision",val:": Optional"},{name:"cache_dir",val:": Union"},{name:"force_download",val:": bool"},{name:"proxies",val:": Optional"},{name:"resume_download",val:": bool"},{name:"local_files_only",val:": bool"},{name:"token",val:": Union"},{name:"**model_kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.ModelHubMixin._from_pretrained.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
ID of the model to load from the Huggingface Hub (e.g. <code>bigscience/bloom</code>).`,name:"model_id"},{anchor:"huggingface_hub.ModelHubMixin._from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Revision of the model on the Hub. Can be a branch name, a git tag or any commit id. Defaults to the
latest commit on <code>main</code> branch.`,name:"revision"},{anchor:"huggingface_hub.ModelHubMixin._from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to force (re-)downloading the model weights and configuration files from the Hub, overriding
the existing cache.`,name:"force_download"},{anchor:"huggingface_hub.ModelHubMixin._from_pretrained.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to delete incompletely received files. Will attempt to resume the download if such a file exists.`,name:"resume_download"},{anchor:"huggingface_hub.ModelHubMixin._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>).`,name:"proxies"},{anchor:"huggingface_hub.ModelHubMixin._from_pretrained.token",description:`<strong>token</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. By default, it will use the token
cached when running <code>huggingface-cli login</code>.`,name:"token"},{anchor:"huggingface_hub.ModelHubMixin._from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>str</code>, <code>Path</code>, <em>optional</em>) &#x2014;
Path to the folder where cached files are stored.`,name:"cache_dir"},{anchor:"huggingface_hub.ModelHubMixin._from_pretrained.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, avoid downloading the file and return the path to the local cached file if it exists.
model_kwargs &#x2014;
Additional keyword arguments passed along to the <a href="/docs/huggingface_hub/v0.21.3/en/package_reference/mixins#huggingface_hub.ModelHubMixin._from_pretrained">_from_pretrained()</a> method.`,name:"local_files_only"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.3/src/huggingface_hub/hub_mixin.py#L296"}}),ee=new k({props:{name:"from_pretrained",anchor:"huggingface_hub.ModelHubMixin.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": Union"},{name:"force_download",val:": bool = False"},{name:"resume_download",val:": bool = False"},{name:"proxies",val:": Optional = None"},{name:"token",val:": Union = None"},{name:"cache_dir",val:": Union = None"},{name:"local_files_only",val:": bool = False"},{name:"revision",val:": Optional = None"},{name:"**model_kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code>, <code>Path</code>) &#x2014;<ul>
<li>Either the <code>model_id</code> (string) of a model hosted on the Hub, e.g. <code>bigscience/bloom</code>.</li>
<li>Or a path to a <code>directory</code> containing model weights saved using
<a href="https://huggingface.co/docs/transformers/v4.38.1/en/main_classes/model#transformers.PreTrainedModel.save_pretrained" rel="nofollow">save_pretrained</a>, e.g., <code>../path/to/my_model_directory/</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Revision of the model on the Hub. Can be a branch name, a git tag or any commit id.
Defaults to the latest commit on <code>main</code> branch.`,name:"revision"},{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to force (re-)downloading the model weights and configuration files from the Hub, overriding
the existing cache.`,name:"force_download"},{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to delete incompletely received files. Will attempt to resume the download if such a file exists.`,name:"resume_download"},{anchor:"huggingface_hub.ModelHubMixin.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 every request.`,name:"proxies"},{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.token",description:`<strong>token</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. By default, it will use the token
cached when running <code>huggingface-cli login</code>.`,name:"token"},{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>str</code>, <code>Path</code>, <em>optional</em>) &#x2014;
Path to the folder where cached files are stored.`,name:"cache_dir"},{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, avoid downloading the file and return the path to the local cached file if it exists.`,name:"local_files_only"},{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.model_kwargs",description:`<strong>model_kwargs</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
Additional kwargs to pass to the model during initialization.`,name:"model_kwargs"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.3/src/huggingface_hub/hub_mixin.py#L182"}}),te=new k({props:{name:"push_to_hub",anchor:"huggingface_hub.ModelHubMixin.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"config",val:": Union = None"},{name:"commit_message",val:": str = 'Push model using huggingface_hub.'"},{name:"private",val:": bool = False"},{name:"token",val:": Optional = None"},{name:"branch",val:": Optional = None"},{name:"create_pr",val:": Optional = None"},{name:"allow_patterns",val:": Union = None"},{name:"ignore_patterns",val:": Union = None"},{name:"delete_patterns",val:": Union = None"},{name:"api_endpoint",val:": Optional = None"}],parametersDescription:[{anchor:"huggingface_hub.ModelHubMixin.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
ID of the repository to push to (example: <code>&quot;username/my-model&quot;</code>).`,name:"repo_id"},{anchor:"huggingface_hub.ModelHubMixin.push_to_hub.config",description:`<strong>config</strong> (<code>dict</code> or <code>DataclassInstance</code>, <em>optional</em>) &#x2014;
Model configuration specified as a key/value dictionary or a dataclass instance.`,name:"config"},{anchor:"huggingface_hub.ModelHubMixin.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Message to commit while pushing.`,name:"commit_message"},{anchor:"huggingface_hub.ModelHubMixin.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the repository created should be private.`,name:"private"},{anchor:"huggingface_hub.ModelHubMixin.push_to_hub.api_endpoint",description:`<strong>api_endpoint</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The API endpoint to use when pushing the model to the hub.`,name:"api_endpoint"},{anchor:"huggingface_hub.ModelHubMixin.push_to_hub.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. By default, it will use the token
cached when running <code>huggingface-cli login</code>.`,name:"token"},{anchor:"huggingface_hub.ModelHubMixin.push_to_hub.branch",description:`<strong>branch</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The git branch on which to push the model. This defaults to <code>&quot;main&quot;</code>.`,name:"branch"},{anchor:"huggingface_hub.ModelHubMixin.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>boolean</code>, <em>optional</em>) &#x2014;
Whether or not to create a Pull Request from <code>branch</code> with that commit. Defaults to <code>False</code>.`,name:"create_pr"},{anchor:"huggingface_hub.ModelHubMixin.push_to_hub.allow_patterns",description:`<strong>allow_patterns</strong> (<code>List[str]</code> or <code>str</code>, <em>optional</em>) &#x2014;
If provided, only files matching at least one pattern are pushed.`,name:"allow_patterns"},{anchor:"huggingface_hub.ModelHubMixin.push_to_hub.ignore_patterns",description:`<strong>ignore_patterns</strong> (<code>List[str]</code> or <code>str</code>, <em>optional</em>) &#x2014;
If provided, files matching any of the patterns are not pushed.`,name:"ignore_patterns"},{anchor:"huggingface_hub.ModelHubMixin.push_to_hub.delete_patterns",description:`<strong>delete_patterns</strong> (<code>List[str]</code> or <code>str</code>, <em>optional</em>) &#x2014;
If provided, remote files matching any of the patterns will be deleted from the repo.`,name:"delete_patterns"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.3/src/huggingface_hub/hub_mixin.py#L345",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The url of the commit of your model in the given repository.</p>
`}}),ae=new k({props:{name:"save_pretrained",anchor:"huggingface_hub.ModelHubMixin.save_pretrained",parameters:[{name:"save_directory",val:": Union"},{name:"config",val:": Union = None"},{name:"repo_id",val:": Optional = None"},{name:"push_to_hub",val:": bool = False"},{name:"**push_to_hub_kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.ModelHubMixin.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>Path</code>) &#x2014;
Path to directory in which the model weights and configuration will be saved.`,name:"save_directory"},{anchor:"huggingface_hub.ModelHubMixin.save_pretrained.config",description:`<strong>config</strong> (<code>dict</code> or <code>DataclassInstance</code>, <em>optional</em>) &#x2014;
Model configuration specified as a key/value dictionary or a dataclass instance.`,name:"config"},{anchor:"huggingface_hub.ModelHubMixin.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 Huggingface Hub after saving it.`,name:"push_to_hub"},{anchor:"huggingface_hub.ModelHubMixin.save_pretrained.repo_id",description:`<strong>repo_id</strong> (<code>str</code>, <em>optional</em>) &#x2014;
ID of your repository on the Hub. Used only if <code>push_to_hub=True</code>. Will default to the folder name if
not provided.
kwargs &#x2014;
Additional key word arguments passed along to the <a href="/docs/huggingface_hub/v0.21.3/en/package_reference/mixins#huggingface_hub.ModelHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"repo_id"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.3/src/huggingface_hub/hub_mixin.py#L122"}}),oe=new ze({props:{title:"PyTorch",local:"huggingface_hub.PyTorchModelHubMixin",headingTag:"h3"}}),ne=new k({props:{name:"class huggingface_hub.PyTorchModelHubMixin",anchor:"huggingface_hub.PyTorchModelHubMixin",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.3/src/huggingface_hub/hub_mixin.py#L422"}}),X=new Bt({props:{anchor:"huggingface_hub.PyTorchModelHubMixin.example",$$slots:{default:[da]},$$scope:{ctx:$}}}),se=new ze({props:{title:"Keras",local:"huggingface_hub.KerasModelHubMixin",headingTag:"h3"}}),le=new k({props:{name:"class huggingface_hub.KerasModelHubMixin",anchor:"huggingface_hub.KerasModelHubMixin",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.3/src/huggingface_hub/keras_mixin.py#L397"}}),L=new Bt({props:{anchor:"huggingface_hub.KerasModelHubMixin.example",$$slots:{default:[ca]},$$scope:{ctx:$}}}),re=new k({props:{name:"huggingface_hub.from_pretrained_keras",anchor:"huggingface_hub.from_pretrained_keras",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.from_pretrained_keras.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:<ul>
<li>A string, the <code>model id</code> 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>You can add <code>revision</code> by appending <code>@</code> at the end of model_id
simply like this: <code>dbmdz/bert-base-german-cased@main</code> Revision
is 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.</li>
<li>A path to a <code>directory</code> containing model weights saved using
<a href="https://huggingface.co/docs/transformers/v4.38.1/en/main_classes/model#transformers.PreTrainedModel.save_pretrained" rel="nofollow">save_pretrained</a>, e.g.,
<code>./my_model_directory/</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:"huggingface_hub.from_pretrained_keras.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to force the (re-)download of the model weights and
configuration files, overriding the cached versions if they exist.`,name:"force_download"},{anchor:"huggingface_hub.from_pretrained_keras.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to delete incompletely received files. Will attempt to
resume the download if such a file exists.`,name:"resume_download"},{anchor:"huggingface_hub.from_pretrained_keras.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:"huggingface_hub.from_pretrained_keras.token",description:`<strong>token</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If
<code>True</code>, will use the token generated when running <code>transformers-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"huggingface_hub.from_pretrained_keras.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:"huggingface_hub.from_pretrained_keras.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only look at local files (i.e., do not try to download
the model).`,name:"local_files_only(bool,"},{anchor:"huggingface_hub.from_pretrained_keras.model_kwargs",description:`<strong>model_kwargs</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
model_kwargs will be passed to the model during initialization`,name:"model_kwargs"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.3/src/huggingface_hub/keras_mixin.py#L216"}}),R=new aa({props:{$$slots:{default:[pa]},$$scope:{ctx:$}}}),ie=new k({props:{name:"huggingface_hub.push_to_hub_keras",anchor:"huggingface_hub.push_to_hub_keras",parameters:[{name:"model",val:""},{name:"repo_id",val:": str"},{name:"config",val:": Optional = None"},{name:"commit_message",val:": str = 'Push Keras model using huggingface_hub.'"},{name:"private",val:": bool = False"},{name:"api_endpoint",val:": Optional = None"},{name:"token",val:": Optional = None"},{name:"branch",val:": Optional = None"},{name:"create_pr",val:": Optional = None"},{name:"allow_patterns",val:": Union = None"},{name:"ignore_patterns",val:": Union = None"},{name:"delete_patterns",val:": Union = None"},{name:"log_dir",val:": Optional = None"},{name:"include_optimizer",val:": bool = False"},{name:"tags",val:": Union = None"},{name:"plot_model",val:": bool = True"},{name:"**model_save_kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.push_to_hub_keras.model",description:`<strong>model</strong> (<code>Keras.Model</code>) &#x2014;
The <a href="%60https://www.tensorflow.org/api_docs/python/tf/keras/Model%60">Keras model</a> you&#x2019;d like to push to the
Hub. The model must be compiled and built.`,name:"model"},{anchor:"huggingface_hub.push_to_hub_keras.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
ID of the repository to push to (example: <code>&quot;username/my-model&quot;</code>).`,name:"repo_id"},{anchor:"huggingface_hub.push_to_hub_keras.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>, defaults to &#x201C;Add Keras model&#x201D;) &#x2014;
Message to commit while pushing.`,name:"commit_message"},{anchor:"huggingface_hub.push_to_hub_keras.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the repository created should be private.`,name:"private"},{anchor:"huggingface_hub.push_to_hub_keras.api_endpoint",description:`<strong>api_endpoint</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The API endpoint to use when pushing the model to the hub.`,name:"api_endpoint"},{anchor:"huggingface_hub.push_to_hub_keras.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If
not set, will use the token set when logging in with
<code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"huggingface_hub.push_to_hub_keras.branch",description:`<strong>branch</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The git branch on which to push the model. This defaults to
the default branch as specified in your repository, which
defaults to <code>&quot;main&quot;</code>.`,name:"branch"},{anchor:"huggingface_hub.push_to_hub_keras.create_pr",description:`<strong>create_pr</strong> (<code>boolean</code>, <em>optional</em>) &#x2014;
Whether or not to create a Pull Request from <code>branch</code> with that commit.
Defaults to <code>False</code>.`,name:"create_pr"},{anchor:"huggingface_hub.push_to_hub_keras.config",description:`<strong>config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Configuration object to be saved alongside the model weights.`,name:"config"},{anchor:"huggingface_hub.push_to_hub_keras.allow_patterns",description:`<strong>allow_patterns</strong> (<code>List[str]</code> or <code>str</code>, <em>optional</em>) &#x2014;
If provided, only files matching at least one pattern are pushed.`,name:"allow_patterns"},{anchor:"huggingface_hub.push_to_hub_keras.ignore_patterns",description:`<strong>ignore_patterns</strong> (<code>List[str]</code> or <code>str</code>, <em>optional</em>) &#x2014;
If provided, files matching any of the patterns are not pushed.`,name:"ignore_patterns"},{anchor:"huggingface_hub.push_to_hub_keras.delete_patterns",description:`<strong>delete_patterns</strong> (<code>List[str]</code> or <code>str</code>, <em>optional</em>) &#x2014;
If provided, remote files matching any of the patterns will be deleted from the repo.`,name:"delete_patterns"},{anchor:"huggingface_hub.push_to_hub_keras.log_dir",description:`<strong>log_dir</strong> (<code>str</code>, <em>optional</em>) &#x2014;
TensorBoard logging directory to be pushed. The Hub automatically
hosts and displays a TensorBoard instance if log files are included
in the repository.`,name:"log_dir"},{anchor:"huggingface_hub.push_to_hub_keras.include_optimizer",description:`<strong>include_optimizer</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to include optimizer during serialization.`,name:"include_optimizer"},{anchor:"huggingface_hub.push_to_hub_keras.tags",description:`<strong>tags</strong> (Union[<code>list</code>, <code>str</code>], <em>optional</em>) &#x2014;
List of tags that are related to model or string of a single tag. See example tags
<a href="https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1" rel="nofollow">here</a>.`,name:"tags"},{anchor:"huggingface_hub.push_to_hub_keras.plot_model",description:`<strong>plot_model</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Setting this to <code>True</code> will plot the model and put it in the model
card. Requires graphviz and pydot to be installed.`,name:"plot_model"},{anchor:"huggingface_hub.push_to_hub_keras.model_save_kwargs(dict,",description:`<strong>model_save_kwargs(<code>dict</code>,</strong> <em>optional</em>) &#x2014;
model_save_kwargs will be passed to
<a href="https://www.tensorflow.org/api_docs/python/tf/keras/models/save_model" rel="nofollow"><code>tf.keras.models.save_model()</code></a>.`,name:"model_save_kwargs(dict,"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.3/src/huggingface_hub/keras_mixin.py#L275",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The url of the commit of your model in the given repository.</p>
`}}),de=new k({props:{name:"huggingface_hub.save_pretrained_keras",anchor:"huggingface_hub.save_pretrained_keras",parameters:[{name:"model",val:""},{name:"save_directory",val:": Union"},{name:"config",val:": Optional = None"},{name:"include_optimizer",val:": bool = False"},{name:"plot_model",val:": bool = True"},{name:"tags",val:": Union = None"},{name:"**model_save_kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.save_pretrained_keras.model",description:`<strong>model</strong> (<code>Keras.Model</code>) &#x2014;
The <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">Keras
model</a>
you&#x2019;d like to save. The model must be compiled and built.`,name:"model"},{anchor:"huggingface_hub.save_pretrained_keras.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>Path</code>) &#x2014;
Specify directory in which you want to save the Keras model.`,name:"save_directory"},{anchor:"huggingface_hub.save_pretrained_keras.config",description:`<strong>config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Configuration object to be saved alongside the model weights.`,name:"config"},{anchor:"huggingface_hub.save_pretrained_keras.include_optimizer(bool,",description:`<strong>include_optimizer(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to include optimizer in serialization.`,name:"include_optimizer(bool,"},{anchor:"huggingface_hub.save_pretrained_keras.plot_model",description:`<strong>plot_model</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Setting this to <code>True</code> will plot the model and put it in the model
card. Requires graphviz and pydot to be installed.`,name:"plot_model"},{anchor:"huggingface_hub.save_pretrained_keras.tags",description:`<strong>tags</strong> (Union[<code>str</code>,<code>list</code>], <em>optional</em>) &#x2014;
List of tags that are related to model or string of a single tag. See example tags
<a href="https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1" rel="nofollow">here</a>.`,name:"tags"},{anchor:"huggingface_hub.save_pretrained_keras.model_save_kwargs(dict,",description:`<strong>model_save_kwargs(<code>dict</code>,</strong> <em>optional</em>) &#x2014;
model_save_kwargs will be passed to
<a href="https://www.tensorflow.org/api_docs/python/tf/keras/models/save_model" rel="nofollow"><code>tf.keras.models.save_model()</code></a>.`,name:"model_save_kwargs(dict,"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.3/src/huggingface_hub/keras_mixin.py#L131"}}),ce=new ze({props:{title:"Fastai",local:"huggingface_hub.from_pretrained_fastai",headingTag:"h3"}}),pe=new k({props:{name:"huggingface_hub.from_pretrained_fastai",anchor:"huggingface_hub.from_pretrained_fastai",parameters:[{name:"repo_id",val:": str"},{name:"revision",val:": Optional = None"}],parametersDescription:[{anchor:"huggingface_hub.from_pretrained_fastai.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The location where the pickled fastai.Learner is. It can be either of the two:<ul>
<li>Hosted on the Hugging Face Hub. E.g.: &#x2018;espejelomar/fatai-pet-breeds-classification&#x2019; or &#x2018;distilgpt2&#x2019;.
You can add a <code>revision</code> by appending <code>@</code> at the end of <code>repo_id</code>. E.g.: <code>dbmdz/bert-base-german-cased@main</code>.
Revision is the specific model version to use. Since we use a git-based system for storing models and other
artifacts on the Hugging Face Hub, it can be a branch name, a tag name, or a commit id.</li>
<li>Hosted locally. <code>repo_id</code> would be a directory containing the pickle and a pyproject.toml
indicating the fastai and fastcore versions used to build the <code>fastai.Learner</code>. E.g.: <code>./my_model_directory/</code>.</li>
</ul>`,name:"repo_id"},{anchor:"huggingface_hub.from_pretrained_fastai.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Revision at which the repo&#x2019;s files are downloaded. See documentation of <code>snapshot_download</code>.`,name:"revision"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.3/src/huggingface_hub/fastai_utils.py#L298",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The <code>fastai.Learner</code> model in the <code>repo_id</code> repo.</p>
`}}),he=new k({props:{name:"huggingface_hub.push_to_hub_fastai",anchor:"huggingface_hub.push_to_hub_fastai",parameters:[{name:"learner",val:""},{name:"repo_id",val:": str"},{name:"commit_message",val:": str = 'Push FastAI model using huggingface_hub.'"},{name:"private",val:": bool = False"},{name:"token",val:": Optional = None"},{name:"config",val:": Optional = None"},{name:"branch",val:": Optional = None"},{name:"create_pr",val:": Optional = None"},{name:"allow_patterns",val:": Union = None"},{name:"ignore_patterns",val:": Union = None"},{name:"delete_patterns",val:": Union = None"},{name:"api_endpoint",val:": Optional = None"}],parametersDescription:[{anchor:"huggingface_hub.push_to_hub_fastai.learner",description:`<strong>learner</strong> (<em>Learner</em>) &#x2014;
The *fastai.Learner&#x2019; you&#x2019;d like to push to the Hub.`,name:"learner"},{anchor:"huggingface_hub.push_to_hub_fastai.repo_id",description:`<strong>repo_id</strong> (<em>str</em>) &#x2014;
The repository id for your model in Hub in the format of &#x201C;namespace/repo_name&#x201D;. The namespace can be your individual account or an organization to which you have write access (for example, &#x2018;stanfordnlp/stanza-de&#x2019;).`,name:"repo_id"},{anchor:"huggingface_hub.push_to_hub_fastai.commit_message",description:"<strong>commit_message</strong> (<em>str`, </em>optional*) &#x2014; Message to commit while pushing. Will default to <code>&quot;add model&quot;</code>.",name:"commit_message"},{anchor:"huggingface_hub.push_to_hub_fastai.private",description:`<strong>private</strong> (<em>bool</em>, <em>optional</em>, defaults to <em>False</em>) &#x2014;
Whether or not the repository created should be private.`,name:"private"},{anchor:"huggingface_hub.push_to_hub_fastai.token",description:`<strong>token</strong> (<em>str</em>, <em>optional</em>) &#x2014;
The Hugging Face account token to use as HTTP bearer authorization for remote files. If <code>None</code>, the token will be asked by a prompt.`,name:"token"},{anchor:"huggingface_hub.push_to_hub_fastai.config",description:`<strong>config</strong> (<em>dict</em>, <em>optional</em>) &#x2014;
Configuration object to be saved alongside the model weights.`,name:"config"},{anchor:"huggingface_hub.push_to_hub_fastai.branch",description:`<strong>branch</strong> (<em>str</em>, <em>optional</em>) &#x2014;
The git branch on which to push the model. This defaults to
the default branch as specified in your repository, which
defaults to <em>&#x201C;main&#x201D;</em>.`,name:"branch"},{anchor:"huggingface_hub.push_to_hub_fastai.create_pr",description:`<strong>create_pr</strong> (<em>boolean</em>, <em>optional</em>) &#x2014;
Whether or not to create a Pull Request from <em>branch</em> with that commit.
Defaults to <em>False</em>.`,name:"create_pr"},{anchor:"huggingface_hub.push_to_hub_fastai.api_endpoint",description:`<strong>api_endpoint</strong> (<em>str</em>, <em>optional</em>) &#x2014;
The API endpoint to use when pushing the model to the hub.`,name:"api_endpoint"},{anchor:"huggingface_hub.push_to_hub_fastai.allow_patterns",description:`<strong>allow_patterns</strong> (<em>List[str]</em> or <em>str</em>, <em>optional</em>) &#x2014;
If provided, only files matching at least one pattern are pushed.`,name:"allow_patterns"},{anchor:"huggingface_hub.push_to_hub_fastai.ignore_patterns",description:`<strong>ignore_patterns</strong> (<em>List[str]</em> or <em>str</em>, <em>optional</em>) &#x2014;
If provided, files matching any of the patterns are not pushed.`,name:"ignore_patterns"},{anchor:"huggingface_hub.push_to_hub_fastai.delete_patterns",description:`<strong>delete_patterns</strong> (<em>List[str]</em> or <em>str</em>, <em>optional</em>) &#x2014;
If provided, remote files matching any of the patterns will be deleted from the repo.`,name:"delete_patterns"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.3/src/huggingface_hub/fastai_utils.py#L343",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The url of the commit of your model in the given repository.</p>
`}}),P=new aa({props:{$$slots:{default:[ha]},$$scope:{ctx:$}}}),{c(){o=i("meta"),y=n(),c=i("p"),h=n(),m(T.$$.fragment),r=n(),m(j.$$.fragment),Ve=n(),D=i("p"),D.innerHTML=Et,Fe=n(),m(Q.$$.fragment),Se=n(),w=i("div"),m(q.$$.fragment),st=n(),ue=i("p"),ue.textContent=Nt,lt=n(),fe=i("p"),fe.innerHTML=zt,rt=n(),m(A.$$.fragment),it=n(),V=i("div"),m(K.$$.fragment),dt=n(),_e=i("p"),_e.innerHTML=Gt,ct=n(),I=i("div"),m(O.$$.fragment),pt=n(),be=i("p"),be.textContent=At,ht=n(),Me=i("p"),Me.innerHTML=Vt,mt=n(),we=i("p"),we.innerHTML=Ft,gt=n(),F=i("div"),m(ee.$$.fragment),ut=n(),ye=i("p"),ye.textContent=St,ft=n(),E=i("div"),m(te.$$.fragment),_t=n(),ve=i("p"),ve.textContent=Xt,bt=n(),Te=i("p"),Te.innerHTML=Lt,Mt=n(),S=i("div"),m(ae.$$.fragment),wt=n(),je=i("p"),je.textContent=Rt,Xe=n(),m(oe.$$.fragment),Le=n(),C=i("div"),m(ne.$$.fragment),yt=n(),xe=i("p"),xe.innerHTML=Pt,vt=n(),m(X.$$.fragment),Re=n(),m(se.$$.fragment),Pe=n(),H=i("div"),m(le.$$.fragment),Tt=n(),Je=i("p"),Je.innerHTML=Yt,jt=n(),m(L.$$.fragment),Ye=n(),Z=i("div"),m(re.$$.fragment),xt=n(),Ue=i("p"),Ue.innerHTML=Dt,Jt=n(),m(R.$$.fragment),De=n(),B=i("div"),m(ie.$$.fragment),Ut=n(),ke=i("p"),ke.textContent=Qt,kt=n(),$e=i("p"),$e.innerHTML=qt,Qe=n(),N=i("div"),m(de.$$.fragment),$t=n(),Ie=i("p"),Ie.textContent=Kt,qe=n(),m(ce.$$.fragment),Ke=n(),z=i("div"),m(pe.$$.fragment),It=n(),Ce=i("p"),Ce.textContent=Ot,Oe=n(),U=i("div"),m(he.$$.fragment),Ct=n(),He=i("p"),He.textContent=ea,Ht=n(),Ze=i("p"),Ze.innerHTML=ta,Zt=n(),m(P.$$.fragment),et=n(),Ge=i("p"),this.h()},l(e){const l=ra("svelte-u9bgzb",document.head);o=d(l,"META",{name:!0,content:!0}),l.forEach(a),y=s(e),c=d(e,"P",{}),x(c).forEach(a),h=s(e),g(T.$$.fragment,e),r=s(e),g(j.$$.fragment,e),Ve=s(e),D=d(e,"P",{"data-svelte-h":!0}),M(D)!=="svelte-by7ppc"&&(D.innerHTML=Et),Fe=s(e),g(Q.$$.fragment,e),Se=s(e),w=d(e,"DIV",{class:!0});var v=x(w);g(q.$$.fragment,v),st=s(v),ue=d(v,"P",{"data-svelte-h":!0}),M(ue)!=="svelte-1q74itk"&&(ue.textContent=Nt),lt=s(v),fe=d(v,"P",{"data-svelte-h":!0}),M(fe)!=="svelte-pgkj9m"&&(fe.innerHTML=zt),rt=s(v),g(A.$$.fragment,v),it=s(v),V=d(v,"DIV",{class:!0});var me=x(V);g(K.$$.fragment,me),dt=s(me),_e=d(me,"P",{"data-svelte-h":!0}),M(_e)!=="svelte-1fdydm0"&&(_e.innerHTML=Gt),me.forEach(a),ct=s(v),I=d(v,"DIV",{class:!0});var W=x(I);g(O.$$.fragment,W),pt=s(W),be=d(W,"P",{"data-svelte-h":!0}),M(be)!=="svelte-1totzue"&&(be.textContent=At),ht=s(W),Me=d(W,"P",{"data-svelte-h":!0}),M(Me)!=="svelte-1hwp672"&&(Me.innerHTML=Vt),mt=s(W),we=d(W,"P",{"data-svelte-h":!0}),M(we)!=="svelte-1xccgfy"&&(we.innerHTML=Ft),W.forEach(a),gt=s(v),F=d(v,"DIV",{class:!0});var ge=x(F);g(ee.$$.fragment,ge),ut=s(ge),ye=d(ge,"P",{"data-svelte-h":!0}),M(ye)!=="svelte-ydwjgk"&&(ye.textContent=St),ge.forEach(a),ft=s(v),E=d(v,"DIV",{class:!0});var G=x(E);g(te.$$.fragment,G),_t=s(G),ve=d(G,"P",{"data-svelte-h":!0}),M(ve)!=="svelte-skcyeb"&&(ve.textContent=Xt),bt=s(G),Te=d(G,"P",{"data-svelte-h":!0}),M(Te)!=="svelte-1e7yyp4"&&(Te.innerHTML=Lt),G.forEach(a),Mt=s(v),S=d(v,"DIV",{class:!0});var at=x(S);g(ae.$$.fragment,at),wt=s(at),je=d(at,"P",{"data-svelte-h":!0}),M(je)!=="svelte-usyekl"&&(je.textContent=Rt),at.forEach(a),v.forEach(a),Xe=s(e),g(oe.$$.fragment,e),Le=s(e),C=d(e,"DIV",{class:!0});var Be=x(C);g(ne.$$.fragment,Be),yt=s(Be),xe=d(Be,"P",{"data-svelte-h":!0}),M(xe)!=="svelte-1n3l4db"&&(xe.innerHTML=Pt),vt=s(Be),g(X.$$.fragment,Be),Be.forEach(a),Re=s(e),g(se.$$.fragment,e),Pe=s(e),H=d(e,"DIV",{class:!0});var We=x(H);g(le.$$.fragment,We),Tt=s(We),Je=d(We,"P",{"data-svelte-h":!0}),M(Je)!=="svelte-avb5is"&&(Je.innerHTML=Yt),jt=s(We),g(L.$$.fragment,We),We.forEach(a),Ye=s(e),Z=d(e,"DIV",{class:!0});var Ee=x(Z);g(re.$$.fragment,Ee),xt=s(Ee),Ue=d(Ee,"P",{"data-svelte-h":!0}),M(Ue)!=="svelte-13dzwpk"&&(Ue.innerHTML=Dt),Jt=s(Ee),g(R.$$.fragment,Ee),Ee.forEach(a),De=s(e),B=d(e,"DIV",{class:!0});var Ne=x(B);g(ie.$$.fragment,Ne),Ut=s(Ne),ke=d(Ne,"P",{"data-svelte-h":!0}),M(ke)!=="svelte-skcyeb"&&(ke.textContent=Qt),kt=s(Ne),$e=d(Ne,"P",{"data-svelte-h":!0}),M($e)!=="svelte-1e7yyp4"&&($e.innerHTML=qt),Ne.forEach(a),Qe=s(e),N=d(e,"DIV",{class:!0});var ot=x(N);g(de.$$.fragment,ot),$t=s(ot),Ie=d(ot,"P",{"data-svelte-h":!0}),M(Ie)!=="svelte-1y1rkkk"&&(Ie.textContent=Kt),ot.forEach(a),qe=s(e),g(ce.$$.fragment,e),Ke=s(e),z=d(e,"DIV",{class:!0});var nt=x(z);g(pe.$$.fragment,nt),It=s(nt),Ce=d(nt,"P",{"data-svelte-h":!0}),M(Ce)!=="svelte-1fexh91"&&(Ce.textContent=Ot),nt.forEach(a),Oe=s(e),U=d(e,"DIV",{class:!0});var Y=x(U);g(he.$$.fragment,Y),Ct=s(Y),He=d(Y,"P",{"data-svelte-h":!0}),M(He)!=="svelte-18c83zg"&&(He.textContent=ea),Ht=s(Y),Ze=d(Y,"P",{"data-svelte-h":!0}),M(Ze)!=="svelte-1jbgd9l"&&(Ze.innerHTML=ta),Zt=s(Y),g(P.$$.fragment,Y),Y.forEach(a),et=s(e),Ge=d(e,"P",{}),x(Ge).forEach(a),this.h()},h(){J(o,"name","hf:doc:metadata"),J(o,"content",ga),J(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(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(e,l){t(document.head,o),p(e,y,l),p(e,c,l),p(e,h,l),u(T,e,l),p(e,r,l),u(j,e,l),p(e,Ve,l),p(e,D,l),p(e,Fe,l),u(Q,e,l),p(e,Se,l),p(e,w,l),u(q,w,null),t(w,st),t(w,ue),t(w,lt),t(w,fe),t(w,rt),u(A,w,null),t(w,it),t(w,V),u(K,V,null),t(V,dt),t(V,_e),t(w,ct),t(w,I),u(O,I,null),t(I,pt),t(I,be),t(I,ht),t(I,Me),t(I,mt),t(I,we),t(w,gt),t(w,F),u(ee,F,null),t(F,ut),t(F,ye),t(w,ft),t(w,E),u(te,E,null),t(E,_t),t(E,ve),t(E,bt),t(E,Te),t(w,Mt),t(w,S),u(ae,S,null),t(S,wt),t(S,je),p(e,Xe,l),u(oe,e,l),p(e,Le,l),p(e,C,l),u(ne,C,null),t(C,yt),t(C,xe),t(C,vt),u(X,C,null),p(e,Re,l),u(se,e,l),p(e,Pe,l),p(e,H,l),u(le,H,null),t(H,Tt),t(H,Je),t(H,jt),u(L,H,null),p(e,Ye,l),p(e,Z,l),u(re,Z,null),t(Z,xt),t(Z,Ue),t(Z,Jt),u(R,Z,null),p(e,De,l),p(e,B,l),u(ie,B,null),t(B,Ut),t(B,ke),t(B,kt),t(B,$e),p(e,Qe,l),p(e,N,l),u(de,N,null),t(N,$t),t(N,Ie),p(e,qe,l),u(ce,e,l),p(e,Ke,l),p(e,z,l),u(pe,z,null),t(z,It),t(z,Ce),p(e,Oe,l),p(e,U,l),u(he,U,null),t(U,Ct),t(U,He),t(U,Ht),t(U,Ze),t(U,Zt),u(P,U,null),p(e,et,l),p(e,Ge,l),tt=!0},p(e,[l]){const v={};l&2&&(v.$$scope={dirty:l,ctx:e}),A.$set(v);const me={};l&2&&(me.$$scope={dirty:l,ctx:e}),X.$set(me);const W={};l&2&&(W.$$scope={dirty:l,ctx:e}),L.$set(W);const ge={};l&2&&(ge.$$scope={dirty:l,ctx:e}),R.$set(ge);const G={};l&2&&(G.$$scope={dirty:l,ctx:e}),P.$set(G)},i(e){tt||(f(T.$$.fragment,e),f(j.$$.fragment,e),f(Q.$$.fragment,e),f(q.$$.fragment,e),f(A.$$.fragment,e),f(K.$$.fragment,e),f(O.$$.fragment,e),f(ee.$$.fragment,e),f(te.$$.fragment,e),f(ae.$$.fragment,e),f(oe.$$.fragment,e),f(ne.$$.fragment,e),f(X.$$.fragment,e),f(se.$$.fragment,e),f(le.$$.fragment,e),f(L.$$.fragment,e),f(re.$$.fragment,e),f(R.$$.fragment,e),f(ie.$$.fragment,e),f(de.$$.fragment,e),f(ce.$$.fragment,e),f(pe.$$.fragment,e),f(he.$$.fragment,e),f(P.$$.fragment,e),tt=!0)},o(e){_(T.$$.fragment,e),_(j.$$.fragment,e),_(Q.$$.fragment,e),_(q.$$.fragment,e),_(A.$$.fragment,e),_(K.$$.fragment,e),_(O.$$.fragment,e),_(ee.$$.fragment,e),_(te.$$.fragment,e),_(ae.$$.fragment,e),_(oe.$$.fragment,e),_(ne.$$.fragment,e),_(X.$$.fragment,e),_(se.$$.fragment,e),_(le.$$.fragment,e),_(L.$$.fragment,e),_(re.$$.fragment,e),_(R.$$.fragment,e),_(ie.$$.fragment,e),_(de.$$.fragment,e),_(ce.$$.fragment,e),_(pe.$$.fragment,e),_(he.$$.fragment,e),_(P.$$.fragment,e),tt=!1},d(e){e&&(a(y),a(c),a(h),a(r),a(Ve),a(D),a(Fe),a(Se),a(w),a(Xe),a(Le),a(C),a(Re),a(Pe),a(H),a(Ye),a(Z),a(De),a(B),a(Qe),a(N),a(qe),a(Ke),a(z),a(Oe),a(U),a(et),a(Ge)),a(o),b(T,e),b(j,e),b(Q,e),b(q),b(A),b(K),b(O),b(ee),b(te),b(ae),b(oe,e),b(ne),b(X),b(se,e),b(le),b(L),b(re),b(R),b(ie),b(de),b(ce,e),b(pe),b(he),b(P)}}}const ga='{"title":"Mixins & serialization methods","local":"mixins--serialization-methods","sections":[{"title":"Mixins","local":"mixins","sections":[{"title":"Generic","local":"huggingface_hub.ModelHubMixin","sections":[],"depth":3},{"title":"PyTorch","local":"huggingface_hub.PyTorchModelHubMixin","sections":[],"depth":3},{"title":"Keras","local":"huggingface_hub.KerasModelHubMixin","sections":[],"depth":3},{"title":"Fastai","local":"huggingface_hub.from_pretrained_fastai","sections":[],"depth":3}],"depth":2}],"depth":1}';function ua($){return na(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ta extends sa{constructor(o){super(),la(this,o,ua,ma,oa,{})}}export{Ta as component};
