import{s as Ao,o as Eo,n as Vo}from"../chunks/scheduler.cc52f4b9.js";import{S as zo,i as Lo,e as a,s as o,c as y,h as Xo,a as r,d as l,b as p,f as No,g as T,j as f,k as W,l as Fo,m as n,n as U,o as d,u as ee,t as b,p as _,q as So,r as Do,v as te}from"../chunks/index.9480bb2b.js";import{T as Yo}from"../chunks/Tip.f7b80743.js";import{C as Oo,H as me,E as Po}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.009dc98d.js";import{Y as Xi}from"../chunks/Youtube.7b12d9e8.js";import{C as h}from"../chunks/CodeBlock.184aadb6.js";import{C as Ho}from"../chunks/CourseFloatingBanner.6488bde3.js";import{F as qo}from"../chunks/FrameworkSwitchCourse.42d12053.js";function Ko(g){let i,m;return i=new Ho({props:{chapter:4,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/zh-CN/chapter4/section3_tf.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/zh-CN/chapter4/section3_tf.ipynb"}]}}),{c(){y(i.$$.fragment)},l(s){T(i.$$.fragment,s)},m(s,c){U(i,s,c),m=!0},i(s){m||(b(i.$$.fragment,s),m=!0)},o(s){d(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function ep(g){let i,m;return i=new Ho({props:{chapter:4,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/zh-CN/chapter4/section3_pt.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/zh-CN/chapter4/section3_pt.ipynb"}]}}),{c(){y(i.$$.fragment)},l(s){T(i.$$.fragment,s)},m(s,c){U(i,s,c),m=!0},i(s){m||(b(i.$$.fragment,s),m=!0)},o(s){d(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function tp(g){let i,m;return i=new Xi({props:{id:"pUh5cGmNV8Y"}}),{c(){y(i.$$.fragment)},l(s){T(i.$$.fragment,s)},m(s,c){U(i,s,c),m=!0},i(s){m||(b(i.$$.fragment,s),m=!0)},o(s){d(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function lp(g){let i,m;return i=new Xi({props:{id:"Zh0FfmVrKX0"}}),{c(){y(i.$$.fragment)},l(s){T(i.$$.fragment,s)},m(s,c){U(i,s,c),m=!0},i(s){m||(b(i.$$.fragment,s),m=!0)},o(s){d(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function np(g){let i,m="如果你使用 Keras 来训练你的模型，则将其上传到 Hub 的最简单方法是在调用 <code>model.fit()</code> 添加 <code>PushToHubCallback</code> ：",s,c,w,u,$="然后，你应该在调用 <code>model.fit()</code> 时添加 <code>callbacks=[callback]</code> 。回调函数将在每次保存模型时（这里是每个训练周期）将你的模型上传到 Hub 的你的账户下的一个仓库。该仓库的名称你选择的输出目录名称相同（此处为 <code>bert-finetuned-mrpc</code> ），但你可以通过 <code>hub_model_id = &quot;a_different_name&quot;</code> 指定一个不同的名称。",C,J,v="要将你的模型上传到你所属的组织，只需设置如下 <code>hub_model_id = my_organization/my_repo_name</code> 。",Z;return c=new h({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFB1c2hUb0h1YkNhbGxiYWNrJTBBJTBBY2FsbGJhY2slMjAlM0QlMjBQdXNoVG9IdWJDYWxsYmFjayglMEElMjAlMjAlMjAlMjAlMjJiZXJ0LWZpbmV0dW5lZC1tcnBjJTIyJTJDJTIwc2F2ZV9zdHJhdGVneSUzRCUyMmVwb2NoJTIyJTJDJTIwdG9rZW5pemVyJTNEdG9rZW5pemVyJTBBKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PushToHubCallback

callback = PushToHubCallback(
    <span class="hljs-string">&quot;bert-finetuned-mrpc&quot;</span>, save_strategy=<span class="hljs-string">&quot;epoch&quot;</span>, tokenizer=tokenizer
)`,wrap:!1}}),{c(){i=a("p"),i.innerHTML=m,s=o(),y(c.$$.fragment),w=o(),u=a("p"),u.innerHTML=$,C=o(),J=a("p"),J.innerHTML=v},l(M){i=r(M,"P",{"data-svelte-h":!0}),f(i)!=="svelte-i1obt0"&&(i.innerHTML=m),s=p(M),T(c.$$.fragment,M),w=p(M),u=r(M,"P",{"data-svelte-h":!0}),f(u)!=="svelte-127bdlb"&&(u.innerHTML=$),C=p(M),J=r(M,"P",{"data-svelte-h":!0}),f(J)!=="svelte-1xp54h0"&&(J.innerHTML=v)},m(M,k){n(M,i,k),n(M,s,k),U(c,M,k),n(M,w,k),n(M,u,k),n(M,C,k),n(M,J,k),Z=!0},i(M){Z||(b(c.$$.fragment,M),Z=!0)},o(M){d(c.$$.fragment,M),Z=!1},d(M){M&&(l(i),l(s),l(w),l(u),l(C),l(J)),_(c,M)}}}function ip(g){let i,m="如果你已经尝试使用过 <code>Trainer</code> API 训练模型，将其上传到 Hub 的最简单方法是在定义 <code>TrainingArguments</code> 时设置 <code>push_to_hub=True</code> ：",s,c,w,u,$="这样，调用 <code>trainer.train()</code> 的时候， <code>Trainer</code> 会在每次保存模型时（这里是每个训练周期）将其上传到 Hub 中你的账户下的一个仓库。该仓库的名称与你选择的输出目录名称相同（这里是 <code>bert-finetuned-mrpc</code> ），但你可以通过 <code>hub_model_id = &quot;a_different_name&quot;</code> 指定一个不同的名称。",C,J,v="若要将你的模型上传到你所属的组织，只需设置 <code>hub_model_id = my_organization/my_repo_name</code> 。",Z,M,k="最后，需要在训练循环结束后运行 <code>trainer.push_to_hub()</code> 上传模型的最新版本。它还会生成一份包含所有相关元数据的模型卡片，包含使用的超参数和评估结果！以下是一个模型卡片的示例：",x,Q,ae='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/model_card.png" alt="An example of an auto-generated model card." width="100%"/>',B;return c=new h({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTBBJTBBdHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMCUyMmJlcnQtZmluZXR1bmVkLW1ycGMlMjIlMkMlMjBzYXZlX3N0cmF0ZWd5JTNEJTIyZXBvY2glMjIlMkMlMjBwdXNoX3RvX2h1YiUzRFRydWUlMEEp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments

training_args = TrainingArguments(
    <span class="hljs-string">&quot;bert-finetuned-mrpc&quot;</span>, save_strategy=<span class="hljs-string">&quot;epoch&quot;</span>, push_to_hub=<span class="hljs-literal">True</span>
)`,wrap:!1}}),{c(){i=a("p"),i.innerHTML=m,s=o(),y(c.$$.fragment),w=o(),u=a("p"),u.innerHTML=$,C=o(),J=a("p"),J.innerHTML=v,Z=o(),M=a("p"),M.innerHTML=k,x=o(),Q=a("div"),Q.innerHTML=ae,this.h()},l(j){i=r(j,"P",{"data-svelte-h":!0}),f(i)!=="svelte-3t0wzw"&&(i.innerHTML=m),s=p(j),T(c.$$.fragment,j),w=p(j),u=r(j,"P",{"data-svelte-h":!0}),f(u)!=="svelte-1ijvlw7"&&(u.innerHTML=$),C=p(j),J=r(j,"P",{"data-svelte-h":!0}),f(J)!=="svelte-14bpeck"&&(J.innerHTML=v),Z=p(j),M=r(j,"P",{"data-svelte-h":!0}),f(M)!=="svelte-1m7kq2x"&&(M.innerHTML=k),x=p(j),Q=r(j,"DIV",{class:!0,"data-svelte-h":!0}),f(Q)!=="svelte-1lhrimn"&&(Q.innerHTML=ae),this.h()},h(){W(Q,"class","flex justify-center")},m(j,G){n(j,i,G),n(j,s,G),U(c,j,G),n(j,w,G),n(j,u,G),n(j,C,G),n(j,J,G),n(j,Z,G),n(j,M,G),n(j,x,G),n(j,Q,G),B=!0},i(j){B||(b(c.$$.fragment,j),B=!0)},o(j){d(c.$$.fragment,j),B=!1},d(j){j&&(l(i),l(s),l(w),l(u),l(C),l(J),l(Z),l(M),l(x),l(Q)),_(c,j)}}}function sp(g){let i,m;return i=new h({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yTWFza2VkTE0lMkMlMjBBdXRvVG9rZW5pemVyJTBBJTBBY2hlY2twb2ludCUyMCUzRCUyMCUyMmNhbWVtYmVydC1iYXNlJTIyJTBBJTBBbW9kZWwlMjAlM0QlMjBURkF1dG9Nb2RlbEZvck1hc2tlZExNLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForMaskedLM, AutoTokenizer

checkpoint = <span class="hljs-string">&quot;camembert-base&quot;</span>

model = TFAutoModelForMaskedLM.from_pretrained(checkpoint)
tokenizer = AutoTokenizer.from_pretrained(checkpoint)`,wrap:!1}}),{c(){y(i.$$.fragment)},l(s){T(i.$$.fragment,s)},m(s,c){U(i,s,c),m=!0},i(s){m||(b(i.$$.fragment,s),m=!0)},o(s){d(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function op(g){let i,m;return i=new h({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvck1hc2tlZExNJTJDJTIwQXV0b1Rva2VuaXplciUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJjYW1lbWJlcnQtYmFzZSUyMiUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yTWFza2VkTE0uZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForMaskedLM, AutoTokenizer

checkpoint = <span class="hljs-string">&quot;camembert-base&quot;</span>

model = AutoModelForMaskedLM.from_pretrained(checkpoint)
tokenizer = AutoTokenizer.from_pretrained(checkpoint)`,wrap:!1}}),{c(){y(i.$$.fragment)},l(s){T(i.$$.fragment,s)},m(s,c){U(i,s,c),m=!0},i(s){m||(b(i.$$.fragment,s),m=!0)},o(s){d(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function pp(g){let i,m='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/push_to_hub_dummy_model_tf.png" alt="Dummy model containing both the tokenizer and model files." width="80%"/>';return{c(){i=a("div"),i.innerHTML=m,this.h()},l(s){i=r(s,"DIV",{class:!0,"data-svelte-h":!0}),f(i)!=="svelte-5a3kk0"&&(i.innerHTML=m),this.h()},h(){W(i,"class","flex justify-center")},m(s,c){n(s,i,c)},d(s){s&&l(i)}}}function mp(g){let i,m='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/push_to_hub_dummy_model.png" alt="Dummy model containing both the tokenizer and model files." width="80%"/>';return{c(){i=a("div"),i.innerHTML=m,this.h()},l(s){i=r(s,"DIV",{class:!0,"data-svelte-h":!0}),f(i)!=="svelte-19u1vyv"&&(i.innerHTML=m),this.h()},h(){W(i,"class","flex justify-center")},m(s,c){n(s,i,c)},d(s){s&&l(i)}}}function ap(g){let i,m="✏️ <strong>试试看</strong> 获取与 <code>bert-base-cased</code> checkpoint 相关的模型和 tokenizer 并使用 <code>push_to_hub()</code> 方法将它们上传到你账户中的一个仓库。并请仔细检查该仓库在你的页面上显示是否正常。";return{c(){i=a("p"),i.innerHTML=m},l(s){i=r(s,"P",{"data-svelte-h":!0}),f(i)!=="svelte-1hv0ck0"&&(i.innerHTML=m)},m(s,c){n(s,i,c)},p:Vo,d(s){s&&l(i)}}}function rp(g){let i,m;return i=new h({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yTWFza2VkTE0lMkMlMjBBdXRvVG9rZW5pemVyJTBBJTBBY2hlY2twb2ludCUyMCUzRCUyMCUyMmNhbWVtYmVydC1iYXNlJTIyJTBBJTBBbW9kZWwlMjAlM0QlMjBURkF1dG9Nb2RlbEZvck1hc2tlZExNLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBJTBBJTIzJTIwJUU1JUFGJUI5JUU2JUE4JUExJUU1JTlFJThCJUU4JUJGJTlCJUU4JUExJThDJUU0JUI4JTgwJUU0JUJBJTlCJUU2JTkzJThEJUU0JUJEJTlDJTJDJUU4JUFFJUFEJUU3JUJCJTgzJUUzJTgwJTgxJUU1JUJFJUFFJUU4JUIwJTgzLi4uJTBBJTBBbW9kZWwuc2F2ZV9wcmV0cmFpbmVkKCUyMiUzQ3BhdGhfdG9fZHVtbXlfZm9sZGVyJTNFJTIyKSUwQXRva2VuaXplci5zYXZlX3ByZXRyYWluZWQoJTIyJTNDcGF0aF90b19kdW1teV9mb2xkZXIlM0UlMjIp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForMaskedLM, AutoTokenizer

checkpoint = <span class="hljs-string">&quot;camembert-base&quot;</span>

model = TFAutoModelForMaskedLM.from_pretrained(checkpoint)
tokenizer = AutoTokenizer.from_pretrained(checkpoint)

<span class="hljs-comment"># 对模型进行一些操作,训练、微调...</span>

model.save_pretrained(<span class="hljs-string">&quot;&lt;path_to_dummy_folder&gt;&quot;</span>)
tokenizer.save_pretrained(<span class="hljs-string">&quot;&lt;path_to_dummy_folder&gt;&quot;</span>)`,wrap:!1}}),{c(){y(i.$$.fragment)},l(s){T(i.$$.fragment,s)},m(s,c){U(i,s,c),m=!0},i(s){m||(b(i.$$.fragment,s),m=!0)},o(s){d(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function fp(g){let i,m;return i=new h({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvck1hc2tlZExNJTJDJTIwQXV0b1Rva2VuaXplciUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJjYW1lbWJlcnQtYmFzZSUyMiUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yTWFza2VkTE0uZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCklMEElMEElMjMlMjAlRTUlQUYlQjklRTYlQTglQTElRTUlOUUlOEIlRTglQkYlOUIlRTglQTElOEMlRTQlQjglODAlRTQlQkElOUIlRTYlOTMlOEQlRTQlQkQlOUMlMkMlRTglQUUlQUQlRTclQkIlODMlRTMlODAlODElRTUlQkUlQUUlRTglQjAlODMuLi4lMEElMEFtb2RlbC5zYXZlX3ByZXRyYWluZWQoJTIyJTNDcGF0aF90b19kdW1teV9mb2xkZXIlM0UlMjIpJTBBdG9rZW5pemVyLnNhdmVfcHJldHJhaW5lZCglMjIlM0NwYXRoX3RvX2R1bW15X2ZvbGRlciUzRSUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForMaskedLM, AutoTokenizer

checkpoint = <span class="hljs-string">&quot;camembert-base&quot;</span>

model = AutoModelForMaskedLM.from_pretrained(checkpoint)
tokenizer = AutoTokenizer.from_pretrained(checkpoint)

<span class="hljs-comment"># 对模型进行一些操作,训练、微调...</span>

model.save_pretrained(<span class="hljs-string">&quot;&lt;path_to_dummy_folder&gt;&quot;</span>)
tokenizer.save_pretrained(<span class="hljs-string">&quot;&lt;path_to_dummy_folder&gt;&quot;</span>)`,wrap:!1}}),{c(){y(i.$$.fragment)},l(s){T(i.$$.fragment,s)},m(s,c){U(i,s,c),m=!0},i(s){m||(b(i.$$.fragment,s),m=!0)},o(s){d(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function up(g){let i,m,s,c="如果你尝试查看文件大小（例如， <code>ls -lh</code> ），你应该会看到模型状态字典文件 （t5_model.h5） 唯一的异常的文件，超过了 400 MB。",w;return i=new h({props:{code:"Y29uZmlnLmpzb24lMjAlMjBSRUFETUUubWQlMjAlMjBzZW50ZW5jZXBpZWNlLmJwZS5tb2RlbCUyMCUyMHNwZWNpYWxfdG9rZW5zX21hcC5qc29uJTIwJTIwdGZfbW9kZWwuaDUlMjAlMjB0b2tlbml6ZXJfY29uZmlnLmpzb24lMjAlMjB0b2tlbml6ZXIuanNvbg==",highlighted:"config.json  README.md  sentencepiece.bpe.model  special_tokens_map.json  tf_model.h5  tokenizer_config.json  tokenizer.json",wrap:!1}}),{c(){y(i.$$.fragment),m=o(),s=a("p"),s.innerHTML=c},l(u){T(i.$$.fragment,u),m=p(u),s=r(u,"P",{"data-svelte-h":!0}),f(s)!=="svelte-r9ypdf"&&(s.innerHTML=c)},m(u,$){U(i,u,$),n(u,m,$),n(u,s,$),w=!0},i(u){w||(b(i.$$.fragment,u),w=!0)},o(u){d(i.$$.fragment,u),w=!1},d(u){u&&(l(m),l(s)),_(i,u)}}}function cp(g){let i,m,s,c="如果你尝试查看文件大小（例如，使用 <code>ls -lh</code> ），你应该看到模型状态字典文件（pytorch_model.bin）是唯一的异常的文件，超过了 400 MB。",w;return i=new h({props:{code:"Y29uZmlnLmpzb24lMjAlMjBweXRvcmNoX21vZGVsLmJpbiUyMCUyMFJFQURNRS5tZCUyMCUyMHNlbnRlbmNlcGllY2UuYnBlLm1vZGVsJTIwJTIwc3BlY2lhbF90b2tlbnNfbWFwLmpzb24lMjB0b2tlbml6ZXJfY29uZmlnLmpzb24lMjAlMjB0b2tlbml6ZXIuanNvbg==",highlighted:"config.json  pytorch_model.bin  README.md  sentencepiece.bpe.model  special_tokens_map.json tokenizer_config.json  tokenizer.json",wrap:!1}}),{c(){y(i.$$.fragment),m=o(),s=a("p"),s.innerHTML=c},l(u){T(i.$$.fragment,u),m=p(u),s=r(u,"P",{"data-svelte-h":!0}),f(s)!=="svelte-bnlafz"&&(s.innerHTML=c)},m(u,$){U(i,u,$),n(u,m,$),n(u,s,$),w=!0},i(u){w||(b(i.$$.fragment,u),w=!0)},o(u){d(i.$$.fragment,u),w=!1},d(u){u&&(l(m),l(s)),_(i,u)}}}function Mp(g){let i;return{c(){i=So("✏️ 当通过网页界面创建仓库时， `.gitattributes` 文件会自动将某些扩展名（如 `.bin` 和 `.h5` ）的文件视为大文件，你无需对 git-lfs 进行任何设置即可跟踪它们。")},l(m){i=Do(m,"✏️ 当通过网页界面创建仓库时， `.gitattributes` 文件会自动将某些扩展名（如 `.bin` 和 `.h5` ）的文件视为大文件，你无需对 git-lfs 进行任何设置即可跟踪它们。")},m(m,s){n(m,i,s)},d(m){m&&l(i)}}}function dp(g){let i,m;return i=new h({props:{code:"T24lMjBicmFuY2glMjBtYWluJTBBWW91ciUyMGJyYW5jaCUyMGlzJTIwdXAlMjB0byUyMGRhdGUlMjB3aXRoJTIwJ29yaWdpbiUyRm1haW4nLiUwQSUwQUNoYW5nZXMlMjB0byUyMGJlJTIwY29tbWl0dGVkJTNBJTBBJTIwJTIwKHVzZSUyMCUyMmdpdCUyMHJlc3RvcmUlMjAtLXN0YWdlZCUyMCUzQ2ZpbGUlM0UuLi4lMjIlMjB0byUyMHVuc3RhZ2UpJTBBJTIwJTIwbW9kaWZpZWQlM0ElMjAlMjAlMjAuZ2l0YXR0cmlidXRlcyUwQSUyMCUyMCUwOW5ldyUyMGZpbGUlM0ElMjAlMjAlMjBjb25maWcuanNvbiUwQSUwOW5ldyUyMGZpbGUlM0ElMjAlMjAlMjBzZW50ZW5jZXBpZWNlLmJwZS5tb2RlbCUwQSUwOW5ldyUyMGZpbGUlM0ElMjAlMjAlMjBzcGVjaWFsX3Rva2Vuc19tYXAuanNvbiUwQSUwOW5ldyUyMGZpbGUlM0ElMjAlMjAlMjB0Zl9tb2RlbC5oNSUwQSUwOW5ldyUyMGZpbGUlM0ElMjAlMjAlMjB0b2tlbml6ZXIuanNvbiUwQSUwOW5ldyUyMGZpbGUlM0ElMjAlMjAlMjB0b2tlbml6ZXJfY29uZmlnLmpzb24=",highlighted:`On branch main
Your branch is up to <span class="hljs-built_in">date</span> with <span class="hljs-string">&#x27;origin/main&#x27;</span>.

Changes to be committed:
  (use <span class="hljs-string">&quot;git restore --staged &lt;file&gt;...&quot;</span> to unstage)
  modified:   .gitattributes
  	new file:   config.json
	new file:   sentencepiece.bpe.model
	new file:   special_tokens_map.json
	new file:   tf_model.h5
	new file:   tokenizer.json
	new file:   tokenizer_config.json`,wrap:!1}}),{c(){y(i.$$.fragment)},l(s){T(i.$$.fragment,s)},m(s,c){U(i,s,c),m=!0},i(s){m||(b(i.$$.fragment,s),m=!0)},o(s){d(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function bp(g){let i,m;return i=new h({props:{code:"T24lMjBicmFuY2glMjBtYWluJTBBWW91ciUyMGJyYW5jaCUyMGlzJTIwdXAlMjB0byUyMGRhdGUlMjB3aXRoJTIwJ29yaWdpbiUyRm1haW4nLiUwQSUwQUNoYW5nZXMlMjB0byUyMGJlJTIwY29tbWl0dGVkJTNBJTBBJTIwJTIwKHVzZSUyMCUyMmdpdCUyMHJlc3RvcmUlMjAtLXN0YWdlZCUyMCUzQ2ZpbGUlM0UuLi4lMjIlMjB0byUyMHVuc3RhZ2UpJTBBJTIwJTIwbW9kaWZpZWQlM0ElMjAlMjAlMjAuZ2l0YXR0cmlidXRlcyUwQSUwOW5ldyUyMGZpbGUlM0ElMjAlMjAlMjBjb25maWcuanNvbiUwQSUwOW5ldyUyMGZpbGUlM0ElMjAlMjAlMjBweXRvcmNoX21vZGVsLmJpbiUwQSUwOW5ldyUyMGZpbGUlM0ElMjAlMjAlMjBzZW50ZW5jZXBpZWNlLmJwZS5tb2RlbCUwQSUwOW5ldyUyMGZpbGUlM0ElMjAlMjAlMjBzcGVjaWFsX3Rva2Vuc19tYXAuanNvbiUwQSUwOW5ldyUyMGZpbGUlM0ElMjAlMjAlMjB0b2tlbml6ZXIuanNvbiUwQSUwOW5ldyUyMGZpbGUlM0ElMjAlMjAlMjB0b2tlbml6ZXJfY29uZmlnLmpzb24=",highlighted:`On branch main
Your branch is up to <span class="hljs-built_in">date</span> with <span class="hljs-string">&#x27;origin/main&#x27;</span>.

Changes to be committed:
  (use <span class="hljs-string">&quot;git restore --staged &lt;file&gt;...&quot;</span> to unstage)
  modified:   .gitattributes
	new file:   config.json
	new file:   pytorch_model.bin
	new file:   sentencepiece.bpe.model
	new file:   special_tokens_map.json
	new file:   tokenizer.json
	new file:   tokenizer_config.json`,wrap:!1}}),{c(){y(i.$$.fragment)},l(s){T(i.$$.fragment,s)},m(s,c){U(i,s,c),m=!0},i(s){m||(b(i.$$.fragment,s),m=!0)},o(s){d(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function yp(g){let i,m,s,c="我们可以看到所有文件都使用 <code>Git</code> 作为处理程序，除了 <code>t5_model.h5</code> ，它的处理程序是 <code>LFS</code> 。",w;return i=new h({props:{code:"T24lMjBicmFuY2glMjBtYWluJTBBT2JqZWN0cyUyMHRvJTIwYmUlMjBwdXNoZWQlMjB0byUyMG9yaWdpbiUyRm1haW4lM0ElMEElMEElMEFPYmplY3RzJTIwdG8lMjBiZSUyMGNvbW1pdHRlZCUzQSUwQSUwQSUwOWNvbmZpZy5qc29uJTIwKEdpdCUzQSUyMGJjMjBmZjIpJTBBJTA5c2VudGVuY2VwaWVjZS5icGUubW9kZWwlMjAoTEZTJTNBJTIwOTg4YmM1YSklMEElMDlzcGVjaWFsX3Rva2Vuc19tYXAuanNvbiUyMChHaXQlM0ElMjBjYjIzOTMxKSUwQSUwOXRmX21vZGVsLmg1JTIwKExGUyUzQSUyMDg2ZmNlMjkpJTBBJTA5dG9rZW5pemVyLmpzb24lMjAoR2l0JTNBJTIwODUxZmYzZSklMEElMDl0b2tlbml6ZXJfY29uZmlnLmpzb24lMjAoR2l0JTNBJTIwZjBmNzc4MyklMEElMEFPYmplY3RzJTIwbm90JTIwc3RhZ2VkJTIwZm9yJTIwY29tbWl0JTNBJTBBJTBB",highlighted:`On branch main
Objects to be pushed to origin/main:


Objects to be committed:

	config.json (Git: bc20ff2)
	sentencepiece.bpe.model (LFS: 988bc5a)
	special_tokens_map.json (Git: cb23931)
	tf_model.h5 (LFS: 86fce29)
	tokenizer.json (Git: 851ff3e)
	tokenizer_config.json (Git: f0f7783)

Objects not staged <span class="hljs-keyword">for</span> commit:

`,wrap:!1}}),{c(){y(i.$$.fragment),m=o(),s=a("p"),s.innerHTML=c},l(u){T(i.$$.fragment,u),m=p(u),s=r(u,"P",{"data-svelte-h":!0}),f(s)!=="svelte-1t6zx6c"&&(s.innerHTML=c)},m(u,$){U(i,u,$),n(u,m,$),n(u,s,$),w=!0},i(u){w||(b(i.$$.fragment,u),w=!0)},o(u){d(i.$$.fragment,u),w=!1},d(u){u&&(l(m),l(s)),_(i,u)}}}function Tp(g){let i,m,s,c="我们可以看到所有文件都使用 <code>Git</code> 作为处理程序，除了 <code>pytorch_model.bin</code> 和 <code>sentencepiece.bpe.model</code> 它们的处理程序是 <code>LFS</code> 。",w;return i=new h({props:{code:"T24lMjBicmFuY2glMjBtYWluJTBBT2JqZWN0cyUyMHRvJTIwYmUlMjBwdXNoZWQlMjB0byUyMG9yaWdpbiUyRm1haW4lM0ElMEElMEElMEFPYmplY3RzJTIwdG8lMjBiZSUyMGNvbW1pdHRlZCUzQSUwQSUwQSUwOWNvbmZpZy5qc29uJTIwKEdpdCUzQSUyMGJjMjBmZjIpJTBBJTA5cHl0b3JjaF9tb2RlbC5iaW4lMjAoTEZTJTNBJTIwMzU2ODZjMiklMEElMDlzZW50ZW5jZXBpZWNlLmJwZS5tb2RlbCUyMChMRlMlM0ElMjA5ODhiYzVhKSUwQSUwOXNwZWNpYWxfdG9rZW5zX21hcC5qc29uJTIwKEdpdCUzQSUyMGNiMjM5MzEpJTBBJTA5dG9rZW5pemVyLmpzb24lMjAoR2l0JTNBJTIwODUxZmYzZSklMEElMDl0b2tlbml6ZXJfY29uZmlnLmpzb24lMjAoR2l0JTNBJTIwZjBmNzc4MyklMEElMEFPYmplY3RzJTIwbm90JTIwc3RhZ2VkJTIwZm9yJTIwY29tbWl0JTNBJTBBJTBB",highlighted:`On branch main
Objects to be pushed to origin/main:


Objects to be committed:

	config.json (Git: bc20ff2)
	pytorch_model.bin (LFS: 35686c2)
	sentencepiece.bpe.model (LFS: 988bc5a)
	special_tokens_map.json (Git: cb23931)
	tokenizer.json (Git: 851ff3e)
	tokenizer_config.json (Git: f0f7783)

Objects not staged <span class="hljs-keyword">for</span> commit:

`,wrap:!1}}),{c(){y(i.$$.fragment),m=o(),s=a("p"),s.innerHTML=c},l(u){T(i.$$.fragment,u),m=p(u),s=r(u,"P",{"data-svelte-h":!0}),f(s)!=="svelte-nmqvu"&&(s.innerHTML=c)},m(u,$){U(i,u,$),n(u,m,$),n(u,s,$),w=!0},i(u){w||(b(i.$$.fragment,u),w=!0)},o(u){d(i.$$.fragment,u),w=!1},d(u){u&&(l(m),l(s)),_(i,u)}}}function Up(g){let i,m;return i=new h({props:{code:"JTVCbWFpbiUyMGIwOGFhYjElNUQlMjBGaXJzdCUyMG1vZGVsJTIwdmVyc2lvbiUwQSUyMDYlMjBmaWxlcyUyMGNoYW5nZWQlMkMlMjAzNiUyMGluc2VydGlvbnMoJTJCKSUwQSUyMGNyZWF0ZSUyMG1vZGUlMjAxMDA2NDQlMjBjb25maWcuanNvbiUwQSUyMGNyZWF0ZSUyMG1vZGUlMjAxMDA2NDQlMjBzZW50ZW5jZXBpZWNlLmJwZS5tb2RlbCUwQSUyMGNyZWF0ZSUyMG1vZGUlMjAxMDA2NDQlMjBzcGVjaWFsX3Rva2Vuc19tYXAuanNvbiUwQSUyMGNyZWF0ZSUyMG1vZGUlMjAxMDA2NDQlMjB0Zl9tb2RlbC5oNSUwQSUyMGNyZWF0ZSUyMG1vZGUlMjAxMDA2NDQlMjB0b2tlbml6ZXIuanNvbiUwQSUyMGNyZWF0ZSUyMG1vZGUlMjAxMDA2NDQlMjB0b2tlbml6ZXJfY29uZmlnLmpzb24=",highlighted:`[main b08aab1] First model version
 6 files changed, 36 insertions(+)
 create mode 100644 config.json
 create mode 100644 sentencepiece.bpe.model
 create mode 100644 special_tokens_map.json
 create mode 100644 tf_model.h5
 create mode 100644 tokenizer.json
 create mode 100644 tokenizer_config.json`,wrap:!1}}),{c(){y(i.$$.fragment)},l(s){T(i.$$.fragment,s)},m(s,c){U(i,s,c),m=!0},i(s){m||(b(i.$$.fragment,s),m=!0)},o(s){d(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function _p(g){let i,m;return i=new h({props:{code:"JTVCbWFpbiUyMGIwOGFhYjElNUQlMjBGaXJzdCUyMG1vZGVsJTIwdmVyc2lvbiUwQSUyMDclMjBmaWxlcyUyMGNoYW5nZWQlMkMlMjAyOTAyNyUyMGluc2VydGlvbnMoJTJCKSUwQSUyMCUyMDYlMjBmaWxlcyUyMGNoYW5nZWQlMkMlMjAzNiUyMGluc2VydGlvbnMoJTJCKSUwQSUyMGNyZWF0ZSUyMG1vZGUlMjAxMDA2NDQlMjBjb25maWcuanNvbiUwQSUyMGNyZWF0ZSUyMG1vZGUlMjAxMDA2NDQlMjBweXRvcmNoX21vZGVsLmJpbiUwQSUyMGNyZWF0ZSUyMG1vZGUlMjAxMDA2NDQlMjBzZW50ZW5jZXBpZWNlLmJwZS5tb2RlbCUwQSUyMGNyZWF0ZSUyMG1vZGUlMjAxMDA2NDQlMjBzcGVjaWFsX3Rva2Vuc19tYXAuanNvbiUwQSUyMGNyZWF0ZSUyMG1vZGUlMjAxMDA2NDQlMjB0b2tlbml6ZXIuanNvbiUwQSUyMGNyZWF0ZSUyMG1vZGUlMjAxMDA2NDQlMjB0b2tlbml6ZXJfY29uZmlnLmpzb24=",highlighted:`[main b08aab1] First model version
 7 files changed, 29027 insertions(+)
  6 files changed, 36 insertions(+)
 create mode 100644 config.json
 create mode 100644 pytorch_model.bin
 create mode 100644 sentencepiece.bpe.model
 create mode 100644 special_tokens_map.json
 create mode 100644 tokenizer.json
 create mode 100644 tokenizer_config.json`,wrap:!1}}),{c(){y(i.$$.fragment)},l(s){T(i.$$.fragment,s)},m(s,c){U(i,s,c),m=!0},i(s){m||(b(i.$$.fragment,s),m=!0)},o(s){d(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function gp(g){let i,m="当这些都完成时，如果我们查看模型仓库，我们可以看到所有最近添加的文件：",s,c,w='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/full_model_tf.png" alt="The &#39;Files and versions&#39; tab now contains all the recently uploaded files." width="80%"/>',u,$,C="在Huggingface 的网页上你可以查看模型文件和提交，并查看每次提交引入的差异：",J,v,Z='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/diffstf.gif" alt="The diff introduced by the recent commit." width="80%"/>';return{c(){i=a("p"),i.textContent=m,s=o(),c=a("div"),c.innerHTML=w,u=o(),$=a("p"),$.textContent=C,J=o(),v=a("div"),v.innerHTML=Z,this.h()},l(M){i=r(M,"P",{"data-svelte-h":!0}),f(i)!=="svelte-1b70wlt"&&(i.textContent=m),s=p(M),c=r(M,"DIV",{class:!0,"data-svelte-h":!0}),f(c)!=="svelte-tz4fi2"&&(c.innerHTML=w),u=p(M),$=r(M,"P",{"data-svelte-h":!0}),f($)!=="svelte-1i4hldf"&&($.textContent=C),J=p(M),v=r(M,"DIV",{class:!0,"data-svelte-h":!0}),f(v)!=="svelte-2jd8bj"&&(v.innerHTML=Z),this.h()},h(){W(c,"class","flex justify-center"),W(v,"class","flex justify-center")},m(M,k){n(M,i,k),n(M,s,k),n(M,c,k),n(M,u,k),n(M,$,k),n(M,J,k),n(M,v,k)},d(M){M&&(l(i),l(s),l(c),l(u),l($),l(J),l(v))}}}function $p(g){let i,m="当这些都完成时，如果我们查看模型仓库，我们可以看到所有最近添加的文件：",s,c,w='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/full_model.png" alt="The &#39;Files and versions&#39; tab now contains all the recently uploaded files." width="80%"/>',u,$,C="在Huggingface 的网页上你可以查看模型文件和提交，并查看每次提交引入的差异：",J,v,Z='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/diffs.gif" alt="The diff introduced by the recent commit." width="80%"/>';return{c(){i=a("p"),i.textContent=m,s=o(),c=a("div"),c.innerHTML=w,u=o(),$=a("p"),$.textContent=C,J=o(),v=a("div"),v.innerHTML=Z,this.h()},l(M){i=r(M,"P",{"data-svelte-h":!0}),f(i)!=="svelte-1b70wlt"&&(i.textContent=m),s=p(M),c=r(M,"DIV",{class:!0,"data-svelte-h":!0}),f(c)!=="svelte-1v39mjb"&&(c.innerHTML=w),u=p(M),$=r(M,"P",{"data-svelte-h":!0}),f($)!=="svelte-1i4hldf"&&($.textContent=C),J=p(M),v=r(M,"DIV",{class:!0,"data-svelte-h":!0}),f(v)!=="svelte-1g561m5"&&(v.innerHTML=Z),this.h()},h(){W(c,"class","flex justify-center"),W(v,"class","flex justify-center")},m(M,k){n(M,i,k),n(M,s,k),n(M,c,k),n(M,u,k),n(M,$,k),n(M,J,k),n(M,v,k)},d(M){M&&(l(i),l(s),l(c),l(u),l($),l(J),l(v))}}}function wp(g){let i,m,s,c,w,u,$,C,J,v,Z,M,k,x,Q="接下来，我们将探索把预训练模型分享到 🤗 Hub 最便捷的方法。我们将一同研究一些工具和功能，它们可以简化直接在中心上分享和更新模型的流程。",ae,B,j,G,Fi="我们鼓励所有训练模型的用户通过与社区共享来做出贡献——即使是在特定数据集上训练的模型的分享，也能帮助他人，节省他们的时间和计算资源，并提供一些有用的训练成果。反过来，你可以从其他人所做的工作中受益！",vl,re,Si="创建模型存储仓库的方法有以下三种：",Zl,fe,Di="<li>使用 <code>push_to_hub</code> API 接口</li> <li>使用 <code>huggingface_hub</code> Python 库</li> <li>使用网页界面</li>",Cl,ue,Oi="创建仓库后，你可以通过 git 和 git-lfs 将文件上传到其中。我们将在以下部分带领你创建模型仓库并向其中上传文件。",Gl,ce,Wl,R,I,yl,Me,Pi="将文件上传到 hub 的最简单方法是利用 <code>push_to_hub</code> API 接口。",xl,de,qi="在进行下一步操作之前，你需要生成一个身份验证令牌，这样 <code>huggingface_hub</code> API 才会知道你是谁以及你对哪些空间具有写入权限。",Bl,be,Ki='在一个安装了 <code>transformers</code> 环境中（参见 <a href="/course/chapter0">第零章</a> ）。如果你在 notebook 中，可以运行以下代码登录：',Ql,ye,Rl,Te,es="在终端中，你可以运行：",Il,Ue,Nl,_e,ts='在这两种情况下，系统都会提示你输入用户名和密码，这与你用于登录 Hub 的用户名和密码相同。如果你还没有 Huggingface 账户，则应该 <a href="https://huggingface.co/join" rel="nofollow">在这里</a> 创建一个账户。',Yl,ge,ls="好极了！现在已将你的身份验证令牌存储在了缓存文件夹中。让我们创建一些仓库！",Hl,N,Y,Tl,$e,ns="在更底层，你可以通过直接在模型、tokenizer 和配置对象上调用 <code>push_to_hub()</code> 方法来访问模型中心。该方法能够同时创建仓库并直接将模型和 tokenizer 文件推送至仓库，无需手动操作，这与我们在下面要看到的 API 有些许不同。",Al,we,is="为了了解它是如何工作的，让我们首先创建一个模型和一个 tokenizer",El,H,A,Ul,he,ss="你可以随意进行一些操作——给 tokenizer 添加 tokens 训练模型，微调模型。直到你对最终的模型、权重和 tokenizer 满意。当你对的模最终的模型、权重和 tokenizer 感到满意，你就可以直接在 <code>model</code> 对象上调用 <code>push_to_hub()</code> 方法：",Vl,je,zl,Je,os="这将在你的账户中创建新的 <code>dummy-model</code> 仓库，并将这个模型文件上传上去。",Ll,ke,ps="对 tokenizer 也需要进行相同的操作：",Xl,ve,Fl,Ze,ms="如果你属于一个组织，只需指定 <code>organization</code> 参数即可将模型上传到该组织的账户下：",Sl,Ce,Dl,Ge,as="如果你希望使用特定的 Hugging Face 令牌，你也可以很方便地将其传递给 <code>push_to_hub()</code> 方法：",Ol,We,Pl,xe,rs='现在你就可以前往 <a href="https://huggingface.co/user-or-organization/dummy-model" rel="nofollow">模型中心</a> 查看你新上传的模型。',ql,Be,fs="单击“文件和版本（Files and versions）”选项卡，你应该能看到以下的文件：",Kl,_l,le,en,Qe,us='如你所见， <code>push_to_hub()</code> 方法接受多个参数，从而可以上传到特定的仓库或账户，除此之外还可以使用不同的 API 令牌验证身份。我们建议你直接查看 <a href="https://huggingface.co/transformers/model_sharing" rel="nofollow">🤗 Transformers 文档</a> 了解更多的用法。',tn,Re,cs='位于 <a href="https://github.com/huggingface/huggingface_hub" rel="nofollow">huggingface_hub</a> 库里的 <code>push_to_hub()</code> 方提供了直接面向 Hugging Face Hub 的 API。它集成在 🤗 Transformers 和其他几个机器学习库中，例如 <a href="https://github.com/allenai/allennlp" rel="nofollow">allenlp</a> 。虽然我们在本章中专注于 🤗 Transformers 但将其集成到你自己的代码或库中很简单。',ln,Ie,Ms="到了最后一部分，让我们看看如何将文件上传到你新创建的仓库！",nn,Ne,sn,Ye,ds="<code>huggingface_hub</code> Python 库是一个包，为模型和数据集中心提供了一系列工具。它提供了简单的方法和类，可以便捷地获取 hub 中仓库的信息以及管理仓库等常见任务。它在 git 的基础上提供了简单的 API，可以在你你的项目中管理这些仓库的内容，以及 hub 的一些功能。",on,He,bs="与使用 <code>push_to_hub</code> API 类似，这需要你将 API 令牌保存在缓存中。为此，你需要在操作系统的命令行使用 CLI 中的 <code>login</code> 命令，（如果在 Notebook 中运行，请在这些命令前添加 <code>!</code> 字符）：",pn,Ae,mn,Ee,ys="此外，它还提供了非常强大的 <code>Repository</code> 类来管理本地仓库。我们将在接下来的几节中探讨这些方法和类，以理解如何利用它们。",an,Ve,Ts="可以使用 <code>create_repo</code> 方法在 Hub 上创建新的仓库：",rn,ze,fn,Le,Us="这将在你的账户中创建 <code>dummy-model</code> 仓库。除此之外你还可以使用 <code>organization</code> 参数指定仓库应属于哪个组织：",un,Xe,cn,Fe,_s="这将在 <code>huggingface</code> 组织的账户中创建 <code>dummy-model</code> 仓库，如果你属于该组织并且有创建仓库的权限。",Mn,Se,gs="其他可能有用的一些参数有：",dn,De,$s="<li><code>private</code> ，用于指定仓库是否应对其他人可见。</li> <li><code>token</code> ，如果你希望使用特定的身份令牌，而不是缓存中的身份令牌。</li> <li><code>repo_type</code> ，如果你希望创建一个 <code>dataset</code> 或 <code>space</code> 而不是模型。需要将 <code>repo_type</code> 设置为 <code>&quot;dataset&quot;</code> 和 <code>&quot;space&quot;</code> 。</li>",bn,Oe,ws="创建仓库后，我们应该向其中添加文件！让我们到下一节，看看三种添加文件的方式。",yn,Pe,Tn,qe,hs="Web 界面提供了直接在 Hub 中管理仓库的工具。使用该界面，你可以轻松创建仓库、添加文件（甚至是大文件！）、探索模型、可视化差异等等。",Un,Ke,js='要创建新的仓库，请访问 <a href="https://huggingface.co/new" rel="nofollow">huggingface.co/new</a> ：',_n,ne,Js='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/new_model.png" alt="Page showcasing the model used for the creation of a new model repository." width="80%"/>',gn,et,ks="首先，指定仓库的所有者：这可以是你或你所属的组织。如果你选择一个组织，模型将在会显示在组织的页面上，组织的每个成员可以操作仓库。",$n,tt,vs="接下来，输入你的模型名称。同时也是仓库的名称。最后，你可以指定你的模型是公开的还是私有的。私有的模型将被隐藏，对其他的用户不可见。",wn,lt,Zs="创建模型仓库后，你应该会看到如下页面：",hn,ie,Cs='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/empty_model.png" alt="An empty model page after creating a new repository." width="80%"/>',jn,nt,Gs="这就是你的模型仓库会显示的页面。你可以直接从网页界面添加 README 文件来填写它。",Jn,se,Ws='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/dummy_model.png" alt="The README file showing the Markdown capabilities." width="80%"/>',kn,it,xs="README 文件采用 Markdown 格式 - 你可以根据你的需要自由编写！",vn,st,Bs="这一章的下一部分将帮助你建立模型卡片。这些模型卡片对于提升模型的价值非常重要，因为它们可以告诉其他人你的模型能做什么。",Zn,ot,Qs="如果你希望添加更多文件，点击页面顶部的 “Files and versions（文件和版本）” 标签页。在这里，你可以看到仓库的所有文件以及它们的版本。",Cn,oe,Rs='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/files.png" alt="The &#39;Files and versions&#39; tab only shows the .gitattributes and README.md files." width="80%"/>',Gn,pt,Is="接下来我们将看看如何添加一些新文件。",Wn,mt,xn,at,Ns='Hugging Face Hub 的文件管理系统基于 git 用于处理常规文件，对于较大的文件则需要使用 git-lfs（详情请参阅 <a href="https://git-lfs.github.com/" rel="nofollow">Git 大文件存储</a> ）',Bn,rt,Ys="在下一节中，我们会讲述怎么以三种不同的方式将文件上传到 Hub： <code>upload_file</code> 方法、 <code>Repository</code> 类  以及通过 git 命令。",Qn,ft,Rn,ut,Hs="使用 <code>upload_file</code> 不需要在你的系统上安装 git 和 git-lfs。它使用 HTTP POST 请求将文件直接发送到 Hub。这种方法的一个限制是它不能上传大于 5GB 的文件。如果你的文件大于 5GB，请按照另外两种方法进行操作。 <code>upload_file</code> 的使用方法如下：",In,ct,Nn,Mt,As="以上的代码会把 <code>&lt;path_to_file&gt;</code> 位置的 <code>config.json</code> 文件上传到 <code>dummy-model</code> 仓库的根目录作为模型的 <code>config.json</code> 。其他可能有用的参数包括：",Yn,dt,Es="<li><code>token</code> ，如果你希望在这里使用特定的身份令牌，而不是缓存中的身份令牌。</li> <li><code>repo_type</code> ，如果你希望创建一个 <code>dataset</code> 或 <code>space</code> 而不是模型。需要将 <code>repo_type</code> 设置为 <code>&quot;dataset&quot;</code> 和 <code>&quot;space&quot;</code> 。</li>",Hn,bt,An,yt,Vs='使用这个类需要安装 git 和 git-lfs，所以请确保你已经安装了 git-lfs（如果没有安装，可以查看 <a href="https://git-lfs.github.com/" rel="nofollow">git-lfs 官网</a> 的安装指南）并已经在操作系统里配置好了相关功能。',En,Tt,zs="为了开始使用我们刚刚创建的仓库，我们可以把远程仓库克隆到一个本地文件夹：",Vn,Ut,zn,_t,Ls="以上代码会在我们当前的工作目录中创建 <code>&lt;path_to_dummy_folder&gt;</code> 文件夹。此文件夹里只有 <code>.gitattributes</code> 文件，这是使用 <code>create_repo</code> 创建仓库时生成的文件。",Ln,gt,Xs="从现在开始，我们可以利用许多传统的 git 方法：",Xn,$t,Fn,wt,Fs='此外！我们建议你查看 <a href="https://github.com/huggingface/huggingface_hub/tree/main/src/huggingface_hub#advanced-programmatic-repository-management" rel="nofollow">huggingface</a> 的 <code>Repository</code> 文档，了解一下所有可用方法。',Sn,ht,Ss="现在，我们有了一个模型和一个 tokenizer 我们希望将其推送到 hub。我们已经成功克隆了仓库，因此我们可以将文件保存到在该仓库的文件夹中。",Dn,jt,Ds="首先，我们通过拉取最新的更改，确保我们的本地克隆是最新的：",On,Jt,Pn,kt,Os="完成后，我们保存模型和 tokenizer 文件：",qn,vt,Kn,Zt,Ps="<code>&lt;path_to_dummy_folder&gt;</code> 现在已经存储了模型和 tokenizer 文件。我们遵循常规的 git 工作流程，将文件添加到暂存区，提交它们并推送它们到 hub：",ei,Ct,ti,Gt,qs="恭喜你！你刚刚在 hub 上推送了你的第一个文件。",li,Wt,ni,xt,Ks="这是上传文件的最基础方法：我们将直接使用 git 和 git-lfs 进行操作，相比于之前的方法难度更大同时也更加灵活。在前面的方法大部分的难点都已经被封装好的库解决，但是接下来的方法需要手动来解决它们，所以我们会尝试一个更复杂的使用案例。",ii,Bt,eo='使用这个方法需要安装 git 和 git-lfs，所以请确保你已经安装了 git-lfs（如果没有安装，可以参见 <a href="https://git-lfs.github.com/" rel="nofollow">git-lfs 官网</a> 的安装指南）并已经在操作系统里配置好了相关功能。',si,Qt,to="首先，初始化 git-lfs：",oi,Rt,pi,It,mi,Nt,lo="完成后，接下来需要克隆你的模型仓库：",ai,Yt,ri,Ht,no="我的用户名是 <code>lysandre</code> 我使用的模型的名称是 <code>dummy</code> ，所以对我来说，命令最终如下所示：",fi,At,ui,Et,io="我现在在工作目录中多了一个名为 dummy 的文件夹。我可以 cd 到这个文件夹，看看其中的内容：",ci,Vt,Mi,zt,di,Lt,so="如果你刚刚用的是 Hugging Face Hub 的 <code>create_repo</code> 方法创建的仓库，这个文件夹应该只包含一个隐藏的 .gitattributes 文件。如果你使用的是网页界面创建了一个仓库，那么文件夹应该只包含一个 README.md 文件和一个隐藏的 .gitattributes 文件。",bi,Xt,oo="较小的文件，如配置文件、词汇表文件，或者基本上任何几 MB 以下的文件，操作的方法就像我们平时使用 git 一样。然而，更大的文件必须通过 git-lfs 注册才能推送到 huggingface.co。",yi,Ft,po="让我们回到 Python，生成一些我们希望提交到 dummy 仓库的模型和 tokenizer",Ti,E,V,gl,St,mo="现在我们已经保存了模型和 tokenizer 让我们再看一下 dummy 文件夹：",Ui,Dt,_i,z,L,$l,pe,gi,Ot,ao="我们现在可以继续上传，就像我们使用传统 Git 仓库一样。我们可以使用以下命令将所有文件添加到 Git 的暂存环境中 <code>git add</code> 命令：",$i,Pt,wi,qt,ro="然后我们可以查看当前暂存的文件：",hi,Kt,ji,X,F,wl,el,fo="同样，我们可以使用 <code>status</code> 命令查看 git-lfs 正在跟踪的文件：",Ji,tl,ki,S,D,hl,ll,uo="让我们继续进行最后的步骤，提交并推送到 huggingface.co 远程仓库：",vi,nl,Zi,O,P,jl,il,co="推送可能需要一些时间，具体取决于你的网络速度以及你的文件大小：",Ci,sl,Gi,ol,Wi,Jl,pl,xi,kl,Bi;w=new qo({props:{fw:g[0]}}),$=new Oo({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),J=new me({props:{title:"共享预训练模型",local:"共享预训练模型",headingTag:"h1"}});const Mo=[ep,Ko],ml=[];function bo(e,t){return e[0]==="pt"?0:1}Z=bo(g),M=ml[Z]=Mo[Z](g),B=new Xi({props:{id:"9yY3RB_GSPM"}}),ce=new me({props:{title:"使用 push_to_hub API",local:"使用 push_to_hub API",headingTag:"h2"}});const yo=[lp,tp],al=[];function To(e,t){return e[0]==="pt"?0:1}R=To(g),I=al[R]=yo[R](g),ye=new h({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBJTBBbm90ZWJvb2tfbG9naW4oKQ==",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

notebook_login()`,wrap:!1}}),Ue=new h({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4=",highlighted:"huggingface-cli login",wrap:!1}});const Uo=[ip,np],rl=[];function _o(e,t){return e[0]==="pt"?0:1}N=_o(g),Y=rl[N]=Uo[N](g);const go=[op,sp],fl=[];function $o(e,t){return e[0]==="pt"?0:1}H=$o(g),A=fl[H]=go[H](g),je=new h({props:{code:"bW9kZWwucHVzaF90b19odWIoJTIyZHVtbXktbW9kZWwlMjIp",highlighted:'model.push_to_hub(<span class="hljs-string">&quot;dummy-model&quot;</span>)',wrap:!1}}),ve=new h({props:{code:"dG9rZW5pemVyLnB1c2hfdG9faHViKCUyMmR1bW15LW1vZGVsJTIyKQ==",highlighted:'tokenizer.push_to_hub(<span class="hljs-string">&quot;dummy-model&quot;</span>)',wrap:!1}}),Ce=new h({props:{code:"dG9rZW5pemVyLnB1c2hfdG9faHViKCUyMmR1bW15LW1vZGVsJTIyJTJDJTIwb3JnYW5pemF0aW9uJTNEJTIyaHVnZ2luZ2ZhY2UlMjIp",highlighted:'tokenizer.push_to_hub(<span class="hljs-string">&quot;dummy-model&quot;</span>, organization=<span class="hljs-string">&quot;huggingface&quot;</span>)',wrap:!1}}),We=new h({props:{code:"dG9rZW5pemVyLnB1c2hfdG9faHViKCUyMmR1bW15LW1vZGVsJTIyJTJDJTIwb3JnYW5pemF0aW9uJTNEJTIyaHVnZ2luZ2ZhY2UlMjIlMkMlMjB1c2VfYXV0aF90b2tlbiUzRCUyMiUzQ1RPS0VOJTNFJTIyKQ==",highlighted:'tokenizer.push_to_hub(<span class="hljs-string">&quot;dummy-model&quot;</span>, organization=<span class="hljs-string">&quot;huggingface&quot;</span>, use_auth_token=<span class="hljs-string">&quot;&lt;TOKEN&gt;&quot;</span>)',wrap:!1}});function wo(e,t){return e[0]==="pt"?mp:pp}let Qi=wo(g),q=Qi(g);le=new Yo({props:{$$slots:{default:[ap]},$$scope:{ctx:g}}}),Ne=new me({props:{title:"使用 huggingface_hub python 库",local:"使用 huggingface_hub python 库",headingTag:"h2"}}),Ae=new h({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4lMEElNjAlNjAlNjAlMjAlNjBodWdnaW5nZmFjZV9odWIlNjAlMjAlRTUlOEMlODUlRTYlOEYlOTAlRTQlQkUlOUIlRTQlQkElODYlRTUlODclQTAlRTQlQjglQUElRTklOUQlOUUlRTUlQjglQjglRTQlQkUlQkYlRTYlOEQlQjclRTYlOTYlQjklRTYlQjMlOTUlRTUlOTIlOEMlRTclQjElQkIlRTUlOEYlQUYlRTQlQkIlQTUlRTUlQjglQUUlRTUlOEElQTklRTYlODglOTElRTQlQkIlQUMlRTUlQUUlOEMlRTYlODglOTAlMjBodWIlMjAlRTclOUElODQlRTclQUUlQTElRTclOTAlODYlRTMlODAlODIlRTklQTYlOTYlRTUlODUlODglRUYlQkMlOEMlRTYlOUMlODklRTQlQjglODAlRTQlQkElOUIlRTYlOTYlQjklRTYlQjMlOTUlRTUlOEYlQUYlRTQlQkIlQTUlRTclQUUlQTElRTclOTAlODYlRTQlQkIlOTMlRTUlQkElOTMlRTclOUElODQlRTUlODglOUIlRTUlQkIlQkElRTMlODAlODElRTUlODglQTAlRTklOTklQTQlRTclQUQlODklRUYlQkMlOUElMEElMEElNjAlNjAlNjBweXRob24lMjBuby1mb3JtYXQlMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwKCUwQSUyMCUyMCUyMCUyMCUyMyUyMCVFNyU5NCVBOCVFNiU4OCVCNyVFNyVBRSVBMSVFNyU5MCU4NiUwQSUyMCUyMCUyMCUyMGxvZ2luJTJDJTBBJTIwJTIwJTIwJTIwbG9nb3V0JTJDJTBBJTIwJTIwJTIwJTIwd2hvYW1pJTJDJTBBJTBBJTIwJTIwJTIwJTIwJTIzJTIwJUU0JUJCJTkzJUU1JUJBJTkzJUU1JTg4JTlCJUU1JUJCJUJBJUU1JTkyJThDJUU3JUFFJUExJUU3JTkwJTg2JTBBJTIwJTIwJTIwJTIwY3JlYXRlX3JlcG8lMkMlMEElMjAlMjAlMjAlMjBkZWxldGVfcmVwbyUyQyUwQSUyMCUyMCUyMCUyMHVwZGF0ZV9yZXBvX3Zpc2liaWxpdHklMkMlMEElMEElMjAlMjAlMjAlMjAlMjMlMjAlRTQlQkIlQTUlRTUlOEYlOEElRTQlQjglODAlRTQlQkElOUIlRTYlQTMlODAlRTclQjQlQTIlMkYlRTYlOUIlQjQlRTYlOTQlQjklRTYlOTYlODclRTQlQkIlQjYlRTclOUElODQlRTYlOTYlQjklRTYlQjMlOTUlMEElMjAlMjAlMjAlMjBsaXN0X21vZGVscyUyQyUwQSUyMCUyMCUyMCUyMGxpc3RfZGF0YXNldHMlMkMlMEElMjAlMjAlMjAlMjBsaXN0X21ldHJpY3MlMkMlMEElMjAlMjAlMjAlMjBsaXN0X3JlcG9fZmlsZXMlMkMlMEElMjAlMjAlMjAlMjB1cGxvYWRfZmlsZSUyQyUwQSUyMCUyMCUyMCUyMGRlbGV0ZV9maWxlJTJDJTBBKQ==",highlighted:`huggingface-cli login
\`\`\` \`huggingface_hub\` 包提供了几个非常便捷方法和类可以帮助我们完成 hub 的管理。首先，有一些方法可以管理仓库的创建、删除等：

\`\`\`python no-format
from huggingface_hub import (
    <span class="hljs-comment"># 用户管理</span>
    login,
    <span class="hljs-built_in">logout</span>,
    <span class="hljs-built_in">whoami</span>,

    <span class="hljs-comment"># 仓库创建和管理</span>
    create_repo,
    delete_repo,
    update_repo_visibility,

    <span class="hljs-comment"># 以及一些检索/更改文件的方法</span>
    list_models,
    list_datasets,
    list_metrics,
    list_repo_files,
    upload_file,
    delete_file,
)`,wrap:!1}}),ze=new h({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGNyZWF0ZV9yZXBvJTBBJTBBY3JlYXRlX3JlcG8oJTIyZHVtbXktbW9kZWwlMjIp",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> create_repo

create_repo(<span class="hljs-string">&quot;dummy-model&quot;</span>)`,wrap:!1}}),Xe=new h({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGNyZWF0ZV9yZXBvJTBBJTBBY3JlYXRlX3JlcG8oJTIyZHVtbXktbW9kZWwlMjIlMkMlMjBvcmdhbml6YXRpb24lM0QlMjJodWdnaW5nZmFjZSUyMik=",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> create_repo

create_repo(<span class="hljs-string">&quot;dummy-model&quot;</span>, organization=<span class="hljs-string">&quot;huggingface&quot;</span>)`,wrap:!1}}),Pe=new me({props:{title:"使用网络界面",local:"使用网络界面",headingTag:"h2"}}),mt=new me({props:{title:"上传模型文件",local:"上传模型文件",headingTag:"h2"}}),ft=new me({props:{title:"upload_file 方法",local:"upload_file 方法",headingTag:"h3"}}),ct=new h({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMHVwbG9hZF9maWxlJTBBJTBBdXBsb2FkX2ZpbGUoJTBBJTIwJTIwJTIwJTIwJTIyJTNDcGF0aF90b19maWxlJTNFJTJGY29uZmlnLmpzb24lMjIlMkMlMEElMjAlMjAlMjAlMjBwYXRoX2luX3JlcG8lM0QlMjJjb25maWcuanNvbiUyMiUyQyUwQSUyMCUyMCUyMCUyMHJlcG9faWQlM0QlMjIlM0NuYW1lc3BhY2UlM0UlMkZkdW1teS1tb2RlbCUyMiUyQyUwQSk=",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> upload_file

upload_file(
    <span class="hljs-string">&quot;&lt;path_to_file&gt;/config.json&quot;</span>,
    path_in_repo=<span class="hljs-string">&quot;config.json&quot;</span>,
    repo_id=<span class="hljs-string">&quot;&lt;namespace&gt;/dummy-model&quot;</span>,
)`,wrap:!1}}),bt=new me({props:{title:"Repository 类 [ Repository 类 ] Repository 类可以使用类似 git 的方式管理一个本地仓库。它解决了使用 git 可能遇到的大部分痛点，提供我们所需的所有功能。",local:"repository-类--repository-类--repository-类可以使用类似-git-的方式管理一个本地仓库它解决了使用-git-可能遇到的大部分痛点提供我们所需的所有功能",headingTag:"h3"}}),Ut=new h({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMFJlcG9zaXRvcnklMEElMEFyZXBvJTIwJTNEJTIwUmVwb3NpdG9yeSglMjIlM0NwYXRoX3RvX2R1bW15X2ZvbGRlciUzRSUyMiUyQyUyMGNsb25lX2Zyb20lM0QlMjIlM0NuYW1lc3BhY2UlM0UlMkZkdW1teS1tb2RlbCUyMik=",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> Repository

repo = Repository(<span class="hljs-string">&quot;&lt;path_to_dummy_folder&gt;&quot;</span>, clone_from=<span class="hljs-string">&quot;&lt;namespace&gt;/dummy-model&quot;</span>)`,wrap:!1}}),$t=new h({props:{code:"cmVwby5naXRfcHVsbCgpJTBBcmVwby5naXRfYWRkKCklMEFyZXBvLmdpdF9jb21taXQoKSUwQXJlcG8uZ2l0X3B1c2goKSUwQXJlcG8uZ2l0X3RhZygp",highlighted:`repo.git_pull()
repo.git_add()
repo.git_commit()
repo.git_push()
repo.git_tag()`,wrap:!1}}),Jt=new h({props:{code:"cmVwby5naXRfcHVsbCgp",highlighted:"repo.git_pull()",wrap:!1}}),vt=new h({props:{code:"bW9kZWwuc2F2ZV9wcmV0cmFpbmVkKCUyMiUzQ3BhdGhfdG9fZHVtbXlfZm9sZGVyJTNFJTIyKSUwQXRva2VuaXplci5zYXZlX3ByZXRyYWluZWQoJTIyJTNDcGF0aF90b19kdW1teV9mb2xkZXIlM0UlMjIp",highlighted:`model.save_pretrained(<span class="hljs-string">&quot;&lt;path_to_dummy_folder&gt;&quot;</span>)
tokenizer.save_pretrained(<span class="hljs-string">&quot;&lt;path_to_dummy_folder&gt;&quot;</span>)`,wrap:!1}}),Ct=new h({props:{code:"cmVwby5naXRfYWRkKCklMEFyZXBvLmdpdF9jb21taXQoJTIyQWRkJTIwbW9kZWwlMjBhbmQlMjB0b2tlbml6ZXIlMjBmaWxlcyUyMiklMEFyZXBvLmdpdF9wdXNoKCk=",highlighted:`repo.git_add()
repo.git_commit(<span class="hljs-string">&quot;Add model and tokenizer files&quot;</span>)
repo.git_push()`,wrap:!1}}),Wt=new me({props:{title:"基于 git 的方法",local:"基于 git 的方法",headingTag:"h3"}}),Rt=new h({props:{code:"Z2l0JTIwbGZzJTIwaW5zdGFsbA==",highlighted:"git lfs install",wrap:!1}}),It=new h({props:{code:"VXBkYXRlZCUyMGdpdCUyMGhvb2tzLiUwQUdpdCUyMExGUyUyMGluaXRpYWxpemVkLg==",highlighted:`Updated git hooks.
Git LFS initialized.`,wrap:!1}}),Yt=new h({props:{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGJTNDbmFtZXNwYWNlJTNFJTJGJTNDeW91ci1tb2RlbC1pZCUzRQ==",highlighted:'git <span class="hljs-built_in">clone</span> https://huggingface.co/&lt;namespace&gt;/&lt;your-model-id&gt;',wrap:!1}}),At=new h({props:{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGbHlzYW5kcmUlMkZkdW1teQ==",highlighted:'git clone https:<span class="hljs-regexp">//</span>huggingface.co<span class="hljs-regexp">/lysandre/</span>dummy',wrap:!1}}),Vt=new h({props:{code:"Y2QlMjBkdW1teSUyMCUyNiUyNiUyMGxz",highlighted:'<span class="hljs-built_in">cd</span> dummy &amp;&amp; <span class="hljs-built_in">ls</span>',wrap:!1}}),zt=new h({props:{code:"UkVBRE1FLm1k",highlighted:"README.md",wrap:!1}});const ho=[fp,rp],ul=[];function jo(e,t){return e[0]==="pt"?0:1}E=jo(g),V=ul[E]=ho[E](g),Dt=new h({props:{code:"bHM=",highlighted:'<span class="hljs-built_in">ls</span>',wrap:!1}});const Jo=[cp,up],cl=[];function ko(e,t){return e[0]==="pt"?0:1}z=ko(g),L=cl[z]=Jo[z](g),pe=new Yo({props:{$$slots:{default:[Mp]},$$scope:{ctx:g}}}),Pt=new h({props:{code:"Z2l0JTIwYWRkJTIwLg==",highlighted:"git add .",wrap:!1}}),Kt=new h({props:{code:"Z2l0JTIwc3RhdHVz",highlighted:"git status",wrap:!1}});const vo=[bp,dp],Ml=[];function Zo(e,t){return e[0]==="pt"?0:1}X=Zo(g),F=Ml[X]=vo[X](g),tl=new h({props:{code:"Z2l0JTIwbGZzJTIwc3RhdHVz",highlighted:"git lfs status",wrap:!1}});const Co=[Tp,yp],dl=[];function Go(e,t){return e[0]==="pt"?0:1}S=Go(g),D=dl[S]=Co[S](g),nl=new h({props:{code:"Z2l0JTIwY29tbWl0JTIwLW0lMjAlMjJGaXJzdCUyMG1vZGVsJTIwdmVyc2lvbiUyMg==",highlighted:'git commit -m <span class="hljs-string">&quot;First model version&quot;</span>',wrap:!1}});const Wo=[_p,Up],bl=[];function xo(e,t){return e[0]==="pt"?0:1}O=xo(g),P=bl[O]=Wo[O](g),sl=new h({props:{code:"Z2l0JTIwcHVzaA==",highlighted:"git push",wrap:!1}}),ol=new h({props:{code:"VXBsb2FkaW5nJTIwTEZTJTIwb2JqZWN0cyUzQSUyMDEwMCUyNSUyMCgxJTJGMSklMkMlMjA0MzMlMjBNQiUyMCU3QyUyMDEuMyUyME1CJTJGcyUyQyUyMGRvbmUuJTBBRW51bWVyYXRpbmclMjBvYmplY3RzJTNBJTIwMTElMkMlMjBkb25lLiUwQUNvdW50aW5nJTIwb2JqZWN0cyUzQSUyMDEwMCUyNSUyMCgxMSUyRjExKSUyQyUyMGRvbmUuJTBBRGVsdGElMjBjb21wcmVzc2lvbiUyMHVzaW5nJTIwdXAlMjB0byUyMDEyJTIwdGhyZWFkcyUwQUNvbXByZXNzaW5nJTIwb2JqZWN0cyUzQSUyMDEwMCUyNSUyMCg5JTJGOSklMkMlMjBkb25lLiUwQVdyaXRpbmclMjBvYmplY3RzJTNBJTIwMTAwJTI1JTIwKDklMkY5KSUyQyUyMDI4OC4yNyUyMEtpQiUyMCU3QyUyMDYuMjclMjBNaUIlMkZzJTJDJTIwZG9uZS4lMEFUb3RhbCUyMDklMjAoZGVsdGElMjAxKSUyQyUyMHJldXNlZCUyMDAlMjAoZGVsdGElMjAwKSUyQyUyMHBhY2stcmV1c2VkJTIwMCUwQVRvJTIwaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmx5c2FuZHJlJTJGZHVtbXklMEElMjAlMjAlMjA4OTFiNDFkLi5iMDhhYWIxJTIwJTIwbWFpbiUyMC0lM0UlMjBtYWlu",highlighted:`Uploading LFS objects: 100% (1/1), 433 MB | 1.3 MB/s, <span class="hljs-keyword">done</span>.
Enumerating objects: 11, <span class="hljs-keyword">done</span>.
Counting objects: 100% (11/11), <span class="hljs-keyword">done</span>.
Delta compression using up to 12 threads
Compressing objects: 100% (9/9), <span class="hljs-keyword">done</span>.
Writing objects: 100% (9/9), 288.27 KiB | 6.27 MiB/s, <span class="hljs-keyword">done</span>.
Total 9 (delta 1), reused 0 (delta 0), pack-reused 0
To https://huggingface.co/lysandre/dummy
   891b41d..b08aab1  main -&gt; main`,wrap:!1}});function Bo(e,t){return e[0]==="pt"?$p:gp}let Ri=Bo(g),K=Ri(g);return pl=new Po({props:{source:"https://github.com/huggingface/course/blob/main/chapters/zh-CN/chapter4/3.mdx"}}),{c(){i=a("meta"),m=o(),s=a("p"),c=o(),y(w.$$.fragment),u=o(),y($.$$.fragment),C=o(),y(J.$$.fragment),v=o(),M.c(),k=o(),x=a("p"),x.textContent=Q,ae=o(),y(B.$$.fragment),j=o(),G=a("p"),G.textContent=Fi,vl=o(),re=a("p"),re.textContent=Si,Zl=o(),fe=a("ul"),fe.innerHTML=Di,Cl=o(),ue=a("p"),ue.textContent=Oi,Gl=o(),y(ce.$$.fragment),Wl=o(),I.c(),yl=o(),Me=a("p"),Me.innerHTML=Pi,xl=o(),de=a("p"),de.innerHTML=qi,Bl=o(),be=a("p"),be.innerHTML=Ki,Ql=o(),y(ye.$$.fragment),Rl=o(),Te=a("p"),Te.textContent=es,Il=o(),y(Ue.$$.fragment),Nl=o(),_e=a("p"),_e.innerHTML=ts,Yl=o(),ge=a("p"),ge.textContent=ls,Hl=o(),Y.c(),Tl=o(),$e=a("p"),$e.innerHTML=ns,Al=o(),we=a("p"),we.textContent=is,El=o(),A.c(),Ul=o(),he=a("p"),he.innerHTML=ss,Vl=o(),y(je.$$.fragment),zl=o(),Je=a("p"),Je.innerHTML=os,Ll=o(),ke=a("p"),ke.textContent=ps,Xl=o(),y(ve.$$.fragment),Fl=o(),Ze=a("p"),Ze.innerHTML=ms,Sl=o(),y(Ce.$$.fragment),Dl=o(),Ge=a("p"),Ge.innerHTML=as,Ol=o(),y(We.$$.fragment),Pl=o(),xe=a("p"),xe.innerHTML=rs,ql=o(),Be=a("p"),Be.textContent=fs,Kl=o(),q.c(),_l=o(),y(le.$$.fragment),en=o(),Qe=a("p"),Qe.innerHTML=us,tn=o(),Re=a("p"),Re.innerHTML=cs,ln=o(),Ie=a("p"),Ie.textContent=Ms,nn=o(),y(Ne.$$.fragment),sn=o(),Ye=a("p"),Ye.innerHTML=ds,on=o(),He=a("p"),He.innerHTML=bs,pn=o(),y(Ae.$$.fragment),mn=o(),Ee=a("p"),Ee.innerHTML=ys,an=o(),Ve=a("p"),Ve.innerHTML=Ts,rn=o(),y(ze.$$.fragment),fn=o(),Le=a("p"),Le.innerHTML=Us,un=o(),y(Xe.$$.fragment),cn=o(),Fe=a("p"),Fe.innerHTML=_s,Mn=o(),Se=a("p"),Se.textContent=gs,dn=o(),De=a("ul"),De.innerHTML=$s,bn=o(),Oe=a("p"),Oe.textContent=ws,yn=o(),y(Pe.$$.fragment),Tn=o(),qe=a("p"),qe.textContent=hs,Un=o(),Ke=a("p"),Ke.innerHTML=js,_n=o(),ne=a("div"),ne.innerHTML=Js,gn=o(),et=a("p"),et.textContent=ks,$n=o(),tt=a("p"),tt.textContent=vs,wn=o(),lt=a("p"),lt.textContent=Zs,hn=o(),ie=a("div"),ie.innerHTML=Cs,jn=o(),nt=a("p"),nt.textContent=Gs,Jn=o(),se=a("div"),se.innerHTML=Ws,kn=o(),it=a("p"),it.textContent=xs,vn=o(),st=a("p"),st.textContent=Bs,Zn=o(),ot=a("p"),ot.textContent=Qs,Cn=o(),oe=a("div"),oe.innerHTML=Rs,Gn=o(),pt=a("p"),pt.textContent=Is,Wn=o(),y(mt.$$.fragment),xn=o(),at=a("p"),at.innerHTML=Ns,Bn=o(),rt=a("p"),rt.innerHTML=Ys,Qn=o(),y(ft.$$.fragment),Rn=o(),ut=a("p"),ut.innerHTML=Hs,In=o(),y(ct.$$.fragment),Nn=o(),Mt=a("p"),Mt.innerHTML=As,Yn=o(),dt=a("ul"),dt.innerHTML=Es,Hn=o(),y(bt.$$.fragment),An=o(),yt=a("p"),yt.innerHTML=Vs,En=o(),Tt=a("p"),Tt.textContent=zs,Vn=o(),y(Ut.$$.fragment),zn=o(),_t=a("p"),_t.innerHTML=Ls,Ln=o(),gt=a("p"),gt.textContent=Xs,Xn=o(),y($t.$$.fragment),Fn=o(),wt=a("p"),wt.innerHTML=Fs,Sn=o(),ht=a("p"),ht.textContent=Ss,Dn=o(),jt=a("p"),jt.textContent=Ds,On=o(),y(Jt.$$.fragment),Pn=o(),kt=a("p"),kt.textContent=Os,qn=o(),y(vt.$$.fragment),Kn=o(),Zt=a("p"),Zt.innerHTML=Ps,ei=o(),y(Ct.$$.fragment),ti=o(),Gt=a("p"),Gt.textContent=qs,li=o(),y(Wt.$$.fragment),ni=o(),xt=a("p"),xt.textContent=Ks,ii=o(),Bt=a("p"),Bt.innerHTML=eo,si=o(),Qt=a("p"),Qt.textContent=to,oi=o(),y(Rt.$$.fragment),pi=o(),y(It.$$.fragment),mi=o(),Nt=a("p"),Nt.textContent=lo,ai=o(),y(Yt.$$.fragment),ri=o(),Ht=a("p"),Ht.innerHTML=no,fi=o(),y(At.$$.fragment),ui=o(),Et=a("p"),Et.textContent=io,ci=o(),y(Vt.$$.fragment),Mi=o(),y(zt.$$.fragment),di=o(),Lt=a("p"),Lt.innerHTML=so,bi=o(),Xt=a("p"),Xt.textContent=oo,yi=o(),Ft=a("p"),Ft.textContent=po,Ti=o(),V.c(),gl=o(),St=a("p"),St.textContent=mo,Ui=o(),y(Dt.$$.fragment),_i=o(),L.c(),$l=o(),y(pe.$$.fragment),gi=o(),Ot=a("p"),Ot.innerHTML=ao,$i=o(),y(Pt.$$.fragment),wi=o(),qt=a("p"),qt.textContent=ro,hi=o(),y(Kt.$$.fragment),ji=o(),F.c(),wl=o(),el=a("p"),el.innerHTML=fo,Ji=o(),y(tl.$$.fragment),ki=o(),D.c(),hl=o(),ll=a("p"),ll.textContent=uo,vi=o(),y(nl.$$.fragment),Zi=o(),P.c(),jl=o(),il=a("p"),il.textContent=co,Ci=o(),y(sl.$$.fragment),Gi=o(),y(ol.$$.fragment),Wi=o(),K.c(),Jl=o(),y(pl.$$.fragment),xi=o(),kl=a("p"),this.h()},l(e){const t=Xo("svelte-u9bgzb",document.head);i=r(t,"META",{name:!0,content:!0}),t.forEach(l),m=p(e),s=r(e,"P",{}),No(s).forEach(l),c=p(e),T(w.$$.fragment,e),u=p(e),T($.$$.fragment,e),C=p(e),T(J.$$.fragment,e),v=p(e),M.l(e),k=p(e),x=r(e,"P",{"data-svelte-h":!0}),f(x)!=="svelte-1ez12s8"&&(x.textContent=Q),ae=p(e),T(B.$$.fragment,e),j=p(e),G=r(e,"P",{"data-svelte-h":!0}),f(G)!=="svelte-13jox3x"&&(G.textContent=Fi),vl=p(e),re=r(e,"P",{"data-svelte-h":!0}),f(re)!=="svelte-1tb1eea"&&(re.textContent=Si),Zl=p(e),fe=r(e,"UL",{"data-svelte-h":!0}),f(fe)!=="svelte-o3rhwp"&&(fe.innerHTML=Di),Cl=p(e),ue=r(e,"P",{"data-svelte-h":!0}),f(ue)!=="svelte-1cyr7v9"&&(ue.textContent=Oi),Gl=p(e),T(ce.$$.fragment,e),Wl=p(e),I.l(e),yl=p(e),Me=r(e,"P",{"data-svelte-h":!0}),f(Me)!=="svelte-7emhbc"&&(Me.innerHTML=Pi),xl=p(e),de=r(e,"P",{"data-svelte-h":!0}),f(de)!=="svelte-r5u1qb"&&(de.innerHTML=qi),Bl=p(e),be=r(e,"P",{"data-svelte-h":!0}),f(be)!=="svelte-1gd5p9n"&&(be.innerHTML=Ki),Ql=p(e),T(ye.$$.fragment,e),Rl=p(e),Te=r(e,"P",{"data-svelte-h":!0}),f(Te)!=="svelte-xeghpy"&&(Te.textContent=es),Il=p(e),T(Ue.$$.fragment,e),Nl=p(e),_e=r(e,"P",{"data-svelte-h":!0}),f(_e)!=="svelte-hr5evb"&&(_e.innerHTML=ts),Yl=p(e),ge=r(e,"P",{"data-svelte-h":!0}),f(ge)!=="svelte-d6i8l7"&&(ge.textContent=ls),Hl=p(e),Y.l(e),Tl=p(e),$e=r(e,"P",{"data-svelte-h":!0}),f($e)!=="svelte-1hp1xow"&&($e.innerHTML=ns),Al=p(e),we=r(e,"P",{"data-svelte-h":!0}),f(we)!=="svelte-10bupsx"&&(we.textContent=is),El=p(e),A.l(e),Ul=p(e),he=r(e,"P",{"data-svelte-h":!0}),f(he)!=="svelte-1hx5p15"&&(he.innerHTML=ss),Vl=p(e),T(je.$$.fragment,e),zl=p(e),Je=r(e,"P",{"data-svelte-h":!0}),f(Je)!=="svelte-ya1nrs"&&(Je.innerHTML=os),Ll=p(e),ke=r(e,"P",{"data-svelte-h":!0}),f(ke)!=="svelte-iwkw2"&&(ke.textContent=ps),Xl=p(e),T(ve.$$.fragment,e),Fl=p(e),Ze=r(e,"P",{"data-svelte-h":!0}),f(Ze)!=="svelte-31b7pk"&&(Ze.innerHTML=ms),Sl=p(e),T(Ce.$$.fragment,e),Dl=p(e),Ge=r(e,"P",{"data-svelte-h":!0}),f(Ge)!=="svelte-cclejb"&&(Ge.innerHTML=as),Ol=p(e),T(We.$$.fragment,e),Pl=p(e),xe=r(e,"P",{"data-svelte-h":!0}),f(xe)!=="svelte-1uec537"&&(xe.innerHTML=rs),ql=p(e),Be=r(e,"P",{"data-svelte-h":!0}),f(Be)!=="svelte-wght1v"&&(Be.textContent=fs),Kl=p(e),q.l(e),_l=p(e),T(le.$$.fragment,e),en=p(e),Qe=r(e,"P",{"data-svelte-h":!0}),f(Qe)!=="svelte-6u39hq"&&(Qe.innerHTML=us),tn=p(e),Re=r(e,"P",{"data-svelte-h":!0}),f(Re)!=="svelte-1mrib0b"&&(Re.innerHTML=cs),ln=p(e),Ie=r(e,"P",{"data-svelte-h":!0}),f(Ie)!=="svelte-j9zhz4"&&(Ie.textContent=Ms),nn=p(e),T(Ne.$$.fragment,e),sn=p(e),Ye=r(e,"P",{"data-svelte-h":!0}),f(Ye)!=="svelte-1akdli3"&&(Ye.innerHTML=ds),on=p(e),He=r(e,"P",{"data-svelte-h":!0}),f(He)!=="svelte-ct1t7u"&&(He.innerHTML=bs),pn=p(e),T(Ae.$$.fragment,e),mn=p(e),Ee=r(e,"P",{"data-svelte-h":!0}),f(Ee)!=="svelte-g2ojd0"&&(Ee.innerHTML=ys),an=p(e),Ve=r(e,"P",{"data-svelte-h":!0}),f(Ve)!=="svelte-9laibn"&&(Ve.innerHTML=Ts),rn=p(e),T(ze.$$.fragment,e),fn=p(e),Le=r(e,"P",{"data-svelte-h":!0}),f(Le)!=="svelte-knweyp"&&(Le.innerHTML=Us),un=p(e),T(Xe.$$.fragment,e),cn=p(e),Fe=r(e,"P",{"data-svelte-h":!0}),f(Fe)!=="svelte-1nrpboy"&&(Fe.innerHTML=_s),Mn=p(e),Se=r(e,"P",{"data-svelte-h":!0}),f(Se)!=="svelte-694p53"&&(Se.textContent=gs),dn=p(e),De=r(e,"UL",{"data-svelte-h":!0}),f(De)!=="svelte-1lh8p02"&&(De.innerHTML=$s),bn=p(e),Oe=r(e,"P",{"data-svelte-h":!0}),f(Oe)!=="svelte-14iopi5"&&(Oe.textContent=ws),yn=p(e),T(Pe.$$.fragment,e),Tn=p(e),qe=r(e,"P",{"data-svelte-h":!0}),f(qe)!=="svelte-8dwi2d"&&(qe.textContent=hs),Un=p(e),Ke=r(e,"P",{"data-svelte-h":!0}),f(Ke)!=="svelte-1ae3n1y"&&(Ke.innerHTML=js),_n=p(e),ne=r(e,"DIV",{class:!0,"data-svelte-h":!0}),f(ne)!=="svelte-4qsgxt"&&(ne.innerHTML=Js),gn=p(e),et=r(e,"P",{"data-svelte-h":!0}),f(et)!=="svelte-1bph78w"&&(et.textContent=ks),$n=p(e),tt=r(e,"P",{"data-svelte-h":!0}),f(tt)!=="svelte-141u7rf"&&(tt.textContent=vs),wn=p(e),lt=r(e,"P",{"data-svelte-h":!0}),f(lt)!=="svelte-tetvex"&&(lt.textContent=Zs),hn=p(e),ie=r(e,"DIV",{class:!0,"data-svelte-h":!0}),f(ie)!=="svelte-1xh6nig"&&(ie.innerHTML=Cs),jn=p(e),nt=r(e,"P",{"data-svelte-h":!0}),f(nt)!=="svelte-eg7xzt"&&(nt.textContent=Gs),Jn=p(e),se=r(e,"DIV",{class:!0,"data-svelte-h":!0}),f(se)!=="svelte-1jm8l0p"&&(se.innerHTML=Ws),kn=p(e),it=r(e,"P",{"data-svelte-h":!0}),f(it)!=="svelte-16jhpt8"&&(it.textContent=xs),vn=p(e),st=r(e,"P",{"data-svelte-h":!0}),f(st)!=="svelte-1ygia8y"&&(st.textContent=Bs),Zn=p(e),ot=r(e,"P",{"data-svelte-h":!0}),f(ot)!=="svelte-1j9d8go"&&(ot.textContent=Qs),Cn=p(e),oe=r(e,"DIV",{class:!0,"data-svelte-h":!0}),f(oe)!=="svelte-1kuf5jc"&&(oe.innerHTML=Rs),Gn=p(e),pt=r(e,"P",{"data-svelte-h":!0}),f(pt)!=="svelte-9eohe8"&&(pt.textContent=Is),Wn=p(e),T(mt.$$.fragment,e),xn=p(e),at=r(e,"P",{"data-svelte-h":!0}),f(at)!=="svelte-nnssmw"&&(at.innerHTML=Ns),Bn=p(e),rt=r(e,"P",{"data-svelte-h":!0}),f(rt)!=="svelte-1xxhqkm"&&(rt.innerHTML=Ys),Qn=p(e),T(ft.$$.fragment,e),Rn=p(e),ut=r(e,"P",{"data-svelte-h":!0}),f(ut)!=="svelte-1wv2003"&&(ut.innerHTML=Hs),In=p(e),T(ct.$$.fragment,e),Nn=p(e),Mt=r(e,"P",{"data-svelte-h":!0}),f(Mt)!=="svelte-865h78"&&(Mt.innerHTML=As),Yn=p(e),dt=r(e,"UL",{"data-svelte-h":!0}),f(dt)!=="svelte-plsyyf"&&(dt.innerHTML=Es),Hn=p(e),T(bt.$$.fragment,e),An=p(e),yt=r(e,"P",{"data-svelte-h":!0}),f(yt)!=="svelte-1ncb87g"&&(yt.innerHTML=Vs),En=p(e),Tt=r(e,"P",{"data-svelte-h":!0}),f(Tt)!=="svelte-c5cxc7"&&(Tt.textContent=zs),Vn=p(e),T(Ut.$$.fragment,e),zn=p(e),_t=r(e,"P",{"data-svelte-h":!0}),f(_t)!=="svelte-5w9rdf"&&(_t.innerHTML=Ls),Ln=p(e),gt=r(e,"P",{"data-svelte-h":!0}),f(gt)!=="svelte-p6b4ty"&&(gt.textContent=Xs),Xn=p(e),T($t.$$.fragment,e),Fn=p(e),wt=r(e,"P",{"data-svelte-h":!0}),f(wt)!=="svelte-tsk6e5"&&(wt.innerHTML=Fs),Sn=p(e),ht=r(e,"P",{"data-svelte-h":!0}),f(ht)!=="svelte-195rxgy"&&(ht.textContent=Ss),Dn=p(e),jt=r(e,"P",{"data-svelte-h":!0}),f(jt)!=="svelte-av6whq"&&(jt.textContent=Ds),On=p(e),T(Jt.$$.fragment,e),Pn=p(e),kt=r(e,"P",{"data-svelte-h":!0}),f(kt)!=="svelte-omrpwm"&&(kt.textContent=Os),qn=p(e),T(vt.$$.fragment,e),Kn=p(e),Zt=r(e,"P",{"data-svelte-h":!0}),f(Zt)!=="svelte-6uh8dx"&&(Zt.innerHTML=Ps),ei=p(e),T(Ct.$$.fragment,e),ti=p(e),Gt=r(e,"P",{"data-svelte-h":!0}),f(Gt)!=="svelte-ef7ef5"&&(Gt.textContent=qs),li=p(e),T(Wt.$$.fragment,e),ni=p(e),xt=r(e,"P",{"data-svelte-h":!0}),f(xt)!=="svelte-mnjwf9"&&(xt.textContent=Ks),ii=p(e),Bt=r(e,"P",{"data-svelte-h":!0}),f(Bt)!=="svelte-1oj8yfa"&&(Bt.innerHTML=eo),si=p(e),Qt=r(e,"P",{"data-svelte-h":!0}),f(Qt)!=="svelte-uo613s"&&(Qt.textContent=to),oi=p(e),T(Rt.$$.fragment,e),pi=p(e),T(It.$$.fragment,e),mi=p(e),Nt=r(e,"P",{"data-svelte-h":!0}),f(Nt)!=="svelte-1o96t3b"&&(Nt.textContent=lo),ai=p(e),T(Yt.$$.fragment,e),ri=p(e),Ht=r(e,"P",{"data-svelte-h":!0}),f(Ht)!=="svelte-jt23pm"&&(Ht.innerHTML=no),fi=p(e),T(At.$$.fragment,e),ui=p(e),Et=r(e,"P",{"data-svelte-h":!0}),f(Et)!=="svelte-1r1uuh1"&&(Et.textContent=io),ci=p(e),T(Vt.$$.fragment,e),Mi=p(e),T(zt.$$.fragment,e),di=p(e),Lt=r(e,"P",{"data-svelte-h":!0}),f(Lt)!=="svelte-9vpuc0"&&(Lt.innerHTML=so),bi=p(e),Xt=r(e,"P",{"data-svelte-h":!0}),f(Xt)!=="svelte-1u8cwmn"&&(Xt.textContent=oo),yi=p(e),Ft=r(e,"P",{"data-svelte-h":!0}),f(Ft)!=="svelte-13f3ubf"&&(Ft.textContent=po),Ti=p(e),V.l(e),gl=p(e),St=r(e,"P",{"data-svelte-h":!0}),f(St)!=="svelte-e7orlz"&&(St.textContent=mo),Ui=p(e),T(Dt.$$.fragment,e),_i=p(e),L.l(e),$l=p(e),T(pe.$$.fragment,e),gi=p(e),Ot=r(e,"P",{"data-svelte-h":!0}),f(Ot)!=="svelte-a5o7vp"&&(Ot.innerHTML=ao),$i=p(e),T(Pt.$$.fragment,e),wi=p(e),qt=r(e,"P",{"data-svelte-h":!0}),f(qt)!=="svelte-iuy89q"&&(qt.textContent=ro),hi=p(e),T(Kt.$$.fragment,e),ji=p(e),F.l(e),wl=p(e),el=r(e,"P",{"data-svelte-h":!0}),f(el)!=="svelte-1uz7bc"&&(el.innerHTML=fo),Ji=p(e),T(tl.$$.fragment,e),ki=p(e),D.l(e),hl=p(e),ll=r(e,"P",{"data-svelte-h":!0}),f(ll)!=="svelte-80qp80"&&(ll.textContent=uo),vi=p(e),T(nl.$$.fragment,e),Zi=p(e),P.l(e),jl=p(e),il=r(e,"P",{"data-svelte-h":!0}),f(il)!=="svelte-1cjthzw"&&(il.textContent=co),Ci=p(e),T(sl.$$.fragment,e),Gi=p(e),T(ol.$$.fragment,e),Wi=p(e),K.l(e),Jl=p(e),T(pl.$$.fragment,e),xi=p(e),kl=r(e,"P",{}),No(kl).forEach(l),this.h()},h(){W(i,"name","hf:doc:metadata"),W(i,"content",hp),W(ne,"class","flex justify-center"),W(ie,"class","flex justify-center"),W(se,"class","flex justify-center"),W(oe,"class","flex justify-center")},m(e,t){Fo(document.head,i),n(e,m,t),n(e,s,t),n(e,c,t),U(w,e,t),n(e,u,t),U($,e,t),n(e,C,t),U(J,e,t),n(e,v,t),ml[Z].m(e,t),n(e,k,t),n(e,x,t),n(e,ae,t),U(B,e,t),n(e,j,t),n(e,G,t),n(e,vl,t),n(e,re,t),n(e,Zl,t),n(e,fe,t),n(e,Cl,t),n(e,ue,t),n(e,Gl,t),U(ce,e,t),n(e,Wl,t),al[R].m(e,t),n(e,yl,t),n(e,Me,t),n(e,xl,t),n(e,de,t),n(e,Bl,t),n(e,be,t),n(e,Ql,t),U(ye,e,t),n(e,Rl,t),n(e,Te,t),n(e,Il,t),U(Ue,e,t),n(e,Nl,t),n(e,_e,t),n(e,Yl,t),n(e,ge,t),n(e,Hl,t),rl[N].m(e,t),n(e,Tl,t),n(e,$e,t),n(e,Al,t),n(e,we,t),n(e,El,t),fl[H].m(e,t),n(e,Ul,t),n(e,he,t),n(e,Vl,t),U(je,e,t),n(e,zl,t),n(e,Je,t),n(e,Ll,t),n(e,ke,t),n(e,Xl,t),U(ve,e,t),n(e,Fl,t),n(e,Ze,t),n(e,Sl,t),U(Ce,e,t),n(e,Dl,t),n(e,Ge,t),n(e,Ol,t),U(We,e,t),n(e,Pl,t),n(e,xe,t),n(e,ql,t),n(e,Be,t),n(e,Kl,t),q.m(e,t),n(e,_l,t),U(le,e,t),n(e,en,t),n(e,Qe,t),n(e,tn,t),n(e,Re,t),n(e,ln,t),n(e,Ie,t),n(e,nn,t),U(Ne,e,t),n(e,sn,t),n(e,Ye,t),n(e,on,t),n(e,He,t),n(e,pn,t),U(Ae,e,t),n(e,mn,t),n(e,Ee,t),n(e,an,t),n(e,Ve,t),n(e,rn,t),U(ze,e,t),n(e,fn,t),n(e,Le,t),n(e,un,t),U(Xe,e,t),n(e,cn,t),n(e,Fe,t),n(e,Mn,t),n(e,Se,t),n(e,dn,t),n(e,De,t),n(e,bn,t),n(e,Oe,t),n(e,yn,t),U(Pe,e,t),n(e,Tn,t),n(e,qe,t),n(e,Un,t),n(e,Ke,t),n(e,_n,t),n(e,ne,t),n(e,gn,t),n(e,et,t),n(e,$n,t),n(e,tt,t),n(e,wn,t),n(e,lt,t),n(e,hn,t),n(e,ie,t),n(e,jn,t),n(e,nt,t),n(e,Jn,t),n(e,se,t),n(e,kn,t),n(e,it,t),n(e,vn,t),n(e,st,t),n(e,Zn,t),n(e,ot,t),n(e,Cn,t),n(e,oe,t),n(e,Gn,t),n(e,pt,t),n(e,Wn,t),U(mt,e,t),n(e,xn,t),n(e,at,t),n(e,Bn,t),n(e,rt,t),n(e,Qn,t),U(ft,e,t),n(e,Rn,t),n(e,ut,t),n(e,In,t),U(ct,e,t),n(e,Nn,t),n(e,Mt,t),n(e,Yn,t),n(e,dt,t),n(e,Hn,t),U(bt,e,t),n(e,An,t),n(e,yt,t),n(e,En,t),n(e,Tt,t),n(e,Vn,t),U(Ut,e,t),n(e,zn,t),n(e,_t,t),n(e,Ln,t),n(e,gt,t),n(e,Xn,t),U($t,e,t),n(e,Fn,t),n(e,wt,t),n(e,Sn,t),n(e,ht,t),n(e,Dn,t),n(e,jt,t),n(e,On,t),U(Jt,e,t),n(e,Pn,t),n(e,kt,t),n(e,qn,t),U(vt,e,t),n(e,Kn,t),n(e,Zt,t),n(e,ei,t),U(Ct,e,t),n(e,ti,t),n(e,Gt,t),n(e,li,t),U(Wt,e,t),n(e,ni,t),n(e,xt,t),n(e,ii,t),n(e,Bt,t),n(e,si,t),n(e,Qt,t),n(e,oi,t),U(Rt,e,t),n(e,pi,t),U(It,e,t),n(e,mi,t),n(e,Nt,t),n(e,ai,t),U(Yt,e,t),n(e,ri,t),n(e,Ht,t),n(e,fi,t),U(At,e,t),n(e,ui,t),n(e,Et,t),n(e,ci,t),U(Vt,e,t),n(e,Mi,t),U(zt,e,t),n(e,di,t),n(e,Lt,t),n(e,bi,t),n(e,Xt,t),n(e,yi,t),n(e,Ft,t),n(e,Ti,t),ul[E].m(e,t),n(e,gl,t),n(e,St,t),n(e,Ui,t),U(Dt,e,t),n(e,_i,t),cl[z].m(e,t),n(e,$l,t),U(pe,e,t),n(e,gi,t),n(e,Ot,t),n(e,$i,t),U(Pt,e,t),n(e,wi,t),n(e,qt,t),n(e,hi,t),U(Kt,e,t),n(e,ji,t),Ml[X].m(e,t),n(e,wl,t),n(e,el,t),n(e,Ji,t),U(tl,e,t),n(e,ki,t),dl[S].m(e,t),n(e,hl,t),n(e,ll,t),n(e,vi,t),U(nl,e,t),n(e,Zi,t),bl[O].m(e,t),n(e,jl,t),n(e,il,t),n(e,Ci,t),U(sl,e,t),n(e,Gi,t),U(ol,e,t),n(e,Wi,t),K.m(e,t),n(e,Jl,t),U(pl,e,t),n(e,xi,t),n(e,kl,t),Bi=!0},p(e,[t]){const Qo={};t&1&&(Qo.fw=e[0]),w.$set(Qo);let Ii=Z;Z=bo(e),Z!==Ii&&(te(),d(ml[Ii],1,1,()=>{ml[Ii]=null}),ee(),M=ml[Z],M||(M=ml[Z]=Mo[Z](e),M.c()),b(M,1),M.m(k.parentNode,k));let Ni=R;R=To(e),R!==Ni&&(te(),d(al[Ni],1,1,()=>{al[Ni]=null}),ee(),I=al[R],I||(I=al[R]=yo[R](e),I.c()),b(I,1),I.m(yl.parentNode,yl));let Yi=N;N=_o(e),N!==Yi&&(te(),d(rl[Yi],1,1,()=>{rl[Yi]=null}),ee(),Y=rl[N],Y||(Y=rl[N]=Uo[N](e),Y.c()),b(Y,1),Y.m(Tl.parentNode,Tl));let Hi=H;H=$o(e),H!==Hi&&(te(),d(fl[Hi],1,1,()=>{fl[Hi]=null}),ee(),A=fl[H],A||(A=fl[H]=go[H](e),A.c()),b(A,1),A.m(Ul.parentNode,Ul)),Qi!==(Qi=wo(e))&&(q.d(1),q=Qi(e),q&&(q.c(),q.m(_l.parentNode,_l)));const Ro={};t&2&&(Ro.$$scope={dirty:t,ctx:e}),le.$set(Ro);let Ai=E;E=jo(e),E!==Ai&&(te(),d(ul[Ai],1,1,()=>{ul[Ai]=null}),ee(),V=ul[E],V||(V=ul[E]=ho[E](e),V.c()),b(V,1),V.m(gl.parentNode,gl));let Ei=z;z=ko(e),z!==Ei&&(te(),d(cl[Ei],1,1,()=>{cl[Ei]=null}),ee(),L=cl[z],L||(L=cl[z]=Jo[z](e),L.c()),b(L,1),L.m($l.parentNode,$l));const Io={};t&2&&(Io.$$scope={dirty:t,ctx:e}),pe.$set(Io);let Vi=X;X=Zo(e),X!==Vi&&(te(),d(Ml[Vi],1,1,()=>{Ml[Vi]=null}),ee(),F=Ml[X],F||(F=Ml[X]=vo[X](e),F.c()),b(F,1),F.m(wl.parentNode,wl));let zi=S;S=Go(e),S!==zi&&(te(),d(dl[zi],1,1,()=>{dl[zi]=null}),ee(),D=dl[S],D||(D=dl[S]=Co[S](e),D.c()),b(D,1),D.m(hl.parentNode,hl));let Li=O;O=xo(e),O!==Li&&(te(),d(bl[Li],1,1,()=>{bl[Li]=null}),ee(),P=bl[O],P||(P=bl[O]=Wo[O](e),P.c()),b(P,1),P.m(jl.parentNode,jl)),Ri!==(Ri=Bo(e))&&(K.d(1),K=Ri(e),K&&(K.c(),K.m(Jl.parentNode,Jl)))},i(e){Bi||(b(w.$$.fragment,e),b($.$$.fragment,e),b(J.$$.fragment,e),b(M),b(B.$$.fragment,e),b(ce.$$.fragment,e),b(I),b(ye.$$.fragment,e),b(Ue.$$.fragment,e),b(Y),b(A),b(je.$$.fragment,e),b(ve.$$.fragment,e),b(Ce.$$.fragment,e),b(We.$$.fragment,e),b(le.$$.fragment,e),b(Ne.$$.fragment,e),b(Ae.$$.fragment,e),b(ze.$$.fragment,e),b(Xe.$$.fragment,e),b(Pe.$$.fragment,e),b(mt.$$.fragment,e),b(ft.$$.fragment,e),b(ct.$$.fragment,e),b(bt.$$.fragment,e),b(Ut.$$.fragment,e),b($t.$$.fragment,e),b(Jt.$$.fragment,e),b(vt.$$.fragment,e),b(Ct.$$.fragment,e),b(Wt.$$.fragment,e),b(Rt.$$.fragment,e),b(It.$$.fragment,e),b(Yt.$$.fragment,e),b(At.$$.fragment,e),b(Vt.$$.fragment,e),b(zt.$$.fragment,e),b(V),b(Dt.$$.fragment,e),b(L),b(pe.$$.fragment,e),b(Pt.$$.fragment,e),b(Kt.$$.fragment,e),b(F),b(tl.$$.fragment,e),b(D),b(nl.$$.fragment,e),b(P),b(sl.$$.fragment,e),b(ol.$$.fragment,e),b(pl.$$.fragment,e),Bi=!0)},o(e){d(w.$$.fragment,e),d($.$$.fragment,e),d(J.$$.fragment,e),d(M),d(B.$$.fragment,e),d(ce.$$.fragment,e),d(I),d(ye.$$.fragment,e),d(Ue.$$.fragment,e),d(Y),d(A),d(je.$$.fragment,e),d(ve.$$.fragment,e),d(Ce.$$.fragment,e),d(We.$$.fragment,e),d(le.$$.fragment,e),d(Ne.$$.fragment,e),d(Ae.$$.fragment,e),d(ze.$$.fragment,e),d(Xe.$$.fragment,e),d(Pe.$$.fragment,e),d(mt.$$.fragment,e),d(ft.$$.fragment,e),d(ct.$$.fragment,e),d(bt.$$.fragment,e),d(Ut.$$.fragment,e),d($t.$$.fragment,e),d(Jt.$$.fragment,e),d(vt.$$.fragment,e),d(Ct.$$.fragment,e),d(Wt.$$.fragment,e),d(Rt.$$.fragment,e),d(It.$$.fragment,e),d(Yt.$$.fragment,e),d(At.$$.fragment,e),d(Vt.$$.fragment,e),d(zt.$$.fragment,e),d(V),d(Dt.$$.fragment,e),d(L),d(pe.$$.fragment,e),d(Pt.$$.fragment,e),d(Kt.$$.fragment,e),d(F),d(tl.$$.fragment,e),d(D),d(nl.$$.fragment,e),d(P),d(sl.$$.fragment,e),d(ol.$$.fragment,e),d(pl.$$.fragment,e),Bi=!1},d(e){e&&(l(m),l(s),l(c),l(u),l(C),l(v),l(k),l(x),l(ae),l(j),l(G),l(vl),l(re),l(Zl),l(fe),l(Cl),l(ue),l(Gl),l(Wl),l(yl),l(Me),l(xl),l(de),l(Bl),l(be),l(Ql),l(Rl),l(Te),l(Il),l(Nl),l(_e),l(Yl),l(ge),l(Hl),l(Tl),l($e),l(Al),l(we),l(El),l(Ul),l(he),l(Vl),l(zl),l(Je),l(Ll),l(ke),l(Xl),l(Fl),l(Ze),l(Sl),l(Dl),l(Ge),l(Ol),l(Pl),l(xe),l(ql),l(Be),l(Kl),l(_l),l(en),l(Qe),l(tn),l(Re),l(ln),l(Ie),l(nn),l(sn),l(Ye),l(on),l(He),l(pn),l(mn),l(Ee),l(an),l(Ve),l(rn),l(fn),l(Le),l(un),l(cn),l(Fe),l(Mn),l(Se),l(dn),l(De),l(bn),l(Oe),l(yn),l(Tn),l(qe),l(Un),l(Ke),l(_n),l(ne),l(gn),l(et),l($n),l(tt),l(wn),l(lt),l(hn),l(ie),l(jn),l(nt),l(Jn),l(se),l(kn),l(it),l(vn),l(st),l(Zn),l(ot),l(Cn),l(oe),l(Gn),l(pt),l(Wn),l(xn),l(at),l(Bn),l(rt),l(Qn),l(Rn),l(ut),l(In),l(Nn),l(Mt),l(Yn),l(dt),l(Hn),l(An),l(yt),l(En),l(Tt),l(Vn),l(zn),l(_t),l(Ln),l(gt),l(Xn),l(Fn),l(wt),l(Sn),l(ht),l(Dn),l(jt),l(On),l(Pn),l(kt),l(qn),l(Kn),l(Zt),l(ei),l(ti),l(Gt),l(li),l(ni),l(xt),l(ii),l(Bt),l(si),l(Qt),l(oi),l(pi),l(mi),l(Nt),l(ai),l(ri),l(Ht),l(fi),l(ui),l(Et),l(ci),l(Mi),l(di),l(Lt),l(bi),l(Xt),l(yi),l(Ft),l(Ti),l(gl),l(St),l(Ui),l(_i),l($l),l(gi),l(Ot),l($i),l(wi),l(qt),l(hi),l(ji),l(wl),l(el),l(Ji),l(ki),l(hl),l(ll),l(vi),l(Zi),l(jl),l(il),l(Ci),l(Gi),l(Wi),l(Jl),l(xi),l(kl)),l(i),_(w,e),_($,e),_(J,e),ml[Z].d(e),_(B,e),_(ce,e),al[R].d(e),_(ye,e),_(Ue,e),rl[N].d(e),fl[H].d(e),_(je,e),_(ve,e),_(Ce,e),_(We,e),q.d(e),_(le,e),_(Ne,e),_(Ae,e),_(ze,e),_(Xe,e),_(Pe,e),_(mt,e),_(ft,e),_(ct,e),_(bt,e),_(Ut,e),_($t,e),_(Jt,e),_(vt,e),_(Ct,e),_(Wt,e),_(Rt,e),_(It,e),_(Yt,e),_(At,e),_(Vt,e),_(zt,e),ul[E].d(e),_(Dt,e),cl[z].d(e),_(pe,e),_(Pt,e),_(Kt,e),Ml[X].d(e),_(tl,e),dl[S].d(e),_(nl,e),bl[O].d(e),_(sl,e),_(ol,e),K.d(e),_(pl,e)}}}const hp='{"title":"共享预训练模型","local":"共享预训练模型","sections":[{"title":"使用 push_to_hub API","local":"使用 push_to_hub API","sections":[],"depth":2},{"title":"使用 huggingface_hub python 库","local":"使用 huggingface_hub python 库","sections":[],"depth":2},{"title":"使用网络界面","local":"使用网络界面","sections":[],"depth":2},{"title":"上传模型文件","local":"上传模型文件","sections":[{"title":"upload_file 方法","local":"upload_file 方法","sections":[],"depth":3},{"title":"Repository 类 [ Repository 类 ] Repository 类可以使用类似 git 的方式管理一个本地仓库。它解决了使用 git 可能遇到的大部分痛点，提供我们所需的所有功能。","local":"repository-类--repository-类--repository-类可以使用类似-git-的方式管理一个本地仓库它解决了使用-git-可能遇到的大部分痛点提供我们所需的所有功能","sections":[],"depth":3},{"title":"基于 git 的方法","local":"基于 git 的方法","sections":[],"depth":3}],"depth":2}],"depth":1}';function jp(g,i,m){let s="pt";return Eo(()=>{const c=new URLSearchParams(window.location.search);m(0,s=c.get("fw")||"pt")}),[s]}class Bp extends zo{constructor(i){super(),Lo(this,i,jp,wp,Ao,{})}}export{Bp as component};
