import{s as we,o as Ee,n as ve}from"../chunks/scheduler.0cf4ef2e.js";import{S as Ie,i as Me,e as _,s as r,c as l,q as Ne,h as Ce,a as $,d as a,b as g,f as F,g as u,j as W,r as qe,k as V,l as E,m as s,n as p,t as h,o as f,p as m}from"../chunks/index.abc433bf.js";import{C as Se}from"../chunks/CopyLLMTxtMenu.efc6b005.js";import{D as ue}from"../chunks/Docstring.e4170f41.js";import{C as ye}from"../chunks/CodeBlock.00dcd05e.js";import{E as xe}from"../chunks/ExampleCodeBlock.9d6d4e26.js";import{H as B,E as Ue}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.86d448e2.js";function ke(G){let o,x="Example:",b,i,c;return i=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>, <span class="hljs-built_in">type</span>=<span class="hljs-string">&#x27;user&#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,b=r(),l(i.$$.fragment)},l(n){o=$(n,"P",{"data-svelte-h":!0}),W(o)!=="svelte-11lpom8"&&(o.textContent=x),b=g(n),u(i.$$.fragment,n)},m(n,d){s(n,o,d),s(n,b,d),p(i,n,d),c=!0},p:ve,i(n){c||(h(i.$$.fragment,n),c=!0)},o(n){f(i.$$.fragment,n),c=!1},d(n){n&&(a(o),a(b)),m(i,n)}}}function Te(G){let o,x="Value can be compared to a string:",b,i,c;return i=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,b=r(),l(i.$$.fragment)},l(n){o=$(n,"P",{"data-svelte-h":!0}),W(o)!=="svelte-141gd08"&&(o.textContent=x),b=g(n),u(i.$$.fragment,n)},m(n,d){s(n,o,d),s(n,b,d),p(i,n,d),c=!0},p:ve,i(n){c||(h(i.$$.fragment,n),c=!0)},o(n){f(i.$$.fragment,n),c=!1},d(n){n&&(a(o),a(b)),m(i,n)}}}function He(G){let o,x,b,i,c,n,d,X,I,de='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,M,_e='<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>',K,N,ee,C,te,J,q,pe,A,$e="Contains information about a Job.",he,y,ae,S,ne,U,k,se,T,oe,j,H,fe,Q,je="Enumeration of possible stage of a Job on the Hub.",me,w,be,re,L,ge,D,O,ie,R,ce,Z,le;return c=new Se({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),d=new B({props:{title:"Jobs",local:"jobs",headingTag:"h1"}}),N=new B({props:{title:"Data structures",local:"data-structures",headingTag:"h2"}}),C=new B({props:{title:"JobInfo",local:"huggingface_hub.JobInfo",headingTag:"h3"}}),q=new ue({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.owner",description:`<strong>owner</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;, type=&quot;user&quot;)</code>`,name:"owner"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_jobs_api.py#L59"}}),y=new xe({props:{anchor:"huggingface_hub.JobInfo.example",$$slots:{default:[ke]},$$scope:{ctx:G}}}),S=new B({props:{title:"JobOwner",local:"huggingface_hub.JobOwner",headingTag:"h3"}}),k=new ue({props:{name:"class huggingface_hub.JobOwner",anchor:"huggingface_hub.JobOwner",parameters:[{name:"id",val:": str"},{name:"name",val:": str"},{name:"type",val:": str"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_jobs_api.py#L52"}}),T=new B({props:{title:"JobStage",local:"huggingface_hub.JobStage",headingTag:"h3"}}),H=new ue({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"}}),w=new xe({props:{anchor:"huggingface_hub.JobStage.example",$$slots:{default:[Te]},$$scope:{ctx:G}}}),L=new B({props:{title:"JobStatus",local:"huggingface_hub.JobStatus",headingTag:"h3"}}),O=new ue({props:{name:"class huggingface_hub.JobStatus",anchor:"huggingface_hub.JobStatus",parameters:[{name:"stage",val:": JobStage"},{name:"message",val:": typing.Optional[str]"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_jobs_api.py#L46"}}),R=new Ue({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/en/package_reference/jobs.md"}}),{c(){o=_("meta"),x=r(),b=_("p"),i=r(),l(c.$$.fragment),n=r(),l(d.$$.fragment),X=r(),I=_("p"),I.innerHTML=de,Y=r(),M=_("ul"),M.innerHTML=_e,K=r(),l(N.$$.fragment),ee=r(),l(C.$$.fragment),te=r(),J=_("div"),l(q.$$.fragment),pe=r(),A=_("p"),A.textContent=$e,he=r(),l(y.$$.fragment),ae=r(),l(S.$$.fragment),ne=r(),U=_("div"),l(k.$$.fragment),se=r(),l(T.$$.fragment),oe=r(),j=_("div"),l(H.$$.fragment),fe=r(),Q=_("p"),Q.textContent=je,me=r(),l(w.$$.fragment),be=Ne("\nPossible values are: `COMPLETED`, `CANCELED`, `ERROR`, `DELETED`, `RUNNING`.\nTaken from https://github.com/huggingface/moon-landing/blob/main/server/job_types/JobInfo.ts#L61 (private url)."),re=r(),l(L.$$.fragment),ge=r(),D=_("div"),l(O.$$.fragment),ie=r(),l(R.$$.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),b=$(e,"P",{}),F(b).forEach(a),i=g(e),u(c.$$.fragment,e),n=g(e),u(d.$$.fragment,e),X=g(e),I=$(e,"P",{"data-svelte-h":!0}),W(I)!=="svelte-ugj36q"&&(I.innerHTML=de),Y=g(e),M=$(e,"UL",{"data-svelte-h":!0}),W(M)!=="svelte-s5msxg"&&(M.innerHTML=_e),K=g(e),u(N.$$.fragment,e),ee=g(e),u(C.$$.fragment,e),te=g(e),J=$(e,"DIV",{class:!0});var v=F(J);u(q.$$.fragment,v),pe=g(v),A=$(v,"P",{"data-svelte-h":!0}),W(A)!=="svelte-246v5o"&&(A.textContent=$e),he=g(v),u(y.$$.fragment,v),v.forEach(a),ae=g(e),u(S.$$.fragment,e),ne=g(e),U=$(e,"DIV",{class:!0});var z=F(U);u(k.$$.fragment,z),z.forEach(a),se=g(e),u(T.$$.fragment,e),oe=g(e),j=$(e,"DIV",{class:!0});var P=F(j);u(H.$$.fragment,P),fe=g(P),Q=$(P,"P",{"data-svelte-h":!0}),W(Q)!=="svelte-1uwa6yp"&&(Q.textContent=je),me=g(P),u(w.$$.fragment,P),be=qe(P,"\nPossible values are: `COMPLETED`, `CANCELED`, `ERROR`, `DELETED`, `RUNNING`.\nTaken from https://github.com/huggingface/moon-landing/blob/main/server/job_types/JobInfo.ts#L61 (private url)."),P.forEach(a),re=g(e),u(L.$$.fragment,e),ge=g(e),D=$(e,"DIV",{class:!0});var Je=F(D);u(O.$$.fragment,Je),Je.forEach(a),ie=g(e),u(R.$$.fragment,e),ce=g(e),Z=$(e,"P",{}),F(Z).forEach(a),this.h()},h(){V(o,"name","hf:doc:metadata"),V(o,"content",Le),V(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),V(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),V(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),V(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){E(document.head,o),s(e,x,t),s(e,b,t),s(e,i,t),p(c,e,t),s(e,n,t),p(d,e,t),s(e,X,t),s(e,I,t),s(e,Y,t),s(e,M,t),s(e,K,t),p(N,e,t),s(e,ee,t),p(C,e,t),s(e,te,t),s(e,J,t),p(q,J,null),E(J,pe),E(J,A),E(J,he),p(y,J,null),s(e,ae,t),p(S,e,t),s(e,ne,t),s(e,U,t),p(k,U,null),s(e,se,t),p(T,e,t),s(e,oe,t),s(e,j,t),p(H,j,null),E(j,fe),E(j,Q),E(j,me),p(w,j,null),E(j,be),s(e,re,t),p(L,e,t),s(e,ge,t),s(e,D,t),p(O,D,null),s(e,ie,t),p(R,e,t),s(e,ce,t),s(e,Z,t),le=!0},p(e,[t]){const v={};t&2&&(v.$$scope={dirty:t,ctx:e}),y.$set(v);const z={};t&2&&(z.$$scope={dirty:t,ctx:e}),w.$set(z)},i(e){le||(h(c.$$.fragment,e),h(d.$$.fragment,e),h(N.$$.fragment,e),h(C.$$.fragment,e),h(q.$$.fragment,e),h(y.$$.fragment,e),h(S.$$.fragment,e),h(k.$$.fragment,e),h(T.$$.fragment,e),h(H.$$.fragment,e),h(w.$$.fragment,e),h(L.$$.fragment,e),h(O.$$.fragment,e),h(R.$$.fragment,e),le=!0)},o(e){f(c.$$.fragment,e),f(d.$$.fragment,e),f(N.$$.fragment,e),f(C.$$.fragment,e),f(q.$$.fragment,e),f(y.$$.fragment,e),f(S.$$.fragment,e),f(k.$$.fragment,e),f(T.$$.fragment,e),f(H.$$.fragment,e),f(w.$$.fragment,e),f(L.$$.fragment,e),f(O.$$.fragment,e),f(R.$$.fragment,e),le=!1},d(e){e&&(a(x),a(b),a(i),a(n),a(X),a(I),a(Y),a(M),a(K),a(ee),a(te),a(J),a(ae),a(ne),a(U),a(se),a(oe),a(j),a(re),a(ge),a(D),a(ie),a(ce),a(Z)),a(o),m(c,e),m(d,e),m(N,e),m(C,e),m(q),m(y),m(S,e),m(k),m(T,e),m(H),m(w),m(L,e),m(O),m(R,e)}}}const Le='{"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 De(G){return Ee(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ve extends Ie{constructor(o){super(),Me(this,o,De,He,we,{})}}export{Ve as component};
