uv venv -p3.10
brew install mecab
git clone https://github.com/shenberg/TTS
uv pip install -e TTS
uv pip install gdown
uvx gdown 1dExa0AZqmyjz8rSZz1noyQY9aF7dR8ew
uvx gdown 1eK1XR_ZwuUy4yWh80nui-q5PBifJsYfy
uvx gdown 1XdmRRHjZ_eZOFKoAQgQ8wivrLDJnNDkh
uvx gdown 1An6cTCYkxXWhagIJe3NGkoP8n2CQWQ-3
mkdir tts_model
mkdir hifigan_model
mv saspeech_nikud_7350.pth tts_model/
mv config_overflow.json tts_model/
mv checkpoint_500000.pth hifigan_model/
mv config_hifigan.json hifigan_model/
CUDA_VISIBLE_DEVICES= uv run tts --text "שָׁלוֹם וּבְרָכָה נִפָּרֵד בְּשִׂמְחָה מִמֻּמֵּן" \
--model_path tts_model/saspeech_nikud_7350.pth \
--config_path tts_model/config_overflow.json \
--vocoder_path hifigan_model/checkpoint_500000.pth \
--vocoder_config_path hifigan_model/config_hifigan.json \
--out_path test.wav
Then use:
import sys
import os
sys.path.append('./TTS')
from TTS.api import TTS
# Load model once
print("Loading TTS model...")
tts = TTS(
model_path="tts_model/saspeech_nikud_7350.pth",
config_path="tts_model/config_overflow.json",
vocoder_path="hifigan_model/checkpoint_500000.pth",
vocoder_config_path="hifigan_model/config_hifigan.json",
gpu=False
)
print("Model loaded!")
# Test text
text = "שָׁלוֹם וּבְרָכָה נִפָּרֵד בְּשִׂמְחָה מִמֻּמֵּן"
# Generate in loop (fast after first load)
for i in range(3):
print(f"Generating speech {i+1}...")
tts.tts_to_file(text=text, file_path=f"test_{i+1}.wav")
print(f"Saved to test_{i+1}.wav")