Page MenuHomePhabricator
Paste P96446

TTS batch generation test on the statbox
ActivePublic

Authored by kevinbazira on Mon, Sep 14, 12:09 PM.
Referenced Files
F102909317: TTS batch generation test on the statbox
Mon, Sep 14, 12:09 PM
Subscribers
None
$ python3 -m venv venv && . venv/bin/activate && pip install requests
CANARY=/srv/published/wmf-ml-models/tts/experiment-v1/_canary
$ cat > canary.json <<'JSON'
[{"title": "Earth", "page_id": 9228, "rev_id": 1362915217},
{"title": "Killdeer", "page_id": 276101, "rev_id": 1361766784},
{"title": "Leg before wicket", "page_id": 286694, "rev_id": 1366875154}]
JSON
$ export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
$ python3 batch_generate.py \
--dataset canary.json --sections lead \
--base https://tts-section-generator.discovery.wmnet:31443 \
--artifact-dir "$CANARY" --manifest-dir "$CANARY" \
--log ~/tts/canary.jsonl --concurrency 2
Batch: 3 articles from canary.json (pinned revisions); 0 sections already settled in /home/kevinbazira/tts/canary.jsonl; concurrency 2; artifacts ['audio_mp3', 'captions_vtt']; scope lead; writing artifacts to /srv/published/wmf-ml-models/tts/experiment-v1/_canary
3 sections to generate
Done: 3 ok, 0 skip, 0 fail in 2.4 min
Articles: 3 manifests written, 0 incomplete (dead letter: fail records in /home/kevinbazira/tts/canary.jsonl), 0 with no generatable sections
$ find "$CANARY" -type f | sort && ls -la "$CANARY/enwiki/9228/1362915217/"
/srv/published/wmf-ml-models/tts/experiment-v1/_canary/enwiki/276101/1361766784/lead.mp3
/srv/published/wmf-ml-models/tts/experiment-v1/_canary/enwiki/276101/1361766784/lead.vtt
/srv/published/wmf-ml-models/tts/experiment-v1/_canary/enwiki/276101/1361766784/manifest.json
/srv/published/wmf-ml-models/tts/experiment-v1/_canary/enwiki/286694/1366875154/lead.mp3
/srv/published/wmf-ml-models/tts/experiment-v1/_canary/enwiki/286694/1366875154/lead.vtt
/srv/published/wmf-ml-models/tts/experiment-v1/_canary/enwiki/286694/1366875154/manifest.json
/srv/published/wmf-ml-models/tts/experiment-v1/_canary/enwiki/9228/1362915217/lead.mp3
/srv/published/wmf-ml-models/tts/experiment-v1/_canary/enwiki/9228/1362915217/lead.vtt
/srv/published/wmf-ml-models/tts/experiment-v1/_canary/enwiki/9228/1362915217/manifest.json
total 1516
drwxr-xr-x 2 kevinbazira wikidev 4096 Sep 14 11:20 .
drwxrwxr-x 3 kevinbazira wikidev 4096 Sep 14 11:18 ..
-rw-r--r-- 1 kevinbazira wikidev 1513584 Sep 14 11:18 lead.mp3
-rw-r--r-- 1 kevinbazira wikidev 24193 Sep 14 11:18 lead.vtt
-rw-r--r-- 1 kevinbazira wikidev 626 Sep 14 11:20 manifest.json
$ python3 -m json.tool "$CANARY/enwiki/9228/1362915217/manifest.json"
{
"schema_version": 2,
"scope": "lead",
"wiki_id": "enwiki",
"page_id": 9228,
"rev_id": 1362915217,
"generation_version": "kokoro-v1.0+af_heart+norm-2026.07.23-nemo-98d86449",
"generated_at": "2026-09-14T11:20:08+00:00",
"sections": [
{
"section_id": "lead",
"title": "Lead",
"level": 1,
"duration_ms": 252201.7,
"content_sha256": "457971c72fa3de06f9d9a44f4e1db345e59f5c6e5a92df0459376560f94f15fe",
"audio": {
"key": "enwiki/9228/1362915217/lead.mp3",
"media_type": "audio/mpeg"
},
"captions": {
"key": "enwiki/9228/1362915217/lead.vtt",
"media_type": "text/vtt"
}
}
]
}