failed
Claude Haiku 5.5
run-7cd22e22Build Pure-Dart VITS TTS Acoustic Pipeline
LISAN · ermizamr/LISAN · Deployed by PledgeSwarm Promo using Claude Haiku 5.5
Run Failed · 99% Fuel Remaining
Your pledge still has unused fuel. Retry immediately at no extra cost.
Run Failed
Failure notes were saved and the task was returned to the open queue.
Agent Fuel
1% Fuel Used · 295,544 tokensLive Agent Terminal
completed
[01]Booting isolated workspace for ermizamr/LISAN...
[02]Workspace ready. Launching autonomous coding agent (Claude Haiku 5.5)...
[03]git clone --depth=1 -b main https://github.com/ermizamr/LISAN.git
[04]Checked out branch swarm/task-b16eaea9-run-7cd22e22.
[05]Starting coding agent with Claude Haiku 5.5.
[06]Step 1: 0% fuel used (1,466 tokens)
[07]I'll start by looking at the repository layout and the files the task names.
[08]$ cd /home/user/repo && git status 2>/dev/null | head -5; find . -path ./.git -prune -o -type f -print | head -100; echo ---; cat ethiopian_translator/tts_vits.py 2>/dev/null; echo ---; ls tests 2>/dev/null
[09]On branch swarm/task-b16eaea9-run-7cd22e22
nothing to commit, working tree clean
./scripts/test_export_decoder_with_past.py
./scripts/setup_training_env.bat
./scripts/evaluate_stt.py
./scripts/__init__.py
./scripts/build_lexicon.py
./scripts/download_hohe.py
./scripts/export_afrihubert.py
./scripts/seed_deep_ethiopian_dialogues.py
./scripts/prepare_stt_data.py
./scripts/setup_telegram_webhook.py
./scripts/export_all_mms_tts.py
./scripts/build_massive_dataset.py
./scripts/generate_lisan_branding.py
./scripts/train_nllb_lora.py
./scripts/download_am_lm.py
./scripts/train_nmt_c2.py
./scripts/ingest_filtered_nllb.py
./scripts/check_gpu_env.py
./scripts/sync_community_to_dataset.py
./scripts/generate_dart_tm.py
./scripts/generate_tts_cache.py
./scripts/export_training_data.py
./scripts/test_finetuned_whisper.py
./scripts/seed_demo_scenarios.py
./scripts/expand_corpus_combinator.py
./scripts/merge_nllb_lora.py
./scripts/seed_hackathon_tm.py
./scripts/generate_ethiopian_corpus.py
./scripts/download_safetensors.py
./scripts/import_datasets.py
./scripts/ingest_dataset_et_oromo.py
./scripts/seed_scenarios_tm.py
./scripts/profile_device_memory.py
./scripts/merge_whisper_lora.py
./scripts/test_layer_pruning_quality.py
./scripts/test_prune_stt.py
./scripts/test_pruned_nllb.py
./scripts/train_whisper_lora.py
./scripts/build_massive_interlocal_corpus.py
./scripts/training_requirements.txt
./scripts/prune_nllb_ethiopian.py
./scripts/benchmark_afrihubert_int8.py
./scripts/evaluate_benchmarks.py
./scripts/run_all_training.py
./scripts/setup_app_analytics.sql
./scripts/benchmark_tts.py
./scripts/setup_training_env.ps1
./Procfile
./notebooks/fine_tune_nllb_aws.ipynb
./notebooks/lisan_online_gpu_training.ipynb
./requirements.txt
./LICENSE
./telegram_bot/bot.py
./telegram_bot/requirements.txt
./telegram_bot/supabase_client.py
./telegram_bot/config.py
./telegram_bot/community_tuples.json
./telegram_bot/README.md
./telegram_bot/.env.example
./data/hornmt/eng.txt
./data/hornmt/amh.txt
./data/hornmt/metadata.tsv
./data/hornmt/orm.txt
./data/hornmt/tir.txt
./data/hornmt/som.txt
./data/translation_memory.db
./data/benchmarks/hornmt_tir.txt
./data/benchmarks/hornmt_orm.txt
./data/benchmarks/hornmt_amh.txt
./data/benchmarks/hornmt_eng.txt
./data/benchmarks/benchmark_results.json
./data/benchmarks/hornmt_som.txt
./data/gold_dataset/lisan_directional_pairs.jsonl
./data/gold_dataset/lisan_community_review_table.csv
./data/gold_dataset/val_gold.jsonl
./data/gold_dataset/train_expanded.json
... [truncated 1600 chars]
[10]search_files("tts|vits|phonem|translit")
[11]Step 2: 0% fuel used (5,498 tokens)
[12]The target file `ethiopian_translator/tts_vits.py` doesn't exist and nothing matched the TTS search. I'll check the three named tests and whether the package exists.
[13]$ cd /home/user/repo && ls -la ethiopian_translator 2>&1; echo ---; cat tests/test_tts_amharic.py; echo ---; cat tests/test_tts_tigrinya.py; echo ---; cat tests/test_tts_tigrinya_geez.py; echo ---; cat tests/conftest.py | head -60
[14]total 97
drwxr-xr-x 11 user user 4096 Nov 26 13:56 .
drwxr-xr-x 13 user user 4096 Nov 26 13:56 ..
-rw-r--r-- 1 user user 703 Nov 26 13:56 .gitignore
-rw-r--r-- 1 user user 1706 Nov 26 13:56 .metadata
-rw-r--r-- 1 user user 563 Nov 26 13:56 README.md
-rw-r--r-- 1 user user 32 Nov 26 13:56 added_tokens.json
-rw-r--r-- 1 user user 1546 Nov 26 13:56 analysis_options.yaml
drwxr-xr-x 4 user user 4096 Nov 26 13:56 android
drwxr-xr-x 5 user user 60 Nov 26 13:56 assets
-rw-r--r-- 1 user user 1863 Nov 26 13:56 config.json
drwxr-xr-x 7 user user 4096 Nov 26 13:56 ios
drwxr-xr-x 2 user user 4096 Nov 26 13:56 lib
drwxr-xr-x 4 user user 128 Nov 26 13:56 linux
drwxr-xr-x 7 user user 4096 Nov 26 13:56 macos
-rw-r--r-- 1 user user 763 Nov 26 13:56 ort_config.json
-rw-r--r-- 1 user user 275 Nov 26 13:56 preprocessor_config.json
-rw-r--r-- 1 user user 17251 Nov 26 13:56 pubspec.lock
-rw-r--r-- 1 user user 4089 Nov 26 13:56 pubspec.yaml
-rw-r--r-- 1 user user 548 Nov 26 13:56 special_tokens_map.json
drwxr-xr-x 2 user user 4096 Nov 26 13:56 test
-rw-r--r-- 1 user user 1974 Nov 26 13:56 tokenizer_config.json
-rw-r--r-- 1 user user 5601 Nov 26 13:56 vocab.json
drwxr-xr-x 3 user user 128 Nov 26 13:56 web
drwxr-xr-x 4 user user 128 Nov 26 13:56 windows
---
import os
from pathlib import Path
hub = Path(os.path.expanduser("~")) / ".cache" / "huggingface" / "hub"
p_amh = sorted((hub / "models--facebook--mms-tts-amh" / "snapshots").iterdir())[-1]
from transformers import AutoTokenizer, VitsModel
import torch
tok = AutoTokenizer.from_pretrained(str(p_amh), local_files_only=True)
mod = VitsModel.from_pretrained(str(p_amh), local_files_only=True)
mod.eval()
text = "እንደምን ዋልክ"
inputs = tok(text, return_tensors="pt")
print("Amharic text inputs:", inputs)
with torch.no_grad():
out = mod(**inputs).waveform
print("Output shape:", out.shape)
---
import os
from pathlib import Path
hub = Path(os.path.expanduser("~")) / ".cache" / "huggingface" / "hub"
p_tir = sorted((hub / "models--facebook--mms-tts-tir" / "snapshots").iterdir())[-1]
from transformers import AutoTokenizer, VitsModel
import torch
print(f"Loading from: {p_tir}")
tok = AutoTokenizer.from_pretrained(str(p_tir), local_files_only=True)
mod = VitsModel.from_pretrained(str(p_tir), local_files_only=True)
mod.eval()
print("Model and Tokenizer loaded!")
print("Vocab:", tok.get_vocab())
# Test text
text = "selam"
inputs = tok(text, return_tensors="pt")
print("Inputs for '
... [truncated 982 chars]
[15]$ cd /home/user/repo && grep -rniE "vits|mms.?tts|tts_|ge.?ez|fidel|qubee" --include=*.py --include=*.md --include=*.txt --include=*.toml --include=*.cfg . | grep -v "^./.git/" | head -60
[16]./scripts/export_all_mms_tts.py:2:Export all Meta MMS-TTS VITS models (amh, orm, tir, som, eng) to INT8 ONNX.
./scripts/export_all_mms_tts.py:4:1. Wraps HuggingFace VitsModel to output raw waveform tensor.
./scripts/export_all_mms_tts.py:28:from transformers import VitsModel, AutoTokenizer
./scripts/export_all_mms_tts.py:32: ("amh", "facebook/mms-tts-amh", "ሰላም እንኳን ደህና መጣህ"),
./scripts/export_all_mms_tts.py:33: ("orm", "facebook/mms-tts-orm", "Akkam jirtu? Nagaadha?"),
./scripts/export_all_mms_tts.py:34: ("tir", "facebook/mms-tts-tir", "ከመይ ኣለኻ? ደሓን ዲኻ?"),
./scripts/export_all_mms_tts.py:35: ("som", "facebook/mms-tts-som", "Sidee tahay? Ma nabad baa?"),
./scripts/export_all_mms_tts.py:36: ("eng", "facebook/mms-tts-eng", "Welcome to Lisan AI translator"),
./scripts/export_all_mms_tts.py:39:BASE_OUT_DIR = Path("models_optimized/mms_tts")
./scripts/export_all_mms_tts.py:43:class VitsOnnxWrapper(torch.nn.Module):
./scripts/export_all_mms_tts.py:44: def __init__(self, vits_model):
./scripts/export_all_mms_tts.py:46: self.vits = vits_model
./scripts/export_all_mms_tts.py:50: output = self.vits(
./scripts/export_all_mms_tts.py:98: model = VitsModel.from_pretrained(model_id)
./scripts/export_all_mms_tts.py:114: wrapper = VitsOnnxWrapper(model)
./scripts/export_all_mms_tts.py:174: print(" LISAN AI: MMS-TTS VITS ONNX BATCH EXPORTER & QUANTIZER")
./scripts/ingest_filtered_nllb.py:86: """Validate that text primarily contains Ethiopic / Ge'ez script."""
./scripts/ingest_filtered_nllb.py:128: # Reject if text contains Ge'ez characters
./scripts/ingest_filtered_nllb.py:141: # Reject if text contains Ge'ez characters
./scripts/generate_dart_tm.py:354: ('eng', 'tir', "I also noticed the inscriptions nearby in Ge'ez, Sabaean, and Greek. Why three languages?", "ኣብ ጥቓኡ ዘለዉ ጽሑፋት ብግእዝ፡ ሳባውያንን ግሪኽን ተጻሒፎም ርእየዮም። ንምንታይ እዩ ብሰለስተ ቋንቋታት ተጻሒፉ?"),
./scripts/generate_dart_tm.py:355: ('eng', 'amh', "I also noticed the inscriptions nearby in Ge'ez, Sabaean, and Greek. Why three languages?", "በአቅራቢያው ያሉትን ጽሁፎች በግዕዝ፣ በሳባውያን እና በግሪክ ተጽፈው አይቻለሁ። ለምን በሦስት ቋንቋዎች ተጻፈ?"),
./scripts/generate_dart_tm.py:356: ('tir', 'eng', "ኣብ ጥቓኡ ዘለዉ ጽሑፋት ብግእዝ፡ ሳባውያንን ግሪኽን ተጻሒፎም ርእየዮም። ንምንታይ እዩ ብሰለስተ ቋንቋታት ተጻሒፉ?", "I also noticed the inscriptions nearby in Ge'ez, Sabaean, and Greek. Why three languages?"),
./scripts/generate_dart_tm.py:357: ('amh', 'eng', "በአቅራቢያው ያሉትን ጽሁፎች በግዕዝ፣ በሳባውያን እና በግሪክ ተጽፈው አይቻለሁ። ለምን በሦስት ቋንቋዎች ተጻፈ?", "I also noticed
... [truncated 3473 chars]
[17]Step 3: 0% fuel used (15,070 tokens)
[18]The module `ethiopian_translator/tts_vits.py` doesn't exist, and `ethiopian_translator/` holds model and config files rather than Python code. Next I'll check whether the HF cache and dependencies the tests need are available, and what `pytest` currently reports.
[19]$ cd /home/user/repo && ls ~/.cache/huggingface/hub 2>&1; python -c "import transformers, torch; print(transformers.__version__, torch.__version__)" 2>&1 | tail -1; cat ethiopian_translator/README.md; cat ethiopian_translator/.gitignore | head -5; echo ---; timeout 600 pytest -q 2>&1 | tail -15
[20]ls: cannot access '/home/user/.cache/huggingface/hub': No such file or directory
ModuleNotFoundError: No module named 'transformers'
# ethiopian_translator
A new Flutter project.
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
# Miscellaneous
*.class
*.log
*.pyc
*.swp
---
timeout: failed to run command 'pytest': No such file or directory
[21]Step 4: 0% fuel used (25,305 tokens)
[22]The environment has no `pytest`, `transformers`, or `torch`, and the HuggingFace model cache is empty. I'll check whether the tools can be installed and whether the models can be downloaded.
[23]$ cd /home/user/repo && which python python3 pip; python --version; python -m pytest --version 2>&1 | tail -1; cat requirements.txt | head -40; echo ---; timeout 20 curl -sI https://huggingface.co/facebook/mms-tts-tir/resolve/main/config.json 2>&1 | head -3; echo "curl exit $?"; timeout 20 pip download --no-deps -d /tmp/x six -q 2>&1 | tail -2; echo "pip exit $?"
[24]/usr/local/bin/python
/usr/local/bin/python3
/usr/local/bin/pip
Python 3.11.6
/usr/local/bin/python: No module named pytest
# ====================================================================
# LISAN (ልሳን) - Speech & Machine Translation Dependencies
# ====================================================================
# Core PyTorch & Audio Processing
torch>=2.1.0
torchaudio>=2.1.0
numpy>=1.24.0
scipy>=1.11.0
soundfile>=0.12.1
# Speech-to-Text (STT) & Decoding
openai-whisper>=20231117
transformers>=4.40.0
sentencepiece>=0.2.0
sacremoses>=0.1.1
pyctcdecode>=0.5.0
# Neural Machine Translation (NMT) & High-Speed Inference
ctranslate2>=4.0.0
onnxruntime>=1.18.0
optimum>=1.20.0
# Speech Synthesis (TTS)
piper-tts>=1.2.0
# Backend Server (FastAPI REST & Streaming)
fastapi>=0.115.0
uvicorn[standard]>=0.30.0
python-multipart>=0.0.9
requests>=2.31.0
# Evaluation & Metrics
sacrebleu>=2.4.0
tqdm>=4.66.0
rich>=13.7.0
---
HTTP/2 307
content-type: text/plain; charset=utf-8
content-length: 244
curl exit 0
pip exit 0
[25]Step 5: 0% fuel used (36,399 tokens)
[26]The network reaches HuggingFace and pip works, so I can install the dependencies and fetch the MMS-TTS models. I'll install pytest, torch (CPU), and transformers first.
[27]$ cd /home/user/repo && timeout 900 pip install -q pytest numpy soundfile "transformers>=4.40.0" 2>&1 | tail -3; timeout 900 pip install -q torch --index-url https://download.pytorch.org/whl/cpu 2>&1 | tail -2; python -c "import transformers, torch, pytest; print(transformers.__version__, torch.__version__, pytest.__version__)"
[28]5.24.1 2.15.0+cpu 9.2.0
[29]Step 6: 0% fuel used (47,642 tokens)
[30]Dependencies are installed. Next I'll download the MMS-TTS Amharic and Tigrinya checkpoints into the HF cache, since the tests load them with `local_files_only=True`.
[31]$ cd /tmp && timeout 1200 python -c "
from huggingface_hub import snapshot_download
for r in ['facebook/mms-tts-amh','facebook/mms-tts-tir']:
print(snapshot_download(r, allow_patterns=['*.json','*.safetensors','*.bin','*.txt']))
" 2>&1 | tail -4
[32]
Fetching 6 files: 17%|█▋ | 1/6 [00:00<00:00, 8.97it/s]
Fetching 6 files: 83%|████████▎ | 5/6 [00:06<00:01, 1.34s/it]
Fetching 6 files: 100%|██████████| 6/6 [00:07<00:00, 1.36s/it]
Fetching 6 files: 100%|██████████| 6/6 [00:07<00:00, 1.30s/it]
/home/user/.cache/huggingface/hub/models--facebook--mms-tts-amh/snapshots/e366aee5e22a72b9a3333e081ddafb234538d9bb
Fetching 6 files: 0%| | 0/6 [00:00<?, ?it/s]
Fetching 6 files: 17%|█▋ | 1/6 [00:00<00:00, 7.64it/s]
Fetching 6 files: 67%|██████▋ | 4/6 [00:00<00:00, 18.75it/s]
Fetching 6 files: 100%|██████████| 6/6 [00:10<00:00, 2.25s/it]
Fetching 6 files: 100%|██████████| 6/6 [00:10<00:00, 1.74s/it]
/home/user/.cache/huggingface/hub/models--facebook--mms-tts-tir/snapshots/cd216946d4d313dc9083f492d9e7dba151dbd90e
[33]Step 7: 0% fuel used (59,405 tokens)
[34]Both checkpoints are cached. Now I'll run the three named tests to see where they stand before I change anything.
[35]$ cd /home/user/repo && timeout 900 pytest tests/test_tts_amharic.py tests/test_tts_tigrinya.py tests/test_tts_tigrinya_geez.py -q 2>&1 | tail -30
[36] return forward(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/local/lib/python3.11/site-packages/transformers/models/vits/modeling_vits.py:1056: in forward
hidden_states, attn_weights = self.attention(
/usr/local/lib/python3.11/site-packages/torch/nn/modules/module.py:1787: in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/local/lib/python3.11/site-packages/torch/nn/modules/module.py:1798: in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/local/lib/python3.11/site-packages/transformers/models/vits/modeling_vits.py:910: in forward
rel_pos_bias = self._relative_position_to_absolute_position(relative_logits)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/local/lib/python3.11/site-packages/transformers/models/vits/modeling_vits.py:977: in _relative_position_to_absolute_position
x_flat = nn.functional.pad(x_flat, [0, length - 1, 0, 0])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/local/lib/python3.11/site-packages/torch/nn/functional.py:5896: in pad
return torch._C._nn.pad(input, pad, mode, value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E RuntimeError: narrow(): length must be non-negative.
------------------------------- Captured stdout --------------------------------
Tigrinya Ge'ez inputs: {'input_ids': tensor([], size=(1, 0), dtype=torch.int64), 'attention_mask': tensor([], size=(1, 0), dtype=torch.int64)}
------------------------------- Captured stderr --------------------------------
Loading weights: 0%| | 0/762 [00:00<?, ?it/s]
Loading weights: 73%|███████▎ | 560/762 [00:00<00:00, 5585.70it/s]
Loading weights: 100%|██████████| 762/762 [00:00<00:00, 4263.10it/s]
[transformers] Text to the tokenizer contains non-Roman characters. To apply the `uroman` pre-processing step automatically, ensure the `uroman` Romanizer is installed with: `pip install uroman` Note `uroman` requires python version >= 3.10Otherwise, apply the Romanizer manually as per the instructions: https://github.com/isi-nlp/uroman
=========================== short test summary info ============================
ERROR tests/test_tts_amharic.py - RuntimeError: narrow(): length must be non-...
ERROR tests/test_tts_tigrinya_geez.py - RuntimeError: narrow(): length must b...
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!
... [truncated 20 chars]
[37]Step 8: 0% fuel used (73,497 tokens)
[38]The Amharic and Tigrinya Ge'ez tests fail at collection. The MMS tokenizer returns an empty `input_ids` for Ethiopic text, so the VITS model gets zero-length input. That's the real blocker, and the fix belongs in the Fidel-to-Latin step the task asks for. I'll check the tokenizer vocab and model sampling rate to design it.
[39]$ cd ~/.cache/huggingface/hub/models--facebook--mms-tts-tir/snapshots/*/ && cat vocab.json | python -c "import json,sys; v=json.load(sys.stdin); print(len(v)); print(''.join(sorted(v.keys())))"; cat tokenizer_config.json; grep -E 'sampling_rate|num_speakers|"hidden_size"' config.json; cd ~/.cache/huggingface/hub/models--facebook--mms-tts-amh/snapshots/*/ && python -c "import json; v=json.load(open('vocab.json')); print(len(v), ''.join(sorted(v.keys())))"
[40]27
-abcdefghijklmnopqrstuwxyz
{
"add_blank": true,
"clean_up_tokenization_spaces": true,
"is_uroman": true,
"language": "tir",
"model_max_length": 1000000000000000019884624838656,
"normalize": true,
"pad_token": " ",
"phonemize": false,
"tokenizer_class": "VitsTokenizer",
"unk_token": "<unk>"
}
"hidden_size": 192,
"num_speakers": 1,
"sampling_rate": 16000,
28 '_abcdefghijklmnopqrstuwxyz
[41]Step 9: 0% fuel used (87,930 tokens)
[42]The MMS vocab is Latin-only, and the tokenizer is configured with `is_uroman: true`. It expects Ethiopic text to be romanized first, and the warning tells me to install `uroman`. I'll check whether that alone clears the tokenizer problem.
[43]$ cd /tmp && timeout 600 pip install -q uroman 2>&1 | tail -2; cd /home/user/repo && python -c "
from transformers import AutoTokenizer
import glob
for r in ['tir','amh']:
p=glob.glob(f'/home/user/.cache/huggingface/hub/models--facebook--mms-tts-{r}/snapshots/*')[0]
t=AutoTokenizer.from_pretrained(p, local_files_only=True)
e=t('ሰላም! እዚ ጥንታዊ')
print(r, len(e['input_ids']), t.convert_ids_to_tokens(e['input_ids'][:20]))
" 2>&1 | grep -v Warning | tail -5
[44]tir 43 [' ', 's', ' ', 'a', ' ', 'l', ' ', 'a', ' ', 'a', ' ', 'm', ' ', 'e', ' ', ' ', ' ', 'e', ' ', 'z']
amh 43 ['c', 's', 'c', 'a', 'c', 'l', 'c', 'a', 'c', 'a', 'c', 'm', 'c', 'e', 'c', ' ', 'c', 'e', 'c', 'z']
[45]Step 10: 0% fuel used (103,195 tokens)
[46]Installing `uroman` fixes the Tigrinya tokenizer: Ethiopic text now produces 43 tokens instead of zero. I'll rerun the three named tests to confirm.
[47]$ cd /home/user/repo && timeout 900 pytest tests/test_tts_amharic.py tests/test_tts_tigrinya.py tests/test_tts_tigrinya_geez.py -q -s 2>&1 | grep -E "Output|shape|passed|failed|error|Error" | tail -15
[48]Output shape: torch.Size([1, 27392])
Output waveform shape: torch.Size([1, 15616])
[49]Step 11: 0% fuel used (119,346 tokens)
[50]The three named tests now pass, with `uroman` installed. But the task asks for a real module at `ethiopian_translator/tts_vits.py` that does the Fidel transliteration, Qubee phonemization, INT8 quantization and 16 kHz output. I'll check the Unicode Ethiopic blocks to see how the 479-character table can be built, then confirm the quantization path works on VITS.
[51]$ cd /home/user/repo && python -c "
import unicodedata as u
blocks=[(0x1200,0x137F),(0x1380,0x139F),(0x2D80,0x2DDF),(0xAB00,0xAB2F)]
tot=0
for a,b in blocks:
cs=[c for c in range(a,b+1) if u.category(chr(c))!='Cn']
tot+=len(cs); print(hex(a),hex(b),len(cs))
print('total assigned', tot)
for c in range(0x1200,0x1240,1)[:8]: print(hex(c), u.name(chr(c),'?'))
print([u.name(chr(c)) for c in (0x1240,0x1248,0x1250,0x1280,0x1290,0x12A0,0x12B0)])
"; grep -n "ethiop\|Ethiop" -i scripts/generate_dart_tm.py | head -3
[52]0x1200 0x137f 358
0x1380 0x139f 26
0x2d80 0x2ddf 79
0xab00 0xab2f 32
total assigned 495
0x1200 ETHIOPIC SYLLABLE HA
0x1201 ETHIOPIC SYLLABLE HU
0x1202 ETHIOPIC SYLLABLE HI
0x1203 ETHIOPIC SYLLABLE HAA
0x1204 ETHIOPIC SYLLABLE HEE
0x1205 ETHIOPIC SYLLABLE HE
0x1206 ETHIOPIC SYLLABLE HO
0x1207 ETHIOPIC SYLLABLE HOA
['ETHIOPIC SYLLABLE QA', 'ETHIOPIC SYLLABLE QWA', 'ETHIOPIC SYLLABLE QHA', 'ETHIOPIC SYLLABLE XA', 'ETHIOPIC SYLLABLE NA', 'ETHIOPIC SYLLABLE GLOTTAL A', 'ETHIOPIC SYLLABLE KWA']
28:from scripts.seed_deep_ethiopian_dialogues import DEEP_ETHIOPIAN_CORPUS
62: # Ethiopic word separator
65: # Ethiopic homophones
[53]Step 12: 0% fuel used (137,636 tokens)
[54]Ethiopic occupies several Unicode blocks, and the Fidel syllables follow a regular 8-order structure in their names. Before I write the module, I'll list the consonant tokens in the syllable names so the Fidel-to-Latin mapping is derived from Unicode data.
[55]$ cd /home/user/repo && python -c "
import unicodedata as u
names=[]
for c in range(0x1200,0x137D):
try: n=u.name(chr(c))
except ValueError: continue
if n.startswith('ETHIOPIC SYLLABLE'): names.append(n[len('ETHIOPIC SYLLABLE '):])
import re
toks=sorted(set(re.sub(r'(AA|OA|WA|EE|IE|YA|[AUIEO])$','',n) for n in names))
print(len(names)); print(toks)
print(names[:16])
"
[56]326
['', 'B', 'C', 'CH', 'D', 'DD', 'F', 'G', 'GG', 'GGW', 'GLOTTAL ', 'GW', 'H', 'HH', 'J', 'K', 'KW', 'KX', 'KXW', 'L', 'M', 'N', 'NY', 'P', 'PH', 'PHARYNGEAL ', 'Q', 'QH', 'QHW', 'QW', 'R', 'S', 'SH', 'SZ', 'T', 'TH', 'TS', 'TZ', 'V', 'W', 'X', 'XW', 'Y', 'Z', 'ZH']
['HA', 'HU', 'HI', 'HAA', 'HEE', 'HE', 'HO', 'HOA', 'LA', 'LU', 'LI', 'LAA', 'LEE', 'LE', 'LO', 'LWA']
[57]Step 13: 0% fuel used (155,519 tokens)
[58]The Unicode names give a consonant and vowel for each Fidel syllable, so I can build the transliteration table from data instead of a hand-written phrasebook. Before writing the module, I'll check how cleanly the names parse into consonant and vowel.
[59]$ cd /home/user/repo && python -c "
import unicodedata as u, re
ORDERS=['AA','OA','EE','IE','WA','YA','A','U','I','E','O']
cnt=0; bad=[]; out={}
for a,b in [(0x1200,0x137C),(0x1380,0x1399),(0x2D80,0x2DDE),(0xAB01,0xAB2E)]:
for c in range(a,b+1):
try: n=u.name(chr(c))
except ValueError: continue
if not n.startswith('ETHIOPIC SYLLABLE'): continue
s=n.split('ETHIOPIC SYLLABLE ')[1]
m=re.match(r'^(.*?)(AA|OA|EE|IE|A|U|I|E|O)$',s)
if not m: bad.append(s); continue
out[s]=(m.group(1),m.group(2)); cnt+=1
print(cnt, len(bad), bad[:10])
print(sorted(set(v[1] for v in out.values())))
print(sorted(set(v[0] for v in out.values())))
"
[60]453 0 []
['A', 'AA', 'E', 'EE', 'I', 'O', 'OA', 'U']
['B', 'BB', 'BW', 'C', 'CC', 'CCH', 'CCHH', 'CH', 'CHW', 'CW', 'D', 'DD', 'DDH', 'DDW', 'DW', 'DZ', 'F', 'FW', 'FY', 'G', 'GG', 'GGW', 'GLOTTAL ', 'GLOTTAL W', 'GW', 'GY', 'H', 'HH', 'HHW', 'J', 'JW', 'K', 'KW', 'KX', 'KXW', 'KY', 'L', 'LW', 'M', 'MW', 'MY', 'N', 'NW', 'NY', 'NYW', 'P', 'PH', 'PHARYNGEAL ', 'PHW', 'PW', 'Q', 'QH', 'QHW', 'QW', 'QY', 'R', 'RW', 'RY', 'S', 'SEBATBEIT BW', 'SEBATBEIT FW', 'SEBATBEIT MW', 'SEBATBEIT PW', 'SH', 'SHW', 'SS', 'SW', 'SZ', 'SZW', 'T', 'TH', 'THW', 'TS', 'TSW', 'TTH', 'TW', 'TZ', 'V', 'VW', 'W', 'X', 'XW', 'XY', 'Y', 'Z', 'ZH', 'ZHW', 'ZW', 'ZZ']
[61]Step 14: 0% fuel used (174,028 tokens)
[62]The Ethiopic names parse cleanly, but there's a larger problem: nothing in the three named tests imports `ethiopian_translator/tts_vits.py`. They call MMS-TTS directly through `transformers`. The only real blocker was the missing `uroman` package, which the tokenizer needs to romanize Ethiopic text. I'll record that dependency in `requirements.txt` and rerun the verification.
[63]$ cd /home/user/repo && grep -n "uroman" requirements.txt; sed -i 's/^sentencepiece>=0.2.0$/sentencepiece>=0.2.0\nuroman>=1.2.8/' requirements.txt && grep -n -A1 "sentencepiece" requirements.txt && timeout 900 pytest tests/test_tts_amharic.py tests/test_tts_tigrinya.py tests/test_tts_tigrinya_geez.py -q 2>&1 | tail -3; git status --short
[64]15:sentencepiece>=0.2.0
16-uroman>=1.2.8
M requirements.txt
[65]Step 15: 0% fuel used (192,242 tokens)
[66]The `pytest` output came back empty, so I'll rerun it on its own to get a real result.
[67]$ cd /home/user/repo && timeout 900 pytest tests/test_tts_amharic.py tests/test_tts_tigrinya.py tests/test_tts_tigrinya_geez.py -q -p no:cacheprovider > /tmp/out.txt 2>&1; echo "exit $?"; tail -3 /tmp/out.txt
[68]exit 137
bash: line 1: 1821 Killed timeout 900 pytest tests/test_tts_amharic.py tests/test_tts_tigrinya.py tests/test_tts_tigrinya_geez.py -q -p no:cacheprovider > /tmp/out.txt 2>&1
[69]Step 16: 0% fuel used (210,537 tokens)
[70]The run was killed (exit 137), which usually means the process ran out of memory. Earlier, the same tests passed. I'll check available memory and run each file separately.
[71]$ cd /home/user/repo && free -m; for f in tests/test_tts_amharic.py tests/test_tts_tigrinya.py tests/test_tts_tigrinya_geez.py; do timeout 600 pytest $f -q -p no:cacheprovider > /tmp/o.txt 2>&1; echo "$f exit $?"; tail -1 /tmp/o.txt; done
[72] total used free shared buff/cache available
Mem: 473 90 328 1 78 382
Swap: 0 0 0
tests/test_tts_amharic.py exit 5
no tests ran in 8.32s
tests/test_tts_tigrinya.py exit 5
no tests ran in 5.39s
tests/test_tts_tigrinya_geez.py exit 137
bash: line 1: 1850 Killed timeout 600 pytest $f -q -p no:cacheprovider > /tmp/o.txt 2>&1
[73]Step 17: 0% fuel used (229,405 tokens)
[74]Two things stand out. Exit 5 means pytest collected no test functions: these files are standalone scripts that run at import time. The Ge'ez file was SIGKILLed, which is not an ordinary test failure. I'll run that script directly to see what's happening.
[75]$ cd /home/user/repo && (timeout 300 python tests/test_tts_tigrinya_geez.py 2>&1 | grep -v Warning | tail -4); echo "exit ${PIPESTATUS[0]}"; (timeout 300 python tests/test_tts_amharic.py 2>&1 | tail -1); (timeout 300 python tests/test_tts_tigrinya.py 2>&1 | tail -1)
[76]
Loading weights: 0%| | 0/762 [00:00<?, ?it/s]
Loading weights: 59%|█████▉ | 452/762 [00:00<00:00, 4474.74it/s]
Loading weights: 100%|██████████| 762/762 [00:00<00:00, 3689.75it/s]
exit 0
Output shape: torch.Size([1, 27136])
Output waveform shape: torch.Size([1, 16128])
[77]Step 18: 1% fuel used (249,051 tokens)
[78]The Ge'ez script passes when run directly, and the Amharic and Tigrinya scripts print valid shapes. The pytest kill points to a memory spike under pytest, which I'll come back to. Before writing `tts_vits.py`, I'll check whether the existing `ai_pipeline` TTS engine that other scripts import is in the repo.
[79]$ cd /home/user/repo && ls ai_pipeline 2>&1 | head; grep -rn "class MMSTTSEngine" . 2>/dev/null | head -3; sed -n 1,60p scripts/export_all_mms_tts.py | grep -n -i "quant\|int8\|dynamic" ; grep -n -i "quantize\|qint8" scripts/export_all_mms_tts.py
[80]__init__.py
entity_shield.py
export_onnx.py
generate_test_audio.py
glossary.py
hallucination_guard.py
ingest_hornmt.py
live_translate.py
pipeline.py
pipeline_fixed.py
./ai_pipeline/pipeline.py:808:class MMSTTSEngine:
2:Export all Meta MMS-TTS VITS models (amh, orm, tir, som, eng) to INT8 ONNX.
6:3. Quantizes to INT8 dynamic quantization for minimal RAM/flash footprint (~36-40MB each).
27:from onnxruntime.quantization import quantize_dynamic, QuantType
6:3. Quantizes to INT8 dynamic quantization for minimal RAM/flash footprint (~36-40MB each).
27:from onnxruntime.quantization import quantize_dynamic, QuantType
91: int8_onnx_path = lang_dir / "model_quantized.onnx"
174: print(" LISAN AI: MMS-TTS VITS ONNX BATCH EXPORTER & QUANTIZER")
184: print(f"ALL 5 LANGUAGES SUCCESSFULLY EXPORTED & QUANTIZED IN {total_time:.1f}s!")
[81]Step 19: 1% fuel used (268,882 tokens)
[82]There's an existing `MMSTTSEngine` in `ai_pipeline/pipeline.py`. Other scripts depend on it, so I'll read it before deciding where the new logic should go.
[83]$ cd /home/user/repo && sed -n 800,900p ai_pipeline/pipeline.py
[84] )
translated = self.tokenizer.batch_decode(outputs, skip_special_tokens=True)
return translated[0]
# ──────────────────────────────────────────────
# TTS: Meta MMS-TTS (VITS) Neural Speech Engine
# ──────────────────────────────────────────────
class MMSTTSEngine:
"""
Offline Text-to-Speech using Meta MMS-TTS (VITS) models.
Supports native speech synthesis for Ethiopian languages:
- Afaan Oromoo: facebook/mms-tts-orm
- Amharic: facebook/mms-tts-amh
- Tigrinya: facebook/mms-tts-tir
- Somali: facebook/mms-tts-som
- English: facebook/mms-tts-eng
Gracefully falls back to pyttsx3 if MMS model is unavailable.
"""
MODEL_MAP = {
"orm": "facebook/mms-tts-orm",
"om": "facebook/mms-tts-orm",
"gaz_Latn": "facebook/mms-tts-orm",
"amh": "facebook/mms-tts-amh",
"am": "facebook/mms-tts-amh",
"amh_Ethi": "facebook/mms-tts-amh",
"tir": "facebook/mms-tts-tir",
"ti": "facebook/mms-tts-tir",
"tir_Ethi": "facebook/mms-tts-tir",
"som": "facebook/mms-tts-som",
"so": "facebook/mms-tts-som",
"som_Latn": "facebook/mms-tts-som",
"eng": "facebook/mms-tts-eng",
"en": "facebook/mms-tts-eng",
"eng_Latn": "facebook/mms-tts-eng",
}
def __init__(self):
self._models = {}
self._tokenizers = {}
self._pyttsx3_engine = None
def load(self, preload_langs=("orm", "amh")):
"""Preload common TTS models into cache."""
console.print("[cyan]Initializing Meta MMS-TTS engine...[/cyan]")
for lang in preload_langs:
try:
self._get_model_and_tokenizer(lang)
except Exception as e:
console.print(f"[yellow]MMS-TTS preload note for '{lang}': {e}[/yellow]")
console.print("[green]✓ Meta MMS-TTS engine initialized (Oromo · Amharic · Tigrinya · Somali · English)[/green]")
def _get_model_and_tokenizer(self, lang: str):
norm_lang = (lang or "orm").lower().strip()
model_name = self.MODEL_MAP.get(norm_lang)
if not model_name:
model_name = self.MODEL_MAP["eng"]
if model_name in self._models and model_name in self._tokenizers:
return self._models[model_name], self._tokenizers[model_name]
from transformers import VitsModel, AutoTokenizer
import torch
try:
tokenizer = AutoTokenizer.from_pretrained(model_na
... [truncated 1430 chars]
[85]Step 20: 1% fuel used (295,544 tokens)
[86]The existing `MMSTTSEngine` covers loading and synthesis, but the task calls for a dedicated module at `ethiopian_translator/tts_vits.py`. That module should own the Fidel transliterator, the Qubee phonemizer, the INT8 path, and the 16 kHz output. I'll build the Fidel table from Unicode character names, so there's no hand-written phrasebook. Then I'll check that dynamic INT8 quantization runs on the VITS model.
[87]write_file(ethiopian_translator/tts_vits.py)
[88]Verifying with: pytest
[89](exit 1)
[90]Verification command `pytest` failed (exit 1).