mirror of https://github.com/coqui-ai/TTS.git
Fix `extract_tts_spectrograms.py` model init
This commit is contained in:
parent
537c8576ec
commit
807f1d3817
|
@ -16,7 +16,6 @@ from TTS.tts.models import setup_model
|
||||||
from TTS.tts.utils.speakers import get_speaker_manager
|
from TTS.tts.utils.speakers import get_speaker_manager
|
||||||
from TTS.utils.audio import AudioProcessor
|
from TTS.utils.audio import AudioProcessor
|
||||||
from TTS.utils.generic_utils import count_parameters
|
from TTS.utils.generic_utils import count_parameters
|
||||||
from TTS.utils.io import load_fsspec
|
|
||||||
|
|
||||||
use_cuda = torch.cuda.is_available()
|
use_cuda = torch.cuda.is_available()
|
||||||
|
|
||||||
|
@ -239,8 +238,7 @@ def main(args): # pylint: disable=redefined-outer-name
|
||||||
model = setup_model(c)
|
model = setup_model(c)
|
||||||
|
|
||||||
# restore model
|
# restore model
|
||||||
checkpoint = load_fsspec(args.checkpoint_path, map_location="cpu")
|
model.load_checkpoint(c, args.checkpoint_path, eval=True)
|
||||||
model.load_state_dict(checkpoint["model"])
|
|
||||||
|
|
||||||
if use_cuda:
|
if use_cuda:
|
||||||
model.cuda()
|
model.cuda()
|
||||||
|
|
Loading…
Reference in New Issue