-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
9 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,14 @@ | |
|
||
A GitHub action that'll sync files from a GitHub repo with the Hugging Face Hub. 🤗 | ||
|
||
A simple example repo using this can be found [here](https://github.com/nateraw/test-spaces-app). A more complex example can be seen [here](https://github.com/nateraw/my-huggingface-repos/). | ||
A simple example repo using this can be found [here](https://github.com/nateraw/test-spaces-app). | ||
|
||
## Usage | ||
|
||
The first step is to add a Hugging Face token with write access to your repo as a GitHub Secret. Below, mine is called `HF_TOKEN`. Then, you can use this action in your repo as shown below. :) | ||
The first step is to add a Hugging Face token with write access to your repo as a GitHub Secret. Below, mine is called `HF_TOKEN`. Then, you can use this action in your repo as shown below. 🤗 | ||
|
||
```yaml | ||
uses: nateraw/[email protected].2 | ||
uses: nateraw/[email protected].4 | ||
with: | ||
# The github repo you are syncing from. Required. | ||
github_repo_id: '' | ||
|
@@ -18,6 +18,10 @@ with: | |
# A repo with this name will be created if it doesn't exist. Required. | ||
huggingface_repo_id: '' | ||
|
||
# Hugging Face token with write access. Required. | ||
# Here, we provide a token that we called `HF_TOKEN` when we added the secret to our GitHub repo. | ||
hf_token: ${{ secrets.HF_TOKEN }} | ||
|
||
# The type of repo you are syncing to: model, dataset, or space. | ||
# Defaults to space. | ||
repo_type: 'space' | ||
|
@@ -37,14 +41,7 @@ with: | |
# If provided, subdirectory will determine which directory of the repo will be synced. | ||
# By default, this action syncs the entire GitHub repo. | ||
# | ||
# It can be useful to sync only a subdirectory, as that means you can then sync multiple | ||
# Hugging Face repos from one central GitHub repo. An example can be seen here: | ||
# https://github.com/nateraw/my-huggingface-repos/ | ||
# | ||
# An example using this option can be seen here: | ||
# https://github.com/huggingface/fuego/blob/830ed98/.github/workflows/sync-with-huggingface.yml | ||
subdirectory: '' | ||
|
||
# When using this action, you must provide a Hugging Face token with write access. | ||
# Here, we provide that token, which we called `HF_TOKEN` when we added the secret to our GitHub repo. | ||
secrets: | ||
hf_token: ${{ secrets.HF_TOKEN }} | ||
``` |