From 32e40d3d0be86433ea0a609ea010f3c31253da48 Mon Sep 17 00:00:00 2001 From: Mikei386 <44135113+Mikei386@users.noreply.github.com> Date: Tue, 27 Oct 2026 17:14:31 +0100 Subject: [PATCH] Record isolated Kokoro Kikiri Victoria CPU and technical speech test --- .../kikiri-victoria-cpu-2026-10-27/README.md | 135 +++++++++ .../benchmark.py | 105 +++++++ .../constraints.txt | 105 +++++++ .../final-verification.json | 20 ++ .../manifest.json | 49 ++++ .../kikiri-victoria-cpu-2026-10-27/prepare.py | 94 ++++++ .../quality.json | 232 +++++++++++++++ .../requirements-resolved.txt | 97 +++++++ .../kikiri-victoria-cpu-2026-10-27/score.py | 36 +++ .../kikiri-victoria-cpu-2026-10-27/speed.json | 271 ++++++++++++++++++ .../kikiri-victoria-cpu-2026-10-27/support.py | 37 +++ .../transcriptions.json | 14 + .../tts-candidate-shortlist-2026-10-27.md | 5 +- 13 files changed, 1199 insertions(+), 1 deletion(-) create mode 100644 docs/experiments/kikiri-victoria-cpu-2026-10-27/README.md create mode 100644 docs/experiments/kikiri-victoria-cpu-2026-10-27/benchmark.py create mode 100644 docs/experiments/kikiri-victoria-cpu-2026-10-27/constraints.txt create mode 100644 docs/experiments/kikiri-victoria-cpu-2026-10-27/final-verification.json create mode 100644 docs/experiments/kikiri-victoria-cpu-2026-10-27/manifest.json create mode 100644 docs/experiments/kikiri-victoria-cpu-2026-10-27/prepare.py create mode 100644 docs/experiments/kikiri-victoria-cpu-2026-10-27/quality.json create mode 100644 docs/experiments/kikiri-victoria-cpu-2026-10-27/requirements-resolved.txt create mode 100644 docs/experiments/kikiri-victoria-cpu-2026-10-27/score.py create mode 100644 docs/experiments/kikiri-victoria-cpu-2026-10-27/speed.json create mode 100644 docs/experiments/kikiri-victoria-cpu-2026-10-27/support.py create mode 100644 docs/experiments/kikiri-victoria-cpu-2026-10-27/transcriptions.json diff --git a/docs/experiments/kikiri-victoria-cpu-2026-10-27/README.md b/docs/experiments/kikiri-victoria-cpu-2026-10-27/README.md new file mode 100644 index 0000000..6e12389 --- /dev/null +++ b/docs/experiments/kikiri-victoria-cpu-2026-10-27/README.md @@ -0,0 +1,135 @@ +# Kokoro/Kikiri Victoria on Athena CPU · 27 October 2026 + +Michael authorized a speed-first CPU test, then the unchanged technical text, +local STT and one listening sample if fast enough. Active TTS must remain +unchanged. This uses the public **Victoria** voice, not Anna. No voice cloning, +Anna training, GPU work or production integration was performed. Sopro +technical B remains the documentary comparison reference. + +## Pinned native inference setup + +- Model `kikiri-tts/kikiri-german-victoria`, revision + `ce81e200ff9203e1a3b042cd678c48e3ffb85cef`: only the 327 MB inference checkpoint, + 0.52 MB Victoria voicepack and model card were downloaded. The 1.69 GB raw + training checkpoint was not downloaded. Publisher LFS SHA-256 values matched. +- Kikiri source `a12d0410e89841e6f3c09958ae5c072f90ae1d49`, its Kokoro fork + `b96fef95e6a746495f92443fac7c688f90fc57fc`, Misaki fork + `6d252a2e02f3b030f22f56686f1a73786c16ffc8` from the published lockfile. +- Own standalone CPython 3.11.18 and own venv, uv 0.13.6, CPU Torch 2.6.0, + transformers 4.48.3, numpy 1.26.4, SpaCy 3.8.4 and espeakng-loader 0.2.4. + No host apt install, global Python changes or dependency on a container. + eSpeak library/data are provided inside the venv by the pinned loader. +- Four Torch intra-op threads, one inter-op thread, affinity 2–5/8–11, + CPUQuota 400%, nice 10, MemoryMax 3 GiB, no swap. All model parameters on CPU; + CPU-only Torch reports `torch.version.cuda is None`. +- Inference and local STT units had private networking and offline asset paths. + Strata remained resident; no concurrent synthetic LLM workload was added. + +`manifest.json`, `requirements-resolved.txt` and `constraints.txt` record public +pins/hashes. Constraints are derived from a universal upstream lockfile and +may mention other-platform/GPU packages; they do not install those packages. +The resolved CPU venv package list is the actual installed set. + +## Setup findings and validation + +The initial unconstrained transitive package resolution imported a newer +Typer family without the required Click module. The setup was corrected to use +the published dependency versions. Universal lockfiles include alternative +versions for different Python/platform branches: the first translation wrongly +made those duplicate versions unconditional constraints; this was corrected. +Two unused newer Typer/Pydantic-family dependencies were removed from the own +venv. Package compatibility and German G2P import then passed. No model speed +or quality conclusion is drawn from these setup failures. + +An initial strict checkpoint check found missing InstanceNorm affine entries. +The pinned Kokoro `istftnet.py` explicitly enables `affine=True` for old ONNX +export compatibility although original checkpoints use non-affine norms. +The checker now accepts only those exact InstanceNorm weight/bias constants, +verifies weights are all one and biases all zero, then strictly reloads every +component with those identity constants included. There were 24 such keys in +the predictor and 116 in the decoder; all other checkpoint keys matched and +no unexpected keys were accepted. Learned model weights were not altered or +retrained. The instantiated model contains 81,810,022 parameters; voicepack +shape is `[510, 1, 256]`. + +The German training guide's `ʏ` → `y` Kokoro-vocabulary mapping was fixed in the +own inference wrapper before synthesis. No phonemes were dropped in the speed +or technical outputs. All other upstream German normalization, pronunciation +overrides, chunking and speed=1 behavior were retained. No external Athena text +normalizer, custom technical lexicon edits or output-driven retuning was added. + +## Speed gate and technical sample + +The minimum remained RTF ≤ 0.5 (at least twice realtime). One explicitly +reported short warmup preceded the two full-story speed runs; the technical +sample then ran in a fresh model process. Seed 42 was reset before each call. +Generation times include the German text frontend and waveform synthesis, +but exclude model load, warmup and WAV writing. Model/voice preparation in the +technical process took 0.788 s; warmup in the speed process took 0.660 s for +2.55 s of speech. + +| Case | Audio | Generation | RTF | Realtime multiple | +| --- | ---: | ---: | ---: | ---: | +| Story, repetition 1 | 14.50 s | 4.777 s | 0.3295 | 3.04× | +| Story, repetition 2 | 14.50 s | 4.243 s | 0.2926 | 3.42× | +| Raw technical paragraph | 19.00 s | 6.696 s | 0.3524 | 2.84× | + +Both speed runs passed and produced identical WAV hashes. Weighted story RTF +was 0.3110. No nonfinite values, clipping or phoneme truncation were observed. +Technical audio peak was 0.4904. Technical inference cgroup peak was about +1.2 GiB, with no swap. This is a few short renders, not a sustained throughput, +Strata-load, Hermes playback or streaming-latency qualification. Each request +returned one complete chunk; the technical first complete chunk took 6.695 s. + +The raw technical text is identical to the earlier Sopro/Chatterbox case. +Misaki automatically expanded numbers and time, e.g. `18:30` to `achtzehn Uhr +dreißig`, while leaving `MiB`, `Mbit` and `CEST` in its normalized text. Exact +input, normalized text and phoneme trace are retained in `quality.json`. + +## STT and listening assessment + +The existing native Parakeet Redux CPU CLI v0.6.1 transcribed the technical WAV +in 1.424 s using two threads. The first STT report attempt had an own harness +schema mismatch (a reference-label field copied from the Anna tests); it was +corrected to the fixed voice Victoria and the same WAV was transcribed again. +No additional TTS render or text adjustment followed that reporting error. + +Numbers, quantities and time were recovered, including 47, 512 MiB, 100 Mbit +and 18:30. Raw case/punctuation word alignment has five edits across forty +reference tokens: Unraid/Unreid, Logfile/Lockfehler, inserted Uhr, CEST/Käst and +Scan/Scarn. Inserted Uhr is a valid expansion of the original time, and ASR +spelling differences need not be TTS errors. Do not call this a confirmed +12.5% TTS pronunciation error rate. The upstream phoneme trace does explicitly +render CEST as a word (`kˈɛst`), rather than spelling its letters. + +No human naturalness, accent or Anna-identity acceptance has been recorded. +This sample is **Victoria**, so it cannot establish Anna similarity or the +quality of a future Anna fine-tune. The local listening WAV's SHA-256, mono +24 kHz PCM16 header and 19 s duration match the remote result. + +## Preservation and native reproduction + +Root `/data/athena-kikiri-victoria-cpu-20261027`, 0700, approximately 1.96 GiB +including its independent Python, venv, uv cache, source and public weights. +All own setup, preflight, inference and STT units ended and were collected. +Production catalogue, endpoint, audio/CPU policy, Anna reference and canonical +Qwen worker hashes, worker PIDs and Deck start time remained unchanged; see +`final-verification.json`. No new permanent service, container, profile, endpoint +switch, training run, restart or Mac-app change. + +Listening file remains outside Git locally at +`work/kikiri-victoria-cpu-20261027/audio/kikiri-victoria-quality-technical-1.wav` +and remotely under the own root's `outputs/` directory. + +For native Debian reproduction, supply host Python supporting tomllib and safe +tar extraction, Git and CA roots. Configure explicit root/production paths in +the scripts. `prepare.py` obtains verified standalone Python and uv binaries, +checks out pinned public sources, installs CPU dependencies with uv, and fetches +only the required inference weights. Reusing a verified public Python archive +from the preceding test is optional; the script downloads it independently +when absent, and the extracted runtime has no dependency on that earlier root. +Use the resolved dependency record when reproducing this particular run. +Run `benchmark.py speed` under the limits above, then `benchmark.py quality` +only after a passed gate. `score.py` needs the separately restored existing +native Parakeet runtime/model. This is an isolated experiment recipe, not a +complete native Deck install/restore or a training/deployment qualification. diff --git a/docs/experiments/kikiri-victoria-cpu-2026-10-27/benchmark.py b/docs/experiments/kikiri-victoria-cpu-2026-10-27/benchmark.py new file mode 100644 index 0000000..6cc9f6f --- /dev/null +++ b/docs/experiments/kikiri-victoria-cpu-2026-10-27/benchmark.py @@ -0,0 +1,105 @@ +"""Speed first, then the original technical paragraph; Victoria only, CPU only.""" +import os +from pathlib import Path +ROOT=Path('/data/athena-kikiri-victoria-cpu-20261027') +os.environ.update(CUDA_VISIBLE_DEVICES='',HF_HUB_OFFLINE='1',HF_HUB_DISABLE_TELEMETRY='1',HF_HUB_DISABLE_IMPLICIT_TOKEN='1', + HF_HOME=str(ROOT/'cache/huggingface'),XDG_CACHE_HOME=str(ROOT/'cache'),OMP_NUM_THREADS='4',MKL_NUM_THREADS='4', + OPENBLAS_NUM_THREADS='1',TOKENIZERS_PARALLELISM='false') +import argparse +import hashlib +import json +import random +import resource +import time +import numpy as np +import soundfile as sf +import torch +from kokoro import KModel,KPipeline +from misaki.de import normalize_text_de +from support import CASES,available,write,preservation + +def seed():random.seed(42);np.random.seed(42);torch.manual_seed(42) + +def main(): + parser=argparse.ArgumentParser();parser.add_argument('phase',choices=['speed','quality']);args=parser.parse_args() + os.umask(0o077);torch.set_num_threads(4);torch.set_num_interop_threads(1);os.sched_setaffinity(0,{2,3,4,5,8,9,10,11}) + assert torch.version.cuda is None and not torch.cuda.is_available() + assert available()>=3*1024**3 + target=ROOT/(args.phase+'.json');assert not target.exists() + if args.phase=='quality':assert json.loads((ROOT/'speed.json').read_text())['gate_passed'] + (ROOT/'outputs').mkdir(exist_ok=True,mode=0o700) + data=dict(phase='loading',runs=[],protocol=dict(device='cpu',voice='Victoria',cpu_threads=4,interop_threads=1, + affinity=sorted(os.sched_getaffinity(0)),precision='fp32',seed=42,speed=1,gate_maximum_rtf=.5, + german_frontend='Kikiri lockfile Misaki DEG2P',compatibility_map={'ʏ':'y'},cpu_quota_percent=400, + memory_max_gib=3,concurrent_llm_load_added=False),torch=torch.__version__) + write(target,data);seed();start=time.monotonic() + model=KModel(repo_id='hexgrad/Kokoro-82M',config=str(ROOT/'source/training/config.json'), + model=str(ROOT/'model/kikiri_german_victoria_ep10.pth')).to('cpu').eval() + # The fork enables affine InstanceNorm only for ONNX compatibility; original + # checkpoints omit those identity constants. Verify this exact exception, + # then strictly reload the complete state instead of trusting a broad fallback. + weights=torch.load(ROOT/'model/kikiri_german_victoria_ep10.pth',map_location='cpu',weights_only=True) + strict=[] + for name,state in weights.items(): + component=getattr(model,name) + normalized={k.removeprefix('module.'):v for k,v in state.items()} + check=component.load_state_dict(normalized,strict=False) + assert not check.unexpected_keys,(name,check.unexpected_keys) + current=component.state_dict() + for key in check.missing_keys: + module_path,parameter=key.rsplit('.',1);layer=component.get_submodule(module_path) + assert isinstance(layer,torch.nn.InstanceNorm1d) and layer.affine + assert parameter in ['weight','bias'] + expected=1 if parameter=='weight' else 0 + assert torch.all(current[key]==expected),(name,key) + normalized[key]=current[key] + component.load_state_dict(normalized,strict=True) + strict.append(dict(component=name,identity_affine_keys=check.missing_keys)) + del weights + pipeline=KPipeline(lang_code='d',repo_id='hexgrad/Kokoro-82M',model=model,device='cpu') + original=pipeline.g2p + # Kokoro's documented German symbol compatibility mapping, fixed before any output. + def compatible(text): + ps,tokens=original(text) + return ps.replace('ʏ','y'),tokens + pipeline.g2p=compatible + voice=torch.load(ROOT/'model/voices/victoria.pt',map_location='cpu',weights_only=True) + assert voice.ndim==3 and voice.shape[-1]==256 and torch.isfinite(voice).all() + assert all(p.device.type=='cpu' for p in model.parameters()) + data.update(model_load_seconds=time.monotonic()-start,strict_components=strict, + parameters=sum(p.numel() for p in model.parameters()),voice_shape=list(voice.shape)) + def synthesize(text,name,save=True): + assert available()>=2*1024**3 + seed();chunks=[];first=None;phonemes=[];start=time.monotonic() + for result in pipeline(text,voice=voice,speed=1): + if first is None:first=time.monotonic()-start + assert len(result.phonemes)<=510,'Upstream phoneme truncation would invalidate this test' + audio=result.audio.detach().cpu().numpy().reshape(-1) + assert len(audio) and np.isfinite(audio).all() + chunks.append(audio);phonemes.append(result.phonemes) + elapsed=time.monotonic()-start + assert chunks + pcm=np.concatenate(chunks);duration=len(pcm)/24000 + row=dict(file=name if save else None,text=text,normalized_text=normalize_text_de(text),generation_seconds=elapsed, + duration_seconds=duration,rtf=elapsed/duration,realtime_multiple=duration/elapsed,first_complete_chunk_seconds=first, + chunks=len(chunks),phonemes=phonemes,dropped_phonemes=sorted({c for p in phonemes for c in p if c not in model.vocab}), + peak=float(np.max(np.abs(pcm))),clipped_fraction=float(np.mean(np.abs(pcm)>=1)), + peak_rss_kib=resource.getrusage(resource.RUSAGE_SELF).ru_maxrss) + if save: + path=ROOT/'outputs'/name;sf.write(path,pcm,24000,subtype='PCM_16');row['sha256']=hashlib.file_digest(path.open('rb'),'sha256').hexdigest() + return row + if args.phase=='speed': + # Explicit warmup is reported separately; both subsequent full story renders must pass. + data['warmup']=synthesize('Die Sprachausgabe ist bereit.','warmup.wav',False) + work=[(CASES[0],1),(CASES[0],2)] + else:work=[(CASES[1],1)] + for case,rep in work: + row=synthesize(case['text'],f'kikiri-victoria-{args.phase}-{case["id"]}-{rep}.wav');row.update(case=case['id'],repetition=rep) + data['runs'].append(row);data['phase']='running';write(target,data);print(json.dumps(row,ensure_ascii=False),flush=True) + if args.phase=='speed' and row['rtf']>.5:data.update(phase='speed_rejected',gate_passed=False);break + else:data.update(phase='complete',gate_passed=True) + data['weighted_rtf']=sum(r['generation_seconds'] for r in data['runs'])/sum(r['duration_seconds'] for r in data['runs']) + data['production_preservation']=preservation();write(target,data) + print(json.dumps(dict(phase=data['phase'],gate_passed=data['gate_passed'],weighted_rtf=data['weighted_rtf'],preservation=data['production_preservation'])),flush=True) + +if __name__=='__main__':main() diff --git a/docs/experiments/kikiri-victoria-cpu-2026-10-27/constraints.txt b/docs/experiments/kikiri-victoria-cpu-2026-10-27/constraints.txt new file mode 100644 index 0000000..0d221cd --- /dev/null +++ b/docs/experiments/kikiri-victoria-cpu-2026-10-27/constraints.txt @@ -0,0 +1,105 @@ +torch==2.6.0+cpu +addict==2.4.0 +annotated-types==0.7.0 +attrs==25.1.0 +babel==2.17.0 +blis==1.2.0 +catalogue==2.0.10 +certifi==2025.1.31 +cffi==2.0.0 +charset-normalizer==3.4.1 +click==8.1.8 +clldutils==3.21.0 +cloudpathlib==0.20.0 +colorama==0.4.6 +colorlog==6.9.0 +confection==0.1.5 +csvw==3.5.1 +curated-tokenizers==0.0.9 +curated-transformers==0.1.1 +cymem==2.0.11 +dlinfo==2.0.0 +docopt==0.6.2 +espeakng-loader==0.2.4 +filelock==3.17.0 +fsspec==2025.2.0 +huggingface-hub==0.28.1 +idna==3.10 +isodate==0.7.2 +jinja2==3.1.5 +joblib==1.4.2 +jsonschema==4.23.0 +jsonschema-specifications==2024.10.1 +langcodes==3.5.0 +language-data==1.3.0 +language-tags==1.2.0 +loguru==0.7.3 +lxml==5.3.1 +marisa-trie==1.2.1 +markdown==3.7 +markdown-it-py==3.0.0 +markupsafe==3.0.2 +mdurl==0.1.2 +mpmath==1.3.0 +murmurhash==1.0.12 +num2words==0.5.14 +numpy==1.26.4 +nvidia-cublas-cu12==12.4.5.8 +nvidia-cuda-cupti-cu12==12.4.127 +nvidia-cuda-nvrtc-cu12==12.4.127 +nvidia-cuda-runtime-cu12==12.4.127 +nvidia-cudnn-cu12==9.1.0.70 +nvidia-cufft-cu12==11.2.1.3 +nvidia-curand-cu12==10.3.5.147 +nvidia-cusolver-cu12==11.6.1.9 +nvidia-cusparse-cu12==12.3.1.170 +nvidia-cusparselt-cu12==0.6.2 +nvidia-nccl-cu12==2.21.5 +nvidia-nvjitlink-cu12==12.4.127 +nvidia-nvtx-cu12==12.4.127 +packaging==24.2 +phonemizer-fork==3.3.2 +pip==26.0.1 +preshed==3.0.9 +pycparser==3.0 +pydantic==2.10.6 +pydantic-core==2.27.2 +pygments==2.19.1 +pylatexenc==2.10 +pyparsing==3.2.1 +python-dateutil==2.9.0.post0 +pyyaml==6.0.2 +rdflib==7.1.3 +referencing==0.36.2 +regex==2024.11.6 +requests==2.32.3 +rfc3986==1.5.0 +rich==13.9.4 +rpds-py==0.22.3 +safetensors==0.5.2 +segments==2.2.1 +setuptools==75.8.0 +shellingham==1.5.4 +six==1.17.0 +smart-open==7.1.0 +soundfile==0.14.0 +spacy==3.8.4 +spacy-curated-transformers==0.3.0 +spacy-legacy==3.0.12 +spacy-loggers==1.0.5 +srsly==2.5.1 +sympy==1.13.1 +tabulate==0.9.0 +thinc==8.3.4 +tokenizers==0.21.0 +tqdm==4.67.1 +transformers==4.48.3 +triton==3.2.0 +typer==0.15.1 +typing-extensions==4.12.2 +uritemplate==4.1.1 +urllib3==2.3.0 +wasabi==1.1.3 +weasel==0.4.1 +win32-setctime==1.2.0 +wrapt==1.17.2 diff --git a/docs/experiments/kikiri-victoria-cpu-2026-10-27/final-verification.json b/docs/experiments/kikiri-victoria-cpu-2026-10-27/final-verification.json new file mode 100644 index 0000000..3d6631d --- /dev/null +++ b/docs/experiments/kikiri-victoria-cpu-2026-10-27/final-verification.json @@ -0,0 +1,20 @@ +{ + "production_preservation": { + "files_equal": true, + "pids_equal": true, + "deck_start_equal": true + }, + "test_units": { + "prepare": "LoadState=not-found\nActiveState=inactive", + "prepare2": "LoadState=not-found\nActiveState=inactive", + "prepare3": "LoadState=not-found\nActiveState=inactive", + "prepare4": "LoadState=not-found\nActiveState=inactive", + "checkpoint-check": "LoadState=not-found\nActiveState=inactive", + "speed": "LoadState=not-found\nActiveState=inactive", + "speed2": "LoadState=not-found\nActiveState=inactive", + "quality": "LoadState=not-found\nActiveState=inactive", + "stt": "LoadState=not-found\nActiveState=inactive", + "stt2": "LoadState=not-found\nActiveState=inactive" + }, + "own_disk_bytes": 2104439147 +} \ No newline at end of file diff --git a/docs/experiments/kikiri-victoria-cpu-2026-10-27/manifest.json b/docs/experiments/kikiri-victoria-cpu-2026-10-27/manifest.json new file mode 100644 index 0000000..b420e1f --- /dev/null +++ b/docs/experiments/kikiri-victoria-cpu-2026-10-27/manifest.json @@ -0,0 +1,49 @@ +{ + "python_url": "https://github.com/astral-sh/python-build-standalone/releases/download/20261026/cpython-3.11.18%2B20261026-x86_64-unknown-linux-gnu-install_only.tar.gz", + "python_sha256": "a87ee63646c8f8438b7af3954b2135ed2af91d033c631f12a8f20af903046d06", + "uv_url": "https://files.pythonhosted.org/packages/5c/43/0688ff5142934238f2812e348f4a24e09b57d48bfb38dd8f850325a0d9de/uv-0.13.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", + "uv_sha256": "22759b8895e1103578de6fb4cd27e94b4399d021023378d29f01333717751fba", + "repositories": { + "source": [ + "https://github.com/semidark/kikiri-tts.git", + "a12d0410e89841e6f3c09958ae5c072f90ae1d49" + ], + "kokoro": [ + "https://github.com/semidark/kokoro.git", + "b96fef95e6a746495f92443fac7c688f90fc57fc" + ], + "misaki": [ + "https://github.com/semidark/misaki.git", + "6d252a2e02f3b030f22f56686f1a73786c16ffc8" + ] + }, + "model_id": "kikiri-tts/kikiri-german-victoria", + "model_revision": "ce81e200ff9203e1a3b042cd678c48e3ffb85cef", + "files": [ + { + "file": "kikiri_german_victoria_ep10.pth", + "bytes": 327231582, + "sha256": "128d1c4a4184a459f23cb307a6cbbb8e9c076c2526f86e18594c1b320a81e00c", + "publisher_sha256": "128d1c4a4184a459f23cb307a6cbbb8e9c076c2526f86e18594c1b320a81e00c" + }, + { + "file": "voices/victoria.pt", + "bytes": 523445, + "sha256": "18dbcf0afa7b737e450e6ba769ee898a5aae1d90218265ff4c95422f4693da50", + "publisher_sha256": "18dbcf0afa7b737e450e6ba769ee898a5aae1d90218265ff4c95422f4693da50" + }, + { + "file": "README.md", + "bytes": 1679, + "sha256": "05eb9070a975754d0bc0034787288a2f53c89b5884b72458c61c3a59eb09f69b", + "publisher_sha256": null + } + ], + "config_sha256": "5abb01e2403b072bf03d04fde160443e209d7a0dad49a423be15196b9b43c17f", + "total_model_bytes": 327756706, + "production_preservation": { + "files_equal": true, + "pids_equal": true, + "deck_start_equal": true + } +} \ No newline at end of file diff --git a/docs/experiments/kikiri-victoria-cpu-2026-10-27/prepare.py b/docs/experiments/kikiri-victoria-cpu-2026-10-27/prepare.py new file mode 100644 index 0000000..bd073f7 --- /dev/null +++ b/docs/experiments/kikiri-victoria-cpu-2026-10-27/prepare.py @@ -0,0 +1,94 @@ +"""Pinned native Victoria CPU inference only; no training or production writes.""" +from pathlib import Path +import hashlib +import json +import os +import subprocess +import tarfile +import tomllib +import urllib.request +import zipfile +from support import ROOT,snapshot,write,preservation + +PYTHON_URL='https://github.com/astral-sh/python-build-standalone/releases/download/20261026/cpython-3.11.18%2B20261026-x86_64-unknown-linux-gnu-install_only.tar.gz' +PYTHON_SHA='a87ee63646c8f8438b7af3954b2135ed2af91d033c631f12a8f20af903046d06' +UV_URL='https://files.pythonhosted.org/packages/5c/43/0688ff5142934238f2812e348f4a24e09b57d48bfb38dd8f850325a0d9de/uv-0.13.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl' +UV_SHA='22759b8895e1103578de6fb4cd27e94b4399d021023378d29f01333717751fba' +REPOS={ + 'source':('https://github.com/semidark/kikiri-tts.git','a12d0410e89841e6f3c09958ae5c072f90ae1d49'), + 'kokoro':('https://github.com/semidark/kokoro.git','b96fef95e6a746495f92443fac7c688f90fc57fc'), + 'misaki':('https://github.com/semidark/misaki.git','6d252a2e02f3b030f22f56686f1a73786c16ffc8')} +MODEL_ID='kikiri-tts/kikiri-german-victoria' +MODEL_REV='ce81e200ff9203e1a3b042cd678c48e3ffb85cef' +NAMES=['kikiri_german_victoria_ep10.pth','voices/victoria.pt','README.md'] + +def run(args):subprocess.run([str(x) for x in args],check=True) +def download(url,path,expected=None): + if path.exists() and expected and hashlib.file_digest(path.open('rb'),'sha256').hexdigest()==expected:return + path.parent.mkdir(parents=True,exist_ok=True) + tmp=path.with_suffix(path.suffix+'.part') + with urllib.request.urlopen(url,timeout=120) as r,tmp.open('wb') as w: + while chunk:=r.read(1024*1024):w.write(chunk) + assert not expected or hashlib.file_digest(tmp.open('rb'),'sha256').hexdigest()==expected,path.name+' checksum' + tmp.replace(path) + +os.umask(0o077);ROOT.mkdir(exist_ok=True,mode=0o700) +os.environ.update(UV_CACHE_DIR=str(ROOT/'cache/uv'),UV_PYTHON_DOWNLOADS='never',CUDA_VISIBLE_DEVICES='', + HF_HOME=str(ROOT/'cache/huggingface'),HF_HUB_DISABLE_TELEMETRY='1',HF_HUB_DISABLE_IMPLICIT_TOKEN='1', + XDG_CACHE_HOME=str(ROOT/'cache'),OMP_NUM_THREADS='2',OPENBLAS_NUM_THREADS='1',GIT_LFS_SKIP_SMUDGE='1') +if not (ROOT/'production-before.json').exists():write(ROOT/'production-before.json',snapshot()) +if not (ROOT/'python/bin/python3.11').exists(): + archive=Path('/data/athena-chatterbox-nano-de-20261027/cpython-3.11.18.tar.gz') + if not archive.exists():archive=ROOT/'cpython-3.11.18.tar.gz';download(PYTHON_URL,archive,PYTHON_SHA) + assert hashlib.file_digest(archive.open('rb'),'sha256').hexdigest()==PYTHON_SHA + with tarfile.open(archive) as t:t.extractall(ROOT,filter='data') +uv=ROOT/'tools/uv' +if not uv.exists(): + wheel=ROOT/'uv-0.13.6.whl';download(UV_URL,wheel,UV_SHA) + uv.parent.mkdir(exist_ok=True) + with zipfile.ZipFile(wheel) as z: + candidates=[n for n in z.namelist() if n.endswith('/uv')] + assert len(candidates)==1,candidates + uv.write_bytes(z.read(candidates[0]));uv.chmod(0o700) +for folder,(url,rev) in REPOS.items(): + dest=ROOT/folder + if not dest.exists():run(['git','clone','--quiet',url,dest]) + run(['git','-C',dest,'checkout','--quiet','--detach',rev]) + assert subprocess.check_output(['git','-C',str(dest),'rev-parse','HEAD'],text=True).strip()==rev +python=ROOT/'venv/bin/python' +if not python.exists():run([uv,'venv','--python',ROOT/'python/bin/python3.11',ROOT/'venv']) +run([uv,'pip','install','--python',python,'--index-url','https://download.pytorch.org/whl/cpu','torch==2.6.0']) +constraints=ROOT/'constraints.txt' +lock=tomllib.loads((ROOT/'source/uv.lock').read_text()) +versions={} +for package in lock['package']: + if package.get('version'):versions.setdefault(package['name'],set()).add(package['version']) +# Universal lockfiles can contain different versions selected by Python/platform +# markers. Do not turn those branches into contradictory unconditional constraints. +locked=[f'{name}=={next(iter(values))}' for name,values in sorted(versions.items()) + if len(values)==1 and name not in ['torch','kokoro-deutsch','misaki']] +constraints.write_text('torch==2.6.0+cpu\n'+'\n'.join(locked)+'\n') +run([uv,'pip','install','--python',python,'--constraint',constraints, + '--extra-index-url','https://download.pytorch.org/whl/cpu','--index-strategy','unsafe-best-match', + str(ROOT/'misaki')+'[en,de]',ROOT/'kokoro','soundfile','click']) +# Remove two unused dependencies left by the initial unconstrained bootstrap; +# they require the newer Typer/Pydantic family that this published lock predates. +run([uv,'pip','uninstall','--python',python,'typer-slim','typing-inspection']) +run([uv,'pip','install','--python',python,'--constraint',constraints,'--reinstall-package','typer','typer==0.15.1']) +manifest=[] +with urllib.request.urlopen(f'https://huggingface.co/api/models/{MODEL_ID}/revision/{MODEL_REV}?blobs=true',timeout=30) as r:meta=json.load(r) +assert meta['sha']==MODEL_REV +remote={x['rfilename']:x for x in meta['siblings']} +for name in NAMES: + expected=remote[name].get('lfs',{}).get('sha256');path=ROOT/'model'/name + download(f'https://huggingface.co/{MODEL_ID}/resolve/{MODEL_REV}/{name}',path,expected) + row=dict(file=name,bytes=path.stat().st_size,sha256=hashlib.file_digest(path.open('rb'),'sha256').hexdigest(),publisher_sha256=expected) + manifest.append(row);print(json.dumps(row),flush=True) +(ROOT/'requirements-resolved.txt').write_text(subprocess.check_output([str(uv),'pip','freeze','--python',str(python)],text=True)) +write(ROOT/'manifest.json',dict(python_url=PYTHON_URL,python_sha256=PYTHON_SHA,uv_url=UV_URL,uv_sha256=UV_SHA, + repositories=REPOS,model_id=MODEL_ID,model_revision=MODEL_REV,files=manifest, + config_sha256=hashlib.file_digest((ROOT/'source/training/config.json').open('rb'),'sha256').hexdigest(), + total_model_bytes=sum(x['bytes'] for x in manifest),production_preservation=preservation())) +run([uv,'pip','check','--python',python]) +run([python,'-c','import torch; from kokoro import KModel,KPipeline; from misaki.de import DEG2P; from misaki.espeak import EspeakWrapper; print("CPU_TORCH",torch.__version__,"CUDA_BUILD",torch.version.cuda); print("GERMAN_G2P",DEG2P()("Die Sprachausgabe ist bereit.")[0]); assert torch.version.cuda is None']) +print('PREPARED',flush=True) diff --git a/docs/experiments/kikiri-victoria-cpu-2026-10-27/quality.json b/docs/experiments/kikiri-victoria-cpu-2026-10-27/quality.json new file mode 100644 index 0000000..112d810 --- /dev/null +++ b/docs/experiments/kikiri-victoria-cpu-2026-10-27/quality.json @@ -0,0 +1,232 @@ +{ + "phase": "complete", + "runs": [ + { + "file": "kikiri-victoria-quality-technical-1.wav", + "text": "Home Assistant läuft in Docker auf Unraid. Die SSD hat 47 Grad Celsius. Das Logfile enthält keinen Fehler. Die Datei ist 512 MiB groß und die Verbindung überträgt 100 Mbit pro Sekunde. Um 18:30 CEST startet der nächste Scan.", + "normalized_text": "Home Assistant läuft in Docker auf Unraid. Die SSD hat siebenundvierzig Grad Celsius. Das Logfile enthält keinen Fehler. Die Datei ist fünfhundertzwölf MiB groß und die Verbindung überträgt einhundert Mbit pro Sekunde. Um achtzehn Uhr dreißig CEST startet der nächste Scan.", + "generation_seconds": 6.695527099989704, + "duration_seconds": 19.0, + "rtf": 0.35239616315735284, + "realtime_multiple": 2.837715345820827, + "first_complete_chunk_seconds": 6.695394671987742, + "chunks": 1, + "phonemes": [ + "hˈoːmə ˈasɪstˌɑːnt lˈɔøft ɪn dˈɔkɜ Wf ˈʊnrˌIt. diː ˌɛsˌɛsdˈeː hat zˈiːbənˌʊndviːɾʦˌɪç ɡɾˈɑːt ʦˈɛlziːˌʊs. das lɔkfˈiːlə ɛnthˈɛlt kˈInən fˈeːlɜ. diː datˈI ɪst fˈynfhʊndɜʦvˌœlf mˈiː bˈeː ɡɾˈoːs ʊnt diː fɛɾbˈɪndʊŋ ˌyːbɜtɾˈɛːkt ˈInhˌʊndɜt ˈɛmbˈiːt pɾoː zeːkˈʊndə. ʊm ˈaxʦeːn ˈuːɾ dɾˈIsɪç kˈɛst ʃtˈaɾtət dɛɾ nˈɛçstə skˈɑːn." + ], + "dropped_phonemes": [], + "peak": 0.4903533458709717, + "clipped_fraction": 0.0, + "peak_rss_kib": 1467868, + "sha256": "634d713078734696b2a7e63ece4ae167ea59fb0a4cdf92bf74ccc05c8f846b8c", + "case": "technical", + "repetition": 1 + } + ], + "protocol": { + "device": "cpu", + "voice": "Victoria", + "cpu_threads": 4, + "interop_threads": 1, + "affinity": [ + 2, + 3, + 4, + 5, + 8, + 9, + 10, + 11 + ], + "precision": "fp32", + "seed": 42, + "speed": 1, + "gate_maximum_rtf": 0.5, + "german_frontend": "Kikiri lockfile Misaki DEG2P", + "compatibility_map": { + "ʏ": "y" + }, + "cpu_quota_percent": 400, + "memory_max_gib": 3, + "concurrent_llm_load_added": false + }, + "torch": "2.6.0+cpu", + "model_load_seconds": 0.788367835993995, + "strict_components": [ + { + "component": "bert", + "identity_affine_keys": [] + }, + { + "component": "bert_encoder", + "identity_affine_keys": [] + }, + { + "component": "predictor", + "identity_affine_keys": [ + "F0.0.norm1.norm.weight", + "F0.0.norm1.norm.bias", + "F0.0.norm2.norm.weight", + "F0.0.norm2.norm.bias", + "F0.1.norm1.norm.weight", + "F0.1.norm1.norm.bias", + "F0.1.norm2.norm.weight", + "F0.1.norm2.norm.bias", + "F0.2.norm1.norm.weight", + "F0.2.norm1.norm.bias", + "F0.2.norm2.norm.weight", + "F0.2.norm2.norm.bias", + "N.0.norm1.norm.weight", + "N.0.norm1.norm.bias", + "N.0.norm2.norm.weight", + "N.0.norm2.norm.bias", + "N.1.norm1.norm.weight", + "N.1.norm1.norm.bias", + "N.1.norm2.norm.weight", + "N.1.norm2.norm.bias", + "N.2.norm1.norm.weight", + "N.2.norm1.norm.bias", + "N.2.norm2.norm.weight", + "N.2.norm2.norm.bias" + ] + }, + { + "component": "text_encoder", + "identity_affine_keys": [] + }, + { + "component": "decoder", + "identity_affine_keys": [ + "encode.norm1.norm.weight", + "encode.norm1.norm.bias", + "encode.norm2.norm.weight", + "encode.norm2.norm.bias", + "decode.0.norm1.norm.weight", + "decode.0.norm1.norm.bias", + "decode.0.norm2.norm.weight", + "decode.0.norm2.norm.bias", + "decode.1.norm1.norm.weight", + "decode.1.norm1.norm.bias", + "decode.1.norm2.norm.weight", + "decode.1.norm2.norm.bias", + "decode.2.norm1.norm.weight", + "decode.2.norm1.norm.bias", + "decode.2.norm2.norm.weight", + "decode.2.norm2.norm.bias", + "decode.3.norm1.norm.weight", + "decode.3.norm1.norm.bias", + "decode.3.norm2.norm.weight", + "decode.3.norm2.norm.bias", + "generator.noise_res.0.adain1.0.norm.weight", + "generator.noise_res.0.adain1.0.norm.bias", + "generator.noise_res.0.adain1.1.norm.weight", + "generator.noise_res.0.adain1.1.norm.bias", + "generator.noise_res.0.adain1.2.norm.weight", + "generator.noise_res.0.adain1.2.norm.bias", + "generator.noise_res.0.adain2.0.norm.weight", + "generator.noise_res.0.adain2.0.norm.bias", + "generator.noise_res.0.adain2.1.norm.weight", + "generator.noise_res.0.adain2.1.norm.bias", + "generator.noise_res.0.adain2.2.norm.weight", + "generator.noise_res.0.adain2.2.norm.bias", + "generator.noise_res.1.adain1.0.norm.weight", + "generator.noise_res.1.adain1.0.norm.bias", + "generator.noise_res.1.adain1.1.norm.weight", + "generator.noise_res.1.adain1.1.norm.bias", + "generator.noise_res.1.adain1.2.norm.weight", + "generator.noise_res.1.adain1.2.norm.bias", + "generator.noise_res.1.adain2.0.norm.weight", + "generator.noise_res.1.adain2.0.norm.bias", + "generator.noise_res.1.adain2.1.norm.weight", + "generator.noise_res.1.adain2.1.norm.bias", + "generator.noise_res.1.adain2.2.norm.weight", + "generator.noise_res.1.adain2.2.norm.bias", + "generator.resblocks.0.adain1.0.norm.weight", + "generator.resblocks.0.adain1.0.norm.bias", + "generator.resblocks.0.adain1.1.norm.weight", + "generator.resblocks.0.adain1.1.norm.bias", + "generator.resblocks.0.adain1.2.norm.weight", + "generator.resblocks.0.adain1.2.norm.bias", + "generator.resblocks.0.adain2.0.norm.weight", + "generator.resblocks.0.adain2.0.norm.bias", + "generator.resblocks.0.adain2.1.norm.weight", + "generator.resblocks.0.adain2.1.norm.bias", + "generator.resblocks.0.adain2.2.norm.weight", + "generator.resblocks.0.adain2.2.norm.bias", + "generator.resblocks.1.adain1.0.norm.weight", + "generator.resblocks.1.adain1.0.norm.bias", + "generator.resblocks.1.adain1.1.norm.weight", + "generator.resblocks.1.adain1.1.norm.bias", + "generator.resblocks.1.adain1.2.norm.weight", + "generator.resblocks.1.adain1.2.norm.bias", + "generator.resblocks.1.adain2.0.norm.weight", + "generator.resblocks.1.adain2.0.norm.bias", + "generator.resblocks.1.adain2.1.norm.weight", + "generator.resblocks.1.adain2.1.norm.bias", + "generator.resblocks.1.adain2.2.norm.weight", + "generator.resblocks.1.adain2.2.norm.bias", + "generator.resblocks.2.adain1.0.norm.weight", + "generator.resblocks.2.adain1.0.norm.bias", + "generator.resblocks.2.adain1.1.norm.weight", + "generator.resblocks.2.adain1.1.norm.bias", + "generator.resblocks.2.adain1.2.norm.weight", + "generator.resblocks.2.adain1.2.norm.bias", + "generator.resblocks.2.adain2.0.norm.weight", + "generator.resblocks.2.adain2.0.norm.bias", + "generator.resblocks.2.adain2.1.norm.weight", + "generator.resblocks.2.adain2.1.norm.bias", + "generator.resblocks.2.adain2.2.norm.weight", + "generator.resblocks.2.adain2.2.norm.bias", + "generator.resblocks.3.adain1.0.norm.weight", + "generator.resblocks.3.adain1.0.norm.bias", + "generator.resblocks.3.adain1.1.norm.weight", + "generator.resblocks.3.adain1.1.norm.bias", + "generator.resblocks.3.adain1.2.norm.weight", + "generator.resblocks.3.adain1.2.norm.bias", + "generator.resblocks.3.adain2.0.norm.weight", + "generator.resblocks.3.adain2.0.norm.bias", + "generator.resblocks.3.adain2.1.norm.weight", + "generator.resblocks.3.adain2.1.norm.bias", + "generator.resblocks.3.adain2.2.norm.weight", + "generator.resblocks.3.adain2.2.norm.bias", + "generator.resblocks.4.adain1.0.norm.weight", + "generator.resblocks.4.adain1.0.norm.bias", + "generator.resblocks.4.adain1.1.norm.weight", + "generator.resblocks.4.adain1.1.norm.bias", + "generator.resblocks.4.adain1.2.norm.weight", + "generator.resblocks.4.adain1.2.norm.bias", + "generator.resblocks.4.adain2.0.norm.weight", + "generator.resblocks.4.adain2.0.norm.bias", + "generator.resblocks.4.adain2.1.norm.weight", + "generator.resblocks.4.adain2.1.norm.bias", + "generator.resblocks.4.adain2.2.norm.weight", + "generator.resblocks.4.adain2.2.norm.bias", + "generator.resblocks.5.adain1.0.norm.weight", + "generator.resblocks.5.adain1.0.norm.bias", + "generator.resblocks.5.adain1.1.norm.weight", + "generator.resblocks.5.adain1.1.norm.bias", + "generator.resblocks.5.adain1.2.norm.weight", + "generator.resblocks.5.adain1.2.norm.bias", + "generator.resblocks.5.adain2.0.norm.weight", + "generator.resblocks.5.adain2.0.norm.bias", + "generator.resblocks.5.adain2.1.norm.weight", + "generator.resblocks.5.adain2.1.norm.bias", + "generator.resblocks.5.adain2.2.norm.weight", + "generator.resblocks.5.adain2.2.norm.bias" + ] + } + ], + "parameters": 81810022, + "voice_shape": [ + 510, + 1, + 256 + ], + "gate_passed": true, + "weighted_rtf": 0.35239616315735284, + "production_preservation": { + "files_equal": true, + "pids_equal": true, + "deck_start_equal": true + } +} \ No newline at end of file diff --git a/docs/experiments/kikiri-victoria-cpu-2026-10-27/requirements-resolved.txt b/docs/experiments/kikiri-victoria-cpu-2026-10-27/requirements-resolved.txt new file mode 100644 index 0000000..78f1680 --- /dev/null +++ b/docs/experiments/kikiri-victoria-cpu-2026-10-27/requirements-resolved.txt @@ -0,0 +1,97 @@ +addict==2.4.0 +annotated-doc==0.0.5 +annotated-types==0.7.0 +attrs==25.1.0 +babel==2.17.0 +blis==1.2.0 +catalogue==2.0.10 +certifi==2025.1.31 +cffi==2.0.0 +charset-normalizer==3.4.1 +click==8.1.8 +clldutils==3.21.0 +cloudpathlib==0.20.0 +cloudpickle==3.1.2 +colorama==0.4.6 +colorlog==6.9.0 +confection==0.1.5 +csvw==3.5.1 +curated-tokenizers==0.0.9 +curated-transformers==0.1.1 +cymem==2.0.11 +dlinfo==2.0.0 +docopt==0.6.2 +espeakng-loader==0.2.4 +filelock==3.17.0 +fsspec==2025.2.0 +huggingface-hub==0.28.1 +idna==3.10 +isodate==0.7.2 +jinja2==3.1.5 +joblib==1.4.2 +jsonschema==4.23.0 +jsonschema-specifications==2024.10.1 +kokoro @ file:///data/athena-kikiri-victoria-cpu-20261027/kokoro +langcodes==3.5.0 +language-data==1.3.0 +language-tags==1.2.0 +loguru==0.7.3 +lxml==5.3.1 +marisa-trie==1.2.1 +markdown==3.7 +markdown-it-py==3.0.0 +markupsafe==3.0.2 +mdurl==0.1.2 +misaki @ file:///data/athena-kikiri-victoria-cpu-20261027/misaki +mpmath==1.3.0 +murmurhash==1.0.12 +networkx==3.6.1 +num2words==0.5.14 +numpy==1.26.4 +packaging==24.2 +phonemizer-fork==3.3.2 +pip==26.0.1 +preshed==3.0.9 +pycparser==3.0 +pydantic==2.10.6 +pydantic-core==2.27.2 +pygments==2.19.1 +pylatexenc==2.10 +pyparsing==3.2.1 +python-dateutil==2.9.0.post0 +pyyaml==6.0.2 +rdflib==7.1.3 +referencing==0.36.2 +regex==2024.11.6 +requests==2.32.3 +rfc3986==1.5.0 +rich==13.9.4 +rpds-py==0.22.3 +safetensors==0.5.2 +segments==2.2.1 +setuptools==75.8.0 +shellingham==1.5.4 +six==1.17.0 +smart-open==7.1.0 +soundfile==0.14.0 +spacy==3.8.4 +spacy-curated-transformers==0.3.0 +spacy-legacy==3.0.12 +spacy-loggers==1.0.5 +srsly==2.5.1 +sympy==1.13.1 +tabulate==0.9.0 +termcolor==3.3.0 +thinc==8.3.4 +tokenizers==0.21.0 +torch==2.6.0+cpu +tqdm==4.67.1 +transformers==4.48.3 +typer==0.15.1 +typing-extensions==4.12.2 +tzdata==2026.5 +uritemplate==4.1.1 +urllib3==2.3.0 +wasabi==1.1.3 +weasel==0.4.1 +wrapt==1.17.2 diff --git a/docs/experiments/kikiri-victoria-cpu-2026-10-27/score.py b/docs/experiments/kikiri-victoria-cpu-2026-10-27/score.py new file mode 100644 index 0000000..f9d6420 --- /dev/null +++ b/docs/experiments/kikiri-victoria-cpu-2026-10-27/score.py @@ -0,0 +1,36 @@ +"""Verify actual synthetic speech with existing native local CPU ASR.""" +from pathlib import Path +import json +import re +import subprocess +import time +from support import ROOT,write + +BASE=Path('/opt/athena-deck-dev/runtime/state/parakeet-runtime/v0.6.1') +CLI=BASE/'runtime/parakeet-v0.6.1-bin-linux-cpu-x64/parakeet-cli' + +def edits(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] + +rows=[] +for name in ['quality']: + source=ROOT/(name+'.json') + if not source.exists():continue + data=json.loads(source.read_text()) + assert data['phase'] in ['complete','speed_rejected'],'Do not score a failed/incomplete run' + for run in data['runs']: + started=time.monotonic() + proc=subprocess.run([str(CLI),'transcribe','--model',str(BASE/'redux-packed.gguf'), + '--input',str(ROOT/'outputs'/run['file']),'--lang','de','--threads','2','--json'], + capture_output=True,text=True,timeout=90) + row=dict(file=run['file'],case=run['case'],voice='Victoria',exit_code=proc.returncode,seconds=time.monotonic()-started) + if proc.returncode==0: + actual=json.loads(proc.stdout)['text'];a=re.findall(r'\w+',run['text'].casefold());b=re.findall(r'\w+',actual.casefold()) + row.update(expected=run['text'],recognized=actual,reference_words=len(a),word_edits=edits(a,b),exact_word_match=a==b) + else:row['error']=proc.stderr[-1000:] + rows.append(row);write(ROOT/'transcriptions.json',rows);print(json.dumps(row,ensure_ascii=False),flush=True) diff --git a/docs/experiments/kikiri-victoria-cpu-2026-10-27/speed.json b/docs/experiments/kikiri-victoria-cpu-2026-10-27/speed.json new file mode 100644 index 0000000..200479e --- /dev/null +++ b/docs/experiments/kikiri-victoria-cpu-2026-10-27/speed.json @@ -0,0 +1,271 @@ +{ + "phase": "complete", + "runs": [ + { + "file": "kikiri-victoria-speed-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.", + "normalized_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": 4.777436057993327, + "duration_seconds": 14.5, + "rtf": 0.329478348827126, + "realtime_multiple": 3.0351007996725454, + "first_complete_chunk_seconds": 4.777343484995072, + "chunks": 1, + "phonemes": [ + "vˌɛn duː mˈɑːkst, ɛɾʦˈɛːlə ɪç diːɾ ˌInə kˈʊɐʦə ɡəʃˈɪçtə. ˈanɑː ˈœfnətə das fˈɛnstɜ ʊnt hˈœɾtə dɾˈI vˈøːɡəl zˈɪŋən. Wf deːm tˈɪʃ lˈɑːɡən zˈiːbən bˈyːçɜ ʊnt ˌInə rˈoːtə tˈasə. ʦʊm ʃlˈʊs zˈɑːɡtə ziː: das hat vˈʊndɜbˌɑːɾ fʊŋkʦjˌoːnˈiːɾt." + ], + "dropped_phonemes": [], + "peak": 0.3984907269477844, + "clipped_fraction": 0.0, + "peak_rss_kib": 1352056, + "sha256": "bad38707a3111d2c3aa8f3e793cc0cc4ccb33bc095398aa5068fc1426e4f91db", + "case": "story", + "repetition": 1 + }, + { + "file": "kikiri-victoria-speed-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.", + "normalized_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": 4.243002183007775, + "duration_seconds": 14.5, + "rtf": 0.29262084020743273, + "realtime_multiple": 3.417391595523822, + "first_complete_chunk_seconds": 4.242912625006284, + "chunks": 1, + "phonemes": [ + "vˌɛn duː mˈɑːkst, ɛɾʦˈɛːlə ɪç diːɾ ˌInə kˈʊɐʦə ɡəʃˈɪçtə. ˈanɑː ˈœfnətə das fˈɛnstɜ ʊnt hˈœɾtə dɾˈI vˈøːɡəl zˈɪŋən. Wf deːm tˈɪʃ lˈɑːɡən zˈiːbən bˈyːçɜ ʊnt ˌInə rˈoːtə tˈasə. ʦʊm ʃlˈʊs zˈɑːɡtə ziː: das hat vˈʊndɜbˌɑːɾ fʊŋkʦjˌoːnˈiːɾt." + ], + "dropped_phonemes": [], + "peak": 0.3984907269477844, + "clipped_fraction": 0.0, + "peak_rss_kib": 1352056, + "sha256": "bad38707a3111d2c3aa8f3e793cc0cc4ccb33bc095398aa5068fc1426e4f91db", + "case": "story", + "repetition": 2 + } + ], + "protocol": { + "device": "cpu", + "voice": "Victoria", + "cpu_threads": 4, + "interop_threads": 1, + "affinity": [ + 2, + 3, + 4, + 5, + 8, + 9, + 10, + 11 + ], + "precision": "fp32", + "seed": 42, + "speed": 1, + "gate_maximum_rtf": 0.5, + "german_frontend": "Kikiri lockfile Misaki DEG2P", + "compatibility_map": { + "ʏ": "y" + }, + "cpu_quota_percent": 400, + "memory_max_gib": 3, + "concurrent_llm_load_added": false + }, + "torch": "2.6.0+cpu", + "model_load_seconds": 0.771420061995741, + "strict_components": [ + { + "component": "bert", + "identity_affine_keys": [] + }, + { + "component": "bert_encoder", + "identity_affine_keys": [] + }, + { + "component": "predictor", + "identity_affine_keys": [ + "F0.0.norm1.norm.weight", + "F0.0.norm1.norm.bias", + "F0.0.norm2.norm.weight", + "F0.0.norm2.norm.bias", + "F0.1.norm1.norm.weight", + "F0.1.norm1.norm.bias", + "F0.1.norm2.norm.weight", + "F0.1.norm2.norm.bias", + "F0.2.norm1.norm.weight", + "F0.2.norm1.norm.bias", + "F0.2.norm2.norm.weight", + "F0.2.norm2.norm.bias", + "N.0.norm1.norm.weight", + "N.0.norm1.norm.bias", + "N.0.norm2.norm.weight", + "N.0.norm2.norm.bias", + "N.1.norm1.norm.weight", + "N.1.norm1.norm.bias", + "N.1.norm2.norm.weight", + "N.1.norm2.norm.bias", + "N.2.norm1.norm.weight", + "N.2.norm1.norm.bias", + "N.2.norm2.norm.weight", + "N.2.norm2.norm.bias" + ] + }, + { + "component": "text_encoder", + "identity_affine_keys": [] + }, + { + "component": "decoder", + "identity_affine_keys": [ + "encode.norm1.norm.weight", + "encode.norm1.norm.bias", + "encode.norm2.norm.weight", + "encode.norm2.norm.bias", + "decode.0.norm1.norm.weight", + "decode.0.norm1.norm.bias", + "decode.0.norm2.norm.weight", + "decode.0.norm2.norm.bias", + "decode.1.norm1.norm.weight", + "decode.1.norm1.norm.bias", + "decode.1.norm2.norm.weight", + "decode.1.norm2.norm.bias", + "decode.2.norm1.norm.weight", + "decode.2.norm1.norm.bias", + "decode.2.norm2.norm.weight", + "decode.2.norm2.norm.bias", + "decode.3.norm1.norm.weight", + "decode.3.norm1.norm.bias", + "decode.3.norm2.norm.weight", + "decode.3.norm2.norm.bias", + "generator.noise_res.0.adain1.0.norm.weight", + "generator.noise_res.0.adain1.0.norm.bias", + "generator.noise_res.0.adain1.1.norm.weight", + "generator.noise_res.0.adain1.1.norm.bias", + "generator.noise_res.0.adain1.2.norm.weight", + "generator.noise_res.0.adain1.2.norm.bias", + "generator.noise_res.0.adain2.0.norm.weight", + "generator.noise_res.0.adain2.0.norm.bias", + "generator.noise_res.0.adain2.1.norm.weight", + "generator.noise_res.0.adain2.1.norm.bias", + "generator.noise_res.0.adain2.2.norm.weight", + "generator.noise_res.0.adain2.2.norm.bias", + "generator.noise_res.1.adain1.0.norm.weight", + "generator.noise_res.1.adain1.0.norm.bias", + "generator.noise_res.1.adain1.1.norm.weight", + "generator.noise_res.1.adain1.1.norm.bias", + "generator.noise_res.1.adain1.2.norm.weight", + "generator.noise_res.1.adain1.2.norm.bias", + "generator.noise_res.1.adain2.0.norm.weight", + "generator.noise_res.1.adain2.0.norm.bias", + "generator.noise_res.1.adain2.1.norm.weight", + "generator.noise_res.1.adain2.1.norm.bias", + "generator.noise_res.1.adain2.2.norm.weight", + "generator.noise_res.1.adain2.2.norm.bias", + "generator.resblocks.0.adain1.0.norm.weight", + "generator.resblocks.0.adain1.0.norm.bias", + "generator.resblocks.0.adain1.1.norm.weight", + "generator.resblocks.0.adain1.1.norm.bias", + "generator.resblocks.0.adain1.2.norm.weight", + "generator.resblocks.0.adain1.2.norm.bias", + "generator.resblocks.0.adain2.0.norm.weight", + "generator.resblocks.0.adain2.0.norm.bias", + "generator.resblocks.0.adain2.1.norm.weight", + "generator.resblocks.0.adain2.1.norm.bias", + "generator.resblocks.0.adain2.2.norm.weight", + "generator.resblocks.0.adain2.2.norm.bias", + "generator.resblocks.1.adain1.0.norm.weight", + "generator.resblocks.1.adain1.0.norm.bias", + "generator.resblocks.1.adain1.1.norm.weight", + "generator.resblocks.1.adain1.1.norm.bias", + "generator.resblocks.1.adain1.2.norm.weight", + "generator.resblocks.1.adain1.2.norm.bias", + "generator.resblocks.1.adain2.0.norm.weight", + "generator.resblocks.1.adain2.0.norm.bias", + "generator.resblocks.1.adain2.1.norm.weight", + "generator.resblocks.1.adain2.1.norm.bias", + "generator.resblocks.1.adain2.2.norm.weight", + "generator.resblocks.1.adain2.2.norm.bias", + "generator.resblocks.2.adain1.0.norm.weight", + "generator.resblocks.2.adain1.0.norm.bias", + "generator.resblocks.2.adain1.1.norm.weight", + "generator.resblocks.2.adain1.1.norm.bias", + "generator.resblocks.2.adain1.2.norm.weight", + "generator.resblocks.2.adain1.2.norm.bias", + "generator.resblocks.2.adain2.0.norm.weight", + "generator.resblocks.2.adain2.0.norm.bias", + "generator.resblocks.2.adain2.1.norm.weight", + "generator.resblocks.2.adain2.1.norm.bias", + "generator.resblocks.2.adain2.2.norm.weight", + "generator.resblocks.2.adain2.2.norm.bias", + "generator.resblocks.3.adain1.0.norm.weight", + "generator.resblocks.3.adain1.0.norm.bias", + "generator.resblocks.3.adain1.1.norm.weight", + "generator.resblocks.3.adain1.1.norm.bias", + "generator.resblocks.3.adain1.2.norm.weight", + "generator.resblocks.3.adain1.2.norm.bias", + "generator.resblocks.3.adain2.0.norm.weight", + "generator.resblocks.3.adain2.0.norm.bias", + "generator.resblocks.3.adain2.1.norm.weight", + "generator.resblocks.3.adain2.1.norm.bias", + "generator.resblocks.3.adain2.2.norm.weight", + "generator.resblocks.3.adain2.2.norm.bias", + "generator.resblocks.4.adain1.0.norm.weight", + "generator.resblocks.4.adain1.0.norm.bias", + "generator.resblocks.4.adain1.1.norm.weight", + "generator.resblocks.4.adain1.1.norm.bias", + "generator.resblocks.4.adain1.2.norm.weight", + "generator.resblocks.4.adain1.2.norm.bias", + "generator.resblocks.4.adain2.0.norm.weight", + "generator.resblocks.4.adain2.0.norm.bias", + "generator.resblocks.4.adain2.1.norm.weight", + "generator.resblocks.4.adain2.1.norm.bias", + "generator.resblocks.4.adain2.2.norm.weight", + "generator.resblocks.4.adain2.2.norm.bias", + "generator.resblocks.5.adain1.0.norm.weight", + "generator.resblocks.5.adain1.0.norm.bias", + "generator.resblocks.5.adain1.1.norm.weight", + "generator.resblocks.5.adain1.1.norm.bias", + "generator.resblocks.5.adain1.2.norm.weight", + "generator.resblocks.5.adain1.2.norm.bias", + "generator.resblocks.5.adain2.0.norm.weight", + "generator.resblocks.5.adain2.0.norm.bias", + "generator.resblocks.5.adain2.1.norm.weight", + "generator.resblocks.5.adain2.1.norm.bias", + "generator.resblocks.5.adain2.2.norm.weight", + "generator.resblocks.5.adain2.2.norm.bias" + ] + } + ], + "parameters": 81810022, + "voice_shape": [ + 510, + 1, + 256 + ], + "warmup": { + "file": null, + "text": "Die Sprachausgabe ist bereit.", + "normalized_text": "Die Sprachausgabe ist bereit.", + "generation_seconds": 0.6597314259997802, + "duration_seconds": 2.55, + "rtf": 0.2587182062744236, + "realtime_multiple": 3.865209234402682, + "first_complete_chunk_seconds": 0.6596542509942083, + "chunks": 1, + "phonemes": [ + "diː ʃpɾˈɑːxWsɡˌɑːbə ɪst bərˈIt." + ], + "dropped_phonemes": [], + "peak": 0.38191255927085876, + "clipped_fraction": 0.0, + "peak_rss_kib": 1047092 + }, + "gate_passed": true, + "weighted_rtf": 0.31104959451727937, + "production_preservation": { + "files_equal": true, + "pids_equal": true, + "deck_start_equal": true + } +} \ No newline at end of file diff --git a/docs/experiments/kikiri-victoria-cpu-2026-10-27/support.py b/docs/experiments/kikiri-victoria-cpu-2026-10-27/support.py new file mode 100644 index 0000000..910f1ab --- /dev/null +++ b/docs/experiments/kikiri-victoria-cpu-2026-10-27/support.py @@ -0,0 +1,37 @@ +"""Small stdlib-only helpers; no production settings or credentials are read out.""" +from pathlib import Path +import hashlib +import json +import subprocess + +ROOT=Path('/data/athena-kikiri-victoria-cpu-20261027') +REFS=Path('/data/athena-articulino-references-20261027/references') +STATE=Path('/opt/athena-deck-dev/runtime/state') +FILES=[STATE/n for n in ('profiles.json','endpoint.json','audio-policy.json','cpu-partition.json')] +FILES += [STATE/'speech-voices/Anna/reference.wav',Path('/opt/athena-deck-dev/source/qwen_native_worker.py')] +CASES=[dict(id='story',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.'), + dict(id='technical',text='Home Assistant läuft in Docker auf Unraid. Die SSD hat 47 Grad Celsius. Das Logfile enthält keinen Fehler. Die Datei ist 512 MiB groß und die Verbindung überträgt 100 Mbit pro Sekunde. Um 18:30 CEST startet der nächste Scan.')] + +def write(path,data): + tmp=path.with_suffix('.tmp');tmp.write_text(json.dumps(data,indent=2,ensure_ascii=False));tmp.replace(path) + +def available(): + return next(int(s.split()[1])*1024 for s in Path('/proc/meminfo').read_text().splitlines() if s.startswith('MemAvailable:')) + +def snapshot(): + pids=dict(strata=[],articulino=[],qwen_tts=[]) + for p in Path('/proc').iterdir(): + if not p.name.isdigit():continue + try:args=(p/'cmdline').read_bytes().split(b'\0') + except OSError:continue + if args and args[0].endswith(b'/engine/strata'):pids['strata'].append(int(p.name)) + for key,name in [('articulino','articulino_worker.py'),('qwen_tts','qwen_native_worker.py')]: + if any(a.endswith(('/'+name).encode()) for a in args):pids[key].append(int(p.name)) + return dict(hashes={str(p):hashlib.file_digest(p.open('rb'),'sha256').hexdigest() for p in FILES},pids=pids, + deck_started=subprocess.check_output(['docker','inspect','--format','{{.State.StartedAt}}','athena-deck-dev'],text=True).strip()) + +def preservation(): + before=json.loads((ROOT/'production-before.json').read_text());after=snapshot() + write(ROOT/'production-after.json',after) + return dict(files_equal=before['hashes']==after['hashes'],pids_equal=before['pids']==after['pids'], + deck_start_equal=before['deck_started']==after['deck_started']) diff --git a/docs/experiments/kikiri-victoria-cpu-2026-10-27/transcriptions.json b/docs/experiments/kikiri-victoria-cpu-2026-10-27/transcriptions.json new file mode 100644 index 0000000..9f92ab6 --- /dev/null +++ b/docs/experiments/kikiri-victoria-cpu-2026-10-27/transcriptions.json @@ -0,0 +1,14 @@ +[ + { + "file": "kikiri-victoria-quality-technical-1.wav", + "case": "technical", + "voice": "Victoria", + "exit_code": 0, + "seconds": 1.424114230001578, + "expected": "Home Assistant läuft in Docker auf Unraid. Die SSD hat 47 Grad Celsius. Das Logfile enthält keinen Fehler. Die Datei ist 512 MiB groß und die Verbindung überträgt 100 Mbit pro Sekunde. Um 18:30 CEST startet der nächste Scan.", + "recognized": "Home Assistant läuft in Docker auf Unreid. Die SSD hat 47 Grad Celsius. Das Lockfehler enthält keinen Fehler. Die Datei ist 512 MiB groß und die Verbindung überträgt 100 Mbit pro Sekunde. Um 18.30 Uhr Käst startet der nächste Scarn.", + "reference_words": 40, + "word_edits": 5, + "exact_word_match": false + } +] \ No newline at end of file diff --git a/docs/experiments/tts-candidate-shortlist-2026-10-27.md b/docs/experiments/tts-candidate-shortlist-2026-10-27.md index fb4c361..f828857 100644 --- a/docs/experiments/tts-candidate-shortlist-2026-10-27.md +++ b/docs/experiments/tts-candidate-shortlist-2026-10-27.md @@ -17,6 +17,7 @@ record the verdict and clean up its own test data when requested. | Sopro V2 Turbo, FP32 | **Serious candidate; retain — preferred listening sample: technical B** | About 2.42× realtime on Athena CPU, four threads. All three story samples matched all words in local STT. Raw technical text still has ASR discrepancies around Unraid, MiB, CEST and time wording. Michael hears technical B as the closest Anna approximation so far, better than Articulino but not perfect. Reference B is 05:25.14–05:33.00 of the supplied recording; fixed recipe and results: [Sopro experiment](sopro-cpu-2026-10-27/README.md). No activation/integration authorized; continue evaluating other models. | | Qwen3-TTS 0.6B Q4 / Q8 codec | Retained comparison reference | Same three clips/text gave about 15 s in 14.111–14.645 s. This passage was complete in STT; previous intermittent noise failures remain unresolved. This row makes no claim about which profile is currently published. | | Chatterbox Nano + German community LoRA, FP32 | **Stronger perceived Anna identity; accent and CPU reserve unresolved** | Explicit Athena trial: Anna B, four CPU threads, adapter merged in RAM, 16.98 s audio in 14.815 s (RTF 0.8725, 1.146× realtime), first synthesis. No warm repeat or quality matrix after missing the 2× gate. Michael hears Anna more clearly, with a slight Chinese-sounding accent. He confirms “rote Tasse” is correct: the raw STT “hohe Tasse” was an ASR error, not a confirmed TTS word error. No general claim about untested precision/runtime alternatives. No activation; Sopro technical B remains the reference. [Actual trial](chatterbox-nano-de-cpu-2026-10-27/README.md). | +| Kokoro/Kikiri German Victoria, FP32 | **CPU speed gate passed; listening verdict pending; Anna untested** | Explicit CPU-only test with the public Victoria voice: story 14.5 s in 4.24–4.78 s; technical text 19 s in 6.70 s (2.84× realtime). Local STT recovered numbers/time; technical term discrepancies remain, and the frontend pronounces CEST as a word. This is not an Anna-cloning sample or proof that Anna fine-tuning will work. No training, GPU test or activation. [Victoria trial](kikiri-victoria-cpu-2026-10-27/README.md). | | Audio8 TTS Preview 0.1B ONNX INT8 | **Rejected and deleted** | CPU speed fails; Michael also reports a Chinese-sounding accent. All isolated weights, venv, derived voices, pilot data and audio deleted remotely and locally: about 1.49 GiB on Athena plus 8.3 MiB local. Small records remain in `audio8-cpu-2026-10-27/`. Qwen and Articulino preserved. | | Pocket TTS German | Already tested, not a newly discovered alternative | Existing 17 October Anna CPU runs had RTF 0.453/0.462. Do not present it as untested or claim the newly advertised tiny English models support German. A different German checkpoint/recipe would need a specific reason to retest. | | MOSS-TTS-Nano / NeuTTS-Nano German Q8 | Rejected; test weights removed | Michael rejected pronunciation/naturalness. Do not silently reinstall or rank them as acceptable based on ASR. | @@ -89,10 +90,12 @@ an installed Hermes integration or verified native-client playback. - [Phonon runtime: provider-based custom voice creation](https://github.com/gradium-ai/xn-ptts#voices) - [Sopro V2 Turbo publisher model card](https://huggingface.co/samuel-vitorino/sopro-v2-turbo) - [Chatterbox Nano German community adapter](https://huggingface.co/Pseudonaut/chatterbox-nano-de-lora) +- [Kikiri German Victoria](https://huggingface.co/kikiri-tts/kikiri-german-victoria) +- [Kikiri training/inference source](https://github.com/semidark/kikiri-tts) - Local measurements: `articulino-reference-comparison-2026-10-27/`, `qwen-reference-comparison-2026-10-27/`, `small-tts-2026-10-17/`, `mini-tts-cpu-2026-10-26/`, `sopro-cpu-2026-10-27/` and - `chatterbox-nano-de-cpu-2026-10-27/`. + `chatterbox-nano-de-cpu-2026-10-27/` and `kikiri-victoria-cpu-2026-10-27/`. The initial shortlist discussion added documentation only. Michael later authorized the isolated Audio8 experiment: its own weights and CPU venv were