mirror of
https://github.com/f/awesome-chatgpt-prompts.git
synced 2026-02-12 15:52:47 +00:00
ci(workflows): Add workflow step to sync prompts.csv to Hugging Face
This commit is contained in:
20
.github/workflows/update-contributors.yml
vendored
20
.github/workflows/update-contributors.yml
vendored
@@ -37,3 +37,23 @@ jobs:
|
||||
- name: Push changes
|
||||
run: |
|
||||
git push origin main --force-with-lease
|
||||
|
||||
- name: Sync to Hugging Face
|
||||
env:
|
||||
HF_API_TOKEN: ${{ secrets.HF_API_TOKEN }}
|
||||
run: |
|
||||
pip install huggingface_hub
|
||||
python3 << 'EOF'
|
||||
import os
|
||||
from huggingface_hub import HfApi
|
||||
|
||||
api = HfApi(token=os.environ["HF_API_TOKEN"])
|
||||
api.upload_file(
|
||||
path_or_fileobj="prompts.csv",
|
||||
path_in_repo="prompts.csv",
|
||||
repo_id="fka/awesome-chatgpt-prompts",
|
||||
repo_type="dataset",
|
||||
commit_message="Update prompts.csv"
|
||||
)
|
||||
print("Successfully synced prompts.csv to Hugging Face")
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user