Skip to content

Commit e0c5141

Browse files
committed
Merge branch 'main' of https://github.com/huggingface/huggingface.js into llamafile
2 parents deaf038 + 1ae84ba commit e0c5141

File tree

643 files changed

+26076
-20128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

643 files changed

+26076
-20128
lines changed

.github/workflows/agents-publish.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
# remote: error: GH006: Protected branch update failed for refs/heads/main.
3131
# remote: error: Changes must be made through a pull request. Required status check "lint" is expected.
3232
token: ${{ secrets.BOT_ACCESS_TOKEN }}
33-
- run: corepack enable
33+
- run: npm install -g corepack@latest && corepack enable
3434
- uses: actions/setup-node@v3
3535
with:
3636
node-version: "20"
@@ -50,7 +50,7 @@ jobs:
5050
node -e "const fs = require('fs'); const package = JSON.parse(fs.readFileSync('./package.json')); package.version = '$BUMPED_VERSION'; fs.writeFileSync('./package.json', JSON.stringify(package, null, '\t') + '\n');"
5151
pnpm --filter doc-internal run fix-cdn-versions
5252
git add ../..
53-
git commit -m "🔖 @hugginface/agents $BUMPED_VERSION"
53+
git commit -m "🔖 @huggingface/agents $BUMPED_VERSION"
5454
git tag "agents-v$BUMPED_VERSION"
5555
- run: pnpm --filter agents... build && pnpm publish --no-git-checks .
5656
env:
@@ -61,10 +61,12 @@ jobs:
6161
with:
6262
node-version: "20"
6363
registry-url: "https://npm.pkg.github.com"
64-
- run: pnpm publish --no-git-checks .
65-
env:
66-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
# Disable for now, until github supports PATs for writing github packages (https://github.com/github/roadmap/issues/558)
65+
# - run: pnpm publish --no-git-checks .
66+
# env:
67+
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6768
- name: "Update Doc"
6869
uses: peter-evans/repository-dispatch@v2
6970
with:
7071
event-type: doc-build
72+
token: ${{ secrets.BOT_ACCESS_TOKEN }}

.github/workflows/blob-publish.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Blob - Version and Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
newversion:
7+
type: choice
8+
description: "Semantic Version Bump Type"
9+
default: patch
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
15+
concurrency:
16+
group: "push-to-main"
17+
18+
defaults:
19+
run:
20+
working-directory: packages/blob
21+
22+
jobs:
23+
version_and_release:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v3
27+
with:
28+
# Needed to push the tag and the commit on the main branch, otherwise we get:
29+
# > Run git push --follow-tags
30+
# remote: error: GH006: Protected branch update failed for refs/heads/main.
31+
# remote: error: Changes must be made through a pull request. Required status check "lint" is expected.
32+
token: ${{ secrets.BOT_ACCESS_TOKEN }}
33+
- run: npm install -g corepack@latest && corepack enable
34+
- uses: actions/setup-node@v3
35+
with:
36+
node-version: "20"
37+
cache: "pnpm"
38+
cache-dependency-path: |
39+
packages/blob/pnpm-lock.yaml
40+
# setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED
41+
registry-url: "https://registry.npmjs.org"
42+
- run: pnpm install
43+
- run: git config --global user.name machineuser
44+
- run: git config --global user.email [email protected]
45+
- run: |
46+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
47+
BUMPED_VERSION=$(node -p "require('semver').inc('$PACKAGE_VERSION', '${{ github.event.inputs.newversion }}')")
48+
# Update package.json with the new version
49+
node -e "const fs = require('fs'); const package = JSON.parse(fs.readFileSync('./package.json')); package.version = '$BUMPED_VERSION'; fs.writeFileSync('./package.json', JSON.stringify(package, null, '\t') + '\n');"
50+
git commit . -m "🔖 @huggingface/blob $BUMPED_VERSION"
51+
git tag "blob-v$BUMPED_VERSION"
52+
53+
- run: pnpm publish --no-git-checks .
54+
env:
55+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
56+
- run: git pull --rebase && git push --follow-tags
57+
# hack - reuse actions/setup-node@v3 just to set a new registry
58+
- uses: actions/setup-node@v3
59+
with:
60+
node-version: "20"
61+
registry-url: "https://npm.pkg.github.com"
62+
# Disable for now, until github supports PATs for writing github packages (https://github.com/github/roadmap/issues/558)
63+
# - run: pnpm publish --no-git-checks .
64+
# env:
65+
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
- name: "Update Doc"
67+
uses: peter-evans/repository-dispatch@v2
68+
with:
69+
event-type: doc-build
70+
token: ${{ secrets.BOT_ACCESS_TOKEN }}

