Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ export default defineConfig({
// imports; the transliteration path never loads them, but the dev
// scanner and rolldown still try to resolve them.
optimizeDeps: { exclude: ["interscript-ts"] },
// onnxruntime-web must NOT be externalized: the /neural demo loads
// the ML engine lazily in the browser, and an externalized bare
// specifier is unresolvable at runtime (the deployed demo failed
// with "Failed to resolve module specifier 'onnxruntime-web'").
// Node-only backends stay external — the client never imports them.
build: {
rolldownOptions: {
external: ["onnxruntime-web", "@litertjs/core", "onnxruntime-node"],
external: ["onnxruntime-node"],
},
},
},
Expand Down
23 changes: 23 additions & 0 deletions e2e/neural-live.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// LIVE /neural verification — downloads the real artifact through the
// assets proxy and decodes in the browser. Opt-in (LIVE_NEURAL=1) so
// CI never pulls 95MB; run against the deployed site:
// LIVE_NEURAL=1 npx playwright test e2e/neural-live.spec.ts
import { expect, test } from "@playwright/test"

test.skip(!process.env.LIVE_NEURAL, "live download test — set LIVE_NEURAL=1")

test("lite int4 tier downloads, verifies, and vocalizes in the browser", async ({ page }) => {
test.setTimeout(420_000)
await page.goto(`${process.env.LIVE_NEURAL_BASE ?? "https://interscript.org"}/neural`)
await page.selectOption("#model", "ara-diac-layerdrop-1.0-int4")
await page.fill("#input", "قوله فحكمها في الوفاة")
await page.click("#run")
// progress must appear (index resolve + download), then the model decodes
await expect(page.locator("#progress")).toBeVisible({ timeout: 30_000 })
const output = page.locator("#output")
await expect(output).not.toBeEmpty({ timeout: 420_000 })
const text = (await output.textContent()) ?? ""
// fully vocalized output carries haraqat bytes and no error surface
expect(text).toMatch(/[ً-ْٰٓ-ٕ]/)
expect(text).not.toMatch(/Error|cause:/)
})
88 changes: 16 additions & 72 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@fontsource/jetbrains-mono": "^5.3.0",
"@iso24229/iso15924-data": "^0.2.0",
"@iso24229/iso639-data": "^0.2.0",
"@litertjs/core": "^2.5.3",
"@tailwindcss/vite": "^4.0.0",
"astro": "^7.0.0",
"interscript": "^5.2.1",
Expand Down