Merge pull request #971 from tbxark-fork/main

chore: Update the model checkpoint path to use the cache path.
This commit is contained in:
Yushen CHEN
2025-04-14 15:54:50 +08:00
committed by GitHub

View File

@@ -9,6 +9,7 @@ import torch.nn.functional as F
import torchaudio
from hydra.utils import get_class
from omegaconf import OmegaConf
from cached_path import cached_path
from f5_tts.infer.utils_infer import load_checkpoint, load_vocoder, save_spectrogram
from f5_tts.model import CFM
@@ -55,7 +56,8 @@ win_length = model_cfg.model.mel_spec.win_length
n_fft = model_cfg.model.mel_spec.n_fft
ckpt_path = str(files("f5_tts").joinpath("../../")) + f"ckpts/{exp_name}/model_{ckpt_step}.safetensors"
# ckpt_path = str(files("f5_tts").joinpath("../../")) + f"/ckpts/{exp_name}/model_{ckpt_step}.safetensors"
ckpt_path = str(cached_path(f"hf://SWivid/F5-TTS/{exp_name}/model_{ckpt_step}.safetensors"))
output_dir = "tests"