import{S as $e,i as be,s as Ee,e as a,k as u,w as J,t as x,M as xe,c as n,d as o,m as f,a as s,x as W,h as k,b as r,F as t,g as l,y as X,L as ke,q as j,o as z,B as K,v as Ne}from"../../chunks/vendor-e830fc9c.js";import{D as Se}from"../../chunks/Docstring-785cfc11.js";import{I as le}from"../../chunks/IconCopyLink-af4c5c5b.js";function De(de){let d,T,c,v,S,y,Q,D,Y,F,N,Z,C,p,g,M,w,ee,A,oe,I,m,_,L,$,te,P,ae,U,h,b,ne,E,se,O,re,ie,H;return y=new le({}),w=new le({}),$=new le({}),b=new Se({props:{name:"evaluate.load",anchor:"evaluate.load",parameters:[{name:"path",val:": str"},{name:"config_name",val:": typing.Optional[str] = None"},{name:"type",val:": typing.Optional[str] = None"},{name:"process_id",val:": int = 0"},{name:"num_process",val:": int = 1"},{name:"cache_dir",val:": typing.Optional[str] = None"},{name:"experiment_id",val:": typing.Optional[str] = None"},{name:"keep_in_memory",val:": bool = False"},{name:"download_config",val:": typing.Optional[evaluate.utils.file_utils.DownloadConfig] = None"},{name:"download_mode",val:": typing.Optional[datasets.utils.download_manager.DownloadMode] = None"},{name:"revision",val:": typing.Union[str, datasets.utils.version.Version, NoneType] = None"},{name:"**init_kwargs",val:""}],parametersDescription:[{anchor:"evaluate.load.path",description:`<strong>path</strong> (<code>str</code>) &#x2014;
path to the evaluation processing script with the evaluation builder. Can be either:<ul>
<li>a local path to processing script or the directory containing the script (if the script has the same name as the directory),
e.g. <code>&apos;./metrics/rouge&apos;</code> or <code>&apos;./metrics/rogue/rouge.py&apos;</code></li>
<li>a evaluation module identifier on the HuggingFace evaluate repo e.g. <code>&apos;rouge&apos;</code> or <code>&apos;bleu&apos;</code> that are in either <code>&apos;metrics/&apos;</code>,
<code>&apos;comparisons/&apos;</code>, or <code>&apos;measurements/&apos;</code> depending on the provided <code>type</code>.</li>
</ul>`,name:"path"},{anchor:"evaluate.load.config_name",description:"<strong>config_name</strong> (<code>str</code>, optional) &#x2014; selecting a configuration for the metric (e.g. the GLUE metric has a configuration for each subset)",name:"config_name"},{anchor:"evaluate.load.type",description:"<strong>type</strong> (<code>str</code>, default <code>&apos;metric&apos;</code>) &#x2014; type of evaluation module, can be one of <code>&apos;metric&apos;</code>, <code>&apos;comparison&apos;</code>, or <code>&apos;measurement&apos;</code>.",name:"type"},{anchor:"evaluate.load.process_id",description:"<strong>process_id</strong> (<code>int</code>, optional) &#x2014; for distributed evaluation: id of the process",name:"process_id"},{anchor:"evaluate.load.num_process",description:"<strong>num_process</strong> (<code>int</code>, optional) &#x2014; for distributed evaluation: total number of processes",name:"num_process"},{anchor:"evaluate.load.cache_dir",description:"<strong>cache_dir</strong> (Optional str) &#x2014; path to store the temporary predictions and references (default to <em>~/.cache/huggingface/evaluate/</em>)",name:"cache_dir"},{anchor:"evaluate.load.experiment_id",description:`<strong>experiment_id</strong> (<code>str</code>) &#x2014; A specific experiment id. This is used if several distributed evaluations share the same file system.
This is useful to compute metrics in distributed setups (in particular non-additive metrics like F1).`,name:"experiment_id"},{anchor:"evaluate.load.keep_in_memory",description:"<strong>keep_in_memory</strong> (bool) &#x2014; Whether to store the temporary results in memory (defaults to False)",name:"keep_in_memory"},{anchor:"evaluate.load.download_config",description:"<strong>download_config</strong> (Optional <code>evaluate.DownloadConfig</code> &#x2014; specific download configuration parameters.",name:"download_config"},{anchor:"evaluate.load.download_mode",description:"<strong>download_mode</strong> (<code>DownloadMode</code>, default <code>REUSE_DATASET_IF_EXISTS</code>) &#x2014; Download/generate mode.",name:"download_mode"},{anchor:"evaluate.load.revision",description:`<strong>revision</strong> (Optional <code>Union[str, evaluate.Version]</code>) &#x2014; if specified, the module will be loaded from the datasets repository
at this version. By default it is set to the local version of the lib. Specifying a version that is different from
your local version of the lib might cause compatibility issues.`,name:"revision"}],source:"https://github.com/huggingface/evaluate/blob/vr_50/src/evaluate/loading.py#L730",returnDescription:`
<p><em>evaluate.EvaluationModule</em></p>
`}}),{c(){d=a("meta"),T=u(),c=a("h1"),v=a("a"),S=a("span"),J(y.$$.fragment),Q=u(),D=a("span"),Y=x("Loading methods"),F=u(),N=a("p"),Z=x("Methods for listing and loading datasets and metrics:"),C=u(),p=a("h2"),g=a("a"),M=a("span"),J(w.$$.fragment),ee=u(),A=a("span"),oe=x("Datasets"),I=u(),m=a("h2"),_=a("a"),L=a("span"),J($.$$.fragment),te=u(),P=a("span"),ae=x("Metrics"),U=u(),h=a("div"),J(b.$$.fragment),ne=u(),E=a("p"),se=x("Load a "),O=a("em"),re=x("evaluate.EvaluationModule"),ie=x("."),this.h()},l(e){const i=xe('[data-svelte="svelte-1phssyn"]',document.head);d=n(i,"META",{name:!0,content:!0}),i.forEach(o),T=f(e),c=n(e,"H1",{class:!0});var q=s(c);v=n(q,"A",{id:!0,class:!0,href:!0});var ce=s(v);S=n(ce,"SPAN",{});var pe=s(S);W(y.$$.fragment,pe),pe.forEach(o),ce.forEach(o),Q=f(q),D=n(q,"SPAN",{});var me=s(D);Y=k(me,"Loading methods"),me.forEach(o),q.forEach(o),F=f(e),N=n(e,"P",{});var he=s(N);Z=k(he,"Methods for listing and loading datasets and metrics:"),he.forEach(o),C=f(e),p=n(e,"H2",{class:!0});var V=s(p);g=n(V,"A",{id:!0,class:!0,href:!0});var ue=s(g);M=n(ue,"SPAN",{});var fe=s(M);W(w.$$.fragment,fe),fe.forEach(o),ue.forEach(o),ee=f(V),A=n(V,"SPAN",{});var ve=s(A);oe=k(ve,"Datasets"),ve.forEach(o),V.forEach(o),I=f(e),m=n(e,"H2",{class:!0});var B=s(m);_=n(B,"A",{id:!0,class:!0,href:!0});var ge=s(_);L=n(ge,"SPAN",{});var _e=s(L);W($.$$.fragment,_e),_e.forEach(o),ge.forEach(o),te=f(B),P=n(B,"SPAN",{});var ye=s(P);ae=k(ye,"Metrics"),ye.forEach(o),B.forEach(o),U=f(e),h=n(e,"DIV",{class:!0});var R=s(h);W(b.$$.fragment,R),ne=f(R),E=n(R,"P",{});var G=s(E);se=k(G,"Load a "),O=n(G,"EM",{});var we=s(O);re=k(we,"evaluate.EvaluationModule"),we.forEach(o),ie=k(G,"."),G.forEach(o),R.forEach(o),this.h()},h(){r(d,"name","hf:doc:metadata"),r(d,"content",JSON.stringify(Me)),r(v,"id","loading-methods"),r(v,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(v,"href","#loading-methods"),r(c,"class","relative group"),r(g,"id","datasets"),r(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(g,"href","#datasets"),r(p,"class","relative group"),r(_,"id","evaluate.load"),r(_,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(_,"href","#evaluate.load"),r(m,"class","relative group"),r(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,i){t(document.head,d),l(e,T,i),l(e,c,i),t(c,v),t(v,S),X(y,S,null),t(c,Q),t(c,D),t(D,Y),l(e,F,i),l(e,N,i),t(N,Z),l(e,C,i),l(e,p,i),t(p,g),t(g,M),X(w,M,null),t(p,ee),t(p,A),t(A,oe),l(e,I,i),l(e,m,i),t(m,_),t(_,L),X($,L,null),t(m,te),t(m,P),t(P,ae),l(e,U,i),l(e,h,i),X(b,h,null),t(h,ne),t(h,E),t(E,se),t(E,O),t(O,re),t(E,ie),H=!0},p:ke,i(e){H||(j(y.$$.fragment,e),j(w.$$.fragment,e),j($.$$.fragment,e),j(b.$$.fragment,e),H=!0)},o(e){z(y.$$.fragment,e),z(w.$$.fragment,e),z($.$$.fragment,e),z(b.$$.fragment,e),H=!1},d(e){o(d),e&&o(T),e&&o(c),K(y),e&&o(F),e&&o(N),e&&o(C),e&&o(p),K(w),e&&o(I),e&&o(m),K($),e&&o(U),e&&o(h),K(b)}}}const Me={local:"loading-methods",sections:[{local:"datasets",title:"Datasets"},{local:"evaluate.load",title:"Metrics"}],title:"Loading methods"};function Ae(de){return Ne(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Te extends $e{constructor(d){super();be(this,d,Ae,De,Ee,{})}}export{Te as default,Me as metadata};
