import{s as Q,o as R,n as Z}from"../chunks/scheduler.7da89386.js";import{S as A,i as S,g as b,s as d,r as T,A as z,h as J,f as s,c as p,j as U,u as $,x as N,k as D,y as W,a as n,v as y,d as x,t as I,w as j}from"../chunks/index.20910acc.js";import{D as L}from"../chunks/Docstring.f0851586.js";import{C as Y}from"../chunks/CodeBlock.143bd81e.js";import{E as O}from"../chunks/ExampleCodeBlock.d74eb35c.js";import{H as F,E as K}from"../chunks/getInferenceSnippets.217b4024.js";function tt(k){let o,_="Example:",m,r,l;return r=new Y({props:{code:"cHVzaF90b19odWIoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QlMjJodWdnaW5nZmFjZSUyRmdwdDItd2lraXRleHQyJTIyJTJDJTBBJTIwJTIwJTIwJTIwbWV0cmljX3ZhbHVlJTNEMC41JTBBJTIwJTIwJTIwJTIwbWV0cmljX3R5cGUlM0QlMjJibGV1JTIyJTJDJTBBJTIwJTIwJTIwJTIwbWV0cmljX25hbWUlM0QlMjJCTEVVJTIyJTJDJTBBJTIwJTIwJTIwJTIwZGF0YXNldF9uYW1lJTNEJTIyV2lraVRleHQlMjIlMkMlMEElMjAlMjAlMjAlMjBkYXRhc2V0X3R5cGUlM0QlMjJ3aWtpdGV4dCUyMiUyQyUwQSUyMCUyMCUyMCUyMGRhdGFzZXRfc3BsaXQlM0QlMjJ0ZXN0JTIyJTJDJTBBJTIwJTIwJTIwJTIwdGFza190eXBlJTNEJTIydGV4dC1nZW5lcmF0aW9uJTIyJTJDJTBBJTIwJTIwJTIwJTIwdGFza19uYW1lJTNEJTIyVGV4dCUyMEdlbmVyYXRpb24lMjIlMEEp",highlighted:`>>> push_to_hub(
... model_id="huggingface/gpt2-wikitext2",
... metric_value=0.5
... metric_type="bleu",
... metric_name="BLEU",
... dataset_name="WikiText",
... dataset_type="wikitext",
... dataset_split="test",
... task_type="text-generation",
... task_name="Text Generation"
... )`,wrap:!1}}),{c(){o=b("p"),o.textContent=_,m=d(),T(r.$$.fragment)},l(a){o=J(a,"P",{"data-svelte-h":!0}),N(o)!=="svelte-11lpom8"&&(o.textContent=_),m=p(a),$(r.$$.fragment,a)},m(a,i){n(a,o,i),n(a,m,i),y(r,a,i),l=!0},p:Z,i(a){l||(x(r.$$.fragment,a),l=!0)},o(a){I(r.$$.fragment,a),l=!1},d(a){a&&(s(o),s(m)),j(r,a)}}}function et(k){let o,_,m,r,l,a,i,H="Methods for using the Hugging Face Hub:",C,g,E,c,f,G,w,X="Pushes the result of a metric to the metadata of a model repository in the Hub.",P,h,B,v,q,M,V;return l=new F({props:{title:"Hub methods",local:"hub-methods",headingTag:"h1"}}),g=new F({props:{title:"Push to hub",local:"evaluate.push_to_hub",headingTag:"h2"}}),f=new L({props:{name:"evaluate.push_to_hub",anchor:"evaluate.push_to_hub",parameters:[{name:"model_id",val:": str"},{name:"task_type",val:": str"},{name:"dataset_type",val:": str"},{name:"dataset_name",val:": str"},{name:"metric_type",val:": str"},{name:"metric_name",val:": str"},{name:"metric_value",val:": float"},{name:"task_name",val:": str = None"},{name:"dataset_config",val:": str = None"},{name:"dataset_split",val:": str = None"},{name:"dataset_revision",val:": str = None"},{name:"dataset_args",val:": typing.Dict[str, int] = None"},{name:"metric_config",val:": str = None"},{name:"metric_args",val:": typing.Dict[str, int] = None"},{name:"overwrite",val:": bool = False"}],parametersDescription:[{anchor:"evaluate.push_to_hub.model_id",description:`model_id (str
) —
Model id from https://hf.co/models.`,name:"model_id"},{anchor:"evaluate.push_to_hub.task_type",description:`task_type (str
) —
Task id, refer to the Hub allowed tasks for allowed values.`,name:"task_type"},{anchor:"evaluate.push_to_hub.dataset_type",description:`dataset_type (str
) —
Dataset id from https://hf.co/datasets.`,name:"dataset_type"},{anchor:"evaluate.push_to_hub.dataset_name",description:`dataset_name (str
) —
Pretty name for the dataset.`,name:"dataset_name"},{anchor:"evaluate.push_to_hub.metric_type",description:`metric_type (str
) —
Metric id from https://hf.co/metrics.`,name:"metric_type"},{anchor:"evaluate.push_to_hub.metric_name",description:`metric_name (str
) —
Pretty name for the metric.`,name:"metric_name"},{anchor:"evaluate.push_to_hub.metric_value",description:`metric_value (float
) —
Computed metric value.`,name:"metric_value"},{anchor:"evaluate.push_to_hub.task_name",description:`task_name (str
, optional) —
Pretty name for the task.`,name:"task_name"},{anchor:"evaluate.push_to_hub.dataset_config",description:`dataset_config (str
, optional) —
Dataset configuration used in load_dataset.
See load_dataset for more info.`,name:"dataset_config"},{anchor:"evaluate.push_to_hub.dataset_split",description:`dataset_split (str
, optional) —
Name of split used for metric computation.`,name:"dataset_split"},{anchor:"evaluate.push_to_hub.dataset_revision",description:`dataset_revision (str
, optional) —
Git hash for the specific version of the dataset.`,name:"dataset_revision"},{anchor:"evaluate.push_to_hub.dataset_args",description:`dataset_args (dict[str, int]
, optional) —
Additional arguments passed to load_dataset.`,name:"dataset_args"},{anchor:"evaluate.push_to_hub.metric_config",description:`metric_config (str
, optional) —
Configuration for the metric (e.g. the GLUE metric has a configuration for each subset).`,name:"metric_config"},{anchor:"evaluate.push_to_hub.metric_args",description:`metric_args (dict[str, int]
, optional) —
Arguments passed during compute().`,name:"metric_args"},{anchor:"evaluate.push_to_hub.overwrite",description:`overwrite (bool
, optional, defaults to False
) —
If set to True
an existing metric field can be overwritten, otherwise
attempting to overwrite any existing fields will cause an error.`,name:"overwrite"}],source:"https://github.com/huggingface/evaluate/blob/v0.4.5/src/evaluate/hub.py#L14"}}),h=new O({props:{anchor:"evaluate.push_to_hub.example",$$slots:{default:[tt]},$$scope:{ctx:k}}}),v=new K({props:{source:"https://github.com/huggingface/evaluate/blob/main/docs/source/package_reference/hub_methods.mdx"}}),{c(){o=b("meta"),_=d(),m=b("p"),r=d(),T(l.$$.fragment),a=d(),i=b("p"),i.textContent=H,C=d(),T(g.$$.fragment),E=d(),c=b("div"),T(f.$$.fragment),G=d(),w=b("p"),w.textContent=X,P=d(),T(h.$$.fragment),B=d(),T(v.$$.fragment),q=d(),M=b("p"),this.h()},l(t){const e=z("svelte-u9bgzb",document.head);o=J(e,"META",{name:!0,content:!0}),e.forEach(s),_=p(t),m=J(t,"P",{}),U(m).forEach(s),r=p(t),$(l.$$.fragment,t),a=p(t),i=J(t,"P",{"data-svelte-h":!0}),N(i)!=="svelte-11qexm1"&&(i.textContent=H),C=p(t),$(g.$$.fragment,t),E=p(t),c=J(t,"DIV",{class:!0});var u=U(c);$(f.$$.fragment,u),G=p(u),w=J(u,"P",{"data-svelte-h":!0}),N(w)!=="svelte-gnsh13"&&(w.textContent=X),P=p(u),$(h.$$.fragment,u),u.forEach(s),B=p(t),$(v.$$.fragment,t),q=p(t),M=J(t,"P",{}),U(M).forEach(s),this.h()},h(){D(o,"name","hf:doc:metadata"),D(o,"content",at),D(c,"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,o),n(t,_,e),n(t,m,e),n(t,r,e),y(l,t,e),n(t,a,e),n(t,i,e),n(t,C,e),y(g,t,e),n(t,E,e),n(t,c,e),y(f,c,null),W(c,G),W(c,w),W(c,P),y(h,c,null),n(t,B,e),y(v,t,e),n(t,q,e),n(t,M,e),V=!0},p(t,[e]){const u={};e&2&&(u.$$scope={dirty:e,ctx:t}),h.$set(u)},i(t){V||(x(l.$$.fragment,t),x(g.$$.fragment,t),x(f.$$.fragment,t),x(h.$$.fragment,t),x(v.$$.fragment,t),V=!0)},o(t){I(l.$$.fragment,t),I(g.$$.fragment,t),I(f.$$.fragment,t),I(h.$$.fragment,t),I(v.$$.fragment,t),V=!1},d(t){t&&(s(_),s(m),s(r),s(a),s(i),s(C),s(E),s(c),s(B),s(q),s(M)),s(o),j(l,t),j(g,t),j(f),j(h),j(v,t)}}}const at='{"title":"Hub methods","local":"hub-methods","sections":[{"title":"Push to hub","local":"evaluate.push_to_hub","sections":[],"depth":2}],"depth":1}';function st(k){return R(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class mt extends A{constructor(o){super(),S(this,o,st,et,Q,{})}}export{mt as component};