import{s as un,o as _n,n as Fe}from"../chunks/scheduler.6062bdaf.js";import{S as fn,i as bn,g as r,s as a,r as g,A as Mn,h as c,f as n,c as o,j as x,u as m,x as M,k as U,y as t,a as d,v as u,d as _,t as f,w as b}from"../chunks/index.4bca734e.js";import{T as mn}from"../chunks/Tip.b9ac1f03.js";import{D as $}from"../chunks/Docstring.81ba5e3c.js";import{C as St}from"../chunks/CodeBlock.fa01571c.js";import{E as Gt}from"../chunks/ExampleCodeBlock.30e7542f.js";import{H as Ge,E as yn}from"../chunks/EditOnGithub.74ab2baa.js";function wn(I){let l,j="Example:",p,h,v;return h=new St({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyME1vZGVsSHViTWl4aW4lMEElMEFjbGFzcyUyME15Q3VzdG9tTW9kZWwoJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwTW9kZWxIdWJNaXhpbiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxpYnJhcnlfbmFtZSUzRCUyMm15LWxpYnJhcnklMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB0YWdzJTNEJTVCJTIyeC1jdXN0b20tdGFnJTIyJTJDJTIwJTIyYXJ4aXYlM0EyMzA0LjEyMjQ0JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmVwb191cmwlM0QlMjJodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZodWdnaW5nZmFjZSUyRm15LWNvb2wtbGlicmFyeSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGRvY3NfdXJsJTNEJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRvY3MlMkZteS1jb29sLWxpYnJhcnklMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjAlNUUlMjBvcHRpb25hbCUyMG1ldGFkYXRhJTIwdG8lMjBnZW5lcmF0ZSUyMG1vZGVsJTIwY2FyZCUwQSUyMCUyMCUyMCUyMCklM0ElMEElMjAlMjAlMjAlMjBkZWYlMjBfX2luaXRfXyhzZWxmJTJDJTIwc2l6ZSUzQSUyMGludCUyMCUzRCUyMDUxMiUyQyUyMGRldmljZSUzQSUyMHN0ciUyMCUzRCUyMCUyMmNwdSUyMiklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjBkZWZpbmUlMjBob3clMjB0byUyMGluaXRpYWxpemUlMjB5b3VyJTIwbW9kZWwlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBzdXBlcigpLl9faW5pdF9fKCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAuLi4lMEElMjAlMjAlMjAlMjBkZWYlMjBfc2F2ZV9wcmV0cmFpbmVkKHNlbGYlMkMlMjBzYXZlX2RpcmVjdG9yeSUzQSUyMFBhdGgpJTIwLSUzRSUyME5vbmUlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjBkZWZpbmUlMjBob3clMjB0byUyMHNlcmlhbGl6ZSUyMHlvdXIlMjBtb2RlbCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC4uLiUwQSUyMCUyMCUyMCUyMCU0MGNsYXNzbWV0aG9kJTBBJTIwJTIwJTIwJTIwZGVmJTIwZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGNscyUzQSUyMFR5cGUlNUJUJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcHJldHJhaW5lZF9tb2RlbF9uYW1lX29yX3BhdGglM0ElMjBVbmlvbiU1QnN0ciUyQyUyMFBhdGglNUQlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAqJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZm9yY2VfZG93bmxvYWQlM0ElMjBib29sJTIwJTNEJTIwRmFsc2UlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXN1bWVfZG93bmxvYWQlM0ElMjBPcHRpb25hbCU1QmJvb2wlNUQlMjAlM0QlMjBOb25lJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcHJveGllcyUzQSUyME9wdGlvbmFsJTVCRGljdCU1RCUyMCUzRCUyME5vbmUlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB0b2tlbiUzQSUyME9wdGlvbmFsJTVCVW5pb24lNUJzdHIlMkMlMjBib29sJTVEJTVEJTIwJTNEJTIwTm9uZSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGNhY2hlX2RpciUzQSUyME9wdGlvbmFsJTVCVW5pb24lNUJzdHIlMkMlMjBQYXRoJTVEJTVEJTIwJTNEJTIwTm9uZSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxvY2FsX2ZpbGVzX29ubHklM0ElMjBib29sJTIwJTNEJTIwRmFsc2UlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXZpc2lvbiUzQSUyME9wdGlvbmFsJTVCc3RyJTVEJTIwJTNEJTIwTm9uZSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCoqbW9kZWxfa3dhcmdzJTJDJTBBJTIwJTIwJTIwJTIwKSUyMC0lM0UlMjBUJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIzJTIwZGVmaW5lJTIwaG93JTIwdG8lMjBkZXNlcmlhbGl6ZSUyMHlvdXIlMjBtb2RlbCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC4uLiUwQSUwQW1vZGVsJTIwJTNEJTIwTXlDdXN0b21Nb2RlbChzaXplJTNEMjU2JTJDJTIwZGV2aWNlJTNEJTIyZ3B1JTIyKSUwQSUwQW1vZGVsLnNhdmVfcHJldHJhaW5lZCglMjJteS1hd2Vzb21lLW1vZGVsJTIyKSUwQSUwQW1vZGVsLnB1c2hfdG9faHViKCUyMm15LWF3ZXNvbWUtbW9kZWwlMjIpJTBBJTBBcmVsb2FkZWRfbW9kZWwlMjAlM0QlMjBNeUN1c3RvbU1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJ1c2VybmFtZSUyRm15LWF3ZXNvbWUtbW9kZWwlMjIpJTBBcmVsb2FkZWRfbW9kZWwuc2l6ZSUwQSUwQWZyb20lMjBodWdnaW5nZmFjZV9odWIlMjBpbXBvcnQlMjBNb2RlbENhcmQlMEFjYXJkJTIwJTNEJTIwTW9kZWxDYXJkLmxvYWQoJTIydXNlcm5hbWUlMkZteS1hd2Vzb21lLW1vZGVsJTIyKSUwQWNhcmQuZGF0YS50YWdzJTBBY2FyZC5kYXRhLmxpYnJhcnlfbmFtZQ==",highlighted:`<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"># Inherit from ModelHubMixin</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-meta">... </span>        ModelHubMixin,
<span class="hljs-meta">... </span>        library_name=<span class="hljs-string">&quot;my-library&quot;</span>,
<span class="hljs-meta">... </span>        tags=[<span class="hljs-string">&quot;x-custom-tag&quot;</span>, <span class="hljs-string">&quot;arxiv:2304.12244&quot;</span>],
<span class="hljs-meta">... </span>        repo_url=<span class="hljs-string">&quot;https://github.com/huggingface/my-cool-library&quot;</span>,
<span class="hljs-meta">... </span>        docs_url=<span class="hljs-string">&quot;https://huggingface.co/docs/my-cool-library&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-comment"># ^ optional metadata to generate model card</span>
<span class="hljs-meta">... </span>    ):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, size: <span class="hljs-built_in">int</span> = <span class="hljs-number">512</span>, device: <span class="hljs-built_in">str</span> = <span class="hljs-string">&quot;cpu&quot;</span></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-type">Optional</span>[<span class="hljs-built_in">bool</span>] = <span class="hljs-literal">None</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(size=<span class="hljs-number">256</span>, device=<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.size
<span class="hljs-number">256</span>

<span class="hljs-comment"># Model card has been correctly populated</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> ModelCard
<span class="hljs-meta">&gt;&gt;&gt; </span>card = ModelCard.load(<span class="hljs-string">&quot;username/my-awesome-model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>card.data.tags
[<span class="hljs-string">&quot;x-custom-tag&quot;</span>, <span class="hljs-string">&quot;pytorch_model_hub_mixin&quot;</span>, <span class="hljs-string">&quot;model_hub_mixin&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>card.data.library_name
<span class="hljs-string">&quot;my-library&quot;</span>`,wrap:!1}}),{c(){l=r("p"),l.textContent=j,p=a(),g(h.$$.fragment)},l(i){l=c(i,"P",{"data-svelte-h":!0}),M(l)!=="svelte-11lpom8"&&(l.textContent=j),p=o(i),m(h.$$.fragment,i)},m(i,T){d(i,l,T),d(i,p,T),u(h,i,T),v=!0},p:Fe,i(i){v||(_(h.$$.fragment,i),v=!0)},o(i){f(h.$$.fragment,i),v=!1},d(i){i&&(n(l),n(p)),b(h,i)}}}function jn(I){let l,j="Example:",p,h,v;return h=new St({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjB0b3JjaC5ubiUyMGFzJTIwbm4lMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwUHlUb3JjaE1vZGVsSHViTWl4aW4lMEElMEFjbGFzcyUyME15TW9kZWwoJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbm4uTW9kdWxlJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwUHlUb3JjaE1vZGVsSHViTWl4aW4lMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsaWJyYXJ5X25hbWUlM0QlMjJrZXJhcy1ubHAlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXBvX3VybCUzRCUyMmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmtlcmFzLXRlYW0lMkZrZXJhcy1ubHAlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBkb2NzX3VybCUzRCUyMmh0dHBzJTNBJTJGJTJGa2VyYXMuaW8lMkZrZXJhc19ubHAlMkYlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjAlNUUlMjBvcHRpb25hbCUyMG1ldGFkYXRhJTIwdG8lMjBnZW5lcmF0ZSUyMG1vZGVsJTIwY2FyZCUwQSUyMCUyMCUyMCUyMCklM0ElMEElMjAlMjAlMjAlMjBkZWYlMjBfX2luaXRfXyhzZWxmJTJDJTIwaGlkZGVuX3NpemUlM0ElMjBpbnQlMjAlM0QlMjA1MTIlMkMlMjB2b2NhYl9zaXplJTNBJTIwaW50JTIwJTNEJTIwMzAwMDAlMkMlMjBvdXRwdXRfc2l6ZSUzQSUyMGludCUyMCUzRCUyMDQpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc3VwZXIoKS5fX2luaXRfXygpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2VsZi5wYXJhbSUyMCUzRCUyMG5uLlBhcmFtZXRlcih0b3JjaC5yYW5kKGhpZGRlbl9zaXplJTJDJTIwdm9jYWJfc2l6ZSkpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2VsZi5saW5lYXIlMjAlM0QlMjBubi5MaW5lYXIob3V0cHV0X3NpemUlMkMlMjB2b2NhYl9zaXplKSUwQSUwQSUyMCUyMCUyMCUyMGRlZiUyMGZvcndhcmQoc2VsZiUyQyUyMHgpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwc2VsZi5saW5lYXIoeCUyMCUyQiUyMHNlbGYucGFyYW0pJTBBbW9kZWwlMjAlM0QlMjBNeU1vZGVsKGhpZGRlbl9zaXplJTNEMjU2KSUwQSUwQW1vZGVsLnNhdmVfcHJldHJhaW5lZCglMjJteS1hd2Vzb21lLW1vZGVsJTIyKSUwQSUwQW1vZGVsLnB1c2hfdG9faHViKCUyMm15LWF3ZXNvbWUtbW9kZWwlMjIpJTBBJTBBbW9kZWwlMjAlM0QlMjBNeU1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJ1c2VybmFtZSUyRm15LWF3ZXNvbWUtbW9kZWwlMjIpJTBBbW9kZWwuaGlkZGVuX3NpemU=",highlighted:`<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><span class="hljs-keyword">class</span> <span class="hljs-title class_">MyModel</span>(
<span class="hljs-meta">... </span>        nn.Module,
<span class="hljs-meta">... </span>        PyTorchModelHubMixin,
<span class="hljs-meta">... </span>        library_name=<span class="hljs-string">&quot;keras-nlp&quot;</span>,
<span class="hljs-meta">... </span>        repo_url=<span class="hljs-string">&quot;https://github.com/keras-team/keras-nlp&quot;</span>,
<span class="hljs-meta">... </span>        docs_url=<span class="hljs-string">&quot;https://keras.io/keras_nlp/&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-comment"># ^ optional metadata to generate model card</span>
<span class="hljs-meta">... </span>    ):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, hidden_size: <span class="hljs-built_in">int</span> = <span class="hljs-number">512</span>, vocab_size: <span class="hljs-built_in">int</span> = <span class="hljs-number">30000</span>, output_size: <span class="hljs-built_in">int</span> = <span class="hljs-number">4</span></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(hidden_size, vocab_size))
<span class="hljs-meta">... </span>        self.linear = nn.Linear(output_size, 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(hidden_size=<span class="hljs-number">256</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>model = MyModel.from_pretrained(<span class="hljs-string">&quot;username/my-awesome-model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.hidden_size
<span class="hljs-number">256</span>`,wrap:!1}}),{c(){l=r("p"),l.textContent=j,p=a(),g(h.$$.fragment)},l(i){l=c(i,"P",{"data-svelte-h":!0}),M(l)!=="svelte-11lpom8"&&(l.textContent=j),p=o(i),m(h.$$.fragment,i)},m(i,T){d(i,l,T),d(i,p,T),u(h,i,T),v=!0},p:Fe,i(i){v||(_(h.$$.fragment,i),v=!0)},o(i){f(h.$$.fragment,i),v=!1},d(i){i&&(n(l),n(p)),b(h,i)}}}function vn(I){let l,j;return l=new St({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(){g(l.$$.fragment)},l(p){m(l.$$.fragment,p)},m(p,h){u(l,p,h),j=!0},p:Fe,i(p){j||(_(l.$$.fragment,p),j=!0)},o(p){f(l.$$.fragment,p),j=!1},d(p){b(l,p)}}}function Tn(I){let l,j=`Passing <code>token=True</code> is required when you want to use a private
model.`;return{c(){l=r("p"),l.innerHTML=j},l(p){l=c(p,"P",{"data-svelte-h":!0}),M(l)!=="svelte-1j5fb81"&&(l.innerHTML=j)},m(p,h){d(p,l,h)},p:Fe,d(p){p&&n(l)}}}function xn(I){let l,j="Raises the following error:",p,h,v=`<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(){l=r("p"),l.textContent=j,p=a(),h=r("ul"),h.innerHTML=v},l(i){l=c(i,"P",{"data-svelte-h":!0}),M(l)!=="svelte-1f6kjc7"&&(l.textContent=j),p=o(i),h=c(i,"UL",{"data-svelte-h":!0}),M(h)!=="svelte-qftit0"&&(h.innerHTML=v)},m(i,T){d(i,l,T),d(i,p,T),d(i,h,T)},p:Fe,d(i){i&&(n(l),n(p),n(h))}}}function Un(I){let l,j,p,h,v,i,T,Xe,Q,Ft=`<code>huggingface_hub</code> 라이브러리는 객체에 함수들의 업로드 및 다운로드 기능을 손쉽게 제공하기 위해서, 부모 클래스로 사용될 수 있는 다양한 믹스인을 제공합니다.
ML 프레임워크를 Hub와 통합하는 방법은 <a href="../guides/integrations">통합 가이드</a>를 통해 배울 수 있습니다.`,De,q,Pe,y,K,dt,fe,Xt="A generic mixin to integrate ANY machine learning framework with the Hub.",pt,be,Dt=`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/main/ko/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.`,ht,Me,Pt=`When inheriting from <a href="/docs/huggingface_hub/main/ko/package_reference/mixins#huggingface_hub.ModelHubMixin">ModelHubMixin</a>, you can define class-level attributes. These attributes are not passed to
<code>__init__</code> but to the class definition itself. This is useful to define metadata about the library integrating
<a href="/docs/huggingface_hub/main/ko/package_reference/mixins#huggingface_hub.ModelHubMixin">ModelHubMixin</a>.`,gt,ye,Rt='For more details on how to integrate the mixin with your library, checkout the <a href="../guides/integrations">integration guide</a>.',mt,L,ut,V,O,_t,we,Yt=`Overwrite this method in subclass to define how to save your model.
Check out our <a href="../guides/integrations">integration guide</a> for instructions.`,ft,H,ee,bt,je,Qt="Overwrite this method in subclass to define how to load your model from pretrained.",Mt,ve,qt=`Use <code>hf_hub_download()</code> or <code>snapshot_download()</code> 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.`,yt,Te,Kt='Check out our <a href="../guides/integrations">integration guide</a> for more instructions.',wt,G,te,jt,xe,Ot="Download a model from the Huggingface Hub and instantiate it.",vt,N,ne,Tt,Ue,en="Upload model checkpoint to the Hub.",xt,Je,tn=`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/main/ko/package_reference/hf_api#huggingface_hub.HfApi.upload_folder">upload_folder()</a> reference for more
details.`,Ut,S,ae,Jt,ke,nn="Save weights in local directory.",Re,oe,Ye,J,se,kt,$e,an=`Implementation of <a href="/docs/huggingface_hub/main/ko/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>.`,$t,Ie,on='See <a href="/docs/huggingface_hub/main/ko/package_reference/mixins#huggingface_hub.ModelHubMixin">ModelHubMixin</a> for more details on how to use the mixin.',It,F,Qe,le,qe,C,ie,Ht,He,sn=`Implementation of <a href="/docs/huggingface_hub/main/ko/package_reference/mixins#huggingface_hub.ModelHubMixin">ModelHubMixin</a> to provide model Hub upload/download
capabilities to Keras models.`,Ct,X,Ke,A,re,At,Ce,ln=`Instantiate a pretrained Keras model from a pre-trained model from the Hub.
The model is expected to be in <code>SavedModel</code> format.`,Zt,D,Oe,Z,ce,Wt,Ae,rn="Upload model checkpoint to the Hub.",Nt,Ze,cn=`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/main/ko/package_reference/hf_api#huggingface_hub.HfApi.upload_folder">upload_folder()</a> reference for more
details.`,et,B,de,Bt,We,dn=`Saves a Keras model to save_directory in SavedModel format. Use this if
you’re using the Functional or Sequential APIs.`,tt,pe,nt,E,he,Et,Ne,pn="Load pretrained fastai model from the Hub or from a local directory.",at,k,ge,zt,Be,hn="Upload learner checkpoint files to the Hub.",Lt,Ee,gn=`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.`,Vt,P,ot,me,st,Se,lt;return v=new Ge({props:{title:"믹스인 & 직렬화 메소드",local:"mixins—serialization-methods",headingTag:"h1"}}),T=new Ge({props:{title:"믹스인",local:"mixins",headingTag:"h2"}}),q=new Ge({props:{title:"제네릭",local:"huggingface_hub.ModelHubMixin ][ huggingface_hub.ModelHubMixin",headingTag:"h3"}}),K=new $({props:{name:"class huggingface_hub.ModelHubMixin",anchor:"huggingface_hub.ModelHubMixin",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.ModelHubMixin.repo_url",description:`<strong>repo_url</strong> (<code>str</code>, <em>optional</em>) &#x2014;
URL of the library repository. Used to generate model card.`,name:"repo_url"},{anchor:"huggingface_hub.ModelHubMixin.docs_url",description:`<strong>docs_url</strong> (<code>str</code>, <em>optional</em>) &#x2014;
URL of the library documentation. Used to generate model card.`,name:"docs_url"},{anchor:"huggingface_hub.ModelHubMixin.model_card_template",description:`<strong>model_card_template</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Template of the model card. Used to generate model card. Defaults to a generic template.`,name:"model_card_template"},{anchor:"huggingface_hub.ModelHubMixin.language",description:`<strong>language</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Language supported by the library. Used to generate model card.`,name:"language"},{anchor:"huggingface_hub.ModelHubMixin.library_name",description:`<strong>library_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of the library integrating ModelHubMixin. Used to generate model card.`,name:"library_name"},{anchor:"huggingface_hub.ModelHubMixin.license",description:`<strong>license</strong> (<code>str</code>, <em>optional</em>) &#x2014;
License of the library integrating ModelHubMixin. Used to generate model card.
E.g: &#x201C;apache-2.0&#x201D;`,name:"license"},{anchor:"huggingface_hub.ModelHubMixin.license_name",description:`<strong>license_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of the library integrating ModelHubMixin. Used to generate model card.
Only used if <code>license</code> is set to <code>other</code>.
E.g: &#x201C;coqui-public-model-license&#x201D;.`,name:"license_name"},{anchor:"huggingface_hub.ModelHubMixin.license_link",description:`<strong>license_link</strong> (<code>str</code>, <em>optional</em>) &#x2014;
URL to the license of the library integrating ModelHubMixin. Used to generate model card.
Only used if <code>license</code> is set to <code>other</code> and <code>license_name</code> is set.
E.g: &#x201D;<a href="https://coqui.ai/cpml%22" rel="nofollow">https://coqui.ai/cpml&#x201D;</a>.`,name:"license_link"},{anchor:"huggingface_hub.ModelHubMixin.pipeline_tag",description:`<strong>pipeline_tag</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Tag of the pipeline. Used to generate model card. E.g. &#x201C;text-classification&#x201D;.`,name:"pipeline_tag"},{anchor:"huggingface_hub.ModelHubMixin.tags",description:`<strong>tags</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
Tags to be added to the model card. Used to generate model card. E.g. [&#x201C;x-custom-tag&#x201D;, &#x201C;arxiv:2304.12244&#x201D;]`,name:"tags"},{anchor:"huggingface_hub.ModelHubMixin.coders",description:`<strong>coders</strong> (<code>Dict[Type, Tuple[Callable, Callable]]</code>, <em>optional</em>) &#x2014;
Dictionary of custom types and their encoders/decoders. Used to encode/decode arguments that are not
jsonable by default. E.g dataclasses, argparse.Namespace, OmegaConf, etc.`,name:"coders"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hub_mixin.py#L74"}}),L=new Gt({props:{anchor:"huggingface_hub.ModelHubMixin.example",$$slots:{default:[wn]},$$scope:{ctx:I}}}),O=new $({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/main/src/huggingface_hub/hub_mixin.py#L436"}}),ee=new $({props:{name:"_from_pretrained",anchor:"huggingface_hub.ModelHubMixin._from_pretrained",parameters:[{name:"model_id",val:": str"},{name:"revision",val:": typing.Optional[str]"},{name:"cache_dir",val:": typing.Union[str, pathlib.Path, NoneType]"},{name:"force_download",val:": bool"},{name:"proxies",val:": typing.Optional[typing.Dict]"},{name:"resume_download",val:": typing.Optional[bool]"},{name:"local_files_only",val:": bool"},{name:"token",val:": typing.Union[str, bool, NoneType]"},{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.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.`,name:"local_files_only"},{anchor:"huggingface_hub.ModelHubMixin._from_pretrained.model_kwargs",description:`<strong>model_kwargs</strong> &#x2014;
Additional keyword arguments passed along to the <a href="/docs/huggingface_hub/main/ko/package_reference/mixins#huggingface_hub.ModelHubMixin._from_pretrained">_from_pretrained()</a> method.`,name:"model_kwargs"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hub_mixin.py#L572"}}),te=new $({props:{name:"from_pretrained",anchor:"huggingface_hub.ModelHubMixin.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, pathlib.Path]"},{name:"force_download",val:": bool = False"},{name:"resume_download",val:": typing.Optional[bool] = None"},{name:"proxies",val:": typing.Optional[typing.Dict] = None"},{name:"token",val:": typing.Union[str, bool, NoneType] = None"},{name:"cache_dir",val:": typing.Union[str, pathlib.Path, NoneType] = None"},{name:"local_files_only",val:": bool = False"},{name:"revision",val:": typing.Optional[str] = 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
<code>save_pretrained</code>, 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.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/main/src/huggingface_hub/hub_mixin.py#L447"}}),ne=new $({props:{name:"push_to_hub",anchor:"huggingface_hub.ModelHubMixin.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"config",val:": typing.Union[dict, huggingface_hub.hub_mixin.DataclassInstance, NoneType] = None"},{name:"commit_message",val:": str = 'Push model using huggingface_hub.'"},{name:"private",val:": typing.Optional[bool] = None"},{name:"token",val:": typing.Optional[str] = None"},{name:"branch",val:": typing.Optional[str] = None"},{name:"create_pr",val:": typing.Optional[bool] = None"},{name:"allow_patterns",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"ignore_patterns",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"delete_patterns",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"model_card_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = 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>) &#x2014;
Whether the repository created should be private.
If <code>None</code> (default), the repo will be public unless the organization&#x2019;s default is private.`,name:"private"},{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"},{anchor:"huggingface_hub.ModelHubMixin.push_to_hub.model_card_kwargs",description:`<strong>model_card_kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional arguments passed to the model card template to customize the model card.`,name:"model_card_kwargs"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hub_mixin.py#L619",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 $({props:{name:"save_pretrained",anchor:"huggingface_hub.ModelHubMixin.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, pathlib.Path]"},{name:"config",val:": typing.Union[dict, huggingface_hub.hub_mixin.DataclassInstance, NoneType] = None"},{name:"repo_id",val:": typing.Optional[str] = None"},{name:"push_to_hub",val:": bool = False"},{name:"model_card_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{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.`,name:"repo_id"},{anchor:"huggingface_hub.ModelHubMixin.save_pretrained.model_card_kwargs",description:`<strong>model_card_kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional arguments passed to the model card template to customize the model card.`,name:"model_card_kwargs"},{anchor:"huggingface_hub.ModelHubMixin.save_pretrained.push_to_hub_kwargs",description:`<strong>push_to_hub_kwargs</strong> &#x2014;
Additional key word arguments passed along to the <a href="/docs/huggingface_hub/main/ko/package_reference/mixins#huggingface_hub.ModelHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"push_to_hub_kwargs"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hub_mixin.py#L368",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>url of the commit on the Hub if <code>push_to_hub=True</code>, <code>None</code> otherwise.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>str</code> or <code>None</code></p>
`}}),oe=new Ge({props:{title:"PyTorch",local:"huggingface_hub.PyTorchModelHubMixin ][ huggingface_hub.PyTorchModelHubMixin",headingTag:"h3"}}),se=new $({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/main/src/huggingface_hub/hub_mixin.py#L701"}}),F=new Gt({props:{anchor:"huggingface_hub.PyTorchModelHubMixin.example",$$slots:{default:[jn]},$$scope:{ctx:I}}}),le=new Ge({props:{title:"Keras",local:"huggingface_hub.KerasModelHubMixin ][ huggingface_hub.KerasModelHubMixin",headingTag:"h3"}}),ie=new $({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/main/src/huggingface_hub/keras_mixin.py#L420"}}),X=new Gt({props:{anchor:"huggingface_hub.KerasModelHubMixin.example",$$slots:{default:[vn]},$$scope:{ctx:I}}}),re=new $({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
<code>save_pretrained</code>, 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.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/main/src/huggingface_hub/keras_mixin.py#L240"}}),D=new mn({props:{$$slots:{default:[Tn]},$$scope:{ctx:I}}}),ce=new $({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:": typing.Optional[dict] = None"},{name:"commit_message",val:": str = 'Push Keras model using huggingface_hub.'"},{name:"private",val:": typing.Optional[bool] = None"},{name:"api_endpoint",val:": typing.Optional[str] = None"},{name:"token",val:": typing.Optional[str] = None"},{name:"branch",val:": typing.Optional[str] = None"},{name:"create_pr",val:": typing.Optional[bool] = None"},{name:"allow_patterns",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"ignore_patterns",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"delete_patterns",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"log_dir",val:": typing.Optional[str] = None"},{name:"include_optimizer",val:": bool = False"},{name:"tags",val:": typing.Union[list, str, NoneType] = 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>) &#x2014;
Whether the repository created should be private.
If <code>None</code> (default), the repo will be public unless the organization&#x2019;s default is 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/main/src/huggingface_hub/keras_mixin.py#L296",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 $({props:{name:"huggingface_hub.save_pretrained_keras",anchor:"huggingface_hub.save_pretrained_keras",parameters:[{name:"model",val:""},{name:"save_directory",val:": typing.Union[str, pathlib.Path]"},{name:"config",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"include_optimizer",val:": bool = False"},{name:"plot_model",val:": bool = True"},{name:"tags",val:": typing.Union[list, str, NoneType] = 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/main/src/huggingface_hub/keras_mixin.py#L156"}}),pe=new Ge({props:{title:"Fastai",local:"huggingface_hub.from_pretrained_fastai ][ huggingface_hub.from_pretrained_fastai",headingTag:"h3"}}),he=new $({props:{name:"huggingface_hub.from_pretrained_fastai",anchor:"huggingface_hub.from_pretrained_fastai",parameters:[{name:"repo_id",val:": str"},{name:"revision",val:": typing.Optional[str] = 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/main/src/huggingface_hub/fastai_utils.py#L297",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The <code>fastai.Learner</code> model in the <code>repo_id</code> repo.</p>
`}}),ge=new $({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:": typing.Optional[bool] = None"},{name:"token",val:": typing.Optional[str] = None"},{name:"config",val:": typing.Optional[dict] = None"},{name:"branch",val:": typing.Optional[str] = None"},{name:"create_pr",val:": typing.Optional[bool] = None"},{name:"allow_patterns",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"ignore_patterns",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"delete_patterns",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"api_endpoint",val:": typing.Optional[str] = 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>) &#x2014;
Whether or not the repository created should be private.
If <em>None</em> (default), will default to been public except if the organization&#x2019;s default is 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/main/src/huggingface_hub/fastai_utils.py#L342",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 mn({props:{$$slots:{default:[xn]},$$scope:{ctx:I}}}),me=new yn({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/ko/package_reference/mixins.md"}}),{c(){l=r("meta"),j=a(),p=r("p"),h=a(),g(v.$$.fragment),i=a(),g(T.$$.fragment),Xe=a(),Q=r("p"),Q.innerHTML=Ft,De=a(),g(q.$$.fragment),Pe=a(),y=r("div"),g(K.$$.fragment),dt=a(),fe=r("p"),fe.textContent=Xt,pt=a(),be=r("p"),be.innerHTML=Dt,ht=a(),Me=r("p"),Me.innerHTML=Pt,gt=a(),ye=r("p"),ye.innerHTML=Rt,mt=a(),g(L.$$.fragment),ut=a(),V=r("div"),g(O.$$.fragment),_t=a(),we=r("p"),we.innerHTML=Yt,ft=a(),H=r("div"),g(ee.$$.fragment),bt=a(),je=r("p"),je.textContent=Qt,Mt=a(),ve=r("p"),ve.innerHTML=qt,yt=a(),Te=r("p"),Te.innerHTML=Kt,wt=a(),G=r("div"),g(te.$$.fragment),jt=a(),xe=r("p"),xe.textContent=Ot,vt=a(),N=r("div"),g(ne.$$.fragment),Tt=a(),Ue=r("p"),Ue.textContent=en,xt=a(),Je=r("p"),Je.innerHTML=tn,Ut=a(),S=r("div"),g(ae.$$.fragment),Jt=a(),ke=r("p"),ke.textContent=nn,Re=a(),g(oe.$$.fragment),Ye=a(),J=r("div"),g(se.$$.fragment),kt=a(),$e=r("p"),$e.innerHTML=an,$t=a(),Ie=r("p"),Ie.innerHTML=on,It=a(),g(F.$$.fragment),Qe=a(),g(le.$$.fragment),qe=a(),C=r("div"),g(ie.$$.fragment),Ht=a(),He=r("p"),He.innerHTML=sn,Ct=a(),g(X.$$.fragment),Ke=a(),A=r("div"),g(re.$$.fragment),At=a(),Ce=r("p"),Ce.innerHTML=ln,Zt=a(),g(D.$$.fragment),Oe=a(),Z=r("div"),g(ce.$$.fragment),Wt=a(),Ae=r("p"),Ae.textContent=rn,Nt=a(),Ze=r("p"),Ze.innerHTML=cn,et=a(),B=r("div"),g(de.$$.fragment),Bt=a(),We=r("p"),We.textContent=dn,tt=a(),g(pe.$$.fragment),nt=a(),E=r("div"),g(he.$$.fragment),Et=a(),Ne=r("p"),Ne.textContent=pn,at=a(),k=r("div"),g(ge.$$.fragment),zt=a(),Be=r("p"),Be.textContent=hn,Lt=a(),Ee=r("p"),Ee.innerHTML=gn,Vt=a(),g(P.$$.fragment),ot=a(),g(me.$$.fragment),st=a(),Se=r("p"),this.h()},l(e){const s=Mn("svelte-u9bgzb",document.head);l=c(s,"META",{name:!0,content:!0}),s.forEach(n),j=o(e),p=c(e,"P",{}),x(p).forEach(n),h=o(e),m(v.$$.fragment,e),i=o(e),m(T.$$.fragment,e),Xe=o(e),Q=c(e,"P",{"data-svelte-h":!0}),M(Q)!=="svelte-1v1ak99"&&(Q.innerHTML=Ft),De=o(e),m(q.$$.fragment,e),Pe=o(e),y=c(e,"DIV",{class:!0});var w=x(y);m(K.$$.fragment,w),dt=o(w),fe=c(w,"P",{"data-svelte-h":!0}),M(fe)!=="svelte-1q74itk"&&(fe.textContent=Xt),pt=o(w),be=c(w,"P",{"data-svelte-h":!0}),M(be)!=="svelte-12nvh8"&&(be.innerHTML=Dt),ht=o(w),Me=c(w,"P",{"data-svelte-h":!0}),M(Me)!=="svelte-1wlpyuh"&&(Me.innerHTML=Pt),gt=o(w),ye=c(w,"P",{"data-svelte-h":!0}),M(ye)!=="svelte-1gs2y95"&&(ye.innerHTML=Rt),mt=o(w),m(L.$$.fragment,w),ut=o(w),V=c(w,"DIV",{class:!0});var ue=x(V);m(O.$$.fragment,ue),_t=o(ue),we=c(ue,"P",{"data-svelte-h":!0}),M(we)!=="svelte-1fdydm0"&&(we.innerHTML=Yt),ue.forEach(n),ft=o(w),H=c(w,"DIV",{class:!0});var W=x(H);m(ee.$$.fragment,W),bt=o(W),je=c(W,"P",{"data-svelte-h":!0}),M(je)!=="svelte-1totzue"&&(je.textContent=Qt),Mt=o(W),ve=c(W,"P",{"data-svelte-h":!0}),M(ve)!=="svelte-tfd436"&&(ve.innerHTML=qt),yt=o(W),Te=c(W,"P",{"data-svelte-h":!0}),M(Te)!=="svelte-1xccgfy"&&(Te.innerHTML=Kt),W.forEach(n),wt=o(w),G=c(w,"DIV",{class:!0});var _e=x(G);m(te.$$.fragment,_e),jt=o(_e),xe=c(_e,"P",{"data-svelte-h":!0}),M(xe)!=="svelte-ydwjgk"&&(xe.textContent=Ot),_e.forEach(n),vt=o(w),N=c(w,"DIV",{class:!0});var z=x(N);m(ne.$$.fragment,z),Tt=o(z),Ue=c(z,"P",{"data-svelte-h":!0}),M(Ue)!=="svelte-skcyeb"&&(Ue.textContent=en),xt=o(z),Je=c(z,"P",{"data-svelte-h":!0}),M(Je)!=="svelte-1vd8jp4"&&(Je.innerHTML=tn),z.forEach(n),Ut=o(w),S=c(w,"DIV",{class:!0});var it=x(S);m(ae.$$.fragment,it),Jt=o(it),ke=c(it,"P",{"data-svelte-h":!0}),M(ke)!=="svelte-usyekl"&&(ke.textContent=nn),it.forEach(n),w.forEach(n),Re=o(e),m(oe.$$.fragment,e),Ye=o(e),J=c(e,"DIV",{class:!0});var R=x(J);m(se.$$.fragment,R),kt=o(R),$e=c(R,"P",{"data-svelte-h":!0}),M($e)!=="svelte-15y07xl"&&($e.innerHTML=an),$t=o(R),Ie=c(R,"P",{"data-svelte-h":!0}),M(Ie)!=="svelte-frn8l6"&&(Ie.innerHTML=on),It=o(R),m(F.$$.fragment,R),R.forEach(n),Qe=o(e),m(le.$$.fragment,e),qe=o(e),C=c(e,"DIV",{class:!0});var ze=x(C);m(ie.$$.fragment,ze),Ht=o(ze),He=c(ze,"P",{"data-svelte-h":!0}),M(He)!=="svelte-5v5sd0"&&(He.innerHTML=sn),Ct=o(ze),m(X.$$.fragment,ze),ze.forEach(n),Ke=o(e),A=c(e,"DIV",{class:!0});var Le=x(A);m(re.$$.fragment,Le),At=o(Le),Ce=c(Le,"P",{"data-svelte-h":!0}),M(Ce)!=="svelte-13dzwpk"&&(Ce.innerHTML=ln),Zt=o(Le),m(D.$$.fragment,Le),Le.forEach(n),Oe=o(e),Z=c(e,"DIV",{class:!0});var Ve=x(Z);m(ce.$$.fragment,Ve),Wt=o(Ve),Ae=c(Ve,"P",{"data-svelte-h":!0}),M(Ae)!=="svelte-skcyeb"&&(Ae.textContent=rn),Nt=o(Ve),Ze=c(Ve,"P",{"data-svelte-h":!0}),M(Ze)!=="svelte-1vd8jp4"&&(Ze.innerHTML=cn),Ve.forEach(n),et=o(e),B=c(e,"DIV",{class:!0});var rt=x(B);m(de.$$.fragment,rt),Bt=o(rt),We=c(rt,"P",{"data-svelte-h":!0}),M(We)!=="svelte-1y1rkkk"&&(We.textContent=dn),rt.forEach(n),tt=o(e),m(pe.$$.fragment,e),nt=o(e),E=c(e,"DIV",{class:!0});var ct=x(E);m(he.$$.fragment,ct),Et=o(ct),Ne=c(ct,"P",{"data-svelte-h":!0}),M(Ne)!=="svelte-1fexh91"&&(Ne.textContent=pn),ct.forEach(n),at=o(e),k=c(e,"DIV",{class:!0});var Y=x(k);m(ge.$$.fragment,Y),zt=o(Y),Be=c(Y,"P",{"data-svelte-h":!0}),M(Be)!=="svelte-18c83zg"&&(Be.textContent=hn),Lt=o(Y),Ee=c(Y,"P",{"data-svelte-h":!0}),M(Ee)!=="svelte-1jbgd9l"&&(Ee.innerHTML=gn),Vt=o(Y),m(P.$$.fragment,Y),Y.forEach(n),ot=o(e),m(me.$$.fragment,e),st=o(e),Se=c(e,"P",{}),x(Se).forEach(n),this.h()},h(){U(l,"name","hf:doc:metadata"),U(l,"content",Jn),U(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,s){t(document.head,l),d(e,j,s),d(e,p,s),d(e,h,s),u(v,e,s),d(e,i,s),u(T,e,s),d(e,Xe,s),d(e,Q,s),d(e,De,s),u(q,e,s),d(e,Pe,s),d(e,y,s),u(K,y,null),t(y,dt),t(y,fe),t(y,pt),t(y,be),t(y,ht),t(y,Me),t(y,gt),t(y,ye),t(y,mt),u(L,y,null),t(y,ut),t(y,V),u(O,V,null),t(V,_t),t(V,we),t(y,ft),t(y,H),u(ee,H,null),t(H,bt),t(H,je),t(H,Mt),t(H,ve),t(H,yt),t(H,Te),t(y,wt),t(y,G),u(te,G,null),t(G,jt),t(G,xe),t(y,vt),t(y,N),u(ne,N,null),t(N,Tt),t(N,Ue),t(N,xt),t(N,Je),t(y,Ut),t(y,S),u(ae,S,null),t(S,Jt),t(S,ke),d(e,Re,s),u(oe,e,s),d(e,Ye,s),d(e,J,s),u(se,J,null),t(J,kt),t(J,$e),t(J,$t),t(J,Ie),t(J,It),u(F,J,null),d(e,Qe,s),u(le,e,s),d(e,qe,s),d(e,C,s),u(ie,C,null),t(C,Ht),t(C,He),t(C,Ct),u(X,C,null),d(e,Ke,s),d(e,A,s),u(re,A,null),t(A,At),t(A,Ce),t(A,Zt),u(D,A,null),d(e,Oe,s),d(e,Z,s),u(ce,Z,null),t(Z,Wt),t(Z,Ae),t(Z,Nt),t(Z,Ze),d(e,et,s),d(e,B,s),u(de,B,null),t(B,Bt),t(B,We),d(e,tt,s),u(pe,e,s),d(e,nt,s),d(e,E,s),u(he,E,null),t(E,Et),t(E,Ne),d(e,at,s),d(e,k,s),u(ge,k,null),t(k,zt),t(k,Be),t(k,Lt),t(k,Ee),t(k,Vt),u(P,k,null),d(e,ot,s),u(me,e,s),d(e,st,s),d(e,Se,s),lt=!0},p(e,[s]){const w={};s&2&&(w.$$scope={dirty:s,ctx:e}),L.$set(w);const ue={};s&2&&(ue.$$scope={dirty:s,ctx:e}),F.$set(ue);const W={};s&2&&(W.$$scope={dirty:s,ctx:e}),X.$set(W);const _e={};s&2&&(_e.$$scope={dirty:s,ctx:e}),D.$set(_e);const z={};s&2&&(z.$$scope={dirty:s,ctx:e}),P.$set(z)},i(e){lt||(_(v.$$.fragment,e),_(T.$$.fragment,e),_(q.$$.fragment,e),_(K.$$.fragment,e),_(L.$$.fragment,e),_(O.$$.fragment,e),_(ee.$$.fragment,e),_(te.$$.fragment,e),_(ne.$$.fragment,e),_(ae.$$.fragment,e),_(oe.$$.fragment,e),_(se.$$.fragment,e),_(F.$$.fragment,e),_(le.$$.fragment,e),_(ie.$$.fragment,e),_(X.$$.fragment,e),_(re.$$.fragment,e),_(D.$$.fragment,e),_(ce.$$.fragment,e),_(de.$$.fragment,e),_(pe.$$.fragment,e),_(he.$$.fragment,e),_(ge.$$.fragment,e),_(P.$$.fragment,e),_(me.$$.fragment,e),lt=!0)},o(e){f(v.$$.fragment,e),f(T.$$.fragment,e),f(q.$$.fragment,e),f(K.$$.fragment,e),f(L.$$.fragment,e),f(O.$$.fragment,e),f(ee.$$.fragment,e),f(te.$$.fragment,e),f(ne.$$.fragment,e),f(ae.$$.fragment,e),f(oe.$$.fragment,e),f(se.$$.fragment,e),f(F.$$.fragment,e),f(le.$$.fragment,e),f(ie.$$.fragment,e),f(X.$$.fragment,e),f(re.$$.fragment,e),f(D.$$.fragment,e),f(ce.$$.fragment,e),f(de.$$.fragment,e),f(pe.$$.fragment,e),f(he.$$.fragment,e),f(ge.$$.fragment,e),f(P.$$.fragment,e),f(me.$$.fragment,e),lt=!1},d(e){e&&(n(j),n(p),n(h),n(i),n(Xe),n(Q),n(De),n(Pe),n(y),n(Re),n(Ye),n(J),n(Qe),n(qe),n(C),n(Ke),n(A),n(Oe),n(Z),n(et),n(B),n(tt),n(nt),n(E),n(at),n(k),n(ot),n(st),n(Se)),n(l),b(v,e),b(T,e),b(q,e),b(K),b(L),b(O),b(ee),b(te),b(ne),b(ae),b(oe,e),b(se),b(F),b(le,e),b(ie),b(X),b(re),b(D),b(ce),b(de),b(pe,e),b(he),b(ge),b(P),b(me,e)}}}const Jn='{"title":"믹스인 & 직렬화 메소드","local":"mixins—serialization-methods","sections":[{"title":"믹스인","local":"mixins","sections":[{"title":"제네릭","local":"huggingface_hub.ModelHubMixin ][ huggingface_hub.ModelHubMixin","sections":[],"depth":3},{"title":"PyTorch","local":"huggingface_hub.PyTorchModelHubMixin ][ huggingface_hub.PyTorchModelHubMixin","sections":[],"depth":3},{"title":"Keras","local":"huggingface_hub.KerasModelHubMixin ][ huggingface_hub.KerasModelHubMixin","sections":[],"depth":3},{"title":"Fastai","local":"huggingface_hub.from_pretrained_fastai ][ huggingface_hub.from_pretrained_fastai","sections":[],"depth":3}],"depth":2}],"depth":1}';function kn(I){return _n(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Nn extends fn{constructor(l){super(),bn(this,l,kn,Un,un,{})}}export{Nn as component};
