import{s as Ye,o as Ve,n as Oe}from"../chunks/scheduler.3e4cb221.js";import{S as Qe,i as De,g as o,s as a,r,A as Ke,h as i,f as l,c as n,j as Fe,u as h,x as p,k as Se,y as et,a as s,v as m,d,t as M,w as c}from"../chunks/index.e1c70545.js";import{T as tt}from"../chunks/Tip.31fd538c.js";import{C as Ae}from"../chunks/CodeBlock.72e9ab19.js";import{H as f,E as lt}from"../chunks/getInferenceSnippets.25162521.js";function st(Q){let u,j="We have not explored evaluation in this course yet, but in chapter 2 we will explore evaluation in more detail. For now, we’re focusing on training and submitting your model.";return{c(){u=o("p"),u.textContent=j},l(w){u=i(w,"P",{"data-svelte-h":!0}),p(u)!=="svelte-1yh34fy"&&(u.textContent=j)},m(w,V){s(w,u,V)},p:Oe,d(w){w&&l(u)}}}function at(Q){let u,j,w,V,g,D,y,We="It’s time to submit your project! This year the smol course will use a leaderboard based submission. Here’s the plan:",K,J,xe="<li>Read the written guide for the chapter ✅</li> <li>Train a model using what you learned in the chapter.</li> <li>Push the model to the Hugging Face Hub.</li> <li>Evaluate the model using <code>hf jobs</code>.</li> <li>Open a pull request on the leaderboard.</li>",ee,$,He="On this page we will go through each step.",te,b,le,I,_e='For chapter 1’s submission, you should read all the materials in the chapter and train a model using what you learned. Most of the training code is in the page on <a href="./3">Supervised Fine-Tuning</a>, but you’ll need to combine this with the code on <a href="./2">Chat Templates</a> and the code on <a href="./5">Training with Hugging Face Jobs</a>.',se,v,ae,U,qe="Once you’ve trained a model, you’ll need to push it to a repo on the Hugging Face Hub. In fact, TRL will take care of this for you if you add the <code>--push_to_hub</code> flag to your training command. So let’s say you trained a model using <code>hf jobs</code>, then this parameter will look like this:",ne,C,oe,A,Le='Your trained model will be available at <code>your-username/your-model-name</code>. For detailed documentation, check out the <a href="https://huggingface.co/docs/transformers/trainer#checkpoints" rel="nofollow">checkpoints documentation</a> from <code>transformers</code>.',ie,W,ue,x,Be="Now, we will need to evaluate the model. We will use <code>hf jobs</code> to evaluate the model as well and combine it with <code>openbench</code>. We will push the evaluation results to a dataset on the hub.",pe,H,re,_,ze="This command will evaluate the model using <code>lighteval</code> and <code>vllm</code> and save the results to the Hugging Face Hub in the dataset repo that you defined.",he,T,me,q,de,L,Ee="You are now ready to submit your model to the leaderboard!  You need to do two things:",Me,B,Ne="<li>add your model’s results to <code>submissions.json</code></li> <li>share you evaluation command (using <code>hf jobs</code>) in the PR text.</li>",ce,z,we,E,Ge='Open a pull request on the <a href="https://huggingface.co/spaces/smol-course/leaderboard/edit/main/submissions.json" rel="nofollow">leaderboard space</a> to submit your model. You just need to model info and reference to the dataset you created in the previous step. We will pull the results and display them on the leaderboard.',fe,N,Te,G,je,Z,Ze="Within the PR text, share you evaluation command. For example:",ge,k,ye,P,ke="This will help us to reproduce your model evaluation before we add it to the leaderboard.",Je,R,$e,X,Pe='Once the PR is merged, your model will be added to the leaderboard! You can check the leaderboard <a href="https://huggingface.co/spaces/smol-course/leaderboard" rel="nofollow">here</a>.',be,F,Ie,S,Re=`You’ve completed the unit — great work!
Now put your learning to the test by taking the <a href="https://huggingface.co/spaces/smol-course/unit_1_quiz" rel="nofollow">quiz</a>.`,ve,Y,Ue,O,Ce;return g=new f({props:{title:"Submit your final project!",local:"submit-your-final-project",headingTag:"h1"}}),b=new f({props:{title:"1. Read the written guide for the chapter and 2. Train a model using what you learned in the chapter.",local:"1-read-the-written-guide-for-the-chapter-and-2-train-a-model-using-what-you-learned-in-the-chapter",headingTag:"h2"}}),v=new f({props:{title:"3. Push the model to the Hugging Face Hub",local:"3-push-the-model-to-the-hugging-face-hub",headingTag:"h2"}}),C=new Ae({props:{code:"aGYlMjBqb2JzJTIwdXYlMjBydW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWZsYXZvciUyMGExMDAtbGFyZ2UlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNlY3JldHMlMjBIRl9UT0tFTiUyMCU1QyUwQSUyMCUyMCUyMCUyMCUyMnRybCUyRnNjcmlwdHMlMkZzZnQucHklMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAuLi4lMEElMjAlMjAlMjAlMjAtLXB1c2hfdG9faHViJTIwJTIzJTIwdGhpcyUyMHdpbGwlMjBwdXNoJTIwdGhlJTIwbW9kZWwlMjB0byUyMHRoZSUyMEh1Z2dpbmclMjBGYWNlJTIwSHVi",highlighted:`hf <span class="hljs-built_in">jobs</span> uv run \\
    --flavor a100-large \\
    --secrets HF_TOKEN \\
    <span class="hljs-string">&quot;trl/scripts/sft.py&quot;</span> \\
    ...
    --push_to_hub <span class="hljs-comment"># this will push the model to the Hugging Face Hub</span>`,wrap:!1}}),W=new f({props:{title:"4. Evaluate the model using hf jobs",local:"4-evaluate-the-model-using-hf-jobs",headingTag:"h2"}}),H=new Ae({props:{code:"aGYlMjBqb2JzJTIwdXYlMjBydW4lMjAlNUMlMjAlMjMlMjBydW4lMjBhJTIwaGYlMjBqb2JzJTIwam9iJTIwd2l0aCUyMHV2JTBBLS1mbGF2b3IlMjBhMTBnLWxhcmdlJTIwJTVDJTIwJTIzJTIwc2VsZWN0JTIwdGhlJTIwbWFjaGluZSUyMHNpemUlMEEtLXdpdGglMjAlMjJsaWdodGV2YWwlNUJ2bGxtJTVEJTIyJTIwJTVDJTIwJTIzJTIwaW5zdGFsbCUyMGxpZ2h0ZXZhbCUyMHdpdGglMjB2bGxtJTIwZGVwZW5kZW5jaWVzJTBBcyUyMEhGX1RPS0VOJTIwJTVDJTIwJTIzJTIwc2hhcmUlMjB0aGUlMjBodWdnaW5nZmFjZSUyMHdyaXRlJTIwdG9rZW4lMEFsaWdodGV2YWwlMjB2bGxtJTIwJTIybW9kZWxfbmFtZSUzRCUzQ3lvdXItdXNlcm5hbWUlM0UlMkYlM0N5b3VyLW1vZGVsLW5hbWUlM0UlMjIlMjAlMjJsaWdodGV2YWwlN0Nnc204ayU3QzAlN0MwJTIyJTIwLS1wdXNoLXRvLWh1YiUyMC0tcmVzdWx0cy1vcmclMjAlM0N5b3VyLXVzZXJuYW1lJTNF",highlighted:`hf <span class="hljs-built_in">jobs</span> uv run \\ <span class="hljs-comment"># run a hf jobs job with uv</span>
--flavor a10g-large \\ <span class="hljs-comment"># select the machine size</span>
--with <span class="hljs-string">&quot;lighteval[vllm]&quot;</span> \\ <span class="hljs-comment"># install lighteval with vllm dependencies</span>
s HF_TOKEN \\ <span class="hljs-comment"># share the huggingface write token</span>
lighteval vllm <span class="hljs-string">&quot;model_name=&lt;your-username&gt;/&lt;your-model-name&gt;&quot;</span> <span class="hljs-string">&quot;lighteval|gsm8k|0|0&quot;</span> --push-to-hub --results-org &lt;your-username&gt;`,wrap:!1}}),T=new tt({props:{$$slots:{default:[st]},$$scope:{ctx:Q}}}),q=new f({props:{title:"5. Open a pull request on the leaderboard space",local:"5-open-a-pull-request-on-the-leaderboard-space",headingTag:"h2"}}),z=new f({props:{title:"Add your model’s results to submissions.json",local:"add-your-models-results-to-submissionsjson",headingTag:"h3"}}),N=new Ae({props:{code:"JTdCJTBBJTIwJTIwJTIwJTIwJTIyc3VibWlzc2lvbnMlMjIlM0ElMjAlNUIlMEElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAuLi4lMjAlMjMlMjBleGlzdGluZyUyMHN1Ym1pc3Npb25zJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIydXNlcm5hbWUlMjIlM0ElMjAlMjIlM0N5b3VyLXVzZXJuYW1lJTNFJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybW9kZWxfbmFtZSUyMiUzQSUyMCUyMiUzQ3lvdXItbW9kZWwtbmFtZSUzRSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmNoYXB0ZXIlMjIlM0ElMjAlMjIxJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyc3VibWlzc2lvbl9kYXRlJTIyJTNBJTIwJTIyJTNDeW91ci1zdWJtaXNzaW9uLWRhdGUlM0UlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJyZXN1bHRzLWRhdGFzZXQlMjIlM0ElMjAlMjIlM0N5b3VyLXJlc3VsdHMtZGF0YXNldCUzRSUyMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUwQSUyMCUyMCUyMCUyMCU1RCUwQSU3RA==",highlighted:`<span class="hljs-punctuation">{</span>
    <span class="hljs-attr">&quot;submissions&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>

        ... # existing submissions
        
        <span class="hljs-punctuation">{</span>
            <span class="hljs-attr">&quot;username&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;&lt;your-username&gt;&quot;</span><span class="hljs-punctuation">,</span>
            <span class="hljs-attr">&quot;model_name&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;&lt;your-model-name&gt;&quot;</span><span class="hljs-punctuation">,</span>
            <span class="hljs-attr">&quot;chapter&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;1&quot;</span><span class="hljs-punctuation">,</span>
            <span class="hljs-attr">&quot;submission_date&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;&lt;your-submission-date&gt;&quot;</span><span class="hljs-punctuation">,</span>
            <span class="hljs-attr">&quot;results-dataset&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;&lt;your-results-dataset&gt;&quot;</span>
        <span class="hljs-punctuation">}</span>
    <span class="hljs-punctuation">]</span>
<span class="hljs-punctuation">}</span>`,wrap:!1}}),G=new f({props:{title:"Share you evaluation command in the PR text.",local:"share-you-evaluation-command-in-the-pr-text",headingTag:"h3"}}),k=new Ae({props:{code:"aGYlMjBqb2JzJTIwdXYlMjBydW4lMjAuLi4=",highlighted:'<span class="hljs-function"><span class="hljs-title">hf</span></span> jobs uv run ...',wrap:!1}}),R=new f({props:{title:"Wait for the PR to be merged",local:"wait-for-the-pr-to-be-merged",headingTag:"h3"}}),F=new f({props:{title:"Test your knowledge",local:"test-your-knowledge",headingTag:"h2"}}),Y=new lt({props:{source:"https://github.com/huggingface/smol-course/blob/main/units/en/unit1/6.md"}}),{c(){u=o("meta"),j=a(),w=o("p"),V=a(),r(g.$$.fragment),D=a(),y=o("p"),y.textContent=We,K=a(),J=o("ol"),J.innerHTML=xe,ee=a(),$=o("p"),$.textContent=He,te=a(),r(b.$$.fragment),le=a(),I=o("p"),I.innerHTML=_e,se=a(),r(v.$$.fragment),ae=a(),U=o("p"),U.innerHTML=qe,ne=a(),r(C.$$.fragment),oe=a(),A=o("p"),A.innerHTML=Le,ie=a(),r(W.$$.fragment),ue=a(),x=o("p"),x.innerHTML=Be,pe=a(),r(H.$$.fragment),re=a(),_=o("p"),_.innerHTML=ze,he=a(),r(T.$$.fragment),me=a(),r(q.$$.fragment),de=a(),L=o("p"),L.textContent=Ee,Me=a(),B=o("ol"),B.innerHTML=Ne,ce=a(),r(z.$$.fragment),we=a(),E=o("p"),E.innerHTML=Ge,fe=a(),r(N.$$.fragment),Te=a(),r(G.$$.fragment),je=a(),Z=o("p"),Z.textContent=Ze,ge=a(),r(k.$$.fragment),ye=a(),P=o("p"),P.textContent=ke,Je=a(),r(R.$$.fragment),$e=a(),X=o("p"),X.innerHTML=Pe,be=a(),r(F.$$.fragment),Ie=a(),S=o("p"),S.innerHTML=Re,ve=a(),r(Y.$$.fragment),Ue=a(),O=o("p"),this.h()},l(e){const t=Ke("svelte-u9bgzb",document.head);u=i(t,"META",{name:!0,content:!0}),t.forEach(l),j=n(e),w=i(e,"P",{}),Fe(w).forEach(l),V=n(e),h(g.$$.fragment,e),D=n(e),y=i(e,"P",{"data-svelte-h":!0}),p(y)!=="svelte-wonj32"&&(y.textContent=We),K=n(e),J=i(e,"OL",{"data-svelte-h":!0}),p(J)!=="svelte-1o2cbb5"&&(J.innerHTML=xe),ee=n(e),$=i(e,"P",{"data-svelte-h":!0}),p($)!=="svelte-1qwargy"&&($.textContent=He),te=n(e),h(b.$$.fragment,e),le=n(e),I=i(e,"P",{"data-svelte-h":!0}),p(I)!=="svelte-15cqvq"&&(I.innerHTML=_e),se=n(e),h(v.$$.fragment,e),ae=n(e),U=i(e,"P",{"data-svelte-h":!0}),p(U)!=="svelte-71za7v"&&(U.innerHTML=qe),ne=n(e),h(C.$$.fragment,e),oe=n(e),A=i(e,"P",{"data-svelte-h":!0}),p(A)!=="svelte-1o1ar0u"&&(A.innerHTML=Le),ie=n(e),h(W.$$.fragment,e),ue=n(e),x=i(e,"P",{"data-svelte-h":!0}),p(x)!=="svelte-1mgg0oo"&&(x.innerHTML=Be),pe=n(e),h(H.$$.fragment,e),re=n(e),_=i(e,"P",{"data-svelte-h":!0}),p(_)!=="svelte-fnysjl"&&(_.innerHTML=ze),he=n(e),h(T.$$.fragment,e),me=n(e),h(q.$$.fragment,e),de=n(e),L=i(e,"P",{"data-svelte-h":!0}),p(L)!=="svelte-l889jz"&&(L.textContent=Ee),Me=n(e),B=i(e,"OL",{"data-svelte-h":!0}),p(B)!=="svelte-i8buu4"&&(B.innerHTML=Ne),ce=n(e),h(z.$$.fragment,e),we=n(e),E=i(e,"P",{"data-svelte-h":!0}),p(E)!=="svelte-1c2cw0z"&&(E.innerHTML=Ge),fe=n(e),h(N.$$.fragment,e),Te=n(e),h(G.$$.fragment,e),je=n(e),Z=i(e,"P",{"data-svelte-h":!0}),p(Z)!=="svelte-7fpivj"&&(Z.textContent=Ze),ge=n(e),h(k.$$.fragment,e),ye=n(e),P=i(e,"P",{"data-svelte-h":!0}),p(P)!=="svelte-1vwki5p"&&(P.textContent=ke),Je=n(e),h(R.$$.fragment,e),$e=n(e),X=i(e,"P",{"data-svelte-h":!0}),p(X)!=="svelte-6r8604"&&(X.innerHTML=Pe),be=n(e),h(F.$$.fragment,e),Ie=n(e),S=i(e,"P",{"data-svelte-h":!0}),p(S)!=="svelte-12iyozg"&&(S.innerHTML=Re),ve=n(e),h(Y.$$.fragment,e),Ue=n(e),O=i(e,"P",{}),Fe(O).forEach(l),this.h()},h(){Se(u,"name","hf:doc:metadata"),Se(u,"content",nt)},m(e,t){et(document.head,u),s(e,j,t),s(e,w,t),s(e,V,t),m(g,e,t),s(e,D,t),s(e,y,t),s(e,K,t),s(e,J,t),s(e,ee,t),s(e,$,t),s(e,te,t),m(b,e,t),s(e,le,t),s(e,I,t),s(e,se,t),m(v,e,t),s(e,ae,t),s(e,U,t),s(e,ne,t),m(C,e,t),s(e,oe,t),s(e,A,t),s(e,ie,t),m(W,e,t),s(e,ue,t),s(e,x,t),s(e,pe,t),m(H,e,t),s(e,re,t),s(e,_,t),s(e,he,t),m(T,e,t),s(e,me,t),m(q,e,t),s(e,de,t),s(e,L,t),s(e,Me,t),s(e,B,t),s(e,ce,t),m(z,e,t),s(e,we,t),s(e,E,t),s(e,fe,t),m(N,e,t),s(e,Te,t),m(G,e,t),s(e,je,t),s(e,Z,t),s(e,ge,t),m(k,e,t),s(e,ye,t),s(e,P,t),s(e,Je,t),m(R,e,t),s(e,$e,t),s(e,X,t),s(e,be,t),m(F,e,t),s(e,Ie,t),s(e,S,t),s(e,ve,t),m(Y,e,t),s(e,Ue,t),s(e,O,t),Ce=!0},p(e,[t]){const Xe={};t&2&&(Xe.$$scope={dirty:t,ctx:e}),T.$set(Xe)},i(e){Ce||(d(g.$$.fragment,e),d(b.$$.fragment,e),d(v.$$.fragment,e),d(C.$$.fragment,e),d(W.$$.fragment,e),d(H.$$.fragment,e),d(T.$$.fragment,e),d(q.$$.fragment,e),d(z.$$.fragment,e),d(N.$$.fragment,e),d(G.$$.fragment,e),d(k.$$.fragment,e),d(R.$$.fragment,e),d(F.$$.fragment,e),d(Y.$$.fragment,e),Ce=!0)},o(e){M(g.$$.fragment,e),M(b.$$.fragment,e),M(v.$$.fragment,e),M(C.$$.fragment,e),M(W.$$.fragment,e),M(H.$$.fragment,e),M(T.$$.fragment,e),M(q.$$.fragment,e),M(z.$$.fragment,e),M(N.$$.fragment,e),M(G.$$.fragment,e),M(k.$$.fragment,e),M(R.$$.fragment,e),M(F.$$.fragment,e),M(Y.$$.fragment,e),Ce=!1},d(e){e&&(l(j),l(w),l(V),l(D),l(y),l(K),l(J),l(ee),l($),l(te),l(le),l(I),l(se),l(ae),l(U),l(ne),l(oe),l(A),l(ie),l(ue),l(x),l(pe),l(re),l(_),l(he),l(me),l(de),l(L),l(Me),l(B),l(ce),l(we),l(E),l(fe),l(Te),l(je),l(Z),l(ge),l(ye),l(P),l(Je),l($e),l(X),l(be),l(Ie),l(S),l(ve),l(Ue),l(O)),l(u),c(g,e),c(b,e),c(v,e),c(C,e),c(W,e),c(H,e),c(T,e),c(q,e),c(z,e),c(N,e),c(G,e),c(k,e),c(R,e),c(F,e),c(Y,e)}}}const nt='{"title":"Submit your final project!","local":"submit-your-final-project","sections":[{"title":"1. Read the written guide for the chapter and 2. Train a model using what you learned in the chapter.","local":"1-read-the-written-guide-for-the-chapter-and-2-train-a-model-using-what-you-learned-in-the-chapter","sections":[],"depth":2},{"title":"3. Push the model to the Hugging Face Hub","local":"3-push-the-model-to-the-hugging-face-hub","sections":[],"depth":2},{"title":"4. Evaluate the model using hf jobs","local":"4-evaluate-the-model-using-hf-jobs","sections":[],"depth":2},{"title":"5. Open a pull request on the leaderboard space","local":"5-open-a-pull-request-on-the-leaderboard-space","sections":[{"title":"Add your model’s results to submissions.json","local":"add-your-models-results-to-submissionsjson","sections":[],"depth":3},{"title":"Share you evaluation command in the PR text.","local":"share-you-evaluation-command-in-the-pr-text","sections":[],"depth":3},{"title":"Wait for the PR to be merged","local":"wait-for-the-pr-to-be-merged","sections":[],"depth":3}],"depth":2},{"title":"Test your knowledge","local":"test-your-knowledge","sections":[],"depth":2}],"depth":1}';function ot(Q){return Ve(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class mt extends Qe{constructor(u){super(),De(this,u,ot,at,Ye,{})}}export{mt as component};
