import{s as z,o as D,n as R}from"../chunks/scheduler.5f3e6389.js";import{S as Z,i as F,e as x,s as p,c as b,h as X,a as y,d as s,b as f,f as N,g as M,j as V,k as Q,l as W,m as l,n as w,t as j,o as C,p as J}from"../chunks/index.62df735e.js";import{C as K,H as G,E as O}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.e306bd5b.js";import{D as tt}from"../chunks/Docstring.88e8f8ba.js";import{C as et}from"../chunks/CodeBlock.dc1e8be0.js";import{E as at}from"../chunks/ExampleCodeBlock.7e3fcb1f.js";function st(q){let n,g="Example:",u,o,r;return o=new et({props:{code:"aW1wb3J0JTIwZXZhbHVhdGUlMEFyZXN1bHQlMjAlM0QlMjAlN0IlMjJibGV1JTIyJTNBJTIwMC43JTdEJTBBcGFyYW1zJTIwJTNEJTIwJTdCJTIybW9kZWwlMjIlM0ElMjAlMjJncHQtMiUyMiU3RCUwQWV2YWx1YXRlLnNhdmUoJTIyLiUyRnJlc3VsdHMlMkYlMjIlMkMlMjAqKnJlc3VsdCUyQyUyMCoqcGFyYW1zKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> evaluate
<span class="hljs-meta">&gt;&gt;&gt; </span>result = {<span class="hljs-string">&quot;bleu&quot;</span>: <span class="hljs-number">0.7</span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>params = {<span class="hljs-string">&quot;model&quot;</span>: <span class="hljs-string">&quot;gpt-2&quot;</span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>evaluate.save(<span class="hljs-string">&quot;./results/&quot;</span>, **result, **params)`,wrap:!1}}),{c(){n=x("p"),n.textContent=g,u=p(),b(o.$$.fragment)},l(a){n=y(a,"P",{"data-svelte-h":!0}),V(n)!=="svelte-11lpom8"&&(n.textContent=g),u=f(a),M(o.$$.fragment,a)},m(a,i){l(a,n,i),l(a,u,i),w(o,a,i),r=!0},p:R,i(a){r||(j(o.$$.fragment,a),r=!0)},o(a){C(o.$$.fragment,a),r=!1},d(a){a&&(s(n),s(u)),J(o,a)}}}function nt(q){let n,g,u,o,r,a,i,I,d,Y="Methods for saving evaluations results:",k,h,P,m,v,A,T,B=`Saves results to a JSON file. Also saves system information such as current time, current commit
hash if inside a repository, and Python system information.`,L,$,S,_,U,E,H;return r=new K({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),i=new G({props:{title:"Saving methods",local:"saving-methods",headingTag:"h1"}}),h=new G({props:{title:"Save",local:"evaluate.save",headingTag:"h2"}}),v=new tt({props:{name:"evaluate.save",anchor:"evaluate.save",parameters:[{name:"path_or_file",val:""},{name:"**data",val:""}],parametersDescription:[{anchor:"evaluate.save.path_or_file",description:`<strong>path_or_file</strong> (<code>str</code>) &#x2014;
Path or file to store the file. If only a folder is provided
the results file will be saved in the format <code>&quot;result-%Y_%m_%d-%H_%M_%S.json&quot;</code>.`,name:"path_or_file"}],source:"https://github.com/huggingface/evaluate/blob/main/src/evaluate/saving.py#L13"}}),$=new at({props:{anchor:"evaluate.save.example",$$slots:{default:[st]},$$scope:{ctx:q}}}),_=new O({props:{source:"https://github.com/huggingface/evaluate/blob/main/docs/source/package_reference/saving_methods.mdx"}}),{c(){n=x("meta"),g=p(),u=x("p"),o=p(),b(r.$$.fragment),a=p(),b(i.$$.fragment),I=p(),d=x("p"),d.textContent=Y,k=p(),b(h.$$.fragment),P=p(),m=x("div"),b(v.$$.fragment),A=p(),T=x("p"),T.textContent=B,L=p(),b($.$$.fragment),S=p(),b(_.$$.fragment),U=p(),E=x("p"),this.h()},l(t){const e=X("svelte-u9bgzb",document.head);n=y(e,"META",{name:!0,content:!0}),e.forEach(s),g=f(t),u=y(t,"P",{}),N(u).forEach(s),o=f(t),M(r.$$.fragment,t),a=f(t),M(i.$$.fragment,t),I=f(t),d=y(t,"P",{"data-svelte-h":!0}),V(d)!=="svelte-1yplxba"&&(d.textContent=Y),k=f(t),M(h.$$.fragment,t),P=f(t),m=y(t,"DIV",{class:!0});var c=N(m);M(v.$$.fragment,c),A=f(c),T=y(c,"P",{"data-svelte-h":!0}),V(T)!=="svelte-m5xhvn"&&(T.textContent=B),L=f(c),M($.$$.fragment,c),c.forEach(s),S=f(t),M(_.$$.fragment,t),U=f(t),E=y(t,"P",{}),N(E).forEach(s),this.h()},h(){Q(n,"name","hf:doc:metadata"),Q(n,"content",lt),Q(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,e){W(document.head,n),l(t,g,e),l(t,u,e),l(t,o,e),w(r,t,e),l(t,a,e),w(i,t,e),l(t,I,e),l(t,d,e),l(t,k,e),w(h,t,e),l(t,P,e),l(t,m,e),w(v,m,null),W(m,A),W(m,T),W(m,L),w($,m,null),l(t,S,e),w(_,t,e),l(t,U,e),l(t,E,e),H=!0},p(t,[e]){const c={};e&2&&(c.$$scope={dirty:e,ctx:t}),$.$set(c)},i(t){H||(j(r.$$.fragment,t),j(i.$$.fragment,t),j(h.$$.fragment,t),j(v.$$.fragment,t),j($.$$.fragment,t),j(_.$$.fragment,t),H=!0)},o(t){C(r.$$.fragment,t),C(i.$$.fragment,t),C(h.$$.fragment,t),C(v.$$.fragment,t),C($.$$.fragment,t),C(_.$$.fragment,t),H=!1},d(t){t&&(s(g),s(u),s(o),s(a),s(I),s(d),s(k),s(P),s(m),s(S),s(U),s(E)),s(n),J(r,t),J(i,t),J(h,t),J(v),J($),J(_,t)}}}const lt='{"title":"Saving methods","local":"saving-methods","sections":[{"title":"Save","local":"evaluate.save","sections":[],"depth":2}],"depth":1}';function ot(q){return D(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ct extends Z{constructor(n){super(),F(this,n,ot,nt,z,{})}}export{ct as component};
