Qiaoo commited on
Commit
9cb66b2
·
verified ·
1 Parent(s): 2d8e804

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -45,6 +45,9 @@ def vits(text, language, speaker_id, noise_scale, noise_scale_w, length_scale):
45
  text = f"{text}"
46
  stn_tst, clean_text = get_text(text, hps_ms)
47
  with no_grad():
 
 
 
48
  x_tst = stn_tst.unsqueeze(0).to(device)
49
  x_tst_lengths = LongTensor([stn_tst.size(0)]).to(device)
50
  speaker_id = LongTensor([speaker_id]).to(device)
 
45
  text = f"{text}"
46
  stn_tst, clean_text = get_text(text, hps_ms)
47
  with no_grad():
48
+ if round(time.perf_counter()-start,2) >= 15.0:
49
+ return "Gagal!", "", f"Waktu terlalu panjang"
50
+
51
  x_tst = stn_tst.unsqueeze(0).to(device)
52
  x_tst_lengths = LongTensor([stn_tst.size(0)]).to(device)
53
  speaker_id = LongTensor([speaker_id]).to(device)