Skip to content

SOTA Open Source TTS

fix: match the dac inference input suffix case-insensitively (#1313)

Dhevenddra K Gaa0caa6e650a
diff --git a/fish_speech/models/dac/inference.py b/fish_speech/models/dac/inference.py
index 50be273..77b33c7 100644
--- a/fish_speech/models/dac/inference.py
+++ b/fish_speech/models/dac/inference.py
@@ -71,7 +71,8 @@ def load_model(config_name, checkpoint_path, device="cuda"):
def main(input_path, output_path, config_name, checkpoint_path, device):
model = load_model(config_name, checkpoint_path, device=device)
- if input_path.suffix in AUDIO_EXTENSIONS:
+ suffix = input_path.suffix.lower()
+ if suffix in AUDIO_EXTENSIONS:
logger.info(f"Processing in-place reconstruction of {input_path}")
# Load audio
@@ -96,7 +97,7 @@ def main(input_path, output_path, config_name, checkpoint_path, device):
# Save indices
np.save(output_path.with_suffix(".npy"), indices.cpu().numpy())
- elif input_path.suffix == ".npy":
+ elif suffix == ".npy":
logger.info(f"Processing precomputed indices from {input_path}")
indices = np.load(input_path)
indices = torch.from_numpy(indices).to(device).long()