Fix "split_with_sizes(): argument 'split_sizes' (position 2)" error when using cuda

This commit is contained in:
Deniz Şafak
2025-04-29 15:00:20 +03:00
parent 0a7d352209
commit 7c55a6f6fa
+4 -1
View File
@@ -5,7 +5,10 @@ from constants import VOICES_INTERNAL
def get_new_voice(pipeline, formula, use_gpu):
try:
weighted_voice = parse_voice_formula(pipeline, formula)
device = "cuda" if use_gpu else "cpu"
# device = "cuda" if use_gpu else "cpu"
# Setting the device "cuda" gives "Error occurred: split_with_sizes(): argument 'split_sizes' (position 2)"
# error when the device is gpu. So disabling this for now.
device = "cpu"
return weighted_voice.to(device)
except Exception as e:
raise ValueError(f"Failed to create voice: {str(e)}")