Buckets:

rtrm's picture
download
raw
12.8 kB
import{s as ye,o as xe}from"../chunks/scheduler.37c15a92.js";import{S as _e,i as ke,g as me,s as a,r as u,A as Te,h as ce,f as o,c as s,j as we,u as m,x as ve,k as be,y as Ae,a as r,v as c,t as h,b as Ce,d as l,w as p,p as He}from"../chunks/index.7cb9c9b8.js";import{C as ze}from"../chunks/CourseFloatingBanner.df82c153.js";import{Q as b}from"../chunks/Question.7e41e492.js";import{F as qe}from"../chunks/FrameworkSwitchCourse.97630871.js";import{H as w,E as We}from"../chunks/getInferenceSnippets.50ff7b37.js";function Pe(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 Fe(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 Me(x){let n,f,i,$,y,Q,_,U,k,Y,T,fe="Let’s test what you learned in this chapter!",O,v,D,A,J,C,K,H,V,z,X,q,Z,W,ee,P,te,F,oe,d,g,B,M,ie,R,re,E,ne,j,ae,I,se,L,he,N,le,G,ue;y=new qe({props:{fw:x[0]}}),_=new w({props:{title:"End-of-chapter quiz",local:"end-of-chapter-quiz",headingTag:"h1"}}),k=new ze({props:{chapter:4,classNames:"absolute z-10 right-0 top-0"}}),v=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"}}),A=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!"}]}}),C=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"}}),H=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}]}}),z=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"}}),q=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}]}}),W=new w({props:{title:"4. What is a model card?",local:"4-what-is-a-model-card",headingTag:"h3"}}),P=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."}]}}),F=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 de=[Fe,Pe],S=[];function ge(e,t){return e[0]==="pt"?0:1}return d=ge(x),g=S[d]=de[d](x),M=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}]}}),E=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"}}),j=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."}]}}),I=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"}}),L=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 We({props:{source:"https://github.com/huggingface/course/blob/main/chapters/en/chapter4/6.mdx"}}),{c(){n=me("meta"),f=a(),i=me("p"),$=a(),u(y.$$.fragment),Q=a(),u(_.$$.fragment),U=a(),u(k.$$.fragment),Y=a(),T=me("p"),T.textContent=fe,O=a(),u(v.$$.fragment),D=a(),u(A.$$.fragment),J=a(),u(C.$$.fragment),K=a(),u(H.$$.fragment),V=a(),u(z.$$.fragment),X=a(),u(q.$$.fragment),Z=a(),u(W.$$.fragment),ee=a(),u(P.$$.fragment),te=a(),u(F.$$.fragment),oe=a(),g.c(),B=a(),u(M.$$.fragment),ie=a(),u(R.$$.fragment),re=a(),u(E.$$.fragment),ne=a(),u(j.$$.fragment),ae=a(),u(I.$$.fragment),se=a(),u(L.$$.fragment),he=a(),u(N.$$.fragment),le=a(),G=me("p"),this.h()},l(e){const t=Te("svelte-u9bgzb",document.head);n=ce(t,"META",{name:!0,content:!0}),t.forEach(o),f=s(e),i=ce(e,"P",{}),we(i).forEach(o),$=s(e),m(y.$$.fragment,e),Q=s(e),m(_.$$.fragment,e),U=s(e),m(k.$$.fragment,e),Y=s(e),T=ce(e,"P",{"data-svelte-h":!0}),ve(T)!=="svelte-19og2hy"&&(T.textContent=fe),O=s(e),m(v.$$.fragment,e),D=s(e),m(A.$$.fragment,e),J=s(e),m(C.$$.fragment,e),K=s(e),m(H.$$.fragment,e),V=s(e),m(z.$$.fragment,e),X=s(e),m(q.$$.fragment,e),Z=s(e),m(W.$$.fragment,e),ee=s(e),m(P.$$.fragment,e),te=s(e),m(F.$$.fragment,e),oe=s(e),g.l(e),B=s(e),m(M.$$.fragment,e),ie=s(e),m(R.$$.fragment,e),re=s(e),m(E.$$.fragment,e),ne=s(e),m(j.$$.fragment,e),ae=s(e),m(I.$$.fragment,e),se=s(e),m(L.$$.fragment,e),he=s(e),m(N.$$.fragment,e),le=s(e),G=ce(e,"P",{}),we(G).forEach(o),this.h()},h(){be(n,"name","hf:doc:metadata"),be(n,"content",Re)},m(e,t){Ae(document.head,n),r(e,f,t),r(e,i,t),r(e,$,t),c(y,e,t),r(e,Q,t),c(_,e,t),r(e,U,t),c(k,e,t),r(e,Y,t),r(e,T,t),r(e,O,t),c(v,e,t),r(e,D,t),c(A,e,t),r(e,J,t),c(C,e,t),r(e,K,t),c(H,e,t),r(e,V,t),c(z,e,t),r(e,X,t),c(q,e,t),r(e,Z,t),c(W,e,t),r(e,ee,t),c(P,e,t),r(e,te,t),c(F,e,t),r(e,oe,t),S[d].m(e,t),r(e,B,t),c(M,e,t),r(e,ie,t),c(R,e,t),r(e,re,t),c(E,e,t),r(e,ne,t),c(j,e,t),r(e,ae,t),c(I,e,t),r(e,se,t),c(L,e,t),r(e,he,t),c(N,e,t),r(e,le,t),r(e,G,t),ue=!0},p(e,[t]){const $e={};t&1&&($e.fw=e[0]),y.$set($e);let pe=d;d=ge(e),d!==pe&&(He(),h(S[pe],1,1,()=>{S[pe]=null}),Ce(),g=S[d],g||(g=S[d]=de[d](e),g.c()),l(g,1),g.m(B.parentNode,B))},i(e){ue||(l(y.$$.fragment,e),l(_.$$.fragment,e),l(k.$$.fragment,e),l(v.$$.fragment,e),l(A.$$.fragment,e),l(C.$$.fragment,e),l(H.$$.fragment,e),l(z.$$.fragment,e),l(q.$$.fragment,e),l(W.$$.fragment,e),l(P.$$.fragment,e),l(F.$$.fragment,e),l(g),l(M.$$.fragment,e),l(R.$$.fragment,e),l(E.$$.fragment,e),l(j.$$.fragment,e),l(I.$$.fragment,e),l(L.$$.fragment,e),l(N.$$.fragment,e),ue=!0)},o(e){h(y.$$.fragment,e),h(_.$$.fragment,e),h(k.$$.fragment,e),h(v.$$.fragment,e),h(A.$$.fragment,e),h(C.$$.fragment,e),h(H.$$.fragment,e),h(z.$$.fragment,e),h(q.$$.fragment,e),h(W.$$.fragment,e),h(P.$$.fragment,e),h(F.$$.fragment,e),h(g),h(M.$$.fragment,e),h(R.$$.fragment,e),h(E.$$.fragment,e),h(j.$$.fragment,e),h(I.$$.fragment,e),h(L.$$.fragment,e),h(N.$$.fragment,e),ue=!1},d(e){e&&(o(f),o(i),o($),o(Q),o(U),o(Y),o(T),o(O),o(D),o(J),o(K),o(V),o(X),o(Z),o(ee),o(te),o(oe),o(B),o(ie),o(re),o(ne),o(ae),o(se),o(he),o(le),o(G)),o(n),p(y,e),p(_,e),p(k,e),p(v,e),p(A,e),p(C,e),p(H,e),p(z,e),p(q,e),p(W,e),p(P,e),p(F,e),S[d].d(e),p(M,e),p(R,e),p(E,e),p(j,e),p(I,e),p(L,e),p(N,e)}}}const Re='{"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 Ee(x,n,f){let i="pt";return xe(()=>{const $=new URLSearchParams(window.location.search);f(0,i=$.get("fw")||"pt")}),[i]}class Ge extends _e{constructor(n){super(),ke(this,n,Ee,Me,ye,{})}}export{Ge as component};

Xet Storage Details

Size:
12.8 kB
·
Xet hash:
80162b75adea4f877a399ae840b44ea2ac9be46c952af455880d77b548e85aca

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