chore: import upstream snapshot with attribution
Build documentation / build (push) Failing after 0s
Unit tests / build (18) (push) Has been cancelled
Unit tests / build (20) (push) Has been cancelled
Unit tests / build (22) (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 12:44:39 +08:00
commit 311a3666c4
703 changed files with 71017 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
name: "🐛 Bug Report"
description: Submit a bug report to help us improve transformers.js
labels: ["bug"]
body:
- type: textarea
id: system-info
attributes:
label: System Info
description: Please share your system info with us. If you are using other JS libraries/frameworks (e.g., React or Next.js), please include their versions too.
placeholder: transformers.js version, browser (if applicable), operating system, Node.js version, bundlers, ...
validations:
required: true
- type: checkboxes
id: environment-or-platform
attributes:
label: Environment/Platform
description: "The environment I am running in, or platform I am developing for:"
options:
- label: "Website/web-app"
- label: "Browser extension"
- label: "Server-side (e.g., Node.js, Deno, Bun)"
- label: "Desktop app (e.g., Electron)"
- label: "Other (e.g., VSCode extension)"
- type: textarea
id: description
validations:
required: true
attributes:
label: Description
description: A clear and concise description of the bug, as well as what you expected to happen.
- type: textarea
id: reproduction
validations:
required: true
attributes:
label: Reproduction
description: |
Please provide a code sample that reproduces the problem you ran into. If you have code snippets, error messages, or stack traces, please provide them here as well.
Important! Use [code tags](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) to correctly format your code.
placeholder: |
Steps to reproduce the behavior:
1.
2.
3.
+40
View File
@@ -0,0 +1,40 @@
name: "🌟 New model addition"
description: Submit a proposal/request to implement a new model
labels: ["new model"]
body:
- type: textarea
id: description-request
validations:
required: true
attributes:
label: Model description
description: |
Include important information about the model.
- type: checkboxes
id: information-tasks
attributes:
label: Prerequisites
description: |
Please note that Transformers.js relies on the model first being supported in [🤗 Transformers](https://github.com/huggingface/transformers) and [🤗 Optimum](https://github.com/huggingface/optimum). If the model you are requesting is not yet supported by either of them, feel free to open up a model request there too.
options:
- label: "The model is supported in Transformers (i.e., listed [here](https://huggingface.co/docs/transformers/index#supported-models-and-frameworks))"
- label: "The model can be exported to ONNX with Optimum (i.e., listed [here](https://huggingface.co/docs/optimum/main/en/exporters/onnx/overview))"
- type: textarea
id: additional-info
attributes:
label: Additional information
description: |
Please provide additional information about the model here.
If the model is already supported in Transformers, you can provide example Python code to help ensure the JavaScript implementation (and output) matches the original version.
- type: textarea
id: contribution
validations:
required: true
attributes:
label: Your contribution
description: |
Is there any way that you could help, e.g. by submitting a PR?
+39
View File
@@ -0,0 +1,39 @@
name: "🔧 New pipeline addition"
description: Submit a proposal/request to implement a new pipeline
labels: ["new pipeline"]
body:
- type: textarea
id: description-request
validations:
required: true
attributes:
label: Pipeline description
description: |
Include important information about the pipeline.
- type: checkboxes
id: information-tasks
attributes:
label: Prerequisites
description: |
Please note that Transformers.js relies on the pipeline first being supported in [🤗 Transformers](https://github.com/huggingface/transformers). If the pipeline you are requesting is not yet supported by Transformers, feel free to open up a feature request for it there too.
options:
- label: "The pipeline is supported in Transformers (i.e., listed [here](https://huggingface.co/docs/transformers/main_classes/pipelines))"
- label: "The task is listed [here](https://huggingface.co/tasks)"
- type: textarea
id: additional-info
attributes:
label: Additional information
description: |
Please provide additional information about the pipeline here. If the pipeline is already supported in Transformers, you can provide example Python code to help ensure the JavaScript implementation (and output) matches the original version.
- type: textarea
id: contribution
validations:
required: true
attributes:
label: Your contribution
description: |
Is there any way that you could help, e.g. by submitting a PR?
@@ -0,0 +1,30 @@
name: "🚀 Feature request"
description: Submit a proposal/request for a new transformers.js feature
labels: ["enhancement"]
body:
- type: textarea
id: feature-request
validations:
required: true
attributes:
label: Feature request
description: |
A clear and concise description of the feature proposal. If the feature is already part of the [Transformers](https://github.com/huggingface/transformers) library, please provide relevant links or example usage.
- type: textarea
id: motivation
validations:
required: true
attributes:
label: Motivation
description: |
Please outline the motivation for the proposal. Why is it important that we add this feature? What is your intended use case?
- type: textarea
id: contribution
validations:
required: true
attributes:
label: Your contribution
description: |
Is there any way that you could help, e.g. by submitting a PR?
+13
View File
@@ -0,0 +1,13 @@
name: "🙋 Question"
description: Ask a question about the library
labels: ["question"]
body:
- type: textarea
id: question
validations:
required: true
attributes:
label: Question
description: |
Please enter your question here...
+9
View File
@@ -0,0 +1,9 @@
blank_issues_enabled: true
version: 2.1
contact_links:
- name: Models on the Hugging Face Hub
url: https://huggingface.co/models?library=transformers.js
about: Open a Pull request / Discussion related to a specific model checkpoint directly on the Hugging Face Hub
- name: Documentation
url: https://huggingface.co/docs/transformers.js
about: View the transformers.js documentation
+11
View File
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
cooldown:
default-days: 7
groups:
actions:
patterns: ["*"]
+19
View File
@@ -0,0 +1,19 @@
name: Build documentation
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@90b4ee2c10b81b5c1a6367c4e6fc9e2fb510a7e3 # main
with:
commit_sha: ${{ github.sha }}
package: transformers.js
path_to_docs: transformers.js/packages/transformers/docs/source
pre_command: cd transformers.js && corepack enable && ONNXRUNTIME_NODE_INSTALL=skip pnpm install --frozen-lockfile && pnpm --filter @huggingface/transformers docs-api
additional_args: --not_python_module
secrets:
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
+19
View File
@@ -0,0 +1,19 @@
name: Build PR Documentation
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@90b4ee2c10b81b5c1a6367c4e6fc9e2fb510a7e3 # main
with:
commit_sha: ${{ github.sha }}
pr_number: ${{ github.event.number }}
package: transformers.js
path_to_docs: transformers.js/packages/transformers/docs/source
pre_command: cd transformers.js && corepack enable && ONNXRUNTIME_NODE_INSTALL=skip pnpm install --frozen-lockfile && pnpm --filter @huggingface/transformers docs-api
additional_args: --not_python_module
+28
View File
@@ -0,0 +1,28 @@
name: Publish Package to npmjs
on:
release:
types: [published]
env:
ONNXRUNTIME_NODE_INSTALL: skip
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: "24.10.0"
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm build
- name: Publish to npm
run: pnpm --filter @huggingface/transformers publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+45
View File
@@ -0,0 +1,45 @@
name: Unit tests
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- ready_for_review
env:
TESTING_REMOTELY: true
ONNXRUNTIME_NODE_INSTALL: skip
jobs:
build:
if: github.event.pull_request.draft == false
runs-on:
group: aws-general-8-plus
strategy:
matrix:
node-version: [18, 20, 22]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm build
# Setup the testing environment
- run: git lfs install && GIT_CLONE_PROTECTION_ACTIVE=false git clone https://huggingface.co/hf-internal-testing/tiny-random-T5ForConditionalGeneration ./packages/transformers/models/hf-internal-testing/tiny-random-T5ForConditionalGeneration
# Actually run tests
- run: pnpm test
@@ -0,0 +1,16 @@
name: Upload PR Documentation
on:
workflow_run:
workflows: ["Build PR Documentation"]
types:
- completed
jobs:
build:
uses: huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml@9ad2de8582b56c017cb530c1165116d40433f1c6 # main
with:
package_name: transformers.js
secrets:
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}