Spaces:
Build error
Build error
Test 5
Browse files- .github/workflows/test.yml +0 -30
- check_update.py +0 -22
.github/workflows/test.yml
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
name: Check Hugging Face Space Update
|
| 2 |
-
|
| 3 |
-
on:
|
| 4 |
-
push:
|
| 5 |
-
branches:
|
| 6 |
-
- main # or the branch you want to trigger the action
|
| 7 |
-
|
| 8 |
-
jobs:
|
| 9 |
-
check-update:
|
| 10 |
-
runs-on: ubuntu-latest
|
| 11 |
-
|
| 12 |
-
steps:
|
| 13 |
-
- name: Checkout code
|
| 14 |
-
uses: actions/checkout@v3
|
| 15 |
-
|
| 16 |
-
- name: Set up Python
|
| 17 |
-
uses: actions/setup-python@v4
|
| 18 |
-
with:
|
| 19 |
-
python-version: '3.x' # Specify the Python version you need
|
| 20 |
-
|
| 21 |
-
- name: Install dependencies
|
| 22 |
-
run: |
|
| 23 |
-
pip install requests # Install requests library to interact with APIs
|
| 24 |
-
|
| 25 |
-
- name: Check if Hugging Face Space was updated
|
| 26 |
-
env:
|
| 27 |
-
HF_SPACE_URL: ${{ secrets.HF_SPACE_URL }}
|
| 28 |
-
HF_API_KEY: ${{ secrets.HF_TOKEN }}
|
| 29 |
-
run: |
|
| 30 |
-
python check_update.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
check_update.py
DELETED
|
@@ -1,22 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
import requests
|
| 3 |
-
|
| 4 |
-
# Retrieve environment variables
|
| 5 |
-
hf_space_url = os.getenv('HF_SPACE_URL')
|
| 6 |
-
hf_api_key = os.getenv('HF_TOKEN')
|
| 7 |
-
|
| 8 |
-
# Make a request to the Hugging Face API
|
| 9 |
-
headers = {
|
| 10 |
-
'Authorization': f'Bearer {hf_api_key}',
|
| 11 |
-
}
|
| 12 |
-
|
| 13 |
-
response = requests.get(f'{hf_space_url}/info', headers=headers)
|
| 14 |
-
|
| 15 |
-
# Check if the response was successful
|
| 16 |
-
if response.status_code == 200:
|
| 17 |
-
data = response.json()
|
| 18 |
-
# Perform checks on the data as needed
|
| 19 |
-
print("Hugging Face Space is up to date.")
|
| 20 |
-
else:
|
| 21 |
-
print(f"Failed to check update status. Status code: {response.status_code}")
|
| 22 |
-
exit(1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|