.github/workflows/dduf-publish.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: DDUF - Version and Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
newversion:
7+
type: choice
8+
description: "Semantic Version Bump Type"
9+
default: patch
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
15+
concurrency:
16+
group: "push-to-main"
17+
18+
defaults:
19+
run:
20+
working-directory: packages/dduf
21+
22+
jobs:
23+
version_and_release:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v3
27+
with:
28+
# Needed to push the tag and the commit on the main branch, otherwise we get:
29+
# > Run git push --follow-tags
30+
# remote: error: GH006: Protected branch update failed for refs/heads/main.
31+
# remote: error: Changes must be made through a pull request. Required status check "lint" is expected.
32+
token: ${{ secrets.BOT_ACCESS_TOKEN }}
33+
- run: npm install -g corepack@latest && corepack enable
34+
- uses: actions/setup-node@v3
35+
with:
36+
node-version: "20"
37+
cache: "pnpm"
38+
cache-dependency-path: |
39+
packages/dduf/pnpm-lock.yaml
40+
# setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED
41+
registry-url: "https://registry.npmjs.org"
42+
- run: pnpm install
43+
- run: git config --global user.name machineuser
44+
- run: git config --global user.email [email protected]
45+
- run: |
46+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
47+
BUMPED_VERSION=$(node -p "require('semver').inc('$PACKAGE_VERSION', '${{ github.event.inputs.newversion }}')")
48+
# Update package.json with the new version
49+
node -e "const fs = require('fs'); const package = JSON.parse(fs.readFileSync('./package.json')); package.version = '$BUMPED_VERSION'; fs.writeFileSync('./package.json', JSON.stringify(package, null, '\t') + '\n');"
50+
git commit . -m "🔖 @huggingface/dduf $BUMPED_VERSION"
51+
git tag "dduf-v$BUMPED_VERSION"
52+
53+
- name: "Check Deps are published before publishing this package"
54+
run: pnpm -w check-deps blob
55+
56+
- run: pnpm publish --no-git-checks .
57+
env:
58+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
59+
- run: git pull --rebase && git push --follow-tags
60+
# hack - reuse actions/setup-node@v3 just to set a new registry
61+
- uses: actions/setup-node@v3
62+
with:
63+
node-version: "20"
64+
registry-url: "https://npm.pkg.github.com"
65+
# Disable for now, until github supports PATs for writing github packages (https://github.com/github/roadmap/issues/558)
66+
# - run: pnpm publish --no-git-checks .
67+
# env:
68+
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
- name: "Update Doc"
70+
uses: peter-evans/repository-dispatch@v2
71+
with:
72+
event-type: doc-build
73+
token: ${{ secrets.BOT_ACCESS_TOKEN }}

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ jobs:
2222
package: huggingface.js
2323
path_to_docs: huggingface.js/docs
2424
additional_args: --not_python_module
25-
pre_command: corepack enable && cd huggingface.js && pnpm install && pnpm -r build && pnpm --filter doc-internal start
25+
pre_command: npm install -g corepack@latest && corepack enable && cd huggingface.js && pnpm install && pnpm -r build && pnpm --filter doc-internal start
2626
secrets:
2727
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}

