import{s as yt,o as It,n as Nt}from"../chunks/scheduler.bdbef820.js";import{S as Mt,i as At,g as f,s as i,r as $,A as jt,h as c,f as s,c as o,j as Ct,u as d,x as T,k as Et,y as kt,a,v as g,d as h,t as _,w as b}from"../chunks/index.c0aea24a.js";import{T as Ht}from"../chunks/Tip.31005f7d.js";import{C as q}from"../chunks/CodeBlock.6ccca92e.js";import{H as mt,E as Pt}from"../chunks/EditOnGithub.725ee0c1.js";function Zt(F){let l,v="Do not forget that you need to log in first to your Hugging Face account:",u,r,p;return r=new q({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4=",highlighted:"&gt;&gt;&gt; huggingface-cli login",wrap:!1}}),{c(){l=f("p"),l.textContent=v,u=i(),$(r.$$.fragment)},l(n){l=c(n,"P",{"data-svelte-h":!0}),T(l)!=="svelte-17k0t4w"&&(l.textContent=v),u=o(n),d(r.$$.fragment,n)},m(n,m){a(n,l,m),a(n,u,m),g(r,n,m),p=!0},p:Nt,i(n){p||(h(r.$$.fragment,n),p=!0)},o(n){_(r.$$.fragment,n),p=!1},d(n){n&&(s(l),s(u)),b(r,n)}}}function Ut(F){let l,v="Do not forget that you need to log in first to your Hugging Face account:",u,r,p;return r=new q({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4=",highlighted:"&gt;&gt;&gt; huggingface-cli login",wrap:!1}}),{c(){l=f("p"),l.textContent=v,u=i(),$(r.$$.fragment)},l(n){l=c(n,"P",{"data-svelte-h":!0}),T(l)!=="svelte-17k0t4w"&&(l.textContent=v),u=o(n),d(r.$$.fragment,n)},m(n,m){a(n,l,m),a(n,u,m),g(r,n,m),p=!0},p:Nt,i(n){p||(h(r.$$.fragment,n),p=!0)},o(n){_(r.$$.fragment,n),p=!1},d(n){n&&(s(l),s(u)),b(r,n)}}}function Vt(F){let l,v,u,r,p,n,m,ft="🤗 Datasets provides a command line interface (CLI) with useful shell commands to interact with your dataset.",Y,C,ct="You can check the available commands:",D,E,R,H,G,N,$t='Easily convert your Hub <a href="dataset_script">script-based dataset</a> to Parquet <a href="repository_structure">data-only dataset</a>, so that the dataset viewer will be supported.',O,y,X,I,dt="This command:",W,M,gt="<li>makes a copy of the script on the “main” branch into a dedicated branch called “script” (if it does not already exist)</li> <li>creates a pull request to the Hub dataset to convert it to Parquet files (and deletes the script from the main branch)</li>",K,A,ht="If in the future you need to recreate the Parquet files from the “script” branch, pass the <code>--revision script</code> argument.",z,j,_t="Note that you should pass the <code>--trust_remote_code</code> argument only if you trust the remote code to be executed locally on your machine.",Q,k,bt="For example:",tt,P,et,w,st,Z,at,U,Tt='Delete a dataset configuration from a <a href="repository_structure">data-only dataset</a> on the Hub.',nt,V,lt,B,vt="For example:",it,S,ot,x,rt,L,pt,J,ut;return p=new mt({props:{title:"Command Line Interface (CLI)",local:"command-line-interface-cli",headingTag:"h1"}}),E=new q({props:{code:"ZGF0YXNldHMtY2xpJTIwLS1oZWxwJTBBJTBB",highlighted:`&gt;&gt;&gt; datasets-cli --<span class="hljs-built_in">help</span>
usage: datasets-cli &lt;<span class="hljs-built_in">command</span>&gt; [&lt;args&gt;]

positional arguments:
  {convert,<span class="hljs-built_in">env</span>,<span class="hljs-built_in">test</span>,run_beam,dummy_data,convert_to_parquet}
                        datasets-cli <span class="hljs-built_in">command</span> helpers
    convert             Convert a TensorFlow Datasets dataset to a HuggingFace Datasets dataset.
    <span class="hljs-built_in">env</span>                 Print relevant system environment info.
    <span class="hljs-built_in">test</span>                Test dataset implementation.
    run_beam            Run a Beam dataset processing pipeline
    dummy_data          Generate dummy data.
    convert_to_parquet  Convert dataset to Parquet
    delete_from_hub     Delete dataset config from the Hub

optional arguments:
  -h, --<span class="hljs-built_in">help</span>            show this <span class="hljs-built_in">help</span> message and <span class="hljs-built_in">exit</span>`,wrap:!1}}),H=new mt({props:{title:"Convert to Parquet",local:"convert-to-parquet",headingTag:"h2"}}),y=new q({props:{code:"ZGF0YXNldHMtY2xpJTIwY29udmVydF90b19wYXJxdWV0JTIwLS1oZWxwJTBBJTBB",highlighted:`&gt;&gt;&gt; datasets-cli convert_to_parquet --<span class="hljs-built_in">help</span>
usage: datasets-cli &lt;<span class="hljs-built_in">command</span>&gt; [&lt;args&gt;] convert_to_parquet [-h] [--token TOKEN] [--revision REVISION] [--trust_remote_code] dataset_id

positional arguments:
  dataset_id           <span class="hljs-built_in">source</span> dataset ID, e.g. USERNAME/DATASET_NAME or ORGANIZATION/DATASET_NAME

optional arguments:
  -h, --<span class="hljs-built_in">help</span>           show this <span class="hljs-built_in">help</span> message and <span class="hljs-built_in">exit</span>
  --token TOKEN        access token to the Hugging Face Hub (defaults to logged-in user<span class="hljs-string">&#x27;s one)
  --revision REVISION  source revision
  --trust_remote_code  whether to trust the code execution of the load script</span>`,wrap:!1}}),P=new q({props:{code:"ZGF0YXNldHMtY2xpJTIwY29udmVydF90b19wYXJxdWV0JTIwVVNFUk5BTUUlMkZEQVRBU0VUX05BTUU=",highlighted:"&gt;&gt;&gt; datasets-cli convert_to_parquet USERNAME/DATASET_NAME",wrap:!1}}),w=new Ht({props:{$$slots:{default:[Zt]},$$scope:{ctx:F}}}),Z=new mt({props:{title:"Delete from Hub",local:"delete-from-hub",headingTag:"h2"}}),V=new q({props:{code:"ZGF0YXNldHMtY2xpJTIwZGVsZXRlX2Zyb21faHViJTIwLS1oZWxwJTBBJTBB",highlighted:`&gt;&gt;&gt; datasets-cli delete_from_hub --<span class="hljs-built_in">help</span>
usage: datasets-cli &lt;<span class="hljs-built_in">command</span>&gt; [&lt;args&gt;] delete_from_hub [-h] [--token TOKEN] [--revision REVISION] dataset_id config_name

positional arguments:
  dataset_id           <span class="hljs-built_in">source</span> dataset ID, e.g. USERNAME/DATASET_NAME or ORGANIZATION/DATASET_NAME
  config_name          config name to delete

optional arguments:
  -h, --<span class="hljs-built_in">help</span>           show this <span class="hljs-built_in">help</span> message and <span class="hljs-built_in">exit</span>
  --token TOKEN        access token to the Hugging Face Hub
  --revision REVISION  <span class="hljs-built_in">source</span> revision`,wrap:!1}}),S=new q({props:{code:"ZGF0YXNldHMtY2xpJTIwZGVsZXRlX2Zyb21faHViJTIwVVNFUk5BTUUlMkZEQVRBU0VUX05BTUUlMjBDT05GSUdfTkFNRQ==",highlighted:"&gt;&gt;&gt; datasets-cli delete_from_hub USERNAME/DATASET_NAME CONFIG_NAME",wrap:!1}}),x=new Ht({props:{$$slots:{default:[Ut]},$$scope:{ctx:F}}}),L=new Pt({props:{source:"https://github.com/huggingface/datasets/blob/main/docs/source/cli.mdx"}}),{c(){l=f("meta"),v=i(),u=f("p"),r=i(),$(p.$$.fragment),n=i(),m=f("p"),m.textContent=ft,Y=i(),C=f("p"),C.textContent=ct,D=i(),$(E.$$.fragment),R=i(),$(H.$$.fragment),G=i(),N=f("p"),N.innerHTML=$t,O=i(),$(y.$$.fragment),X=i(),I=f("p"),I.textContent=dt,W=i(),M=f("ul"),M.innerHTML=gt,K=i(),A=f("p"),A.innerHTML=ht,z=i(),j=f("p"),j.innerHTML=_t,Q=i(),k=f("p"),k.textContent=bt,tt=i(),$(P.$$.fragment),et=i(),$(w.$$.fragment),st=i(),$(Z.$$.fragment),at=i(),U=f("p"),U.innerHTML=Tt,nt=i(),$(V.$$.fragment),lt=i(),B=f("p"),B.textContent=vt,it=i(),$(S.$$.fragment),ot=i(),$(x.$$.fragment),rt=i(),$(L.$$.fragment),pt=i(),J=f("p"),this.h()},l(t){const e=jt("svelte-u9bgzb",document.head);l=c(e,"META",{name:!0,content:!0}),e.forEach(s),v=o(t),u=c(t,"P",{}),Ct(u).forEach(s),r=o(t),d(p.$$.fragment,t),n=o(t),m=c(t,"P",{"data-svelte-h":!0}),T(m)!=="svelte-5k5y0u"&&(m.textContent=ft),Y=o(t),C=c(t,"P",{"data-svelte-h":!0}),T(C)!=="svelte-phtvh9"&&(C.textContent=ct),D=o(t),d(E.$$.fragment,t),R=o(t),d(H.$$.fragment,t),G=o(t),N=c(t,"P",{"data-svelte-h":!0}),T(N)!=="svelte-1fto6kc"&&(N.innerHTML=$t),O=o(t),d(y.$$.fragment,t),X=o(t),I=c(t,"P",{"data-svelte-h":!0}),T(I)!=="svelte-mqnrhx"&&(I.textContent=dt),W=o(t),M=c(t,"UL",{"data-svelte-h":!0}),T(M)!=="svelte-1ym59af"&&(M.innerHTML=gt),K=o(t),A=c(t,"P",{"data-svelte-h":!0}),T(A)!=="svelte-1jwscz8"&&(A.innerHTML=ht),z=o(t),j=c(t,"P",{"data-svelte-h":!0}),T(j)!=="svelte-udzbny"&&(j.innerHTML=_t),Q=o(t),k=c(t,"P",{"data-svelte-h":!0}),T(k)!=="svelte-1gkqha7"&&(k.textContent=bt),tt=o(t),d(P.$$.fragment,t),et=o(t),d(w.$$.fragment,t),st=o(t),d(Z.$$.fragment,t),at=o(t),U=c(t,"P",{"data-svelte-h":!0}),T(U)!=="svelte-8gqmjy"&&(U.innerHTML=Tt),nt=o(t),d(V.$$.fragment,t),lt=o(t),B=c(t,"P",{"data-svelte-h":!0}),T(B)!=="svelte-1gkqha7"&&(B.textContent=vt),it=o(t),d(S.$$.fragment,t),ot=o(t),d(x.$$.fragment,t),rt=o(t),d(L.$$.fragment,t),pt=o(t),J=c(t,"P",{}),Ct(J).forEach(s),this.h()},h(){Et(l,"name","hf:doc:metadata"),Et(l,"content",Bt)},m(t,e){kt(document.head,l),a(t,v,e),a(t,u,e),a(t,r,e),g(p,t,e),a(t,n,e),a(t,m,e),a(t,Y,e),a(t,C,e),a(t,D,e),g(E,t,e),a(t,R,e),g(H,t,e),a(t,G,e),a(t,N,e),a(t,O,e),g(y,t,e),a(t,X,e),a(t,I,e),a(t,W,e),a(t,M,e),a(t,K,e),a(t,A,e),a(t,z,e),a(t,j,e),a(t,Q,e),a(t,k,e),a(t,tt,e),g(P,t,e),a(t,et,e),g(w,t,e),a(t,st,e),g(Z,t,e),a(t,at,e),a(t,U,e),a(t,nt,e),g(V,t,e),a(t,lt,e),a(t,B,e),a(t,it,e),g(S,t,e),a(t,ot,e),g(x,t,e),a(t,rt,e),g(L,t,e),a(t,pt,e),a(t,J,e),ut=!0},p(t,[e]){const wt={};e&2&&(wt.$$scope={dirty:e,ctx:t}),w.$set(wt);const xt={};e&2&&(xt.$$scope={dirty:e,ctx:t}),x.$set(xt)},i(t){ut||(h(p.$$.fragment,t),h(E.$$.fragment,t),h(H.$$.fragment,t),h(y.$$.fragment,t),h(P.$$.fragment,t),h(w.$$.fragment,t),h(Z.$$.fragment,t),h(V.$$.fragment,t),h(S.$$.fragment,t),h(x.$$.fragment,t),h(L.$$.fragment,t),ut=!0)},o(t){_(p.$$.fragment,t),_(E.$$.fragment,t),_(H.$$.fragment,t),_(y.$$.fragment,t),_(P.$$.fragment,t),_(w.$$.fragment,t),_(Z.$$.fragment,t),_(V.$$.fragment,t),_(S.$$.fragment,t),_(x.$$.fragment,t),_(L.$$.fragment,t),ut=!1},d(t){t&&(s(v),s(u),s(r),s(n),s(m),s(Y),s(C),s(D),s(R),s(G),s(N),s(O),s(X),s(I),s(W),s(M),s(K),s(A),s(z),s(j),s(Q),s(k),s(tt),s(et),s(st),s(at),s(U),s(nt),s(lt),s(B),s(it),s(ot),s(rt),s(pt),s(J)),s(l),b(p,t),b(E,t),b(H,t),b(y,t),b(P,t),b(w,t),b(Z,t),b(V,t),b(S,t),b(x,t),b(L,t)}}}const Bt='{"title":"Command Line Interface (CLI)","local":"command-line-interface-cli","sections":[{"title":"Convert to Parquet","local":"convert-to-parquet","sections":[],"depth":2},{"title":"Delete from Hub","local":"delete-from-hub","sections":[],"depth":2}],"depth":1}';function St(F){return It(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Dt extends Mt{constructor(l){super(),At(this,l,St,Vt,yt,{})}}export{Dt as component};
