import{s as Yo,o as Ho,n as Ao}from"../chunks/scheduler.37c15a92.js";import{S as Eo,i as Vo,g as a,s as o,r as y,A as zo,h as r,f as l,c as p,j as Ro,u as T,x as f,k as B,y as Lo,a as n,v as U,t as M,b as ee,d,w as _,m as Xo,n as Fo,p as te}from"../chunks/index.2bf4358c.js";import{T as Io}from"../chunks/Tip.363c041f.js";import{Y as Li}from"../chunks/Youtube.1e50a667.js";import{C as w}from"../chunks/CodeBlock.4e987730.js";import{C as No}from"../chunks/CourseFloatingBanner.9ff4c771.js";import{F as So}from"../chunks/FrameworkSwitchCourse.8d4d4ab6.js";import{H as me,E as Do}from"../chunks/getInferenceSnippets.39afd8fb.js";function Oo(g){let i,m;return i=new No({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||(d(i.$$.fragment,s),m=!0)},o(s){M(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function Po(g){let i,m;return i=new No({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||(d(i.$$.fragment,s),m=!0)},o(s){M(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function qo(g){let i,m;return i=new Li({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||(d(i.$$.fragment,s),m=!0)},o(s){M(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function Ko(g){let i,m;return i=new Li({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||(d(i.$$.fragment,s),m=!0)},o(s){M(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function ep(g){let i,m="如果你使用 Keras 来训练你的模型，则将其上传到 Hub 的最简单方法是在调用 <code>model.fit()</code> 添加 <code>PushToHubCallback</code> ：",s,c,h,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,J="要将你的模型上传到你所属的组织，只需设置如下 <code>hub_model_id = my_organization/my_repo_name</code> 。",Z;return c=new w({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),h=o(),u=a("p"),u.innerHTML=$,C=o(),j=a("p"),j.innerHTML=J},l(b){i=r(b,"P",{"data-svelte-h":!0}),f(i)!=="svelte-i1obt0"&&(i.innerHTML=m),s=p(b),T(c.$$.fragment,b),h=p(b),u=r(b,"P",{"data-svelte-h":!0}),f(u)!=="svelte-127bdlb"&&(u.innerHTML=$),C=p(b),j=r(b,"P",{"data-svelte-h":!0}),f(j)!=="svelte-1xp54h0"&&(j.innerHTML=J)},m(b,v){n(b,i,v),n(b,s,v),U(c,b,v),n(b,h,v),n(b,u,v),n(b,C,v),n(b,j,v),Z=!0},i(b){Z||(d(c.$$.fragment,b),Z=!0)},o(b){M(c.$$.fragment,b),Z=!1},d(b){b&&(l(i),l(s),l(h),l(u),l(C),l(j)),_(c,b)}}}function tp(g){let i,m="如果你已经尝试使用过 <code>Trainer</code> API 训练模型，将其上传到 Hub 的最简单方法是在定义 <code>TrainingArguments</code> 时设置 <code>push_to_hub=True</code> ：",s,c,h,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,J="若要将你的模型上传到你所属的组织，只需设置 <code>hub_model_id = my_organization/my_repo_name</code> 。",Z,b,v="最后，需要在训练循环结束后运行 <code>trainer.push_to_hub()</code> 上传模型的最新版本。它还会生成一份包含所有相关元数据的模型卡片，包含使用的超参数和评估结果！以下是一个模型卡片的示例：",P,G,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%"/>',x;return c=new w({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),h=o(),u=a("p"),u.innerHTML=$,C=o(),j=a("p"),j.innerHTML=J,Z=o(),b=a("p"),b.innerHTML=v,P=o(),G=a("div"),G.innerHTML=ae,this.h()},l(k){i=r(k,"P",{"data-svelte-h":!0}),f(i)!=="svelte-3t0wzw"&&(i.innerHTML=m),s=p(k),T(c.$$.fragment,k),h=p(k),u=r(k,"P",{"data-svelte-h":!0}),f(u)!=="svelte-1ijvlw7"&&(u.innerHTML=$),C=p(k),j=r(k,"P",{"data-svelte-h":!0}),f(j)!=="svelte-14bpeck"&&(j.innerHTML=J),Z=p(k),b=r(k,"P",{"data-svelte-h":!0}),f(b)!=="svelte-1m7kq2x"&&(b.innerHTML=v),P=p(k),G=r(k,"DIV",{class:!0,"data-svelte-h":!0}),f(G)!=="svelte-1lhrimn"&&(G.innerHTML=ae),this.h()},h(){B(G,"class","flex justify-center")},m(k,W){n(k,i,W),n(k,s,W),U(c,k,W),n(k,h,W),n(k,u,W),n(k,C,W),n(k,j,W),n(k,Z,W),n(k,b,W),n(k,P,W),n(k,G,W),x=!0},i(k){x||(d(c.$$.fragment,k),x=!0)},o(k){M(c.$$.fragment,k),x=!1},d(k){k&&(l(i),l(s),l(h),l(u),l(C),l(j),l(Z),l(b),l(P),l(G)),_(c,k)}}}function lp(g){let i,m;return i=new w({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||(d(i.$$.fragment,s),m=!0)},o(s){M(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function np(g){let i,m;return i=new w({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||(d(i.$$.fragment,s),m=!0)},o(s){M(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function ip(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(){B(i,"class","flex justify-center")},m(s,c){n(s,i,c)},d(s){s&&l(i)}}}function sp(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(){B(i,"class","flex justify-center")},m(s,c){n(s,i,c)},d(s){s&&l(i)}}}function op(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:Ao,d(s){s&&l(i)}}}function pp(g){let i,m;return i=new w({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||(d(i.$$.fragment,s),m=!0)},o(s){M(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function mp(g){let i,m;return i=new w({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||(d(i.$$.fragment,s),m=!0)},o(s){M(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function ap(g){let i,m,s,c="如果你尝试查看文件大小（例如， <code>ls -lh</code> ），你应该会看到模型状态字典文件 （t5_model.h5） 唯一的异常的文件，超过了 400 MB。",h;return i=new w({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,$),h=!0},i(u){h||(d(i.$$.fragment,u),h=!0)},o(u){M(i.$$.fragment,u),h=!1},d(u){u&&(l(m),l(s)),_(i,u)}}}function rp(g){let i,m,s,c="如果你尝试查看文件大小（例如，使用 <code>ls -lh</code> ），你应该看到模型状态字典文件（pytorch_model.bin）是唯一的异常的文件，超过了 400 MB。",h;return i=new w({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,$),h=!0},i(u){h||(d(i.$$.fragment,u),h=!0)},o(u){M(i.$$.fragment,u),h=!1},d(u){u&&(l(m),l(s)),_(i,u)}}}function fp(g){let i;return{c(){i=Xo("✏️ 当通过网页界面创建仓库时， `.gitattributes` 文件会自动将某些扩展名（如 `.bin` 和 `.h5` ）的文件视为大文件，你无需对 git-lfs 进行任何设置即可跟踪它们。")},l(m){i=Fo(m,"✏️ 当通过网页界面创建仓库时， `.gitattributes` 文件会自动将某些扩展名（如 `.bin` 和 `.h5` ）的文件视为大文件，你无需对 git-lfs 进行任何设置即可跟踪它们。")},m(m,s){n(m,i,s)},d(m){m&&l(i)}}}function up(g){let i,m;return i=new w({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||(d(i.$$.fragment,s),m=!0)},o(s){M(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function cp(g){let i,m;return i=new w({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||(d(i.$$.fragment,s),m=!0)},o(s){M(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function Mp(g){let i,m,s,c="我们可以看到所有文件都使用 <code>Git</code> 作为处理程序，除了 <code>t5_model.h5</code> ，它的处理程序是 <code>LFS</code> 。",h;return i=new w({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,$),h=!0},i(u){h||(d(i.$$.fragment,u),h=!0)},o(u){M(i.$$.fragment,u),h=!1},d(u){u&&(l(m),l(s)),_(i,u)}}}function dp(g){let i,m,s,c="我们可以看到所有文件都使用 <code>Git</code> 作为处理程序，除了 <code>pytorch_model.bin</code> 和 <code>sentencepiece.bpe.model</code> 它们的处理程序是 <code>LFS</code> 。",h;return i=new w({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,$),h=!0},i(u){h||(d(i.$$.fragment,u),h=!0)},o(u){M(i.$$.fragment,u),h=!1},d(u){u&&(l(m),l(s)),_(i,u)}}}function bp(g){let i,m;return i=new w({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||(d(i.$$.fragment,s),m=!0)},o(s){M(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function yp(g){let i,m;return i=new w({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||(d(i.$$.fragment,s),m=!0)},o(s){M(i.$$.fragment,s),m=!1},d(s){_(i,s)}}}function Tp(g){let i,m="当这些都完成时，如果我们查看模型仓库，我们可以看到所有最近添加的文件：",s,c,h='<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,J,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=h,u=o(),$=a("p"),$.textContent=C,j=o(),J=a("div"),J.innerHTML=Z,this.h()},l(b){i=r(b,"P",{"data-svelte-h":!0}),f(i)!=="svelte-1b70wlt"&&(i.textContent=m),s=p(b),c=r(b,"DIV",{class:!0,"data-svelte-h":!0}),f(c)!=="svelte-tz4fi2"&&(c.innerHTML=h),u=p(b),$=r(b,"P",{"data-svelte-h":!0}),f($)!=="svelte-1i4hldf"&&($.textContent=C),j=p(b),J=r(b,"DIV",{class:!0,"data-svelte-h":!0}),f(J)!=="svelte-2jd8bj"&&(J.innerHTML=Z),this.h()},h(){B(c,"class","flex justify-center"),B(J,"class","flex justify-center")},m(b,v){n(b,i,v),n(b,s,v),n(b,c,v),n(b,u,v),n(b,$,v),n(b,j,v),n(b,J,v)},d(b){b&&(l(i),l(s),l(c),l(u),l($),l(j),l(J))}}}function Up(g){let i,m="当这些都完成时，如果我们查看模型仓库，我们可以看到所有最近添加的文件：",s,c,h='<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,J,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=h,u=o(),$=a("p"),$.textContent=C,j=o(),J=a("div"),J.innerHTML=Z,this.h()},l(b){i=r(b,"P",{"data-svelte-h":!0}),f(i)!=="svelte-1b70wlt"&&(i.textContent=m),s=p(b),c=r(b,"DIV",{class:!0,"data-svelte-h":!0}),f(c)!=="svelte-1v39mjb"&&(c.innerHTML=h),u=p(b),$=r(b,"P",{"data-svelte-h":!0}),f($)!=="svelte-1i4hldf"&&($.textContent=C),j=p(b),J=r(b,"DIV",{class:!0,"data-svelte-h":!0}),f(J)!=="svelte-1g561m5"&&(J.innerHTML=Z),this.h()},h(){B(c,"class","flex justify-center"),B(J,"class","flex justify-center")},m(b,v){n(b,i,v),n(b,s,v),n(b,c,v),n(b,u,v),n(b,$,v),n(b,j,v),n(b,J,v)},d(b){b&&(l(i),l(s),l(c),l(u),l($),l(j),l(J))}}}function _p(g){let i,m,s,c,h,u,$,C,j,J,Z,b,v="接下来，我们将探索把预训练模型分享到 🤗 Hub 最便捷的方法。我们将一同研究一些工具和功能，它们可以简化直接在中心上分享和更新模型的流程。",P,G,ae,x,k="我们鼓励所有训练模型的用户通过与社区共享来做出贡献——即使是在特定数据集上训练的模型的分享，也能帮助他人，节省他们的时间和计算资源，并提供一些有用的训练成果。反过来，你可以从其他人所做的工作中受益！",W,re,Xi="创建模型存储仓库的方法有以下三种：",vl,fe,Fi="<li>使用 <code>push_to_hub</code> API 接口</li> <li>使用 <code>huggingface_hub</code> Python 库</li> <li>使用网页界面</li>",Zl,ue,Si="创建仓库后，你可以通过 git 和 git-lfs 将文件上传到其中。我们将在以下部分带领你创建模型仓库并向其中上传文件。",Cl,ce,Gl,Q,R,yl,Me,Di="将文件上传到 hub 的最简单方法是利用 <code>push_to_hub</code> API 接口。",Wl,de,Oi="在进行下一步操作之前，你需要生成一个身份验证令牌，这样 <code>huggingface_hub</code> API 才会知道你是谁以及你对哪些空间具有写入权限。",Bl,be,Pi='在一个安装了 <code>transformers</code> 环境中（参见 <a href="/course/chapter0">第零章</a> ）。如果你在 notebook 中，可以运行以下代码登录：',xl,ye,Ql,Te,qi="在终端中，你可以运行：",Rl,Ue,Il,_e,Ki='在这两种情况下，系统都会提示你输入用户名和密码，这与你用于登录 Hub 的用户名和密码相同。如果你还没有 Huggingface 账户，则应该 <a href="https://huggingface.co/join" rel="nofollow">在这里</a> 创建一个账户。',Nl,ge,es="好极了！现在已将你的身份验证令牌存储在了缓存文件夹中。让我们创建一些仓库！",Yl,I,N,Tl,$e,ts="在更底层，你可以通过直接在模型、tokenizer 和配置对象上调用 <code>push_to_hub()</code> 方法来访问模型中心。该方法能够同时创建仓库并直接将模型和 tokenizer 文件推送至仓库，无需手动操作，这与我们在下面要看到的 API 有些许不同。",Hl,he,ls="为了了解它是如何工作的，让我们首先创建一个模型和一个 tokenizer",Al,Y,H,Ul,we,ns="你可以随意进行一些操作——给 tokenizer 添加 tokens 训练模型，微调模型。直到你对最终的模型、权重和 tokenizer 满意。当你对的模最终的模型、权重和 tokenizer 感到满意，你就可以直接在 <code>model</code> 对象上调用 <code>push_to_hub()</code> 方法：",El,je,Vl,Je,is="这将在你的账户中创建新的 <code>dummy-model</code> 仓库，并将这个模型文件上传上去。",zl,ke,ss="对 tokenizer 也需要进行相同的操作：",Ll,ve,Xl,Ze,os="如果你属于一个组织，只需指定 <code>organization</code> 参数即可将模型上传到该组织的账户下：",Fl,Ce,Sl,Ge,ps="如果你希望使用特定的 Hugging Face 令牌，你也可以很方便地将其传递给 <code>push_to_hub()</code> 方法：",Dl,We,Ol,Be,ms='现在你就可以前往 <a href="https://huggingface.co/user-or-organization/dummy-model" rel="nofollow">模型中心</a> 查看你新上传的模型。',Pl,xe,as="单击“文件和版本（Files and versions）”选项卡，你应该能看到以下的文件：",ql,_l,le,Kl,Qe,rs='如你所见， <code>push_to_hub()</code> 方法接受多个参数，从而可以上传到特定的仓库或账户，除此之外还可以使用不同的 API 令牌验证身份。我们建议你直接查看 <a href="https://huggingface.co/transformers/model_sharing" rel="nofollow">🤗 Transformers 文档</a> 了解更多的用法。',en,Re,fs='位于 <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 但将其集成到你自己的代码或库中很简单。',tn,Ie,us="到了最后一部分，让我们看看如何将文件上传到你新创建的仓库！",ln,Ne,nn,Ye,cs="<code>huggingface_hub</code> Python 库是一个包，为模型和数据集中心提供了一系列工具。它提供了简单的方法和类，可以便捷地获取 hub 中仓库的信息以及管理仓库等常见任务。它在 git 的基础上提供了简单的 API，可以在你你的项目中管理这些仓库的内容，以及 hub 的一些功能。",sn,He,Ms="与使用 <code>push_to_hub</code> API 类似，这需要你将 API 令牌保存在缓存中。为此，你需要在操作系统的命令行使用 CLI 中的 <code>login</code> 命令，（如果在 Notebook 中运行，请在这些命令前添加 <code>!</code> 字符）：",on,Ae,pn,Ee,ds="此外，它还提供了非常强大的 <code>Repository</code> 类来管理本地仓库。我们将在接下来的几节中探讨这些方法和类，以理解如何利用它们。",mn,Ve,bs="可以使用 <code>create_repo</code> 方法在 Hub 上创建新的仓库：",an,ze,rn,Le,ys="这将在你的账户中创建 <code>dummy-model</code> 仓库。除此之外你还可以使用 <code>organization</code> 参数指定仓库应属于哪个组织：",fn,Xe,un,Fe,Ts="这将在 <code>huggingface</code> 组织的账户中创建 <code>dummy-model</code> 仓库，如果你属于该组织并且有创建仓库的权限。",cn,Se,Us="其他可能有用的一些参数有：",Mn,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>",dn,Oe,gs="创建仓库后，我们应该向其中添加文件！让我们到下一节，看看三种添加文件的方式。",bn,Pe,yn,qe,$s="Web 界面提供了直接在 Hub 中管理仓库的工具。使用该界面，你可以轻松创建仓库、添加文件（甚至是大文件！）、探索模型、可视化差异等等。",Tn,Ke,hs='要创建新的仓库，请访问 <a href="https://huggingface.co/new" rel="nofollow">huggingface.co/new</a> ：',Un,ne,ws='<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%"/>',_n,et,js="首先，指定仓库的所有者：这可以是你或你所属的组织。如果你选择一个组织，模型将在会显示在组织的页面上，组织的每个成员可以操作仓库。",gn,tt,Js="接下来，输入你的模型名称。同时也是仓库的名称。最后，你可以指定你的模型是公开的还是私有的。私有的模型将被隐藏，对其他的用户不可见。",$n,lt,ks="创建模型仓库后，你应该会看到如下页面：",hn,ie,vs='<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%"/>',wn,nt,Zs="这就是你的模型仓库会显示的页面。你可以直接从网页界面添加 README 文件来填写它。",jn,se,Cs='<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%"/>',Jn,it,Gs="README 文件采用 Markdown 格式 - 你可以根据你的需要自由编写！",kn,st,Ws="这一章的下一部分将帮助你建立模型卡片。这些模型卡片对于提升模型的价值非常重要，因为它们可以告诉其他人你的模型能做什么。",vn,ot,Bs="如果你希望添加更多文件，点击页面顶部的 “Files and versions（文件和版本）” 标签页。在这里，你可以看到仓库的所有文件以及它们的版本。",Zn,oe,xs='<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%"/>',Cn,pt,Qs="接下来我们将看看如何添加一些新文件。",Gn,mt,Wn,at,Rs='Hugging Face Hub 的文件管理系统基于 git 用于处理常规文件，对于较大的文件则需要使用 git-lfs（详情请参阅 <a href="https://git-lfs.github.com/" rel="nofollow">Git 大文件存储</a> ）',Bn,rt,Is="在下一节中，我们会讲述怎么以三种不同的方式将文件上传到 Hub： <code>upload_file</code> 方法、 <code>Repository</code> 类  以及通过 git 命令。",xn,ft,Qn,ut,Ns="使用 <code>upload_file</code> 不需要在你的系统上安装 git 和 git-lfs。它使用 HTTP POST 请求将文件直接发送到 Hub。这种方法的一个限制是它不能上传大于 5GB 的文件。如果你的文件大于 5GB，请按照另外两种方法进行操作。 <code>upload_file</code> 的使用方法如下：",Rn,ct,In,Mt,Ys="以上的代码会把 <code>&lt;path_to_file&gt;</code> 位置的 <code>config.json</code> 文件上传到 <code>dummy-model</code> 仓库的根目录作为模型的 <code>config.json</code> 。其他可能有用的参数包括：",Nn,dt,Hs="<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>",Yn,bt,Hn,yt,As='使用这个类需要安装 git 和 git-lfs，所以请确保你已经安装了 git-lfs（如果没有安装，可以查看 <a href="https://git-lfs.github.com/" rel="nofollow">git-lfs 官网</a> 的安装指南）并已经在操作系统里配置好了相关功能。',An,Tt,Es="为了开始使用我们刚刚创建的仓库，我们可以把远程仓库克隆到一个本地文件夹：",En,Ut,Vn,_t,Vs="以上代码会在我们当前的工作目录中创建 <code>&lt;path_to_dummy_folder&gt;</code> 文件夹。此文件夹里只有 <code>.gitattributes</code> 文件，这是使用 <code>create_repo</code> 创建仓库时生成的文件。",zn,gt,zs="从现在开始，我们可以利用许多传统的 git 方法：",Ln,$t,Xn,ht,Ls='此外！我们建议你查看 <a href="https://github.com/huggingface/huggingface_hub/tree/main/src/huggingface_hub#advanced-programmatic-repository-management" rel="nofollow">huggingface</a> 的 <code>Repository</code> 文档，了解一下所有可用方法。',Fn,wt,Xs="现在，我们有了一个模型和一个 tokenizer 我们希望将其推送到 hub。我们已经成功克隆了仓库，因此我们可以将文件保存到在该仓库的文件夹中。",Sn,jt,Fs="首先，我们通过拉取最新的更改，确保我们的本地克隆是最新的：",Dn,Jt,On,kt,Ss="完成后，我们保存模型和 tokenizer 文件：",Pn,vt,qn,Zt,Ds="<code>&lt;path_to_dummy_folder&gt;</code> 现在已经存储了模型和 tokenizer 文件。我们遵循常规的 git 工作流程，将文件添加到暂存区，提交它们并推送它们到 hub：",Kn,Ct,ei,Gt,Os="恭喜你！你刚刚在 hub 上推送了你的第一个文件。",ti,Wt,li,Bt,Ps="这是上传文件的最基础方法：我们将直接使用 git 和 git-lfs 进行操作，相比于之前的方法难度更大同时也更加灵活。在前面的方法大部分的难点都已经被封装好的库解决，但是接下来的方法需要手动来解决它们，所以我们会尝试一个更复杂的使用案例。",ni,xt,qs='使用这个方法需要安装 git 和 git-lfs，所以请确保你已经安装了 git-lfs（如果没有安装，可以参见 <a href="https://git-lfs.github.com/" rel="nofollow">git-lfs 官网</a> 的安装指南）并已经在操作系统里配置好了相关功能。',ii,Qt,Ks="首先，初始化 git-lfs：",si,Rt,oi,It,pi,Nt,eo="完成后，接下来需要克隆你的模型仓库：",mi,Yt,ai,Ht,to="我的用户名是 <code>lysandre</code> 我使用的模型的名称是 <code>dummy</code> ，所以对我来说，命令最终如下所示：",ri,At,fi,Et,lo="我现在在工作目录中多了一个名为 dummy 的文件夹。我可以 cd 到这个文件夹，看看其中的内容：",ui,Vt,ci,zt,Mi,Lt,no="如果你刚刚用的是 Hugging Face Hub 的 <code>create_repo</code> 方法创建的仓库，这个文件夹应该只包含一个隐藏的 .gitattributes 文件。如果你使用的是网页界面创建了一个仓库，那么文件夹应该只包含一个 README.md 文件和一个隐藏的 .gitattributes 文件。",di,Xt,io="较小的文件，如配置文件、词汇表文件，或者基本上任何几 MB 以下的文件，操作的方法就像我们平时使用 git 一样。然而，更大的文件必须通过 git-lfs 注册才能推送到 huggingface.co。",bi,Ft,so="让我们回到 Python，生成一些我们希望提交到 dummy 仓库的模型和 tokenizer",yi,A,E,gl,St,oo="现在我们已经保存了模型和 tokenizer 让我们再看一下 dummy 文件夹：",Ti,Dt,Ui,V,z,$l,pe,_i,Ot,po="我们现在可以继续上传，就像我们使用传统 Git 仓库一样。我们可以使用以下命令将所有文件添加到 Git 的暂存环境中 <code>git add</code> 命令：",gi,Pt,$i,qt,mo="然后我们可以查看当前暂存的文件：",hi,Kt,wi,L,X,hl,el,ao="同样，我们可以使用 <code>status</code> 命令查看 git-lfs 正在跟踪的文件：",ji,tl,Ji,F,S,wl,ll,ro="让我们继续进行最后的步骤，提交并推送到 huggingface.co 远程仓库：",ki,nl,vi,D,O,jl,il,fo="推送可能需要一些时间，具体取决于你的网络速度以及你的文件大小：",Zi,sl,Ci,ol,Gi,Jl,pl,Wi,kl,Bi;h=new So({props:{fw:g[0]}}),$=new me({props:{title:"共享预训练模型",local:"共享预训练模型",headingTag:"h1"}});const uo=[Po,Oo],ml=[];function co(e,t){return e[0]==="pt"?0:1}j=co(g),J=ml[j]=uo[j](g),G=new Li({props:{id:"9yY3RB_GSPM"}}),ce=new me({props:{title:"使用 push_to_hub API",local:"使用 push_to_hub API",headingTag:"h2"}});const Mo=[Ko,qo],al=[];function bo(e,t){return e[0]==="pt"?0:1}Q=bo(g),R=al[Q]=Mo[Q](g),ye=new w({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 w({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4=",highlighted:"huggingface-cli login",wrap:!1}});const yo=[tp,ep],rl=[];function To(e,t){return e[0]==="pt"?0:1}I=To(g),N=rl[I]=yo[I](g);const Uo=[np,lp],fl=[];function _o(e,t){return e[0]==="pt"?0:1}Y=_o(g),H=fl[Y]=Uo[Y](g),je=new w({props:{code:"bW9kZWwucHVzaF90b19odWIoJTIyZHVtbXktbW9kZWwlMjIp",highlighted:'model.push_to_hub(<span class="hljs-string">&quot;dummy-model&quot;</span>)',wrap:!1}}),ve=new w({props:{code:"dG9rZW5pemVyLnB1c2hfdG9faHViKCUyMmR1bW15LW1vZGVsJTIyKQ==",highlighted:'tokenizer.push_to_hub(<span class="hljs-string">&quot;dummy-model&quot;</span>)',wrap:!1}}),Ce=new w({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 w({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 go(e,t){return e[0]==="pt"?sp:ip}let xi=go(g),q=xi(g);le=new Io({props:{$$slots:{default:[op]},$$scope:{ctx:g}}}),Ne=new me({props:{title:"使用 huggingface_hub python 库",local:"使用 huggingface_hub python 库",headingTag:"h2"}}),Ae=new w({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 w({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 w({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 w({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 w({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 w({props:{code:"cmVwby5naXRfcHVsbCgpJTBBcmVwby5naXRfYWRkKCklMEFyZXBvLmdpdF9jb21taXQoKSUwQXJlcG8uZ2l0X3B1c2goKSUwQXJlcG8uZ2l0X3RhZygp",highlighted:`repo.git_pull()
repo.git_add()
repo.git_commit()
repo.git_push()
repo.git_tag()`,wrap:!1}}),Jt=new w({props:{code:"cmVwby5naXRfcHVsbCgp",highlighted:"repo.git_pull()",wrap:!1}}),vt=new w({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 w({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 w({props:{code:"Z2l0JTIwbGZzJTIwaW5zdGFsbA==",highlighted:"git lfs install",wrap:!1}}),It=new w({props:{code:"VXBkYXRlZCUyMGdpdCUyMGhvb2tzLiUwQUdpdCUyMExGUyUyMGluaXRpYWxpemVkLg==",highlighted:`Updated git hooks.
Git LFS initialized.`,wrap:!1}}),Yt=new w({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 w({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 w({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 w({props:{code:"UkVBRE1FLm1k",highlighted:"README.md",wrap:!1}});const $o=[mp,pp],ul=[];function ho(e,t){return e[0]==="pt"?0:1}A=ho(g),E=ul[A]=$o[A](g),Dt=new w({props:{code:"bHM=",highlighted:'<span class="hljs-built_in">ls</span>',wrap:!1}});const wo=[rp,ap],cl=[];function jo(e,t){return e[0]==="pt"?0:1}V=jo(g),z=cl[V]=wo[V](g),pe=new Io({props:{$$slots:{default:[fp]},$$scope:{ctx:g}}}),Pt=new w({props:{code:"Z2l0JTIwYWRkJTIwLg==",highlighted:"git add .",wrap:!1}}),Kt=new w({props:{code:"Z2l0JTIwc3RhdHVz",highlighted:"git status",wrap:!1}});const Jo=[cp,up],Ml=[];function ko(e,t){return e[0]==="pt"?0:1}L=ko(g),X=Ml[L]=Jo[L](g),tl=new w({props:{code:"Z2l0JTIwbGZzJTIwc3RhdHVz",highlighted:"git lfs status",wrap:!1}});const vo=[dp,Mp],dl=[];function Zo(e,t){return e[0]==="pt"?0:1}F=Zo(g),S=dl[F]=vo[F](g),nl=new w({props:{code:"Z2l0JTIwY29tbWl0JTIwLW0lMjAlMjJGaXJzdCUyMG1vZGVsJTIwdmVyc2lvbiUyMg==",highlighted:'git commit -m <span class="hljs-string">&quot;First model version&quot;</span>',wrap:!1}});const Co=[yp,bp],bl=[];function Go(e,t){return e[0]==="pt"?0:1}D=Go(g),O=bl[D]=Co[D](g),sl=new w({props:{code:"Z2l0JTIwcHVzaA==",highlighted:"git push",wrap:!1}}),ol=new w({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 Wo(e,t){return e[0]==="pt"?Up:Tp}let Qi=Wo(g),K=Qi(g);return pl=new Do({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(h.$$.fragment),u=o(),y($.$$.fragment),C=o(),J.c(),Z=o(),b=a("p"),b.textContent=v,P=o(),y(G.$$.fragment),ae=o(),x=a("p"),x.textContent=k,W=o(),re=a("p"),re.textContent=Xi,vl=o(),fe=a("ul"),fe.innerHTML=Fi,Zl=o(),ue=a("p"),ue.textContent=Si,Cl=o(),y(ce.$$.fragment),Gl=o(),R.c(),yl=o(),Me=a("p"),Me.innerHTML=Di,Wl=o(),de=a("p"),de.innerHTML=Oi,Bl=o(),be=a("p"),be.innerHTML=Pi,xl=o(),y(ye.$$.fragment),Ql=o(),Te=a("p"),Te.textContent=qi,Rl=o(),y(Ue.$$.fragment),Il=o(),_e=a("p"),_e.innerHTML=Ki,Nl=o(),ge=a("p"),ge.textContent=es,Yl=o(),N.c(),Tl=o(),$e=a("p"),$e.innerHTML=ts,Hl=o(),he=a("p"),he.textContent=ls,Al=o(),H.c(),Ul=o(),we=a("p"),we.innerHTML=ns,El=o(),y(je.$$.fragment),Vl=o(),Je=a("p"),Je.innerHTML=is,zl=o(),ke=a("p"),ke.textContent=ss,Ll=o(),y(ve.$$.fragment),Xl=o(),Ze=a("p"),Ze.innerHTML=os,Fl=o(),y(Ce.$$.fragment),Sl=o(),Ge=a("p"),Ge.innerHTML=ps,Dl=o(),y(We.$$.fragment),Ol=o(),Be=a("p"),Be.innerHTML=ms,Pl=o(),xe=a("p"),xe.textContent=as,ql=o(),q.c(),_l=o(),y(le.$$.fragment),Kl=o(),Qe=a("p"),Qe.innerHTML=rs,en=o(),Re=a("p"),Re.innerHTML=fs,tn=o(),Ie=a("p"),Ie.textContent=us,ln=o(),y(Ne.$$.fragment),nn=o(),Ye=a("p"),Ye.innerHTML=cs,sn=o(),He=a("p"),He.innerHTML=Ms,on=o(),y(Ae.$$.fragment),pn=o(),Ee=a("p"),Ee.innerHTML=ds,mn=o(),Ve=a("p"),Ve.innerHTML=bs,an=o(),y(ze.$$.fragment),rn=o(),Le=a("p"),Le.innerHTML=ys,fn=o(),y(Xe.$$.fragment),un=o(),Fe=a("p"),Fe.innerHTML=Ts,cn=o(),Se=a("p"),Se.textContent=Us,Mn=o(),De=a("ul"),De.innerHTML=_s,dn=o(),Oe=a("p"),Oe.textContent=gs,bn=o(),y(Pe.$$.fragment),yn=o(),qe=a("p"),qe.textContent=$s,Tn=o(),Ke=a("p"),Ke.innerHTML=hs,Un=o(),ne=a("div"),ne.innerHTML=ws,_n=o(),et=a("p"),et.textContent=js,gn=o(),tt=a("p"),tt.textContent=Js,$n=o(),lt=a("p"),lt.textContent=ks,hn=o(),ie=a("div"),ie.innerHTML=vs,wn=o(),nt=a("p"),nt.textContent=Zs,jn=o(),se=a("div"),se.innerHTML=Cs,Jn=o(),it=a("p"),it.textContent=Gs,kn=o(),st=a("p"),st.textContent=Ws,vn=o(),ot=a("p"),ot.textContent=Bs,Zn=o(),oe=a("div"),oe.innerHTML=xs,Cn=o(),pt=a("p"),pt.textContent=Qs,Gn=o(),y(mt.$$.fragment),Wn=o(),at=a("p"),at.innerHTML=Rs,Bn=o(),rt=a("p"),rt.innerHTML=Is,xn=o(),y(ft.$$.fragment),Qn=o(),ut=a("p"),ut.innerHTML=Ns,Rn=o(),y(ct.$$.fragment),In=o(),Mt=a("p"),Mt.innerHTML=Ys,Nn=o(),dt=a("ul"),dt.innerHTML=Hs,Yn=o(),y(bt.$$.fragment),Hn=o(),yt=a("p"),yt.innerHTML=As,An=o(),Tt=a("p"),Tt.textContent=Es,En=o(),y(Ut.$$.fragment),Vn=o(),_t=a("p"),_t.innerHTML=Vs,zn=o(),gt=a("p"),gt.textContent=zs,Ln=o(),y($t.$$.fragment),Xn=o(),ht=a("p"),ht.innerHTML=Ls,Fn=o(),wt=a("p"),wt.textContent=Xs,Sn=o(),jt=a("p"),jt.textContent=Fs,Dn=o(),y(Jt.$$.fragment),On=o(),kt=a("p"),kt.textContent=Ss,Pn=o(),y(vt.$$.fragment),qn=o(),Zt=a("p"),Zt.innerHTML=Ds,Kn=o(),y(Ct.$$.fragment),ei=o(),Gt=a("p"),Gt.textContent=Os,ti=o(),y(Wt.$$.fragment),li=o(),Bt=a("p"),Bt.textContent=Ps,ni=o(),xt=a("p"),xt.innerHTML=qs,ii=o(),Qt=a("p"),Qt.textContent=Ks,si=o(),y(Rt.$$.fragment),oi=o(),y(It.$$.fragment),pi=o(),Nt=a("p"),Nt.textContent=eo,mi=o(),y(Yt.$$.fragment),ai=o(),Ht=a("p"),Ht.innerHTML=to,ri=o(),y(At.$$.fragment),fi=o(),Et=a("p"),Et.textContent=lo,ui=o(),y(Vt.$$.fragment),ci=o(),y(zt.$$.fragment),Mi=o(),Lt=a("p"),Lt.innerHTML=no,di=o(),Xt=a("p"),Xt.textContent=io,bi=o(),Ft=a("p"),Ft.textContent=so,yi=o(),E.c(),gl=o(),St=a("p"),St.textContent=oo,Ti=o(),y(Dt.$$.fragment),Ui=o(),z.c(),$l=o(),y(pe.$$.fragment),_i=o(),Ot=a("p"),Ot.innerHTML=po,gi=o(),y(Pt.$$.fragment),$i=o(),qt=a("p"),qt.textContent=mo,hi=o(),y(Kt.$$.fragment),wi=o(),X.c(),hl=o(),el=a("p"),el.innerHTML=ao,ji=o(),y(tl.$$.fragment),Ji=o(),S.c(),wl=o(),ll=a("p"),ll.textContent=ro,ki=o(),y(nl.$$.fragment),vi=o(),O.c(),jl=o(),il=a("p"),il.textContent=fo,Zi=o(),y(sl.$$.fragment),Ci=o(),y(ol.$$.fragment),Gi=o(),K.c(),Jl=o(),y(pl.$$.fragment),Wi=o(),kl=a("p"),this.h()},l(e){const t=zo("svelte-u9bgzb",document.head);i=r(t,"META",{name:!0,content:!0}),t.forEach(l),m=p(e),s=r(e,"P",{}),Ro(s).forEach(l),c=p(e),T(h.$$.fragment,e),u=p(e),T($.$$.fragment,e),C=p(e),J.l(e),Z=p(e),b=r(e,"P",{"data-svelte-h":!0}),f(b)!=="svelte-1ez12s8"&&(b.textContent=v),P=p(e),T(G.$$.fragment,e),ae=p(e),x=r(e,"P",{"data-svelte-h":!0}),f(x)!=="svelte-13jox3x"&&(x.textContent=k),W=p(e),re=r(e,"P",{"data-svelte-h":!0}),f(re)!=="svelte-1tb1eea"&&(re.textContent=Xi),vl=p(e),fe=r(e,"UL",{"data-svelte-h":!0}),f(fe)!=="svelte-o3rhwp"&&(fe.innerHTML=Fi),Zl=p(e),ue=r(e,"P",{"data-svelte-h":!0}),f(ue)!=="svelte-1cyr7v9"&&(ue.textContent=Si),Cl=p(e),T(ce.$$.fragment,e),Gl=p(e),R.l(e),yl=p(e),Me=r(e,"P",{"data-svelte-h":!0}),f(Me)!=="svelte-7emhbc"&&(Me.innerHTML=Di),Wl=p(e),de=r(e,"P",{"data-svelte-h":!0}),f(de)!=="svelte-r5u1qb"&&(de.innerHTML=Oi),Bl=p(e),be=r(e,"P",{"data-svelte-h":!0}),f(be)!=="svelte-1gd5p9n"&&(be.innerHTML=Pi),xl=p(e),T(ye.$$.fragment,e),Ql=p(e),Te=r(e,"P",{"data-svelte-h":!0}),f(Te)!=="svelte-xeghpy"&&(Te.textContent=qi),Rl=p(e),T(Ue.$$.fragment,e),Il=p(e),_e=r(e,"P",{"data-svelte-h":!0}),f(_e)!=="svelte-hr5evb"&&(_e.innerHTML=Ki),Nl=p(e),ge=r(e,"P",{"data-svelte-h":!0}),f(ge)!=="svelte-d6i8l7"&&(ge.textContent=es),Yl=p(e),N.l(e),Tl=p(e),$e=r(e,"P",{"data-svelte-h":!0}),f($e)!=="svelte-1hp1xow"&&($e.innerHTML=ts),Hl=p(e),he=r(e,"P",{"data-svelte-h":!0}),f(he)!=="svelte-10bupsx"&&(he.textContent=ls),Al=p(e),H.l(e),Ul=p(e),we=r(e,"P",{"data-svelte-h":!0}),f(we)!=="svelte-1hx5p15"&&(we.innerHTML=ns),El=p(e),T(je.$$.fragment,e),Vl=p(e),Je=r(e,"P",{"data-svelte-h":!0}),f(Je)!=="svelte-ya1nrs"&&(Je.innerHTML=is),zl=p(e),ke=r(e,"P",{"data-svelte-h":!0}),f(ke)!=="svelte-iwkw2"&&(ke.textContent=ss),Ll=p(e),T(ve.$$.fragment,e),Xl=p(e),Ze=r(e,"P",{"data-svelte-h":!0}),f(Ze)!=="svelte-31b7pk"&&(Ze.innerHTML=os),Fl=p(e),T(Ce.$$.fragment,e),Sl=p(e),Ge=r(e,"P",{"data-svelte-h":!0}),f(Ge)!=="svelte-cclejb"&&(Ge.innerHTML=ps),Dl=p(e),T(We.$$.fragment,e),Ol=p(e),Be=r(e,"P",{"data-svelte-h":!0}),f(Be)!=="svelte-1uec537"&&(Be.innerHTML=ms),Pl=p(e),xe=r(e,"P",{"data-svelte-h":!0}),f(xe)!=="svelte-wght1v"&&(xe.textContent=as),ql=p(e),q.l(e),_l=p(e),T(le.$$.fragment,e),Kl=p(e),Qe=r(e,"P",{"data-svelte-h":!0}),f(Qe)!=="svelte-6u39hq"&&(Qe.innerHTML=rs),en=p(e),Re=r(e,"P",{"data-svelte-h":!0}),f(Re)!=="svelte-1mrib0b"&&(Re.innerHTML=fs),tn=p(e),Ie=r(e,"P",{"data-svelte-h":!0}),f(Ie)!=="svelte-j9zhz4"&&(Ie.textContent=us),ln=p(e),T(Ne.$$.fragment,e),nn=p(e),Ye=r(e,"P",{"data-svelte-h":!0}),f(Ye)!=="svelte-1akdli3"&&(Ye.innerHTML=cs),sn=p(e),He=r(e,"P",{"data-svelte-h":!0}),f(He)!=="svelte-ct1t7u"&&(He.innerHTML=Ms),on=p(e),T(Ae.$$.fragment,e),pn=p(e),Ee=r(e,"P",{"data-svelte-h":!0}),f(Ee)!=="svelte-g2ojd0"&&(Ee.innerHTML=ds),mn=p(e),Ve=r(e,"P",{"data-svelte-h":!0}),f(Ve)!=="svelte-9laibn"&&(Ve.innerHTML=bs),an=p(e),T(ze.$$.fragment,e),rn=p(e),Le=r(e,"P",{"data-svelte-h":!0}),f(Le)!=="svelte-knweyp"&&(Le.innerHTML=ys),fn=p(e),T(Xe.$$.fragment,e),un=p(e),Fe=r(e,"P",{"data-svelte-h":!0}),f(Fe)!=="svelte-1nrpboy"&&(Fe.innerHTML=Ts),cn=p(e),Se=r(e,"P",{"data-svelte-h":!0}),f(Se)!=="svelte-694p53"&&(Se.textContent=Us),Mn=p(e),De=r(e,"UL",{"data-svelte-h":!0}),f(De)!=="svelte-1lh8p02"&&(De.innerHTML=_s),dn=p(e),Oe=r(e,"P",{"data-svelte-h":!0}),f(Oe)!=="svelte-14iopi5"&&(Oe.textContent=gs),bn=p(e),T(Pe.$$.fragment,e),yn=p(e),qe=r(e,"P",{"data-svelte-h":!0}),f(qe)!=="svelte-8dwi2d"&&(qe.textContent=$s),Tn=p(e),Ke=r(e,"P",{"data-svelte-h":!0}),f(Ke)!=="svelte-1ae3n1y"&&(Ke.innerHTML=hs),Un=p(e),ne=r(e,"DIV",{class:!0,"data-svelte-h":!0}),f(ne)!=="svelte-4qsgxt"&&(ne.innerHTML=ws),_n=p(e),et=r(e,"P",{"data-svelte-h":!0}),f(et)!=="svelte-1bph78w"&&(et.textContent=js),gn=p(e),tt=r(e,"P",{"data-svelte-h":!0}),f(tt)!=="svelte-141u7rf"&&(tt.textContent=Js),$n=p(e),lt=r(e,"P",{"data-svelte-h":!0}),f(lt)!=="svelte-tetvex"&&(lt.textContent=ks),hn=p(e),ie=r(e,"DIV",{class:!0,"data-svelte-h":!0}),f(ie)!=="svelte-1xh6nig"&&(ie.innerHTML=vs),wn=p(e),nt=r(e,"P",{"data-svelte-h":!0}),f(nt)!=="svelte-eg7xzt"&&(nt.textContent=Zs),jn=p(e),se=r(e,"DIV",{class:!0,"data-svelte-h":!0}),f(se)!=="svelte-1jm8l0p"&&(se.innerHTML=Cs),Jn=p(e),it=r(e,"P",{"data-svelte-h":!0}),f(it)!=="svelte-16jhpt8"&&(it.textContent=Gs),kn=p(e),st=r(e,"P",{"data-svelte-h":!0}),f(st)!=="svelte-1ygia8y"&&(st.textContent=Ws),vn=p(e),ot=r(e,"P",{"data-svelte-h":!0}),f(ot)!=="svelte-1j9d8go"&&(ot.textContent=Bs),Zn=p(e),oe=r(e,"DIV",{class:!0,"data-svelte-h":!0}),f(oe)!=="svelte-1kuf5jc"&&(oe.innerHTML=xs),Cn=p(e),pt=r(e,"P",{"data-svelte-h":!0}),f(pt)!=="svelte-9eohe8"&&(pt.textContent=Qs),Gn=p(e),T(mt.$$.fragment,e),Wn=p(e),at=r(e,"P",{"data-svelte-h":!0}),f(at)!=="svelte-nnssmw"&&(at.innerHTML=Rs),Bn=p(e),rt=r(e,"P",{"data-svelte-h":!0}),f(rt)!=="svelte-1xxhqkm"&&(rt.innerHTML=Is),xn=p(e),T(ft.$$.fragment,e),Qn=p(e),ut=r(e,"P",{"data-svelte-h":!0}),f(ut)!=="svelte-1wv2003"&&(ut.innerHTML=Ns),Rn=p(e),T(ct.$$.fragment,e),In=p(e),Mt=r(e,"P",{"data-svelte-h":!0}),f(Mt)!=="svelte-865h78"&&(Mt.innerHTML=Ys),Nn=p(e),dt=r(e,"UL",{"data-svelte-h":!0}),f(dt)!=="svelte-plsyyf"&&(dt.innerHTML=Hs),Yn=p(e),T(bt.$$.fragment,e),Hn=p(e),yt=r(e,"P",{"data-svelte-h":!0}),f(yt)!=="svelte-1ncb87g"&&(yt.innerHTML=As),An=p(e),Tt=r(e,"P",{"data-svelte-h":!0}),f(Tt)!=="svelte-c5cxc7"&&(Tt.textContent=Es),En=p(e),T(Ut.$$.fragment,e),Vn=p(e),_t=r(e,"P",{"data-svelte-h":!0}),f(_t)!=="svelte-5w9rdf"&&(_t.innerHTML=Vs),zn=p(e),gt=r(e,"P",{"data-svelte-h":!0}),f(gt)!=="svelte-p6b4ty"&&(gt.textContent=zs),Ln=p(e),T($t.$$.fragment,e),Xn=p(e),ht=r(e,"P",{"data-svelte-h":!0}),f(ht)!=="svelte-tsk6e5"&&(ht.innerHTML=Ls),Fn=p(e),wt=r(e,"P",{"data-svelte-h":!0}),f(wt)!=="svelte-195rxgy"&&(wt.textContent=Xs),Sn=p(e),jt=r(e,"P",{"data-svelte-h":!0}),f(jt)!=="svelte-av6whq"&&(jt.textContent=Fs),Dn=p(e),T(Jt.$$.fragment,e),On=p(e),kt=r(e,"P",{"data-svelte-h":!0}),f(kt)!=="svelte-omrpwm"&&(kt.textContent=Ss),Pn=p(e),T(vt.$$.fragment,e),qn=p(e),Zt=r(e,"P",{"data-svelte-h":!0}),f(Zt)!=="svelte-6uh8dx"&&(Zt.innerHTML=Ds),Kn=p(e),T(Ct.$$.fragment,e),ei=p(e),Gt=r(e,"P",{"data-svelte-h":!0}),f(Gt)!=="svelte-ef7ef5"&&(Gt.textContent=Os),ti=p(e),T(Wt.$$.fragment,e),li=p(e),Bt=r(e,"P",{"data-svelte-h":!0}),f(Bt)!=="svelte-mnjwf9"&&(Bt.textContent=Ps),ni=p(e),xt=r(e,"P",{"data-svelte-h":!0}),f(xt)!=="svelte-1oj8yfa"&&(xt.innerHTML=qs),ii=p(e),Qt=r(e,"P",{"data-svelte-h":!0}),f(Qt)!=="svelte-uo613s"&&(Qt.textContent=Ks),si=p(e),T(Rt.$$.fragment,e),oi=p(e),T(It.$$.fragment,e),pi=p(e),Nt=r(e,"P",{"data-svelte-h":!0}),f(Nt)!=="svelte-1o96t3b"&&(Nt.textContent=eo),mi=p(e),T(Yt.$$.fragment,e),ai=p(e),Ht=r(e,"P",{"data-svelte-h":!0}),f(Ht)!=="svelte-jt23pm"&&(Ht.innerHTML=to),ri=p(e),T(At.$$.fragment,e),fi=p(e),Et=r(e,"P",{"data-svelte-h":!0}),f(Et)!=="svelte-1r1uuh1"&&(Et.textContent=lo),ui=p(e),T(Vt.$$.fragment,e),ci=p(e),T(zt.$$.fragment,e),Mi=p(e),Lt=r(e,"P",{"data-svelte-h":!0}),f(Lt)!=="svelte-9vpuc0"&&(Lt.innerHTML=no),di=p(e),Xt=r(e,"P",{"data-svelte-h":!0}),f(Xt)!=="svelte-1u8cwmn"&&(Xt.textContent=io),bi=p(e),Ft=r(e,"P",{"data-svelte-h":!0}),f(Ft)!=="svelte-13f3ubf"&&(Ft.textContent=so),yi=p(e),E.l(e),gl=p(e),St=r(e,"P",{"data-svelte-h":!0}),f(St)!=="svelte-e7orlz"&&(St.textContent=oo),Ti=p(e),T(Dt.$$.fragment,e),Ui=p(e),z.l(e),$l=p(e),T(pe.$$.fragment,e),_i=p(e),Ot=r(e,"P",{"data-svelte-h":!0}),f(Ot)!=="svelte-a5o7vp"&&(Ot.innerHTML=po),gi=p(e),T(Pt.$$.fragment,e),$i=p(e),qt=r(e,"P",{"data-svelte-h":!0}),f(qt)!=="svelte-iuy89q"&&(qt.textContent=mo),hi=p(e),T(Kt.$$.fragment,e),wi=p(e),X.l(e),hl=p(e),el=r(e,"P",{"data-svelte-h":!0}),f(el)!=="svelte-1uz7bc"&&(el.innerHTML=ao),ji=p(e),T(tl.$$.fragment,e),Ji=p(e),S.l(e),wl=p(e),ll=r(e,"P",{"data-svelte-h":!0}),f(ll)!=="svelte-80qp80"&&(ll.textContent=ro),ki=p(e),T(nl.$$.fragment,e),vi=p(e),O.l(e),jl=p(e),il=r(e,"P",{"data-svelte-h":!0}),f(il)!=="svelte-1cjthzw"&&(il.textContent=fo),Zi=p(e),T(sl.$$.fragment,e),Ci=p(e),T(ol.$$.fragment,e),Gi=p(e),K.l(e),Jl=p(e),T(pl.$$.fragment,e),Wi=p(e),kl=r(e,"P",{}),Ro(kl).forEach(l),this.h()},h(){B(i,"name","hf:doc:metadata"),B(i,"content",gp),B(ne,"class","flex justify-center"),B(ie,"class","flex justify-center"),B(se,"class","flex justify-center"),B(oe,"class","flex justify-center")},m(e,t){Lo(document.head,i),n(e,m,t),n(e,s,t),n(e,c,t),U(h,e,t),n(e,u,t),U($,e,t),n(e,C,t),ml[j].m(e,t),n(e,Z,t),n(e,b,t),n(e,P,t),U(G,e,t),n(e,ae,t),n(e,x,t),n(e,W,t),n(e,re,t),n(e,vl,t),n(e,fe,t),n(e,Zl,t),n(e,ue,t),n(e,Cl,t),U(ce,e,t),n(e,Gl,t),al[Q].m(e,t),n(e,yl,t),n(e,Me,t),n(e,Wl,t),n(e,de,t),n(e,Bl,t),n(e,be,t),n(e,xl,t),U(ye,e,t),n(e,Ql,t),n(e,Te,t),n(e,Rl,t),U(Ue,e,t),n(e,Il,t),n(e,_e,t),n(e,Nl,t),n(e,ge,t),n(e,Yl,t),rl[I].m(e,t),n(e,Tl,t),n(e,$e,t),n(e,Hl,t),n(e,he,t),n(e,Al,t),fl[Y].m(e,t),n(e,Ul,t),n(e,we,t),n(e,El,t),U(je,e,t),n(e,Vl,t),n(e,Je,t),n(e,zl,t),n(e,ke,t),n(e,Ll,t),U(ve,e,t),n(e,Xl,t),n(e,Ze,t),n(e,Fl,t),U(Ce,e,t),n(e,Sl,t),n(e,Ge,t),n(e,Dl,t),U(We,e,t),n(e,Ol,t),n(e,Be,t),n(e,Pl,t),n(e,xe,t),n(e,ql,t),q.m(e,t),n(e,_l,t),U(le,e,t),n(e,Kl,t),n(e,Qe,t),n(e,en,t),n(e,Re,t),n(e,tn,t),n(e,Ie,t),n(e,ln,t),U(Ne,e,t),n(e,nn,t),n(e,Ye,t),n(e,sn,t),n(e,He,t),n(e,on,t),U(Ae,e,t),n(e,pn,t),n(e,Ee,t),n(e,mn,t),n(e,Ve,t),n(e,an,t),U(ze,e,t),n(e,rn,t),n(e,Le,t),n(e,fn,t),U(Xe,e,t),n(e,un,t),n(e,Fe,t),n(e,cn,t),n(e,Se,t),n(e,Mn,t),n(e,De,t),n(e,dn,t),n(e,Oe,t),n(e,bn,t),U(Pe,e,t),n(e,yn,t),n(e,qe,t),n(e,Tn,t),n(e,Ke,t),n(e,Un,t),n(e,ne,t),n(e,_n,t),n(e,et,t),n(e,gn,t),n(e,tt,t),n(e,$n,t),n(e,lt,t),n(e,hn,t),n(e,ie,t),n(e,wn,t),n(e,nt,t),n(e,jn,t),n(e,se,t),n(e,Jn,t),n(e,it,t),n(e,kn,t),n(e,st,t),n(e,vn,t),n(e,ot,t),n(e,Zn,t),n(e,oe,t),n(e,Cn,t),n(e,pt,t),n(e,Gn,t),U(mt,e,t),n(e,Wn,t),n(e,at,t),n(e,Bn,t),n(e,rt,t),n(e,xn,t),U(ft,e,t),n(e,Qn,t),n(e,ut,t),n(e,Rn,t),U(ct,e,t),n(e,In,t),n(e,Mt,t),n(e,Nn,t),n(e,dt,t),n(e,Yn,t),U(bt,e,t),n(e,Hn,t),n(e,yt,t),n(e,An,t),n(e,Tt,t),n(e,En,t),U(Ut,e,t),n(e,Vn,t),n(e,_t,t),n(e,zn,t),n(e,gt,t),n(e,Ln,t),U($t,e,t),n(e,Xn,t),n(e,ht,t),n(e,Fn,t),n(e,wt,t),n(e,Sn,t),n(e,jt,t),n(e,Dn,t),U(Jt,e,t),n(e,On,t),n(e,kt,t),n(e,Pn,t),U(vt,e,t),n(e,qn,t),n(e,Zt,t),n(e,Kn,t),U(Ct,e,t),n(e,ei,t),n(e,Gt,t),n(e,ti,t),U(Wt,e,t),n(e,li,t),n(e,Bt,t),n(e,ni,t),n(e,xt,t),n(e,ii,t),n(e,Qt,t),n(e,si,t),U(Rt,e,t),n(e,oi,t),U(It,e,t),n(e,pi,t),n(e,Nt,t),n(e,mi,t),U(Yt,e,t),n(e,ai,t),n(e,Ht,t),n(e,ri,t),U(At,e,t),n(e,fi,t),n(e,Et,t),n(e,ui,t),U(Vt,e,t),n(e,ci,t),U(zt,e,t),n(e,Mi,t),n(e,Lt,t),n(e,di,t),n(e,Xt,t),n(e,bi,t),n(e,Ft,t),n(e,yi,t),ul[A].m(e,t),n(e,gl,t),n(e,St,t),n(e,Ti,t),U(Dt,e,t),n(e,Ui,t),cl[V].m(e,t),n(e,$l,t),U(pe,e,t),n(e,_i,t),n(e,Ot,t),n(e,gi,t),U(Pt,e,t),n(e,$i,t),n(e,qt,t),n(e,hi,t),U(Kt,e,t),n(e,wi,t),Ml[L].m(e,t),n(e,hl,t),n(e,el,t),n(e,ji,t),U(tl,e,t),n(e,Ji,t),dl[F].m(e,t),n(e,wl,t),n(e,ll,t),n(e,ki,t),U(nl,e,t),n(e,vi,t),bl[D].m(e,t),n(e,jl,t),n(e,il,t),n(e,Zi,t),U(sl,e,t),n(e,Ci,t),U(ol,e,t),n(e,Gi,t),K.m(e,t),n(e,Jl,t),U(pl,e,t),n(e,Wi,t),n(e,kl,t),Bi=!0},p(e,[t]){const Bo={};t&1&&(Bo.fw=e[0]),h.$set(Bo);let Ri=j;j=co(e),j!==Ri&&(te(),M(ml[Ri],1,1,()=>{ml[Ri]=null}),ee(),J=ml[j],J||(J=ml[j]=uo[j](e),J.c()),d(J,1),J.m(Z.parentNode,Z));let Ii=Q;Q=bo(e),Q!==Ii&&(te(),M(al[Ii],1,1,()=>{al[Ii]=null}),ee(),R=al[Q],R||(R=al[Q]=Mo[Q](e),R.c()),d(R,1),R.m(yl.parentNode,yl));let Ni=I;I=To(e),I!==Ni&&(te(),M(rl[Ni],1,1,()=>{rl[Ni]=null}),ee(),N=rl[I],N||(N=rl[I]=yo[I](e),N.c()),d(N,1),N.m(Tl.parentNode,Tl));let Yi=Y;Y=_o(e),Y!==Yi&&(te(),M(fl[Yi],1,1,()=>{fl[Yi]=null}),ee(),H=fl[Y],H||(H=fl[Y]=Uo[Y](e),H.c()),d(H,1),H.m(Ul.parentNode,Ul)),xi!==(xi=go(e))&&(q.d(1),q=xi(e),q&&(q.c(),q.m(_l.parentNode,_l)));const xo={};t&2&&(xo.$$scope={dirty:t,ctx:e}),le.$set(xo);let Hi=A;A=ho(e),A!==Hi&&(te(),M(ul[Hi],1,1,()=>{ul[Hi]=null}),ee(),E=ul[A],E||(E=ul[A]=$o[A](e),E.c()),d(E,1),E.m(gl.parentNode,gl));let Ai=V;V=jo(e),V!==Ai&&(te(),M(cl[Ai],1,1,()=>{cl[Ai]=null}),ee(),z=cl[V],z||(z=cl[V]=wo[V](e),z.c()),d(z,1),z.m($l.parentNode,$l));const Qo={};t&2&&(Qo.$$scope={dirty:t,ctx:e}),pe.$set(Qo);let Ei=L;L=ko(e),L!==Ei&&(te(),M(Ml[Ei],1,1,()=>{Ml[Ei]=null}),ee(),X=Ml[L],X||(X=Ml[L]=Jo[L](e),X.c()),d(X,1),X.m(hl.parentNode,hl));let Vi=F;F=Zo(e),F!==Vi&&(te(),M(dl[Vi],1,1,()=>{dl[Vi]=null}),ee(),S=dl[F],S||(S=dl[F]=vo[F](e),S.c()),d(S,1),S.m(wl.parentNode,wl));let zi=D;D=Go(e),D!==zi&&(te(),M(bl[zi],1,1,()=>{bl[zi]=null}),ee(),O=bl[D],O||(O=bl[D]=Co[D](e),O.c()),d(O,1),O.m(jl.parentNode,jl)),Qi!==(Qi=Wo(e))&&(K.d(1),K=Qi(e),K&&(K.c(),K.m(Jl.parentNode,Jl)))},i(e){Bi||(d(h.$$.fragment,e),d($.$$.fragment,e),d(J),d(G.$$.fragment,e),d(ce.$$.fragment,e),d(R),d(ye.$$.fragment,e),d(Ue.$$.fragment,e),d(N),d(H),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(E),d(Dt.$$.fragment,e),d(z),d(pe.$$.fragment,e),d(Pt.$$.fragment,e),d(Kt.$$.fragment,e),d(X),d(tl.$$.fragment,e),d(S),d(nl.$$.fragment,e),d(O),d(sl.$$.fragment,e),d(ol.$$.fragment,e),d(pl.$$.fragment,e),Bi=!0)},o(e){M(h.$$.fragment,e),M($.$$.fragment,e),M(J),M(G.$$.fragment,e),M(ce.$$.fragment,e),M(R),M(ye.$$.fragment,e),M(Ue.$$.fragment,e),M(N),M(H),M(je.$$.fragment,e),M(ve.$$.fragment,e),M(Ce.$$.fragment,e),M(We.$$.fragment,e),M(le.$$.fragment,e),M(Ne.$$.fragment,e),M(Ae.$$.fragment,e),M(ze.$$.fragment,e),M(Xe.$$.fragment,e),M(Pe.$$.fragment,e),M(mt.$$.fragment,e),M(ft.$$.fragment,e),M(ct.$$.fragment,e),M(bt.$$.fragment,e),M(Ut.$$.fragment,e),M($t.$$.fragment,e),M(Jt.$$.fragment,e),M(vt.$$.fragment,e),M(Ct.$$.fragment,e),M(Wt.$$.fragment,e),M(Rt.$$.fragment,e),M(It.$$.fragment,e),M(Yt.$$.fragment,e),M(At.$$.fragment,e),M(Vt.$$.fragment,e),M(zt.$$.fragment,e),M(E),M(Dt.$$.fragment,e),M(z),M(pe.$$.fragment,e),M(Pt.$$.fragment,e),M(Kt.$$.fragment,e),M(X),M(tl.$$.fragment,e),M(S),M(nl.$$.fragment,e),M(O),M(sl.$$.fragment,e),M(ol.$$.fragment,e),M(pl.$$.fragment,e),Bi=!1},d(e){e&&(l(m),l(s),l(c),l(u),l(C),l(Z),l(b),l(P),l(ae),l(x),l(W),l(re),l(vl),l(fe),l(Zl),l(ue),l(Cl),l(Gl),l(yl),l(Me),l(Wl),l(de),l(Bl),l(be),l(xl),l(Ql),l(Te),l(Rl),l(Il),l(_e),l(Nl),l(ge),l(Yl),l(Tl),l($e),l(Hl),l(he),l(Al),l(Ul),l(we),l(El),l(Vl),l(Je),l(zl),l(ke),l(Ll),l(Xl),l(Ze),l(Fl),l(Sl),l(Ge),l(Dl),l(Ol),l(Be),l(Pl),l(xe),l(ql),l(_l),l(Kl),l(Qe),l(en),l(Re),l(tn),l(Ie),l(ln),l(nn),l(Ye),l(sn),l(He),l(on),l(pn),l(Ee),l(mn),l(Ve),l(an),l(rn),l(Le),l(fn),l(un),l(Fe),l(cn),l(Se),l(Mn),l(De),l(dn),l(Oe),l(bn),l(yn),l(qe),l(Tn),l(Ke),l(Un),l(ne),l(_n),l(et),l(gn),l(tt),l($n),l(lt),l(hn),l(ie),l(wn),l(nt),l(jn),l(se),l(Jn),l(it),l(kn),l(st),l(vn),l(ot),l(Zn),l(oe),l(Cn),l(pt),l(Gn),l(Wn),l(at),l(Bn),l(rt),l(xn),l(Qn),l(ut),l(Rn),l(In),l(Mt),l(Nn),l(dt),l(Yn),l(Hn),l(yt),l(An),l(Tt),l(En),l(Vn),l(_t),l(zn),l(gt),l(Ln),l(Xn),l(ht),l(Fn),l(wt),l(Sn),l(jt),l(Dn),l(On),l(kt),l(Pn),l(qn),l(Zt),l(Kn),l(ei),l(Gt),l(ti),l(li),l(Bt),l(ni),l(xt),l(ii),l(Qt),l(si),l(oi),l(pi),l(Nt),l(mi),l(ai),l(Ht),l(ri),l(fi),l(Et),l(ui),l(ci),l(Mi),l(Lt),l(di),l(Xt),l(bi),l(Ft),l(yi),l(gl),l(St),l(Ti),l(Ui),l($l),l(_i),l(Ot),l(gi),l($i),l(qt),l(hi),l(wi),l(hl),l(el),l(ji),l(Ji),l(wl),l(ll),l(ki),l(vi),l(jl),l(il),l(Zi),l(Ci),l(Gi),l(Jl),l(Wi),l(kl)),l(i),_(h,e),_($,e),ml[j].d(e),_(G,e),_(ce,e),al[Q].d(e),_(ye,e),_(Ue,e),rl[I].d(e),fl[Y].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[A].d(e),_(Dt,e),cl[V].d(e),_(pe,e),_(Pt,e),_(Kt,e),Ml[L].d(e),_(tl,e),dl[F].d(e),_(nl,e),bl[D].d(e),_(sl,e),_(ol,e),K.d(e),_(pl,e)}}}const gp='{"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 $p(g,i,m){let s="pt";return Ho(()=>{const c=new URLSearchParams(window.location.search);m(0,s=c.get("fw")||"pt")}),[s]}class Gp extends Eo{constructor(i){super(),Vo(this,i,$p,_p,Yo,{})}}export{Gp as component};
