Record isolated Piper Anna pilot and CPU performance checks
This commit is contained in:
1 parent
884b2fa184
commit
4e00be9a15
30 files changed
+1654
No files matched your search
@@ -0,0 +1,162 @@
|
||||
# Piper CPU and Anna adaptation pilot · 27 October 2026
|
||||
|
||||
Michael authorized trying Piper and, explicitly, temporarily unloading idle
|
||||
Qwen for GPU training and restoring it afterwards. This is an isolated pilot,
|
||||
not an accepted Anna replacement or a production endpoint integration.
|
||||
|
||||
## Observed outcome
|
||||
|
||||
- Piper 1.8.0 CPU inference passes the speed gate with substantial headroom.
|
||||
- Anna fine-tuning completed on the RTX 5080: **1,000 generator batches /
|
||||
2,000 optimizer updates in 249.10 seconds**, peak allocated GPU memory
|
||||
5,641 MiB. The two optimizers explain the differing step counts.
|
||||
- The exported Anna model is 63,516,051 bytes, 22,050 Hz mono. Its architecture
|
||||
and CPU thread count are unchanged from the medium baseline.
|
||||
- **Voice identity and naturalness are not accepted.** Listening by Michael is
|
||||
required. Local STT still finds errors, especially in the technical passage;
|
||||
no claim that additional training will necessarily resolve them.
|
||||
- Qwen `flash-next-strata-iq3-dual` is restored, `/health` reports loaded/ok,
|
||||
and no own trainer remains. Production settings and original Anna reference
|
||||
match the before-test hashes. Deck was not restarted.
|
||||
- Articulino CPU TTS and Parakeet STT stayed enabled and resident. No Hermes,
|
||||
Mac app or production TTS worker code changed. Native client playback of
|
||||
these new Piper files has **not** been tested.
|
||||
|
||||
## Measurements
|
||||
|
||||
Four ONNX intra-op threads, one inter-op thread, sequential execution,
|
||||
CPUExecutionProvider only, two tiny warmups. Own transient units used
|
||||
CPUQuota=400%, AllowedCPUs=2-5,8-11, Nice=10, MemoryMax=2G,
|
||||
MemorySwapMax=0, PrivateDevices=yes, no network and a 90-second limit.
|
||||
The first filter was predeclared as RTF <= 0.2, not as Articulino parity or a
|
||||
user-specified exact threshold. Model loading is separate from generation.
|
||||
|
||||
| Arm | Story 1 audio / generation | Story 2 audio / generation | Technical audio / generation | Weighted RTF |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| Public Thorsten medium | 11.44 / 0.330 s | 11.55 / 0.326 s | 9.74 / 0.273 s | 0.02840 |
|
||||
| Anna, 250 generator batches | 13.99 / 0.404 s | 13.37 / 0.379 s | 10.69 / 0.306 s | 0.02864 |
|
||||
| Anna, 500 generator batches | 13.19 / 0.574 s | 13.94 / 0.612 s | 10.15 / 0.438 s | 0.04357 |
|
||||
| Anna, 1,000 generator batches | 13.10 / 0.373 s | 13.19 / 0.364 s | 10.23 / 0.287 s | 0.02803 |
|
||||
|
||||
The 500-batch timing overlapped the final CPU export and Qwen reload; do not
|
||||
attribute its lower speed to that checkpoint. The final measurement ran with
|
||||
Qwen resident again and the GPU trainer finished. These are short probes,
|
||||
not a concurrency/load benchmark. The final three runs are 35.2–36.3x realtime;
|
||||
first sentence 89–113 ms, peak process RSS about 261 MiB.
|
||||
|
||||
Unmodified synthetic story and technical text are recorded in the JSON results.
|
||||
STT uses the existing local Parakeet CPU CLI. Its lexical word-error proxy
|
||||
normalizes case and punctuation but not number spellings or merged words.
|
||||
For example, the public baseline's `Vögelsingen` counts as two edits although
|
||||
it may be an orthographic ASR decision. STT is neither a human transcript nor
|
||||
a voice-identity score. Final story runs: 2/36 and 1/36 edits; final technical
|
||||
passage: 9/25. Examples include `Vögel zählen` and `Bergkopf` for `Backup`.
|
||||
The public baseline also has technical ASR deviations (4/25 edits).
|
||||
|
||||
An additional **untrained checkpoint re-export** through the same current
|
||||
exporter/CPU runtime gives 0/36 edits in each story and 4/25 in the technical
|
||||
passage (weighted RTF 0.02934). This does not prove every dynamic-shape case,
|
||||
but provides no evidence that a generally broken export explains the Anna
|
||||
pilot's extra pronunciation deviations. Do not label this pilot production-ready.
|
||||
|
||||
The extra `pronunciation_probe.py` uses **explicitly different phonetic input**,
|
||||
recorded alongside the original input, and is not part of that benchmark.
|
||||
German eSpeak produces German readings of English brand names/units (observed
|
||||
`Home` /ho:me/, `Terabyte` with /by:te/). This explains some pronunciation
|
||||
problems, not all training/ASR deviations. The existing production enhancer is
|
||||
unchanged. The guided probe remains imperfect and is not an acceptance result.
|
||||
|
||||
## Private data and training protocol
|
||||
|
||||
Own root: `/data/athena-piper-test-20261027`, mode 0700. The supplied 15-minute
|
||||
`Anna Training.wav` was copied there, never uploaded to a provider. Original
|
||||
recording and production reference are unchanged. Local silence segmentation
|
||||
and confidence-filtered Parakeet transcripts accepted 76 clips / 882.03 seconds,
|
||||
rejected one forced-boundary clip. **Transcripts were not manually certified.**
|
||||
|
||||
69 clips form the training pool: 63 actual training clips and six internal
|
||||
validation clips. Seven independent held-out clips never enter the trainer;
|
||||
one supplies the paired original/synthetic listening sample. A single source
|
||||
recording and automatically transcribed text limit generalization conclusions.
|
||||
|
||||
Piper medium's existing German checkpoint supplies all **784 matching tensors**;
|
||||
no mismatched random architecture was silently substituted. Warmstart loads
|
||||
generator and discriminator weights, with fresh optimizers; it does not resume
|
||||
the checkpoint's old 2.7-million global step. Learning rates 5e-5 generator /
|
||||
2.5e-5 discriminator, batch 8, float32, seed 20261027, no MRD, no cloud/MOS
|
||||
scoring, no extra languages. Maximum 1,000 generator batches or 25 minutes.
|
||||
Progress checks reject nonfinite losses; a local stop-request file ends only
|
||||
the own trainer. Checkpoints at 250/500/750/1,000 batches are weight-only.
|
||||
|
||||
The default 1.8.0 phoneme map adds symbols without changing existing IDs.
|
||||
The technical probe contains no symbols missing from the public baseline map;
|
||||
the observed errors therefore cannot simply be attributed to missing symbol IDs.
|
||||
|
||||
Audio, per-clip transcripts, private held-out text, caches, checkpoints and ONNX
|
||||
weights stay outside Git. This test root is not a declared part of Deck's
|
||||
encrypted restore bundle. A future accepted custom voice must be added to that
|
||||
bundle explicitly; this experiment did not create an unsolicited backup.
|
||||
|
||||
## Native reproduction and recovery
|
||||
|
||||
The scripts are native Python/Linux; Docker supplies no compiler or trainer.
|
||||
Only `verify_preservation.py` optionally inspects today's exact Deck container
|
||||
start time. A future native deployment must replace that diagnostic with its
|
||||
service invocation/start-time check; a native full restore was not exercised.
|
||||
|
||||
Public asset revisions, URLs, sizes and hashes are in the three manifests.
|
||||
Pinned Piper source is `639388b6317fc4731e91d53da42aea68fd4166ff` (v1.8.0).
|
||||
The German Thorsten dataset is CC0 according to its model card; Piper runtime
|
||||
is GPL. Consult those original licenses when redistributing software/voices.
|
||||
|
||||
On Debian 13 with Python 3.13.5 and GCC:
|
||||
|
||||
1. Create the own private root, copy scripts/manifests, run `prepare.py` for the
|
||||
CPU-only venv. It contains no Torch/CUDA inference dependencies.
|
||||
2. Run `speed.py` under the CPU limits above. Only if it passes, copy authorized
|
||||
Anna input as `anna-input.wav` and run `prepare_data.py` with the installed
|
||||
local Parakeet binary/model paths verified first.
|
||||
3. Run `prepare_training.py`: separate `train-venv`, Torch 2.13.0 CUDA 13,
|
||||
Lightning 2.6.6, Cython and ONNX exporter. Exact resolved packages are recorded.
|
||||
Debian `libpython3.13-dev` and `python3.13-dev` **3.13.5-2+deb13u5** are downloaded
|
||||
and extracted under the test root, never installed on the host. Build the
|
||||
alignment extension there and copy it into the wheel's nested alignment
|
||||
package. Matching Debian headers/compiler must be supplied explicitly on
|
||||
another OS/Python version; do not blindly reuse these native paths.
|
||||
4. With GPUs hidden, run `train_pilot.py prepare`. Verify the tensor match and
|
||||
prepared clip counts. Set `TMPDIR` to the own writable `tmp/` for sandboxed units.
|
||||
5. After authorized idle/drain checks, temporarily disable the previously
|
||||
enabled chat profiles through Deck's authenticated UI and use **Modell
|
||||
entladen**. CPU TTS/STT remain enabled; never use video-mode switching,
|
||||
endpoint stop or a Deck restart to free the training GPU.
|
||||
6. Resolve the RTX 5080 by UUID from `nvidia-smi`, not a numeric CUDA index:
|
||||
CUDA's default enumeration mapped numeric index 1 to the 3060 here. The
|
||||
wrong-device assertion stopped that attempt before training. Run
|
||||
`train_pilot.py train` under an own transient systemd unit, MemoryMax=12G,
|
||||
CPUQuota=500%, RuntimeMaxSec=1620, TimeoutStopSec=60, no network, writable
|
||||
own root only. Do not enable PrivateDevices for the GPU trainer.
|
||||
7. **After success, error or interruption**, stop/wait only the own trainer,
|
||||
restore exactly the former chat-profile publication through the UI, and
|
||||
reload the previous Qwen profile with a short ordinary authenticated request.
|
||||
No auto-restore daemon or persistent service was installed. If this workflow
|
||||
is automated later it needs a finally/watchdog for this manual UI restoration.
|
||||
8. Export checkpoints with `export_pilot.py`, then `speed.py --model ...
|
||||
--results ... --prefix ...` and `evaluate.py` on CPU. The official exporter
|
||||
is used with explicit `dynamo=False` for Torch 2.13; Python 3.13's PosixPath
|
||||
alias is narrowly allowlisted for the public old checkpoint. ONNX checker
|
||||
passes. The exporter emits expected dynamic-shape tracer warnings; several
|
||||
sentence lengths are exercised by the CPU probes, not exhaustively proved.
|
||||
9. Verify settings/reference/source hashes, worker health and absence of the
|
||||
own trainer. Do not replace unrelated endpoint settings with a stale snapshot.
|
||||
|
||||
Initial setup failures (missing Python headers, nested extension output,
|
||||
sandbox TMPDIR, CUDA numeric-device order, and the old-checkpoint PosixPath
|
||||
alias) were diagnosed before retrying; no production service restart resulted.
|
||||
The corrected training preparation/import recipe was rerun successfully.
|
||||
|
||||
## Sources
|
||||
|
||||
- [Official Piper training guide](https://github.com/OHF-Voice/piper1-gpl/blob/639388b6317fc4731e91d53da42aea68fd4166ff/docs/TRAINING.md)
|
||||
- [Piper v1.8.0 source](https://github.com/OHF-Voice/piper1-gpl/tree/639388b6317fc4731e91d53da42aea68fd4166ff)
|
||||
- [Public training checkpoint dataset](https://huggingface.co/datasets/rhasspy/piper-checkpoints/tree/37d1bea250e21ca0d617818d2bef1db724edb80c/de/de_DE/thorsten/medium)
|
||||
- [Baseline voice and model card](https://huggingface.co/rhasspy/piper-voices/tree/5041a7a49ae5b3a0f30e6837769eb03fdbb231bd/de/de_DE/thorsten/medium)
|
||||
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"phase": "complete",
|
||||
"phase_started_monotonic": 87581.910079087,
|
||||
"voice": "piper-anna-1000",
|
||||
"threads": 4,
|
||||
"affinity": [
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11
|
||||
],
|
||||
"runs": [
|
||||
{
|
||||
"file": "piper-anna-1000-story-1.wav",
|
||||
"text": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"generation_seconds": 0.372568175997003,
|
||||
"duration_seconds": 13.096054421768708,
|
||||
"rtf": 0.028448887275369556,
|
||||
"times_realtime": 35.15075968773579,
|
||||
"first_sentence_seconds": 0.0900434149953071,
|
||||
"chunks": 4,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 1.3851950354609929e-05,
|
||||
"peak_rss_kib": 254456
|
||||
},
|
||||
{
|
||||
"file": "piper-anna-1000-story-2.wav",
|
||||
"text": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"generation_seconds": 0.3635522939875955,
|
||||
"duration_seconds": 13.188934240362812,
|
||||
"rtf": 0.02756494856688243,
|
||||
"times_realtime": 36.27795631737321,
|
||||
"first_sentence_seconds": 0.0885125279892236,
|
||||
"chunks": 4,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 1.719300176056338e-05,
|
||||
"peak_rss_kib": 254456
|
||||
},
|
||||
{
|
||||
"file": "piper-anna-1000-technical.wav",
|
||||
"text": "Home Assistant läuft in einem Docker-Container auf Unraid. Die SSD hat zwei Terabyte Kapazität. Das Backup ist abgeschlossen, und im Log stehen keine Fehler.",
|
||||
"generation_seconds": 0.28731617399898823,
|
||||
"duration_seconds": 10.228390022675738,
|
||||
"rtf": 0.028090068267051335,
|
||||
"times_realtime": 35.59977108254183,
|
||||
"first_sentence_seconds": 0.11334588799218182,
|
||||
"chunks": 3,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 1.3301645856980703e-05,
|
||||
"peak_rss_kib": 266800
|
||||
}
|
||||
],
|
||||
"gate_max_rtf": 0.2,
|
||||
"gate_note": "Conservative >=5x-realtime first filter, not Articulino parity or user-specified exact threshold",
|
||||
"load_seconds": 0.5906786319974344,
|
||||
"providers": [
|
||||
"CPUExecutionProvider"
|
||||
],
|
||||
"sample_rate": 22050,
|
||||
"piper_version": "1.8.0",
|
||||
"onnxruntime_version": "1.23.2",
|
||||
"setup_warmups": [
|
||||
{
|
||||
"file": "piper-anna-1000-warmup-1.wav",
|
||||
"text": "Hallo.",
|
||||
"generation_seconds": 0.026056098999106325,
|
||||
"duration_seconds": 0.6617687074829932,
|
||||
"rtf": 0.03937342262406075,
|
||||
"times_realtime": 25.397842843078337,
|
||||
"first_sentence_seconds": 0.02600644600170199,
|
||||
"chunks": 1,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 6.853070175438596e-05,
|
||||
"peak_rss_kib": 156364
|
||||
},
|
||||
{
|
||||
"file": "piper-anna-1000-warmup-2.wav",
|
||||
"text": "Hallo.",
|
||||
"generation_seconds": 0.021243618000880815,
|
||||
"duration_seconds": 0.626938775510204,
|
||||
"rtf": 0.033884677149842446,
|
||||
"times_realtime": 29.511864480156326,
|
||||
"first_sentence_seconds": 0.021204153992584907,
|
||||
"chunks": 1,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 7.233796296296296e-05,
|
||||
"peak_rss_kib": 159460
|
||||
}
|
||||
],
|
||||
"decision": "speed_gate_passed",
|
||||
"weighted_rtf": 0.028029086347175682
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"checkpoint": "anna-final.ckpt",
|
||||
"output": "anna-1000.onnx",
|
||||
"bytes": 63516051,
|
||||
"sha256": "2f7f8d05401cbcdc5d6250091aa69cf30783dc1f5b2b9ebb29517f2d2f94ba3b",
|
||||
"export_seconds": 2.590410681994399,
|
||||
"exporter": "Piper 1.8.0, explicit dynamo=False",
|
||||
"onnx_checked": true
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"phase": "complete",
|
||||
"phase_started_monotonic": 87245.88149353,
|
||||
"voice": "piper-anna-250",
|
||||
"threads": 4,
|
||||
"affinity": [
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11
|
||||
],
|
||||
"runs": [
|
||||
{
|
||||
"file": "piper-anna-250-story-1.wav",
|
||||
"text": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"generation_seconds": 0.4044927950017154,
|
||||
"duration_seconds": 13.990022675736961,
|
||||
"rtf": 0.028912947775505137,
|
||||
"times_realtime": 34.58658064769146,
|
||||
"first_sentence_seconds": 0.10106559500854928,
|
||||
"chunks": 4,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 1.2966804979253112e-05,
|
||||
"peak_rss_kib": 251672
|
||||
},
|
||||
{
|
||||
"file": "piper-anna-250-story-2.wav",
|
||||
"text": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"generation_seconds": 0.37933236701064743,
|
||||
"duration_seconds": 13.374693877551021,
|
||||
"rtf": 0.028361947606692084,
|
||||
"times_realtime": 35.25850953070822,
|
||||
"first_sentence_seconds": 0.09852779700304382,
|
||||
"chunks": 4,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 1.3563368055555555e-05,
|
||||
"peak_rss_kib": 251672
|
||||
},
|
||||
{
|
||||
"file": "piper-anna-250-technical.wav",
|
||||
"text": "Home Assistant läuft in einem Docker-Container auf Unraid. Die SSD hat zwei Terabyte Kapazität. Das Backup ist abgeschlossen, und im Log stehen keine Fehler.",
|
||||
"generation_seconds": 0.3061924950015964,
|
||||
"duration_seconds": 10.692789115646258,
|
||||
"rtf": 0.02863541885003224,
|
||||
"times_realtime": 34.9217870790416,
|
||||
"first_sentence_seconds": 0.10639156401157379,
|
||||
"chunks": 3,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 1.2723941368078176e-05,
|
||||
"peak_rss_kib": 256576
|
||||
}
|
||||
],
|
||||
"gate_max_rtf": 0.2,
|
||||
"gate_note": "Conservative >=5x-realtime first filter, not Articulino parity or user-specified exact threshold",
|
||||
"load_seconds": 0.6125769049976952,
|
||||
"providers": [
|
||||
"CPUExecutionProvider"
|
||||
],
|
||||
"sample_rate": 22050,
|
||||
"piper_version": "1.8.0",
|
||||
"onnxruntime_version": "1.23.2",
|
||||
"setup_warmups": [
|
||||
{
|
||||
"file": "piper-anna-250-warmup-1.wav",
|
||||
"text": "Hallo.",
|
||||
"generation_seconds": 0.054873104993021116,
|
||||
"duration_seconds": 0.8475283446712019,
|
||||
"rtf": 0.06474486114598221,
|
||||
"times_realtime": 15.445241248494913,
|
||||
"first_sentence_seconds": 0.05482486500113737,
|
||||
"chunks": 1,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 5.351027397260274e-05,
|
||||
"peak_rss_kib": 160196
|
||||
},
|
||||
{
|
||||
"file": "piper-anna-250-warmup-2.wav",
|
||||
"text": "Hallo.",
|
||||
"generation_seconds": 0.02659643700462766,
|
||||
"duration_seconds": 0.7778684807256235,
|
||||
"rtf": 0.03419143166697994,
|
||||
"times_realtime": 29.247093533253267,
|
||||
"first_sentence_seconds": 0.026557944001979195,
|
||||
"chunks": 1,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 5.830223880597015e-05,
|
||||
"peak_rss_kib": 167416
|
||||
}
|
||||
],
|
||||
"decision": "speed_gate_passed",
|
||||
"weighted_rtf": 0.028641332054079517
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"phase": "complete",
|
||||
"phase_started_monotonic": 87488.070713428,
|
||||
"voice": "piper-anna-500",
|
||||
"threads": 4,
|
||||
"affinity": [
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11
|
||||
],
|
||||
"runs": [
|
||||
{
|
||||
"file": "piper-anna-500-story-1.wav",
|
||||
"text": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"generation_seconds": 0.5743318930035457,
|
||||
"duration_seconds": 13.188934240362812,
|
||||
"rtf": 0.04354649758172928,
|
||||
"times_realtime": 22.96395934307167,
|
||||
"first_sentence_seconds": 0.15775739400123712,
|
||||
"chunks": 4,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 1.3754401408450705e-05,
|
||||
"peak_rss_kib": 249668
|
||||
},
|
||||
{
|
||||
"file": "piper-anna-500-story-2.wav",
|
||||
"text": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"generation_seconds": 0.6118481840094319,
|
||||
"duration_seconds": 13.94358276643991,
|
||||
"rtf": 0.04388027053434629,
|
||||
"times_realtime": 22.78928520318198,
|
||||
"first_sentence_seconds": 0.17677178401208948,
|
||||
"chunks": 4,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 1.300999167360533e-05,
|
||||
"peak_rss_kib": 257040
|
||||
},
|
||||
{
|
||||
"file": "piper-anna-500-technical.wav",
|
||||
"text": "Home Assistant läuft in einem Docker-Container auf Unraid. Die SSD hat zwei Terabyte Kapazität. Das Backup ist abgeschlossen, und im Log stehen keine Fehler.",
|
||||
"generation_seconds": 0.43826043300214224,
|
||||
"duration_seconds": 10.147120181405896,
|
||||
"rtf": 0.043190622084602205,
|
||||
"times_realtime": 23.15317427105334,
|
||||
"first_sentence_seconds": 0.1714300839958014,
|
||||
"chunks": 3,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 1.3408180778032036e-05,
|
||||
"peak_rss_kib": 260068
|
||||
}
|
||||
],
|
||||
"gate_max_rtf": 0.2,
|
||||
"gate_note": "Conservative >=5x-realtime first filter, not Articulino parity or user-specified exact threshold",
|
||||
"load_seconds": 0.6087181729963049,
|
||||
"providers": [
|
||||
"CPUExecutionProvider"
|
||||
],
|
||||
"sample_rate": 22050,
|
||||
"piper_version": "1.8.0",
|
||||
"onnxruntime_version": "1.23.2",
|
||||
"setup_warmups": [
|
||||
{
|
||||
"file": "piper-anna-500-warmup-1.wav",
|
||||
"text": "Hallo.",
|
||||
"generation_seconds": 0.03265011998882983,
|
||||
"duration_seconds": 0.5224489795918368,
|
||||
"rtf": 0.06249437029111959,
|
||||
"times_realtime": 16.001441335302157,
|
||||
"first_sentence_seconds": 0.03259873398928903,
|
||||
"chunks": 1,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 8.680555555555556e-05,
|
||||
"peak_rss_kib": 153532
|
||||
},
|
||||
{
|
||||
"file": "piper-anna-500-warmup-2.wav",
|
||||
"text": "Hallo.",
|
||||
"generation_seconds": 0.03356992198678199,
|
||||
"duration_seconds": 0.6617687074829932,
|
||||
"rtf": 0.05072757537065124,
|
||||
"times_realtime": 19.713144038391324,
|
||||
"first_sentence_seconds": 0.03352731199993286,
|
||||
"chunks": 1,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 6.853070175438596e-05,
|
||||
"peak_rss_kib": 160744
|
||||
}
|
||||
],
|
||||
"decision": "speed_gate_passed",
|
||||
"weighted_rtf": 0.04357447208549881
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"phase": "complete",
|
||||
"phase_started_monotonic": 87984.180435996,
|
||||
"voice": "piper-base-export-control",
|
||||
"threads": 4,
|
||||
"affinity": [
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11
|
||||
],
|
||||
"runs": [
|
||||
{
|
||||
"file": "piper-base-export-control-story-1.wav",
|
||||
"text": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"generation_seconds": 0.3201446040038718,
|
||||
"duration_seconds": 11.15718820861678,
|
||||
"rtf": 0.028694022007858727,
|
||||
"times_realtime": 34.85046466215575,
|
||||
"first_sentence_seconds": 0.08089398800802883,
|
||||
"chunks": 4,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 1.625910509885536e-05,
|
||||
"peak_rss_kib": 220192
|
||||
},
|
||||
{
|
||||
"file": "piper-base-export-control-story-2.wav",
|
||||
"text": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"generation_seconds": 0.34218063799198717,
|
||||
"duration_seconds": 11.180408163265307,
|
||||
"rtf": 0.030605379785352237,
|
||||
"times_realtime": 32.67399414787203,
|
||||
"first_sentence_seconds": 0.07795057499606628,
|
||||
"chunks": 4,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 1.622533748701973e-05,
|
||||
"peak_rss_kib": 221216
|
||||
},
|
||||
{
|
||||
"file": "piper-base-export-control-technical.wav",
|
||||
"text": "Home Assistant läuft in einem Docker-Container auf Unraid. Die SSD hat zwei Terabyte Kapazität. Das Backup ist abgeschlossen, und im Log stehen keine Fehler.",
|
||||
"generation_seconds": 0.26602944399928674,
|
||||
"duration_seconds": 9.299591836734693,
|
||||
"rtf": 0.028606572059263192,
|
||||
"times_realtime": 34.95700211574936,
|
||||
"first_sentence_seconds": 0.09324425000522751,
|
||||
"chunks": 3,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 1.4630149812734083e-05,
|
||||
"peak_rss_kib": 223268
|
||||
}
|
||||
],
|
||||
"gate_max_rtf": 0.2,
|
||||
"gate_note": "Conservative >=5x-realtime first filter, not Articulino parity or user-specified exact threshold",
|
||||
"load_seconds": 0.5929461620107759,
|
||||
"providers": [
|
||||
"CPUExecutionProvider"
|
||||
],
|
||||
"sample_rate": 22050,
|
||||
"piper_version": "1.8.0",
|
||||
"onnxruntime_version": "1.23.2",
|
||||
"setup_warmups": [
|
||||
{
|
||||
"file": "piper-base-export-control-warmup-1.wav",
|
||||
"text": "Hallo.",
|
||||
"generation_seconds": 0.034508526005083695,
|
||||
"duration_seconds": 0.626938775510204,
|
||||
"rtf": 0.05504289629717126,
|
||||
"times_realtime": 18.167648639001424,
|
||||
"first_sentence_seconds": 0.034451769999577664,
|
||||
"chunks": 1,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 7.233796296296296e-05,
|
||||
"peak_rss_kib": 153856
|
||||
},
|
||||
{
|
||||
"file": "piper-base-export-control-warmup-2.wav",
|
||||
"text": "Hallo.",
|
||||
"generation_seconds": 0.027466776009532623,
|
||||
"duration_seconds": 0.6617687074829932,
|
||||
"rtf": 0.04150509943874687,
|
||||
"times_realtime": 24.09342498927867,
|
||||
"first_sentence_seconds": 0.027428625005995855,
|
||||
"chunks": 1,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 0.00013706140350877192,
|
||||
"peak_rss_kib": 157236
|
||||
}
|
||||
],
|
||||
"decision": "speed_gate_passed",
|
||||
"weighted_rtf": 0.029343779854061013
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"piper_version": "1.8.0",
|
||||
"package": {
|
||||
"filename": "piper_tts-1.8.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl",
|
||||
"url": "https://files.pythonhosted.org/packages/84/81/0112a7d510911f33018dc24023d1655bb772f84a4e95fe7f0180f66bbd17/piper_tts-1.8.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl",
|
||||
"bytes": 34131442,
|
||||
"sha256": "25b4d3f31ff70c8fa7151908e00aaa5650cbdf16bca8fcf21299f3941b89a7d3"
|
||||
},
|
||||
"voice_repository": "rhasspy/piper-voices",
|
||||
"voice_revision": "5041a7a49ae5b3a0f30e6837769eb03fdbb231bd",
|
||||
"voice_files": [
|
||||
{
|
||||
"path": "de/de_DE/thorsten/medium/MODEL_CARD",
|
||||
"bytes": 285,
|
||||
"url": "https://huggingface.co/rhasspy/piper-voices/resolve/5041a7a49ae5b3a0f30e6837769eb03fdbb231bd/de/de_DE/thorsten/medium/MODEL_CARD",
|
||||
"sha256": "5196b5ab0794e6056263a1f37c18bec407b61ac187529bee29d1c366871e5c9e"
|
||||
},
|
||||
{
|
||||
"path": "de/de_DE/thorsten/medium/de_DE-thorsten-medium.onnx",
|
||||
"bytes": 63201294,
|
||||
"url": "https://huggingface.co/rhasspy/piper-voices/resolve/5041a7a49ae5b3a0f30e6837769eb03fdbb231bd/de/de_DE/thorsten/medium/de_DE-thorsten-medium.onnx",
|
||||
"sha256": "7e64762d8e5118bb578f2eea6207e1a35a8e0c30595010b666f983fc87bb7819"
|
||||
},
|
||||
{
|
||||
"path": "de/de_DE/thorsten/medium/de_DE-thorsten-medium.onnx.json",
|
||||
"bytes": 4819,
|
||||
"url": "https://huggingface.co/rhasspy/piper-voices/resolve/5041a7a49ae5b3a0f30e6837769eb03fdbb231bd/de/de_DE/thorsten/medium/de_DE-thorsten-medium.onnx.json",
|
||||
"sha256": "974adee790533adb273a1ac88f49027d2a1b8f0f2cf4905954a4791e79264e85"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
"""Private local held-out voice comparison plus STT of synthetic CPU probes."""
|
||||
import argparse
|
||||
import csv
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import time
|
||||
import wave
|
||||
|
||||
os.environ.update(CUDA_VISIBLE_DEVICES='',OMP_NUM_THREADS='4',MKL_NUM_THREADS='4')
|
||||
import numpy as np
|
||||
import onnxruntime as ort
|
||||
from piper import PiperVoice
|
||||
from piper.config import PiperConfig, SynthesisConfig
|
||||
|
||||
ROOT=Path('/data/athena-piper-test-20261027')
|
||||
CLI=Path('/opt/athena-deck-dev/runtime/state/parakeet-runtime/v0.6.1/runtime/parakeet-v0.6.1-bin-linux-cpu-x64/parakeet-cli')
|
||||
STT_MODEL=CLI.parents[2]/'redux-packed.gguf'
|
||||
parser=argparse.ArgumentParser()
|
||||
parser.add_argument('--model',required=True)
|
||||
parser.add_argument('--results',required=True)
|
||||
parser.add_argument('--prefix',required=True)
|
||||
args=parser.parse_args()
|
||||
|
||||
def words(text):
|
||||
return re.findall(r'[a-zäöüß0-9]+',text.lower())
|
||||
|
||||
def edit_distance(a,b):
|
||||
prev=list(range(len(b)+1))
|
||||
for i,x in enumerate(a,1):
|
||||
row=[i]
|
||||
for j,y in enumerate(b,1):
|
||||
row.append(min(row[-1]+1,prev[j]+1,prev[j-1]+(x!=y)))
|
||||
prev=row
|
||||
return prev[-1]
|
||||
|
||||
def stt(path,text):
|
||||
started=time.monotonic()
|
||||
run=subprocess.run([str(CLI),'transcribe','--model',str(STT_MODEL),
|
||||
'--input',str(path),'--lang','de','--threads','2','--json'],
|
||||
text=True,capture_output=True,check=True,timeout=60)
|
||||
response=json.loads(run.stdout)
|
||||
a,b=words(text),words(response['text'])
|
||||
distance=edit_distance(a,b)
|
||||
return dict(file=path.name,expected=text,recognized=response['text'],
|
||||
edit_distance=distance,reference_words=len(a),wer=distance/max(1,len(a)),
|
||||
stt_seconds=time.monotonic()-started,
|
||||
caveat='ASR proxy; lexical tokenization counts merged compounds as errors')
|
||||
|
||||
results=json.loads(Path(args.results).read_text())
|
||||
report=dict(synthetic=[stt(ROOT/'outputs'/row['file'],row['text']) for row in results['runs']],
|
||||
voice_identity='Not established by STT; human comparison required')
|
||||
with (ROOT/'anna-data/heldout.csv').open() as f:
|
||||
clip_id,text=next(csv.reader(f,delimiter='|'))
|
||||
source=ROOT/'anna-data/wav'/clip_id
|
||||
shutil.copy2(source,ROOT/'outputs/anna-original-heldout.wav')
|
||||
opts=ort.SessionOptions();opts.intra_op_num_threads=4;opts.inter_op_num_threads=1
|
||||
session=ort.InferenceSession(args.model,sess_options=opts,providers=['CPUExecutionProvider'])
|
||||
cfg=PiperConfig.from_dict(json.loads(Path(args.model+'.json').read_text()))
|
||||
voice=PiperVoice(session=session,config=cfg,download_dir=ROOT/'cache')
|
||||
chunks=list(voice.synthesize(text,syn_config=SynthesisConfig(length_scale=1.,
|
||||
noise_scale=.667,noise_w_scale=.8,normalize_audio=True)))
|
||||
pcm=b''.join(chunk.audio_int16_bytes for chunk in chunks)
|
||||
assert pcm and all(np.isfinite(c.audio_float_array).all() for c in chunks)
|
||||
path=ROOT/'outputs'/(args.prefix+'-heldout.wav')
|
||||
with wave.open(str(path),'wb') as wav:
|
||||
wav.setnchannels(1);wav.setsampwidth(2);wav.setframerate(cfg.sample_rate);wav.writeframes(pcm)
|
||||
# Private original transcription remains in the private evaluation file only.
|
||||
report['heldout_private']=stt(path,text)
|
||||
report['heldout_private']['reference_type']='ASR transcript of untrained source, not manually verified'
|
||||
(ROOT/(args.prefix+'-evaluation.private.json')).write_text(json.dumps(report,indent=2,ensure_ascii=False))
|
||||
public={k:v for k,v in report.items() if k!='heldout_private'}
|
||||
public['heldout_wer_asr_proxy']=report['heldout_private']['wer']
|
||||
(ROOT/(args.prefix+'-evaluation.json')).write_text(json.dumps(public,indent=2,ensure_ascii=False))
|
||||
print(json.dumps(public,ensure_ascii=False),flush=True)
|
||||
@@ -0,0 +1,42 @@
|
||||
"""Official Piper exporter with explicit legacy ONNX export on Torch 2.13.
|
||||
|
||||
Piper's pinned exporter predates PyTorch's dynamo-default change. Architecture,
|
||||
opset and tensor names remain those of the official exporter, unmodified.
|
||||
"""
|
||||
import argparse
|
||||
from functools import partial
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path, PosixPath
|
||||
import shutil
|
||||
import sys
|
||||
import time
|
||||
|
||||
os.environ['CUDA_VISIBLE_DEVICES']=''
|
||||
os.environ['OMP_NUM_THREADS']='2'
|
||||
os.environ['MKL_NUM_THREADS']='2'
|
||||
import torch
|
||||
from piper.train.export_onnx import main as official_export
|
||||
|
||||
parser=argparse.ArgumentParser()
|
||||
parser.add_argument('--checkpoint',required=True)
|
||||
parser.add_argument('--output',required=True)
|
||||
args=parser.parse_args()
|
||||
torch.set_num_threads(2)
|
||||
torch.serialization.add_safe_globals([PosixPath,(PosixPath,'pathlib.PosixPath')])
|
||||
torch.onnx.export=partial(torch.onnx.export,dynamo=False)
|
||||
sys.argv=['piper.train.export_onnx','--checkpoint',args.checkpoint,'--output-file',args.output]
|
||||
started=time.monotonic()
|
||||
official_export()
|
||||
root=Path('/data/athena-piper-test-20261027/anna-pilot')
|
||||
shutil.copy2(root/'anna.onnx.json',args.output+'.json')
|
||||
import onnx
|
||||
onnx.checker.check_model(args.output)
|
||||
path=Path(args.output)
|
||||
result=dict(checkpoint=Path(args.checkpoint).name,output=path.name,
|
||||
bytes=path.stat().st_size,sha256=hashlib.file_digest(path.open('rb'),'sha256').hexdigest(),
|
||||
export_seconds=time.monotonic()-started,exporter='Piper 1.8.0, explicit dynamo=False',
|
||||
onnx_checked=True)
|
||||
Path(args.output+'.export.json').write_text(json.dumps(result,indent=2))
|
||||
print(json.dumps(result),flush=True)
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"synthetic": [
|
||||
{
|
||||
"file": "piper-anna-1000-story-1.wav",
|
||||
"expected": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"recognized": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse, zum Schluss sagte sie, das hat wohl aber funktioniert.",
|
||||
"edit_distance": 2,
|
||||
"reference_words": 36,
|
||||
"wer": 0.05555555555555555,
|
||||
"stt_seconds": 0.9670747419877443,
|
||||
"caveat": "ASR proxy; lexical tokenization counts merged compounds as errors"
|
||||
},
|
||||
{
|
||||
"file": "piper-anna-1000-story-2.wav",
|
||||
"expected": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"recognized": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel zählen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse, zum Schluss sagte sie, das hat wunderbar funktioniert.",
|
||||
"edit_distance": 1,
|
||||
"reference_words": 36,
|
||||
"wer": 0.027777777777777776,
|
||||
"stt_seconds": 0.9299798220017692,
|
||||
"caveat": "ASR proxy; lexical tokenization counts merged compounds as errors"
|
||||
},
|
||||
{
|
||||
"file": "piper-anna-1000-technical.wav",
|
||||
"expected": "Home Assistant läuft in einem Docker-Container auf Unraid. Die SSD hat zwei Terabyte Kapazität. Das Backup ist abgeschlossen, und im Log stehen keine Fehler.",
|
||||
"recognized": "Oma Assistant läuft in einem Docker Container auf Unrad. GS ist die 2-Teraber Kapazität, das Bergkopf ist abgeschlossen, und im Look stehen keine Fehler.",
|
||||
"edit_distance": 9,
|
||||
"reference_words": 25,
|
||||
"wer": 0.36,
|
||||
"stt_seconds": 0.7319966439972632,
|
||||
"caveat": "ASR proxy; lexical tokenization counts merged compounds as errors"
|
||||
}
|
||||
],
|
||||
"voice_identity": "Not established by STT; human comparison required",
|
||||
"heldout_wer_asr_proxy": 0.10714285714285714
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"synthetic": [
|
||||
{
|
||||
"file": "piper-anna-500-story-1.wav",
|
||||
"expected": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"recognized": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie, das hat Bonne war funktioniert.",
|
||||
"edit_distance": 2,
|
||||
"reference_words": 36,
|
||||
"wer": 0.05555555555555555,
|
||||
"stt_seconds": 0.9392474080086686,
|
||||
"caveat": "ASR proxy; lexical tokenization counts merged compounds as errors"
|
||||
},
|
||||
{
|
||||
"file": "piper-anna-500-story-2.wav",
|
||||
"expected": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"recognized": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna ersmete das Fenster und hörte drei Vögelzin. Auf dem Tisch lagen sieben Dächer und eine rote Tasse. Zum Schluss sagte sie, das hat wunderbar funktioniert.",
|
||||
"edit_distance": 4,
|
||||
"reference_words": 36,
|
||||
"wer": 0.1111111111111111,
|
||||
"stt_seconds": 0.9690120019949973,
|
||||
"caveat": "ASR proxy; lexical tokenization counts merged compounds as errors"
|
||||
},
|
||||
{
|
||||
"file": "piper-anna-500-technical.wav",
|
||||
"expected": "Home Assistant läuft in einem Docker-Container auf Unraid. Die SSD hat zwei Terabyte Kapazität. Das Backup ist abgeschlossen, und im Log stehen keine Fehler.",
|
||||
"recognized": "Roma Assistant läuft in einem Doppel Container auf Unreid, die SSD hat zwei derabeische Kapazität, das Berghop ist abgeschlossen, und im Log stehen keine Fehler.",
|
||||
"edit_distance": 5,
|
||||
"reference_words": 25,
|
||||
"wer": 0.2,
|
||||
"stt_seconds": 0.7528127350087743,
|
||||
"caveat": "ASR proxy; lexical tokenization counts merged compounds as errors"
|
||||
}
|
||||
],
|
||||
"voice_identity": "Not established by STT; human comparison required",
|
||||
"heldout_wer_asr_proxy": 0.07142857142857142
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"synthetic": [
|
||||
{
|
||||
"file": "piper-base-export-control-story-1.wav",
|
||||
"expected": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"recognized": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie, das hat wunderbar funktioniert.",
|
||||
"edit_distance": 0,
|
||||
"reference_words": 36,
|
||||
"wer": 0.0,
|
||||
"stt_seconds": 0.8536872539989417,
|
||||
"caveat": "ASR proxy; lexical tokenization counts merged compounds as errors"
|
||||
},
|
||||
{
|
||||
"file": "piper-base-export-control-story-2.wav",
|
||||
"expected": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"recognized": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie, das hat wunderbar funktioniert.",
|
||||
"edit_distance": 0,
|
||||
"reference_words": 36,
|
||||
"wer": 0.0,
|
||||
"stt_seconds": 0.8383940370113123,
|
||||
"caveat": "ASR proxy; lexical tokenization counts merged compounds as errors"
|
||||
},
|
||||
{
|
||||
"file": "piper-base-export-control-technical.wav",
|
||||
"expected": "Home Assistant läuft in einem Docker-Container auf Unraid. Die SSD hat zwei Terabyte Kapazität. Das Backup ist abgeschlossen, und im Log stehen keine Fehler.",
|
||||
"recognized": "Home Assistant läuft in einem Docker Container auf Unreiht. Die SSD hat 2 Therabalte Kapazität, das Backup ist abgeschlossen und im Loog stehen keine Fehler.",
|
||||
"edit_distance": 4,
|
||||
"reference_words": 25,
|
||||
"wer": 0.16,
|
||||
"stt_seconds": 0.6909826649934985,
|
||||
"caveat": "ASR proxy; lexical tokenization counts merged compounds as errors"
|
||||
}
|
||||
],
|
||||
"voice_identity": "Not established by STT; human comparison required",
|
||||
"heldout_wer_asr_proxy": 0.03571428571428571
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"synthetic": [
|
||||
{
|
||||
"file": "piper-thorsten-story-1.wav",
|
||||
"expected": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"recognized": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögelsingen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie, das hat wunderbar funktioniert.",
|
||||
"edit_distance": 2,
|
||||
"reference_words": 36,
|
||||
"wer": 0.05555555555555555,
|
||||
"stt_seconds": 0.8494525700079976,
|
||||
"caveat": "ASR proxy; lexical tokenization counts merged compounds as errors"
|
||||
},
|
||||
{
|
||||
"file": "piper-thorsten-story-2.wav",
|
||||
"expected": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"recognized": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie, das hat wunderbar funktioniert.",
|
||||
"edit_distance": 0,
|
||||
"reference_words": 36,
|
||||
"wer": 0.0,
|
||||
"stt_seconds": 0.8705769009975484,
|
||||
"caveat": "ASR proxy; lexical tokenization counts merged compounds as errors"
|
||||
},
|
||||
{
|
||||
"file": "piper-thorsten-technical.wav",
|
||||
"expected": "Home Assistant läuft in einem Docker-Container auf Unraid. Die SSD hat zwei Terabyte Kapazität. Das Backup ist abgeschlossen, und im Log stehen keine Fehler.",
|
||||
"recognized": "Home Assistant läuft in einem Docker Container auf Unreid. Die SSD hat 2 Tabete Kapazität. Das Backup ist abgeschlossen und im Loog stehen keine Fehler.",
|
||||
"edit_distance": 4,
|
||||
"reference_words": 25,
|
||||
"wer": 0.16,
|
||||
"stt_seconds": 0.7341318030084949,
|
||||
"caveat": "ASR proxy; lexical tokenization counts merged compounds as errors"
|
||||
}
|
||||
],
|
||||
"voice_identity": "Not established by STT; human comparison required",
|
||||
"heldout_wer_asr_proxy": 0.07142857142857142
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
"""Isolated, pinned Piper CPU preparation; no production writes."""
|
||||
from pathlib import Path
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import urllib.request
|
||||
|
||||
ROOT = Path('/data/athena-piper-test-20261027')
|
||||
ROOT.mkdir(mode=0o700, exist_ok=True)
|
||||
os.umask(0o077)
|
||||
available = next(int(s.split()[1]) * 1024 for s in
|
||||
Path('/proc/meminfo').read_text().splitlines() if s.startswith('MemAvailable:'))
|
||||
if available < 4 * 1024**3:
|
||||
raise SystemExit('Insufficient memory reserve for isolated CPU preparation')
|
||||
manifest = json.loads((ROOT / 'download-manifest.json').read_text())
|
||||
(ROOT / 'model').mkdir(exist_ok=True)
|
||||
|
||||
def download(item, target):
|
||||
if not target.is_file():
|
||||
with urllib.request.urlopen(item['url'], timeout=90) as source, target.open('xb') as dest:
|
||||
while block := source.read(1024 * 1024):
|
||||
dest.write(block)
|
||||
digest = hashlib.file_digest(target.open('rb'), 'sha256').hexdigest()
|
||||
if target.stat().st_size != item['bytes'] or digest != item['sha256']:
|
||||
raise RuntimeError(f'Public asset checksum mismatch: {target.name}')
|
||||
|
||||
for item in manifest['voice_files']:
|
||||
download(item, ROOT / 'model' / Path(item['path']).name)
|
||||
wheel = ROOT / manifest['package']['filename']
|
||||
download(manifest['package'], wheel)
|
||||
venv = ROOT / 'venv'
|
||||
if not (venv / 'bin/python').is_file():
|
||||
subprocess.run([sys.executable, '-m', 'venv', str(venv)], check=True)
|
||||
subprocess.run([str(venv / 'bin/python'), '-m', 'pip', 'install', '--no-input',
|
||||
'--no-cache-dir', '--only-binary=:all:', str(wheel),
|
||||
'onnxruntime==1.23.2', 'numpy==2.2.6', 'pathvalidate==3.3.1'], check=True)
|
||||
freeze = subprocess.check_output([str(venv / 'bin/python'), '-m', 'pip', 'freeze'], text=True)
|
||||
(ROOT / 'requirements-resolved.txt').write_text(freeze)
|
||||
assert not any(s.lower().startswith(('torch', 'nvidia-', 'onnxruntime-gpu')) for s in freeze.splitlines())
|
||||
print(json.dumps({'prepared': True, 'python': sys.version.split()[0],
|
||||
'public_model_bytes': sum(i['bytes'] for i in manifest['voice_files']),
|
||||
'piper_version': manifest['piper_version']}), flush=True)
|
||||
@@ -0,0 +1,106 @@
|
||||
"""Prepare private Anna clips locally; only aggregate metadata goes to stdout."""
|
||||
from pathlib import Path
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import time
|
||||
import wave
|
||||
import numpy as np
|
||||
|
||||
ROOT = Path('/data/athena-piper-test-20261027')
|
||||
DATA = ROOT / 'anna-data'
|
||||
AUDIO = DATA / 'wav'
|
||||
AUDIO.mkdir(parents=True, exist_ok=True, mode=0o700)
|
||||
os.umask(0o077)
|
||||
CLI = Path('/opt/athena-deck-dev/runtime/state/parakeet-runtime/v0.6.1/runtime/parakeet-v0.6.1-bin-linux-cpu-x64/parakeet-cli')
|
||||
MODEL = Path('/opt/athena-deck-dev/runtime/state/parakeet-runtime/v0.6.1/redux-packed.gguf')
|
||||
source = ROOT / 'anna-input.wav'
|
||||
with wave.open(str(source), 'rb') as wav:
|
||||
rate = wav.getframerate()
|
||||
assert wav.getnchannels() == 1 and wav.getsampwidth() == 2
|
||||
pcm = np.frombuffer(wav.readframes(wav.getnframes()), dtype='<i2')
|
||||
hop = rate // 100
|
||||
frames = pcm[:len(pcm)//hop*hop].reshape(-1, hop).astype(np.float32)
|
||||
rms = np.sqrt(np.mean(frames * frames, axis=1))
|
||||
del frames
|
||||
threshold = min(350, max(65, float(np.percentile(rms, 8)) * 1.5))
|
||||
silent = rms < threshold
|
||||
edges = np.diff(np.r_[False, silent, False].astype(np.int8))
|
||||
pauses = [((a+b)/2)*hop for a,b in zip(np.where(edges == 1)[0], np.where(edges == -1)[0])
|
||||
if b-a >= 18]
|
||||
cuts = [0]
|
||||
forced = set()
|
||||
while len(pcm)-cuts[-1] > 16*rate:
|
||||
start = cuts[-1]
|
||||
choices = [int(p) for p in pauses if start+5*rate <= p <= start+14*rate]
|
||||
if choices:
|
||||
cuts.append(choices[-1])
|
||||
else:
|
||||
choices = [int(p) for p in pauses if start+4*rate <= p <= start+19*rate]
|
||||
if choices:
|
||||
cuts.append(choices[0])
|
||||
else:
|
||||
lo = (start+10*rate)//hop
|
||||
hi = min(len(rms), (start+16*rate)//hop)
|
||||
cut = int((lo+np.argmin(rms[lo:hi]))*hop)
|
||||
cuts.append(cut); forced.add(cut)
|
||||
cuts.append(len(pcm))
|
||||
rows = []
|
||||
accepted = []
|
||||
started = time.monotonic()
|
||||
for i,(a,b) in enumerate(zip(cuts, cuts[1:]), 1):
|
||||
row = {'id':f'anna-{i:03}', 'source_start':a/rate, 'source_end':b/rate,
|
||||
'forced_boundary':a in forced or b in forced}
|
||||
lo,hi=a//hop,min(len(rms),(b+hop-1)//hop)
|
||||
voiced=np.where(rms[lo:hi]>=threshold)[0]
|
||||
if not len(voiced):
|
||||
row['rejected']='silence'; rows.append(row); continue
|
||||
aa=max(a,(lo+int(voiced[0]))*hop-int(.12*rate))
|
||||
bb=min(b,(lo+int(voiced[-1])+1)*hop+int(.15*rate))
|
||||
path=AUDIO/(row['id']+'.wav')
|
||||
with wave.open(str(path),'wb') as wav:
|
||||
wav.setnchannels(1);wav.setsampwidth(2);wav.setframerate(rate)
|
||||
wav.writeframes(pcm[aa:bb].tobytes())
|
||||
row['duration_seconds']=(bb-aa)/rate
|
||||
result=subprocess.run([str(CLI),'transcribe','--model',str(MODEL),
|
||||
'--input',str(path),'--lang','de','--threads','2','--timestamps','--json'],
|
||||
capture_output=True,text=True,timeout=45)
|
||||
if result.returncode:
|
||||
row['rejected']='stt_failed'
|
||||
else:
|
||||
stt=json.loads(result.stdout)
|
||||
text=' '.join(stt.get('text','').replace('|',' ').split())
|
||||
conf=[w['conf'] for w in stt.get('words',[]) if isinstance(w.get('conf'),(int,float))]
|
||||
row.update(text=text,mean_word_confidence=float(np.mean(conf)) if conf else None,
|
||||
words=len(stt.get('words',[])))
|
||||
(DATA/(row['id']+'.stt.json')).write_text(json.dumps(stt,ensure_ascii=False))
|
||||
reason=('forced_boundary' if row['forced_boundary'] else
|
||||
'short_or_empty' if len(text)<12 or row['duration_seconds']<1 else
|
||||
'low_stt_confidence' if conf and np.mean(conf)<.9 else
|
||||
'unexpected_script' if re.search('[\u3400-\u9fff]',text) else None)
|
||||
if reason: row['rejected']=reason
|
||||
else:
|
||||
row['split']='heldout' if i%10==0 else 'train'
|
||||
accepted.append(row)
|
||||
rows.append(row)
|
||||
(DATA/'segments.private.json').write_text(json.dumps(rows,ensure_ascii=False,indent=2))
|
||||
(ROOT/'data-progress.json').write_text(json.dumps({'phase':'preparing',
|
||||
'processed':i,'total':len(cuts)-1,'accepted':len(accepted),
|
||||
'elapsed_seconds':time.monotonic()-started}))
|
||||
for split in ('train','heldout'):
|
||||
(DATA/f'{split}.csv').write_text(''.join(f'{r["id"]}.wav|{r["text"]}\n'
|
||||
for r in accepted if r['split']==split))
|
||||
summary={'phase':'complete','source_seconds':len(pcm)/rate,'source_sample_rate':rate,
|
||||
'source_sha256':hashlib.file_digest(source.open('rb'),'sha256').hexdigest(),
|
||||
'segments_total':len(rows),'segments_accepted':len(accepted),
|
||||
'segments_rejected':len(rows)-len(accepted),
|
||||
'train_segments':sum(r['split']=='train' for r in accepted),
|
||||
'heldout_segments':sum(r['split']=='heldout' for r in accepted),
|
||||
'accepted_audio_seconds':sum(r['duration_seconds'] for r in accepted),
|
||||
'silence_threshold_pcm16':threshold,'elapsed_seconds':time.monotonic()-started,
|
||||
'transcript_status':'Local ASR-generated; not manually verified ground truth',
|
||||
'private_outputs':'Audio and transcripts stay under the own private Athena test root'}
|
||||
(ROOT/'data-progress.json').write_text(json.dumps(summary,indent=2))
|
||||
print(json.dumps(summary),flush=True)
|
||||
@@ -0,0 +1,61 @@
|
||||
"""Own, pinned Piper training environment; no production configuration changes."""
|
||||
from pathlib import Path
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tarfile
|
||||
import urllib.request
|
||||
|
||||
ROOT = Path('/data/athena-piper-test-20261027')
|
||||
os.umask(0o077)
|
||||
|
||||
def obtain(item, target):
|
||||
if not target.is_file():
|
||||
with urllib.request.urlopen(item['url'], timeout=180) as r, target.open('xb') as f:
|
||||
while b := r.read(4*1024*1024):
|
||||
f.write(b)
|
||||
if target.stat().st_size != item['bytes'] or hashlib.file_digest(target.open('rb'), 'sha256').hexdigest() != item['sha256']:
|
||||
raise RuntimeError('Public asset integrity check failed: ' + target.name)
|
||||
|
||||
source = json.loads((ROOT/'source-archive-manifest.json').read_text())
|
||||
checkpoint = json.loads((ROOT/'training-checkpoint-manifest.json').read_text())
|
||||
obtain(source, ROOT/'piper-source.tar.gz')
|
||||
obtain(checkpoint, ROOT/'base-thorsten-medium.ckpt')
|
||||
source_dir = ROOT/('piper1-gpl-'+source['revision'])
|
||||
if not source_dir.is_dir():
|
||||
with tarfile.open(ROOT/'piper-source.tar.gz','r:gz') as archive:
|
||||
archive.extractall(ROOT,filter='data')
|
||||
venv = ROOT/'train-venv'
|
||||
if not (venv/'bin/python').is_file():
|
||||
subprocess.run([sys.executable,'-m','venv',str(venv)],check=True)
|
||||
python = str(venv/'bin/python')
|
||||
wheel = next(ROOT.glob('piper_tts-1.8.0-*.whl'))
|
||||
subprocess.run([python,'-m','pip','install','--no-input','--no-cache-dir',
|
||||
str(wheel)+'[train]','torch==2.13.0','numpy==2.2.6','onnxruntime==1.23.2',
|
||||
'setuptools','wheel','onnxscript'],check=True)
|
||||
# Debian Python headers are extracted here, never installed into the host.
|
||||
debs=ROOT/'dev-debs'
|
||||
debs.mkdir(exist_ok=True)
|
||||
subprocess.run(['apt-get','download','libpython3.13-dev=3.13.5-2+deb13u5',
|
||||
'python3.13-dev=3.13.5-2+deb13u5'],cwd=debs,check=True)
|
||||
for package in debs.glob('*.deb'):
|
||||
subprocess.run(['dpkg-deb','-x',str(package),str(ROOT/'dev-root')],check=True)
|
||||
align=source_dir/'src/piper/train/vits/monotonic_align'
|
||||
env=dict(os.environ,CFLAGS=f'-I{ROOT}/dev-root/usr/include -I{ROOT}/dev-root/usr/include/python3.13')
|
||||
subprocess.run([python,'setup.py','build_ext'],cwd=align,env=env,check=True)
|
||||
site=Path(subprocess.check_output([python,'-c','import site; print(site.getsitepackages()[0])'],text=True).strip())
|
||||
compiled=list((align/'build').glob('lib.*/piper/train/vits/monotonic_align/core*.so'))
|
||||
assert len(compiled)==1,compiled
|
||||
destination=site/'piper/train/vits/monotonic_align/monotonic_align'
|
||||
destination.mkdir(exist_ok=True)
|
||||
shutil.copy2(compiled[0],destination/compiled[0].name)
|
||||
subprocess.run([python,'-c','import torch; from piper.train.vits.lightning import VitsModel; from piper.train.vits.dataset import VitsDataModule; print("training_imports_ok",torch.__version__,torch.version.cuda)'],check=True)
|
||||
freeze=subprocess.check_output([python,'-m','pip','freeze'],text=True)
|
||||
(ROOT/'training-requirements-resolved.txt').write_text(freeze)
|
||||
(ROOT/'training-prepared.json').write_text(json.dumps({'ready':True,'source_revision':source['revision'],
|
||||
'checkpoint_sha256':checkpoint['sha256'],'training_environment':str(venv),
|
||||
'cpu_inference_environment_unchanged':True},indent=2))
|
||||
print('own_training_environment_ready',flush=True)
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ready": true,
|
||||
"matched_tensors": 784,
|
||||
"train_clips": 63,
|
||||
"validation_clips": 6,
|
||||
"external_heldout_clips": 7,
|
||||
"sample_rate": 22050,
|
||||
"transcript_source": "local STT, confidence-filtered, not manually certified"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"production_files_unchanged": {
|
||||
"profiles.json": true,
|
||||
"endpoint.json": true,
|
||||
"audio-policy.json": true,
|
||||
"cpu-partition.json": true,
|
||||
"reference.wav": true,
|
||||
"qwen_native_worker.py": true
|
||||
},
|
||||
"deck_not_restarted": true,
|
||||
"restored_profile": "flash-next-strata-iq3-dual",
|
||||
"worker_health": {
|
||||
"status": "ok",
|
||||
"loaded": true
|
||||
},
|
||||
"no_owned_trainer": true,
|
||||
"cpu_tts_profile_unchanged": true,
|
||||
"client_playback_tested": false,
|
||||
"piper_published": false,
|
||||
"verified": true
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"probe": "phonetic-input, not original-text benchmark",
|
||||
"original_input": "Home Assistant läuft in einem Docker-Container auf Unraid. Die SSD hat zwei Terabyte Kapazität. Das Backup ist abgeschlossen, und im Log stehen keine Fehler.",
|
||||
"prepared_input": "Houm Ässistent läuft in einem Docker-Container auf Anrejd. Die Es Es De hat zwei Tera Beit Kapazität. Das Bäckapp ist abgeschlossen, und im Log stehen keine Fehler.",
|
||||
"file": "piper-anna-1000-guided-technical.wav",
|
||||
"generation_seconds": 0.2898485729965614,
|
||||
"duration_seconds": 10.077460317460318,
|
||||
"rtf": 0.028762065427771183,
|
||||
"recognized": "Ho assistent läuft in einem Docker Container auf Anräde. Die SSD hat 2 TRABK, das Backup ist abgeschlossen, und in Logs stehen keine Fehler.",
|
||||
"production_enhancer_changed": false
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
"""Explicit extra pronunciation probe, separate from unchanged-text benchmarks.
|
||||
|
||||
German eSpeak reads e.g. Home as /ho:me/ and Byte as /by:te/. This probe uses
|
||||
visible phonetic spellings; it is not an unmodified-text quality result and
|
||||
does not change Athena's production text enhancer.
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import time
|
||||
import wave
|
||||
|
||||
os.environ.update(CUDA_VISIBLE_DEVICES='',OMP_NUM_THREADS='4',MKL_NUM_THREADS='4')
|
||||
import onnxruntime as ort
|
||||
from piper import PiperVoice
|
||||
from piper.config import PiperConfig,SynthesisConfig
|
||||
|
||||
ROOT=Path('/data/athena-piper-test-20261027')
|
||||
model=ROOT/'anna-pilot/anna-1000.onnx'
|
||||
opts=ort.SessionOptions();opts.intra_op_num_threads=4;opts.inter_op_num_threads=1
|
||||
voice=PiperVoice(session=ort.InferenceSession(str(model),sess_options=opts,
|
||||
providers=['CPUExecutionProvider']),config=PiperConfig.from_dict(
|
||||
json.loads(Path(str(model)+'.json').read_text())),download_dir=ROOT/'cache')
|
||||
original=('Home Assistant läuft in einem Docker-Container auf Unraid. '
|
||||
'Die SSD hat zwei Terabyte Kapazität. Das Backup ist abgeschlossen, '
|
||||
'und im Log stehen keine Fehler.')
|
||||
prepared=('Houm Ässistent läuft in einem Docker-Container auf Anrejd. '
|
||||
'Die Es Es De hat zwei Tera Beit Kapazität. Das Bäckapp ist abgeschlossen, '
|
||||
'und im Log stehen keine Fehler.')
|
||||
list(voice.synthesize('Hallo.'))
|
||||
started=time.monotonic()
|
||||
chunks=list(voice.synthesize(prepared,syn_config=SynthesisConfig(length_scale=1.,
|
||||
noise_scale=.667,noise_w_scale=.8,normalize_audio=True)))
|
||||
elapsed=time.monotonic()-started
|
||||
pcm=b''.join(c.audio_int16_bytes for c in chunks)
|
||||
path=ROOT/'outputs/piper-anna-1000-guided-technical.wav'
|
||||
rate=voice.config.sample_rate
|
||||
with wave.open(str(path),'wb') as wav:
|
||||
wav.setnchannels(1);wav.setsampwidth(2);wav.setframerate(rate);wav.writeframes(pcm)
|
||||
cli=Path('/opt/athena-deck-dev/runtime/state/parakeet-runtime/v0.6.1/runtime/parakeet-v0.6.1-bin-linux-cpu-x64/parakeet-cli')
|
||||
stt=subprocess.run([str(cli),'transcribe','--model',str(cli.parents[2]/'redux-packed.gguf'),
|
||||
'--input',str(path),'--lang','de','--threads','2','--json'],capture_output=True,text=True,
|
||||
check=True,timeout=60)
|
||||
result=dict(probe='phonetic-input, not original-text benchmark',original_input=original,
|
||||
prepared_input=prepared,file=path.name,generation_seconds=elapsed,
|
||||
duration_seconds=len(pcm)/2/rate,rtf=elapsed/(len(pcm)/2/rate),
|
||||
recognized=json.loads(stt.stdout)['text'],production_enhancer_changed=False)
|
||||
(ROOT/'pronunciation-probe.json').write_text(json.dumps(result,indent=2,ensure_ascii=False))
|
||||
print(json.dumps(result,ensure_ascii=False),flush=True)
|
||||
@@ -0,0 +1,11 @@
|
||||
coloredlogs==15.0.1
|
||||
flatbuffers==25.12.19
|
||||
humanfriendly==10.0
|
||||
mpmath==1.3.0
|
||||
numpy==2.2.6
|
||||
onnxruntime==1.23.2
|
||||
packaging==26.3
|
||||
pathvalidate==3.3.1
|
||||
piper-tts @ file:///data/athena-piper-test-20261027/piper_tts-1.8.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl#sha256=25b4d3f31ff70c8fa7151908e00aaa5650cbdf16bca8fcf21299f3941b89a7d3
|
||||
protobuf==7.36.2
|
||||
sympy==1.14.0
|
||||
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"phase": "complete",
|
||||
"phase_started_monotonic": 85587.108888699,
|
||||
"voice": "de_DE-thorsten-medium; not Anna",
|
||||
"threads": 4,
|
||||
"affinity": [
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11
|
||||
],
|
||||
"runs": [
|
||||
{
|
||||
"file": "piper-thorsten-story-1.wav",
|
||||
"text": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"generation_seconds": 0.3302003720018547,
|
||||
"duration_seconds": 11.435827664399094,
|
||||
"rtf": 0.0288741997249401,
|
||||
"times_realtime": 34.632994490796214,
|
||||
"first_sentence_seconds": 0.08019605500157923,
|
||||
"chunks": 4,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 1.9828680203045684e-05,
|
||||
"peak_rss_kib": 216340
|
||||
},
|
||||
{
|
||||
"file": "piper-thorsten-story-2.wav",
|
||||
"text": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.",
|
||||
"generation_seconds": 0.32638141300412826,
|
||||
"duration_seconds": 11.551927437641723,
|
||||
"rtf": 0.02825341613042175,
|
||||
"times_realtime": 35.39395007612032,
|
||||
"first_sentence_seconds": 0.07525297699612565,
|
||||
"chunks": 4,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 1.57035175879397e-05,
|
||||
"peak_rss_kib": 239296
|
||||
},
|
||||
{
|
||||
"file": "piper-thorsten-technical.wav",
|
||||
"text": "Home Assistant läuft in einem Docker-Container auf Unraid. Die SSD hat zwei Terabyte Kapazität. Das Backup ist abgeschlossen, und im Log stehen keine Fehler.",
|
||||
"generation_seconds": 0.27286586399713997,
|
||||
"duration_seconds": 9.740770975056689,
|
||||
"rtf": 0.02801275840442927,
|
||||
"times_realtime": 35.69801965099887,
|
||||
"first_sentence_seconds": 0.09957721999671776,
|
||||
"chunks": 3,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 1.396752085816448e-05,
|
||||
"peak_rss_kib": 245508
|
||||
}
|
||||
],
|
||||
"gate_max_rtf": 0.2,
|
||||
"gate_note": "Conservative >=5x-realtime first filter, not Articulino parity or user-specified exact threshold",
|
||||
"load_seconds": 0.4992241709987866,
|
||||
"providers": [
|
||||
"CPUExecutionProvider"
|
||||
],
|
||||
"sample_rate": 22050,
|
||||
"piper_version": "1.8.0",
|
||||
"onnxruntime_version": "1.23.2",
|
||||
"setup_warmups": [
|
||||
{
|
||||
"file": "warmup-1.wav",
|
||||
"text": "Hallo.",
|
||||
"generation_seconds": 0.023052114993333817,
|
||||
"duration_seconds": 0.5572789115646258,
|
||||
"rtf": 0.04136548955102626,
|
||||
"times_realtime": 24.174741091035642,
|
||||
"first_sentence_seconds": 0.023004935996141285,
|
||||
"chunks": 1,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 8.138020833333333e-05,
|
||||
"peak_rss_kib": 148760
|
||||
},
|
||||
{
|
||||
"file": "warmup-2.wav",
|
||||
"text": "Hallo.",
|
||||
"generation_seconds": 0.021178738999878988,
|
||||
"duration_seconds": 0.6385487528344671,
|
||||
"rtf": 0.03316698827750935,
|
||||
"times_realtime": 30.150461405568844,
|
||||
"first_sentence_seconds": 0.021143792997463606,
|
||||
"chunks": 1,
|
||||
"peak": 0.999969482421875,
|
||||
"clipped_fraction": 7.102272727272727e-05,
|
||||
"peak_rss_kib": 153272
|
||||
}
|
||||
],
|
||||
"decision": "speed_gate_passed",
|
||||
"weighted_rtf": 0.0283987016956906
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"repository": "OHF-Voice/piper1-gpl",
|
||||
"revision": "639388b6317fc4731e91d53da42aea68fd4166ff",
|
||||
"url": "https://codeload.github.com/OHF-Voice/piper1-gpl/tar.gz/639388b6317fc4731e91d53da42aea68fd4166ff",
|
||||
"bytes": 24738952,
|
||||
"sha256": "a7045b7ef4268d1088047c20a69ae447b552e579dacb42d3dc18f53576aa54ce"
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
"""Warm CPU speed gate before any private Anna preparation or training."""
|
||||
import os
|
||||
os.environ.update(CUDA_VISIBLE_DEVICES='', OMP_NUM_THREADS='4',
|
||||
OPENBLAS_NUM_THREADS='1', MKL_NUM_THREADS='4')
|
||||
from pathlib import Path
|
||||
import argparse
|
||||
import gc
|
||||
import importlib.metadata
|
||||
import json
|
||||
import resource
|
||||
import time
|
||||
import wave
|
||||
import numpy as np
|
||||
import onnxruntime as ort
|
||||
from piper import PiperVoice
|
||||
from piper.config import PiperConfig, SynthesisConfig
|
||||
|
||||
ROOT = Path('/data/athena-piper-test-20261027')
|
||||
parser=argparse.ArgumentParser()
|
||||
parser.add_argument('--model',default=str(ROOT/'model/de_DE-thorsten-medium.onnx'))
|
||||
parser.add_argument('--results',default=str(ROOT/'results.json'))
|
||||
parser.add_argument('--prefix',default='piper-thorsten')
|
||||
args=parser.parse_args()
|
||||
model=Path(args.model)
|
||||
OUT = ROOT / 'outputs'
|
||||
OUT.mkdir(exist_ok=True)
|
||||
STORY = ('Wenn du magst, erzähle ich dir eine kurze Geschichte. '
|
||||
'Anna öffnete das Fenster und hörte drei Vögel singen. '
|
||||
'Auf dem Tisch lagen sieben Bücher und eine rote Tasse. '
|
||||
'Zum Schluss sagte sie: Das hat wunderbar funktioniert.')
|
||||
TECH = ('Home Assistant läuft in einem Docker-Container auf Unraid. '
|
||||
'Die SSD hat zwei Terabyte Kapazität. Das Backup ist abgeschlossen, '
|
||||
'und im Log stehen keine Fehler.')
|
||||
state = {'phase': 'loading', 'phase_started_monotonic': time.monotonic(),
|
||||
'voice': args.prefix, 'threads': 4,
|
||||
'affinity': sorted(os.sched_getaffinity(0)), 'runs': [],
|
||||
'gate_max_rtf': .2,
|
||||
'gate_note': 'Conservative >=5x-realtime first filter, not Articulino parity or user-specified exact threshold'}
|
||||
def save():
|
||||
Path(args.results).write_text(json.dumps(state, ensure_ascii=False, indent=2))
|
||||
def phase(name):
|
||||
state.update(phase=name, phase_started_monotonic=time.monotonic())
|
||||
save()
|
||||
save()
|
||||
started = time.monotonic()
|
||||
opts = ort.SessionOptions()
|
||||
opts.intra_op_num_threads = 4
|
||||
opts.inter_op_num_threads = 1
|
||||
opts.execution_mode = ort.ExecutionMode.ORT_SEQUENTIAL
|
||||
session = ort.InferenceSession(str(model),
|
||||
sess_options=opts, providers=['CPUExecutionProvider'])
|
||||
cfg = PiperConfig.from_dict(json.loads(Path(str(model)+'.json').read_text()))
|
||||
voice = PiperVoice(session=session, config=cfg, download_dir=ROOT / 'cache')
|
||||
assert session.get_providers() == ['CPUExecutionProvider']
|
||||
state.update(load_seconds=time.monotonic()-started, providers=session.get_providers(),
|
||||
sample_rate=cfg.sample_rate, piper_version=importlib.metadata.version('piper-tts'),
|
||||
onnxruntime_version=ort.__version__, setup_warmups=[])
|
||||
syn = SynthesisConfig(length_scale=1.0, noise_scale=.667, noise_w_scale=.8,
|
||||
normalize_audio=True)
|
||||
|
||||
def generate(text, name):
|
||||
chunks = []
|
||||
first = None
|
||||
start = time.monotonic()
|
||||
for chunk in voice.synthesize(text, syn_config=syn):
|
||||
if first is None:
|
||||
first = time.monotonic()-start
|
||||
assert np.isfinite(chunk.audio_float_array).all()
|
||||
chunks.append(chunk.audio_int16_bytes)
|
||||
elapsed = time.monotonic()-start
|
||||
pcm = b''.join(chunks)
|
||||
assert len(pcm) > 0
|
||||
duration = len(pcm) / 2 / cfg.sample_rate
|
||||
with wave.open(str(OUT / name), 'wb') as wav:
|
||||
wav.setnchannels(1); wav.setsampwidth(2); wav.setframerate(cfg.sample_rate)
|
||||
wav.writeframes(pcm)
|
||||
samples = np.frombuffer(pcm, dtype='<i2').astype(np.float32) / 32768
|
||||
return {'file': name, 'text': text, 'generation_seconds': elapsed,
|
||||
'duration_seconds': duration, 'rtf': elapsed / duration,
|
||||
'times_realtime': duration / elapsed, 'first_sentence_seconds': first,
|
||||
'chunks': len(chunks), 'peak': float(np.max(np.abs(samples))),
|
||||
'clipped_fraction': float(np.mean(np.abs(samples) >= .999)),
|
||||
'peak_rss_kib': resource.getrusage(resource.RUSAGE_SELF).ru_maxrss}
|
||||
|
||||
for i in range(2):
|
||||
phase('warmup')
|
||||
state['setup_warmups'].append(generate('Hallo.', f'{args.prefix}-warmup-{i+1}.wav'))
|
||||
for label, text in [('story-1', STORY), ('story-2', STORY), ('technical', TECH)]:
|
||||
phase('probe')
|
||||
row = generate(text, f'{args.prefix}-{label}.wav')
|
||||
state['runs'].append(row)
|
||||
print(json.dumps(row, ensure_ascii=False), flush=True)
|
||||
save()
|
||||
if row['rtf'] > state['gate_max_rtf']:
|
||||
state.update(phase='complete', decision='speed_gate_rejected')
|
||||
save()
|
||||
raise SystemExit(0)
|
||||
state.update(phase='complete', decision='speed_gate_passed',
|
||||
weighted_rtf=sum(x['generation_seconds'] for x in state['runs']) /
|
||||
sum(x['duration_seconds'] for x in state['runs']))
|
||||
save()
|
||||
print(json.dumps({'decision': state['decision'], 'weighted_rtf': state['weighted_rtf']}), flush=True)
|
||||
@@ -0,0 +1,117 @@
|
||||
"""Bounded local Anna fine-tune. Never controls production or exports private data."""
|
||||
import argparse
|
||||
import inspect
|
||||
import json
|
||||
import math
|
||||
import os
|
||||
from pathlib import Path
|
||||
import time
|
||||
|
||||
os.environ.setdefault('OMP_NUM_THREADS','4')
|
||||
os.environ.setdefault('MKL_NUM_THREADS','4')
|
||||
os.environ.setdefault('HF_HUB_OFFLINE','1')
|
||||
os.environ.setdefault('WANDB_MODE','disabled')
|
||||
import torch
|
||||
import lightning as L
|
||||
from lightning.pytorch.callbacks import Callback, ModelCheckpoint
|
||||
from lightning.pytorch.loggers import CSVLogger
|
||||
from piper.train.vits.dataset import VitsDataModule
|
||||
from piper.train.vits.lightning import VitsModel
|
||||
|
||||
ROOT=Path('/data/athena-piper-test-20261027')
|
||||
PILOT=ROOT/'anna-pilot'
|
||||
PILOT.mkdir(exist_ok=True)
|
||||
torch.set_num_threads(4)
|
||||
L.seed_everything(20261027,workers=True)
|
||||
|
||||
def data_module():
|
||||
return VitsDataModule(csv_path=ROOT/'anna-data/train.csv',
|
||||
audio_dir=ROOT/'anna-data/wav',cache_dir=PILOT/'cache',
|
||||
espeak_voice='de',config_path=PILOT/'anna.onnx.json',voice_name='Anna pilot',
|
||||
sample_rate=22050,batch_size=8,num_workers=2,validation_split=.1,
|
||||
num_test_examples=0,trim_silence=False)
|
||||
|
||||
def write(name,data):
|
||||
path=PILOT/name
|
||||
tmp=path.with_suffix('.tmp')
|
||||
tmp.write_text(json.dumps(data,indent=2,ensure_ascii=False))
|
||||
tmp.replace(path)
|
||||
|
||||
class Guard(Callback):
|
||||
def __init__(self):
|
||||
self.started=time.monotonic()
|
||||
self.batches=0
|
||||
def on_train_batch_end(self,trainer,module,outputs,batch,batch_idx):
|
||||
self.batches+=1
|
||||
metrics={k:float(v) for k,v in trainer.callback_metrics.items()
|
||||
if getattr(v,'numel',lambda:0)()==1}
|
||||
if any(not math.isfinite(v) for v in metrics.values()):
|
||||
raise RuntimeError('Non-finite pilot training loss; stop own training')
|
||||
if self.batches==1 or self.batches%10==0:
|
||||
report=dict(phase='training',batches=self.batches,
|
||||
optimizer_steps=trainer.global_step,epoch=trainer.current_epoch,
|
||||
elapsed_seconds=time.monotonic()-self.started,metrics=metrics,
|
||||
gpu_allocated_mib=torch.cuda.memory_allocated()/2**20,
|
||||
gpu_peak_mib=torch.cuda.max_memory_allocated()/2**20)
|
||||
write('progress.json',report)
|
||||
print(json.dumps(report),flush=True)
|
||||
if (ROOT/'stop-training.request').exists():
|
||||
trainer.should_stop=True
|
||||
|
||||
def main():
|
||||
parser=argparse.ArgumentParser()
|
||||
parser.add_argument('mode',choices=['prepare','train'])
|
||||
args=parser.parse_args()
|
||||
dm=data_module()
|
||||
dm.prepare_data()
|
||||
dm.setup('fit')
|
||||
if args.mode=='prepare':
|
||||
checkpoint=torch.load(ROOT/'base-thorsten-medium.ckpt',map_location='cpu',weights_only=False)
|
||||
allowed=set(inspect.signature(VitsModel.__init__).parameters)
|
||||
params={k:v for k,v in checkpoint['hyper_parameters'].items() if k in allowed}
|
||||
params.update(batch_size=8,learning_rate=5e-5,learning_rate_d=2.5e-5,
|
||||
mos_metric='none',dataset=None,warmstart_ckpt=None,
|
||||
vocoder_warmstart_ckpt=None)
|
||||
model=VitsModel(**params)
|
||||
old=checkpoint['state_dict']; new=model.state_dict()
|
||||
matched=[k for k,v in old.items() if k in new and v.shape==new[k].shape]
|
||||
missing=[k for k in new if k not in old or new[k].shape!=old[k].shape]
|
||||
skipped=[k for k in old if k not in matched]
|
||||
assert not missing and not skipped,(missing,skipped)
|
||||
# All 784 tensors must match before any GPU is reserved.
|
||||
write('model-parameters.json',params)
|
||||
write('prepared.json',dict(ready=True,matched_tensors=len(matched),
|
||||
train_clips=len(dm.train_dataset),validation_clips=len(dm.val_dataset),
|
||||
external_heldout_clips=7,sample_rate=22050,
|
||||
transcript_source='local STT, confidence-filtered, not manually certified'))
|
||||
print('pilot_data_and_architecture_ready',flush=True)
|
||||
return
|
||||
assert torch.cuda.is_available()
|
||||
assert '5080' in torch.cuda.get_device_name(0)
|
||||
free,total=torch.cuda.mem_get_info()
|
||||
assert free>12*2**30,'Training GPU not free; do not touch production'
|
||||
params=json.loads((PILOT/'model-parameters.json').read_text())
|
||||
params['warmstart_ckpt']=str(ROOT/'base-thorsten-medium.ckpt')
|
||||
model=VitsModel(**params)
|
||||
checkpoints=ModelCheckpoint(dirpath=PILOT/'checkpoints',
|
||||
filename='anna-{epoch:03d}-{step:06d}',every_n_train_steps=500,
|
||||
save_top_k=-1,save_last=True,save_weights_only=True)
|
||||
guard=Guard()
|
||||
trainer=L.Trainer(accelerator='gpu',devices=1,precision='32-true',
|
||||
max_steps=2000,max_epochs=200,max_time='00:00:25:00',
|
||||
callbacks=[guard,checkpoints],logger=CSVLogger(str(PILOT),'metrics'),
|
||||
enable_progress_bar=False,enable_model_summary=False,
|
||||
log_every_n_steps=10,num_sanity_val_steps=0,
|
||||
check_val_every_n_epoch=10,deterministic=False)
|
||||
started=time.monotonic()
|
||||
trainer.fit(model,datamodule=dm)
|
||||
trainer.save_checkpoint(PILOT/'anna-final.ckpt',weights_only=True)
|
||||
write('training-result.json',dict(complete=True,optimizer_steps=trainer.global_step,
|
||||
generator_batches=guard.batches,elapsed_seconds=time.monotonic()-started,
|
||||
stopped_by_operator=(ROOT/'stop-training.request').exists(),
|
||||
gpu=torch.cuda.get_device_name(0),peak_gpu_mib=torch.cuda.max_memory_allocated()/2**20,
|
||||
trained_architecture='Piper medium, unchanged inference graph',
|
||||
limitations=['pilot only','automatic transcripts','human voice-identity review required']))
|
||||
|
||||
if __name__=='__main__':
|
||||
main()
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"repository": "rhasspy/piper-checkpoints",
|
||||
"revision": "37d1bea250e21ca0d617818d2bef1db724edb80c",
|
||||
"file": "de/de_DE/thorsten/medium/epoch=3135-step=2702056.ckpt",
|
||||
"url": "https://huggingface.co/datasets/rhasspy/piper-checkpoints/resolve/37d1bea250e21ca0d617818d2bef1db724edb80c/de/de_DE/thorsten/medium/epoch%3D3135-step%3D2702056.ckpt",
|
||||
"bytes": 845898392,
|
||||
"sha256": "063f96fd905b9f57bd077bdbca0aa39876a29103c2cc8688fb4d39e2876a0de2"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ready": true,
|
||||
"source_revision": "639388b6317fc4731e91d53da42aea68fd4166ff",
|
||||
"checkpoint_sha256": "063f96fd905b9f57bd077bdbca0aa39876a29103c2cc8688fb4d39e2876a0de2",
|
||||
"training_environment": "/data/athena-piper-test-20261027/train-venv",
|
||||
"cpu_inference_environment_unchanged": true
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
absl-py==2.5.1
|
||||
aiohappyeyeballs==2.7.1
|
||||
aiohttp==3.14.5
|
||||
aiosignal==1.4.0
|
||||
attrs==26.1.0
|
||||
audioop-lts==0.2.2
|
||||
audioread==3.1.0
|
||||
certifi==2026.10.23
|
||||
cffi==2.1.1
|
||||
charset-normalizer==3.5.2
|
||||
cloudpickle==3.1.2
|
||||
coloredlogs==15.0.1
|
||||
cuda-bindings==13.4.4
|
||||
cuda-pathfinder==1.8.4
|
||||
cuda-toolkit==13.0.3.0
|
||||
Cython==3.3.0
|
||||
decorator==5.3.1
|
||||
docstring_parser==0.18.0
|
||||
filelock==4.2.4
|
||||
flatbuffers==25.12.19
|
||||
frozenlist==1.8.0
|
||||
fsspec==2026.9.0
|
||||
grpcio==1.85.0
|
||||
humanfriendly==10.0
|
||||
idna==3.20
|
||||
Jinja2==3.1.6
|
||||
joblib==1.6.0
|
||||
jsonargparse==4.53.0
|
||||
lazy-loader==0.6
|
||||
librosa==0.11.0
|
||||
lightning==2.6.6
|
||||
lightning-utilities==0.15.3
|
||||
llvmlite==0.50.0
|
||||
Markdown==3.11.2
|
||||
MarkupSafe==3.0.4
|
||||
ml_dtypes==0.6.0
|
||||
mpmath==1.3.0
|
||||
msgpack==1.2.4
|
||||
multidict==7.2.1
|
||||
narwhals==2.28.0
|
||||
networkx==3.7
|
||||
numba==0.68.0
|
||||
numpy==2.2.6
|
||||
nvidia-cublas==13.1.1.3
|
||||
nvidia-cuda-cupti==13.0.85
|
||||
nvidia-cuda-nvrtc==13.0.88
|
||||
nvidia-cuda-runtime==13.0.96
|
||||
nvidia-cudnn-cu13==9.20.0.48
|
||||
nvidia-cufft==12.0.0.61
|
||||
nvidia-cufile==1.15.1.6
|
||||
nvidia-curand==10.4.0.35
|
||||
nvidia-cusolver==12.0.4.66
|
||||
nvidia-cusparse==12.6.3.3
|
||||
nvidia-cusparselt-cu13==0.8.1
|
||||
nvidia-nccl-cu13==2.29.7
|
||||
nvidia-nvjitlink==13.4.92
|
||||
nvidia-nvshmem-cu13==3.4.5
|
||||
nvidia-nvtx==13.0.85
|
||||
onnx==1.23.2
|
||||
onnx-ir==1.1.0
|
||||
onnxruntime==1.23.2
|
||||
onnxscript==0.7.2
|
||||
packaging==26.3
|
||||
pathvalidate==3.3.1
|
||||
pillow==13.0.0
|
||||
piper-tts @ file:///data/athena-piper-test-20261027/piper_tts-1.8.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl#sha256=25b4d3f31ff70c8fa7151908e00aaa5650cbdf16bca8fcf21299f3941b89a7d3
|
||||
platformdirs==4.13.6
|
||||
pooch==1.9.0
|
||||
propcache==0.5.4
|
||||
protobuf==7.36.2
|
||||
pycparser==3.12
|
||||
pysilero_vad==2.1.1
|
||||
pytorch-lightning==2.6.6
|
||||
PyYAML==6.0.3
|
||||
requests==2.34.2
|
||||
scikit-learn==1.9.1
|
||||
scipy==1.18.1
|
||||
setuptools==84.2.1
|
||||
soundfile==0.14.0
|
||||
soxr==1.1.0
|
||||
standard-aifc==3.13.0
|
||||
standard-chunk==3.13.0
|
||||
standard-sunau==3.13.0
|
||||
sympy==1.14.0
|
||||
tensorboard==2.21.0
|
||||
tensorboard-data-server==0.7.2
|
||||
tensorboardX==2.6.5
|
||||
threadpoolctl==3.7.0
|
||||
torch==2.13.0
|
||||
torchmetrics==1.9.0
|
||||
tqdm==4.70.1
|
||||
triton==3.7.1
|
||||
typeshed_client==2.14.0
|
||||
typing_extensions==4.16.0
|
||||
urllib3==2.8.0
|
||||
Werkzeug==3.1.9
|
||||
wheel==0.48.0
|
||||
yarl==1.25.1
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"complete": true,
|
||||
"optimizer_steps": 2000,
|
||||
"generator_batches": 1000,
|
||||
"elapsed_seconds": 249.09722232799686,
|
||||
"stopped_by_operator": false,
|
||||
"gpu": "NVIDIA GeForce RTX 5080",
|
||||
"peak_gpu_mib": 5641.3173828125,
|
||||
"trained_architecture": "Piper medium, unchanged inference graph",
|
||||
"limitations": [
|
||||
"pilot only",
|
||||
"automatic transcripts",
|
||||
"human voice-identity review required"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
"""Read-only verification: restored Qwen, production hashes and no own trainer.
|
||||
|
||||
Worker credentials stay in memory and the health-probe stdin. Never print them.
|
||||
"""
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
|
||||
ROOT=Path('/data/athena-piper-test-20261027')
|
||||
STATE=Path('/opt/athena-deck-dev/runtime/state')
|
||||
before=json.loads((ROOT/'production-before.json').read_text())
|
||||
same={Path(name).name:hashlib.file_digest(Path(name).open('rb'),'sha256').hexdigest()==digest
|
||||
for name,digest in before['files'].items()}
|
||||
started=subprocess.check_output(['docker','inspect','--format','{{.State.StartedAt}}',
|
||||
'athena-deck-dev'],text=True).strip()
|
||||
worker=json.loads((STATE/'strata-worker/worker.json').read_text())
|
||||
workers=[];trainers=[]
|
||||
for p in Path('/proc').iterdir():
|
||||
if not p.name.isdigit():continue
|
||||
try:argv=(p/'cmdline').read_bytes().split(b'\0')
|
||||
except OSError:continue
|
||||
if any(a.endswith(b'/serve/server.py') for a in argv) and b'/var/lib/deck/strata-worker/worker.json' in argv:
|
||||
workers.append(int(p.name))
|
||||
if str(ROOT/'train_pilot.py').encode() in argv and b'train' in argv:
|
||||
trainers.append(int(p.name))
|
||||
assert len(workers)==1,'Expected one restored Qwen worker'
|
||||
probe="import json,sys,urllib.request;x=json.load(sys.stdin);r=urllib.request.Request('http://127.0.0.1:'+str(x['port'])+'/health',headers={'Authorization':'Bearer '+x['api_key']});d=json.load(urllib.request.urlopen(r,timeout=10));print(json.dumps({k:d.get(k) for k in ('status','loaded')}))"
|
||||
health=json.loads(subprocess.check_output(['nsenter','-t',str(workers[0]),'-n',
|
||||
'python3','-c',probe],input=json.dumps(worker),text=True))
|
||||
result=dict(production_files_unchanged=same,deck_not_restarted=started==before['deck_started_at'],
|
||||
restored_profile=worker['model_name'],worker_health=health,no_owned_trainer=not trainers,
|
||||
cpu_tts_profile_unchanged=same['profiles.json'] and same['audio-policy.json'],
|
||||
client_playback_tested=False,piper_published=False)
|
||||
result['verified']=bool(all(same.values()) and result['deck_not_restarted'] and not trainers
|
||||
and worker['model_name']=='flash-next-strata-iq3-dual' and health.get('status')=='ok'
|
||||
and health.get('loaded'))
|
||||
(ROOT/'preservation.json').write_text(json.dumps(result,indent=2))
|
||||
print(json.dumps(result,indent=2))
|
||||
if not result['verified']:raise SystemExit(1)
|
||||
Reference in new issue
Block a user