import{s as to,o as oo,n as nt}from"../chunks/scheduler.6062bdaf.js";import{S as no,i as ao,g as i,s as n,r as h,A as so,h as l,f as o,c as a,j as k,u as p,x as y,k as T,y as t,a as d,v as m,d as u,t as f,w as _}from"../chunks/index.4bca734e.js";import{H as Pe,g as ro}from"../chunks/Heading.8904b53b.js";import{T as Ot}from"../chunks/Tip.b9ac1f03.js";import{D as H}from"../chunks/Docstring.5a52fa73.js";import{C as eo}from"../chunks/CodeBlock.fa01571c.js";import{E as Qt}from"../chunks/ExampleCodeBlock.5dee3e03.js";function io(N){let r,w="Example:",c,b,x;return b=new eo({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=w,c=n(),h(b.$$.fragment)},l(g){r=l(g,"P",{"data-svelte-h":!0}),y(r)!=="svelte-11lpom8"&&(r.textContent=w),c=a(g),p(b.$$.fragment,g)},m(g,$){d(g,r,$),d(g,c,$),m(b,g,$),x=!0},p:nt,i(g){x||(u(b.$$.fragment,g),x=!0)},o(g){f(b.$$.fragment,g),x=!1},d(g){g&&(o(r),o(c)),_(b,g)}}}function lo(N){let r,w;return r=new eo({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(){h(r.$$.fragment)},l(c){p(r.$$.fragment,c)},m(c,b){m(r,c,b),w=!0},p:nt,i(c){w||(u(r.$$.fragment,c),w=!0)},o(c){f(r.$$.fragment,c),w=!1},d(c){_(r,c)}}}function co(N){let r,w=`Passing <code>token=True</code> is required when you want to use a private
model.`;return{c(){r=i("p"),r.innerHTML=w},l(c){r=l(c,"P",{"data-svelte-h":!0}),y(r)!=="svelte-1j5fb81"&&(r.innerHTML=w)},m(c,b){d(c,r,b)},p:nt,d(c){c&&o(r)}}}function go(N){let r,w="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=w,c=n(),b=i("ul"),b.innerHTML=x},l(g){r=l(g,"P",{"data-svelte-h":!0}),y(r)!=="svelte-1f6kjc7"&&(r.textContent=w),c=a(g),b=l(g,"UL",{"data-svelte-h":!0}),y(b)!=="svelte-qftit0"&&(b.innerHTML=x)},m(g,$){d(g,r,$),d(g,c,$),d(g,b,$)},p:nt,d(g){g&&(o(r),o(c),o(b))}}}function ho(N){let r,w,c,b,x,g,$,Ze,X,Jt=`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,ze,v,R,at,pe,Wt="A generic mixin to integrate ANY machine learning framework with the Hub.",st,me,Lt=`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.19.3/en/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin">PyTorchModelHubMixin</a> is a good example
of mixin integration with the Hub. Check out our <a href="../guides/integrations">integration guide</a> for more instructions.`,rt,Z,q,it,ue,Nt=`Overwrite this method in subclass to define how to save your model.
Check out our <a href="../guides/integrations">integration guide</a> for instructions.`,lt,U,K,dt,fe,Et="Overwrite this method in subclass to define how to load your model from pretrained.",ct,_e,Pt=`Use <a href="/docs/huggingface_hub/v0.19.3/en/package_reference/file_download#huggingface_hub.hf_hub_download">hf_hub_download()</a> or <a href="/docs/huggingface_hub/v0.19.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.`,gt,be,At='Check out our <a href="../guides/integrations">integration guide</a> for more instructions.',ht,F,O,pt,ye,Zt="Download a model from the Huggingface Hub and instantiate it.",mt,E,Q,ut,ve,Ft="Upload model checkpoint to the Hub.",ft,Me,zt=`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.19.3/en/package_reference/hf_api#huggingface_hub.HfApi.upload_folder">upload_folder()</a> reference for more
details.`,_t,z,ee,bt,we,Bt="Save weights in local directory.",Be,te,De,C,oe,yt,xe,Dt=`Implementation of <a href="/docs/huggingface_hub/v0.19.3/en/package_reference/mixins#huggingface_hub.ModelHubMixin">ModelHubMixin</a> to provide model Hub upload/download capabilities to PyTorch models. The model
is set in evaluation mode by default using <code>model.eval()</code> (dropout modules are deactivated). To train the model,
you should first set it back in training mode with <code>model.train()</code>.`,vt,B,Ve,ne,Ge,I,ae,Mt,$e,Vt=`Implementation of <a href="/docs/huggingface_hub/v0.19.3/en/package_reference/mixins#huggingface_hub.ModelHubMixin">ModelHubMixin</a> to provide model Hub upload/download
capabilities to Keras models.`,wt,D,Se,J,se,xt,ke,Gt=`Instantiate a pretrained Keras model from a pre-trained model from the Hub.
The model is expected to be in <code>SavedModel</code> format.`,$t,V,Xe,W,re,kt,Te,St="Upload model checkpoint to the Hub.",Tt,je,Xt=`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.19.3/en/package_reference/hf_api#huggingface_hub.HfApi.upload_folder">upload_folder()</a> reference for more
details.`,Ye,P,ie,jt,He,Yt=`Saves a Keras model to save_directory in SavedModel format. Use this if
you’re using the Functional or Sequential APIs.`,Re,le,qe,A,de,Ht,Ue,Rt="Load pretrained fastai model from the Hub or from a local directory.",Ke,j,ce,Ut,Ce,qt="Upload learner checkpoint files to the Hub.",Ct,Ie,Kt=`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.`,It,G,Oe,Ae,Qe;return x=new Pe({props:{title:"Mixins & serialization methods",local:"mixins--serialization-methods",headingTag:"h1"}}),$=new Pe({props:{title:"Mixins",local:"mixins",headingTag:"h2"}}),Y=new Pe({props:{title:"Generic",local:"huggingface_hub.ModelHubMixin",headingTag:"h3"}}),R=new H({props:{name:"class huggingface_hub.ModelHubMixin",anchor:"huggingface_hub.ModelHubMixin",parameters:[],source:"https://github.com/huggingface/huggingface_hub/blob/v0.19.3/src/huggingface_hub/hub_mixin.py#L21"}}),q=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.19.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:": 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:": 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.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.19.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.19.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:": typing.Union[str, pathlib.Path]"},{name:"force_download",val:": bool = False"},{name:"resume_download",val:": bool = False"},{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
<a href="https://huggingface.co/docs/transformers/v4.35.1/en/main_classes/model#transformers.PreTrainedModel.save_pretrained" rel="nofollow">save_pretrained</a>, e.g., <code>../path/to/my_model_directory/</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Revision of the model on the Hub. Can be a branch name, a git tag or any commit id.
Defaults to the latest commit on <code>main</code> branch.`,name:"revision"},{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to force (re-)downloading the model weights and configuration files from the Hub, overriding
the existing cache.`,name:"force_download"},{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to delete incompletely received files. Will attempt to resume the download if such a file exists.`,name:"resume_download"},{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on every request.`,name:"proxies"},{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.token",description:`<strong>token</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. By default, it will use the token
cached when running <code>huggingface-cli login</code>.`,name:"token"},{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>str</code>, <code>Path</code>, <em>optional</em>) &#x2014;
Path to the folder where cached files are stored.`,name:"cache_dir"},{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, avoid downloading the file and return the path to the local cached file if it exists.`,name:"local_files_only"},{anchor:"huggingface_hub.ModelHubMixin.from_pretrained.model_kwargs",description:`<strong>model_kwargs</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
Additional kwargs to pass to the model during initialization.`,name:"model_kwargs"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.19.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:": typing.Optional[dict] = None"},{name:"commit_message",val:": str = 'Push model using huggingface_hub.'"},{name:"private",val:": bool = False"},{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"}],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.19.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:": typing.Union[str, pathlib.Path]"},{name:"config",val:": typing.Optional[dict] = None"},{name:"repo_id",val:": typing.Optional[str] = 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.19.3/en/package_reference/mixins#huggingface_hub.ModelHubMixin._from_pretrained">_from_pretrained()</a> method.`,name:"repo_id"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.19.3/src/huggingface_hub/hub_mixin.py#L30"}}),te=new Pe({props:{title:"PyTorch",local:"huggingface_hub.PyTorchModelHubMixin",headingTag:"h3"}}),oe=new H({props:{name:"class huggingface_hub.PyTorchModelHubMixin",anchor:"huggingface_hub.PyTorchModelHubMixin",parameters:[],source:"https://github.com/huggingface/huggingface_hub/blob/v0.19.3/src/huggingface_hub/hub_mixin.py#L290"}}),B=new Qt({props:{anchor:"huggingface_hub.PyTorchModelHubMixin.example",$$slots:{default:[io]},$$scope:{ctx:N}}}),ne=new Pe({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.19.3/src/huggingface_hub/keras_mixin.py#L397"}}),D=new Qt({props:{anchor:"huggingface_hub.KerasModelHubMixin.example",$$slots:{default:[lo]},$$scope:{ctx:N}}}),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.35.1/en/main_classes/model#transformers.PreTrainedModel.save_pretrained" rel="nofollow">save_pretrained</a>, e.g.,
<code>./my_model_directory/</code>.</li>
<li><code>None</code> if you are both providing the configuration and state
dictionary (resp. with keyword arguments <code>config</code> and
<code>state_dict</code>).</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"huggingface_hub.from_pretrained_keras.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to force the (re-)download of the model weights and
configuration files, overriding the cached versions if they exist.`,name:"force_download"},{anchor:"huggingface_hub.from_pretrained_keras.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to delete incompletely received files. Will attempt to
resume the download if such a file exists.`,name:"resume_download"},{anchor:"huggingface_hub.from_pretrained_keras.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, e.g.,
<code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The
proxies are used on each request.`,name:"proxies"},{anchor:"huggingface_hub.from_pretrained_keras.token",description:`<strong>token</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If
<code>True</code>, will use the token generated when running <code>transformers-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"huggingface_hub.from_pretrained_keras.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model
configuration should be cached if the standard cache should not be
used.`,name:"cache_dir"},{anchor:"huggingface_hub.from_pretrained_keras.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only look at local files (i.e., do not try to download
the model).`,name:"local_files_only(bool,"},{anchor:"huggingface_hub.from_pretrained_keras.model_kwargs",description:`<strong>model_kwargs</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
model_kwargs will be passed to the model during initialization`,name:"model_kwargs"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.19.3/src/huggingface_hub/keras_mixin.py#L216"}}),V=new Ot({props:{$$slots:{default:[co]},$$scope:{ctx:N}}}),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:": typing.Optional[dict] = None"},{name:"commit_message",val:": str = 'Push Keras model using huggingface_hub.'"},{name:"private",val:": bool = False"},{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>, 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/blame/main/modelcard.md" 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.19.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:": typing.Union[str, pathlib.Path]"},{name:"config",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = 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/blame/main/modelcard.md" 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.19.3/src/huggingface_hub/keras_mixin.py#L131"}}),le=new Pe({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:": 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/v0.19.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:": 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>, 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.19.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 Ot({props:{$$slots:{default:[go]},$$scope:{ctx:N}}}),{c(){r=i("meta"),w=n(),c=i("p"),b=n(),h(x.$$.fragment),g=n(),h($.$$.fragment),Ze=n(),X=i("p"),X.innerHTML=Jt,Fe=n(),h(Y.$$.fragment),ze=n(),v=i("div"),h(R.$$.fragment),at=n(),pe=i("p"),pe.textContent=Wt,st=n(),me=i("p"),me.innerHTML=Lt,rt=n(),Z=i("div"),h(q.$$.fragment),it=n(),ue=i("p"),ue.innerHTML=Nt,lt=n(),U=i("div"),h(K.$$.fragment),dt=n(),fe=i("p"),fe.textContent=Et,ct=n(),_e=i("p"),_e.innerHTML=Pt,gt=n(),be=i("p"),be.innerHTML=At,ht=n(),F=i("div"),h(O.$$.fragment),pt=n(),ye=i("p"),ye.textContent=Zt,mt=n(),E=i("div"),h(Q.$$.fragment),ut=n(),ve=i("p"),ve.textContent=Ft,ft=n(),Me=i("p"),Me.innerHTML=zt,_t=n(),z=i("div"),h(ee.$$.fragment),bt=n(),we=i("p"),we.textContent=Bt,Be=n(),h(te.$$.fragment),De=n(),C=i("div"),h(oe.$$.fragment),yt=n(),xe=i("p"),xe.innerHTML=Dt,vt=n(),h(B.$$.fragment),Ve=n(),h(ne.$$.fragment),Ge=n(),I=i("div"),h(ae.$$.fragment),Mt=n(),$e=i("p"),$e.innerHTML=Vt,wt=n(),h(D.$$.fragment),Se=n(),J=i("div"),h(se.$$.fragment),xt=n(),ke=i("p"),ke.innerHTML=Gt,$t=n(),h(V.$$.fragment),Xe=n(),W=i("div"),h(re.$$.fragment),kt=n(),Te=i("p"),Te.textContent=St,Tt=n(),je=i("p"),je.innerHTML=Xt,Ye=n(),P=i("div"),h(ie.$$.fragment),jt=n(),He=i("p"),He.textContent=Yt,Re=n(),h(le.$$.fragment),qe=n(),A=i("div"),h(de.$$.fragment),Ht=n(),Ue=i("p"),Ue.textContent=Rt,Ke=n(),j=i("div"),h(ce.$$.fragment),Ut=n(),Ce=i("p"),Ce.textContent=qt,Ct=n(),Ie=i("p"),Ie.innerHTML=Kt,It=n(),h(G.$$.fragment),Oe=n(),Ae=i("p"),this.h()},l(e){const s=so("svelte-u9bgzb",document.head);r=l(s,"META",{name:!0,content:!0}),s.forEach(o),w=a(e),c=l(e,"P",{}),k(c).forEach(o),b=a(e),p(x.$$.fragment,e),g=a(e),p($.$$.fragment,e),Ze=a(e),X=l(e,"P",{"data-svelte-h":!0}),y(X)!=="svelte-by7ppc"&&(X.innerHTML=Jt),Fe=a(e),p(Y.$$.fragment,e),ze=a(e),v=l(e,"DIV",{class:!0});var M=k(v);p(R.$$.fragment,M),at=a(M),pe=l(M,"P",{"data-svelte-h":!0}),y(pe)!=="svelte-1q74itk"&&(pe.textContent=Wt),st=a(M),me=l(M,"P",{"data-svelte-h":!0}),y(me)!=="svelte-1l4ddpl"&&(me.innerHTML=Lt),rt=a(M),Z=l(M,"DIV",{class:!0});var ge=k(Z);p(q.$$.fragment,ge),it=a(ge),ue=l(ge,"P",{"data-svelte-h":!0}),y(ue)!=="svelte-1fdydm0"&&(ue.innerHTML=Nt),ge.forEach(o),lt=a(M),U=l(M,"DIV",{class:!0});var L=k(U);p(K.$$.fragment,L),dt=a(L),fe=l(L,"P",{"data-svelte-h":!0}),y(fe)!=="svelte-1totzue"&&(fe.textContent=Et),ct=a(L),_e=l(L,"P",{"data-svelte-h":!0}),y(_e)!=="svelte-1x40tl0"&&(_e.innerHTML=Pt),gt=a(L),be=l(L,"P",{"data-svelte-h":!0}),y(be)!=="svelte-1xccgfy"&&(be.innerHTML=At),L.forEach(o),ht=a(M),F=l(M,"DIV",{class:!0});var he=k(F);p(O.$$.fragment,he),pt=a(he),ye=l(he,"P",{"data-svelte-h":!0}),y(ye)!=="svelte-ydwjgk"&&(ye.textContent=Zt),he.forEach(o),mt=a(M),E=l(M,"DIV",{class:!0});var Je=k(E);p(Q.$$.fragment,Je),ut=a(Je),ve=l(Je,"P",{"data-svelte-h":!0}),y(ve)!=="svelte-skcyeb"&&(ve.textContent=Ft),ft=a(Je),Me=l(Je,"P",{"data-svelte-h":!0}),y(Me)!=="svelte-1gztevj"&&(Me.innerHTML=zt),Je.forEach(o),_t=a(M),z=l(M,"DIV",{class:!0});var et=k(z);p(ee.$$.fragment,et),bt=a(et),we=l(et,"P",{"data-svelte-h":!0}),y(we)!=="svelte-usyekl"&&(we.textContent=Bt),et.forEach(o),M.forEach(o),Be=a(e),p(te.$$.fragment,e),De=a(e),C=l(e,"DIV",{class:!0});var We=k(C);p(oe.$$.fragment,We),yt=a(We),xe=l(We,"P",{"data-svelte-h":!0}),y(xe)!=="svelte-1qth8v2"&&(xe.innerHTML=Dt),vt=a(We),p(B.$$.fragment,We),We.forEach(o),Ve=a(e),p(ne.$$.fragment,e),Ge=a(e),I=l(e,"DIV",{class:!0});var Le=k(I);p(ae.$$.fragment,Le),Mt=a(Le),$e=l(Le,"P",{"data-svelte-h":!0}),y($e)!=="svelte-1ogaant"&&($e.innerHTML=Vt),wt=a(Le),p(D.$$.fragment,Le),Le.forEach(o),Se=a(e),J=l(e,"DIV",{class:!0});var Ne=k(J);p(se.$$.fragment,Ne),xt=a(Ne),ke=l(Ne,"P",{"data-svelte-h":!0}),y(ke)!=="svelte-13dzwpk"&&(ke.innerHTML=Gt),$t=a(Ne),p(V.$$.fragment,Ne),Ne.forEach(o),Xe=a(e),W=l(e,"DIV",{class:!0});var Ee=k(W);p(re.$$.fragment,Ee),kt=a(Ee),Te=l(Ee,"P",{"data-svelte-h":!0}),y(Te)!=="svelte-skcyeb"&&(Te.textContent=St),Tt=a(Ee),je=l(Ee,"P",{"data-svelte-h":!0}),y(je)!=="svelte-1gztevj"&&(je.innerHTML=Xt),Ee.forEach(o),Ye=a(e),P=l(e,"DIV",{class:!0});var tt=k(P);p(ie.$$.fragment,tt),jt=a(tt),He=l(tt,"P",{"data-svelte-h":!0}),y(He)!=="svelte-1y1rkkk"&&(He.textContent=Yt),tt.forEach(o),Re=a(e),p(le.$$.fragment,e),qe=a(e),A=l(e,"DIV",{class:!0});var ot=k(A);p(de.$$.fragment,ot),Ht=a(ot),Ue=l(ot,"P",{"data-svelte-h":!0}),y(Ue)!=="svelte-1fexh91"&&(Ue.textContent=Rt),ot.forEach(o),Ke=a(e),j=l(e,"DIV",{class:!0});var S=k(j);p(ce.$$.fragment,S),Ut=a(S),Ce=l(S,"P",{"data-svelte-h":!0}),y(Ce)!=="svelte-18c83zg"&&(Ce.textContent=qt),Ct=a(S),Ie=l(S,"P",{"data-svelte-h":!0}),y(Ie)!=="svelte-1jbgd9l"&&(Ie.innerHTML=Kt),It=a(S),p(G.$$.fragment,S),S.forEach(o),Oe=a(e),Ae=l(e,"P",{}),k(Ae).forEach(o),this.h()},h(){T(r,"name","hf:doc:metadata"),T(r,"content",po),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(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(E,"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(v,"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(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(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){t(document.head,r),d(e,w,s),d(e,c,s),d(e,b,s),m(x,e,s),d(e,g,s),m($,e,s),d(e,Ze,s),d(e,X,s),d(e,Fe,s),m(Y,e,s),d(e,ze,s),d(e,v,s),m(R,v,null),t(v,at),t(v,pe),t(v,st),t(v,me),t(v,rt),t(v,Z),m(q,Z,null),t(Z,it),t(Z,ue),t(v,lt),t(v,U),m(K,U,null),t(U,dt),t(U,fe),t(U,ct),t(U,_e),t(U,gt),t(U,be),t(v,ht),t(v,F),m(O,F,null),t(F,pt),t(F,ye),t(v,mt),t(v,E),m(Q,E,null),t(E,ut),t(E,ve),t(E,ft),t(E,Me),t(v,_t),t(v,z),m(ee,z,null),t(z,bt),t(z,we),d(e,Be,s),m(te,e,s),d(e,De,s),d(e,C,s),m(oe,C,null),t(C,yt),t(C,xe),t(C,vt),m(B,C,null),d(e,Ve,s),m(ne,e,s),d(e,Ge,s),d(e,I,s),m(ae,I,null),t(I,Mt),t(I,$e),t(I,wt),m(D,I,null),d(e,Se,s),d(e,J,s),m(se,J,null),t(J,xt),t(J,ke),t(J,$t),m(V,J,null),d(e,Xe,s),d(e,W,s),m(re,W,null),t(W,kt),t(W,Te),t(W,Tt),t(W,je),d(e,Ye,s),d(e,P,s),m(ie,P,null),t(P,jt),t(P,He),d(e,Re,s),m(le,e,s),d(e,qe,s),d(e,A,s),m(de,A,null),t(A,Ht),t(A,Ue),d(e,Ke,s),d(e,j,s),m(ce,j,null),t(j,Ut),t(j,Ce),t(j,Ct),t(j,Ie),t(j,It),m(G,j,null),d(e,Oe,s),d(e,Ae,s),Qe=!0},p(e,[s]){const M={};s&2&&(M.$$scope={dirty:s,ctx:e}),B.$set(M);const ge={};s&2&&(ge.$$scope={dirty:s,ctx:e}),D.$set(ge);const L={};s&2&&(L.$$scope={dirty:s,ctx:e}),V.$set(L);const he={};s&2&&(he.$$scope={dirty:s,ctx:e}),G.$set(he)},i(e){Qe||(u(x.$$.fragment,e),u($.$$.fragment,e),u(Y.$$.fragment,e),u(R.$$.fragment,e),u(q.$$.fragment,e),u(K.$$.fragment,e),u(O.$$.fragment,e),u(Q.$$.fragment,e),u(ee.$$.fragment,e),u(te.$$.fragment,e),u(oe.$$.fragment,e),u(B.$$.fragment,e),u(ne.$$.fragment,e),u(ae.$$.fragment,e),u(D.$$.fragment,e),u(se.$$.fragment,e),u(V.$$.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(R.$$.fragment,e),f(q.$$.fragment,e),f(K.$$.fragment,e),f(O.$$.fragment,e),f(Q.$$.fragment,e),f(ee.$$.fragment,e),f(te.$$.fragment,e),f(oe.$$.fragment,e),f(B.$$.fragment,e),f(ne.$$.fragment,e),f(ae.$$.fragment,e),f(D.$$.fragment,e),f(se.$$.fragment,e),f(V.$$.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&&(o(w),o(c),o(b),o(g),o(Ze),o(X),o(Fe),o(ze),o(v),o(Be),o(De),o(C),o(Ve),o(Ge),o(I),o(Se),o(J),o(Xe),o(W),o(Ye),o(P),o(Re),o(qe),o(A),o(Ke),o(j),o(Oe),o(Ae)),o(r),_(x,e),_($,e),_(Y,e),_(R),_(q),_(K),_(O),_(Q),_(ee),_(te,e),_(oe),_(B),_(ne,e),_(ae),_(D),_(se),_(V),_(re),_(ie),_(le,e),_(de),_(ce),_(G)}}}const po='{"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 mo(N){return oo(()=>{new URLSearchParams(window.location.search).get("fw"),window.hfDocGoto=ro}),[]}class wo extends no{constructor(r){super(),ao(this,r,mo,ho,to,{})}}export{wo as component};