.github/workflows/gguf-publish.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
# remote: error: GH006: Protected branch update failed for refs/heads/main.
3131
# remote: error: Changes must be made through a pull request. Required status check "lint" is expected.
3232
token: ${{ secrets.BOT_ACCESS_TOKEN }}
33-
- run: corepack enable
33+
- run: npm install -g corepack@latest && corepack enable
3434
- uses: actions/setup-node@v3
3535
with:
3636
node-version: "20"
@@ -47,8 +47,12 @@ jobs:
4747
BUMPED_VERSION=$(node -p "require('semver').inc('$PACKAGE_VERSION', '${{ github.event.inputs.newversion }}')")
4848
# Update package.json with the new version
4949
node -e "const fs = require('fs'); const package = JSON.parse(fs.readFileSync('./package.json')); package.version = '$BUMPED_VERSION'; fs.writeFileSync('./package.json', JSON.stringify(package, null, '\t') + '\n');"
50-
git commit . -m "🔖 @hugginface/gguf $BUMPED_VERSION"
50+
git commit . -m "🔖 @huggingface/gguf $BUMPED_VERSION"
5151
git tag "gguf-v$BUMPED_VERSION"
52+
53+
- name: "Check Deps are published before publishing this package"
54+
run: pnpm -w check-deps tasks
55+
5256
- run: pnpm publish --no-git-checks .
5357
env:
5458
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -58,6 +62,7 @@ jobs:
5862
with:
5963
node-version: "20"
6064
registry-url: "https://npm.pkg.github.com"
61-
- run: pnpm publish --no-git-checks .
62-
env:
63-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
# Disable for now, until github supports PATs for writing github packages (https://github.com/github/roadmap/issues/558)
66+
# - run: pnpm publish --no-git-checks .
67+
# env:
68+
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/hub-publish.yml

Lines changed: 9 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
# remote: error: GH006: Protected branch update failed for refs/heads/main.
3131
# remote: error: Changes must be made through a pull request. Required status check "lint" is expected.
3232
token: ${{ secrets.BOT_ACCESS_TOKEN }}
33-
- run: corepack enable
33+
- run: npm install -g corepack@latest && corepack enable
3434
- uses: actions/setup-node@v3
3535
with:
3636
node-version: "20"
@@ -50,45 +50,11 @@ jobs:
5050
node -e "const fs = require('fs'); const package = JSON.parse(fs.readFileSync('./package.json')); package.version = '$BUMPED_VERSION'; fs.writeFileSync('./package.json', JSON.stringify(package, null, '\t') + '\n');"
5151
pnpm --filter doc-internal run fix-cdn-versions
5252
git add ../..
53-
git commit -m "🔖 @hugginface/hub $BUMPED_VERSION"
53+
git commit -m "🔖 @huggingface/hub $BUMPED_VERSION"
5454
git tag "hub-v$BUMPED_VERSION"
5555
56-
- name: Make sure that the latest version of @huggingface/tasks is consistent with the local version
57-
run: |
58-
LOCAL_TASKS_VERSION=$(node -p "require('./package.json').version")
59-
REMOTE_TASKS_VERSION=$(npm view @huggingface/tasks version)
60-
61-
# If the versions are different, error
62-
if [ "$LOCAL_TASKS_VERSION" != "$REMOTE_TASKS_VERSION" ]; then
63-
echo "Error: The local @huggingface/tasks package version ($LOCAL_TASKS_VERSION) differs from the remote version ($REMOTE_TASKS_VERSION). Release halted."
64-
exit 1
65-
fi
66-
67-
npm pack @huggingface/tasks
68-
mv huggingface-tasks-$LOCAL_TASKS_VERSION.tgz tasks-local.tgz
69-
70-
npm pack @huggingface/tasks@$REMOTE_TASKS_VERSION
71-
mv huggingface-tasks-$REMOTE_TASKS_VERSION.tgz tasks-remote.tgz
72-
73-
# Compute checksum of local tar. We need to extract both tar since the remote compression might be different
74-
tar -xf tasks-local.tgz
75-
LOCAL_CHECKSUM=$(cd package && tar --mtime='1970-01-01' --mode=755 -cf - . | sha256sum | cut -d' ' -f1)
76-
echo "Local package checksum: $LOCAL_CHECKSUM"
77-
78-
rm -Rf package
79-
80-
tar -xf tasks-remote.tgz
81-
REMOTE_CHECKSUM=$(cd package && tar --mtime='1970-01-01' --mode=755 -cf - . | sha256sum | cut -d' ' -f1)
82-
echo "Remote package checksum: $REMOTE_CHECKSUM"
83-
84-
rm -Rf package
85-
86-
if [ "$LOCAL_CHECKSUM" != "$REMOTE_CHECKSUM" ]; then
87-
echo "Checksum Verification Failed: The local @huggingface/tasks package differs from the remote version. Release halted. Local Checksum: $LOCAL_CHECKSUM, Remote Checksum: $REMOTE_CHECKSUM"
88-
exit 1
89-
fi
90-
echo "Checksum Verification Successful: The local and remote @huggingface/tasks packages are consistent. Proceeding with the @huggingface/widgets package release. Local Checksum: $LOCAL_CHECKSUM, Remote Checksum: $REMOTE_CHECKSUM."
91-
working-directory: packages/tasks
56+
- name: "Check Deps are published before publishing this package"
57+
run: pnpm -w check-deps tasks
9258

