Merge f8c3eafba66916ab913e7eeaf7eb826f0dd94989 into ed75ecdd6d3ebb033b9dddee91dff6d2efa7df14

This commit is contained in:
normal-me 2024-03-25 19:22:26 +00:00 committed by GitHub
commit d015f7fd02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -199,16 +199,18 @@ def open_asr(asr_inp_dir, asr_opt_dir, asr_model, asr_model_size, asr_lang):
global p_asr
if(p_asr==None):
asr_inp_dir=my_utils.clean_path(asr_inp_dir)
cmd = f'"{python_exec}" tools/asr/{asr_dict[asr_model]["path"]}'
cmd += f' -i "{asr_inp_dir}"'
cmd += f' -o "{asr_opt_dir}"'
cmd += f' -s {asr_model_size}'
cmd += f' -l {asr_lang}'
cmd += " -p %s"%("float16"if is_half==True else "float32")
cmd_list = [python_exec, f'tools/asr/{asr_dict[asr_model]["path"]}']
cmd_list.extend(['-i', asr_inp_dir])
cmd_list.extend(['-o', asr_opt_dir])
cmd_list.extend(['-s', asr_model_size])
cmd_list.extend(['-l', asr_lang])
cmd_list.extend(['-p', 'float16' if is_half else 'float32'])
yield "ASR任务开启%s"%cmd,{"__type__":"update","visible":False},{"__type__":"update","visible":True}
print(cmd)
p_asr = Popen(cmd, shell=True)
cmd_str = " ".join(cmd_list)
yield "ASR任务开启%s"%cmd_str,{"__type__":"update","visible":False},{"__type__":"update","visible":True}
print(cmd_str)
p_asr = Popen(cmd_list)
p_asr.wait()
p_asr=None
yield f"ASR任务完成, 查看终端进行下一步",{"__type__":"update","visible":True},{"__type__":"update","visible":False}