Skip to content

Commit eee7dd0

Browse files
committed
chore: interscript ^5.2.1 + E3 bench scripts + demo error causes
1 parent 7ee2eb9 commit eee7dd0

5 files changed

Lines changed: 46 additions & 6 deletions

File tree

e2e/e3-bench.mjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// E3: browser-tier benchmark through the LIVE /neural page (paper C).
2+
import { chromium } from "@playwright/test"
3+
4+
const URL = "https://interscript.org/neural"
5+
const MODEL = "tha-g2p-small-1.0" // smallest tier for a headless-runnable pass
6+
const browser = await chromium.launch()
7+
const page = await browser.newPage()
8+
9+
const t0 = Date.now()
10+
await page.goto(URL, { waitUntil: "networkidle" })
11+
console.log(`page load: ${Date.now() - t0} ms`)
12+
13+
await page.selectOption("#model", MODEL)
14+
await page.evaluate(() => caches.keys().then((k) => Promise.all(k.map((n) => caches.delete(n)))))
15+
for (const pass of ["cold", "warm"]) {
16+
const t1 = Date.now()
17+
await page.click("#run")
18+
await page.waitForFunction(() => document.getElementById("output").textContent.length > 0, null, { timeout: 600000 })
19+
const out = await page.textContent("#output")
20+
console.log(`${pass} resolve+session+decode: ${Date.now() - t1} ms (out ${out.length}B)`)
21+
if (pass === "cold") await page.click("#clear-cache")
22+
}
23+
await browser.close()

e2e/e3-debug.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { chromium } from "@playwright/test"
2+
const b = await chromium.launch()
3+
const p = await b.newPage()
4+
await p.goto("https://interscript.org/neural", { waitUntil: "networkidle" })
5+
const res = await p.evaluate(async () => {
6+
try {
7+
const r = await fetch("https://github.com/interscript/interscript-ml/releases/download/index-v2/models-index.yaml.sha256")
8+
return `ok ${r.status}`
9+
} catch (e) { return `FAIL ${e.message} | ${e.cause?.message ?? ""}` }
10+
})
11+
console.log("index fetch:", res)
12+
const same = await p.evaluate(async () => {
13+
try { const r = await fetch("/v1/info"); return `ok ${r.status}` } catch (e) { return `FAIL ${e.message}` }
14+
})
15+
console.log("same-origin:", same)
16+
await b.close()

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@iso24229/iso639-data": "^0.2.0",
3434
"@tailwindcss/vite": "^4.0.0",
3535
"astro": "^7.0.0",
36-
"interscript": "^5.2.0",
36+
"interscript": "^5.2.1",
3737
"onnxruntime-web": "^1.29.0",
3838
"tailwindcss": "^4.0.0",
3939
"vue": "^3.5.0"

src/pages/neural.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ import Base from "../layouts/Base.astro"
137137
conf.textContent = `Decode confidence: min top-2 gap ${min.toFixed(2)} across ${gaps.length} steps (lower = less certain)`
138138
}
139139
} catch (e) {
140-
out.textContent = `Error: ${(e as Error).message}`
140+
const cause = (e as Error).cause as Error | undefined
141+
out.textContent = `Error: ${(e as Error).message}${cause ? " | cause: " + cause.message : ""}`
141142
}
142143
})
143144

0 commit comments

Comments
 (0)