import{s as xp,o as Hp,n as Ip}from"../chunks/scheduler.37c15a92.js";import{S as Np,i as Vp,g as a,s as p,r as y,A as Lp,h as m,f as l,c as r,j as Gp,u as d,x as f,k as B,y as Xp,a as n,v as _,t as c,b as tt,d as b,w as h,m as Rp,n as zp,p as et}from"../chunks/index.2bf4358c.js";import{T as Wp}from"../chunks/Tip.363c041f.js";import{Y as Yi}from"../chunks/Youtube.1e50a667.js";import{C as U}from"../chunks/CodeBlock.4e987730.js";import{C as Bp}from"../chunks/CourseFloatingBanner.9ff4c771.js";import{F as Yp}from"../chunks/FrameworkSwitchCourse.8d4d4ab6.js";import{H as ot,E as Ap}from"../chunks/getInferenceSnippets.1837c472.js";function Qp($){let i,o;return i=new Bp({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){d(i.$$.fragment,s)},m(s,M){_(i,s,M),o=!0},i(s){o||(b(i.$$.fragment,s),o=!0)},o(s){c(i.$$.fragment,s),o=!1},d(s){h(i,s)}}}function Sp($){let i,o;return i=new Bp({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){d(i.$$.fragment,s)},m(s,M){_(i,s,M),o=!0},i(s){o||(b(i.$$.fragment,s),o=!0)},o(s){c(i.$$.fragment,s),o=!1},d(s){h(i,s)}}}function Fp($){let i,o;return i=new Yi({props:{id:"pUh5cGmNV8Y"}}),{c(){y(i.$$.fragment)},l(s){d(i.$$.fragment,s)},m(s,M){_(i,s,M),o=!0},i(s){o||(b(i.$$.fragment,s),o=!0)},o(s){c(i.$$.fragment,s),o=!1},d(s){h(i,s)}}}function Ep($){let i,o;return i=new Yi({props:{id:"Zh0FfmVrKX0"}}),{c(){y(i.$$.fragment)},l(s){d(i.$$.fragment,s)},m(s,M){_(i,s,M),o=!0},i(s){o||(b(i.$$.fragment,s),o=!0)},o(s){c(i.$$.fragment,s),o=!1},d(s){h(i,s)}}}function Pp($){let i,o="如果您使用Keras來訓練您的模型，則將其上傳到Hub的最簡單方法是在調用 <strong>model.fit()</strong>  時傳遞<strong>PushToHubCallback</strong>：",s,M,T,u,w="然後，您應該在對<strong>model.fit()</strong>的調用中添加<strong>callbacks=[callback]</strong>。然後，每次將模型保存在命名空間的存儲庫中（此處為每個 epoch）時，回調都會將模型上傳到 Hub。該存儲庫的名稱將類似於您選擇的輸出目錄（此處為<strong>bert-finetuned-mrpc</strong>），但您可以選擇另一個名稱，名稱為<strong>hub_model_id = a_different_name</strong>。",C,j,v="要將您的模型上傳到您所屬的組織，只需將其傳遞給 <strong>hub_model_id = my_organization/my_repo_name</strong> 。",Z;return M=new U({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=o,s=p(),y(M.$$.fragment),T=p(),u=a("p"),u.innerHTML=w,C=p(),j=a("p"),j.innerHTML=v},l(g){i=m(g,"P",{"data-svelte-h":!0}),f(i)!=="svelte-1kddlaa"&&(i.innerHTML=o),s=r(g),d(M.$$.fragment,g),T=r(g),u=m(g,"P",{"data-svelte-h":!0}),f(u)!=="svelte-bkkgh9"&&(u.innerHTML=w),C=r(g),j=m(g,"P",{"data-svelte-h":!0}),f(j)!=="svelte-4arcmo"&&(j.innerHTML=v)},m(g,J){n(g,i,J),n(g,s,J),_(M,g,J),n(g,T,J),n(g,u,J),n(g,C,J),n(g,j,J),Z=!0},i(g){Z||(b(M.$$.fragment,g),Z=!0)},o(g){c(M.$$.fragment,g),Z=!1},d(g){g&&(l(i),l(s),l(T),l(u),l(C),l(j)),h(M,g)}}}function qp($){let i,o="如果你玩過 <strong>Trainer</strong> 用於訓練模型的 API，將其上傳到 Hub 的最簡單方法是設置 <strong>push_to_hub=True</strong> 當你定義你的 <strong>TrainingArguments</strong> ：",s,M,T,u,w="你聲明 <strong>trainer.train()</strong> 的時候， 這 <strong>Trainer</strong> 然後每次將您的模型保存到您的命名空間中的存儲庫中時（這裡是每個時代），它將上傳到模型中心。該存儲庫將命名為您選擇的輸出目錄（此處 <strong>bert-finetuned-mrpc</strong> ) 但您可以選擇不同的名稱 <strong>hub_model_id = a_different_name</strong> 。",C,j,v="要將您的模型上傳到您所屬的組織，只需將其傳遞給 <strong>hub_model_id = my_organization/my_repo_name</strong> 。",Z,g,J="訓練結束後，你應該做最後的 <strong>trainer.push_to_hub()</strong> 上傳模型的最新版本。它還將生成包含所有相關元數據的模型卡，報告使用的超參數和評估結果！以下是您可能會在此類模型卡中找到的內容示例：",D,G,at='<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 M=new U({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=o,s=p(),y(M.$$.fragment),T=p(),u=a("p"),u.innerHTML=w,C=p(),j=a("p"),j.innerHTML=v,Z=p(),g=a("p"),g.innerHTML=J,D=p(),G=a("div"),G.innerHTML=at,this.h()},l(k){i=m(k,"P",{"data-svelte-h":!0}),f(i)!=="svelte-1d8nzk8"&&(i.innerHTML=o),s=r(k),d(M.$$.fragment,k),T=r(k),u=m(k,"P",{"data-svelte-h":!0}),f(u)!=="svelte-zw37cm"&&(u.innerHTML=w),C=r(k),j=m(k,"P",{"data-svelte-h":!0}),f(j)!=="svelte-4arcmo"&&(j.innerHTML=v),Z=r(k),g=m(k,"P",{"data-svelte-h":!0}),f(g)!=="svelte-1ci5fik"&&(g.innerHTML=J),D=r(k),G=m(k,"DIV",{class:!0,"data-svelte-h":!0}),f(G)!=="svelte-1lhrimn"&&(G.innerHTML=at),this.h()},h(){B(G,"class","flex justify-center")},m(k,W){n(k,i,W),n(k,s,W),_(M,k,W),n(k,T,W),n(k,u,W),n(k,C,W),n(k,j,W),n(k,Z,W),n(k,g,W),n(k,D,W),n(k,G,W),x=!0},i(k){x||(b(M.$$.fragment,k),x=!0)},o(k){c(M.$$.fragment,k),x=!1},d(k){k&&(l(i),l(s),l(T),l(u),l(C),l(j),l(Z),l(g),l(D),l(G)),h(M,k)}}}function Dp($){let i,o;return i=new U({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){d(i.$$.fragment,s)},m(s,M){_(i,s,M),o=!0},i(s){o||(b(i.$$.fragment,s),o=!0)},o(s){c(i.$$.fragment,s),o=!1},d(s){h(i,s)}}}function Kp($){let i,o;return i=new U({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){d(i.$$.fragment,s)},m(s,M){_(i,s,M),o=!0},i(s){o||(b(i.$$.fragment,s),o=!0)},o(s){c(i.$$.fragment,s),o=!1},d(s){h(i,s)}}}function Op($){let i,o='<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=o,this.h()},l(s){i=m(s,"DIV",{class:!0,"data-svelte-h":!0}),f(i)!=="svelte-5a3kk0"&&(i.innerHTML=o),this.h()},h(){B(i,"class","flex justify-center")},m(s,M){n(s,i,M)},d(s){s&&l(i)}}}function tr($){let i,o='<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=o,this.h()},l(s){i=m(s,"DIV",{class:!0,"data-svelte-h":!0}),f(i)!=="svelte-19u1vyv"&&(i.innerHTML=o),this.h()},h(){B(i,"class","flex justify-center")},m(s,M){n(s,i,M)},d(s){s&&l(i)}}}function er($){let i,o="✏️ <strong>試試看</strong>！獲取與檢查點關聯的模型和標記器，並使用該方法將它們上傳到您的命名空間中的存儲庫。在刪除之前，請仔細檢查該存儲庫是否正確顯示在您的頁面上。";return{c(){i=a("p"),i.innerHTML=o},l(s){i=m(s,"P",{"data-svelte-h":!0}),f(i)!=="svelte-173pvtw"&&(i.innerHTML=o)},m(s,M){n(s,i,M)},p:Ip,d(s){s&&l(i)}}}function lr($){let i,o;return i=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yTWFza2VkTE0lMkMlMjBBdXRvVG9rZW5pemVyJTBBJTBBY2hlY2twb2ludCUyMCUzRCUyMCUyMmNhbWVtYmVydC1iYXNlJTIyJTBBJTBBbW9kZWwlMjAlM0QlMjBURkF1dG9Nb2RlbEZvck1hc2tlZExNLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBJTBBJTIzJTIwRG8lMjB3aGF0ZXZlciUyMHdpdGglMjB0aGUlMjBtb2RlbCUyQyUyMHRyYWluJTIwaXQlMkMlMjBmaW5lLXR1bmUlMjBpdC4uLiUwQSUwQW1vZGVsLnNhdmVfcHJldHJhaW5lZCglMjIlM0NwYXRoX3RvX2R1bW15X2ZvbGRlciUzRSUyMiklMEF0b2tlbml6ZXIuc2F2ZV9wcmV0cmFpbmVkKCUyMiUzQ3BhdGhfdG9fZHVtbXlfZm9sZGVyJTNFJTIyKQ==",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"># Do whatever with the model, train it, fine-tune it...</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){d(i.$$.fragment,s)},m(s,M){_(i,s,M),o=!0},i(s){o||(b(i.$$.fragment,s),o=!0)},o(s){c(i.$$.fragment,s),o=!1},d(s){h(i,s)}}}function nr($){let i,o;return i=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvck1hc2tlZExNJTJDJTIwQXV0b1Rva2VuaXplciUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJjYW1lbWJlcnQtYmFzZSUyMiUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yTWFza2VkTE0uZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCklMEElMEElMjMlMjBEbyUyMHdoYXRldmVyJTIwd2l0aCUyMHRoZSUyMG1vZGVsJTJDJTIwdHJhaW4lMjBpdCUyQyUyMGZpbmUtdHVuZSUyMGl0Li4uJTBBJTBBbW9kZWwuc2F2ZV9wcmV0cmFpbmVkKCUyMiUzQ3BhdGhfdG9fZHVtbXlfZm9sZGVyJTNFJTIyKSUwQXRva2VuaXplci5zYXZlX3ByZXRyYWluZWQoJTIyJTNDcGF0aF90b19kdW1teV9mb2xkZXIlM0UlMjIp",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"># Do whatever with the model, train it, fine-tune it...</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){d(i.$$.fragment,s)},m(s,M){_(i,s,M),o=!0},i(s){o||(b(i.$$.fragment,s),o=!0)},o(s){c(i.$$.fragment,s),o=!1},d(s){h(i,s)}}}function ir($){let i,o,s,M="如果您查看文件大小（例如， <strong>ls -lh</strong> )，您應該會看到模型狀態 dict 文件 (pytorch_model.bin) 是唯一的異常值，超過 400 MB。",T;return i=new U({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),o=p(),s=a("p"),s.innerHTML=M},l(u){d(i.$$.fragment,u),o=r(u),s=m(u,"P",{"data-svelte-h":!0}),f(s)!=="svelte-1csho22"&&(s.innerHTML=M)},m(u,w){_(i,u,w),n(u,o,w),n(u,s,w),T=!0},i(u){T||(b(i.$$.fragment,u),T=!0)},o(u){c(i.$$.fragment,u),T=!1},d(u){u&&(l(o),l(s)),h(i,u)}}}function sr($){let i,o,s,M="If you look at the file sizes (for example, with <code>ls -lh</code>), you should see that the model state dict file (<em>pytorch_model.bin</em>) is the only outlier, at more than 400 MB.",T;return i=new U({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),o=p(),s=a("p"),s.innerHTML=M},l(u){d(i.$$.fragment,u),o=r(u),s=m(u,"P",{"data-svelte-h":!0}),f(s)!=="svelte-174jxm4"&&(s.innerHTML=M)},m(u,w){_(i,u,w),n(u,o,w),n(u,s,w),T=!0},i(u){T||(b(i.$$.fragment,u),T=!0)},o(u){c(i.$$.fragment,u),T=!1},d(u){u&&(l(o),l(s)),h(i,u)}}}function pr($){let i;return{c(){i=Rp("✏️ 從 web 界面創建存儲庫時，*.gitattributes* 文件會自動設置為將具有某些擴展名的文件，例如 *.bin* 和 *.h5* 視為大文件，git-lfs 會對其進行跟蹤您無需進行必要的設置。")},l(o){i=zp(o,"✏️ 從 web 界面創建存儲庫時，*.gitattributes* 文件會自動設置為將具有某些擴展名的文件，例如 *.bin* 和 *.h5* 視為大文件，git-lfs 會對其進行跟蹤您無需進行必要的設置。")},m(o,s){n(o,i,s)},d(o){o&&l(i)}}}function rr($){let i,o;return i=new U({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){d(i.$$.fragment,s)},m(s,M){_(i,s,M),o=!0},i(s){o||(b(i.$$.fragment,s),o=!0)},o(s){c(i.$$.fragment,s),o=!1},d(s){h(i,s)}}}function or($){let i,o;return i=new U({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){d(i.$$.fragment,s)},m(s,M){_(i,s,M),o=!0},i(s){o||(b(i.$$.fragment,s),o=!0)},o(s){c(i.$$.fragment,s),o=!1},d(s){h(i,s)}}}function ar($){let i,o,s,M="我們可以看到所有文件都有 <strong>Git</strong> 作為處理程序，除了其中有 <strong>LFS</strong>的<em>t5_model.h5</em>。",T;return i=new U({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),o=p(),s=a("p"),s.innerHTML=M},l(u){d(i.$$.fragment,u),o=r(u),s=m(u,"P",{"data-svelte-h":!0}),f(s)!=="svelte-cg1to"&&(s.innerHTML=M)},m(u,w){_(i,u,w),n(u,o,w),n(u,s,w),T=!0},i(u){T||(b(i.$$.fragment,u),T=!0)},o(u){c(i.$$.fragment,u),T=!1},d(u){u&&(l(o),l(s)),h(i,u)}}}function mr($){let i,o,s,M="我們可以看到所有文件都有 <strong>Git</strong> 作為處理程序，除了其中有 <strong>LFS</strong>的<em>pytorch_model.bin</em> 和 <em>sentencepiece.bpe.model</em>。",T;return i=new U({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),o=p(),s=a("p"),s.innerHTML=M},l(u){d(i.$$.fragment,u),o=r(u),s=m(u,"P",{"data-svelte-h":!0}),f(s)!=="svelte-1tchun8"&&(s.innerHTML=M)},m(u,w){_(i,u,w),n(u,o,w),n(u,s,w),T=!0},i(u){T||(b(i.$$.fragment,u),T=!0)},o(u){c(i.$$.fragment,u),T=!1},d(u){u&&(l(o),l(s)),h(i,u)}}}function fr($){let i,o;return i=new U({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){d(i.$$.fragment,s)},m(s,M){_(i,s,M),o=!0},i(s){o||(b(i.$$.fragment,s),o=!0)},o(s){c(i.$$.fragment,s),o=!1},d(s){h(i,s)}}}function ur($){let i,o;return i=new U({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){d(i.$$.fragment,s)},m(s,M){_(i,s,M),o=!0},i(s){o||(b(i.$$.fragment,s),o=!0)},o(s){c(i.$$.fragment,s),o=!1},d(s){h(i,s)}}}function Mr($){let i,o="如果我們在完成後查看模型存儲庫，我們可以看到所有最近添加的文件：",s,M,T='<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,w,C="UI 允許您瀏覽模型文件和提交，並查看每個提交引入的差異：",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=o,s=p(),M=a("div"),M.innerHTML=T,u=p(),w=a("p"),w.textContent=C,j=p(),v=a("div"),v.innerHTML=Z,this.h()},l(g){i=m(g,"P",{"data-svelte-h":!0}),f(i)!=="svelte-xel6h2"&&(i.textContent=o),s=r(g),M=m(g,"DIV",{class:!0,"data-svelte-h":!0}),f(M)!=="svelte-tz4fi2"&&(M.innerHTML=T),u=r(g),w=m(g,"P",{"data-svelte-h":!0}),f(w)!=="svelte-4kssbx"&&(w.textContent=C),j=r(g),v=m(g,"DIV",{class:!0,"data-svelte-h":!0}),f(v)!=="svelte-2jd8bj"&&(v.innerHTML=Z),this.h()},h(){B(M,"class","flex justify-center"),B(v,"class","flex justify-center")},m(g,J){n(g,i,J),n(g,s,J),n(g,M,J),n(g,u,J),n(g,w,J),n(g,j,J),n(g,v,J)},d(g){g&&(l(i),l(s),l(M),l(u),l(w),l(j),l(v))}}}function cr($){let i,o="If we take a look at the model repository when this is finished, we can see all the recently added files:",s,M,T='<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,w,C="UI 允許您瀏覽模型文件和提交，並查看每個提交引入的差異：",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=o,s=p(),M=a("div"),M.innerHTML=T,u=p(),w=a("p"),w.textContent=C,j=p(),v=a("div"),v.innerHTML=Z,this.h()},l(g){i=m(g,"P",{"data-svelte-h":!0}),f(i)!=="svelte-dr5wot"&&(i.textContent=o),s=r(g),M=m(g,"DIV",{class:!0,"data-svelte-h":!0}),f(M)!=="svelte-1v39mjb"&&(M.innerHTML=T),u=r(g),w=m(g,"P",{"data-svelte-h":!0}),f(w)!=="svelte-4kssbx"&&(w.textContent=C),j=r(g),v=m(g,"DIV",{class:!0,"data-svelte-h":!0}),f(v)!=="svelte-1g561m5"&&(v.innerHTML=Z),this.h()},h(){B(M,"class","flex justify-center"),B(v,"class","flex justify-center")},m(g,J){n(g,i,J),n(g,s,J),n(g,M,J),n(g,u,J),n(g,w,J),n(g,j,J),n(g,v,J)},d(g){g&&(l(i),l(s),l(M),l(u),l(w),l(j),l(v))}}}function br($){let i,o,s,M,T,u,w,C,j,v,Z,g,J="在下面的步驟中，我們將看看將預訓練模型分享到 🤗 Hub 的最簡單方法。有可用的工具和實用程序可以讓直接在 Hub 上共享和更新模型變得簡單，我們將在下面進行探討。",D,G,at,x,k="我們鼓勵所有訓練模型的用戶通過與社區共享來做出貢獻——共享模型，即使是在非常特定的數據集上進行訓練，也將幫助他人，節省他們的時間和計算資源，並提供對有用的訓練工件的訪問。反過來，您可以從其他人所做的工作中受益！",W,mt,Ai="創建新模型存儲庫的方法有以下三種：",kl,ft,Qi="<li>使用 push_to_hub API 接口</li> <li>使用 huggingface_hub Python 庫</li> <li>使用 web 界面</li>",Jl,ut,Si="創建存儲庫後，您可以通過 git 和 git-lfs 將文件上傳到其中。我們將在以下部分引導您創建模型存儲庫並將文件上傳到它們",Zl,Mt,Cl,H,I,gl,ct,Fi="將文件上傳到模型中心的最簡單方法是利用 <strong>push_to_hub</strong> API 接口。",Gl,bt,Ei='在繼續之前，您需要生成一個身份驗證令牌，以便 <strong>huggingface_hub</strong> API 知道您是誰以及您對哪些名稱空間具有寫入權限。確保你在一個環境中 <strong>transformers</strong> 已安裝（見<a href="/course/chapter0">Setup</a>）。如果您在筆記本中，可以使用以下功能登錄：',Wl,gt,Bl,yt,Pi="在終端中，您可以運行：",xl,dt,Hl,_t,qi='在這兩種情況下，系統都會提示您輸入用戶名和密碼，這與您用於登錄 Hub 的用戶名和密碼相同。如果您還沒有 Hub 配置文件，則應該創建一個<a href="https://huggingface.co/join" rel="nofollow">here</a>。',Il,ht,Di="好的！您現在已將身份驗證令牌存儲在緩存文件夾中。讓我們創建一些存儲庫！",Nl,N,V,yl,$t,Ki="在較低級別，可以通過模型、標記器和配置對象直接訪問模型中心 <strong>push_to_hub()</strong> 方法。此方法負責創建存儲庫並將模型和標記器文件直接推送到存儲庫。與我們將在下面看到的 API 不同，不需要手動處理。",Vl,wt,Oi="為了瞭解它是如何工作的，讓我們首先初始化一個模型和一個標記器：",Ll,L,X,dl,Tt,ts="你可以自由地用這些做任何你想做的事情——向標記器添加標記，訓練模型，微調它。一旦您對生成的模型、權重和標記器感到滿意，您就可以利用 <strong>push_to_hub()</strong> 方法直接在 <strong>model</strong> 中：",Xl,Ut,Rl,jt,es=`這將創建新的存儲庫 <strong>dummy-model</strong> 在您的個人資料中，並用您的模型文件填充它。
對標記器執行相同的操作，以便所有文件現在都可以在此存儲庫中使用：`,zl,vt,Yl,kt,ls="如果您屬於一個組織，只需指定 <strong>organization</strong> 上傳到該組織的命名空間的參數：",Al,Jt,Ql,Zt,ns="如果您希望使用特定的 Hugging Face 令牌，您可以自由地將其指定給 <strong>push_to_hub()</strong> 方法也是：",Sl,Ct,Fl,Gt,is='現在前往模型中心找到您新上傳的模型：<em><a href="https://huggingface.co/user-or-organization/dummy-model" rel="nofollow">https://huggingface.co/user-or-organization/dummy-model</a></em>。',El,Wt,ss="單擊“文件和版本”選項卡，您應該會在以下屏幕截圖中看到可見的文件：",Pl,_l,lt,ql,Bt,ps='如您所見， <strong>push_to_hub()</strong> 方法接受多個參數，從而可以上傳到特定的存儲庫或組織命名空間，或使用不同的 API 令牌。我們建議您查看直接在<a href="https://huggingface.co/transformers/model_sharing.html" rel="nofollow">🤗 Transformers documentation</a>瞭解什麼是可能的',Dl,xt,rs='這 <strong>push_to_hub()</strong> 方法由<a href="https://github.com/huggingface/huggingface_hub" rel="nofollow">huggingface_hub</a>Python 包，為 Hugging Face Hub 提供直接 API。它集成在 🤗 Transformers 和其他幾個機器學習庫中，例如<a href="https://github.com/allenai/allennlp" rel="nofollow">allenlp</a>.雖然我們在本章中專注於 🤗 Transformers 集成，但將其集成到您自己的代碼或庫中很簡單。',Kl,Ht,os="跳到最後一部分，瞭解如何將文件上傳到新創建的存儲庫！",Ol,It,tn,Nt,as=`這 <strong>huggingface_hub</strong> Python 庫是一個包，它為模型和數據集中心提供了一組工具。它為常見任務提供了簡單的方法和類，例如
獲取有關模型中心上存儲庫的信息並對其進行管理。它提供了在 git 之上工作的簡單 API 來管理這些存儲庫的內容並集成 Hub
在您的項目和庫中。`,en,Vt,ms="類似於使用 <strong>push_to_hub</strong> API，這將要求您將 API 令牌保存在緩存中。為此，您需要使用 <strong>login</strong> 來自 CLI 的命令，如上一節所述（同樣，確保在這些命令前面加上 <strong>!</strong> 字符（如果在 Google Colab 中運行）：",ln,Lt,nn,Xt,fs="這 <strong>huggingface_hub</strong> 包提供了幾種對我們有用的方法和類。首先，有幾種方法可以管理存儲庫的創建、刪除等：",sn,Rt,pn,zt,us="此外，它還提供了非常強大的 <strong>Repository</strong> 用於管理本地存儲庫的類。我們將在接下來的幾節中探討這些方法和該類，以瞭解如何利用它們。",rn,Yt,Ms="這 <strong>create_repo</strong> 方法可用於在模型中心上創建新存儲庫：",on,At,an,Qt,cs="這將創建存儲庫 <strong>dummy-model</strong> 在您的命名空間中。如果願意，您可以使用 <strong>organization</strong> 爭論：",mn,St,fn,Ft,bs=`這將創建 <strong>dummy-model</strong> 存儲庫中的 <strong>huggingface</strong> 命名空間，假設您屬於該組織。
其他可能有用的參數是：`,un,Et,gs="<li>private 以指定存儲庫是否應對其他人可見。</li> <li>token 如果您想用給定的令牌覆蓋存儲在緩存中的令牌。</li> <li>repo_type 如果你想創建一個或一個替代一個的而不是模型。接受的值和 datasetspace “dataset&quot;&quot;space”。</li>",Mn,Pt,ys="創建存儲庫後，我們應該向其中添加文件！跳到下一部分以查看可以處理此問題的三種方法。",cn,qt,bn,Dt,ds="Web 界面提供了直接在 Hub 中管理存儲庫的工具。使用該界面，您可以輕鬆創建存儲庫、添加文件（甚至是大文件！）、探索模型、可視化差異等等。",gn,Kt,_s='要創建新的存儲庫，請訪問<a href="https://huggingface.co/new" rel="nofollow">huggingface.co/new</a>：',yn,nt,hs='<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%"/>',dn,Ot,$s="首先，指定存儲庫的所有者：這可以是您或您所屬的任何組織。如果您選擇一個組織，該模型將出現在該組織的頁面上，並且該組織的每個成員都可以為存儲庫做出貢獻。",_n,te,ws="接下來，輸入您的模型名稱。這也將是存儲庫的名稱。最後，您可以指定您的模型是公開的還是私有的。私人模特要求您擁有付費 Hugging Face 帳戶，並允許您將模特隱藏在公眾視野之外。",hn,ee,Ts="創建模型存儲庫後，您應該看到如下頁面：",$n,it,Us='<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,le,js="這是您的模型將被託管的地方。要開始填充它，您可以直接從 Web 界面添加 README 文件。",Tn,st,vs='<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%"/>',Un,ne,ks="README 文件在 Markdown 中 - 隨意使用它！本章的第三部分致力於構建模型卡。這些對於為您的模型帶來價值至關重要，因為它們是您告訴其他人它可以做什麼的地方。",jn,ie,Js="如果您查看“文件和版本”選項卡，您會發現那裡還沒有很多文件——只有自述文件你剛剛創建和.git 屬性跟蹤大文件的文件。",vn,pt,Zs='<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%"/>',kn,se,Cs="接下來我們將看看如何添加一些新文件。",Jn,pe,Zn,re,Gs='Hugging Face Hub 上的文件管理系統基於用於常規文件的 git 和 git-lfs（代表<a href="https://git-lfs.github.com/" rel="nofollow">Git Large File Storage</a>) 對於較大的文件。',Cn,oe,Ws="在下一節中，我們將介紹將文件上傳到 Hub 的三種不同方式：通過 <strong>huggingface_hub</strong> 並通過 git 命令。",Gn,ae,Wn,me,Bs=`使用 <strong>upload_file</strong> 不需要在您的系統上安裝 git 和 git-lfs。它使用 HTTP POST 請求將文件直接推送到 🤗 Hub。這種方法的一個限制是它不能處理大於 5GB 的文件。
如果您的文件大於 5GB，請按照下面詳述的另外兩種方法進行操作。API 可以按如下方式使用：`,Bn,fe,xn,ue,xs=`這將上傳文件 <strong>config.json</strong> 可在 <strong>path_to_file</strong> 到存儲庫的根目錄 <strong>config.json</strong> , 到 <strong>dummy-model</strong> 存儲庫。
其他可能有用的參數是：`,Hn,Me,Hs="<li>token，如果要通過給定的令牌覆蓋緩存中存儲的令牌。</li> <li>repo_type, 如果你想要上傳一個 <code>dataset</code> 或一個 <code>space</code> 而不是模型。 接受的值為 <code>&quot;dataset&quot;</code> 和 <code>&quot;space&quot;</code>.</li>",In,ce,Nn,be,Is="以類似 git 的方式管理本地存儲庫。它抽象了 git 可能遇到的大部分痛點，以提供我們需要的所有功能。",Vn,ge,Ns='使用這個類需要安裝 git 和 git-lfs，所以確保你已經安裝了 git-lfs（參見<a href="https://git-lfs.github.com/" rel="nofollow">here</a>安裝說明）並在開始之前進行設置。',Ln,ye,Vs="為了開始使用我們剛剛創建的存儲庫，我們可以通過克隆遠程存儲庫將其初始化到本地文件夾開始：",Xn,de,Rn,_e,Ls="這創建了文件夾 <strong>path_to_dummy_folder</strong> 在我們的工作目錄中。該文件夾僅包含 <strong>.gitattributes</strong> 文件，因為這是通過實例化存儲庫時創建的唯一文件 <strong>create_repo</strong>。",zn,he,Xs="從現在開始，我們可以利用幾種傳統的 git 方法：",Yn,$e,An,we,Rs='另外！我們建議您查看 <strong>Repository</strong> 可用文件<a href="https://github.com/huggingface/huggingface_hub/tree/main/src/huggingface_hub#advanced-programmatic-repository-management" rel="nofollow">here</a>有關所有可用方法的概述。',Qn,Te,zs="目前，我們有一個模型和一個標記器，我們希望將其推送到模型中心。我們已經成功克隆了存儲庫，因此我們可以將文件保存在該存儲庫中。",Sn,Ue,Ys="我們首先通過拉取最新更改來確保我們的本地克隆是最新的：",Fn,je,En,ve,As="完成後，我們保存模型和標記器文件：",Pn,ke,qn,Je,Qs="這 <strong>path_to_dummy_folder</strong> 現在包含所有模型和標記器文件。我們遵循通常的 git 工作流程，將文件添加到暫存區，提交它們並將它們推送到模型中心：",Dn,Ze,Kn,Ce,Ss="恭喜！您剛剛將第一個文件推送到hub上。",On,Ge,ti,We,Fs="這是上傳文件的非常簡單的方法：我們將直接使用 git 和 git-lfs 來完成。大多數困難都被以前的方法抽象掉了，但是下面的方法有一些警告，所以我們將遵循一個更復雜的用例。",ei,Be,Es='使用這個類需要安裝 git 和 git-lfs，所以請確保你有<a href="https://git-lfs.github.com/" rel="nofollow">git-lfs</a>安裝（請參閱此處瞭解安裝說明）並在開始之前進行設置。',li,xe,Ps="首先從初始化 git-lfs 開始：",ni,He,ii,Ie,si,Ne,qs="完成後，第一步是克隆您的模型存儲庫：",pi,Ve,ri,Le,Ds="我的用戶名是 <strong>lysandre</strong> 我使用了模型名稱 <strong>dummy</strong> ，所以對我來說，命令最終如下所示：",oi,Xe,ai,Re,Ks="我現在有一個名為的文件夾假在我的工作目錄中。我能 <strong>cd</strong> 進入文件夾並查看內容：",mi,ze,fi,Ye,ui,Ae,Os="如果您剛剛使用 Hugging Face Hub 創建了您的存儲庫 <strong>create_repo</strong> 方法，這個文件夾應該只包含一個隱藏的 <strong>.gitattributes</strong> 文件。如果您按照上一節中的說明使用 Web 界面創建存儲庫，則該文件夾應包含一個自述文件文件旁邊的隱藏 <strong>.gitattributes</strong> 文件，如圖所示。",Mi,Qe,tp="添加一個常規大小的文件，例如配置文件、詞彙文件，或者基本上任何幾兆字節以下的文件，就像在任何基於 git 的系統中所做的一樣。但是，更大的文件必須通過 git-lfs 註冊才能將它們推送到Hugging Face。",ci,Se,ep="讓我們回到 Python 來生成我們想要提交到我們的虛擬存儲庫的模型和標記器：",bi,R,z,hl,Fe,lp="現在我們已經保存了一些模型和標記器工件，讓我們再看看假文件夾：",gi,Ee,yi,Y,A,$l,rt,di,Pe,np="我們現在可以繼續進行，就像我們通常使用傳統 Git 存儲庫一樣。我們可以使用以下命令將所有文件添加到 Git 的暫存環境中 <strong>git add</strong> 命令：",_i,qe,hi,De,ip="然後我們可以查看當前暫存的文件：",$i,Ke,wi,Q,S,wl,Oe,sp="同樣，我們可以確保 git-lfs 使用其跟蹤正確的文件 <strong>status</strong> 命令：",Ti,tl,Ui,F,E,Tl,el,pp="讓我們繼續最後的步驟，提交併推送到Hugging Face遠程倉庫：",ji,ll,vi,P,q,Ul,nl,rp="推送可能需要一些時間，具體取決於您的互聯網連接速度和文件大小：",ki,il,Ji,sl,Zi,jl,pl,Ci,vl,Gi;T=new Yp({props:{fw:$[0]}}),w=new ot({props:{title:"共享預訓練模型",local:"共享預訓練模型",headingTag:"h1"}});const op=[Sp,Qp],rl=[];function ap(t,e){return t[0]==="pt"?0:1}j=ap($),v=rl[j]=op[j]($),G=new Yi({props:{id:"9yY3RB_GSPM"}}),Mt=new ot({props:{title:"使用 push_to_hub API",local:"使用-pushtohub-api",headingTag:"h2"}});const mp=[Ep,Fp],ol=[];function fp(t,e){return t[0]==="pt"?0:1}H=fp($),I=ol[H]=mp[H]($),gt=new U({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBJTBBbm90ZWJvb2tfbG9naW4oKQ==",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

notebook_login()`,wrap:!1}}),dt=new U({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4=",highlighted:"huggingface-cli login",wrap:!1}});const up=[qp,Pp],al=[];function Mp(t,e){return t[0]==="pt"?0:1}N=Mp($),V=al[N]=up[N]($);const cp=[Kp,Dp],ml=[];function bp(t,e){return t[0]==="pt"?0:1}L=bp($),X=ml[L]=cp[L]($),Ut=new U({props:{code:"bW9kZWwucHVzaF90b19odWIoJTIyZHVtbXktbW9kZWwlMjIp",highlighted:'model.push_to_hub(<span class="hljs-string">&quot;dummy-model&quot;</span>)',wrap:!1}}),vt=new U({props:{code:"dG9rZW5pemVyLnB1c2hfdG9faHViKCUyMmR1bW15LW1vZGVsJTIyKQ==",highlighted:'tokenizer.push_to_hub(<span class="hljs-string">&quot;dummy-model&quot;</span>)',wrap:!1}}),Jt=new U({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}}),Ct=new U({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 gp(t,e){return t[0]==="pt"?tr:Op}let Wi=gp($),K=Wi($);lt=new Wp({props:{$$slots:{default:[er]},$$scope:{ctx:$}}}),It=new ot({props:{title:"使用 huggingface_hub python庫",local:"使用-huggingfacehub-python庫",headingTag:"h2"}}),Lt=new U({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4=",highlighted:"huggingface-cli login",wrap:!1}}),Rt=new U({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMCglMEElMjAlMjAlMjAlMjAlMjMlMjBVc2VyJTIwbWFuYWdlbWVudCUwQSUyMCUyMCUyMCUyMGxvZ2luJTJDJTBBJTIwJTIwJTIwJTIwbG9nb3V0JTJDJTBBJTIwJTIwJTIwJTIwd2hvYW1pJTJDJTBBJTBBJTIwJTIwJTIwJTIwJTIzJTIwUmVwb3NpdG9yeSUyMGNyZWF0aW9uJTIwYW5kJTIwbWFuYWdlbWVudCUwQSUyMCUyMCUyMCUyMGNyZWF0ZV9yZXBvJTJDJTBBJTIwJTIwJTIwJTIwZGVsZXRlX3JlcG8lMkMlMEElMjAlMjAlMjAlMjB1cGRhdGVfcmVwb192aXNpYmlsaXR5JTJDJTBBJTBBJTIwJTIwJTIwJTIwJTIzJTIwQW5kJTIwc29tZSUyMG1ldGhvZHMlMjB0byUyMHJldHJpZXZlJTJGY2hhbmdlJTIwaW5mb3JtYXRpb24lMjBhYm91dCUyMHRoZSUyMGNvbnRlbnQlMEElMjAlMjAlMjAlMjBsaXN0X21vZGVscyUyQyUwQSUyMCUyMCUyMCUyMGxpc3RfZGF0YXNldHMlMkMlMEElMjAlMjAlMjAlMjBsaXN0X21ldHJpY3MlMkMlMEElMjAlMjAlMjAlMjBsaXN0X3JlcG9fZmlsZXMlMkMlMEElMjAlMjAlMjAlMjB1cGxvYWRfZmlsZSUyQyUwQSUyMCUyMCUyMCUyMGRlbGV0ZV9maWxlJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> (
    <span class="hljs-comment"># User management</span>
    login,
    logout,
    whoami,

    <span class="hljs-comment"># Repository creation and management</span>
    create_repo,
    delete_repo,
    update_repo_visibility,

    <span class="hljs-comment"># And some methods to retrieve/change information about the content</span>
    list_models,
    list_datasets,
    list_metrics,
    list_repo_files,
    upload_file,
    delete_file,
)`,wrap:!1}}),At=new U({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}}),St=new U({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}}),qt=new ot({props:{title:"使用網絡界面",local:"使用網絡界面",headingTag:"h2"}}),pe=new ot({props:{title:"上傳模型文件",local:"上傳模型文件",headingTag:"h2"}}),ae=new ot({props:{title:"The upload_file approach",local:"the-uploadfile-approach",headingTag:"h3"}}),fe=new U({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}}),ce=new ot({props:{title:"The Repository class",local:"the-repository-class",headingTag:"h3"}}),de=new U({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}}),$e=new U({props:{code:"cmVwby5naXRfcHVsbCgpJTBBcmVwby5naXRfYWRkKCklMEFyZXBvLmdpdF9jb21taXQoKSUwQXJlcG8uZ2l0X3B1c2goKSUwQXJlcG8uZ2l0X3RhZygp",highlighted:`repo.git_pull()
repo.git_add()
repo.git_commit()
repo.git_push()
repo.git_tag()`,wrap:!1}}),je=new U({props:{code:"cmVwby5naXRfcHVsbCgp",highlighted:"repo.git_pull()",wrap:!1}}),ke=new U({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}}),Ze=new U({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}}),Ge=new ot({props:{title:"The git-based approach",local:"the-git-based-approach",headingTag:"h3"}}),He=new U({props:{code:"Z2l0JTIwbGZzJTIwaW5zdGFsbA==",highlighted:"git lfs install",wrap:!1}}),Ie=new U({props:{code:"VXBkYXRlZCUyMGdpdCUyMGhvb2tzLiUwQUdpdCUyMExGUyUyMGluaXRpYWxpemVkLg==",highlighted:`Updated git hooks.
Git LFS initialized.`,wrap:!1}}),Ve=new U({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}}),Xe=new U({props:{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGbHlzYW5kcmUlMkZkdW1teQ==",highlighted:'git clone https:<span class="hljs-regexp">//</span>huggingface.co<span class="hljs-regexp">/lysandre/</span>dummy',wrap:!1}}),ze=new U({props:{code:"Y2QlMjBkdW1teSUyMCUyNiUyNiUyMGxz",highlighted:'<span class="hljs-built_in">cd</span> dummy &amp;&amp; <span class="hljs-built_in">ls</span>',wrap:!1}}),Ye=new U({props:{code:"UkVBRE1FLm1k",highlighted:"README.md",wrap:!1}});const yp=[nr,lr],fl=[];function dp(t,e){return t[0]==="pt"?0:1}R=dp($),z=fl[R]=yp[R]($),Ee=new U({props:{code:"bHM=",highlighted:'<span class="hljs-built_in">ls</span>',wrap:!1}});const _p=[sr,ir],ul=[];function hp(t,e){return t[0]==="pt"?0:1}Y=hp($),A=ul[Y]=_p[Y]($),rt=new Wp({props:{$$slots:{default:[pr]},$$scope:{ctx:$}}}),qe=new U({props:{code:"Z2l0JTIwYWRkJTIwLg==",highlighted:"git add .",wrap:!1}}),Ke=new U({props:{code:"Z2l0JTIwc3RhdHVz",highlighted:"git status",wrap:!1}});const $p=[or,rr],Ml=[];function wp(t,e){return t[0]==="pt"?0:1}Q=wp($),S=Ml[Q]=$p[Q]($),tl=new U({props:{code:"Z2l0JTIwbGZzJTIwc3RhdHVz",highlighted:"git lfs status",wrap:!1}});const Tp=[mr,ar],cl=[];function Up(t,e){return t[0]==="pt"?0:1}F=Up($),E=cl[F]=Tp[F]($),ll=new U({props:{code:"Z2l0JTIwY29tbWl0JTIwLW0lMjAlMjJGaXJzdCUyMG1vZGVsJTIwdmVyc2lvbiUyMg==",highlighted:'git commit -m <span class="hljs-string">&quot;First model version&quot;</span>',wrap:!1}});const jp=[ur,fr],bl=[];function vp(t,e){return t[0]==="pt"?0:1}P=vp($),q=bl[P]=jp[P]($),il=new U({props:{code:"Z2l0JTIwcHVzaA==",highlighted:"git push",wrap:!1}}),sl=new U({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 kp(t,e){return t[0]==="pt"?cr:Mr}let Bi=kp($),O=Bi($);return pl=new Ap({props:{source:"https://github.com/huggingface/course/blob/main/chapters/zh-TW/chapter4/3.mdx"}}),{c(){i=a("meta"),o=p(),s=a("p"),M=p(),y(T.$$.fragment),u=p(),y(w.$$.fragment),C=p(),v.c(),Z=p(),g=a("p"),g.textContent=J,D=p(),y(G.$$.fragment),at=p(),x=a("p"),x.textContent=k,W=p(),mt=a("p"),mt.textContent=Ai,kl=p(),ft=a("ul"),ft.innerHTML=Qi,Jl=p(),ut=a("p"),ut.textContent=Si,Zl=p(),y(Mt.$$.fragment),Cl=p(),I.c(),gl=p(),ct=a("p"),ct.innerHTML=Fi,Gl=p(),bt=a("p"),bt.innerHTML=Ei,Wl=p(),y(gt.$$.fragment),Bl=p(),yt=a("p"),yt.textContent=Pi,xl=p(),y(dt.$$.fragment),Hl=p(),_t=a("p"),_t.innerHTML=qi,Il=p(),ht=a("p"),ht.textContent=Di,Nl=p(),V.c(),yl=p(),$t=a("p"),$t.innerHTML=Ki,Vl=p(),wt=a("p"),wt.textContent=Oi,Ll=p(),X.c(),dl=p(),Tt=a("p"),Tt.innerHTML=ts,Xl=p(),y(Ut.$$.fragment),Rl=p(),jt=a("p"),jt.innerHTML=es,zl=p(),y(vt.$$.fragment),Yl=p(),kt=a("p"),kt.innerHTML=ls,Al=p(),y(Jt.$$.fragment),Ql=p(),Zt=a("p"),Zt.innerHTML=ns,Sl=p(),y(Ct.$$.fragment),Fl=p(),Gt=a("p"),Gt.innerHTML=is,El=p(),Wt=a("p"),Wt.textContent=ss,Pl=p(),K.c(),_l=p(),y(lt.$$.fragment),ql=p(),Bt=a("p"),Bt.innerHTML=ps,Dl=p(),xt=a("p"),xt.innerHTML=rs,Kl=p(),Ht=a("p"),Ht.textContent=os,Ol=p(),y(It.$$.fragment),tn=p(),Nt=a("p"),Nt.innerHTML=as,en=p(),Vt=a("p"),Vt.innerHTML=ms,ln=p(),y(Lt.$$.fragment),nn=p(),Xt=a("p"),Xt.innerHTML=fs,sn=p(),y(Rt.$$.fragment),pn=p(),zt=a("p"),zt.innerHTML=us,rn=p(),Yt=a("p"),Yt.innerHTML=Ms,on=p(),y(At.$$.fragment),an=p(),Qt=a("p"),Qt.innerHTML=cs,mn=p(),y(St.$$.fragment),fn=p(),Ft=a("p"),Ft.innerHTML=bs,un=p(),Et=a("ul"),Et.innerHTML=gs,Mn=p(),Pt=a("p"),Pt.textContent=ys,cn=p(),y(qt.$$.fragment),bn=p(),Dt=a("p"),Dt.textContent=ds,gn=p(),Kt=a("p"),Kt.innerHTML=_s,yn=p(),nt=a("div"),nt.innerHTML=hs,dn=p(),Ot=a("p"),Ot.textContent=$s,_n=p(),te=a("p"),te.textContent=ws,hn=p(),ee=a("p"),ee.textContent=Ts,$n=p(),it=a("div"),it.innerHTML=Us,wn=p(),le=a("p"),le.textContent=js,Tn=p(),st=a("div"),st.innerHTML=vs,Un=p(),ne=a("p"),ne.textContent=ks,jn=p(),ie=a("p"),ie.textContent=Js,vn=p(),pt=a("div"),pt.innerHTML=Zs,kn=p(),se=a("p"),se.textContent=Cs,Jn=p(),y(pe.$$.fragment),Zn=p(),re=a("p"),re.innerHTML=Gs,Cn=p(),oe=a("p"),oe.innerHTML=Ws,Gn=p(),y(ae.$$.fragment),Wn=p(),me=a("p"),me.innerHTML=Bs,Bn=p(),y(fe.$$.fragment),xn=p(),ue=a("p"),ue.innerHTML=xs,Hn=p(),Me=a("ul"),Me.innerHTML=Hs,In=p(),y(ce.$$.fragment),Nn=p(),be=a("p"),be.textContent=Is,Vn=p(),ge=a("p"),ge.innerHTML=Ns,Ln=p(),ye=a("p"),ye.textContent=Vs,Xn=p(),y(de.$$.fragment),Rn=p(),_e=a("p"),_e.innerHTML=Ls,zn=p(),he=a("p"),he.textContent=Xs,Yn=p(),y($e.$$.fragment),An=p(),we=a("p"),we.innerHTML=Rs,Qn=p(),Te=a("p"),Te.textContent=zs,Sn=p(),Ue=a("p"),Ue.textContent=Ys,Fn=p(),y(je.$$.fragment),En=p(),ve=a("p"),ve.textContent=As,Pn=p(),y(ke.$$.fragment),qn=p(),Je=a("p"),Je.innerHTML=Qs,Dn=p(),y(Ze.$$.fragment),Kn=p(),Ce=a("p"),Ce.textContent=Ss,On=p(),y(Ge.$$.fragment),ti=p(),We=a("p"),We.textContent=Fs,ei=p(),Be=a("p"),Be.innerHTML=Es,li=p(),xe=a("p"),xe.textContent=Ps,ni=p(),y(He.$$.fragment),ii=p(),y(Ie.$$.fragment),si=p(),Ne=a("p"),Ne.textContent=qs,pi=p(),y(Ve.$$.fragment),ri=p(),Le=a("p"),Le.innerHTML=Ds,oi=p(),y(Xe.$$.fragment),ai=p(),Re=a("p"),Re.innerHTML=Ks,mi=p(),y(ze.$$.fragment),fi=p(),y(Ye.$$.fragment),ui=p(),Ae=a("p"),Ae.innerHTML=Os,Mi=p(),Qe=a("p"),Qe.textContent=tp,ci=p(),Se=a("p"),Se.textContent=ep,bi=p(),z.c(),hl=p(),Fe=a("p"),Fe.textContent=lp,gi=p(),y(Ee.$$.fragment),yi=p(),A.c(),$l=p(),y(rt.$$.fragment),di=p(),Pe=a("p"),Pe.innerHTML=np,_i=p(),y(qe.$$.fragment),hi=p(),De=a("p"),De.textContent=ip,$i=p(),y(Ke.$$.fragment),wi=p(),S.c(),wl=p(),Oe=a("p"),Oe.innerHTML=sp,Ti=p(),y(tl.$$.fragment),Ui=p(),E.c(),Tl=p(),el=a("p"),el.textContent=pp,ji=p(),y(ll.$$.fragment),vi=p(),q.c(),Ul=p(),nl=a("p"),nl.textContent=rp,ki=p(),y(il.$$.fragment),Ji=p(),y(sl.$$.fragment),Zi=p(),O.c(),jl=p(),y(pl.$$.fragment),Ci=p(),vl=a("p"),this.h()},l(t){const e=Lp("svelte-u9bgzb",document.head);i=m(e,"META",{name:!0,content:!0}),e.forEach(l),o=r(t),s=m(t,"P",{}),Gp(s).forEach(l),M=r(t),d(T.$$.fragment,t),u=r(t),d(w.$$.fragment,t),C=r(t),v.l(t),Z=r(t),g=m(t,"P",{"data-svelte-h":!0}),f(g)!=="svelte-1c79ol8"&&(g.textContent=J),D=r(t),d(G.$$.fragment,t),at=r(t),x=m(t,"P",{"data-svelte-h":!0}),f(x)!=="svelte-9tfkv9"&&(x.textContent=k),W=r(t),mt=m(t,"P",{"data-svelte-h":!0}),f(mt)!=="svelte-v9f3jg"&&(mt.textContent=Ai),kl=r(t),ft=m(t,"UL",{"data-svelte-h":!0}),f(ft)!=="svelte-1qo0jor"&&(ft.innerHTML=Qi),Jl=r(t),ut=m(t,"P",{"data-svelte-h":!0}),f(ut)!=="svelte-1d8sq3"&&(ut.textContent=Si),Zl=r(t),d(Mt.$$.fragment,t),Cl=r(t),I.l(t),gl=r(t),ct=m(t,"P",{"data-svelte-h":!0}),f(ct)!=="svelte-s7lyez"&&(ct.innerHTML=Fi),Gl=r(t),bt=m(t,"P",{"data-svelte-h":!0}),f(bt)!=="svelte-q370c7"&&(bt.innerHTML=Ei),Wl=r(t),d(gt.$$.fragment,t),Bl=r(t),yt=m(t,"P",{"data-svelte-h":!0}),f(yt)!=="svelte-1czpzd5"&&(yt.textContent=Pi),xl=r(t),d(dt.$$.fragment,t),Hl=r(t),_t=m(t,"P",{"data-svelte-h":!0}),f(_t)!=="svelte-17n3qpl"&&(_t.innerHTML=qi),Il=r(t),ht=m(t,"P",{"data-svelte-h":!0}),f(ht)!=="svelte-1025qld"&&(ht.textContent=Di),Nl=r(t),V.l(t),yl=r(t),$t=m(t,"P",{"data-svelte-h":!0}),f($t)!=="svelte-1i72c8r"&&($t.innerHTML=Ki),Vl=r(t),wt=m(t,"P",{"data-svelte-h":!0}),f(wt)!=="svelte-f7hgec"&&(wt.textContent=Oi),Ll=r(t),X.l(t),dl=r(t),Tt=m(t,"P",{"data-svelte-h":!0}),f(Tt)!=="svelte-881hi9"&&(Tt.innerHTML=ts),Xl=r(t),d(Ut.$$.fragment,t),Rl=r(t),jt=m(t,"P",{"data-svelte-h":!0}),f(jt)!=="svelte-1iunjn9"&&(jt.innerHTML=es),zl=r(t),d(vt.$$.fragment,t),Yl=r(t),kt=m(t,"P",{"data-svelte-h":!0}),f(kt)!=="svelte-1vmdaap"&&(kt.innerHTML=ls),Al=r(t),d(Jt.$$.fragment,t),Ql=r(t),Zt=m(t,"P",{"data-svelte-h":!0}),f(Zt)!=="svelte-xqmz8y"&&(Zt.innerHTML=ns),Sl=r(t),d(Ct.$$.fragment,t),Fl=r(t),Gt=m(t,"P",{"data-svelte-h":!0}),f(Gt)!=="svelte-1bsythw"&&(Gt.innerHTML=is),El=r(t),Wt=m(t,"P",{"data-svelte-h":!0}),f(Wt)!=="svelte-lrxyvf"&&(Wt.textContent=ss),Pl=r(t),K.l(t),_l=r(t),d(lt.$$.fragment,t),ql=r(t),Bt=m(t,"P",{"data-svelte-h":!0}),f(Bt)!=="svelte-b3zd0n"&&(Bt.innerHTML=ps),Dl=r(t),xt=m(t,"P",{"data-svelte-h":!0}),f(xt)!=="svelte-heur79"&&(xt.innerHTML=rs),Kl=r(t),Ht=m(t,"P",{"data-svelte-h":!0}),f(Ht)!=="svelte-1rwjouq"&&(Ht.textContent=os),Ol=r(t),d(It.$$.fragment,t),tn=r(t),Nt=m(t,"P",{"data-svelte-h":!0}),f(Nt)!=="svelte-18af9io"&&(Nt.innerHTML=as),en=r(t),Vt=m(t,"P",{"data-svelte-h":!0}),f(Vt)!=="svelte-xmqsqm"&&(Vt.innerHTML=ms),ln=r(t),d(Lt.$$.fragment,t),nn=r(t),Xt=m(t,"P",{"data-svelte-h":!0}),f(Xt)!=="svelte-o6bydy"&&(Xt.innerHTML=fs),sn=r(t),d(Rt.$$.fragment,t),pn=r(t),zt=m(t,"P",{"data-svelte-h":!0}),f(zt)!=="svelte-1uynags"&&(zt.innerHTML=us),rn=r(t),Yt=m(t,"P",{"data-svelte-h":!0}),f(Yt)!=="svelte-1szbfie"&&(Yt.innerHTML=Ms),on=r(t),d(At.$$.fragment,t),an=r(t),Qt=m(t,"P",{"data-svelte-h":!0}),f(Qt)!=="svelte-cx3mlc"&&(Qt.innerHTML=cs),mn=r(t),d(St.$$.fragment,t),fn=r(t),Ft=m(t,"P",{"data-svelte-h":!0}),f(Ft)!=="svelte-1pr2lwl"&&(Ft.innerHTML=bs),un=r(t),Et=m(t,"UL",{"data-svelte-h":!0}),f(Et)!=="svelte-15nliwg"&&(Et.innerHTML=gs),Mn=r(t),Pt=m(t,"P",{"data-svelte-h":!0}),f(Pt)!=="svelte-mwru74"&&(Pt.textContent=ys),cn=r(t),d(qt.$$.fragment,t),bn=r(t),Dt=m(t,"P",{"data-svelte-h":!0}),f(Dt)!=="svelte-dzsu3s"&&(Dt.textContent=ds),gn=r(t),Kt=m(t,"P",{"data-svelte-h":!0}),f(Kt)!=="svelte-1kv8vwp"&&(Kt.innerHTML=_s),yn=r(t),nt=m(t,"DIV",{class:!0,"data-svelte-h":!0}),f(nt)!=="svelte-4qsgxt"&&(nt.innerHTML=hs),dn=r(t),Ot=m(t,"P",{"data-svelte-h":!0}),f(Ot)!=="svelte-1117ide"&&(Ot.textContent=$s),_n=r(t),te=m(t,"P",{"data-svelte-h":!0}),f(te)!=="svelte-qkums4"&&(te.textContent=ws),hn=r(t),ee=m(t,"P",{"data-svelte-h":!0}),f(ee)!=="svelte-1x48k8s"&&(ee.textContent=Ts),$n=r(t),it=m(t,"DIV",{class:!0,"data-svelte-h":!0}),f(it)!=="svelte-1xh6nig"&&(it.innerHTML=Us),wn=r(t),le=m(t,"P",{"data-svelte-h":!0}),f(le)!=="svelte-j4gctk"&&(le.textContent=js),Tn=r(t),st=m(t,"DIV",{class:!0,"data-svelte-h":!0}),f(st)!=="svelte-1jm8l0p"&&(st.innerHTML=vs),Un=r(t),ne=m(t,"P",{"data-svelte-h":!0}),f(ne)!=="svelte-1xerycq"&&(ne.textContent=ks),jn=r(t),ie=m(t,"P",{"data-svelte-h":!0}),f(ie)!=="svelte-n2tc0l"&&(ie.textContent=Js),vn=r(t),pt=m(t,"DIV",{class:!0,"data-svelte-h":!0}),f(pt)!=="svelte-1kuf5jc"&&(pt.innerHTML=Zs),kn=r(t),se=m(t,"P",{"data-svelte-h":!0}),f(se)!=="svelte-1ps9k07"&&(se.textContent=Cs),Jn=r(t),d(pe.$$.fragment,t),Zn=r(t),re=m(t,"P",{"data-svelte-h":!0}),f(re)!=="svelte-ksv2vm"&&(re.innerHTML=Gs),Cn=r(t),oe=m(t,"P",{"data-svelte-h":!0}),f(oe)!=="svelte-qk1ka7"&&(oe.innerHTML=Ws),Gn=r(t),d(ae.$$.fragment,t),Wn=r(t),me=m(t,"P",{"data-svelte-h":!0}),f(me)!=="svelte-ptoyjq"&&(me.innerHTML=Bs),Bn=r(t),d(fe.$$.fragment,t),xn=r(t),ue=m(t,"P",{"data-svelte-h":!0}),f(ue)!=="svelte-1nrwexb"&&(ue.innerHTML=xs),Hn=r(t),Me=m(t,"UL",{"data-svelte-h":!0}),f(Me)!=="svelte-wpdb3h"&&(Me.innerHTML=Hs),In=r(t),d(ce.$$.fragment,t),Nn=r(t),be=m(t,"P",{"data-svelte-h":!0}),f(be)!=="svelte-86kk4d"&&(be.textContent=Is),Vn=r(t),ge=m(t,"P",{"data-svelte-h":!0}),f(ge)!=="svelte-1f444n8"&&(ge.innerHTML=Ns),Ln=r(t),ye=m(t,"P",{"data-svelte-h":!0}),f(ye)!=="svelte-hv10js"&&(ye.textContent=Vs),Xn=r(t),d(de.$$.fragment,t),Rn=r(t),_e=m(t,"P",{"data-svelte-h":!0}),f(_e)!=="svelte-1frvt07"&&(_e.innerHTML=Ls),zn=r(t),he=m(t,"P",{"data-svelte-h":!0}),f(he)!=="svelte-2f38c7"&&(he.textContent=Xs),Yn=r(t),d($e.$$.fragment,t),An=r(t),we=m(t,"P",{"data-svelte-h":!0}),f(we)!=="svelte-1qo3jbj"&&(we.innerHTML=Rs),Qn=r(t),Te=m(t,"P",{"data-svelte-h":!0}),f(Te)!=="svelte-16cn5q1"&&(Te.textContent=zs),Sn=r(t),Ue=m(t,"P",{"data-svelte-h":!0}),f(Ue)!=="svelte-1qn3i01"&&(Ue.textContent=Ys),Fn=r(t),d(je.$$.fragment,t),En=r(t),ve=m(t,"P",{"data-svelte-h":!0}),f(ve)!=="svelte-1gynad1"&&(ve.textContent=As),Pn=r(t),d(ke.$$.fragment,t),qn=r(t),Je=m(t,"P",{"data-svelte-h":!0}),f(Je)!=="svelte-2ip8fy"&&(Je.innerHTML=Qs),Dn=r(t),d(Ze.$$.fragment,t),Kn=r(t),Ce=m(t,"P",{"data-svelte-h":!0}),f(Ce)!=="svelte-1n40fh7"&&(Ce.textContent=Ss),On=r(t),d(Ge.$$.fragment,t),ti=r(t),We=m(t,"P",{"data-svelte-h":!0}),f(We)!=="svelte-26idv9"&&(We.textContent=Fs),ei=r(t),Be=m(t,"P",{"data-svelte-h":!0}),f(Be)!=="svelte-1gaw43z"&&(Be.innerHTML=Es),li=r(t),xe=m(t,"P",{"data-svelte-h":!0}),f(xe)!=="svelte-sldxmk"&&(xe.textContent=Ps),ni=r(t),d(He.$$.fragment,t),ii=r(t),d(Ie.$$.fragment,t),si=r(t),Ne=m(t,"P",{"data-svelte-h":!0}),f(Ne)!=="svelte-59t3xy"&&(Ne.textContent=qs),pi=r(t),d(Ve.$$.fragment,t),ri=r(t),Le=m(t,"P",{"data-svelte-h":!0}),f(Le)!=="svelte-16t88ic"&&(Le.innerHTML=Ds),oi=r(t),d(Xe.$$.fragment,t),ai=r(t),Re=m(t,"P",{"data-svelte-h":!0}),f(Re)!=="svelte-144iuaf"&&(Re.innerHTML=Ks),mi=r(t),d(ze.$$.fragment,t),fi=r(t),d(Ye.$$.fragment,t),ui=r(t),Ae=m(t,"P",{"data-svelte-h":!0}),f(Ae)!=="svelte-1awv64g"&&(Ae.innerHTML=Os),Mi=r(t),Qe=m(t,"P",{"data-svelte-h":!0}),f(Qe)!=="svelte-imq7dy"&&(Qe.textContent=tp),ci=r(t),Se=m(t,"P",{"data-svelte-h":!0}),f(Se)!=="svelte-13y4ux1"&&(Se.textContent=ep),bi=r(t),z.l(t),hl=r(t),Fe=m(t,"P",{"data-svelte-h":!0}),f(Fe)!=="svelte-46k05d"&&(Fe.textContent=lp),gi=r(t),d(Ee.$$.fragment,t),yi=r(t),A.l(t),$l=r(t),d(rt.$$.fragment,t),di=r(t),Pe=m(t,"P",{"data-svelte-h":!0}),f(Pe)!=="svelte-rsq4pl"&&(Pe.innerHTML=np),_i=r(t),d(qe.$$.fragment,t),hi=r(t),De=m(t,"P",{"data-svelte-h":!0}),f(De)!=="svelte-1ixsmh"&&(De.textContent=ip),$i=r(t),d(Ke.$$.fragment,t),wi=r(t),S.l(t),wl=r(t),Oe=m(t,"P",{"data-svelte-h":!0}),f(Oe)!=="svelte-1oilp32"&&(Oe.innerHTML=sp),Ti=r(t),d(tl.$$.fragment,t),Ui=r(t),E.l(t),Tl=r(t),el=m(t,"P",{"data-svelte-h":!0}),f(el)!=="svelte-n5c5jk"&&(el.textContent=pp),ji=r(t),d(ll.$$.fragment,t),vi=r(t),q.l(t),Ul=r(t),nl=m(t,"P",{"data-svelte-h":!0}),f(nl)!=="svelte-th8p0"&&(nl.textContent=rp),ki=r(t),d(il.$$.fragment,t),Ji=r(t),d(sl.$$.fragment,t),Zi=r(t),O.l(t),jl=r(t),d(pl.$$.fragment,t),Ci=r(t),vl=m(t,"P",{}),Gp(vl).forEach(l),this.h()},h(){B(i,"name","hf:doc:metadata"),B(i,"content",gr),B(nt,"class","flex justify-center"),B(it,"class","flex justify-center"),B(st,"class","flex justify-center"),B(pt,"class","flex justify-center")},m(t,e){Xp(document.head,i),n(t,o,e),n(t,s,e),n(t,M,e),_(T,t,e),n(t,u,e),_(w,t,e),n(t,C,e),rl[j].m(t,e),n(t,Z,e),n(t,g,e),n(t,D,e),_(G,t,e),n(t,at,e),n(t,x,e),n(t,W,e),n(t,mt,e),n(t,kl,e),n(t,ft,e),n(t,Jl,e),n(t,ut,e),n(t,Zl,e),_(Mt,t,e),n(t,Cl,e),ol[H].m(t,e),n(t,gl,e),n(t,ct,e),n(t,Gl,e),n(t,bt,e),n(t,Wl,e),_(gt,t,e),n(t,Bl,e),n(t,yt,e),n(t,xl,e),_(dt,t,e),n(t,Hl,e),n(t,_t,e),n(t,Il,e),n(t,ht,e),n(t,Nl,e),al[N].m(t,e),n(t,yl,e),n(t,$t,e),n(t,Vl,e),n(t,wt,e),n(t,Ll,e),ml[L].m(t,e),n(t,dl,e),n(t,Tt,e),n(t,Xl,e),_(Ut,t,e),n(t,Rl,e),n(t,jt,e),n(t,zl,e),_(vt,t,e),n(t,Yl,e),n(t,kt,e),n(t,Al,e),_(Jt,t,e),n(t,Ql,e),n(t,Zt,e),n(t,Sl,e),_(Ct,t,e),n(t,Fl,e),n(t,Gt,e),n(t,El,e),n(t,Wt,e),n(t,Pl,e),K.m(t,e),n(t,_l,e),_(lt,t,e),n(t,ql,e),n(t,Bt,e),n(t,Dl,e),n(t,xt,e),n(t,Kl,e),n(t,Ht,e),n(t,Ol,e),_(It,t,e),n(t,tn,e),n(t,Nt,e),n(t,en,e),n(t,Vt,e),n(t,ln,e),_(Lt,t,e),n(t,nn,e),n(t,Xt,e),n(t,sn,e),_(Rt,t,e),n(t,pn,e),n(t,zt,e),n(t,rn,e),n(t,Yt,e),n(t,on,e),_(At,t,e),n(t,an,e),n(t,Qt,e),n(t,mn,e),_(St,t,e),n(t,fn,e),n(t,Ft,e),n(t,un,e),n(t,Et,e),n(t,Mn,e),n(t,Pt,e),n(t,cn,e),_(qt,t,e),n(t,bn,e),n(t,Dt,e),n(t,gn,e),n(t,Kt,e),n(t,yn,e),n(t,nt,e),n(t,dn,e),n(t,Ot,e),n(t,_n,e),n(t,te,e),n(t,hn,e),n(t,ee,e),n(t,$n,e),n(t,it,e),n(t,wn,e),n(t,le,e),n(t,Tn,e),n(t,st,e),n(t,Un,e),n(t,ne,e),n(t,jn,e),n(t,ie,e),n(t,vn,e),n(t,pt,e),n(t,kn,e),n(t,se,e),n(t,Jn,e),_(pe,t,e),n(t,Zn,e),n(t,re,e),n(t,Cn,e),n(t,oe,e),n(t,Gn,e),_(ae,t,e),n(t,Wn,e),n(t,me,e),n(t,Bn,e),_(fe,t,e),n(t,xn,e),n(t,ue,e),n(t,Hn,e),n(t,Me,e),n(t,In,e),_(ce,t,e),n(t,Nn,e),n(t,be,e),n(t,Vn,e),n(t,ge,e),n(t,Ln,e),n(t,ye,e),n(t,Xn,e),_(de,t,e),n(t,Rn,e),n(t,_e,e),n(t,zn,e),n(t,he,e),n(t,Yn,e),_($e,t,e),n(t,An,e),n(t,we,e),n(t,Qn,e),n(t,Te,e),n(t,Sn,e),n(t,Ue,e),n(t,Fn,e),_(je,t,e),n(t,En,e),n(t,ve,e),n(t,Pn,e),_(ke,t,e),n(t,qn,e),n(t,Je,e),n(t,Dn,e),_(Ze,t,e),n(t,Kn,e),n(t,Ce,e),n(t,On,e),_(Ge,t,e),n(t,ti,e),n(t,We,e),n(t,ei,e),n(t,Be,e),n(t,li,e),n(t,xe,e),n(t,ni,e),_(He,t,e),n(t,ii,e),_(Ie,t,e),n(t,si,e),n(t,Ne,e),n(t,pi,e),_(Ve,t,e),n(t,ri,e),n(t,Le,e),n(t,oi,e),_(Xe,t,e),n(t,ai,e),n(t,Re,e),n(t,mi,e),_(ze,t,e),n(t,fi,e),_(Ye,t,e),n(t,ui,e),n(t,Ae,e),n(t,Mi,e),n(t,Qe,e),n(t,ci,e),n(t,Se,e),n(t,bi,e),fl[R].m(t,e),n(t,hl,e),n(t,Fe,e),n(t,gi,e),_(Ee,t,e),n(t,yi,e),ul[Y].m(t,e),n(t,$l,e),_(rt,t,e),n(t,di,e),n(t,Pe,e),n(t,_i,e),_(qe,t,e),n(t,hi,e),n(t,De,e),n(t,$i,e),_(Ke,t,e),n(t,wi,e),Ml[Q].m(t,e),n(t,wl,e),n(t,Oe,e),n(t,Ti,e),_(tl,t,e),n(t,Ui,e),cl[F].m(t,e),n(t,Tl,e),n(t,el,e),n(t,ji,e),_(ll,t,e),n(t,vi,e),bl[P].m(t,e),n(t,Ul,e),n(t,nl,e),n(t,ki,e),_(il,t,e),n(t,Ji,e),_(sl,t,e),n(t,Zi,e),O.m(t,e),n(t,jl,e),_(pl,t,e),n(t,Ci,e),n(t,vl,e),Gi=!0},p(t,[e]){const Jp={};e&1&&(Jp.fw=t[0]),T.$set(Jp);let xi=j;j=ap(t),j!==xi&&(et(),c(rl[xi],1,1,()=>{rl[xi]=null}),tt(),v=rl[j],v||(v=rl[j]=op[j](t),v.c()),b(v,1),v.m(Z.parentNode,Z));let Hi=H;H=fp(t),H!==Hi&&(et(),c(ol[Hi],1,1,()=>{ol[Hi]=null}),tt(),I=ol[H],I||(I=ol[H]=mp[H](t),I.c()),b(I,1),I.m(gl.parentNode,gl));let Ii=N;N=Mp(t),N!==Ii&&(et(),c(al[Ii],1,1,()=>{al[Ii]=null}),tt(),V=al[N],V||(V=al[N]=up[N](t),V.c()),b(V,1),V.m(yl.parentNode,yl));let Ni=L;L=bp(t),L!==Ni&&(et(),c(ml[Ni],1,1,()=>{ml[Ni]=null}),tt(),X=ml[L],X||(X=ml[L]=cp[L](t),X.c()),b(X,1),X.m(dl.parentNode,dl)),Wi!==(Wi=gp(t))&&(K.d(1),K=Wi(t),K&&(K.c(),K.m(_l.parentNode,_l)));const Zp={};e&2&&(Zp.$$scope={dirty:e,ctx:t}),lt.$set(Zp);let Vi=R;R=dp(t),R!==Vi&&(et(),c(fl[Vi],1,1,()=>{fl[Vi]=null}),tt(),z=fl[R],z||(z=fl[R]=yp[R](t),z.c()),b(z,1),z.m(hl.parentNode,hl));let Li=Y;Y=hp(t),Y!==Li&&(et(),c(ul[Li],1,1,()=>{ul[Li]=null}),tt(),A=ul[Y],A||(A=ul[Y]=_p[Y](t),A.c()),b(A,1),A.m($l.parentNode,$l));const Cp={};e&2&&(Cp.$$scope={dirty:e,ctx:t}),rt.$set(Cp);let Xi=Q;Q=wp(t),Q!==Xi&&(et(),c(Ml[Xi],1,1,()=>{Ml[Xi]=null}),tt(),S=Ml[Q],S||(S=Ml[Q]=$p[Q](t),S.c()),b(S,1),S.m(wl.parentNode,wl));let Ri=F;F=Up(t),F!==Ri&&(et(),c(cl[Ri],1,1,()=>{cl[Ri]=null}),tt(),E=cl[F],E||(E=cl[F]=Tp[F](t),E.c()),b(E,1),E.m(Tl.parentNode,Tl));let zi=P;P=vp(t),P!==zi&&(et(),c(bl[zi],1,1,()=>{bl[zi]=null}),tt(),q=bl[P],q||(q=bl[P]=jp[P](t),q.c()),b(q,1),q.m(Ul.parentNode,Ul)),Bi!==(Bi=kp(t))&&(O.d(1),O=Bi(t),O&&(O.c(),O.m(jl.parentNode,jl)))},i(t){Gi||(b(T.$$.fragment,t),b(w.$$.fragment,t),b(v),b(G.$$.fragment,t),b(Mt.$$.fragment,t),b(I),b(gt.$$.fragment,t),b(dt.$$.fragment,t),b(V),b(X),b(Ut.$$.fragment,t),b(vt.$$.fragment,t),b(Jt.$$.fragment,t),b(Ct.$$.fragment,t),b(lt.$$.fragment,t),b(It.$$.fragment,t),b(Lt.$$.fragment,t),b(Rt.$$.fragment,t),b(At.$$.fragment,t),b(St.$$.fragment,t),b(qt.$$.fragment,t),b(pe.$$.fragment,t),b(ae.$$.fragment,t),b(fe.$$.fragment,t),b(ce.$$.fragment,t),b(de.$$.fragment,t),b($e.$$.fragment,t),b(je.$$.fragment,t),b(ke.$$.fragment,t),b(Ze.$$.fragment,t),b(Ge.$$.fragment,t),b(He.$$.fragment,t),b(Ie.$$.fragment,t),b(Ve.$$.fragment,t),b(Xe.$$.fragment,t),b(ze.$$.fragment,t),b(Ye.$$.fragment,t),b(z),b(Ee.$$.fragment,t),b(A),b(rt.$$.fragment,t),b(qe.$$.fragment,t),b(Ke.$$.fragment,t),b(S),b(tl.$$.fragment,t),b(E),b(ll.$$.fragment,t),b(q),b(il.$$.fragment,t),b(sl.$$.fragment,t),b(pl.$$.fragment,t),Gi=!0)},o(t){c(T.$$.fragment,t),c(w.$$.fragment,t),c(v),c(G.$$.fragment,t),c(Mt.$$.fragment,t),c(I),c(gt.$$.fragment,t),c(dt.$$.fragment,t),c(V),c(X),c(Ut.$$.fragment,t),c(vt.$$.fragment,t),c(Jt.$$.fragment,t),c(Ct.$$.fragment,t),c(lt.$$.fragment,t),c(It.$$.fragment,t),c(Lt.$$.fragment,t),c(Rt.$$.fragment,t),c(At.$$.fragment,t),c(St.$$.fragment,t),c(qt.$$.fragment,t),c(pe.$$.fragment,t),c(ae.$$.fragment,t),c(fe.$$.fragment,t),c(ce.$$.fragment,t),c(de.$$.fragment,t),c($e.$$.fragment,t),c(je.$$.fragment,t),c(ke.$$.fragment,t),c(Ze.$$.fragment,t),c(Ge.$$.fragment,t),c(He.$$.fragment,t),c(Ie.$$.fragment,t),c(Ve.$$.fragment,t),c(Xe.$$.fragment,t),c(ze.$$.fragment,t),c(Ye.$$.fragment,t),c(z),c(Ee.$$.fragment,t),c(A),c(rt.$$.fragment,t),c(qe.$$.fragment,t),c(Ke.$$.fragment,t),c(S),c(tl.$$.fragment,t),c(E),c(ll.$$.fragment,t),c(q),c(il.$$.fragment,t),c(sl.$$.fragment,t),c(pl.$$.fragment,t),Gi=!1},d(t){t&&(l(o),l(s),l(M),l(u),l(C),l(Z),l(g),l(D),l(at),l(x),l(W),l(mt),l(kl),l(ft),l(Jl),l(ut),l(Zl),l(Cl),l(gl),l(ct),l(Gl),l(bt),l(Wl),l(Bl),l(yt),l(xl),l(Hl),l(_t),l(Il),l(ht),l(Nl),l(yl),l($t),l(Vl),l(wt),l(Ll),l(dl),l(Tt),l(Xl),l(Rl),l(jt),l(zl),l(Yl),l(kt),l(Al),l(Ql),l(Zt),l(Sl),l(Fl),l(Gt),l(El),l(Wt),l(Pl),l(_l),l(ql),l(Bt),l(Dl),l(xt),l(Kl),l(Ht),l(Ol),l(tn),l(Nt),l(en),l(Vt),l(ln),l(nn),l(Xt),l(sn),l(pn),l(zt),l(rn),l(Yt),l(on),l(an),l(Qt),l(mn),l(fn),l(Ft),l(un),l(Et),l(Mn),l(Pt),l(cn),l(bn),l(Dt),l(gn),l(Kt),l(yn),l(nt),l(dn),l(Ot),l(_n),l(te),l(hn),l(ee),l($n),l(it),l(wn),l(le),l(Tn),l(st),l(Un),l(ne),l(jn),l(ie),l(vn),l(pt),l(kn),l(se),l(Jn),l(Zn),l(re),l(Cn),l(oe),l(Gn),l(Wn),l(me),l(Bn),l(xn),l(ue),l(Hn),l(Me),l(In),l(Nn),l(be),l(Vn),l(ge),l(Ln),l(ye),l(Xn),l(Rn),l(_e),l(zn),l(he),l(Yn),l(An),l(we),l(Qn),l(Te),l(Sn),l(Ue),l(Fn),l(En),l(ve),l(Pn),l(qn),l(Je),l(Dn),l(Kn),l(Ce),l(On),l(ti),l(We),l(ei),l(Be),l(li),l(xe),l(ni),l(ii),l(si),l(Ne),l(pi),l(ri),l(Le),l(oi),l(ai),l(Re),l(mi),l(fi),l(ui),l(Ae),l(Mi),l(Qe),l(ci),l(Se),l(bi),l(hl),l(Fe),l(gi),l(yi),l($l),l(di),l(Pe),l(_i),l(hi),l(De),l($i),l(wi),l(wl),l(Oe),l(Ti),l(Ui),l(Tl),l(el),l(ji),l(vi),l(Ul),l(nl),l(ki),l(Ji),l(Zi),l(jl),l(Ci),l(vl)),l(i),h(T,t),h(w,t),rl[j].d(t),h(G,t),h(Mt,t),ol[H].d(t),h(gt,t),h(dt,t),al[N].d(t),ml[L].d(t),h(Ut,t),h(vt,t),h(Jt,t),h(Ct,t),K.d(t),h(lt,t),h(It,t),h(Lt,t),h(Rt,t),h(At,t),h(St,t),h(qt,t),h(pe,t),h(ae,t),h(fe,t),h(ce,t),h(de,t),h($e,t),h(je,t),h(ke,t),h(Ze,t),h(Ge,t),h(He,t),h(Ie,t),h(Ve,t),h(Xe,t),h(ze,t),h(Ye,t),fl[R].d(t),h(Ee,t),ul[Y].d(t),h(rt,t),h(qe,t),h(Ke,t),Ml[Q].d(t),h(tl,t),cl[F].d(t),h(ll,t),bl[P].d(t),h(il,t),h(sl,t),O.d(t),h(pl,t)}}}const gr='{"title":"共享預訓練模型","local":"共享預訓練模型","sections":[{"title":"使用 push_to_hub API","local":"使用-pushtohub-api","sections":[],"depth":2},{"title":"使用 huggingface_hub python庫","local":"使用-huggingfacehub-python庫","sections":[],"depth":2},{"title":"使用網絡界面","local":"使用網絡界面","sections":[],"depth":2},{"title":"上傳模型文件","local":"上傳模型文件","sections":[{"title":"The upload_file approach","local":"the-uploadfile-approach","sections":[],"depth":3},{"title":"The Repository class","local":"the-repository-class","sections":[],"depth":3},{"title":"The git-based approach","local":"the-git-based-approach","sections":[],"depth":3}],"depth":2}],"depth":1}';function yr($,i,o){let s="pt";return Hp(()=>{const M=new URLSearchParams(window.location.search);o(0,s=M.get("fw")||"pt")}),[s]}class vr extends Np{constructor(i){super(),Vp(this,i,yr,br,xp,{})}}export{vr as component};
