Merge pull request #338 from yrom/fix/preload-bigvgan-cuda

Correct the import path of BigVGAN's custom cuda kernel
This commit is contained in:
nanaoto 2025-09-15 16:27:40 +08:00 committed by GitHub
commit ee23371296
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -100,12 +100,12 @@ class IndexTTS2:
if self.use_cuda_kernel:
# preload the CUDA kernel for BigVGAN
try:
from indextts.BigVGAN.alias_free_activation.cuda import load
from indextts.s2mel.modules.bigvgan.alias_free_activation.cuda import activation1d
anti_alias_activation_cuda = load.load()
print(">> Preload custom CUDA kernel for BigVGAN", anti_alias_activation_cuda)
except:
print(">> Preload custom CUDA kernel for BigVGAN", activation1d.anti_alias_activation_cuda)
except Exception as e:
print(">> Failed to load custom CUDA kernel for BigVGAN. Falling back to torch.")
print(f"{e!r}")
self.use_cuda_kernel = False
self.extract_features = SeamlessM4TFeatureExtractor.from_pretrained("facebook/w2v-bert-2.0")