should not be working late
This commit is contained in:
parent
bfe70e9d56
commit
28d39ef962
|
@ -20,32 +20,29 @@ from tqdm import tqdm
|
||||||
|
|
||||||
from torch.nn.utils.rnn import pad_sequence
|
from torch.nn.utils.rnn import pad_sequence
|
||||||
|
|
||||||
|
AVAILABLE_AUDIO_BACKENDS = []
|
||||||
try:
|
try:
|
||||||
from .codecs.encodec import *
|
from .codecs.encodec import *
|
||||||
cfg.inference.audio_backends["encodec"] = True
|
AVAILABLE_AUDIO_BACKENDS.append("encodec")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
cfg.inference.audio_backends["encodec"] = False # e
|
|
||||||
_logger.warning(str(e))
|
_logger.warning(str(e))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from .codecs.vocos import *
|
from .codecs.vocos import *
|
||||||
cfg.inference.audio_backends["vocos"] = True
|
AVAILABLE_AUDIO_BACKENDS.append("vocos")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
cfg.inference.audio_backends["vocos"] = False # e
|
|
||||||
_logger.warning(str(e))
|
_logger.warning(str(e))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from .codecs.dac import *
|
from .codecs.dac import *
|
||||||
cfg.inference.audio_backends["dac"] = True
|
AVAILABLE_AUDIO_BACKENDS.append("dac")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
cfg.inference.audio_backends["dac"] = False # e
|
|
||||||
_logger.warning(str(e))
|
_logger.warning(str(e))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from .codecs.nemo import *
|
from .codecs.nemo import *
|
||||||
cfg.inference.audio_backends["nemo"] = True
|
AVAILABLE_AUDIO_BACKENDS.append("nemo")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
cfg.inference.audio_backends["nemo"] = False # e
|
|
||||||
_logger.warning(str(e))
|
_logger.warning(str(e))
|
||||||
|
|
||||||
@cache
|
@cache
|
||||||
|
|
|
@ -14,7 +14,7 @@ from pathlib import Path
|
||||||
from tqdm import tqdm, trange
|
from tqdm import tqdm, trange
|
||||||
|
|
||||||
from .emb import g2p, qnt
|
from .emb import g2p, qnt
|
||||||
from .emb.qnt import trim, trim_random, unload_model, repeat_extend_audio
|
from .emb.qnt import trim, trim_random, unload_model, repeat_extend_audio, AVAILABLE_AUDIO_BACKENDS
|
||||||
from .emb.transcribe import transcribe
|
from .emb.transcribe import transcribe
|
||||||
|
|
||||||
from .utils import to_device, set_seed, clamp, ml
|
from .utils import to_device, set_seed, clamp, ml
|
||||||
|
@ -62,7 +62,7 @@ class TTS():
|
||||||
cfg.dataset.use_hdf5 = False # could use cfg.load_hdf5(), but why would it ever need to be loaded for inferencing
|
cfg.dataset.use_hdf5 = False # could use cfg.load_hdf5(), but why would it ever need to be loaded for inferencing
|
||||||
|
|
||||||
# fallback to encodec if no vocos
|
# fallback to encodec if no vocos
|
||||||
if cfg.audio_backend == "vocos" and not cfg.inference.audio_backends.get("vocos", False):
|
if cfg.audio_backend == "vocos" and "vocos" not in AVAILABLE_AUDIO_BACKENDS:
|
||||||
_logger.warning("Vocos requested but not available, falling back to Encodec...")
|
_logger.warning("Vocos requested but not available, falling back to Encodec...")
|
||||||
cfg.set_audio_backend(cfg.audio_backend)
|
cfg.set_audio_backend(cfg.audio_backend)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user