Commit Graph
5 Commits
Author SHA1 Message Date
Kharec 823c9f2d0f fix: share the spelling dictionaries with the translation lexicon
Every model load read the full French and English Hunspell
dictionaries from disk again, even when the spell checker already held
the same dictionary in memory. App now caches one Dictionary per
language; a Dictionary is read-only once loaded, so the checker and
the language detection share it.
2026-10-15 17:55:58 +02:00
Kharec 343836df6b fix: build the stalled-download message from the timeout
The message hard-coded "30 seconds" next to the stallTimeout constant:
change one and the other lied.
2026-10-15 17:54:56 +02:00
Kharec 82bfef8cba fix: give each translation worker its share of the CPUs
Translate runs NumCPU/2 sentence workers and each of them started
GOMAXPROCS goroutines for the logit projection of every step: on 16
cores, 128 goroutines fighting for 16 cores. The model now caps the
goroutines of a step (SetThreads, called once after Load) so that
workers x threads stays within the machine.
2026-10-15 17:53:38 +02:00
Kharec 839e9291d6 feat: resumable download and cancellable load of the translation model
Downloading the 300 MB model restarted from zero after any failure and
hung forever on a stalled connection. Download into a .partial file
that survives interruptions, resume it with a Range request (falling
back to a fresh download when the server cannot), skip files already
verified, and abort when nothing arrives for 30 s. A model directory
only counts as installed when every file has its pinned size, so a
truncated model is offered for download again instead of failing to
load.

The model load held the translation mutex, so Cancel did nothing for
the seconds it takes to read 300 MB. Load without holding the lock,
make marian.Load context-aware, and let CancelTranslation wait for the
task to wind down so a new one can start at once. The idle release
timer re-arms when it fires while a download holds the task slot,
instead of never freeing the model.
2026-10-13 18:17:53 +02:00
Kharec 803dc3328a feat: main translation script 2026-10-01 10:15:53 +02:00