Buckets:
| import{s as ct,n as pt,o as dt}from"../chunks/scheduler.258d2a4d.js";import{S as ht,i as ut,e as i,s as n,c,h as gt,a as o,d as e,b as l,f as it,g as p,j as _,k as ot,l as Tt,m as a,n as d,t as h,o as u,p as g}from"../chunks/index.421344fd.js";import{C as mt}from"../chunks/CopyLLMTxtMenu.62447d40.js";import{C as rt}from"../chunks/CodeBlock.8ce89b2c.js";import{H as D,E as wt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.4ed841e5.js";function ft(K){let r,N,A,Z,T,k,m,v,w,q='You can use <a href="https://docs.github.com/en/actions" rel="nofollow">GitHub Actions</a> to automatically sync your GitHub repository to the Hugging Face Hub. The official <a href="https://github.com/marketplace/actions/sync-github-to-hugging-face-hub" rel="nofollow"><code>huggingface/hub-sync</code></a> action supports syncing <strong>Models</strong>, <strong>Datasets</strong>, and <strong>Spaces</strong>.',S,f,L,M,tt='<li>Create a Hugging Face <a href="https://huggingface.co/settings/tokens" rel="nofollow">access token</a> with <strong>write</strong> permission to the target repo. For better security, use a <a href="https://huggingface.co/settings/tokens" rel="nofollow">fine-grained token</a> scoped to only the repository you’re syncing to.</li> <li>Add the token as a <a href="https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-an-environment" rel="nofollow">GitHub secret</a> called <code>HF_TOKEN</code> in your repository settings.</li> <li>Add a workflow file (e.g. <code>.github/workflows/sync-to-hub.yml</code>) to your repository.</li>',G,J,z,y,X,j,st="By default, this syncs to a <strong>Space</strong>. To sync a model or dataset, set the <code>repo_type</code> parameter:",W,I,Y,b,x,$,et="<thead><tr><th>Parameter</th> <th>Required</th> <th>Default</th> <th>Description</th></tr></thead> <tbody><tr><td><code>github_repo_id</code></td> <td>Yes</td> <td>—</td> <td>GitHub repository (use <code>${{ github.repository }}</code>)</td></tr> <tr><td><code>huggingface_repo_id</code></td> <td>Yes</td> <td>—</td> <td>Target repo on the Hub (<code>username/repo-name</code>)</td></tr> <tr><td><code>hf_token</code></td> <td>Yes</td> <td>—</td> <td>Hugging Face access token</td></tr> <tr><td><code>repo_type</code></td> <td>No</td> <td><code>space</code></td> <td><code>space</code>, <code>model</code>, or <code>dataset</code></td></tr> <tr><td><code>space_sdk</code></td> <td>No</td> <td><code>gradio</code></td> <td><code>gradio</code>, <code>streamlit</code>, <code>docker</code>, or <code>static</code></td></tr> <tr><td><code>private</code></td> <td>No</td> <td><code>false</code></td> <td>Whether to create the repo as private</td></tr> <tr><td><code>subdirectory</code></td> <td>No</td> <td><code>.</code></td> <td>Sync a specific subdirectory (useful for monorepos)</td></tr></tbody>",V,U,at="The action mirrors your files to the Hub using the <code>hf</code> CLI — it is not a git-to-git sync. It automatically excludes <code>.github/</code> and <code>.git/</code> directories and mirrors deletions (files removed from GitHub will be removed from the Hub).",Q,C,nt='For more complex workflows (e.g. build steps, custom upload logic), you can install and use the <a href="https://huggingface.co/docs/huggingface_hub/en/guides/cli" rel="nofollow"><code>hf</code> CLI</a> directly in your workflow instead.',F,B,lt='For Spaces-specific guidance (file size limits, LFS handling), see <a href="./spaces-github-actions">Managing Spaces with GitHub Actions</a>.',P,H,R,E,O;return T=new mt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),m=new D({props:{title:"GitHub Actions",local:"github-actions",headingTag:"h1"}}),f=new D({props:{title:"Setup",local:"setup",headingTag:"h2"}}),J=new D({props:{title:"Basic usage",local:"basic-usage",headingTag:"h2"}}),y=new rt({props:{code:"bmFtZSUzQSUyMFN5bmMlMjB0byUyMEh1Z2dpbmclMjBGYWNlJTIwSHViJTBBb24lM0ElMEElMjAlMjBwdXNoJTNBJTBBJTIwJTIwJTIwJTIwYnJhbmNoZXMlM0ElMjAlNUJtYWluJTVEJTBBJTBBam9icyUzQSUwQSUyMCUyMHN5bmMlM0ElMEElMjAlMjAlMjAlMjBydW5zLW9uJTNBJTIwdWJ1bnR1LWxhdGVzdCUwQSUyMCUyMCUyMCUyMHN0ZXBzJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwLSUyMHVzZXMlM0ElMjBhY3Rpb25zJTJGY2hlY2tvdXQlNDB2NiUwQSUyMCUyMCUyMCUyMCUyMCUyMC0lMjB1c2VzJTNBJTIwaHVnZ2luZ2ZhY2UlMkZodWItc3luYyU0MHYwLjEuMCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHdpdGglM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBnaXRodWJfcmVwb19pZCUzQSUyMCUyNCU3QiU3QiUyMGdpdGh1Yi5yZXBvc2l0b3J5JTIwJTdEJTdEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaHVnZ2luZ2ZhY2VfcmVwb19pZCUzQSUyMHVzZXJuYW1lJTJGcmVwby1uYW1lJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaGZfdG9rZW4lM0ElMjAlMjQlN0IlN0IlMjBzZWNyZXRzLkhGX1RPS0VOJTIwJTdEJTdE",highlighted:`<span class="hljs-attr">name:</span> <span class="hljs-string">Sync</span> <span class="hljs-string">to</span> <span class="hljs-string">Hugging</span> <span class="hljs-string">Face</span> <span class="hljs-string">Hub</span> | |
| <span class="hljs-attr">on:</span> | |
| <span class="hljs-attr">push:</span> | |
| <span class="hljs-attr">branches:</span> [<span class="hljs-string">main</span>] | |
| <span class="hljs-attr">jobs:</span> | |
| <span class="hljs-attr">sync:</span> | |
| <span class="hljs-attr">runs-on:</span> <span class="hljs-string">ubuntu-latest</span> | |
| <span class="hljs-attr">steps:</span> | |
| <span class="hljs-bullet">-</span> <span class="hljs-attr">uses:</span> <span class="hljs-string">actions/checkout@v6</span> | |
| <span class="hljs-bullet">-</span> <span class="hljs-attr">uses:</span> <span class="hljs-string">huggingface/hub-sync@v0.1.0</span> | |
| <span class="hljs-attr">with:</span> | |
| <span class="hljs-attr">github_repo_id:</span> <span class="hljs-string">\${{</span> <span class="hljs-string">github.repository</span> <span class="hljs-string">}}</span> | |
| <span class="hljs-attr">huggingface_repo_id:</span> <span class="hljs-string">username/repo-name</span> | |
| <span class="hljs-attr">hf_token:</span> <span class="hljs-string">\${{</span> <span class="hljs-string">secrets.HF_TOKEN</span> <span class="hljs-string">}}</span>`,wrap:!1}}),I=new rt({props:{code:"JTIwJTIwJTIwJTIwJTIwJTIwLSUyMHVzZXMlM0ElMjBodWdnaW5nZmFjZSUyRmh1Yi1zeW5jJTQwdjAuMS4wJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwd2l0aCUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGdpdGh1Yl9yZXBvX2lkJTNBJTIwJTI0JTdCJTdCJTIwZ2l0aHViLnJlcG9zaXRvcnklMjAlN0QlN0QlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBodWdnaW5nZmFjZV9yZXBvX2lkJTNBJTIwdXNlcm5hbWUlMkZteS1kYXRhc2V0JTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaGZfdG9rZW4lM0ElMjAlMjQlN0IlN0IlMjBzZWNyZXRzLkhGX1RPS0VOJTIwJTdEJTdEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmVwb190eXBlJTNBJTIwZGF0YXNldA==",highlighted:` <span class="hljs-bullet">-</span> <span class="hljs-attr">uses:</span> <span class="hljs-string">huggingface/hub-sync@v0.1.0</span> | |
| <span class="hljs-attr">with:</span> | |
| <span class="hljs-attr">github_repo_id:</span> <span class="hljs-string">\${{</span> <span class="hljs-string">github.repository</span> <span class="hljs-string">}}</span> | |
| <span class="hljs-attr">huggingface_repo_id:</span> <span class="hljs-string">username/my-dataset</span> | |
| <span class="hljs-attr">hf_token:</span> <span class="hljs-string">\${{</span> <span class="hljs-string">secrets.HF_TOKEN</span> <span class="hljs-string">}}</span> | |
| <span class="hljs-attr">repo_type:</span> <span class="hljs-string">dataset</span>`,wrap:!1}}),b=new D({props:{title:"Parameters",local:"parameters",headingTag:"h2"}}),H=new wt({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/repositories-github-actions.md"}}),{c(){r=i("meta"),N=n(),A=i("p"),Z=n(),c(T.$$.fragment),k=n(),c(m.$$.fragment),v=n(),w=i("p"),w.innerHTML=q,S=n(),c(f.$$.fragment),L=n(),M=i("ol"),M.innerHTML=tt,G=n(),c(J.$$.fragment),z=n(),c(y.$$.fragment),X=n(),j=i("p"),j.innerHTML=st,W=n(),c(I.$$.fragment),Y=n(),c(b.$$.fragment),x=n(),$=i("table"),$.innerHTML=et,V=n(),U=i("p"),U.innerHTML=at,Q=n(),C=i("p"),C.innerHTML=nt,F=n(),B=i("p"),B.innerHTML=lt,P=n(),c(H.$$.fragment),R=n(),E=i("p"),this.h()},l(t){const s=gt("svelte-u9bgzb",document.head);r=o(s,"META",{name:!0,content:!0}),s.forEach(e),N=l(t),A=o(t,"P",{}),it(A).forEach(e),Z=l(t),p(T.$$.fragment,t),k=l(t),p(m.$$.fragment,t),v=l(t),w=o(t,"P",{"data-svelte-h":!0}),_(w)!=="svelte-3atwy5"&&(w.innerHTML=q),S=l(t),p(f.$$.fragment,t),L=l(t),M=o(t,"OL",{"data-svelte-h":!0}),_(M)!=="svelte-1syyxry"&&(M.innerHTML=tt),G=l(t),p(J.$$.fragment,t),z=l(t),p(y.$$.fragment,t),X=l(t),j=o(t,"P",{"data-svelte-h":!0}),_(j)!=="svelte-1k5i44a"&&(j.innerHTML=st),W=l(t),p(I.$$.fragment,t),Y=l(t),p(b.$$.fragment,t),x=l(t),$=o(t,"TABLE",{"data-svelte-h":!0}),_($)!=="svelte-jorzla"&&($.innerHTML=et),V=l(t),U=o(t,"P",{"data-svelte-h":!0}),_(U)!=="svelte-1n376kv"&&(U.innerHTML=at),Q=l(t),C=o(t,"P",{"data-svelte-h":!0}),_(C)!=="svelte-1gllh9f"&&(C.innerHTML=nt),F=l(t),B=o(t,"P",{"data-svelte-h":!0}),_(B)!=="svelte-bkb2l2"&&(B.innerHTML=lt),P=l(t),p(H.$$.fragment,t),R=l(t),E=o(t,"P",{}),it(E).forEach(e),this.h()},h(){ot(r,"name","hf:doc:metadata"),ot(r,"content",Mt)},m(t,s){Tt(document.head,r),a(t,N,s),a(t,A,s),a(t,Z,s),d(T,t,s),a(t,k,s),d(m,t,s),a(t,v,s),a(t,w,s),a(t,S,s),d(f,t,s),a(t,L,s),a(t,M,s),a(t,G,s),d(J,t,s),a(t,z,s),d(y,t,s),a(t,X,s),a(t,j,s),a(t,W,s),d(I,t,s),a(t,Y,s),d(b,t,s),a(t,x,s),a(t,$,s),a(t,V,s),a(t,U,s),a(t,Q,s),a(t,C,s),a(t,F,s),a(t,B,s),a(t,P,s),d(H,t,s),a(t,R,s),a(t,E,s),O=!0},p:pt,i(t){O||(h(T.$$.fragment,t),h(m.$$.fragment,t),h(f.$$.fragment,t),h(J.$$.fragment,t),h(y.$$.fragment,t),h(I.$$.fragment,t),h(b.$$.fragment,t),h(H.$$.fragment,t),O=!0)},o(t){u(T.$$.fragment,t),u(m.$$.fragment,t),u(f.$$.fragment,t),u(J.$$.fragment,t),u(y.$$.fragment,t),u(I.$$.fragment,t),u(b.$$.fragment,t),u(H.$$.fragment,t),O=!1},d(t){t&&(e(N),e(A),e(Z),e(k),e(v),e(w),e(S),e(L),e(M),e(G),e(z),e(X),e(j),e(W),e(Y),e(x),e($),e(V),e(U),e(Q),e(C),e(F),e(B),e(P),e(R),e(E)),e(r),g(T,t),g(m,t),g(f,t),g(J,t),g(y,t),g(I,t),g(b,t),g(H,t)}}}const Mt='{"title":"GitHub Actions","local":"github-actions","sections":[{"title":"Setup","local":"setup","sections":[],"depth":2},{"title":"Basic usage","local":"basic-usage","sections":[],"depth":2},{"title":"Parameters","local":"parameters","sections":[],"depth":2}],"depth":1}';function Jt(K){return dt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ut extends ht{constructor(r){super(),ut(this,r,Jt,ft,ct,{})}}export{Ut as component}; | |
Xet Storage Details
- Size:
- 10.5 kB
- Xet hash:
- 80c20253f6845cd89c9befa999906b66cf5873cdf1d3f94c66b09abe7211cb7b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.