import{s as ie,o as re,n as se}from"../chunks/scheduler.5f3e6389.js";import{S as de,i as ce,e as b,s as r,c as g,h as me,a as x,d as n,b as d,f as Z,g as f,j as U,k as q,l as S,m as l,n as h,t as v,o as _,p as $}from"../chunks/index.62df735e.js";import{C as pe,H as K,E as ue}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.e306bd5b.js";import{D as ae}from"../chunks/Docstring.88e8f8ba.js";import{C as le}from"../chunks/CodeBlock.dc1e8be0.js";import{E as ne}from"../chunks/ExampleCodeBlock.7e3fcb1f.js";function ge(j){let a,y="Example:",c,s,i;return s=new le({props:{code:"ZnJvbSUyMGV2YWx1YXRlJTIwaW1wb3J0JTIwbGlzdF9ldmFsdWF0aW9uX21vZHVsZXMlMEFsaXN0X2V2YWx1YXRpb25fbW9kdWxlcyhtb2R1bGVfdHlwZSUzRCUyMm1ldHJpYyUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> evaluate <span class="hljs-keyword">import</span> list_evaluation_modules
<span class="hljs-meta">&gt;&gt;&gt; </span>list_evaluation_modules(module_type=<span class="hljs-string">&quot;metric&quot;</span>)`,wrap:!1}}),{c(){a=b("p"),a.textContent=y,c=r(),g(s.$$.fragment)},l(t){a=x(t,"P",{"data-svelte-h":!0}),U(a)!=="svelte-11lpom8"&&(a.textContent=y),c=d(t),f(s.$$.fragment,t)},m(t,m){l(t,a,m),l(t,c,m),h(s,t,m),i=!0},p:se,i(t){i||(v(s.$$.fragment,t),i=!0)},o(t){_(s.$$.fragment,t),i=!1},d(t){t&&(n(a),n(c)),$(s,t)}}}function fe(j){let a,y="Example:",c,s,i;return s=new le({props:{code:"ZnJvbSUyMGV2YWx1YXRlJTIwaW1wb3J0JTIwbG9hZCUwQWFjY3VyYWN5JTIwJTNEJTIwbG9hZCglMjJhY2N1cmFjeSUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> evaluate <span class="hljs-keyword">import</span> load
<span class="hljs-meta">&gt;&gt;&gt; </span>accuracy = load(<span class="hljs-string">&quot;accuracy&quot;</span>)`,wrap:!1}}),{c(){a=b("p"),a.textContent=y,c=r(),g(s.$$.fragment)},l(t){a=x(t,"P",{"data-svelte-h":!0}),U(a)!=="svelte-11lpom8"&&(a.textContent=y),c=d(t),f(s.$$.fragment,t)},m(t,m){l(t,a,m),l(t,c,m),h(s,t,m),i=!0},p:se,i(t){i||(v(s.$$.fragment,t),i=!0)},o(t){_(s.$$.fragment,t),i=!1},d(t){t&&(n(a),n(c)),$(s,t)}}}function he(j){let a,y,c,s,i,t,m,W,E,ee="Methods for listing and loading evaluation modules:",H,M,V,p,L,z,I,te="List all evaluation modules available on the Hugging Face Hub.",A,C,Y,F,G,u,D,B,J,oe='Load a <a href="/docs/evaluate/main/en/package_reference/main_classes#evaluate.EvaluationModule">EvaluationModule</a>.',Q,T,R,N,X,P,O;return i=new pe({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),m=new K({props:{title:"Loading methods",local:"loading-methods",headingTag:"h1"}}),M=new K({props:{title:"List",local:"evaluate.list_evaluation_modules",headingTag:"h2"}}),L=new ae({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>, defaults to <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>, defaults to <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>, defaults to <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/main/src/evaluate/inspect.py#L35",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[Union[str, dict]]</code></p>
`}}),C=new ne({props:{anchor:"evaluate.list_evaluation_modules.example",$$slots:{default:[ge]},$$scope:{ctx:j}}}),F=new K({props:{title:"Load",local:"evaluate.load",headingTag:"h2"}}),D=new ae({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[datasets.download.download_config.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>, <em>optional</em>) &#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>, <em>optional</em>) &#x2014;
For distributed evaluation: id of the process.`,name:"process_id"},{anchor:"evaluate.load.num_process",description:`<strong>num_process</strong> (<code>int</code>, <em>optional</em>) &#x2014;
For distributed evaluation: total number of processes.`,name:"num_process"},{anchor:"evaluate.load.cache_dir",description:`<strong>cache_dir</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Path to store the temporary predictions and references (default to <code>~/.cache/huggingface/evaluate/</code>).`,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> (<code>bool</code>) &#x2014;
Whether to store the temporary results in memory (defaults to <code>False</code>).`,name:"keep_in_memory"},{anchor:"evaluate.load.download_config",description:`<strong>download_config</strong> (<code>~evaluate.DownloadConfig</code>, <em>optional</em>) &#x2014;
Specific download configuration parameters.`,name:"download_config"},{anchor:"evaluate.load.download_mode",description:`<strong>download_mode</strong> (<code>DownloadMode</code>, defaults to <code>REUSE_DATASET_IF_EXISTS</code>) &#x2014;
Download/generate mode.`,name:"download_mode"},{anchor:"evaluate.load.revision",description:`<strong>revision</strong> (<code>Union[str, evaluate.Version]</code>, <em>optional</em>) &#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/main/src/evaluate/loading.py#L692",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/evaluate/main/en/package_reference/main_classes#evaluate.EvaluationModule"
>evaluate.EvaluationModule</a></p>
`}}),T=new ne({props:{anchor:"evaluate.load.example",$$slots:{default:[fe]},$$scope:{ctx:j}}}),N=new ue({props:{source:"https://github.com/huggingface/evaluate/blob/main/docs/source/package_reference/loading_methods.mdx"}}),{c(){a=b("meta"),y=r(),c=b("p"),s=r(),g(i.$$.fragment),t=r(),g(m.$$.fragment),W=r(),E=b("p"),E.textContent=ee,H=r(),g(M.$$.fragment),V=r(),p=b("div"),g(L.$$.fragment),z=r(),I=b("p"),I.textContent=te,A=r(),g(C.$$.fragment),Y=r(),g(F.$$.fragment),G=r(),u=b("div"),g(D.$$.fragment),B=r(),J=b("p"),J.innerHTML=oe,Q=r(),g(T.$$.fragment),R=r(),g(N.$$.fragment),X=r(),P=b("p"),this.h()},l(e){const o=me("svelte-u9bgzb",document.head);a=x(o,"META",{name:!0,content:!0}),o.forEach(n),y=d(e),c=x(e,"P",{}),Z(c).forEach(n),s=d(e),f(i.$$.fragment,e),t=d(e),f(m.$$.fragment,e),W=d(e),E=x(e,"P",{"data-svelte-h":!0}),U(E)!=="svelte-1ukb6v"&&(E.textContent=ee),H=d(e),f(M.$$.fragment,e),V=d(e),p=x(e,"DIV",{class:!0});var w=Z(p);f(L.$$.fragment,w),z=d(w),I=x(w,"P",{"data-svelte-h":!0}),U(I)!=="svelte-duifbq"&&(I.textContent=te),A=d(w),f(C.$$.fragment,w),w.forEach(n),Y=d(e),f(F.$$.fragment,e),G=d(e),u=x(e,"DIV",{class:!0});var k=Z(u);f(D.$$.fragment,k),B=d(k),J=x(k,"P",{"data-svelte-h":!0}),U(J)!=="svelte-1iforpu"&&(J.innerHTML=oe),Q=d(k),f(T.$$.fragment,k),k.forEach(n),R=d(e),f(N.$$.fragment,e),X=d(e),P=x(e,"P",{}),Z(P).forEach(n),this.h()},h(){q(a,"name","hf:doc:metadata"),q(a,"content",ve),q(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(u,"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,o){S(document.head,a),l(e,y,o),l(e,c,o),l(e,s,o),h(i,e,o),l(e,t,o),h(m,e,o),l(e,W,o),l(e,E,o),l(e,H,o),h(M,e,o),l(e,V,o),l(e,p,o),h(L,p,null),S(p,z),S(p,I),S(p,A),h(C,p,null),l(e,Y,o),h(F,e,o),l(e,G,o),l(e,u,o),h(D,u,null),S(u,B),S(u,J),S(u,Q),h(T,u,null),l(e,R,o),h(N,e,o),l(e,X,o),l(e,P,o),O=!0},p(e,[o]){const w={};o&2&&(w.$$scope={dirty:o,ctx:e}),C.$set(w);const k={};o&2&&(k.$$scope={dirty:o,ctx:e}),T.$set(k)},i(e){O||(v(i.$$.fragment,e),v(m.$$.fragment,e),v(M.$$.fragment,e),v(L.$$.fragment,e),v(C.$$.fragment,e),v(F.$$.fragment,e),v(D.$$.fragment,e),v(T.$$.fragment,e),v(N.$$.fragment,e),O=!0)},o(e){_(i.$$.fragment,e),_(m.$$.fragment,e),_(M.$$.fragment,e),_(L.$$.fragment,e),_(C.$$.fragment,e),_(F.$$.fragment,e),_(D.$$.fragment,e),_(T.$$.fragment,e),_(N.$$.fragment,e),O=!1},d(e){e&&(n(y),n(c),n(s),n(t),n(W),n(E),n(H),n(V),n(p),n(Y),n(G),n(u),n(R),n(X),n(P)),n(a),$(i,e),$(m,e),$(M,e),$(L),$(C),$(F,e),$(D),$(T),$(N,e)}}}const ve='{"title":"Loading methods","local":"loading-methods","sections":[{"title":"List","local":"evaluate.list_evaluation_modules","sections":[],"depth":2},{"title":"Load","local":"evaluate.load","sections":[],"depth":2}],"depth":1}';function _e(j){return re(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ce extends de{constructor(a){super(),ce(this,a,_e,he,ie,{})}}export{Ce as component};
