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:
parent
ba71020318
commit
671dca88ee
|
@ -164,6 +164,7 @@ class Model:
|
||||||
training: bool = True
|
training: bool = True
|
||||||
interleave: bool = False
|
interleave: bool = False
|
||||||
frozen_params: list[str] = field(default_factory=lambda: [])
|
frozen_params: list[str] = field(default_factory=lambda: [])
|
||||||
|
p_ar_nar: float = 0.5
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def full_name(self):
|
def full_name(self):
|
||||||
|
|
|
@ -88,7 +88,7 @@ class AR_NAR(Base):
|
||||||
|
|
||||||
# is training
|
# is training
|
||||||
if n_levels == self.n_resp_levels:
|
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
|
quant_levels = None
|
||||||
|
|
||||||
targ_list = [r[..., 0] for r in resps_list] # guarantees we only have the first levels
|
targ_list = [r[..., 0] for r in resps_list] # guarantees we only have the first levels
|
||||||
|
|
|
@ -81,6 +81,9 @@ def do_inference( progress=gr.Progress(track_tqdm=True), *args, **kwargs ):
|
||||||
|
|
||||||
tmp = tempfile.NamedTemporaryFile(suffix='.wav')
|
tmp = tempfile.NamedTemporaryFile(suffix='.wav')
|
||||||
|
|
||||||
|
if not args.references:
|
||||||
|
raise ValueError("No reference audio provided.")
|
||||||
|
|
||||||
tts = init_tts()
|
tts = init_tts()
|
||||||
with timer() as t:
|
with timer() as t:
|
||||||
wav, sr = tts.inference(
|
wav, sr = tts.inference(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user