From 7c55a6f6fac5c55bd84b98f7a1ebcd42513b39f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deniz=20=C5=9Eafak?= Date: Tue, 29 Apr 2025 15:00:20 +0300 Subject: [PATCH] Fix "split_with_sizes(): argument 'split_sizes' (position 2)" error when using cuda --- abogen/voice_formulas.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/abogen/voice_formulas.py b/abogen/voice_formulas.py index 8374395..b6f7e81 100644 --- a/abogen/voice_formulas.py +++ b/abogen/voice_formulas.py @@ -4,8 +4,11 @@ from constants import VOICES_INTERNAL # Calls parsing and loads the voice to gpu or cpu def get_new_voice(pipeline, formula, use_gpu): try: - weighted_voice = parse_voice_formula(pipeline, formula) - device = "cuda" if use_gpu else "cpu" + weighted_voice = parse_voice_formula(pipeline, formula) + # 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)}")