9359
- run: pnpm publish --no-git-checks .
9460
env:
@@ -99,10 +65,12 @@ jobs:
9965
with:
10066
node-version: "20"
10167
registry-url: "https://npm.pkg.github.com"
102-
- run: pnpm publish --no-git-checks .
103-
env:
104-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
# Disable for now, until github supports PATs for writing github packages (https://github.com/github/roadmap/issues/558)
69+
# - run: pnpm publish --no-git-checks .
70+
# env:
71+
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10572
- name: "Update Doc"
10673
uses: peter-evans/repository-dispatch@v2
10774
with:
10875
event-type: doc-build
76+
token: ${{ secrets.BOT_ACCESS_TOKEN }}

.github/workflows/inference-publish.yml

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
# remote: error: GH006: Protected branch update failed for refs/heads/main.
3131
# remote: error: Changes must be made through a pull request. Required status check "lint" is expected.
3232
token: ${{ secrets.BOT_ACCESS_TOKEN }}
33-
- run: corepack enable
33+
- run: npm install -g corepack@latest && corepack enable
3434
- uses: actions/setup-node@v3
3535
with:
3636
node-version: "20"
@@ -50,45 +50,11 @@ jobs:
5050
node -e "const fs = require('fs'); const package = JSON.parse(fs.readFileSync('./package.json')); package.version = '$BUMPED_VERSION'; fs.writeFileSync('./package.json', JSON.stringify(package, null, '\t') + '\n');"
5151
pnpm --filter doc-internal run fix-cdn-versions
5252
git add ../..
53-
git commit -m "🔖 @hugginface/inference $BUMPED_VERSION"
53+
git commit -m "🔖 @huggingface/inference $BUMPED_VERSION"
5454
git tag "inference-v$BUMPED_VERSION"
5555
56-
- name: Make sure that the latest version of @huggingface/tasks is consistent with the local version
57-
run: |
58-
LOCAL_TASKS_VERSION=$(node -p "require('./package.json').version")
59-
REMOTE_TASKS_VERSION=$(npm view @huggingface/tasks version)
60-
61-
# If the versions are different, error
62-
if [ "$LOCAL_TASKS_VERSION" != "$REMOTE_TASKS_VERSION" ]; then
63-
echo "Error: The local @huggingface/tasks package version ($LOCAL_TASKS_VERSION) differs from the remote version ($REMOTE_TASKS_VERSION). Release halted."
64-
exit 1
65-
fi
66-
67-
npm pack @huggingface/tasks
68-
mv huggingface-tasks-$LOCAL_TASKS_VERSION.tgz tasks-local.tgz
69-
70-
npm pack @huggingface/tasks@$REMOTE_TASKS_VERSION
71-
mv huggingface-tasks-$REMOTE_TASKS_VERSION.tgz tasks-remote.tgz
72-
73-
# Compute checksum of local tar. We need to extract both tar since the remote compression might be different
74-
tar -xf tasks-local.tgz
75-
LOCAL_CHECKSUM=$(cd package && tar --mtime='1970-01-01' --mode=755 -cf - . | sha256sum | cut -d' ' -f1)
76-
echo "Local package checksum: $LOCAL_CHECKSUM"
77-
78-
rm -Rf package
79-
80-
tar -xf tasks-remote.tgz
81-
REMOTE_CHECKSUM=$(cd package && tar --mtime='1970-01-01' --mode=755 -cf - . | sha256sum | cut -d' ' -f1)
82-
echo "Remote package checksum: $REMOTE_CHECKSUM"
83-
84-
rm -Rf package
85-
86-
if [ "$LOCAL_CHECKSUM" != "$REMOTE_CHECKSUM" ]; then
87-
echo "Checksum Verification Failed: The local @huggingface/tasks package differs from the remote version. Release halted. Local Checksum: $LOCAL_CHECKSUM, Remote Checksum: $REMOTE_CHECKSUM"
88-
exit 1
89-
fi
90-
echo "Checksum Verification Successful: The local and remote @huggingface/tasks packages are consistent. Proceeding with the @huggingface/widgets package release. Local Checksum: $LOCAL_CHECKSUM, Remote Checksum: $REMOTE_CHECKSUM."
91-
working-directory: packages/tasks
56+
- name: "Check Deps are published before publishing this package"
57+
run: pnpm -w check-deps tasks
9258

