Вот код:
lang = "cyrillic"
model_id = 'v4_cyrillic'
sample_rate = 48000
speaker = "kz_M1"
put_accent = True
put_yo = True
device = torch.device('cpu')
text = "Сәлем , достар"
model , _ = torch.hub.load(repo_or_dir='snakers4/silero-models',
model = 'silero_tts',
language=lang,
speaker=model_id)
model.to(device)
audio = model.apply_tts(text=text,
speaker=speaker,
sample_rate=sample_rate,
put_accent=put_accent,
put_yo=put_yo)
print(text)
sd.play(audio , sample_rate)
time.sleep(len(audio) / sample_rate)
sd.stop()
audio = model.apply_tts(text="Сәлем!",
speaker=speaker,
sample_rate=sample_rate,
put_accent=put_accent,
put_yo=put_yo)
print(text)
sd.play(audio , sample_rate)
time.sleep(len(audio) / sample_rate)
sd.stop()
Вот время выполнения:
Как можно исправить это?