xj commited on
Commit
2f6d6ff
β€’
1 Parent(s): b6e73ca

[feat] show memory usage

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -1,6 +1,7 @@
1
  # coding=utf-8
2
  import logging
3
  import sys
 
4
  logging.getLogger('numba').setLevel(logging.WARNING)
5
 
6
  logging.basicConfig(
@@ -61,6 +62,8 @@ def vits(text, language, speaker_id, noise_scale, noise_scale_w, length_scale):
61
  speaker_id = LongTensor([speaker_id]).to(device)
62
  audio = net_g_ms.infer(x_tst, x_tst_lengths, sid=speaker_id, noise_scale=noise_scale, noise_scale_w=noise_scale_w,
63
  length_scale=length_scale)[0][0, 0].data.cpu().float().numpy()
 
 
64
 
65
  return "η”ŸζˆζˆεŠŸ!", (22050, audio), f"η”Ÿζˆθ€—ζ—Ά {round(time.perf_counter()-start, 2)} s"
66
 
 
1
  # coding=utf-8
2
  import logging
3
  import sys
4
+ import os
5
  logging.getLogger('numba').setLevel(logging.WARNING)
6
 
7
  logging.basicConfig(
 
62
  speaker_id = LongTensor([speaker_id]).to(device)
63
  audio = net_g_ms.infer(x_tst, x_tst_lengths, sid=speaker_id, noise_scale=noise_scale, noise_scale_w=noise_scale_w,
64
  length_scale=length_scale)[0][0, 0].data.cpu().float().numpy()
65
+ with os.popen('free') as f:
66
+ logger.info(f.read())
67
 
68
  return "η”ŸζˆζˆεŠŸ!", (22050, audio), f"η”Ÿζˆθ€—ζ—Ά {round(time.perf_counter()-start, 2)} s"
69