Skip to content

Commit c4757bd

Browse files
committed
add actions workflow to sync
1 parent 0292288 commit c4757bd

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

.github/workflows/sync.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Sync Model Mappings
2+
3+
on:
4+
schedule:
5+
- cron: '0 * * * *' # Run every hour
6+
push:
7+
branches:
8+
- main
9+
workflow_dispatch: # Allows manual triggering
10+
11+
jobs:
12+
sync:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Sync mappings
26+
env:
27+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
28+
run: npm start
29+

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ To see allowable values for `task`, refer to [huggingface.co/tasks](https://hugg
2424

2525
## Updating model mappings
2626

27-
To fetch Replicate model statuses and post updates to the Hugging Face model mappings API:
27+
This repo uses a [GitHub Actions workflow](.github/workflows/sync.yml) to keep the model mappings up to date, as well as model warm/cold states.
28+
29+
The workflow runs on a schedule and is triggered on every push to the main branch, so **you probably don't need to do anything!**.
30+
31+
But if you need to run the sync manually, here's how:
2832

2933
1. Make sure your user is a member of the [replicate organization](https://huggingface.co/organizations/replicate) on Hugging Face.
3034
1. Create a [Hugging Face token](https://huggingface.co/settings/tokens/new?tokenType=fineGrained). It doesn't need to have any specific permissions.

0 commit comments

Comments
 (0)