import{s as we,o as Ie,n as ve}from"../chunks/scheduler.6062bdaf.js";import{S as Me,i as qe,g as _,s as r,r as p,A as Ce,h as $,f as a,c as g,j as V,u as h,x as A,k as B,y,a as s,v as f,d as m,t as b,w as d}from"../chunks/index.4bca734e.js";import{D as le}from"../chunks/Docstring.b6251191.js";import{C as ye}from"../chunks/CodeBlock.cbbddafc.js";import{E as xe}from"../chunks/ExampleCodeBlock.8d71e6b1.js";import{H as W,E as Ne}from"../chunks/getInferenceSnippets.b564dd8b.js";function ke(O){let o,x="Example:",l,c,i;return c=new ye({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMHJ1bl9qb2IlMEFqb2IlMjAlM0QlMjBydW5fam9iKCUwQSUyMCUyMCUyMCUyMGltYWdlJTNEJTIycHl0aG9uJTNBMy4xMiUyMiUyQyUwQSUyMCUyMCUyMCUyMGNvbW1hbmQlM0QlNUIlMjJweXRob24lMjIlMkMlMjAlMjItYyUyMiUyQyUyMCUyMnByaW50KCdIZWxsbyUyMGZyb20lMjB0aGUlMjBjbG91ZCEnKSUyMiU1RCUwQSklMEFqb2IlMEFqb2IuaWQlMEFqb2IudXJsJTBBam9iLnN0YXR1cy5zdGFnZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> run_job
<span class="hljs-meta">&gt;&gt;&gt; </span>job = run_job(
<span class="hljs-meta">... </span>    image=<span class="hljs-string">&quot;python:3.12&quot;</span>,
<span class="hljs-meta">... </span>    command=[<span class="hljs-string">&quot;python&quot;</span>, <span class="hljs-string">&quot;-c&quot;</span>, <span class="hljs-string">&quot;print(&#x27;Hello from the cloud!&#x27;)&quot;</span>]
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>job
JobInfo(<span class="hljs-built_in">id</span>=<span class="hljs-string">&#x27;687fb701029421ae5549d998&#x27;</span>, created_at=datetime.datetime(<span class="hljs-number">2025</span>, <span class="hljs-number">7</span>, <span class="hljs-number">22</span>, <span class="hljs-number">16</span>, <span class="hljs-number">6</span>, <span class="hljs-number">25</span>, <span class="hljs-number">79000</span>, tzinfo=datetime.timezone.utc), docker_image=<span class="hljs-string">&#x27;python:3.12&#x27;</span>, space_id=<span class="hljs-literal">None</span>, command=[<span class="hljs-string">&#x27;python&#x27;</span>, <span class="hljs-string">&#x27;-c&#x27;</span>, <span class="hljs-string">&quot;print(&#x27;Hello from the cloud!&#x27;)&quot;</span>], arguments=[], environment={}, secrets={}, flavor=<span class="hljs-string">&#x27;cpu-basic&#x27;</span>, status=JobStatus(stage=<span class="hljs-string">&#x27;RUNNING&#x27;</span>, message=<span class="hljs-literal">None</span>), owner=JobOwner(<span class="hljs-built_in">id</span>=<span class="hljs-string">&#x27;5e9ecfc04957053f60648a3e&#x27;</span>, name=<span class="hljs-string">&#x27;lhoestq&#x27;</span>), endpoint=<span class="hljs-string">&#x27;https://huggingface.co&#x27;</span>, url=<span class="hljs-string">&#x27;https://huggingface.co/jobs/lhoestq/687fb701029421ae5549d998&#x27;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>job.<span class="hljs-built_in">id</span>
<span class="hljs-string">&#x27;687fb701029421ae5549d998&#x27;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>job.url
<span class="hljs-string">&#x27;https://huggingface.co/jobs/lhoestq/687fb701029421ae5549d998&#x27;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>job.status.stage
<span class="hljs-string">&#x27;RUNNING&#x27;</span>`,wrap:!1}}),{c(){o=_("p"),o.textContent=x,l=r(),p(c.$$.fragment)},l(n){o=$(n,"P",{"data-svelte-h":!0}),A(o)!=="svelte-11lpom8"&&(o.textContent=x),l=g(n),h(c.$$.fragment,n)},m(n,u){s(n,o,u),s(n,l,u),f(c,n,u),i=!0},p:ve,i(n){i||(m(c.$$.fragment,n),i=!0)},o(n){b(c.$$.fragment,n),i=!1},d(n){n&&(a(o),a(l)),d(c,n)}}}function Se(O){let o,x="Value can be compared to a string:",l,c,i;return c=new ye({props:{code:"YXNzZXJ0JTIwSm9iU3RhZ2UuQ09NUExFVEVEJTIwJTNEJTNEJTIwJTIyQ09NUExFVEVEJTIy",highlighted:'<span class="hljs-keyword">assert</span> JobStage.COMPLETED == <span class="hljs-string">&quot;COMPLETED&quot;</span>',wrap:!1}}),{c(){o=_("p"),o.textContent=x,l=r(),p(c.$$.fragment)},l(n){o=$(n,"P",{"data-svelte-h":!0}),A(o)!=="svelte-141gd08"&&(o.textContent=x),l=g(n),h(c.$$.fragment,n)},m(n,u){s(n,o,u),s(n,l,u),f(c,n,u),i=!0},p:ve,i(n){i||(m(c.$$.fragment,n),i=!0)},o(n){b(c.$$.fragment,n),i=!1},d(n){n&&(a(o),a(l)),d(c,n)}}}function Ue(O){let o,x,l,c,i,n,u,be='Check the <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi">HfApi</a> documentation page for the reference of methods to manage your Jobs on the Hub.',Y,q,de='<li>Run a Job: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.run_job">run_job()</a></li> <li>Fetch logs: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.fetch_job_logs">fetch_job_logs()</a></li> <li>Inspect Job: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.inspect_job">inspect_job()</a></li> <li>List Jobs: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.list_jobs">list_jobs()</a></li> <li>Cancel Job: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.cancel_job">cancel_job()</a></li> <li>Run a UV Job: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.run_uv_job">run_uv_job()</a></li>',z,C,K,N,ee,J,k,ue,Q,_e="Contains information about a Job.",pe,w,te,S,ae,U,E,ne,T,se,j,H,he,F,$e="Enumeration of possible stage of a Job on the Hub.",fe,I,me,R,je='Taken from <a href="https://github.com/huggingface/moon-landing/blob/main/server/job_types/JobInfo.ts#L61" rel="nofollow">https://github.com/huggingface/moon-landing/blob/main/server/job_types/JobInfo.ts#L61</a> (private url).',oe,L,re,D,G,ge,P,ce,Z,ie;return i=new W({props:{title:"Jobs",local:"jobs",headingTag:"h1"}}),C=new W({props:{title:"Data structures",local:"data-structures",headingTag:"h2"}}),N=new W({props:{title:"JobInfo",local:"huggingface_hub.JobInfo",headingTag:"h3"}}),k=new le({props:{name:"class huggingface_hub.JobInfo",anchor:"huggingface_hub.JobInfo",parameters:[{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.JobInfo.id",description:`<strong>id</strong> (<code>str</code>) &#x2014;
Job ID.`,name:"id"},{anchor:"huggingface_hub.JobInfo.created_at",description:`<strong>created_at</strong> (<code>datetime</code> or <code>None</code>) &#x2014;
When the Job was created.`,name:"created_at"},{anchor:"huggingface_hub.JobInfo.docker_image",description:`<strong>docker_image</strong> (<code>str</code> or <code>None</code>) &#x2014;
The Docker image from Docker Hub used for the Job.
Can be None if space_id is present instead.`,name:"docker_image"},{anchor:"huggingface_hub.JobInfo.space_id",description:`<strong>space_id</strong> (<code>str</code> or <code>None</code>) &#x2014;
The Docker image from Hugging Face Spaces used for the Job.
Can be None if docker_image is present instead.`,name:"space_id"},{anchor:"huggingface_hub.JobInfo.command",description:`<strong>command</strong> (<code>List[str]</code> or <code>None</code>) &#x2014;
Command of the Job, e.g. <code>[&quot;python&quot;, &quot;-c&quot;, &quot;print(&apos;hello world&apos;)&quot;]</code>`,name:"command"},{anchor:"huggingface_hub.JobInfo.arguments",description:`<strong>arguments</strong> (<code>List[str]</code> or <code>None</code>) &#x2014;
Arguments passed to the command`,name:"arguments"},{anchor:"huggingface_hub.JobInfo.environment",description:`<strong>environment</strong> (<code>Dict[str]</code> or <code>None</code>) &#x2014;
Environment variables of the Job as a dictionary.`,name:"environment"},{anchor:"huggingface_hub.JobInfo.secrets",description:`<strong>secrets</strong> (<code>Dict[str]</code> or <code>None</code>) &#x2014;
Secret environment variables of the Job (encrypted).`,name:"secrets"},{anchor:"huggingface_hub.JobInfo.flavor",description:`<strong>flavor</strong> (<code>str</code> or <code>None</code>) &#x2014;
Flavor for the hardware, as in Hugging Face Spaces. See <a href="/docs/huggingface_hub/main/en/package_reference/space_runtime#huggingface_hub.SpaceHardware">SpaceHardware</a> for possible values.
E.g. <code>&quot;cpu-basic&quot;</code>.`,name:"flavor"},{anchor:"huggingface_hub.JobInfo.status",description:`<strong>status</strong> &#x2014; (<code>JobStatus</code> or <code>None</code>):
Status of the Job, e.g. <code>JobStatus(stage=&quot;RUNNING&quot;, message=None)</code>
See <a href="/docs/huggingface_hub/main/en/package_reference/jobs#huggingface_hub.JobStage">JobStage</a> for possible stage values.`,name:"status"},{anchor:"huggingface_hub.JobInfo.status",description:`<strong>status</strong> &#x2014; (<code>JobOwner</code> or <code>None</code>):
Owner of the Job, e.g. <code>JobOwner(id=&quot;5e9ecfc04957053f60648a3e&quot;, name=&quot;lhoestq&quot;)</code>`,name:"status"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_jobs_api.py#L61"}}),w=new xe({props:{anchor:"huggingface_hub.JobInfo.example",$$slots:{default:[ke]},$$scope:{ctx:O}}}),S=new W({props:{title:"JobOwner",local:"huggingface_hub.JobOwner",headingTag:"h3"}}),E=new le({props:{name:"class huggingface_hub.JobOwner",anchor:"huggingface_hub.JobOwner",parameters:[{name:"id",val:": str"},{name:"name",val:": str"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_jobs_api.py#L55"}}),T=new W({props:{title:"JobStage",local:"huggingface_hub.JobStage",headingTag:"h3"}}),H=new le({props:{name:"class huggingface_hub.JobStage",anchor:"huggingface_hub.JobStage",parameters:[{name:"value",val:""},{name:"names",val:" = None"},{name:"module",val:" = None"},{name:"qualname",val:" = None"},{name:"type",val:" = None"},{name:"start",val:" = 1"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_jobs_api.py#L25"}}),I=new xe({props:{anchor:"huggingface_hub.JobStage.example",$$slots:{default:[Se]},$$scope:{ctx:O}}}),L=new W({props:{title:"JobStatus",local:"huggingface_hub.JobStatus",headingTag:"h3"}}),G=new le({props:{name:"class huggingface_hub.JobStatus",anchor:"huggingface_hub.JobStatus",parameters:[{name:"**kwargs",val:""}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_jobs_api.py#L45"}}),P=new Ne({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/en/package_reference/jobs.md"}}),{c(){o=_("meta"),x=r(),l=_("p"),c=r(),p(i.$$.fragment),n=r(),u=_("p"),u.innerHTML=be,Y=r(),q=_("ul"),q.innerHTML=de,z=r(),p(C.$$.fragment),K=r(),p(N.$$.fragment),ee=r(),J=_("div"),p(k.$$.fragment),ue=r(),Q=_("p"),Q.textContent=_e,pe=r(),p(w.$$.fragment),te=r(),p(S.$$.fragment),ae=r(),U=_("div"),p(E.$$.fragment),ne=r(),p(T.$$.fragment),se=r(),j=_("div"),p(H.$$.fragment),he=r(),F=_("p"),F.textContent=$e,fe=r(),p(I.$$.fragment),me=r(),R=_("p"),R.innerHTML=je,oe=r(),p(L.$$.fragment),re=r(),D=_("div"),p(G.$$.fragment),ge=r(),p(P.$$.fragment),ce=r(),Z=_("p"),this.h()},l(e){const t=Ce("svelte-u9bgzb",document.head);o=$(t,"META",{name:!0,content:!0}),t.forEach(a),x=g(e),l=$(e,"P",{}),V(l).forEach(a),c=g(e),h(i.$$.fragment,e),n=g(e),u=$(e,"P",{"data-svelte-h":!0}),A(u)!=="svelte-ugj36q"&&(u.innerHTML=be),Y=g(e),q=$(e,"UL",{"data-svelte-h":!0}),A(q)!=="svelte-s5msxg"&&(q.innerHTML=de),z=g(e),h(C.$$.fragment,e),K=g(e),h(N.$$.fragment,e),ee=g(e),J=$(e,"DIV",{class:!0});var v=V(J);h(k.$$.fragment,v),ue=g(v),Q=$(v,"P",{"data-svelte-h":!0}),A(Q)!=="svelte-246v5o"&&(Q.textContent=_e),pe=g(v),h(w.$$.fragment,v),v.forEach(a),te=g(e),h(S.$$.fragment,e),ae=g(e),U=$(e,"DIV",{class:!0});var X=V(U);h(E.$$.fragment,X),X.forEach(a),ne=g(e),h(T.$$.fragment,e),se=g(e),j=$(e,"DIV",{class:!0});var M=V(j);h(H.$$.fragment,M),he=g(M),F=$(M,"P",{"data-svelte-h":!0}),A(F)!=="svelte-1uwa6yp"&&(F.textContent=$e),fe=g(M),h(I.$$.fragment,M),me=g(M),R=$(M,"P",{"data-svelte-h":!0}),A(R)!=="svelte-52qg65"&&(R.innerHTML=je),M.forEach(a),oe=g(e),h(L.$$.fragment,e),re=g(e),D=$(e,"DIV",{class:!0});var Je=V(D);h(G.$$.fragment,Je),Je.forEach(a),ge=g(e),h(P.$$.fragment,e),ce=g(e),Z=$(e,"P",{}),V(Z).forEach(a),this.h()},h(){B(o,"name","hf:doc:metadata"),B(o,"content",Ee),B(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(D,"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,t){y(document.head,o),s(e,x,t),s(e,l,t),s(e,c,t),f(i,e,t),s(e,n,t),s(e,u,t),s(e,Y,t),s(e,q,t),s(e,z,t),f(C,e,t),s(e,K,t),f(N,e,t),s(e,ee,t),s(e,J,t),f(k,J,null),y(J,ue),y(J,Q),y(J,pe),f(w,J,null),s(e,te,t),f(S,e,t),s(e,ae,t),s(e,U,t),f(E,U,null),s(e,ne,t),f(T,e,t),s(e,se,t),s(e,j,t),f(H,j,null),y(j,he),y(j,F),y(j,fe),f(I,j,null),y(j,me),y(j,R),s(e,oe,t),f(L,e,t),s(e,re,t),s(e,D,t),f(G,D,null),s(e,ge,t),f(P,e,t),s(e,ce,t),s(e,Z,t),ie=!0},p(e,[t]){const v={};t&2&&(v.$$scope={dirty:t,ctx:e}),w.$set(v);const X={};t&2&&(X.$$scope={dirty:t,ctx:e}),I.$set(X)},i(e){ie||(m(i.$$.fragment,e),m(C.$$.fragment,e),m(N.$$.fragment,e),m(k.$$.fragment,e),m(w.$$.fragment,e),m(S.$$.fragment,e),m(E.$$.fragment,e),m(T.$$.fragment,e),m(H.$$.fragment,e),m(I.$$.fragment,e),m(L.$$.fragment,e),m(G.$$.fragment,e),m(P.$$.fragment,e),ie=!0)},o(e){b(i.$$.fragment,e),b(C.$$.fragment,e),b(N.$$.fragment,e),b(k.$$.fragment,e),b(w.$$.fragment,e),b(S.$$.fragment,e),b(E.$$.fragment,e),b(T.$$.fragment,e),b(H.$$.fragment,e),b(I.$$.fragment,e),b(L.$$.fragment,e),b(G.$$.fragment,e),b(P.$$.fragment,e),ie=!1},d(e){e&&(a(x),a(l),a(c),a(n),a(u),a(Y),a(q),a(z),a(K),a(ee),a(J),a(te),a(ae),a(U),a(ne),a(se),a(j),a(oe),a(re),a(D),a(ge),a(ce),a(Z)),a(o),d(i,e),d(C,e),d(N,e),d(k),d(w),d(S,e),d(E),d(T,e),d(H),d(I),d(L,e),d(G),d(P,e)}}}const Ee='{"title":"Jobs","local":"jobs","sections":[{"title":"Data structures","local":"data-structures","sections":[{"title":"JobInfo","local":"huggingface_hub.JobInfo","sections":[],"depth":3},{"title":"JobOwner","local":"huggingface_hub.JobOwner","sections":[],"depth":3},{"title":"JobStage","local":"huggingface_hub.JobStage","sections":[],"depth":3},{"title":"JobStatus","local":"huggingface_hub.JobStatus","sections":[],"depth":3}],"depth":2}],"depth":1}';function Te(O){return Ie(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Oe extends Me{constructor(o){super(),qe(this,o,Te,Ue,we,{})}}export{Oe as component};
