lj1995 commited on
Commit
4bb05e5
1 Parent(s): 6bb3db9

Update inference_webui.py

Browse files
Files changed (1) hide show
  1. inference_webui.py +14 -0
inference_webui.py CHANGED
@@ -343,6 +343,20 @@ def merge_short_text_in_array(texts, threshold):
343
  cache= {}
344
  def get_tts_wav(ref_wav_path, prompt_text, prompt_language, text, text_language, how_to_cut=i18n("不切"), top_k=20, top_p=0.6, temperature=0.6, ref_free = False,speed=1,if_freeze=False,inp_refs=123):
345
  global cache
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
  try:
347
  if ref_wav_path:pass
348
  else:gr.Warning(i18n('请上传参考音频'))
 
343
  cache= {}
344
  def get_tts_wav(ref_wav_path, prompt_text, prompt_language, text, text_language, how_to_cut=i18n("不切"), top_k=20, top_p=0.6, temperature=0.6, ref_free = False,speed=1,if_freeze=False,inp_refs=123):
345
  global cache
346
+
347
+ import psutil
348
+
349
+ # 获取内存信息
350
+ memory_info = psutil.virtual_memory()
351
+
352
+ # 打印总内存和剩余内存
353
+ total_memory = memory_info.total / (1024 ** 3) # 转换为 GB
354
+ available_memory = memory_info.available / (1024 ** 3) # 转换为 GB
355
+
356
+ print(f"总内存: {total_memory:.2f} GB")
357
+ print(f"剩余内存: {available_memory:.2f} GB")
358
+
359
+
360
  try:
361
  if ref_wav_path:pass
362
  else:gr.Warning(i18n('请上传参考音频'))