mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-10-07 15:19:59 +08:00
Merge af364358bedea07d7851613bbe9fef2a1b72bb40 into 836bfec1fbf7356d59bd2dbe3883997646554e20
This commit is contained in:
commit
75453e82ba
@ -25,11 +25,9 @@ import torch
|
||||
|
||||
infer_ttswebui = os.environ.get("infer_ttswebui", 9872)
|
||||
infer_ttswebui = int(infer_ttswebui)
|
||||
is_share = os.environ.get("is_share", "False")
|
||||
is_share = eval(is_share)
|
||||
if "_CUDA_VISIBLE_DEVICES" in os.environ:
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = os.environ["_CUDA_VISIBLE_DEVICES"]
|
||||
is_half = eval(os.environ.get("is_half", "True")) and torch.cuda.is_available()
|
||||
from config import is_half,is_share
|
||||
gpt_path = os.environ.get("gpt_path", None)
|
||||
sovits_path = os.environ.get("sovits_path", None)
|
||||
cnhubert_base_path = os.environ.get("cnhubert_base_path", None)
|
||||
|
@ -10,7 +10,7 @@ all_parts = os.environ.get("all_parts")
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = os.environ.get("_CUDA_VISIBLE_DEVICES")
|
||||
opt_dir = os.environ.get("opt_dir")
|
||||
bert_pretrained_dir = os.environ.get("bert_pretrained_dir")
|
||||
is_half = eval(os.environ.get("is_half", "True"))
|
||||
from config import is_half
|
||||
import sys, numpy as np, traceback, pdb
|
||||
import os.path
|
||||
from glob import glob
|
||||
|
@ -10,7 +10,7 @@ os.environ["CUDA_VISIBLE_DEVICES"]= os.environ.get("_CUDA_VISIBLE_DEVICES")
|
||||
from feature_extractor import cnhubert
|
||||
opt_dir= os.environ.get("opt_dir")
|
||||
cnhubert.cnhubert_base_path= os.environ.get("cnhubert_base_dir")
|
||||
is_half=eval(os.environ.get("is_half","True"))
|
||||
from config import is_half
|
||||
|
||||
import pdb,traceback,numpy as np,logging
|
||||
from scipy.io import wavfile
|
||||
|
@ -8,7 +8,7 @@ os.environ["CUDA_VISIBLE_DEVICES"] = os.environ.get("_CUDA_VISIBLE_DEVICES")
|
||||
opt_dir = os.environ.get("opt_dir")
|
||||
pretrained_s2G = os.environ.get("pretrained_s2G")
|
||||
s2config_path = os.environ.get("s2config_path")
|
||||
is_half = eval(os.environ.get("is_half", "True"))
|
||||
from config import is_half
|
||||
import math, traceback
|
||||
import multiprocessing
|
||||
import sys, pdb
|
||||
|
@ -42,6 +42,7 @@ if infer_device == "cuda":
|
||||
is_half=False
|
||||
|
||||
if(infer_device=="cpu"):is_half=False
|
||||
if(torch.backends.mps.is_available()):is_half=False
|
||||
|
||||
class Config:
|
||||
def __init__(self):
|
||||
|
@ -1,29 +1,29 @@
|
||||
import os,argparse
|
||||
|
||||
from modelscope.pipelines import pipeline
|
||||
from modelscope.utils.constant import Tasks
|
||||
from tqdm import tqdm
|
||||
|
||||
path_denoise = 'tools/denoise-model/speech_frcrn_ans_cirm_16k'
|
||||
path_denoise = path_denoise if os.path.exists(path_denoise) else "damo/speech_frcrn_ans_cirm_16k"
|
||||
ans = pipeline(Tasks.acoustic_noise_suppression,model=path_denoise)
|
||||
def execute_denoise(input_folder,output_folder):
|
||||
os.makedirs(output_folder,exist_ok=True)
|
||||
# print(input_folder)
|
||||
# print(list(os.listdir(input_folder).sort()))
|
||||
for name in tqdm(os.listdir(input_folder)):
|
||||
ans("%s/%s"%(input_folder,name),output_path='%s/%s'%(output_folder,name))
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-i", "--input_folder", type=str, required=True,
|
||||
help="Path to the folder containing WAV files.")
|
||||
parser.add_argument("-o", "--output_folder", type=str, required=True,
|
||||
help="Output folder to store transcriptions.")
|
||||
parser.add_argument("-p", "--precision", type=str, default='float16', choices=['float16','float32'],
|
||||
help="fp16 or fp32")#还没接入
|
||||
cmd = parser.parse_args()
|
||||
execute_denoise(
|
||||
input_folder = cmd.input_folder,
|
||||
output_folder = cmd.output_folder,
|
||||
import os,argparse
|
||||
|
||||
from modelscope.pipelines import pipeline
|
||||
from modelscope.utils.constant import Tasks
|
||||
from tqdm import tqdm
|
||||
|
||||
path_denoise = 'tools/denoise-model/speech_frcrn_ans_cirm_16k'
|
||||
path_denoise = path_denoise if os.path.exists(path_denoise) else "damo/speech_frcrn_ans_cirm_16k"
|
||||
ans = pipeline(Tasks.acoustic_noise_suppression,model=path_denoise)
|
||||
def execute_denoise(input_folder,output_folder):
|
||||
os.makedirs(output_folder,exist_ok=True)
|
||||
# print(input_folder)
|
||||
# print(list(os.listdir(input_folder).sort()))
|
||||
for name in tqdm(os.listdir(input_folder)):
|
||||
ans("%s/%s"%(input_folder,name),output_path='%s/%s'%(output_folder,name))
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-i", "--input_folder", type=str, required=True,
|
||||
help="Path to the folder containing WAV files.")
|
||||
parser.add_argument("-o", "--output_folder", type=str, required=True,
|
||||
help="Output folder to store transcriptions.")
|
||||
parser.add_argument("-p", "--precision", type=str, default='float16', choices=['float16','float32'],
|
||||
help="fp16 or fp32")#还没接入
|
||||
cmd = parser.parse_args()
|
||||
execute_denoise(
|
||||
input_folder = cmd.input_folder,
|
||||
output_folder = cmd.output_folder,
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user