From a5b77eb48974cfae45bac65ceb4880752444eb47 Mon Sep 17 00:00:00 2001 From: wuhei Date: Thu, 19 Nov 2026 12:38:24 +0100 Subject: english subtitles from a local translation model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Optional second line under the Chinese, translated on the machine: - -translate-model spawns llama-server (free port, /health wait, SIGTERM on exit) and uses Hy-MT2-1.8B (Tencent Hunyuan MT) — a dedicated zh→en model, 30 tok/s on CPU, so a phrase lands in 0.5-0.8s - -translate points at an already running OpenAI-compatible endpoint (ollama, LM Studio, llama-server) - the English line is sticky rather than tied to the 9 characters on screen: no LLM can keep up with a slide that lives 0.3s, so the translation lags by about one model call and never blanks between phrases - -translate-window (28 chars) trades context for latency; translations cached - phrase text is debounced 200ms and coalesced latest-wins so growth does not queue up dozens of requests - display reserves the English line only when translation is enabled, so the Chinese layout is unchanged without it; autofit now fits both lines --- web/index.html | 97 +++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 72 insertions(+), 25 deletions(-) (limited to 'web/index.html') diff --git a/web/index.html b/web/index.html index 4838047..5179370 100644 --- a/web/index.html +++ b/web/index.html @@ -4,7 +4,7 @@ lilchinese -
+
-- cgit v1.2.3