import{s as tt,o as nt,n as no}from"../chunks/scheduler.6062bdaf.js";import{S as at,i as st,g as i,s as n,r as g,A as rt,h as l,f as t,c as a,j as k,u as m,x as v,k as T,y as o,a as d,v as p,d as u,t as f,w as _}from"../chunks/index.4bca734e.js";import{T as Qo}from"../chunks/Tip.b9ac1f03.js";import{D as H}from"../chunks/Docstring.ed07512f.js";import{C as ot}from"../chunks/CodeBlock.fa01571c.js";import{E as et}from"../chunks/ExampleCodeBlock.823fb173.js";import{H as Ze}from"../chunks/Heading.723dceba.js";function it(L){let r,y="Example:",c,b,x;return b=new ot({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjB0b3JjaC5ubiUyMGFzJTIwbm4lMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwUHlUb3JjaE1vZGVsSHViTWl4aW4lMEElMEElMEFjbGFzcyUyME15TW9kZWwobm4uTW9kdWxlJTJDJTIwUHlUb3JjaE1vZGVsSHViTWl4aW4pJTNBJTBBJTIwJTIwJTIwJTIwZGVmJTIwX19pbml0X18oc2VsZiklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBzdXBlcigpLl9faW5pdF9fKCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBzZWxmLnBhcmFtJTIwJTNEJTIwbm4uUGFyYW1ldGVyKHRvcmNoLnJhbmQoMyUyQyUyMDQpKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHNlbGYubGluZWFyJTIwJTNEJTIwbm4uTGluZWFyKDQlMkMlMjA1KSUwQSUwQSUyMCUyMCUyMCUyMGRlZiUyMGZvcndhcmQoc2VsZiUyQyUyMHgpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwc2VsZi5saW5lYXIoeCUyMCUyQiUyMHNlbGYucGFyYW0pJTBBbW9kZWwlMjAlM0QlMjBNeU1vZGVsKCklMEElMEFtb2RlbC5zYXZlX3ByZXRyYWluZWQoJTIybXktYXdlc29tZS1tb2RlbCUyMiklMEElMEFtb2RlbC5wdXNoX3RvX2h1YiglMjJteS1hd2Vzb21lLW1vZGVsJTIyKSUwQSUwQW1vZGVsJTIwJTNEJTIwTXlNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIydXNlcm5hbWUlMkZteS1hd2Vzb21lLW1vZGVsJTIyKQ==",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>(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</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(<span class="hljs-number">3</span>, <span class="hljs-number">4</span>))
<span class="hljs-meta">... </span>        self.linear = nn.Linear(<span class="hljs-number">4</span>, <span class="hljs-number">5</span>)

<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(){r=i("p"),r.textContent=y,c=n(),g(b.$$.fragment)},l(h){r=l(h,"P",{"data-svelte-h":!0}),v(r)!=="svelte-11lpom8"&&(r.textContent=y),c=a(h),m(b.$$.fragment,h)},m(h,$){d(h,r,$),d(h,c,$),p(b,h,$),x=!0},p:no,i(h){x||(u(b.$$.fragment,h),x=!0)},o(h){f(b.$$.fragment,h),x=!1},d(h){h&&(t(r),t(c)),_(b,h)}}}function lt(L){let r,y;return r=new ot({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(r.$$.fragment)},l(c){m(r.$$.fragment,c)},m(c,b){p(r,c,b),y=!0},p:no,i(c){y||(u(r.$$.fragment,c),y=!0)},o(c){f(r.$$.fragment,c),y=!1},d(c){_(r,c)}}}function dt(L){let r,y=`Passing <code>token=True</code> is required when you want to use a private
model.`;return{c(){r=i("p"),r.innerHTML=y},l(c){r=l(c,"P",{"data-svelte-h":!0}),v(r)!=="svelte-1j5fb81"&&(r.innerHTML=y)},m(c,b){d(c,r,b)},p:no,d(c){c&&t(r)}}}function ct(L){let r,y="Raises the following error:",c,b,x=`<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(){r=i("p"),r.textContent=y,c=n(),b=i("ul"),b.innerHTML=x},l(h){r=l(h,"P",{"data-svelte-h":!0}),v(r)!=="svelte-1f6kjc7"&&(r.textContent=y),c=a(h),b=l(h,"UL",{"data-svelte-h":!0}),v(b)!=="svelte-qftit0"&&(b.innerHTML=x)},m(h,$){d(h,r,$),d(h,c,$),d(h,b,$)},p:no,d(h){h&&(t(r),t(c),t(b))}}}function ht(L){let r,y,c,b,x,h,$,Ne,X,Wo=`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,Y,Be,M,q,ao,me,Eo="A generic mixin to integrate ANY machine learning framework with the Hub.",so,pe,Lo=`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.20.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.`,ro,N,R,io,ue,Po=`Overwrite this method in subclass to define how to save your model.
Check out our <a href="../guides/integrations">integration guide</a> for instructions.`,lo,U,K,co,fe,Zo="Overwrite this method in subclass to define how to load your model from pretrained.",ho,_e,Ao=`Use <a href="/docs/huggingface_hub/v0.20.3/en/package_reference/file_download#huggingface_hub.hf_hub_download">hf_hub_download()</a> or <a href="/docs/huggingface_hub/v0.20.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.`,go,be,No='Check out our <a href="../guides/integrations">integration guide</a> for more instructions.',mo,F,O,po,ve,Fo="Download a model from the Huggingface Hub and instantiate it.",uo,P,Q,fo,Me,Bo="Upload model checkpoint to the Hub.",_o,we,zo=`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.20.3/en/package_reference/hf_api#huggingface_hub.HfApi.upload_folder">upload_folder()</a> reference for more
details.`,bo,B,ee,vo,ye,Vo="Save weights in local directory.",ze,oe,Ve,C,te,Mo,xe,Do=`Implementation of <a href="/docs/huggingface_hub/v0.20.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>.`,wo,z,De,ne,Ge,I,ae,yo,$e,Go=`Implementation of <a href="/docs/huggingface_hub/v0.20.3/en/package_reference/mixins#huggingface_hub.ModelHubMixin">ModelHubMixin</a> to provide model Hub upload/download
capabilities to Keras models.`,xo,V,Se,J,se,$o,ke,So=`Instantiate a pretrained Keras model from a pre-trained model from the Hub.
The model is expected to be in <code>SavedModel</code> format.`,ko,D,Xe,W,re,To,Te,Xo="Upload model checkpoint to the Hub.",jo,je,Yo=`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.20.3/en/package_reference/hf_api#huggingface_hub.HfApi.upload_folder">upload_folder()</a> reference for more
details.`,Ye,Z,ie,Ho,He,qo=`Saves a Keras model to save_directory in SavedModel format. Use this if
you’re using the Functional or Sequential APIs.`,qe,le,Re,A,de,Uo,Ue,Ro="Load pretrained fastai model from the Hub or from a local directory.",Ke,j,ce,Co,Ce,Ko="Upload learner checkpoint files to the Hub.",Io,Ie,Oo=`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.`,Jo,G,Oe,Ae,Qe;return x=new Ze({props:{title:"Mixins & serialization methods",local:"mixins--serialization-methods",headingTag:"h1"}}),$=new Ze({props:{title:"Mixins",local:"mixins",headingTag:"h2"}}),Y=new Ze({props:{title:"Generic",local:"huggingface_hub.ModelHubMixin",headingTag:"h3"}}),q=new H({props:{name:"class huggingface_hub.ModelHubMixin",anchor:"huggingface_hub.ModelHubMixin",parameters:[],source:"https://github.com/huggingface/huggingface_hub/blob/v0.20.3/src/huggingface_hub/hub_mixin.py#L21"}}),R=new H({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.20.3/src/huggingface_hub/hub_mixin.py#L74"}}),K=new H({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.20.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.20.3/src/huggingface_hub/hub_mixin.py#L169"}}),O=new H({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.36.2/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.20.3/src/huggingface_hub/hub_mixin.py#L85"}}),Q=new H({props:{name:"push_to_hub",anchor:"huggingface_hub.ModelHubMixin.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"config",val:": Optional = None"},{name:"commit_message",val:": str = 'Push 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"}],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>, <em>optional</em>) &#x2014;
Configuration object to be saved alongside the model weights.`,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.20.3/src/huggingface_hub/hub_mixin.py#L218",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The url of the commit of your model in the given repository.</p>
`}}),ee=new H({props:{name:"save_pretrained",anchor:"huggingface_hub.ModelHubMixin.save_pretrained",parameters:[{name:"save_directory",val:": Union"},{name:"config",val:": Optional = None"},{name:"repo_id",val:": Optional = None"},{name:"push_to_hub",val:": bool = False"},{name:"**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>, <em>optional</em>) &#x2014;
Model configuration specified as a key/value dictionary.`,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.20.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.20.3/src/huggingface_hub/hub_mixin.py#L30"}}),oe=new Ze({props:{title:"PyTorch",local:"huggingface_hub.PyTorchModelHubMixin",headingTag:"h3"}}),te=new H({props:{name:"class huggingface_hub.PyTorchModelHubMixin",anchor:"huggingface_hub.PyTorchModelHubMixin",parameters:[],source:"https://github.com/huggingface/huggingface_hub/blob/v0.20.3/src/huggingface_hub/hub_mixin.py#L290"}}),z=new et({props:{anchor:"huggingface_hub.PyTorchModelHubMixin.example",$$slots:{default:[it]},$$scope:{ctx:L}}}),ne=new Ze({props:{title:"Keras",local:"huggingface_hub.KerasModelHubMixin",headingTag:"h3"}}),ae=new H({props:{name:"class huggingface_hub.KerasModelHubMixin",anchor:"huggingface_hub.KerasModelHubMixin",parameters:[],source:"https://github.com/huggingface/huggingface_hub/blob/v0.20.3/src/huggingface_hub/keras_mixin.py#L397"}}),V=new et({props:{anchor:"huggingface_hub.KerasModelHubMixin.example",$$slots:{default:[lt]},$$scope:{ctx:L}}}),se=new H({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.36.2/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.20.3/src/huggingface_hub/keras_mixin.py#L216"}}),D=new Qo({props:{$$slots:{default:[dt]},$$scope:{ctx:L}}}),re=new H({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.20.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>
`}}),ie=new H({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.20.3/src/huggingface_hub/keras_mixin.py#L131"}}),le=new Ze({props:{title:"Fastai",local:"huggingface_hub.from_pretrained_fastai",headingTag:"h3"}}),de=new H({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.20.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>
`}}),ce=new H({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.20.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>
`}}),G=new Qo({props:{$$slots:{default:[ct]},$$scope:{ctx:L}}}),{c(){r=i("meta"),y=n(),c=i("p"),b=n(),g(x.$$.fragment),h=n(),g($.$$.fragment),Ne=n(),X=i("p"),X.innerHTML=Wo,Fe=n(),g(Y.$$.fragment),Be=n(),M=i("div"),g(q.$$.fragment),ao=n(),me=i("p"),me.textContent=Eo,so=n(),pe=i("p"),pe.innerHTML=Lo,ro=n(),N=i("div"),g(R.$$.fragment),io=n(),ue=i("p"),ue.innerHTML=Po,lo=n(),U=i("div"),g(K.$$.fragment),co=n(),fe=i("p"),fe.textContent=Zo,ho=n(),_e=i("p"),_e.innerHTML=Ao,go=n(),be=i("p"),be.innerHTML=No,mo=n(),F=i("div"),g(O.$$.fragment),po=n(),ve=i("p"),ve.textContent=Fo,uo=n(),P=i("div"),g(Q.$$.fragment),fo=n(),Me=i("p"),Me.textContent=Bo,_o=n(),we=i("p"),we.innerHTML=zo,bo=n(),B=i("div"),g(ee.$$.fragment),vo=n(),ye=i("p"),ye.textContent=Vo,ze=n(),g(oe.$$.fragment),Ve=n(),C=i("div"),g(te.$$.fragment),Mo=n(),xe=i("p"),xe.innerHTML=Do,wo=n(),g(z.$$.fragment),De=n(),g(ne.$$.fragment),Ge=n(),I=i("div"),g(ae.$$.fragment),yo=n(),$e=i("p"),$e.innerHTML=Go,xo=n(),g(V.$$.fragment),Se=n(),J=i("div"),g(se.$$.fragment),$o=n(),ke=i("p"),ke.innerHTML=So,ko=n(),g(D.$$.fragment),Xe=n(),W=i("div"),g(re.$$.fragment),To=n(),Te=i("p"),Te.textContent=Xo,jo=n(),je=i("p"),je.innerHTML=Yo,Ye=n(),Z=i("div"),g(ie.$$.fragment),Ho=n(),He=i("p"),He.textContent=qo,qe=n(),g(le.$$.fragment),Re=n(),A=i("div"),g(de.$$.fragment),Uo=n(),Ue=i("p"),Ue.textContent=Ro,Ke=n(),j=i("div"),g(ce.$$.fragment),Co=n(),Ce=i("p"),Ce.textContent=Ko,Io=n(),Ie=i("p"),Ie.innerHTML=Oo,Jo=n(),g(G.$$.fragment),Oe=n(),Ae=i("p"),this.h()},l(e){const s=rt("svelte-u9bgzb",document.head);r=l(s,"META",{name:!0,content:!0}),s.forEach(t),y=a(e),c=l(e,"P",{}),k(c).forEach(t),b=a(e),m(x.$$.fragment,e),h=a(e),m($.$$.fragment,e),Ne=a(e),X=l(e,"P",{"data-svelte-h":!0}),v(X)!=="svelte-by7ppc"&&(X.innerHTML=Wo),Fe=a(e),m(Y.$$.fragment,e),Be=a(e),M=l(e,"DIV",{class:!0});var w=k(M);m(q.$$.fragment,w),ao=a(w),me=l(w,"P",{"data-svelte-h":!0}),v(me)!=="svelte-1q74itk"&&(me.textContent=Eo),so=a(w),pe=l(w,"P",{"data-svelte-h":!0}),v(pe)!=="svelte-9l1xm5"&&(pe.innerHTML=Lo),ro=a(w),N=l(w,"DIV",{class:!0});var he=k(N);m(R.$$.fragment,he),io=a(he),ue=l(he,"P",{"data-svelte-h":!0}),v(ue)!=="svelte-1fdydm0"&&(ue.innerHTML=Po),he.forEach(t),lo=a(w),U=l(w,"DIV",{class:!0});var E=k(U);m(K.$$.fragment,E),co=a(E),fe=l(E,"P",{"data-svelte-h":!0}),v(fe)!=="svelte-1totzue"&&(fe.textContent=Zo),ho=a(E),_e=l(E,"P",{"data-svelte-h":!0}),v(_e)!=="svelte-t3q0pw"&&(_e.innerHTML=Ao),go=a(E),be=l(E,"P",{"data-svelte-h":!0}),v(be)!=="svelte-1xccgfy"&&(be.innerHTML=No),E.forEach(t),mo=a(w),F=l(w,"DIV",{class:!0});var ge=k(F);m(O.$$.fragment,ge),po=a(ge),ve=l(ge,"P",{"data-svelte-h":!0}),v(ve)!=="svelte-ydwjgk"&&(ve.textContent=Fo),ge.forEach(t),uo=a(w),P=l(w,"DIV",{class:!0});var Je=k(P);m(Q.$$.fragment,Je),fo=a(Je),Me=l(Je,"P",{"data-svelte-h":!0}),v(Me)!=="svelte-skcyeb"&&(Me.textContent=Bo),_o=a(Je),we=l(Je,"P",{"data-svelte-h":!0}),v(we)!=="svelte-1s1i3qj"&&(we.innerHTML=zo),Je.forEach(t),bo=a(w),B=l(w,"DIV",{class:!0});var eo=k(B);m(ee.$$.fragment,eo),vo=a(eo),ye=l(eo,"P",{"data-svelte-h":!0}),v(ye)!=="svelte-usyekl"&&(ye.textContent=Vo),eo.forEach(t),w.forEach(t),ze=a(e),m(oe.$$.fragment,e),Ve=a(e),C=l(e,"DIV",{class:!0});var We=k(C);m(te.$$.fragment,We),Mo=a(We),xe=l(We,"P",{"data-svelte-h":!0}),v(xe)!=="svelte-jux69e"&&(xe.innerHTML=Do),wo=a(We),m(z.$$.fragment,We),We.forEach(t),De=a(e),m(ne.$$.fragment,e),Ge=a(e),I=l(e,"DIV",{class:!0});var Ee=k(I);m(ae.$$.fragment,Ee),yo=a(Ee),$e=l(Ee,"P",{"data-svelte-h":!0}),v($e)!=="svelte-1akqu81"&&($e.innerHTML=Go),xo=a(Ee),m(V.$$.fragment,Ee),Ee.forEach(t),Se=a(e),J=l(e,"DIV",{class:!0});var Le=k(J);m(se.$$.fragment,Le),$o=a(Le),ke=l(Le,"P",{"data-svelte-h":!0}),v(ke)!=="svelte-13dzwpk"&&(ke.innerHTML=So),ko=a(Le),m(D.$$.fragment,Le),Le.forEach(t),Xe=a(e),W=l(e,"DIV",{class:!0});var Pe=k(W);m(re.$$.fragment,Pe),To=a(Pe),Te=l(Pe,"P",{"data-svelte-h":!0}),v(Te)!=="svelte-skcyeb"&&(Te.textContent=Xo),jo=a(Pe),je=l(Pe,"P",{"data-svelte-h":!0}),v(je)!=="svelte-1s1i3qj"&&(je.innerHTML=Yo),Pe.forEach(t),Ye=a(e),Z=l(e,"DIV",{class:!0});var oo=k(Z);m(ie.$$.fragment,oo),Ho=a(oo),He=l(oo,"P",{"data-svelte-h":!0}),v(He)!=="svelte-1y1rkkk"&&(He.textContent=qo),oo.forEach(t),qe=a(e),m(le.$$.fragment,e),Re=a(e),A=l(e,"DIV",{class:!0});var to=k(A);m(de.$$.fragment,to),Uo=a(to),Ue=l(to,"P",{"data-svelte-h":!0}),v(Ue)!=="svelte-1fexh91"&&(Ue.textContent=Ro),to.forEach(t),Ke=a(e),j=l(e,"DIV",{class:!0});var S=k(j);m(ce.$$.fragment,S),Co=a(S),Ce=l(S,"P",{"data-svelte-h":!0}),v(Ce)!=="svelte-18c83zg"&&(Ce.textContent=Ko),Io=a(S),Ie=l(S,"P",{"data-svelte-h":!0}),v(Ie)!=="svelte-1jbgd9l"&&(Ie.innerHTML=Oo),Jo=a(S),m(G.$$.fragment,S),S.forEach(t),Oe=a(e),Ae=l(e,"P",{}),k(Ae).forEach(t),this.h()},h(){T(r,"name","hf:doc:metadata"),T(r,"content",gt),T(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,s){o(document.head,r),d(e,y,s),d(e,c,s),d(e,b,s),p(x,e,s),d(e,h,s),p($,e,s),d(e,Ne,s),d(e,X,s),d(e,Fe,s),p(Y,e,s),d(e,Be,s),d(e,M,s),p(q,M,null),o(M,ao),o(M,me),o(M,so),o(M,pe),o(M,ro),o(M,N),p(R,N,null),o(N,io),o(N,ue),o(M,lo),o(M,U),p(K,U,null),o(U,co),o(U,fe),o(U,ho),o(U,_e),o(U,go),o(U,be),o(M,mo),o(M,F),p(O,F,null),o(F,po),o(F,ve),o(M,uo),o(M,P),p(Q,P,null),o(P,fo),o(P,Me),o(P,_o),o(P,we),o(M,bo),o(M,B),p(ee,B,null),o(B,vo),o(B,ye),d(e,ze,s),p(oe,e,s),d(e,Ve,s),d(e,C,s),p(te,C,null),o(C,Mo),o(C,xe),o(C,wo),p(z,C,null),d(e,De,s),p(ne,e,s),d(e,Ge,s),d(e,I,s),p(ae,I,null),o(I,yo),o(I,$e),o(I,xo),p(V,I,null),d(e,Se,s),d(e,J,s),p(se,J,null),o(J,$o),o(J,ke),o(J,ko),p(D,J,null),d(e,Xe,s),d(e,W,s),p(re,W,null),o(W,To),o(W,Te),o(W,jo),o(W,je),d(e,Ye,s),d(e,Z,s),p(ie,Z,null),o(Z,Ho),o(Z,He),d(e,qe,s),p(le,e,s),d(e,Re,s),d(e,A,s),p(de,A,null),o(A,Uo),o(A,Ue),d(e,Ke,s),d(e,j,s),p(ce,j,null),o(j,Co),o(j,Ce),o(j,Io),o(j,Ie),o(j,Jo),p(G,j,null),d(e,Oe,s),d(e,Ae,s),Qe=!0},p(e,[s]){const w={};s&2&&(w.$$scope={dirty:s,ctx:e}),z.$set(w);const he={};s&2&&(he.$$scope={dirty:s,ctx:e}),V.$set(he);const E={};s&2&&(E.$$scope={dirty:s,ctx:e}),D.$set(E);const ge={};s&2&&(ge.$$scope={dirty:s,ctx:e}),G.$set(ge)},i(e){Qe||(u(x.$$.fragment,e),u($.$$.fragment,e),u(Y.$$.fragment,e),u(q.$$.fragment,e),u(R.$$.fragment,e),u(K.$$.fragment,e),u(O.$$.fragment,e),u(Q.$$.fragment,e),u(ee.$$.fragment,e),u(oe.$$.fragment,e),u(te.$$.fragment,e),u(z.$$.fragment,e),u(ne.$$.fragment,e),u(ae.$$.fragment,e),u(V.$$.fragment,e),u(se.$$.fragment,e),u(D.$$.fragment,e),u(re.$$.fragment,e),u(ie.$$.fragment,e),u(le.$$.fragment,e),u(de.$$.fragment,e),u(ce.$$.fragment,e),u(G.$$.fragment,e),Qe=!0)},o(e){f(x.$$.fragment,e),f($.$$.fragment,e),f(Y.$$.fragment,e),f(q.$$.fragment,e),f(R.$$.fragment,e),f(K.$$.fragment,e),f(O.$$.fragment,e),f(Q.$$.fragment,e),f(ee.$$.fragment,e),f(oe.$$.fragment,e),f(te.$$.fragment,e),f(z.$$.fragment,e),f(ne.$$.fragment,e),f(ae.$$.fragment,e),f(V.$$.fragment,e),f(se.$$.fragment,e),f(D.$$.fragment,e),f(re.$$.fragment,e),f(ie.$$.fragment,e),f(le.$$.fragment,e),f(de.$$.fragment,e),f(ce.$$.fragment,e),f(G.$$.fragment,e),Qe=!1},d(e){e&&(t(y),t(c),t(b),t(h),t(Ne),t(X),t(Fe),t(Be),t(M),t(ze),t(Ve),t(C),t(De),t(Ge),t(I),t(Se),t(J),t(Xe),t(W),t(Ye),t(Z),t(qe),t(Re),t(A),t(Ke),t(j),t(Oe),t(Ae)),t(r),_(x,e),_($,e),_(Y,e),_(q),_(R),_(K),_(O),_(Q),_(ee),_(oe,e),_(te),_(z),_(ne,e),_(ae),_(V),_(se),_(D),_(re),_(ie),_(le,e),_(de),_(ce),_(G)}}}const gt='{"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 mt(L){return nt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wt extends at{constructor(r){super(),st(this,r,mt,ht,tt,{})}}export{wt as component};
