Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nateraw authored Feb 6, 2023
1 parent e25dc5d commit c1518d9
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''
Expand All @@ -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'
Expand All @@ -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 }}
```

0 comments on commit c1518d9

Please sign in to comment.