facebookresearch / fairseq

Facebook AI Research Sequence-to-Sequence Toolkit written in Python.
MIT License
30.22k stars 6.38k forks source link

Why the speaking does not pause at period or comma? #5420

Open thanhnew2001 opened 8 months ago

thanhnew2001 commented 8 months ago

🐛 Bug

The speech does not include period or comma

To Reproduce

txt = f""" hello. how are you? """ print(f"Text: {txt}")

txt = preprocess_text(txt, text_mapper, hps, lang=LANG) stn_tst = text_mapper.get_text(txt, hps)

with torch.no_grad(): x_tst = stn_tst.unsqueeze(0).to(device) x_tst_lengths = torch.LongTensor([stn_tst.size(0)]).to(device)

start_time = time.time()
hyp = net_g.infer(
    x_tst, x_tst_lengths, noise_scale=0.667,
    noise_scale_w=0.9, length_scale=1.0
)[0][0, 0].cpu().float().numpy()
end_time = time.time()
inference_time = end_time - start_time

print(f"Generated audio (Inference Time: {inference_time:.2f} seconds)") Audio(hyp, rate=hps.data.sampling_rate)

Code sample

Expected behavior

Environment

Additional context