all-the-public-replicate-models 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build_and_publish.yml +48 -0
- package/README.md +31 -0
- package/example.js +11 -0
- package/index.mjs +3 -0
- package/models.json +461409 -0
- package/package.json +17 -0
- package/script/build.js +24 -0
- package/test.js +22 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: Build and Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: '0 0 * * *' # This will run the action daily at midnight.
|
|
6
|
+
workflow_dispatch: # This allows for manual triggering of the workflow.
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-and-publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout code
|
|
14
|
+
uses: actions/checkout@v3
|
|
15
|
+
|
|
16
|
+
- name: Setup Node.js
|
|
17
|
+
uses: actions/setup-node@v3
|
|
18
|
+
with:
|
|
19
|
+
node-version: '18'
|
|
20
|
+
|
|
21
|
+
- name: Install Dependencies
|
|
22
|
+
run: npm ci
|
|
23
|
+
|
|
24
|
+
- name: Build
|
|
25
|
+
run: npm run build
|
|
26
|
+
env:
|
|
27
|
+
REPLICATE_API_TOKEN: ${{ secrets.REPLICATE_API_TOKEN }}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
- name: Check for changes
|
|
31
|
+
run: |
|
|
32
|
+
git diff --quiet && exit 0 || echo "Changes detected!"
|
|
33
|
+
|
|
34
|
+
- name: Run Tests
|
|
35
|
+
run: npm test
|
|
36
|
+
|
|
37
|
+
- name: Commit changes
|
|
38
|
+
run: |
|
|
39
|
+
git config --local user.email "action@github.com"
|
|
40
|
+
git config --local user.name "GitHub Action"
|
|
41
|
+
git add -A
|
|
42
|
+
git commit -m "Build artifacts" || echo "No changes to commit"
|
|
43
|
+
git push
|
|
44
|
+
|
|
45
|
+
- name: Publish to npm
|
|
46
|
+
run: npx np@latest minor --no-2fa --yolo
|
|
47
|
+
env:
|
|
48
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# all-the-public-replicate-models
|
|
2
|
+
|
|
3
|
+
An offline database of metadata for all the public models on Replicate
|
|
4
|
+
|
|
5
|
+
It's all stuffed in a JSON file that's about 17MB.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install all-the-public-replicate-models
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Basic usage:
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import models from 'all-the-public-replicate-models'
|
|
19
|
+
|
|
20
|
+
console.log(models)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Find the top 10 models by run count:
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import models from 'all-the-public-replicate-models'
|
|
27
|
+
import {chain} from 'lodash-es'
|
|
28
|
+
|
|
29
|
+
const mostRun = chain(models).orderBy('run_count', 'desc').take(10).value()
|
|
30
|
+
console.log({mostRun})
|
|
31
|
+
```
|
package/example.js
ADDED
package/index.mjs
ADDED