mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-10-06 14:40:00 +08:00
修改bug
修改bug
This commit is contained in:
parent
ff0b37e7d9
commit
08433226b8
@ -30,7 +30,7 @@ inference_pipeline = pipeline(
|
|||||||
punc_model='tools/damo_asr/models/punc_ct-transformer_zh-cn-common-vocab272727-pytorch',
|
punc_model='tools/damo_asr/models/punc_ct-transformer_zh-cn-common-vocab272727-pytorch',
|
||||||
)
|
)
|
||||||
|
|
||||||
def process_audio_file(dir,name,opt_name):
|
def process_audio_file(dir,filename,name,opt_name):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
text = inference_pipeline(audio_in="%s/%s" % (dir, name))["text"]
|
text = inference_pipeline(audio_in="%s/%s" % (dir, name))["text"]
|
||||||
@ -46,10 +46,11 @@ def run__process(): # 主进程
|
|||||||
opt_dir="output/asr_opt"
|
opt_dir="output/asr_opt"
|
||||||
os.makedirs(opt_dir,exist_ok=True)
|
os.makedirs(opt_dir,exist_ok=True)
|
||||||
filename = "%s/%s.list"%(opt_dir,opt_name)
|
filename = "%s/%s.list"%(opt_dir,opt_name)
|
||||||
os.remove(filename,exist_ok=True)
|
if os.path.exists(filename):
|
||||||
|
os.remove(filename)
|
||||||
|
|
||||||
with multiprocessing.Pool(processes=processes) as pool:
|
with multiprocessing.Pool(processes=processes) as pool:
|
||||||
pool.starmap(process_audio_file, [(dir, name ,opt_name) for name in os.listdir(dir)])
|
pool.starmap(process_audio_file, [(dir,filename,name ,opt_name) for name in os.listdir(dir)])
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user