urdu-s2s-mvp / scripts /remote_tts_smoke.py
sufinity's picture
Deploy Urdu S2S MVP
c759578 verified
Raw
History Blame Contribute Delete
1.44 kB
"""Remote smoke test for Chatterbox Praxy TTS.
This intentionally avoids ASR and LLM calls so we can prove GPU/TTS viability
on short-lived rented instances before running the full S2S path.
"""
from __future__ import annotations
import json
from dataclasses import asdict
from pathlib import Path
from urdu_s2s.schemas import BridgeResult, ReplyResult, SpeechToSpeechRequest
from urdu_s2s.tts_providers import ChatterboxPraxyTTSProvider
def main() -> None:
request = SpeechToSpeechRequest(
request_id="tts_smoke_001",
audio_path=Path("data/raw/benchmarks/gemini_urdu_s2s_v1/audio/bench_001.wav"),
metadata={"purpose": "remote_tts_smoke"},
)
reply = ReplyResult(
text_urdu="Theek hai, main check kar deti hoon.",
provider="smoke",
model="manual",
)
bridge = BridgeResult(
text_devanagari="ठीक है, मैं चेक कर देती हूँ।",
provider="manual",
model="manual",
)
provider = ChatterboxPraxyTTSProvider(
output_audio_path=Path("reports/evals/tts_smoke_001.wav"),
voice_prompt_audio_path=Path(
"data/processed/voice_anchors/chatterbox_praxy_v1/bench_025.wav"
),
device="cuda",
)
result = provider.synthesize(request, reply, bridge)
print(json.dumps(asdict(result), ensure_ascii=False, default=str, indent=2))
if __name__ == "__main__":
main()