dyp01 commited on
Commit
d187a71
·
verified ·
1 Parent(s): ad3617e

Fix batch conversion summary and empty input outputs

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -438,7 +438,7 @@ def create_interface():
438
  # 处理函数
439
  def on_convert(audio_paths, use_cuda, use_quantize, progress=gr.Progress()):
440
  if not audio_paths:
441
- return "请选择输入音频文件", [], gr.update(visible=False)
442
 
443
  all_files = []
444
  results = []
@@ -459,7 +459,7 @@ def create_interface():
459
  progress(1.0, desc="全部完成!")
460
  download_btn_update = gr.update(visible=True) if all_files else gr.update(visible=False)
461
  download_status_update = gr.update(visible=False)
462
- return f"转换完成!共处理 {total_files} 个文件\n" + "\n".join(results), all_files, download_btn_update, download_status_update, all_files
463
 
464
  # 下载所有文件的函数
465
  def download_all_files(file_paths, status_output=None):
 
438
  # 处理函数
439
  def on_convert(audio_paths, use_cuda, use_quantize, progress=gr.Progress()):
440
  if not audio_paths:
441
+ return "请选择输入音频文件", [], gr.update(visible=False), gr.update(visible=False), []
442
 
443
  all_files = []
444
  results = []
 
459
  progress(1.0, desc="全部完成!")
460
  download_btn_update = gr.update(visible=True) if all_files else gr.update(visible=False)
461
  download_status_update = gr.update(visible=False)
462
+ return f"处理结束:共处理 {total_files} 个文件,成功 {sum(message.startswith('转换完成') for message in results)} 个,失败 {sum(message.startswith('转换失败') for message in results)} 个\n" + "\n".join(results), all_files, download_btn_update, download_status_update, all_files
463
 
464
  # 下载所有文件的函数
465
  def download_all_files(file_paths, status_output=None):