You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import os
from ukrainian_tts.tts import TTS, Voices, Stress
MODEL_PATH = "/app/models/ukrainian_tts/robinhad"
os.makedirs(MODEL_PATH, exist_ok=True)
tts = TTS(device="cpu", cache_folder=MODEL_PATH) # can try gpu, mps
UPLOAD_FOLDER = "uploads"
text = "Привіт. Раз, два, три!"
def check():
output_path = os.path.join(UPLOAD_FOLDER, "output.wav")
with open(output_path, mode="wb") as file:
_, output_text = tts.tts(text, Voices.Dmytro.value, Stress.Dictionary.value, file)
print("Accented text:", output_text)
if __name__ == "__main__":
check()
Expectation: model will be downloaded on specific path and using it for voice generation.
Real: model was downloaded into specific folder, all files exists. But raise exception:
state = torch.load(filename, lambda storage, loc: storage)
downloading https://github.com/robinhad/ukrainian-tts/releases/download/v6.0.0
Found /app/models/ukrainian_tts/robinhad/model.pth. Skipping download...
Found /app/models/ukrainian_tts/robinhad/config.yaml. Skipping download...
Found /app/models/ukrainian_tts/robinhad/spk_xvector.ark. Skipping download...
Found /app/models/ukrainian_tts/robinhad/feats_stats.npz. Skipping download...
downloaded.
Traceback (most recent call last):
File "/app/src/test-tts-2.py", line 12, in <module>
tts = TTS(device="cpu", cache_folder=MODEL_PATH) # can try gpu, mps
File "/usr/local/lib/python3.10/site-packages/ukrainian_tts/tts.py", line 43, in __init__
File "/usr/local/lib/python3.10/site-packages/ukrainian_tts/tts.py", line 43, in __init__
self.__setup_cache(cache_folder)
self.__setup_cache(cache_folder)
File "/usr/local/lib/python3.10/site-packages/ukrainian_tts/tts.py", line 117, in __setup_cache
File "/usr/local/lib/python3.10/site-packages/ukrainian_tts/tts.py", line 117, in __setup_cache
self.synthesizer = Text2Speech(
File "/usr/local/lib/python3.10/site-packages/espnet2/bin/tts_inference.py", line 92, in __init__
model, train_args = TTSTask.build_model_from_file(
File "/usr/local/lib/python3.10/site-packages/espnet2/bin/tts_inference.py", line 92, in __init__
model, train_args = TTSTask.build_model_from_file(
model, train_args = TTSTask.build_model_from_file(
File "/usr/local/lib/python3.10/site-packages/espnet2/tasks/abs_task.py", line 1846, in build_model_from_file
model = cls.build_model(args)
File "/usr/local/lib/python3.10/site-packages/espnet2/tasks/tts.py", line 311, in build_model
normalize = normalize_class(**args.normalize_conf)
File "/usr/local/lib/python3.10/site-packages/espnet2/layers/global_mvn.py", line 40, in __init__
stats = np.load(stats_file)
File "/usr/local/lib/python3.10/site-packages/numpy/lib/npyio.py", line 405, in load
fid = stack.enter_context(open(os_fspath(file), "rb"))
FileNotFoundError: [Errno 2] No such file or directory: 'feats_stats.npz'
The text was updated successfully, but these errors were encountered:
How to reproduce:
Expectation: model will be downloaded on specific path and using it for voice generation.
Real: model was downloaded into specific folder, all files exists. But raise exception:
The text was updated successfully, but these errors were encountered: