import{S as Ae,i as Pe,s as Me,e as a,k as d,w as I,t as w,M as Oe,c as n,d as o,m as c,a as i,x as U,h as b,b as s,G as t,g as l,y as C,L as Te,q as V,o as q,B as R,v as Fe}from"../../chunks/vendor-hf-doc-builder.js";import{D as Se}from"../../chunks/Docstring-hf-doc-builder.js";import{I as ve}from"../../chunks/IconCopyLink-hf-doc-builder.js";function He(fe){let p,B,u,g,S,$,te,A,ae,G,D,ne,J,m,_,P,x,ie,M,se,W,h,E,re,O,le,X,v,y,T,L,de,F,ce,j,f,N,pe,k,ue,H,me,he,z;return $=new ve({}),x=new ve({}),E=new Se({props:{name:"evaluate.list_evaluation_modules",anchor:"evaluate.list_evaluation_modules",parameters:[{name:"module_type",val:" = None"},{name:"include_community",val:" = True"},{name:"with_details",val:" = False"}],parametersDescription:[{anchor:"evaluate.list_evaluation_modules.module_type",description:"<strong>module_type</strong> (<code>str</code>, <em>optional</em>, default <code>None</code>) &#x2014; Type of evaluation modules to list. Has to be one of <code>&apos;metric&apos;</code>, <code>&apos;comparison&apos;</code>, or <code>&apos;measurement&apos;</code>. If <code>None</code>, all types are listed.",name:"module_type"},{anchor:"evaluate.list_evaluation_modules.include_community",description:"<strong>include_community</strong> (<code>bool</code>, <em>optional</em>, default <code>True</code>) &#x2014; Include community modules in the list.",name:"include_community"},{anchor:"evaluate.list_evaluation_modules.with_details",description:"<strong>with_details</strong> (<code>bool</code>, <em>optional</em>, default <code>False</code>) &#x2014; Return the full details on the metrics instead of only the ID.",name:"with_details"}],source:"https://github.com/huggingface/evaluate/blob/vr_286/src/evaluate/inspect.py#L35",returnDescription:`
<p><code>List[Union[str, dict]]</code></p>
`}}),L=new ve({}),N=new Se({props:{name:"evaluate.load",anchor:"evaluate.load",parameters:[{name:"path",val:": str"},{name:"config_name",val:": typing.Optional[str] = None"},{name:"module_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.download.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/rouge/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>module_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.module_type",description:"<strong>module_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:"module_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_286/src/evaluate/loading.py#L660",returnDescription:`
<p><em>evaluate.EvaluationModule</em></p>
`}}),{c(){p=a("meta"),B=d(),u=a("h1"),g=a("a"),S=a("span"),I($.$$.fragment),te=d(),A=a("span"),ae=w("Loading methods"),G=d(),D=a("p"),ne=w("Methods for listing and loading evaluation modules:"),J=d(),m=a("h2"),_=a("a"),P=a("span"),I(x.$$.fragment),ie=d(),M=a("span"),se=w("List"),W=d(),h=a("div"),I(E.$$.fragment),re=d(),O=a("p"),le=w("List all evaluation modules available on the Hugging Face Hub."),X=d(),v=a("h2"),y=a("a"),T=a("span"),I(L.$$.fragment),de=d(),F=a("span"),ce=w("Load"),j=d(),f=a("div"),I(N.$$.fragment),pe=d(),k=a("p"),ue=w("Load a "),H=a("em"),me=w("evaluate.EvaluationModule"),he=w("."),this.h()},l(e){const r=Oe('[data-svelte="svelte-1phssyn"]',document.head);p=n(r,"META",{name:!0,content:!0}),r.forEach(o),B=c(e),u=n(e,"H1",{class:!0});var K=i(u);g=n(K,"A",{id:!0,class:!0,href:!0});var ge=i(g);S=n(ge,"SPAN",{});var _e=i(S);U($.$$.fragment,_e),_e.forEach(o),ge.forEach(o),te=c(K),A=n(K,"SPAN",{});var ye=i(A);ae=b(ye,"Loading methods"),ye.forEach(o),K.forEach(o),G=c(e),D=n(e,"P",{});var we=i(D);ne=b(we,"Methods for listing and loading evaluation modules:"),we.forEach(o),J=c(e),m=n(e,"H2",{class:!0});var Q=i(m);_=n(Q,"A",{id:!0,class:!0,href:!0});var be=i(_);P=n(be,"SPAN",{});var $e=i(P);U(x.$$.fragment,$e),$e.forEach(o),be.forEach(o),ie=c(Q),M=n(Q,"SPAN",{});var xe=i(M);se=b(xe,"List"),xe.forEach(o),Q.forEach(o),W=c(e),h=n(e,"DIV",{class:!0});var Y=i(h);U(E.$$.fragment,Y),re=c(Y),O=n(Y,"P",{});var Ee=i(O);le=b(Ee,"List all evaluation modules available on the Hugging Face Hub."),Ee.forEach(o),Y.forEach(o),X=c(e),v=n(e,"H2",{class:!0});var Z=i(v);y=n(Z,"A",{id:!0,class:!0,href:!0});var Le=i(y);T=n(Le,"SPAN",{});var Ne=i(T);U(L.$$.fragment,Ne),Ne.forEach(o),Le.forEach(o),de=c(Z),F=n(Z,"SPAN",{});var ke=i(F);ce=b(ke,"Load"),ke.forEach(o),Z.forEach(o),j=c(e),f=n(e,"DIV",{class:!0});var ee=i(f);U(N.$$.fragment,ee),pe=c(ee),k=n(ee,"P",{});var oe=i(k);ue=b(oe,"Load a "),H=n(oe,"EM",{});var De=i(H);me=b(De,"evaluate.EvaluationModule"),De.forEach(o),he=b(oe,"."),oe.forEach(o),ee.forEach(o),this.h()},h(){s(p,"name","hf:doc:metadata"),s(p,"content",JSON.stringify(Ie)),s(g,"id","loading-methods"),s(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"),s(g,"href","#loading-methods"),s(u,"class","relative group"),s(_,"id","evaluate.list_evaluation_modules"),s(_,"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"),s(_,"href","#evaluate.list_evaluation_modules"),s(m,"class","relative group"),s(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(y,"id","evaluate.load"),s(y,"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"),s(y,"href","#evaluate.load"),s(v,"class","relative group"),s(f,"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,r){t(document.head,p),l(e,B,r),l(e,u,r),t(u,g),t(g,S),C($,S,null),t(u,te),t(u,A),t(A,ae),l(e,G,r),l(e,D,r),t(D,ne),l(e,J,r),l(e,m,r),t(m,_),t(_,P),C(x,P,null),t(m,ie),t(m,M),t(M,se),l(e,W,r),l(e,h,r),C(E,h,null),t(h,re),t(h,O),t(O,le),l(e,X,r),l(e,v,r),t(v,y),t(y,T),C(L,T,null),t(v,de),t(v,F),t(F,ce),l(e,j,r),l(e,f,r),C(N,f,null),t(f,pe),t(f,k),t(k,ue),t(k,H),t(H,me),t(k,he),z=!0},p:Te,i(e){z||(V($.$$.fragment,e),V(x.$$.fragment,e),V(E.$$.fragment,e),V(L.$$.fragment,e),V(N.$$.fragment,e),z=!0)},o(e){q($.$$.fragment,e),q(x.$$.fragment,e),q(E.$$.fragment,e),q(L.$$.fragment,e),q(N.$$.fragment,e),z=!1},d(e){o(p),e&&o(B),e&&o(u),R($),e&&o(G),e&&o(D),e&&o(J),e&&o(m),R(x),e&&o(W),e&&o(h),R(E),e&&o(X),e&&o(v),R(L),e&&o(j),e&&o(f),R(N)}}}const Ie={local:"loading-methods",sections:[{local:"evaluate.list_evaluation_modules",title:"List"},{local:"evaluate.load",title:"Load"}],title:"Loading methods"};function Ue(fe){return Fe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Re extends Ae{constructor(p){super();Pe(this,p,Ue,He,Me,{})}}export{Re as default,Ie as metadata};
