Skip to content

Commit a283574

Browse files
authored
Merge branch 'main' into patch-1
2 parents 7617aeb + 3d57fa0 commit a283574

36 files changed

+1191
-732
lines changed

.github/workflows/hub-publish.yml

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -53,42 +53,8 @@ jobs:
5353
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:

.github/workflows/inference-publish.yml

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -53,42 +53,8 @@ jobs:
5353
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 gguf
9258

9359
- run: pnpm publish --no-git-checks .
9460
env:

.github/workflows/tasks-publish.yml

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -50,42 +50,8 @@ jobs:
5050
git commit . -m "🔖 @huggingface/tasks $BUMPED_VERSION"
5151
git tag "tasks-v$BUMPED_VERSION"
5252
53-
- name: Make sure that the latest version of @huggingface/gguf is consistent with the local version
54-
run: |
55-
LOCAL_GGUF_VERSION=$(node -p "require('./package.json').version")
56-
REMOTE_GGUF_VERSION=$(npm view @huggingface/gguf version)
57-
58-
# If the versions are different, error
59-
if [ "$LOCAL_GGUF_VERSION" != "$REMOTE_GGUF_VERSION" ]; then
60-
echo "Error: The local @huggingface/gguf package version ($LOCAL_GGUF_VERSION) differs from the remote version ($REMOTE_GGUF_VERSION). Release halted."
61-
exit 1
62-
fi
63-
64-
npm pack @huggingface/gguf
65-
mv huggingface-gguf-$LOCAL_GGUF_VERSION.tgz gguf-local.tgz
66-
67-
npm pack @huggingface/gguf@$REMOTE_GGUF_VERSION
68-
mv huggingface-gguf-$REMOTE_GGUF_VERSION.tgz gguf-remote.tgz
69-
70-
# Compute checksum of local tar. We need to extract both tar since the remote compression might be different
71-
tar -xf gguf-local.tgz
72-
LOCAL_CHECKSUM=$(cd package && tar --mtime='1970-01-01' --mode=755 -cf - . | sha256sum | cut -d' ' -f1)
73-
echo "Local package checksum: $LOCAL_CHECKSUM"
74-
75-
rm -Rf package
76-
77-
tar -xf gguf-remote.tgz
78-
REMOTE_CHECKSUM=$(cd package && tar --mtime='1970-01-01' --mode=755 -cf - . | sha256sum | cut -d' ' -f1)
79-
echo "Remote package checksum: $REMOTE_CHECKSUM"
80-
81-
rm -Rf package
82-
83-
if [ "$LOCAL_CHECKSUM" != "$REMOTE_CHECKSUM" ]; then
84-
echo "Checksum Verification Failed: The local @huggingface/gguf package differs from the remote version. Release halted. Local Checksum: $LOCAL_CHECKSUM, Remote Checksum: $REMOTE_CHECKSUM"
85-
exit 1
86-
fi
87-
echo "Checksum Verification Successful: The local and remote @huggingface/gguf packages are consistent. Proceeding with the @huggingface/widgets package release. Local Checksum: $LOCAL_CHECKSUM, Remote Checksum: $REMOTE_CHECKSUM."
88-
working-directory: packages/gguf
53+
- name: "Check Deps are published before publishing this package"
54+
run: pnpm -w check-deps gguf
8955

9056
- run: pnpm publish --no-git-checks .
9157
env:

.github/workflows/widgets-publish.yml

Lines changed: 0 additions & 176 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ You can run our packages with vanilla JS, without any bundler, by using a CDN or
9393
```html
9494
<script type="module">
9595
import { HfInference } from 'https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/+esm';
96-
import { createRepo, commit, deleteRepo, listFiles } from "https://cdn.jsdelivr.net/npm/@huggingface/hub@0.18.2/+esm";
96+
import { createRepo, commit, deleteRepo, listFiles } from "https://cdn.jsdelivr.net/npm/@huggingface/hub@0.19.0/+esm";
9797
</script>
9898
```
9999

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
"lint": "eslint --quiet --fix --ext .cjs,.ts .eslintrc.cjs",
88
"lint:check": "eslint --ext .cjs,.ts .eslintrc.cjs",
99
"format": "prettier --write package.json .prettierrc .vscode .eslintrc.cjs e2e .github *.md",
10-
"format:check": "prettier --check package.json .prettierrc .vscode .eslintrc.cjs .github *.md"
10+
"format:check": "prettier --check package.json .prettierrc .vscode .eslintrc.cjs .github *.md",
11+
"check-deps": "tsx scripts/check-deps.ts"
1112
},
1213
"devDependencies": {
1314
"@typescript-eslint/eslint-plugin": "^7.2.0",
1415
"@typescript-eslint/parser": "^7.2.0",
16+
"@types/node": "^18.16.1",
1517
"@vitest/browser": "^0.34.6",
1618
"eslint": "^8.57.0",
1719
"eslint-config-prettier": "^9.0.0",

packages/hub/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@huggingface/hub",
33
"packageManager": "[email protected]",
4-
"version": "0.18.2",
4+
"version": "0.19.0",
55
"description": "Utilities to interact with the Hugging Face hub",
66
"repository": "https://github.com/huggingface/huggingface.js.git",
77
"publishConfig": {

packages/hub/src/lib/dataset-info.spec.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { describe, expect, it } from "vitest";
22
import { datasetInfo } from "./dataset-info";
3+
import type { DatasetEntry } from "./list-datasets";
4+
import type { ApiDatasetInfo } from "../types/api/api-dataset";
35

46
describe("datasetInfo", () => {
57
it("should return the dataset info", async () => {
@@ -16,4 +18,39 @@ describe("datasetInfo", () => {
1618
private: false,
1719
});
1820
});
21+
22+
it("should return the dataset info with author", async () => {
23+
const info: DatasetEntry & Pick<ApiDatasetInfo, 'author'> = await datasetInfo({
24+
name: "nyu-mll/glue",
25+
additionalFields: ['author'],
26+
});
27+
expect(info).toEqual({
28+
id: "621ffdd236468d709f181e3f",
29+
downloads: expect.any(Number),
30+
gated: false,
31+
name: "nyu-mll/glue",
32+
updatedAt: expect.any(Date),
33+
likes: expect.any(Number),
34+
private: false,
35+
author: 'nyu-mll'
36+
});
37+
});
38+
39+
it("should return the dataset info for a specific revision", async () => {
40+
const info: DatasetEntry & Pick<ApiDatasetInfo, 'sha'> = await datasetInfo({
41+
name: "nyu-mll/glue",
42+
revision: "cb2099c76426ff97da7aa591cbd317d91fb5fcb7",
43+
additionalFields: ["sha"],
44+
});
45+
expect(info).toEqual({
46+
id: "621ffdd236468d709f181e3f",
47+
downloads: expect.any(Number),
48+
gated: false,
49+
name: "nyu-mll/glue",
50+
updatedAt: expect.any(Date),
51+
likes: expect.any(Number),
52+
private: false,
53+
sha: 'cb2099c76426ff97da7aa591cbd317d91fb5fcb7'
54+
});
55+
});
1956
});

0 commit comments

Comments
 (0)