Upgrade @huggingface/transformers to 4.3.2 and carry the sequential-session patch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9607c8558f
commit
753ea03979
8 files changed
+136
-67
No files matched your search
@@ -1224,3 +1224,31 @@ whole-file output is equally bad, which is exactly what the absolute bar
|
||||
exists to catch.
|
||||
**Consequence:** full `bun test` ≈ 19 min on CPU (en_alien ≈ 20 min of it
|
||||
on a cold run); the fast suite excludes this file.
|
||||
|
||||
## D-WS1a — Transformers.js 4.2.0 → 4.3.2, sequential-session patch carried over
|
||||
**Status:** Accepted (2026-10-29, spec 001 Goal 1)
|
||||
`@huggingface/transformers` is now pinned to exactly `4.3.2` (latest; 4.3.0
|
||||
added Safari 26+ WebGPU). It brings onnxruntime-web
|
||||
`1.31.0-dev.20260914-8d85527a0` (was `1.26.0-dev.20260416`) and
|
||||
onnxruntime-node `1.30.0` (was `1.24.3`).
|
||||
**Patch.** Upstream `constructSessions` (`dist/transformers.web.js`) is
|
||||
still the bare `Promise.all` over sub-model sessions, so D-027/D-028's
|
||||
`options.sequentialSessionLoad` branch is still needed. Regenerated with
|
||||
`bun patch` as `patches/@huggingface%2Ftransformers@4.3.2.patch` (the same
|
||||
hunk, byte-identical apart from line offsets); the 4.2.0 patch is deleted.
|
||||
The version is pinned exactly (no caret) because the patch is keyed by
|
||||
version: a caret range would let a fresh lockfile resolve a version the
|
||||
patch does not apply to.
|
||||
**Guard.** `tests/transformers-runtime.test.ts` (fast suite) fails if the
|
||||
installed version, the `patchedDependencies` key, or the patched
|
||||
`constructSessions` body drift apart — a lost patch would otherwise only
|
||||
show up as mobile tab crashes.
|
||||
**Unchanged by the bump:** onnxruntime-web's WebGPU bundle still loads the
|
||||
`ort-wasm-simd-threaded.asyncify.{mjs,wasm}` pair (same as 1.26), and
|
||||
`scripts/build.ts` / `/ort/` already copy every `ort-wasm-*` file.
|
||||
**Parakeet (for spec 001 Goal 7):** 4.3.2 supports only the CTC variant —
|
||||
`ParakeetForCTC` (`model_type: "parakeet_ctc"`, routed through the ASR
|
||||
pipeline's wav2vec2/CTC path) plus `ParakeetFeatureExtractor`. There is no
|
||||
TDT/RNN-T (transducer) decoder or joint-network loop anywhere in the
|
||||
package, so **Parakeet TDT 0.6B v3 is not supported natively**; per the
|
||||
spec, that path uses `parakeet.js`.
|
||||
@@ -339,6 +339,10 @@ cached.
|
||||
`language`/`task` the same way the HTTP route does, and
|
||||
`tests/server-live.test.ts` covers the bridge against a fake sidecar.
|
||||
|
||||
## M8 — Transcription quality and speed (spec 001)
|
||||
- [x] Transformers.js 4.2.0 → 4.3.2, sequential-session patch regenerated
|
||||
for 4.3.2 and guarded by `tests/transformers-runtime.test.ts` (D-WS1a).
|
||||
|
||||
---
|
||||
|
||||
## Deliberately out of scope (for now)
|
||||
|
||||
@@ -57,7 +57,7 @@ onnxruntime-node 1.30.0), bun:test.
|
||||
**Interfaces:**
|
||||
- Produces: `tests/transformers-runtime.test.ts` (Task 2 adds a case to it).
|
||||
|
||||
- [ ] **Step 1: Write the failing test** `describe("@huggingface/transformers runtime")`:
|
||||
- [x] **Step 1: Write the failing test** `describe("@huggingface/transformers runtime")`:
|
||||
- `"installed version is the pinned 4.3.2"` — `node_modules/@huggingface/transformers/package.json`
|
||||
`.version === "4.3.2"`.
|
||||
- `"patchedDependencies points at an existing patch for the installed version"` — root
|
||||
@@ -65,15 +65,15 @@ onnxruntime-node 1.30.0), bun:test.
|
||||
- `"web bundle's constructSessions carries the sequential-load patch (D-027/D-028)"` — the
|
||||
`constructSessions` function text sliced from `dist/transformers.web.js` contains
|
||||
`options?.sequentialSessionLoad` and both `Promise.all(` and `for (const name of Object.keys(names))`.
|
||||
- [ ] **Step 2: Run** `bun test tests/transformers-runtime.test.ts` → FAIL on version (4.2.0) and key.
|
||||
- [ ] **Step 3:** `bun add -d @huggingface/transformers@4.3.2` (remove the 4.2.0
|
||||
- [x] **Step 2: Run** `bun test tests/transformers-runtime.test.ts` → FAIL on version (4.2.0) and key.
|
||||
- [x] **Step 3:** `bun add -d @huggingface/transformers@4.3.2` (remove the 4.2.0
|
||||
`patchedDependencies` entry first if bun refuses), `bun patch @huggingface/transformers`, re-apply
|
||||
the 4.2.0 hunk to `constructSessions` in `dist/transformers.web.js` (upstream is unchanged:
|
||||
still a bare `Promise.all`), `bun patch --commit node_modules/@huggingface/transformers`.
|
||||
`git rm` the 4.2.0 patch. Re-link the shared `.cache` symlink if the reinstall removed it.
|
||||
- [ ] **Step 4: Run** the test → PASS; `bun install --frozen-lockfile` clean; typecheck; fast
|
||||
- [x] **Step 4: Run** the test → PASS; `bun install --frozen-lockfile` clean; typecheck; fast
|
||||
suite; `bun run build`; `ls dist/ort` shows the files ort-web 1.31 requests.
|
||||
- [ ] **Step 5:** docs: AGENTS.md patch filename; `D-WS1a` (upgrade, patch carried, why upstream
|
||||
- [x] **Step 5:** docs: AGENTS.md patch filename; `D-WS1a` (upgrade, patch carried, why upstream
|
||||
doesn't obsolete it, ort versions, Parakeet = CTC only); WorkBreakdown tick. Commit
|
||||
"Upgrade @huggingface/transformers to 4.3.2 and carry the sequential-session patch".
|
||||
|
||||
|
||||
Reference in new issue
Block a user