litagin commited on
Commit
4ee533d
β€’
1 Parent(s): 8373106

Improve log

Browse files
Files changed (1) hide show
  1. app.py +15 -8
app.py CHANGED
@@ -137,7 +137,8 @@ dict_language = {"Chinese": "zh", "English": "en", "Japanese": "ja"}
137
 
138
 
139
  def get_tts_wav(ref_wav_path, prompt_text, prompt_language, text, text_language):
140
- print(f"---{datetime.datetime.now()}---")
 
141
  print(f"ref_wav_path: {ref_wav_path}")
142
  print(f"prompt_text: {prompt_text}")
143
  print(f"prompt_language: {prompt_language}")
@@ -234,13 +235,19 @@ def get_tts_wav(ref_wav_path, prompt_text, prompt_language, text, text_language)
234
  audio_opt.append(audio)
235
  audio_opt.append(zero_wav)
236
  t4 = ttime()
237
- print("%.3f\t%.3f\t%.3f\t%.3f" % (t1 - t0, t2 - t1, t3 - t2, t4 - t3))
238
- return "Success! time: %.3f\t%.3f\t%.3f\t%.3f" % (
239
- t1 - t0,
240
- t2 - t1,
241
- t3 - t2,
242
- t4 - t3,
243
- ), (hps.data.sampling_rate, (np.concatenate(audio_opt, 0) * 32768).astype(np.int16))
 
 
 
 
 
 
244
 
245
 
246
  initial_md = """
 
137
 
138
 
139
  def get_tts_wav(ref_wav_path, prompt_text, prompt_language, text, text_language):
140
+ start_time = datetime.datetime.now()
141
+ print(f"---START---{start_time}---")
142
  print(f"ref_wav_path: {ref_wav_path}")
143
  print(f"prompt_text: {prompt_text}")
144
  print(f"prompt_language: {prompt_language}")
 
235
  audio_opt.append(audio)
236
  audio_opt.append(zero_wav)
237
  t4 = ttime()
238
+ end_time = datetime.datetime.now()
239
+ dur = end_time - start_time
240
+ print(
241
+ f"Success! total time: {dur.seconds:.3f} sec,\ndetail time: {t1 - t0:.3f}, {t2 - t1:.3f}, {t3 - t2:.3f}, {t4 - t3:.3f}"
242
+ )
243
+ print(f"---END---{end_time}---")
244
+ return (
245
+ f"Success! total time: {dur.seconds:.3f} sec,\ndetail time: {t1 - t0:.3f}, {t2 - t1:.3f}, {t3 - t2:.3f}, {t4 - t3:.3f}",
246
+ (
247
+ hps.data.sampling_rate,
248
+ (np.concatenate(audio_opt, 0) * 32768).astype(np.int16),
249
+ ),
250
+ )
251
 
252
 
253
  initial_md = """