mrfakename commited on
Commit
c9b205f
·
verified ·
1 Parent(s): ebe57a6

Sync from GitHub repo

Browse files

This Space is synced from the GitHub repo: https://github.com/SWivid/F5-TTS. Please submit contributions to the Space there

Files changed (1) hide show
  1. src/f5_tts/infer/utils_infer.py +5 -4
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 snapshot_download, hf_hub_download
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
- """download 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
- local_path = snapshot_download(repo_id="nvidia/bigvgan_v2_24khz_100band_256x", cache_dir=hf_cache_dir)
135
- vocoder = bigvgan.BigVGAN.from_pretrained(local_path, use_cuda_kernel=False)
 
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)