refine_texts = chat.infer(texts, skip_refine_text=False, refine_text_only=True, params_refine_text=params_refine_text,) print('======refine===========') for i inrange(len(refine_texts)): print(refine_texts[i])
params_infer_code = ChatTTS.Chat.InferCodeParams( spk_emb = rand_spk, # add sampled speaker temperature = .3, # using custom temperature top_P = 0.7, # top P decode top_K = 20, # top K decode )
for i inrange(len(wavs)): """ In some versions of torchaudio, the first line works but in other versions, so does the second line. """ try: torchaudio.save(f"basic_output{i}.wav", torch.from_numpy(wavs[i]).unsqueeze(0), 24000) except: torchaudio.save(f"basic_output{i}.wav", torch.from_numpy(wavs[i]), 24000)
params_infer_code = ChatTTS.Chat.InferCodeParams( spk_emb = None, # add sampled speaker temperature = .3, # using custom temperature top_P = 0.7, # top P decode top_K = 20, # top K decode )
chat = ChatTTS.Chat() chat.load(compile=False) # Set compile=True for optimized performance
rand_spk = chat.sample_random_speaker() print('=================') print(rand_spk) # save it for later timbre recovery
params_infer_code = ChatTTS.Chat.InferCodeParams( spk_emb = None, # add sampled speaker temperature = .3, # using custom temperature top_P = 0.7, # top P decode top_K = 20, # top K decode )
for i inrange(len(wavs)): """ In some versions of torchaudio, the first line works but in other versions, so does the second line. """ try: torchaudio.save(f"basic_output{i}.wav", torch.from_numpy(wavs[i]).unsqueeze(0), 24000) except: torchaudio.save(f"basic_output{i}.wav", torch.from_numpy(wavs[i]), 24000)