import{s as It,o as Mt,n as Nt}from"../chunks/scheduler.bdbef820.js";import{S as yt,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 g,x as T,k as Et,y as kt,a,v as h,d,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),g(r.$$.fragment,n)},m(n,m){a(n,l,m),a(n,u,m),h(r,n,m),p=!0},p:Nt,i(n){p||(d(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),g(r.$$.fragment,n)},m(n,m){a(n,l,m),a(n,u,m),h(r,n,m),p=!0},p:Nt,i(n){p||(d(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,I,X,M,gt="This command:",W,y,ht="<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,dt="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,S,vt="For example:",it,B,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>,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.
    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"}}),I=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}}),B=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(),$(I.$$.fragment),X=i(),M=f("p"),M.textContent=gt,W=i(),y=f("ul"),y.innerHTML=ht,K=i(),A=f("p"),A.innerHTML=dt,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(),S=f("p"),S.textContent=vt,it=i(),$(B.$$.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),g(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),g(E.$$.fragment,t),R=o(t),g(H.$$.fragment,t),G=o(t),N=c(t,"P",{"data-svelte-h":!0}),T(N)!=="svelte-1fto6kc"&&(N.innerHTML=$t),O=o(t),g(I.$$.fragment,t),X=o(t),M=c(t,"P",{"data-svelte-h":!0}),T(M)!=="svelte-mqnrhx"&&(M.textContent=gt),W=o(t),y=c(t,"UL",{"data-svelte-h":!0}),T(y)!=="svelte-1ym59af"&&(y.innerHTML=ht),K=o(t),A=c(t,"P",{"data-svelte-h":!0}),T(A)!=="svelte-1jwscz8"&&(A.innerHTML=dt),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),g(P.$$.fragment,t),et=o(t),g(w.$$.fragment,t),st=o(t),g(Z.$$.fragment,t),at=o(t),U=c(t,"P",{"data-svelte-h":!0}),T(U)!=="svelte-8gqmjy"&&(U.innerHTML=Tt),nt=o(t),g(V.$$.fragment,t),lt=o(t),S=c(t,"P",{"data-svelte-h":!0}),T(S)!=="svelte-1gkqha7"&&(S.textContent=vt),it=o(t),g(B.$$.fragment,t),ot=o(t),g(x.$$.fragment,t),rt=o(t),g(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",St)},m(t,e){kt(document.head,l),a(t,v,e),a(t,u,e),a(t,r,e),h(p,t,e),a(t,n,e),a(t,m,e),a(t,Y,e),a(t,C,e),a(t,D,e),h(E,t,e),a(t,R,e),h(H,t,e),a(t,G,e),a(t,N,e),a(t,O,e),h(I,t,e),a(t,X,e),a(t,M,e),a(t,W,e),a(t,y,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),h(P,t,e),a(t,et,e),h(w,t,e),a(t,st,e),h(Z,t,e),a(t,at,e),a(t,U,e),a(t,nt,e),h(V,t,e),a(t,lt,e),a(t,S,e),a(t,it,e),h(B,t,e),a(t,ot,e),h(x,t,e),a(t,rt,e),h(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||(d(p.$$.fragment,t),d(E.$$.fragment,t),d(H.$$.fragment,t),d(I.$$.fragment,t),d(P.$$.fragment,t),d(w.$$.fragment,t),d(Z.$$.fragment,t),d(V.$$.fragment,t),d(B.$$.fragment,t),d(x.$$.fragment,t),d(L.$$.fragment,t),ut=!0)},o(t){_(p.$$.fragment,t),_(E.$$.fragment,t),_(H.$$.fragment,t),_(I.$$.fragment,t),_(P.$$.fragment,t),_(w.$$.fragment,t),_(Z.$$.fragment,t),_(V.$$.fragment,t),_(B.$$.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(M),s(W),s(y),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(S),s(it),s(ot),s(rt),s(pt),s(J)),s(l),b(p,t),b(E,t),b(H,t),b(I,t),b(P,t),b(w,t),b(Z,t),b(V,t),b(B,t),b(x,t),b(L,t)}}}const St='{"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 Bt(F){return Mt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Dt extends yt{constructor(l){super(),At(this,l,Bt,Vt,It,{})}}export{Dt as component};
