Bump the python-requirements group with 3 updates (#157) #184
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
--- | |
name: Sync Space | |
permissions: read-all | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Login with Huggingface CLI | |
run: | | |
pip install -U huggingface_hub[cli] hf-transfer | |
git config --global credential.helper store | |
huggingface-cli login --token ${{ secrets.HF_TOKEN }} | |
- name: Upload Files | |
env: | |
HF_HUB_ENABLE_HF_TRANSFER: 1 | |
run: | | |
files=$(git diff --name-only HEAD HEAD~1) | |
deleted_files=$(git diff --name-only --diff-filter=A HEAD HEAD~1) | |
upload_files() { | |
local file=$1 | |
if [ "$file" != "README.md" ] && [ "$file" != ".gitignore" ] && [ "$file" != ".chainlit/config.toml" ] && [ "$file" != "Modelfile" ]; then | |
huggingface-cli upload --repo-type space TotalSundae/dungeons-and-dragons $file $file | |
fi | |
} | |
for file in $files; do | |
if [[ ! "${deleted_files[@]}" =~ "${file}" ]]; then | |
upload_files $file | |
else | |
echo "File $file needs to be deleted" | |
fi | |
done |