Update tts_generation.py
This commit is contained in:
+6
-3
@@ -21,10 +21,13 @@ def main():
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if args.device == "cuda":
|
||||||
|
device="cuda"
|
||||||
|
else:
|
||||||
|
device="cpu"
|
||||||
|
|
||||||
# Init TTS
|
# Init TTS
|
||||||
tts = TTS()
|
tts = TTS(model_path=args.model,config_path=os.path.join(args.model,"config.json")).to(device)
|
||||||
tts.load_tts_model_by_path(model_path=args.model,config_path=os.path.join(args.model,"config.json"))
|
|
||||||
# tts.to(args.device)
|
|
||||||
|
|
||||||
# Run TTS and save to file
|
# Run TTS and save to file
|
||||||
tts.tts_to_file(text=args.text, speaker_wav=args.speaker_wav, language=args.language, file_path=args.output_file)
|
tts.tts_to_file(text=args.text, speaker_wav=args.speaker_wav, language=args.language, file_path=args.output_file)
|
||||||
|
|||||||
Reference in New Issue
Block a user