Views
No views yet
| > loss: -1.139192819595337 (-1.1461634561651597)
| > log_mle: -1.1896342039108276 (-1.1868862626708554)
| > loss_dur: 0.05044136941432953 (0.040722804967998696)
| > amp_scaler: 1024.0 (1024.0)
| > grad_norm: tensor(93.2843, device='cuda:0') (tensor(114.0992, device='cuda:0'))
| > current_lr: 4.95e-05
| > step_time: 1.5738 (0.7975553745792661)
| > loader_time: 0.0148 (0.18739397280684145)EVALUATION
coqui-ttspip install coqui-tts1from TTS.api import TTS
2import torch
3
4# Define paths and input
5check_point_folder = "./ckpts"
6model_path = f"{check_point_folder}/best_model.pth"
7config_path = f"{check_point_folder}/config.json"
8
9out_path = "tts_output.wav"
10text = ("Trong khi đó, tại bến tàu du lịch Nha Trang, hàng ngàn du khách chen nhau "
11 "để đi đến các đảo trên vịnh Nha Trang, lực lượng cảnh sát đường thủy đã "
12 "tăng cường quân số để quản lý, đảm bảo an toàn cho du khách.")
13
14# Set device (GPU if available, else CPU)
15device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
16
17# Initialize TTS model
18tts = TTS(model_path=model_path, config_path=config_path, progress_bar=True)
19
20# Move model to the specified device
21tts.to(device)
22
23# Perform inference and save to file
24tts.tts_to_file(text=text, file_path=out_path, speaker=None, language=None, split_sentences=False)1import IPython
2IPython.display.Audio("tts_output.wav")