9359
- run: pnpm publish --no-git-checks .
9460
env:
@@ -99,6 +65,7 @@ jobs:
9965
with:
10066
node-version: "20"
10167
registry-url: "https://npm.pkg.github.com"
102-
- run: pnpm publish --no-git-checks .
103-
env:
104-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
# Disable for now, until github supports PATs for writing github packages (https://github.com/github/roadmap/issues/558)
69+
# - run: pnpm publish --no-git-checks .
70+
# env:
71+
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/jinja-publish.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
# remote: error: GH006: Protected branch update failed for refs/heads/main.
3131
# remote: error: Changes must be made through a pull request. Required status check "lint" is expected.
3232
token: ${{ secrets.BOT_ACCESS_TOKEN }}
33-
- run: corepack enable
33+
- run: npm install -g corepack@latest && corepack enable
3434
- uses: actions/setup-node@v3
3535
with:
3636
node-version: "20"
@@ -47,7 +47,7 @@ jobs:
4747
BUMPED_VERSION=$(node -p "require('semver').inc('$PACKAGE_VERSION', '${{ github.event.inputs.newversion }}')")
4848
# Update package.json with the new version
4949
node -e "const fs = require('fs'); const package = JSON.parse(fs.readFileSync('./package.json')); package.version = '$BUMPED_VERSION'; fs.writeFileSync('./package.json', JSON.stringify(package, null, '\t') + '\n');"
50-
git commit . -m "🔖 @hugginface/jinja $BUMPED_VERSION"
50+
git commit . -m "🔖 @huggingface/jinja $BUMPED_VERSION"
5151
git tag "jinja-v$BUMPED_VERSION"
5252
- run: pnpm publish --no-git-checks .
5353
env:
@@ -58,6 +58,7 @@ jobs:
5858
with:
5959
node-version: "20"
6060
registry-url: "https://npm.pkg.github.com"
61-
- run: pnpm publish --no-git-checks .
62-
env:
63-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
# Disable for now, until github supports PATs for writing github packages (https://github.com/github/roadmap/issues/558)
62+
# - run: pnpm publish --no-git-checks .
63+
# env:
64+
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)