From 7e4985ca569643d41bc252506fb90407e622eb35 Mon Sep 17 00:00:00 2001 From: SWivid Date: Mon, 17 Mar 2025 02:39:20 +0800 Subject: [PATCH] v1.0.3 fix api.py --- pyproject.toml | 2 +- src/f5_tts/api.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index aeb1e78..1df5ca1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "f5-tts" -version = "1.0.2" +version = "1.0.3" description = "F5-TTS: A Fairytaler that Fakes Fluent and Faithful Speech with Flow Matching" readme = "README.md" license = {text = "MIT License"} diff --git a/src/f5_tts/api.py b/src/f5_tts/api.py index 7c73c87..ea2c1a0 100644 --- a/src/f5_tts/api.py +++ b/src/f5_tts/api.py @@ -74,8 +74,6 @@ class F5TTS: elif model == "E2TTS_Base": repo_name = "E2-TTS" ckpt_step = 1200000 - else: - raise ValueError(f"Unknown model type: {model}") if not ckpt_file: ckpt_file = str( @@ -117,8 +115,9 @@ class F5TTS: seed=None, ): if seed is None: - self.seed = random.randint(0, sys.maxsize) - seed_everything(self.seed) + seed = random.randint(0, sys.maxsize) + seed_everything(seed) + self.seed = seed ref_file, ref_text = preprocess_ref_audio_text(ref_file, ref_text, device=self.device)