Buckets:

rtrm's picture
download
raw
8.78 kB
import{s as ke,n as _e,o as Ie}from"../chunks/scheduler.5f3e6389.js";import{S as be,i as Oe,e as s,s as n,c,h as Ne,a as m,d as l,b as i,f as ye,g as o,j as f,k as xe,l as Qe,m as a,n as p,t as h,o as r,p as u}from"../chunks/index.373ab25c.js";import{C as fe}from"../chunks/CodeBlock.9962115b.js";import{H as $,E as We}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.d67236f8.js";function Ye(ge){let g,P,E,V,T,H,d,$e=`Lighteval includes a caching system that can significantly speed up evaluations by storing and reusing model predictions.
This is especially useful when running the same evaluation multiple times, or comparing different evaluation metrics on the same model outputs.`,L,M,B,w,Te=`The caching system caches the predictions of the model for now (we will add tokenized input caching later).
It stores model responses objects (generations, logits, probabilities) for evaluation samples.`,F,C,S,J,de="Cached data is stored on disk using HuggingFace datasets in the following structure:",D,v,X,U,Me="Where:",q,j,we="<li><code>model_name</code>: The model name (path on the hub or local path)</li> <li><code>model_hash</code>: Hash of the model configuration to ensure cache invalidation when parameters change</li> <li><code>task_name</code>: Name of the evaluation task</li>",z,A,K,y,Ce="A new cache is automatically created when:",ee,x,Je="<li>Model configuration changes (different parameters, quantization, etc.)</li> <li>Model weights change (different revision, checkpoint, etc.)</li> <li>Generation parameters change (temperature, max_tokens, etc.)</li>",te,k,ve="This ensures that cached results are always consistent with your current model setup.",le,_,ae,I,ne,b,Ue=`All built-in model classes in Lighteval automatically support caching. No additional configuration is needed.
For custom models you need to add a cache to the model class and decorators on all functions.`,ie,O,se,N,me,Q,je="To clear cache for a specific model, delete the corresponding directory:",ce,W,oe,Y,Ae="To clear all caches:",pe,R,he,Z,re,G,ue;return T=new $({props:{title:"Caching System",local:"caching-system",headingTag:"h1"}}),M=new $({props:{title:"How It Works",local:"how-it-works",headingTag:"h2"}}),C=new $({props:{title:"Cache Structure",local:"cache-structure",headingTag:"h3"}}),v=new fe({props:{code:"LmNhY2hlJTJGJTBBJUUyJTk0JTk0JUUyJTk0JTgwJUUyJTk0JTgwJTIwaHVnZ2luZ2ZhY2UlMkYlMEElMjAlMjAlMjAlMjAlRTIlOTQlOTQlRTIlOTQlODAlRTIlOTQlODAlMjBsaWdodGV2YWwlMkYlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlRTIlOTQlOTQlRTIlOTQlODAlRTIlOTQlODAlMjBwcmVkaWN0aW9ucyUyRiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCVFMiU5NCU5NCVFMiU5NCU4MCVFMiU5NCU4MCUyMCU3Qm1vZGVsX25hbWUlN0QlMkYlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlRTIlOTQlOTQlRTIlOTQlODAlRTIlOTQlODAlMjAlN0Jtb2RlbF9oYXNoJTdEJTJGJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJUUyJTk0JTk0JUUyJTk0JTgwJUUyJTk0JTgwJTIwJTdCdGFza19uYW1lJTdELnBhcnF1ZXQ=",highlighted:`<span class="language-xml">.cache/
└── huggingface/
└── lighteval/
└── predictions/
└── </span><span class="hljs-template-variable">{model_name}</span><span class="language-xml">/
└── </span><span class="hljs-template-variable">{model_hash}</span><span class="language-xml">/
└── </span><span class="hljs-template-variable">{task_name}</span><span class="language-xml">.parquet</span>`,wrap:!1}}),A=new $({props:{title:"Cache Recreation",local:"cache-recreation",headingTag:"h3"}}),_=new $({props:{title:"Using Caching",local:"using-caching",headingTag:"h2"}}),I=new $({props:{title:"Automatic Caching",local:"automatic-caching",headingTag:"h3"}}),O=new $({props:{title:"Cache Management",local:"cache-management",headingTag:"h2"}}),N=new $({props:{title:"Clearing Cache",local:"clearing-cache",headingTag:"h3"}}),W=new fe({props:{code:"cm0lMjAtcmYlMjB+JTJGLmNhY2hlJTJGaHVnZ2luZ2ZhY2UlMkZsaWdodGV2YWwlMkZwcmVkaWN0aW9ucyUyRiU3Qm1vZGVsX25hbWUlN0QlMkYlN0Jtb2RlbF9oYXNoJTdEJTJG",highlighted:'<span class="hljs-built_in">rm</span> -rf ~/.cache/huggingface/lighteval/predictions/{model_name}/{model_hash}/',wrap:!1}}),R=new fe({props:{code:"cm0lMjAtcmYlMjB+JTJGLmNhY2hlJTJGaHVnZ2luZ2ZhY2UlMkZsaWdodGV2YWwlMkZwcmVkaWN0aW9ucw==",highlighted:'<span class="hljs-built_in">rm</span> -rf ~/.cache/huggingface/lighteval/predictions',wrap:!1}}),Z=new We({props:{source:"https://github.com/huggingface/lighteval/blob/main/docs/source/caching.mdx"}}),{c(){g=s("meta"),P=n(),E=s("p"),V=n(),c(T.$$.fragment),H=n(),d=s("p"),d.textContent=$e,L=n(),c(M.$$.fragment),B=n(),w=s("p"),w.textContent=Te,F=n(),c(C.$$.fragment),S=n(),J=s("p"),J.textContent=de,D=n(),c(v.$$.fragment),X=n(),U=s("p"),U.textContent=Me,q=n(),j=s("ul"),j.innerHTML=we,z=n(),c(A.$$.fragment),K=n(),y=s("p"),y.textContent=Ce,ee=n(),x=s("ul"),x.innerHTML=Je,te=n(),k=s("p"),k.textContent=ve,le=n(),c(_.$$.fragment),ae=n(),c(I.$$.fragment),ne=n(),b=s("p"),b.textContent=Ue,ie=n(),c(O.$$.fragment),se=n(),c(N.$$.fragment),me=n(),Q=s("p"),Q.textContent=je,ce=n(),c(W.$$.fragment),oe=n(),Y=s("p"),Y.textContent=Ae,pe=n(),c(R.$$.fragment),he=n(),c(Z.$$.fragment),re=n(),G=s("p"),this.h()},l(e){const t=Ne("svelte-u9bgzb",document.head);g=m(t,"META",{name:!0,content:!0}),t.forEach(l),P=i(e),E=m(e,"P",{}),ye(E).forEach(l),V=i(e),o(T.$$.fragment,e),H=i(e),d=m(e,"P",{"data-svelte-h":!0}),f(d)!=="svelte-i0emib"&&(d.textContent=$e),L=i(e),o(M.$$.fragment,e),B=i(e),w=m(e,"P",{"data-svelte-h":!0}),f(w)!=="svelte-q0e2o4"&&(w.textContent=Te),F=i(e),o(C.$$.fragment,e),S=i(e),J=m(e,"P",{"data-svelte-h":!0}),f(J)!=="svelte-v21tje"&&(J.textContent=de),D=i(e),o(v.$$.fragment,e),X=i(e),U=m(e,"P",{"data-svelte-h":!0}),f(U)!=="svelte-ubj59h"&&(U.textContent=Me),q=i(e),j=m(e,"UL",{"data-svelte-h":!0}),f(j)!=="svelte-rcuru1"&&(j.innerHTML=we),z=i(e),o(A.$$.fragment,e),K=i(e),y=m(e,"P",{"data-svelte-h":!0}),f(y)!=="svelte-6piv8e"&&(y.textContent=Ce),ee=i(e),x=m(e,"UL",{"data-svelte-h":!0}),f(x)!=="svelte-kksjsp"&&(x.innerHTML=Je),te=i(e),k=m(e,"P",{"data-svelte-h":!0}),f(k)!=="svelte-1po7rv"&&(k.textContent=ve),le=i(e),o(_.$$.fragment,e),ae=i(e),o(I.$$.fragment,e),ne=i(e),b=m(e,"P",{"data-svelte-h":!0}),f(b)!=="svelte-dtxxli"&&(b.textContent=Ue),ie=i(e),o(O.$$.fragment,e),se=i(e),o(N.$$.fragment,e),me=i(e),Q=m(e,"P",{"data-svelte-h":!0}),f(Q)!=="svelte-aebkpt"&&(Q.textContent=je),ce=i(e),o(W.$$.fragment,e),oe=i(e),Y=m(e,"P",{"data-svelte-h":!0}),f(Y)!=="svelte-oib9is"&&(Y.textContent=Ae),pe=i(e),o(R.$$.fragment,e),he=i(e),o(Z.$$.fragment,e),re=i(e),G=m(e,"P",{}),ye(G).forEach(l),this.h()},h(){xe(g,"name","hf:doc:metadata"),xe(g,"content",Re)},m(e,t){Qe(document.head,g),a(e,P,t),a(e,E,t),a(e,V,t),p(T,e,t),a(e,H,t),a(e,d,t),a(e,L,t),p(M,e,t),a(e,B,t),a(e,w,t),a(e,F,t),p(C,e,t),a(e,S,t),a(e,J,t),a(e,D,t),p(v,e,t),a(e,X,t),a(e,U,t),a(e,q,t),a(e,j,t),a(e,z,t),p(A,e,t),a(e,K,t),a(e,y,t),a(e,ee,t),a(e,x,t),a(e,te,t),a(e,k,t),a(e,le,t),p(_,e,t),a(e,ae,t),p(I,e,t),a(e,ne,t),a(e,b,t),a(e,ie,t),p(O,e,t),a(e,se,t),p(N,e,t),a(e,me,t),a(e,Q,t),a(e,ce,t),p(W,e,t),a(e,oe,t),a(e,Y,t),a(e,pe,t),p(R,e,t),a(e,he,t),p(Z,e,t),a(e,re,t),a(e,G,t),ue=!0},p:_e,i(e){ue||(h(T.$$.fragment,e),h(M.$$.fragment,e),h(C.$$.fragment,e),h(v.$$.fragment,e),h(A.$$.fragment,e),h(_.$$.fragment,e),h(I.$$.fragment,e),h(O.$$.fragment,e),h(N.$$.fragment,e),h(W.$$.fragment,e),h(R.$$.fragment,e),h(Z.$$.fragment,e),ue=!0)},o(e){r(T.$$.fragment,e),r(M.$$.fragment,e),r(C.$$.fragment,e),r(v.$$.fragment,e),r(A.$$.fragment,e),r(_.$$.fragment,e),r(I.$$.fragment,e),r(O.$$.fragment,e),r(N.$$.fragment,e),r(W.$$.fragment,e),r(R.$$.fragment,e),r(Z.$$.fragment,e),ue=!1},d(e){e&&(l(P),l(E),l(V),l(H),l(d),l(L),l(B),l(w),l(F),l(S),l(J),l(D),l(X),l(U),l(q),l(j),l(z),l(K),l(y),l(ee),l(x),l(te),l(k),l(le),l(ae),l(ne),l(b),l(ie),l(se),l(me),l(Q),l(ce),l(oe),l(Y),l(pe),l(he),l(re),l(G)),l(g),u(T,e),u(M,e),u(C,e),u(v,e),u(A,e),u(_,e),u(I,e),u(O,e),u(N,e),u(W,e),u(R,e),u(Z,e)}}}const Re='{"title":"Caching System","local":"caching-system","sections":[{"title":"How It Works","local":"how-it-works","sections":[{"title":"Cache Structure","local":"cache-structure","sections":[],"depth":3},{"title":"Cache Recreation","local":"cache-recreation","sections":[],"depth":3}],"depth":2},{"title":"Using Caching","local":"using-caching","sections":[{"title":"Automatic Caching","local":"automatic-caching","sections":[],"depth":3}],"depth":2},{"title":"Cache Management","local":"cache-management","sections":[{"title":"Clearing Cache","local":"clearing-cache","sections":[],"depth":3}],"depth":2}],"depth":1}';function Ze(ge){return Ie(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class He extends be{constructor(g){super(),Oe(this,g,Ze,Ye,ke,{})}}export{He as component};

Xet Storage Details

Size:
8.78 kB
·
Xet hash:
1bb05a2fbfa1fb50daf19a128c8a4cdea4ecffaf0402b5397e79951833774b73

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