From b2284b6cffc5fec4c3dfe84ae7306d506963c08c Mon Sep 17 00:00:00 2001 From: tbxark Date: Mon, 14 Apr 2025 11:28:48 +0800 Subject: [PATCH] chore: Update the model checkpoint path to use the cache path. --- src/f5_tts/infer/speech_edit.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/f5_tts/infer/speech_edit.py b/src/f5_tts/infer/speech_edit.py index b724258..4902edb 100644 --- a/src/f5_tts/infer/speech_edit.py +++ b/src/f5_tts/infer/speech_edit.py @@ -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"