Spaces:
Sleeping
Sleeping
Sync from GitHub repo
Browse filesThis Space is synced from the GitHub repo: https://github.com/SWivid/F5-TTS. Please submit contributions to the Space there
src/f5_tts/infer/utils_infer.py
CHANGED
|
@@ -21,7 +21,7 @@ import numpy as np
|
|
| 21 |
import torch
|
| 22 |
import torchaudio
|
| 23 |
import tqdm
|
| 24 |
-
from huggingface_hub import
|
| 25 |
from pydub import AudioSegment, silence
|
| 26 |
from transformers import pipeline
|
| 27 |
from vocos import Vocos
|
|
@@ -128,11 +128,12 @@ def load_vocoder(vocoder_name="vocos", is_local=False, local_path="", device=dev
|
|
| 128 |
except ImportError:
|
| 129 |
print("You need to follow the README to init submodule and change the BigVGAN source code.")
|
| 130 |
if is_local:
|
| 131 |
-
|
| 132 |
vocoder = bigvgan.BigVGAN.from_pretrained(local_path, use_cuda_kernel=False)
|
| 133 |
else:
|
| 134 |
-
|
| 135 |
-
|
|
|
|
| 136 |
|
| 137 |
vocoder.remove_weight_norm()
|
| 138 |
vocoder = vocoder.eval().to(device)
|
|
|
|
| 21 |
import torch
|
| 22 |
import torchaudio
|
| 23 |
import tqdm
|
| 24 |
+
from huggingface_hub import hf_hub_download
|
| 25 |
from pydub import AudioSegment, silence
|
| 26 |
from transformers import pipeline
|
| 27 |
from vocos import Vocos
|
|
|
|
| 128 |
except ImportError:
|
| 129 |
print("You need to follow the README to init submodule and change the BigVGAN source code.")
|
| 130 |
if is_local:
|
| 131 |
+
# download generator from https://huggingface.co/nvidia/bigvgan_v2_24khz_100band_256x/tree/main
|
| 132 |
vocoder = bigvgan.BigVGAN.from_pretrained(local_path, use_cuda_kernel=False)
|
| 133 |
else:
|
| 134 |
+
vocoder = bigvgan.BigVGAN.from_pretrained(
|
| 135 |
+
"nvidia/bigvgan_v2_24khz_100band_256x", use_cuda_kernel=False, cache_dir=hf_cache_dir
|
| 136 |
+
)
|
| 137 |
|
| 138 |
vocoder.remove_weight_norm()
|
| 139 |
vocoder = vocoder.eval().to(device)
|