device_map="cuda:0" at import killed the container with no logs: on ZeroGPU
CUDA must not be initialised in the main process, and from_pretrained also
places the Higgs audio tokenizer on model.device.
- load on CPU, move to CUDA once inside @spaces.GPU
- take the sample rate from model.sampling_rate instead of hardcoding 24000
- add an optional reference transcript; create_voice_clone_prompt(ref_text=None)
needs load_asr_model() first, which was never called
Fix TTS: use real omnivoice API and ZeroGPU-correct model loading
app.py called a generate() signature that does not exist (ref_audio/ref_text/
language="am"). The real API needs OmniVoiceGenerationConfig, language=
"Amharic", and create_voice_clone_prompt() for the reference voice.
Also:
- load the model with device_map/dtype instead of .to(device); on this
ZeroGPU Space torch.cuda was unavailable at import, so the model stayed on
CPU while @spaces.GPU ran the forward pass on GPU
- named /tts endpoint, so the client has a stable API to call
- return (audio, status) and surface generation errors instead of a bare 500
- drop the non-existent default ref_amharic.wav; no reference = default voice
- enable the queue, cap input length, normalise the output array shape
- pin transformers>=5.3.0 (omnivoice requirement)