Buckets:

rtrm's picture
download
raw
13.1 kB
import{s as _e,o as ke}from"../chunks/scheduler.893fe8c9.js";import{S as Te,i as ve,e as pe,s as a,c as u,h as Ce,a as fe,d as o,b as s,f as ye,g as m,j as He,k as xe,l as Ae,m as r,n as c,o as h,E as ze,t as l,p,F as qe}from"../chunks/index.b1df2166.js";import{C as We,H as w,E as Pe}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.729e3d58.js";import{C as Fe}from"../chunks/CourseFloatingBanner.c1c08878.js";import{Q as b}from"../chunks/Question.ea6d4cb0.js";import{F as Me}from"../chunks/FrameworkSwitchCourse.4480e339.js";function Ee(x){let n,f;return n=new b({props:{choices:[{text:"A tokenizer",explain:"Correct! All tokenizers have the <code>push_to_hub</code> method, and using it will push all the tokenizer files (vocabulary, architecture of the tokenizer, etc.) to a given repo. That's not the only right answer, though!",correct:!0},{text:"A model configuration",explain:"Right! All model configurations have the <code>push_to_hub</code> method, and using it will push them to a given repo. What else can you share?",correct:!0},{text:"A model",explain:"Correct! All models have the <code>push_to_hub</code> method, and using it will push them and their configuration files to a given repo. That's not all you can share, though.",correct:!0},{text:"All of the above with a dedicated callback",explain:"That's right — the <code>PushToHubCallback</code> will regularly send all of those objects to a repo during training.",correct:!0}]}}),{c(){u(n.$$.fragment)},l(i){m(n.$$.fragment,i)},m(i,$){c(n,i,$),f=!0},i(i){f||(l(n.$$.fragment,i),f=!0)},o(i){h(n.$$.fragment,i),f=!1},d(i){p(n,i)}}}function Re(x){let n,f;return n=new b({props:{choices:[{text:"A tokenizer",explain:"Correct! All tokenizers have the <code>push_to_hub</code> method, and using it will push all the tokenizer files (vocabulary, architecture of the tokenizer, etc.) to a given repo. That's not the only right answer, though!",correct:!0},{text:"A model configuration",explain:"Right! All model configurations have the <code>push_to_hub</code> method, and using it will push them to a given repo. What else can you share?",correct:!0},{text:"A model",explain:"Correct! All models have the <code>push_to_hub</code> method, and using it will push them and their configuration files to a given repo. That's not all you can share, though.",correct:!0},{text:"A Trainer",explain:"That's right — the <code>Trainer</code> also implements the <code>push_to_hub</code> method, and using it will upload the model, its configuration, the tokenizer, and a model card draft to a given repo. Try another answer!",correct:!0}]}}),{c(){u(n.$$.fragment)},l(i){m(n.$$.fragment,i)},m(i,$){c(n,i,$),f=!0},i(i){f||(l(n.$$.fragment,i),f=!0)},o(i){h(n.$$.fragment,i),f=!1},d(i){p(n,i)}}}function Le(x){let n,f,i,$,y,U,_,Y,k,O,T,D,v,ge="Let’s test what you learned in this chapter!",J,C,K,H,V,A,X,z,Z,q,ee,W,te,P,oe,F,ie,M,re,d,g,G,E,ne,R,ae,L,se,S,he,j,le,I,ue,N,me,Q,ce;y=new Me({props:{fw:x[0]}}),_=new We({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),k=new w({props:{title:"End-of-chapter quiz",local:"end-of-chapter-quiz",headingTag:"h1"}}),T=new Fe({props:{chapter:4,classNames:"absolute z-10 right-0 top-0"}}),C=new w({props:{title:"1. What are models on the Hub limited to?",local:"1-what-are-models-on-the-hub-limited-to",headingTag:"h3"}}),H=new b({props:{choices:[{text:"Models from the 🤗 Transformers library.",explain:"While models from the 🤗 Transformers library are supported on the Hugging Face Hub, they're not the only ones!"},{text:"All models with a similar interface to 🤗 Transformers.",explain:"No interface requirement is set when uploading models to the Hugging Face Hub. "},{text:"There are no limits.",explain:"Right! There are no limits when uploading models to the Hub.",correct:!0},{text:"Models that are in some way related to NLP.",explain:"No requirement is set regarding the field of application!"}]}}),A=new w({props:{title:"2. How can you manage models on the Hub?",local:"2-how-can-you-manage-models-on-the-hub",headingTag:"h3"}}),z=new b({props:{choices:[{text:"Through a GCP account.",explain:"Incorrect!"},{text:"Through peer-to-peer distribution.",explain:"Incorrect!"},{text:"Through git and git-lfs.",explain:"Correct! Models on the Hub are simple Git repositories, leveraging <code>git-lfs</code> for large files.",correct:!0}]}}),q=new w({props:{title:"3. What can you do using the Hugging Face Hub web interface?",local:"3-what-can-you-do-using-the-hugging-face-hub-web-interface",headingTag:"h3"}}),W=new b({props:{choices:[{text:"Fork an existing repository.",explain:"Forking a repository is not possible on the Hugging Face Hub."},{text:"Create a new model repository.",explain:"Correct! That's not all you can do, though.",correct:!0},{text:"Manage and edit files.",explain:"Correct! That's not the only right answer, though.",correct:!0},{text:"Upload files.",explain:"Right! But that's not all.",correct:!0},{text:"See diffs across versions.",explain:"Correct! That's not all you can do, though.",correct:!0}]}}),P=new w({props:{title:"4. What is a model card?",local:"4-what-is-a-model-card",headingTag:"h3"}}),F=new b({props:{choices:[{text:"A rough description of the model, therefore less important than the model and tokenizer files.",explain:"It is indeed a description of the model, but it's an important piece: if it's incomplete or absent the model's utility is drastically reduced."},{text:"A way to ensure reproducibility, reusability, and fairness.",explain:"Correct! Sharing the right information in the model card will help users leverage your model and be aware of its limits and biases. ",correct:!0},{text:"A Python file that can be run to retrieve information about the model.",explain:"Model cards are simple Markdown files."}]}}),M=new w({props:{title:"5. Which of these objects of the 🤗 Transformers library can be directly shared on the Hub with push_to_hub() ?",local:"5-which-of-these-objects-of-the--transformers-library-can-be-directly-shared-on-the-hub-with-pushtohub-",headingTag:"h3"}});const $e=[Re,Ee],B=[];function we(e,t){return e[0]==="pt"?0:1}return d=we(x),g=B[d]=$e[d](x),E=new w({props:{title:"6. What is the first step when using the push_to_hub() method or the CLI tools?",local:"6-what-is-the-first-step-when-using-the-pushtohub-method-or-the-cli-tools",headingTag:"h3"}}),R=new b({props:{choices:[{text:"Log in on the website.",explain:"This won't help you on your local machine."},{text:"Run 'huggingface-cli login' in a terminal.",explain:"Correct — this will download and cache your personal token.",correct:!0},{text:"Run 'notebook_login()' in a notebook.",explain:"Correct — this will display a widget to let you authenticate.",correct:!0}]}}),L=new w({props:{title:"7. You’re using a model and a tokenizer — how can you upload them to the Hub?",local:"7-youre-using-a-model-and-a-tokenizer--how-can-you-upload-them-to-the-hub",headingTag:"h3"}}),S=new b({props:{choices:[{text:"By calling the push_to_hub method directly on the model and the tokenizer.",explain:"Correct!",correct:!0},{text:"Within the Python runtime, by wrapping them in a <code>huggingface_hub</code> utility.",explain:"Models and tokenizers already benefit from <code>huggingface_hub</code> utilities: no need for additional wrapping!"},{text:"By saving them to disk and calling <code>transformers-cli upload-model</code>",explain:"The command <code>upload-model</code> does not exist."}]}}),j=new w({props:{title:"8. Which git operations can you do with the Repository class?",local:"8-which-git-operations-can-you-do-with-the-repository-class",headingTag:"h3"}}),I=new b({props:{choices:[{text:"A commit.",explain:"Correct, the <code>git_commit()</code> method is there for that.",correct:!0},{text:"A pull",explain:"That is the purpose of the <code>git_pull()</code> method.",correct:!0},{text:"A push",explain:"The method <code>git_push()</code> does this.",correct:!0},{text:"A merge",explain:"No, that operation will never be possible with this API."}]}}),N=new Pe({props:{source:"https://github.com/huggingface/course/blob/main/chapters/en/chapter4/6.mdx"}}),{c(){n=pe("meta"),f=a(),i=pe("p"),$=a(),u(y.$$.fragment),U=a(),u(_.$$.fragment),Y=a(),u(k.$$.fragment),O=a(),u(T.$$.fragment),D=a(),v=pe("p"),v.textContent=ge,J=a(),u(C.$$.fragment),K=a(),u(H.$$.fragment),V=a(),u(A.$$.fragment),X=a(),u(z.$$.fragment),Z=a(),u(q.$$.fragment),ee=a(),u(W.$$.fragment),te=a(),u(P.$$.fragment),oe=a(),u(F.$$.fragment),ie=a(),u(M.$$.fragment),re=a(),g.c(),G=a(),u(E.$$.fragment),ne=a(),u(R.$$.fragment),ae=a(),u(L.$$.fragment),se=a(),u(S.$$.fragment),he=a(),u(j.$$.fragment),le=a(),u(I.$$.fragment),ue=a(),u(N.$$.fragment),me=a(),Q=pe("p"),this.h()},l(e){const t=Ce("svelte-u9bgzb",document.head);n=fe(t,"META",{name:!0,content:!0}),t.forEach(o),f=s(e),i=fe(e,"P",{}),ye(i).forEach(o),$=s(e),m(y.$$.fragment,e),U=s(e),m(_.$$.fragment,e),Y=s(e),m(k.$$.fragment,e),O=s(e),m(T.$$.fragment,e),D=s(e),v=fe(e,"P",{"data-svelte-h":!0}),He(v)!=="svelte-19og2hy"&&(v.textContent=ge),J=s(e),m(C.$$.fragment,e),K=s(e),m(H.$$.fragment,e),V=s(e),m(A.$$.fragment,e),X=s(e),m(z.$$.fragment,e),Z=s(e),m(q.$$.fragment,e),ee=s(e),m(W.$$.fragment,e),te=s(e),m(P.$$.fragment,e),oe=s(e),m(F.$$.fragment,e),ie=s(e),m(M.$$.fragment,e),re=s(e),g.l(e),G=s(e),m(E.$$.fragment,e),ne=s(e),m(R.$$.fragment,e),ae=s(e),m(L.$$.fragment,e),se=s(e),m(S.$$.fragment,e),he=s(e),m(j.$$.fragment,e),le=s(e),m(I.$$.fragment,e),ue=s(e),m(N.$$.fragment,e),me=s(e),Q=fe(e,"P",{}),ye(Q).forEach(o),this.h()},h(){xe(n,"name","hf:doc:metadata"),xe(n,"content",Se)},m(e,t){Ae(document.head,n),r(e,f,t),r(e,i,t),r(e,$,t),c(y,e,t),r(e,U,t),c(_,e,t),r(e,Y,t),c(k,e,t),r(e,O,t),c(T,e,t),r(e,D,t),r(e,v,t),r(e,J,t),c(C,e,t),r(e,K,t),c(H,e,t),r(e,V,t),c(A,e,t),r(e,X,t),c(z,e,t),r(e,Z,t),c(q,e,t),r(e,ee,t),c(W,e,t),r(e,te,t),c(P,e,t),r(e,oe,t),c(F,e,t),r(e,ie,t),c(M,e,t),r(e,re,t),B[d].m(e,t),r(e,G,t),c(E,e,t),r(e,ne,t),c(R,e,t),r(e,ae,t),c(L,e,t),r(e,se,t),c(S,e,t),r(e,he,t),c(j,e,t),r(e,le,t),c(I,e,t),r(e,ue,t),c(N,e,t),r(e,me,t),r(e,Q,t),ce=!0},p(e,[t]){const be={};t&1&&(be.fw=e[0]),y.$set(be);let de=d;d=we(e),d!==de&&(qe(),h(B[de],1,1,()=>{B[de]=null}),ze(),g=B[d],g||(g=B[d]=$e[d](e),g.c()),l(g,1),g.m(G.parentNode,G))},i(e){ce||(l(y.$$.fragment,e),l(_.$$.fragment,e),l(k.$$.fragment,e),l(T.$$.fragment,e),l(C.$$.fragment,e),l(H.$$.fragment,e),l(A.$$.fragment,e),l(z.$$.fragment,e),l(q.$$.fragment,e),l(W.$$.fragment,e),l(P.$$.fragment,e),l(F.$$.fragment,e),l(M.$$.fragment,e),l(g),l(E.$$.fragment,e),l(R.$$.fragment,e),l(L.$$.fragment,e),l(S.$$.fragment,e),l(j.$$.fragment,e),l(I.$$.fragment,e),l(N.$$.fragment,e),ce=!0)},o(e){h(y.$$.fragment,e),h(_.$$.fragment,e),h(k.$$.fragment,e),h(T.$$.fragment,e),h(C.$$.fragment,e),h(H.$$.fragment,e),h(A.$$.fragment,e),h(z.$$.fragment,e),h(q.$$.fragment,e),h(W.$$.fragment,e),h(P.$$.fragment,e),h(F.$$.fragment,e),h(M.$$.fragment,e),h(g),h(E.$$.fragment,e),h(R.$$.fragment,e),h(L.$$.fragment,e),h(S.$$.fragment,e),h(j.$$.fragment,e),h(I.$$.fragment,e),h(N.$$.fragment,e),ce=!1},d(e){e&&(o(f),o(i),o($),o(U),o(Y),o(O),o(D),o(v),o(J),o(K),o(V),o(X),o(Z),o(ee),o(te),o(oe),o(ie),o(re),o(G),o(ne),o(ae),o(se),o(he),o(le),o(ue),o(me),o(Q)),o(n),p(y,e),p(_,e),p(k,e),p(T,e),p(C,e),p(H,e),p(A,e),p(z,e),p(q,e),p(W,e),p(P,e),p(F,e),p(M,e),B[d].d(e),p(E,e),p(R,e),p(L,e),p(S,e),p(j,e),p(I,e),p(N,e)}}}const Se='{"title":"End-of-chapter quiz","local":"end-of-chapter-quiz","sections":[{"title":"1. What are models on the Hub limited to?","local":"1-what-are-models-on-the-hub-limited-to","sections":[],"depth":3},{"title":"2. How can you manage models on the Hub?","local":"2-how-can-you-manage-models-on-the-hub","sections":[],"depth":3},{"title":"3. What can you do using the Hugging Face Hub web interface?","local":"3-what-can-you-do-using-the-hugging-face-hub-web-interface","sections":[],"depth":3},{"title":"4. What is a model card?","local":"4-what-is-a-model-card","sections":[],"depth":3},{"title":"5. Which of these objects of the 🤗 Transformers library can be directly shared on the Hub with push_to_hub() ?","local":"5-which-of-these-objects-of-the--transformers-library-can-be-directly-shared-on-the-hub-with-pushtohub-","sections":[],"depth":3},{"title":"6. What is the first step when using the push_to_hub() method or the CLI tools?","local":"6-what-is-the-first-step-when-using-the-pushtohub-method-or-the-cli-tools","sections":[],"depth":3},{"title":"7. You’re using a model and a tokenizer — how can you upload them to the Hub?","local":"7-youre-using-a-model-and-a-tokenizer--how-can-you-upload-them-to-the-hub","sections":[],"depth":3},{"title":"8. Which git operations can you do with the Repository class?","local":"8-which-git-operations-can-you-do-with-the-repository-class","sections":[],"depth":3}],"depth":1}';function je(x,n,f){let i="pt";return ke(()=>{const $=new URLSearchParams(window.location.search);f(0,i=$.get("fw")||"pt")}),[i]}class Ye extends Te{constructor(n){super(),ve(this,n,je,Le,_e,{})}}export{Ye as component};

Xet Storage Details

Size:
13.1 kB
·
Xet hash:
a889b1bcf8ac05134dcb6781f7cc219b52b39603b8da910264ed859656710ec0

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.