From cff05ca608a2926c330749b7d59e89a4fa6f3dd8 Mon Sep 17 00:00:00 2001 From: alex-bene Date: Wed, 29 May 2024 18:04:24 +0300 Subject: [PATCH] explain why we replace readme --- README.md | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 9532e67..45e23c7 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,40 @@ -# Sync With Hugging Face Space +# Sync With Hugging Face Spaces This action creates seperate README.md file with a YAML header prepended for Hugging Face 🤗 Space and syncs your updates with the space repo. A repo using this action can be found [here](https://github.com/alex-bene/BianqueNet). -## Usage +## Why replace README? +The README for the Hugging Face Spaces is required to have a YAML configuration head with details about the HF Space. However, this header is render in Github and does not look good. This action expects as input a seperate `.yml` file with the YAML configurations for the space and will automatically prepend it the README.md before pushing it to the HF Space. + +## Usage example ```yaml -- uses: alex-bene/huggingface-space-sync-action@v0.1 - with: - # The github repo you are syncing from. Required. - github_repo_id: '' - # The branch of your github repo you want to sync from. Defaults to 'main'. Optional. - github_branch: 'main' - # The yaml headers file to use, e.g., hf_space_metadata.yml (will be prepended to your README.md in the HF space). Required. - yaml_header_path: '' - # The Hugging Face repo id you want to sync to. (ex. 'username/reponame'). Required. - huggingface_repo_id: '' - # Hugging Face token with write access and corresponding username. Required. - # Here, we provide a token that we called `HF_TOKEN` when we added the secret to our GitHub repo. - hf_username: '' - hf_token: ${{ secrets.HF_TOKEN }} +name: Sync with Hugging Face Space + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Sync with HF + uses: alex-bene/huggingface-space-sync-action@v0.1 + with: + # The github repo you are syncing from. Required. + github_repo_id: '' + # The branch of your github repo you want to sync from. Defaults to 'main'. Optional. + github_branch: 'main' + # The yaml headers file to use, e.g., hf_space_metadata.yml (will be prepended to your README.md in the HF space). Required. + yaml_header_path: '' + # The Hugging Face repo id you want to sync to. (ex. 'username/reponame'). Required. + huggingface_repo_id: '' + # Hugging Face token with write access and corresponding username. Required. + # Here, we provide a token that we called `HF_TOKEN` when we added the secret to our GitHub repo. + # Generate your HF_TOKEN from: https://huggingface.co/settings/tokens + hf_username: '' + hf_token: ${{ secrets.HF_TOKEN }} ``` ## License