Lilly model bundle
Browse files- .gitattributes +2 -0
- README.md +50 -3
- listen/built.json +1 -1
- listen/config.json +22 -25
- listen/model.bin +2 -2
- listen/preprocessor_config.json +1 -1
- listen/tokenizer.json +0 -0
- listen/vocabulary.json +1 -2
- translator-en-bs/built.json +1 -0
- translator-en-bs/config.json +10 -0
- translator-en-bs/model.bin +3 -0
- translator-en-bs/source.spm +3 -0
- translator-en-bs/target.spm +3 -0
- translator-en-bs/vocab.json +0 -0
.gitattributes
CHANGED
|
@@ -37,3 +37,5 @@ translate/source.spm filter=lfs diff=lfs merge=lfs -text
|
|
| 37 |
translate/target.spm filter=lfs diff=lfs merge=lfs -text
|
| 38 |
translator/source.spm filter=lfs diff=lfs merge=lfs -text
|
| 39 |
translator/target.spm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 37 |
translate/target.spm filter=lfs diff=lfs merge=lfs -text
|
| 38 |
translator/source.spm filter=lfs diff=lfs merge=lfs -text
|
| 39 |
translator/target.spm filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
translator-en-bs/source.spm filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
translator-en-bs/target.spm filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -14,6 +14,7 @@ tags:
|
|
| 14 |
- ocr
|
| 15 |
base_model:
|
| 16 |
- Helsinki-NLP/opus-mt-tc-big-zls-en
|
|
|
|
| 17 |
- Systran/faster-whisper-small
|
| 18 |
- hexgrad/Kokoro-82M
|
| 19 |
- PaddlePaddle/PP-OCRv6_medium_det
|
|
@@ -31,14 +32,19 @@ redistributed unchanged, credited below. One — the translator — is fine-tune
|
|
| 31 |
project, and is the only part with scores of its own on this page. Everything the app
|
| 32 |
needs is here, so it never reaches the network at runtime.
|
| 33 |
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
## Layout
|
| 37 |
|
| 38 |
| Folder | Ability | Built from | Format | Fine-tuned here? |
|
| 39 |
|---|---|---|---|---|
|
| 40 |
| `translator/` | Bosnian text → English text | OPUS-MT `opus-mt-tc-big-zls-en` | CTranslate2, int8 | **yes** — LoRA merged into the weights |
|
| 41 |
-
| `
|
|
|
|
| 42 |
| `read/` | photo of Bosnian text → text | EasyOCR (CRAFT detector + Latin recogniser) | PyTorch checkpoints | **yes** — recogniser only, words 69.5% → 88.3%. **Since 5 Sep 2026 the app does not read with these weights: it reads with PaddleOCR PP-OCRv6** (Baidu's published weights, untrained, at a recogniser confidence floor of 0.9), fetched at run time by PaddleX from its Hugging Face mirror and **not part of this bundle**. `read/` is the way back — `LILLY_READER=easyocr` — and the "before" build every comparison is measured against. |
|
| 43 |
| `speak/` | English text → spoken English | Kokoro-82M | PyTorch checkpoint + one voice | no — stock weights |
|
| 44 |
|
|
@@ -50,6 +56,7 @@ name.
|
|
| 50 |
from app.lilly import lilly
|
| 51 |
|
| 52 |
lilly.translate("Dobar dan") # Bosnian text -> English text
|
|
|
|
| 53 |
lilly.listen("clip.m4a") # spoken Bosnian -> Bosnian text
|
| 54 |
lilly.speak("Good day", "out.wav") # English text -> spoken English
|
| 55 |
lilly.read("sign.jpg") # photo -> Bosnian text
|
|
@@ -57,6 +64,29 @@ lilly.read("sign.jpg") # photo -> Bosnian text
|
|
| 57 |
|
| 58 |
---
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
# Measured translation quality
|
| 61 |
|
| 62 |
**Test set:** 2,009 FLORES-200 Bosnian–English pairs, held out — not in the base model's
|
|
@@ -223,7 +253,21 @@ see upstream.
|
|
| 223 |
**`listen/` — speech.** Word error rate on 200 held-out FLEURS Bosnian clips, same clips
|
| 224 |
before and after: **38.5% → 35.5%**. Whisper-small with a LoRA adapter, three epochs, and
|
| 225 |
the validation loss fell at every epoch. Kaggle's own run of the same measurement read
|
| 226 |
-
38.4% → 35.1%; the numbers published here are the ones reproduced locally.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
|
| 228 |
**`read/` — photographs.** Only the recogniser is fine-tuned; the CRAFT detector is stock.
|
| 229 |
Measured through easyocr's own recognise path with the app's allowlist, on 600 held-out
|
|
@@ -325,6 +369,9 @@ NOTICE.md was written when the translation folder was named `translate/`; its
|
|
| 325 |
|
| 326 |
- `translator/` — the OPUS-MT weights with this project's LoRA fine-tuning merged in,
|
| 327 |
then converted to CTranslate2 int8. Not byte-identical to upstream, by design.
|
|
|
|
|
|
|
|
|
|
| 328 |
- `listen/` — the Whisper-small weights fine-tuned on Bosnian audio, then converted to
|
| 329 |
CTranslate2 int8. Not byte-identical to upstream.
|
| 330 |
- `read/`, `speak/` — weight files byte-identical to the originals. Two files in
|
|
|
|
| 14 |
- ocr
|
| 15 |
base_model:
|
| 16 |
- Helsinki-NLP/opus-mt-tc-big-zls-en
|
| 17 |
+
- Helsinki-NLP/opus-mt-tc-base-en-sh
|
| 18 |
- Systran/faster-whisper-small
|
| 19 |
- hexgrad/Kokoro-82M
|
| 20 |
- PaddlePaddle/PP-OCRv6_medium_det
|
|
|
|
| 32 |
project, and is the only part with scores of its own on this page. Everything the app
|
| 33 |
needs is here, so it never reaches the network at runtime.
|
| 34 |
|
| 35 |
+
Two directions. Bosnian → English is the shipped direction and carries the scores
|
| 36 |
+
below. English → Bosnian (`translator-en-bs/`, the reply the app offers under the swap
|
| 37 |
+
button) is a smaller base fine-tuned on 8 September 2026; its own numbers are in
|
| 38 |
+
"The reply direction" below, and nothing here says the two directions are of
|
| 39 |
+
comparable quality — on the evidence they are not.
|
| 40 |
|
| 41 |
## Layout
|
| 42 |
|
| 43 |
| Folder | Ability | Built from | Format | Fine-tuned here? |
|
| 44 |
|---|---|---|---|---|
|
| 45 |
| `translator/` | Bosnian text → English text | OPUS-MT `opus-mt-tc-big-zls-en` | CTranslate2, int8 | **yes** — LoRA merged into the weights |
|
| 46 |
+
| `translator-en-bs/` | English text → Bosnian text (the reply) | OPUS-MT `opus-mt-tc-base-en-sh` | CTranslate2, int8 | **yes** — LoRA merged into the weights, 8 Sep 2026 |
|
| 47 |
+
| `listen/` | spoken Bosnian → Bosnian text | `faster-whisper-small` (Whisper small) | CTranslate2, int8 | **yes** — LoRA, word error 38.5% → 35.5% (34.9% on the bench's scorer). **Between 4 September and this publish `listen/` held a whisper-large-v3 fine-tune by mistake**, swept in by the reader publish before its gate had run; the gate (7 Sep) and the pre-registered last look on all 925 clips (8 Sep) both refused it on Croatian substitution, 1.1% → 6.1%, and it is closed. The small model is what ships. |
|
| 48 |
| `read/` | photo of Bosnian text → text | EasyOCR (CRAFT detector + Latin recogniser) | PyTorch checkpoints | **yes** — recogniser only, words 69.5% → 88.3%. **Since 5 Sep 2026 the app does not read with these weights: it reads with PaddleOCR PP-OCRv6** (Baidu's published weights, untrained, at a recogniser confidence floor of 0.9), fetched at run time by PaddleX from its Hugging Face mirror and **not part of this bundle**. `read/` is the way back — `LILLY_READER=easyocr` — and the "before" build every comparison is measured against. |
|
| 49 |
| `speak/` | English text → spoken English | Kokoro-82M | PyTorch checkpoint + one voice | no — stock weights |
|
| 50 |
|
|
|
|
| 56 |
from app.lilly import lilly
|
| 57 |
|
| 58 |
lilly.translate("Dobar dan") # Bosnian text -> English text
|
| 59 |
+
lilly.reply("Good morning") # English text -> Bosnian text
|
| 60 |
lilly.listen("clip.m4a") # spoken Bosnian -> Bosnian text
|
| 61 |
lilly.speak("Good day", "out.wav") # English text -> spoken English
|
| 62 |
lilly.read("sign.jpg") # photo -> Bosnian text
|
|
|
|
| 64 |
|
| 65 |
---
|
| 66 |
|
| 67 |
+
# The reply direction — English → Bosnian
|
| 68 |
+
|
| 69 |
+
`translator-en-bs/` is `opus-mt-tc-base-en-sh` with a LoRA adapter merged in, fine-tuned
|
| 70 |
+
on 8 September 2026 on the same corpus as the forward direction with the pairs flipped,
|
| 71 |
+
and quantised to int8 the same way. It cleared all four bars written before it ran
|
| 72 |
+
(`training/PREREGISTRATION.md`, "v3 — reply"), measured on the 2,009 FLORES-200 pairs
|
| 73 |
+
with `training/evaluate.py` and `training/bosnian_form_rate.py`:
|
| 74 |
+
|
| 75 |
+
| | base as downloaded | fine-tuned | bar |
|
| 76 |
+
|---|---|---|---|
|
| 77 |
+
| chrF2, FLORES-200 | 58.96 | **60.00** (+1.04, paired bootstrap p < 0.001) | above 58.96 |
|
| 78 |
+
| BLEU, FLORES-200 | 29.57 | **30.73** (+1.16, p < 0.001) | not below 29.57 |
|
| 79 |
+
| Bosnian form rate, 338 audited targets | 94.3% | **99.2%** (244 of 246 decided) | not below 94.3% |
|
| 80 |
+
| `>>bos_Latn<<` against `>>hrv<<`, form-rate gap | 21.8 points | **22.5 points** | not collapsed |
|
| 81 |
+
|
| 82 |
+
The form rate asks, for words that separate Bosnian from Croatian and Serbian, which
|
| 83 |
+
form the model wrote; the label gap checks the decoder still hears its language
|
| 84 |
+
selector. Both moved the right way. Two things this does not say: the numbers are the
|
| 85 |
+
adapter's through `training/evaluate.py`, and this int8 build has not been scored through
|
| 86 |
+
the app's own path yet; and `tc-base` is a smaller model than the forward direction's
|
| 87 |
+
base, so 60.00 here and 67.47 there are not the same quality. Bound to these numbers
|
| 88 |
+
by the served build's digest, `training/RESULTS-en-bs-formrate.md`.
|
| 89 |
+
|
| 90 |
# Measured translation quality
|
| 91 |
|
| 92 |
**Test set:** 2,009 FLORES-200 Bosnian–English pairs, held out — not in the base model's
|
|
|
|
| 253 |
**`listen/` — speech.** Word error rate on 200 held-out FLEURS Bosnian clips, same clips
|
| 254 |
before and after: **38.5% → 35.5%**. Whisper-small with a LoRA adapter, three epochs, and
|
| 255 |
the validation loss fell at every epoch. Kaggle's own run of the same measurement read
|
| 256 |
+
38.4% → 35.1%; the numbers published here are the ones reproduced locally. On the
|
| 257 |
+
project's own scale (`training/RUBRIC.md`: all 925 test clips, greedy, Whisper's
|
| 258 |
+
normaliser) this listener reads **39.5%**.
|
| 259 |
+
|
| 260 |
+
A whisper-large-v3 fine-tune of the same data reads 11.9% on the 200 clips and 14.1% on
|
| 261 |
+
the 925, and it does **not** ship: it has to clear three rows, not one, and on the third
|
| 262 |
+
— how often it writes the Croatian form of a word where the Bosnian one was said — it
|
| 263 |
+
went from the small model's 1.1% (1 of 87 decided targets) to 6.1% (8 of 131, p = 0.018),
|
| 264 |
+
the same two words over and over (*Europom* for *evropom*, *vjerojatno* for
|
| 265 |
+
*vjerovatno*). By rule 3 of its pre-registration it is closed. It sat in this
|
| 266 |
+
repository's `listen/` from 4 September until this publish, ungated, because a reader
|
| 267 |
+
publish swept it in; the publisher now refuses any `listen/` but the gated one.
|
| 268 |
+
Everything about it is in `training/speech-instrument/` and `training/RESULTS-speech.md`.
|
| 269 |
+
|
| 270 |
+
**`translator-en-bs/` — the reply direction.** See "The reply direction" below.
|
| 271 |
|
| 272 |
**`read/` — photographs.** Only the recogniser is fine-tuned; the CRAFT detector is stock.
|
| 273 |
Measured through easyocr's own recognise path with the app's allowlist, on 600 held-out
|
|
|
|
| 369 |
|
| 370 |
- `translator/` — the OPUS-MT weights with this project's LoRA fine-tuning merged in,
|
| 371 |
then converted to CTranslate2 int8. Not byte-identical to upstream, by design.
|
| 372 |
+
- `translator-en-bs/` — the OPUS-MT `tc-base-en-sh` weights with this project's LoRA
|
| 373 |
+
fine-tuning merged in, then converted to CTranslate2 int8. Not byte-identical to
|
| 374 |
+
upstream, by design.
|
| 375 |
- `listen/` — the Whisper-small weights fine-tuned on Bosnian audio, then converted to
|
| 376 |
CTranslate2 int8. Not byte-identical to upstream.
|
| 377 |
- `read/`, `speak/` — weight files byte-identical to the originals. Two files in
|
listen/built.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"base": "openai/whisper-
|
|
|
|
| 1 |
+
{"base": "openai/whisper-small", "d_model": 768, "encoder_layers": 12, "quantization": "int8"}
|
listen/config.json
CHANGED
|
@@ -1,44 +1,44 @@
|
|
| 1 |
{
|
| 2 |
"alignment_heads": [
|
| 3 |
[
|
| 4 |
-
|
| 5 |
-
|
| 6 |
],
|
| 7 |
[
|
| 8 |
-
|
| 9 |
-
|
| 10 |
],
|
| 11 |
[
|
| 12 |
-
|
| 13 |
-
|
| 14 |
],
|
| 15 |
[
|
| 16 |
-
|
| 17 |
-
|
| 18 |
],
|
| 19 |
[
|
| 20 |
-
|
| 21 |
-
|
| 22 |
],
|
| 23 |
[
|
| 24 |
-
|
| 25 |
-
|
| 26 |
],
|
| 27 |
[
|
| 28 |
-
|
| 29 |
-
|
| 30 |
],
|
| 31 |
[
|
| 32 |
-
|
| 33 |
-
|
| 34 |
],
|
| 35 |
[
|
| 36 |
-
|
| 37 |
-
|
| 38 |
],
|
| 39 |
[
|
| 40 |
-
|
| 41 |
-
|
| 42 |
]
|
| 43 |
],
|
| 44 |
"lang_ids": [
|
|
@@ -140,8 +140,7 @@
|
|
| 140 |
50354,
|
| 141 |
50355,
|
| 142 |
50356,
|
| 143 |
-
50357
|
| 144 |
-
50358
|
| 145 |
],
|
| 146 |
"suppress_ids": [
|
| 147 |
1,
|
|
@@ -227,11 +226,9 @@
|
|
| 227 |
49870,
|
| 228 |
50254,
|
| 229 |
50258,
|
| 230 |
-
50359,
|
| 231 |
50360,
|
| 232 |
50361,
|
| 233 |
-
50362
|
| 234 |
-
50363
|
| 235 |
],
|
| 236 |
"suppress_ids_begin": [
|
| 237 |
220,
|
|
|
|
| 1 |
{
|
| 2 |
"alignment_heads": [
|
| 3 |
[
|
| 4 |
+
5,
|
| 5 |
+
3
|
| 6 |
],
|
| 7 |
[
|
| 8 |
+
5,
|
| 9 |
+
9
|
| 10 |
],
|
| 11 |
[
|
| 12 |
+
8,
|
| 13 |
+
0
|
| 14 |
],
|
| 15 |
[
|
| 16 |
+
8,
|
| 17 |
+
4
|
| 18 |
],
|
| 19 |
[
|
| 20 |
+
8,
|
| 21 |
+
7
|
| 22 |
],
|
| 23 |
[
|
| 24 |
+
8,
|
| 25 |
+
8
|
| 26 |
],
|
| 27 |
[
|
| 28 |
+
9,
|
| 29 |
+
0
|
| 30 |
],
|
| 31 |
[
|
| 32 |
+
9,
|
| 33 |
+
7
|
| 34 |
],
|
| 35 |
[
|
| 36 |
+
9,
|
| 37 |
+
9
|
| 38 |
],
|
| 39 |
[
|
| 40 |
+
10,
|
| 41 |
+
5
|
| 42 |
]
|
| 43 |
],
|
| 44 |
"lang_ids": [
|
|
|
|
| 140 |
50354,
|
| 141 |
50355,
|
| 142 |
50356,
|
| 143 |
+
50357
|
|
|
|
| 144 |
],
|
| 145 |
"suppress_ids": [
|
| 146 |
1,
|
|
|
|
| 226 |
49870,
|
| 227 |
50254,
|
| 228 |
50258,
|
|
|
|
| 229 |
50360,
|
| 230 |
50361,
|
| 231 |
+
50362
|
|
|
|
| 232 |
],
|
| 233 |
"suppress_ids_begin": [
|
| 234 |
220,
|
listen/model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cfc947cccdfb26ab0f404cd80df2539e314a9cc5153a3b1bc05b8fbf86f7fe98
|
| 3 |
+
size 248203797
|
listen/preprocessor_config.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"chunk_length": 30,
|
| 3 |
"feature_extractor_type": "WhisperFeatureExtractor",
|
| 4 |
-
"feature_size":
|
| 5 |
"hop_length": 160,
|
| 6 |
"n_fft": 400,
|
| 7 |
"n_samples": 480000,
|
|
|
|
| 1 |
{
|
| 2 |
"chunk_length": 30,
|
| 3 |
"feature_extractor_type": "WhisperFeatureExtractor",
|
| 4 |
+
"feature_size": 80,
|
| 5 |
"hop_length": 160,
|
| 6 |
"n_fft": 400,
|
| 7 |
"n_samples": 480000,
|
listen/tokenizer.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
listen/vocabulary.json
CHANGED
|
@@ -50357,12 +50357,11 @@
|
|
| 50357 |
"<|ba|>",
|
| 50358 |
"<|jw|>",
|
| 50359 |
"<|su|>",
|
| 50360 |
-
"<|yue|>",
|
| 50361 |
"<|translate|>",
|
| 50362 |
"<|transcribe|>",
|
| 50363 |
"<|startoflm|>",
|
| 50364 |
"<|startofprev|>",
|
| 50365 |
-
"<|
|
| 50366 |
"<|notimestamps|>",
|
| 50367 |
"<|0.00|>",
|
| 50368 |
"<|0.02|>",
|
|
|
|
| 50357 |
"<|ba|>",
|
| 50358 |
"<|jw|>",
|
| 50359 |
"<|su|>",
|
|
|
|
| 50360 |
"<|translate|>",
|
| 50361 |
"<|transcribe|>",
|
| 50362 |
"<|startoflm|>",
|
| 50363 |
"<|startofprev|>",
|
| 50364 |
+
"<|nocaptions|>",
|
| 50365 |
"<|notimestamps|>",
|
| 50366 |
"<|0.00|>",
|
| 50367 |
"<|0.02|>",
|
translator-en-bs/built.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"fine_tuned": true, "quantization": "int8", "direction": "en-bs", "adapter_md5": "c28a02c603f026eaa5e8b605465123b5"}
|
translator-en-bs/config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_source_bos": false,
|
| 3 |
+
"add_source_eos": false,
|
| 4 |
+
"bos_token": "<s>",
|
| 5 |
+
"decoder_start_token": "</s>",
|
| 6 |
+
"eos_token": "</s>",
|
| 7 |
+
"layer_norm_epsilon": null,
|
| 8 |
+
"multi_query_attention": false,
|
| 9 |
+
"unk_token": "<unk>"
|
| 10 |
+
}
|
translator-en-bs/model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:20951c157b89a77f84f453abae5ef784bc760f91076080ca2b811191dcc15072
|
| 3 |
+
size 76259395
|
translator-en-bs/source.spm
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e21a114e9cd29d86d6686270b555ebae828d7ede41d155c24885477a5fbd5ea5
|
| 3 |
+
size 795135
|
translator-en-bs/target.spm
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5af3b120c89deff27c19623dafd9c48d2198aa811cf66c21167f5fe305e6ad7e
|
| 3 |
+
size 812079
|
translator-en-bs/vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|