throw error when no reference audio is provided in the web UI because someone keeps doing that in the HF space

This commit is contained in:
mrq 2023-09-10 15:50:50 -05:00
parent ba71020318
commit 671dca88ee
3 changed files with 5 additions and 1 deletions

View File

@ -164,6 +164,7 @@ class Model:
training: bool = True
interleave: bool = False
frozen_params: list[str] = field(default_factory=lambda: [])
p_ar_nar: float = 0.5
@property
def full_name(self):

View File

@ -88,7 +88,7 @@ class AR_NAR(Base):
# is training
if n_levels == self.n_resp_levels:
if random.random() < 0.95:
if random.random() < cfg.models.ar_nar.p_ar_nar:
quant_levels = None
targ_list = [r[..., 0] for r in resps_list] # guarantees we only have the first levels

View File

@ -81,6 +81,9 @@ def do_inference( progress=gr.Progress(track_tqdm=True), *args, **kwargs ):
tmp = tempfile.NamedTemporaryFile(suffix='.wav')
if not args.references:
raise ValueError("No reference audio provided.")
tts = init_tts()
with timer() as t:
wav, sr = tts.inference(