Skip to content

Update Hugging Face Downloads #8

Update Hugging Face Downloads

Update Hugging Face Downloads #8

name: Update Hugging Face Downloads
on:
schedule:
- cron: '0 0 * * 0' # Runs every Sunday at midnight (00:00 UTC)
workflow_dispatch: # Allows manual triggering
jobs:
update_downloads:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install jq
run: sudo apt-get install jq # Install jq to process JSON
- name: Get Hugging Face Model Download Count
run: |
curl -s https://huggingface.co/api/models/zhreyu/ComicStrips-Lora-Fluxdev | jq '.downloads' > download_count.txt
- name: Update README.md
run: |
DOWNLOADS=$(cat download_count.txt)
# Find and update the download badge link
sed -i 's/https:\/\/img.shields.io\/badge\/downloads-[0-9]*-blue/https:\/\/img.shields.io\/badge\/downloads-'${DOWNLOADS}'-blue/' README.md
- name: Commit changes
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git add README.md
git commit -m "Update Hugging Face model downloads"
git push